code
stringlengths
38
801k
repo_path
stringlengths
6
263
const std = @import("std"); const parser = @import("parser.zig").Parser; const utils = @import("utils.zig"); const testing = std.testing; /// Template represents a template /// It's a list of tokens and the source template pub const Template = struct { const Self = @This(); decls: []const parser.Decl = &.{}, text: []const u8 = &.{}, pub fn new(comptime input: []const u8) !Self { return Self{ .text = input, .decls = comptime try parser.new(input).parse(), }; } /// render renders a template pub fn render(comptime self: Self, writer: anytype, comptime args: anytype) !void { var last_off: usize = 0; inline for (self.decls) |d| try renderDecl(writer, args, d, &last_off, self.text); try writer.writeAll(self.text[last_off..]); } fn renderDecl(writer: anytype, comptime args: anytype, comptime decl: parser.Decl, last_off: *usize, text: []const u8) !void { switch (decl) { parser.Decl.ident => { try writer.writeAll(text[last_off.*..decl.ident.start]); const v = comptime try utils.getField([]const u8, args, decl.ident.tag.?); try writer.writeAll(v); last_off.* = decl.ident.end; }, parser.Decl.decls => { switch (decl.decls[0]) { parser.Decl.range => { try writer.writeAll(text[last_off.*..decl.decls[0].range.start]); last_off.* = decl.decls[0].range.end; const args2 = @field(args, decl.decls[0].range.tag.?); inline for (args2) |arg2| { var new_off: usize = last_off.*; inline for (decl.decls[1..]) |d| { try renderDecl(writer, arg2, d, &new_off, text); } } last_off.* = decl.decls[decl.decls.len - 1].end.end; }, parser.Decl.cond => { try writer.writeAll(text[last_off.*..decl.decls[0].cond.start]); last_off.* = decl.decls[0].cond.end; if (@field(args, decl.decls[0].cond.tag.?)) inline for (decl.decls[1..]) |d| try renderDecl(writer, args, d, last_off, text); last_off.* = decl.decls[decl.decls.len - 1].end.end; }, else => {}, } }, parser.Decl.end => { try writer.writeAll(text[last_off.*..decl.end.start]); last_off.* = decl.end.end; }, else => {}, } } }; test "parsing" { _ = @import("parser.zig"); _ = @import("utils.zig"); } test "render range" { var out = std.ArrayList(u8).init(std.testing.allocator); defer out.deinit(); { defer out.clearRetainingCapacity(); comptime var t = try Template.new("{{ range .foo }}{{ .bar }}{{ end }}"); try t.render(out.writer(), .{ .foo = .{ &.{ .bar = "hello " }, &.{ .bar = "world" } } }); try utils.expectString("hello world", out.items); } { defer out.clearRetainingCapacity(); comptime var t = try Template.new("{{ range .foo }}{{ range .baz }}{{ .bar }} {{ end }}{{ end }}"); try t.render(out.writer(), .{ .foo = .{ &.{ .baz = .{ &.{ .bar = "Oh" }, &.{ .bar = "hi" }, &.{ .bar = "mark!" }, }, }, &.{ .baz = .{ &.{ .bar = "I did not" }, &.{ .bar = "hit her" }, &.{ .bar = "I did nawt!" }, } } } }); try utils.expectString(out.items, "Oh hi mark! I did not hit her I did nawt! "); } { defer out.clearRetainingCapacity(); comptime var t = try Template.new( \\{{ range .foo }}- {{ .bar }} \\{{ end }} ); try t.render(out.writer(), .{ .foo = .{ &.{ .bar = "a" }, &.{ .bar = "b" }, &.{ .bar = "c" } } }); try utils.expectString( \\- a \\- b \\- c \\ , out.items); } } test "render if" { var out = std.ArrayList(u8).init(std.testing.allocator); defer out.deinit(); { defer out.clearRetainingCapacity(); comptime var t = try Template.new("{{ if .foo }}{{ .bar }}{{ end }}"); try t.render(out.writer(), .{ .foo = true, .bar = "bar123" }); try utils.expectString("bar123", out.items); } { defer out.clearRetainingCapacity(); comptime var t = try Template.new("{{ if .foo }}{{ .bar }}{{ end }}"); try t.render(out.writer(), .{ .foo = false, .bar = "bar123" }); try utils.expectString("", out.items); } } test "render idents" { var out = std.ArrayList(u8).init(std.testing.allocator); defer out.deinit(); { defer out.clearRetainingCapacity(); comptime var t = try Template.new("{{ .foo }}"); try t.render(out.writer(), .{ .foo = "bar123" }); try utils.expectString(out.items, "bar123"); } { defer out.clearRetainingCapacity(); comptime var t = try Template.new(" {{ .foo }} {{ .bar }} {{ .foo }} "); try t.render(out.writer(), .{ .bar = "bar123", .foo = "foo321" }); try utils.expectString(out.items, " foo321 bar123 foo321 "); } { defer out.clearRetainingCapacity(); comptime var t = try Template.new("{{ .foo }} foo between the bars {{ .foo }}"); try t.render(out.writer(), .{ .foo = "bar123" }); try utils.expectString(out.items, "bar123 foo between the bars bar123"); } { defer out.clearRetainingCapacity(); comptime var t = try Template.new("{{ .foo.bar }}"); try t.render(out.writer(), .{ .foo = .{ .bar = "baz" } }); try utils.expectString(out.items, "baz"); } }
src/main.zig
const std = @import("std"); const gpa = std.heap.c_allocator; const u = @import("./index.zig"); // // pub const DepType = enum { system_lib, // std.build.LibExeObjStep.linkSystemLibrary git, // https://git-scm.com/ hg, // https://www.mercurial-scm.org/ http, // https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol pub fn pull(self: DepType, rpath: []const u8, dpath: []const u8) !void { switch (self) { .system_lib => {}, .git => { _ = try u.run_cmd(null, &[_][]const u8{"git", "clone", "--recurse-submodules", rpath, dpath}); }, .hg => { _ = try u.run_cmd(null, &[_][]const u8{"hg", "clone", rpath, dpath}); }, .http => { try u.mkdir_all(dpath); _ = try u.run_cmd(dpath, &[_][]const u8{"wget", rpath}); const f = rpath[std.mem.lastIndexOf(u8, rpath, "/").?+1..]; if (std.mem.endsWith(u8, f, ".zip")) { _ = try u.run_cmd(dpath, &[_][]const u8{"unzip", f, "-d", "."}); } if ( std.mem.endsWith(u8, f, ".tar") or std.mem.endsWith(u8, f, ".tar.gz") or std.mem.endsWith(u8, f, ".tar.xz") or std.mem.endsWith(u8, f, ".tar.zst") ) { _ = try u.run_cmd(dpath, &[_][]const u8{"tar", "-xf", f, "-C", "."}); } }, } } pub fn update(self: DepType, dpath: []const u8, rpath: []const u8) !void { switch (self) { .system_lib => {}, .git => { _ = try u.run_cmd(dpath, &[_][]const u8{"git", "fetch"}); _ = try u.run_cmd(dpath, &[_][]const u8{"git", "pull"}); }, .hg => { _ = try u.run_cmd(dpath, &[_][]const u8{"hg", "pull"}); }, .http => { // }, } } }; pub const GitVersionType = enum { branch, tag, commit, };
src/util/dep_type.zig
const std = @import("std"); const assert = std.debug.assert; const allocator = std.testing.allocator; const DIM = 3; const Vec = struct { v: [DIM]i32, }; const Moon = struct { pos: Vec, vel: Vec, }; pub const Trace = struct { data: std.AutoHashMap(u128, usize), done: bool, pub fn init() Trace { var self = Trace{ .data = std.AutoHashMap(u128, usize).init(allocator), .done = false, }; return self; } pub fn deinit(self: *Trace) void { self.data.deinit(); } }; pub const Map = struct { moons: [10]Moon, pos: usize, trace: [DIM]Trace, pub fn init() Map { var self = Map{ .moons = undefined, .pos = 0, .trace = undefined, }; var dim: usize = 0; while (dim < DIM) : (dim += 1) { self.trace[dim] = Trace.init(); } return self; } pub fn deinit(self: *Map) void { var dim: usize = 0; while (dim < DIM) : (dim += 1) { self.trace[dim].deinit(); } } pub fn add_lines(self: *Map, lines: []const u8) void { var it = std.mem.split(u8, lines, "\n"); while (it.next()) |line| { self.add_line(line); } } pub fn add_line(self: *Map, line: []const u8) void { var itc = std.mem.split(u8, line[1 .. line.len - 1], ", "); while (itc.next()) |str_coord| { var ite = std.mem.split(u8, str_coord, "="); var j: usize = 0; var dim: usize = 99; while (ite.next()) |str_val| : (j += 1) { if (dim == 99) { dim = str_val[0] - 'x'; continue; } const input = std.fmt.parseInt(i32, str_val, 10) catch unreachable; self.moons[self.pos].pos.v[dim] = input; self.moons[self.pos].vel.v[dim] = 0; dim = 99; } } self.pos += 1; } fn step_vel(self: *Map) void { // std.debug.warn("STEP\n"); var j: usize = 0; while (j < self.pos) : (j += 1) { var k: usize = j + 1; while (k < self.pos) : (k += 1) { var dim: usize = 0; while (dim < DIM) : (dim += 1) { if (self.moons[j].pos.v[dim] < self.moons[k].pos.v[dim]) { self.moons[j].vel.v[dim] += 1; self.moons[k].vel.v[dim] -= 1; continue; } if (self.moons[j].pos.v[dim] > self.moons[k].pos.v[dim]) { self.moons[j].vel.v[dim] -= 1; self.moons[k].vel.v[dim] += 1; continue; } } } } } fn step_pos(self: *Map) void { var j: usize = 0; while (j < self.pos) : (j += 1) { var dim: usize = 0; while (dim < DIM) : (dim += 1) { self.moons[j].pos.v[dim] += self.moons[j].vel.v[dim]; } } } pub fn step(self: *Map) void { var dim: usize = 0; while (dim < DIM) : (dim += 1) { _ = self.trace_step(dim); } self.step_vel(); self.step_pos(); } pub fn total_energy(self: Map) usize { var total: usize = 0; var j: usize = 0; while (j < self.pos) : (j += 1) { var potential: usize = 0; var kinetic: usize = 0; var dim: usize = 0; while (dim < DIM) : (dim += 1) { potential += @intCast(usize, std.math.absInt(self.moons[j].pos.v[dim]) catch 0); kinetic += @intCast(usize, std.math.absInt(self.moons[j].vel.v[dim]) catch 0); } total += potential * kinetic; } return total; } pub fn trace_completed(self: *Map) bool { var dim: usize = 0; while (dim < DIM) : (dim += 1) { if (!self.trace[dim].done) { return false; } } return true; } pub fn trace_step(self: *Map, dim: usize) ?usize { const size = self.trace[dim].data.count(); if (self.trace[dim].done) { return size; } var label: u128 = 0; var j: usize = 0; while (j < self.pos) : (j += 1) { label = label * 10000 + @intCast(u128, 10000 - self.moons[j].pos.v[dim]); label = label * 10000 + @intCast(u128, 10000 - self.moons[j].vel.v[dim]); } const pos = size + 1; if (self.trace[dim].data.contains(label)) { self.trace[dim].done = true; // const where = self.trace[dim].data.get(label).?.value; // std.debug.warn("*** FOUND dim {} pos {} label {} => {}\n", dim, pos, label, size); return pos; } else { _ = self.trace[dim].data.put(label, pos) catch unreachable; // std.debug.warn("*** CREATE dim {} pos {} label {}\n", dim, pos, label); return null; } } fn gcd(a: usize, b: usize) usize { var la = a; var lb = b; while (lb != 0) { const t = lb; lb = la % lb; la = t; } return la; } fn compute_cycle_size(self: Map) usize { var p: usize = 1; var dim: usize = 0; while (dim < DIM) : (dim += 1) { const v = self.trace[dim].data.count(); if (dim == 0) { p = v; continue; } const g = gcd(v, p); p *= v / g; } return p; } pub fn find_cycle_size(self: *Map) usize { while (!self.trace_completed()) { self.step(); } return self.compute_cycle_size(); } pub fn show(self: Map) void { std.debug.warn("Map: {} moons\n", self.pos); std.debug.warn("Total energy: {}\n", self.total_energy()); var j: usize = 0; while (j < self.pos) : (j += 1) { std.debug.warn("Moon {}: pos {} {} {}, vel {} {} {}\n", j, self.moons[j].pos.v[0], self.moons[j].pos.v[1], self.moons[j].pos.v[2], self.moons[j].vel.v[0], self.moons[j].vel.v[1], self.moons[j].vel.v[2]); } } }; test "energy aftr 10 steps" { const data: []const u8 = \\<x=-1, y=0, z=2> \\<x=2, y=-10, z=-7> \\<x=4, y=-8, z=8> \\<x=3, y=5, z=-1> ; var map = Map.init(); defer map.deinit(); map.add_lines(data); var j: usize = 0; while (j < 10) : (j += 1) { map.step(); } assert(map.moons[0].pos.v[0] == 2); assert(map.moons[0].pos.v[1] == 1); assert(map.moons[0].pos.v[2] == -3); assert(map.moons[0].vel.v[0] == -3); assert(map.moons[0].vel.v[1] == -2); assert(map.moons[0].vel.v[2] == 1); assert(map.moons[1].pos.v[0] == 1); assert(map.moons[1].pos.v[1] == -8); assert(map.moons[1].pos.v[2] == 0); assert(map.moons[1].vel.v[0] == -1); assert(map.moons[1].vel.v[1] == 1); assert(map.moons[1].vel.v[2] == 3); assert(map.moons[2].pos.v[0] == 3); assert(map.moons[2].pos.v[1] == -6); assert(map.moons[2].pos.v[2] == 1); assert(map.moons[2].vel.v[0] == 3); assert(map.moons[2].vel.v[1] == 2); assert(map.moons[2].vel.v[2] == -3); assert(map.moons[3].pos.v[0] == 2); assert(map.moons[3].pos.v[1] == 0); assert(map.moons[3].pos.v[2] == 4); assert(map.moons[3].vel.v[0] == 1); assert(map.moons[3].vel.v[1] == -1); assert(map.moons[3].vel.v[2] == -1); assert(map.total_energy() == 179); } test "energy aftr 100 steps" { const data: []const u8 = \\<x=-8, y=-10, z=0> \\<x=5, y=5, z=10> \\<x=2, y=-7, z=3> \\<x=9, y=-8, z=-3> ; var map = Map.init(); defer map.deinit(); map.add_lines(data); var j: usize = 0; while (j < 100) : (j += 1) { map.step(); } assert(map.moons[0].pos.v[0] == 8); assert(map.moons[0].pos.v[1] == -12); assert(map.moons[0].pos.v[2] == -9); assert(map.moons[0].vel.v[0] == -7); assert(map.moons[0].vel.v[1] == 3); assert(map.moons[0].vel.v[2] == 0); assert(map.moons[1].pos.v[0] == 13); assert(map.moons[1].pos.v[1] == 16); assert(map.moons[1].pos.v[2] == -3); assert(map.moons[1].vel.v[0] == 3); assert(map.moons[1].vel.v[1] == -11); assert(map.moons[1].vel.v[2] == -5); assert(map.moons[2].pos.v[0] == -29); assert(map.moons[2].pos.v[1] == -11); assert(map.moons[2].pos.v[2] == -1); assert(map.moons[2].vel.v[0] == -3); assert(map.moons[2].vel.v[1] == 7); assert(map.moons[2].vel.v[2] == 4); assert(map.moons[3].pos.v[0] == 16); assert(map.moons[3].pos.v[1] == -13); assert(map.moons[3].pos.v[2] == 23); assert(map.moons[3].vel.v[0] == 7); assert(map.moons[3].vel.v[1] == 1); assert(map.moons[3].vel.v[2] == 1); assert(map.total_energy() == 1940); } test "cycle size small" { const data: []const u8 = \\<x=-1, y=0, z=2> \\<x=2, y=-10, z=-7> \\<x=4, y=-8, z=8> \\<x=3, y=5, z=-1> ; var map = Map.init(); defer map.deinit(); map.add_lines(data); var j: usize = 0; while (j < 2772) : (j += 1) { map.step(); } assert(map.moons[0].pos.v[0] == -1); assert(map.moons[0].pos.v[1] == 0); assert(map.moons[0].pos.v[2] == 2); assert(map.moons[0].vel.v[0] == 0); assert(map.moons[0].vel.v[1] == 0); assert(map.moons[0].vel.v[2] == 0); assert(map.moons[1].pos.v[0] == 2); assert(map.moons[1].pos.v[1] == -10); assert(map.moons[1].pos.v[2] == -7); assert(map.moons[1].vel.v[0] == 0); assert(map.moons[1].vel.v[1] == 0); assert(map.moons[1].vel.v[2] == 0); assert(map.moons[2].pos.v[0] == 4); assert(map.moons[2].pos.v[1] == -8); assert(map.moons[2].pos.v[2] == 8); assert(map.moons[2].vel.v[0] == 0); assert(map.moons[2].vel.v[1] == 0); assert(map.moons[2].vel.v[2] == 0); assert(map.moons[3].pos.v[0] == 3); assert(map.moons[3].pos.v[1] == 5); assert(map.moons[3].pos.v[2] == -1); assert(map.moons[3].vel.v[0] == 0); assert(map.moons[3].vel.v[1] == 0); assert(map.moons[3].vel.v[2] == 0); assert(map.compute_cycle_size() == 2772); } test "cycle size large" { const data: []const u8 = \\<x=-8, y=-10, z=0> \\<x=5, y=5, z=10> \\<x=2, y=-7, z=3> \\<x=9, y=-8, z=-3> ; var map = Map.init(); defer map.deinit(); map.add_lines(data); const result = map.find_cycle_size(); assert(result == 4686774924); }
2019/p12/map.zig
const std = @import("std"); const tools = @import("tools"); const with_trace = true; fn trace(comptime fmt: []const u8, args: anytype) void { if (with_trace) std.debug.print(fmt, args); } const assert = std.debug.assert; pub const main = tools.defaultMain("2021/day12.txt", run); const Room = struct { links: [8]u8 = undefined, nb_links: u8 = 0, is_large: bool = false, }; const Maze = struct { rooms: []Room, names: [][]const u8, start: u8, end: u8, }; fn countRoutes(maze: *const Maze, smallroom_visit_bits: u32, cur_idx: u8, bonus_visit_used: bool) @Vector(2, u32) { if (cur_idx == maze.end) return .{ @boolToInt(!bonus_visit_used), 1 }; const room = &maze.rooms[cur_idx]; if (room.is_large) { var total = @Vector(2, u32){ 0, 0 }; for (room.links[0..room.nb_links]) |ri| { total += countRoutes(maze, smallroom_visit_bits, ri, bonus_visit_used); } return total; } else { const mask = @as(u32, 1) << @intCast(u5, cur_idx); var bonus = bonus_visit_used; if (smallroom_visit_bits & mask != 0) { if (!bonus_visit_used and cur_idx != maze.start and cur_idx != maze.end) { bonus = true; } else { return .{ 0, 0 }; } } var total = @Vector(2, u32){ 0, 0 }; for (room.links[0..room.nb_links]) |ri| { total += countRoutes(maze, (smallroom_visit_bits | mask), ri, bonus); } return total; } } pub fn run(input: []const u8, gpa: std.mem.Allocator) tools.RunError![2][]const u8 { var arena_alloc = std.heap.ArenaAllocator.init(gpa); defer arena_alloc.deinit(); const arena = arena_alloc.allocator(); const maze: Maze = blk: { var room_names = std.StringArrayHashMap(void).init(arena); var rooms = try arena.alloc(Room, 32); std.mem.set(Room, rooms, Room{}); var start: ?u8 = null; var end: ?u8 = null; var it = std.mem.tokenize(u8, input, "\n"); while (it.next()) |line| { if (tools.match_pattern("{}-{}", line)) |val| { const entrya = try room_names.getOrPut(val[0].lit); const entryb = try room_names.getOrPut(val[1].lit); const ia = @intCast(u8, entrya.index); const ib = @intCast(u8, entryb.index); const ra = &rooms[ia]; ra.is_large = (val[0].lit[0] >= 'A' and val[0].lit[0] <= 'Z'); ra.links[ra.nb_links] = @intCast(u8, ib); ra.nb_links += 1; if (std.mem.eql(u8, val[0].lit, "start")) start = ia; if (std.mem.eql(u8, val[0].lit, "end")) end = ia; const rb = &rooms[ib]; rb.is_large = (val[1].lit[0] >= 'A' and val[1].lit[0] <= 'Z'); rb.links[rb.nb_links] = @intCast(u8, ia); rb.nb_links += 1; if (std.mem.eql(u8, val[1].lit, "start")) start = ib; if (std.mem.eql(u8, val[1].lit, "end")) end = ib; } else { std.debug.print("skipping {s}\n", .{line}); } } break :blk Maze{ .rooms = rooms[0..room_names.count()], .names = room_names.keys(), .start = start.?, .end = end.?, }; }; const ans = countRoutes(&maze, 0, maze.start, false); return [_][]const u8{ try std.fmt.allocPrint(gpa, "{}", .{ans[0]}), try std.fmt.allocPrint(gpa, "{}", .{ans[1]}), }; } test { const res0 = try run( \\start-A \\start-b \\A-c \\A-b \\b-d \\A-end \\b-end , std.testing.allocator); defer std.testing.allocator.free(res0[0]); defer std.testing.allocator.free(res0[1]); try std.testing.expectEqualStrings("10", res0[0]); try std.testing.expectEqualStrings("36", res0[1]); const res1 = try run( \\dc-end \\HN-start \\start-kj \\dc-start \\dc-HN \\LN-dc \\HN-end \\kj-sa \\kj-HN \\kj-dc , std.testing.allocator); defer std.testing.allocator.free(res1[0]); defer std.testing.allocator.free(res1[1]); try std.testing.expectEqualStrings("19", res1[0]); try std.testing.expectEqualStrings("103", res1[1]); const res2 = try run( \\fs-end \\he-DX \\fs-he \\start-DX \\pj-DX \\end-zg \\zg-sl \\zg-pj \\pj-he \\RW-he \\fs-DX \\pj-RW \\zg-RW \\start-pj \\he-WI \\zg-he \\pj-fs \\start-RW , std.testing.allocator); defer std.testing.allocator.free(res2[0]); defer std.testing.allocator.free(res2[1]); try std.testing.expectEqualStrings("226", res2[0]); try std.testing.expectEqualStrings("3509", res2[1]); }
2021/day12.zig
const std = @import("std"); pub fn RaxIterator(comptime RaxT: type, comptime StaticSize: usize) type { return struct { tree: *RaxT, data: ?RaxT.ValueT, key: []u8, keyMaxLen: usize, keyStaticBuf: [StaticSize]u8, allocator: *std.mem.Allocator, currentNode: *RaxT.NodeT, stack: RaxT.StackT, nodeFn: ?fn (node: *RaxT.NodeT) void, justSeeked: bool, EOF: bool, safe: bool, const Self = @This(); pub fn init(self: *Self, tree: *RaxT) void { self.* = .{ .tree = tree, .data = null, .key = &self.keyStaticBuf, .keyMaxLen = StaticSize, .keyStaticBuf = undefined, .allocator = tree.allocator, .currentNode = undefined, .stack = undefined, .nodeFn = null, .justSeeked = undefined, .EOF = true, // unseeked iterators return eof .safe = undefined, }; self.key.len = 0; // ignore unset bytes in the static buffer self.stack.init(); } pub fn deinit(self: *Self) void { self.stack.deinit(self.allocator); if (self.key) |k| { if (k.ptr != &self.keyStaticBuf) { self.allocator.free(k); } } } pub const SeekOp = enum { First, Lt, Lte, Eq, Gte, Gt, Last, }; pub fn seek(self: *Self, op: SeekOp, elem: []const u8) !void { // Resetting state self.stack.stack.len = 0; self.justSeeked = true; self.EOF = false; self.key.len = 0; // TODO: we're leaving node to undef. bad idea? if (self.tree.numElements == 0) { self.EOF = true; return; } // Handle first & last switch (op) { .First => { return self.seek(.Gte, &[0]u8{}); }, .Last => { self.currentNode = self.tree.head; try self.seekGreatest(); self.data = self.currentNode.key.?; return; }, else => {}, } const wr = try self.tree.lowWalkStack(elem, &self.stack); self.currentNode = wr.stopNode; const splitPos = wr.splitPos; var i = wr.bytesMatched; const eqCase = op == .Eq or op == .Lte or op == .Gte; const ltCase = op == .Lt or op == .Lte; const gtCase = op == .Gt or op == .Gte; const fullMatch = i == elem.len; const noMidCompressed = self.currentNode.layout != .Compressed or splitPos == 0; if (eqCase and fullMatch and noMidCompressed and self.currentNode.key != null) { try self.addChars(elem); self.data = self.currentNode.key.?; return; } else if (ltCase or gtCase) { // TODO: I strongly suspect this code is unnecessary, as in // it's doing the right thing (copying in self.key all that we // found until now) but it would be much more efficient to // just copy elem[..i] and then start from the last node. // We did match up until i (and the last node in the stack), // did we not? { try self.stack.push(self.allocator, self.currentNode); var j: usize = 1; while (j < self.stack.stack.len) : (j += 1) { const parent = self.stack.stack[j - 1]; const child = self.stack.stack[j]; switch (parent.layout) { .Compressed => |c| { try self.addChars(c.chars); }, .Branching => |branches| { for (branches) |b| { if (b.child == child) { try self.addChars(@as(*const [1]u8, &b.char)); // this needs to be a [1]u8 break; } } }, } } const x = self.stack.pop(); std.debug.warn("3. pop {*}\n", .{x}); } if (i != elem.len and self.currentNode.layout != .Compressed) { // Mismatch in branching node try self.addChars(elem[i..(i + 1)]); self.justSeeked = false; if (ltCase) try self.prevStep(true); if (gtCase) try self.nextStep(true); self.justSeeked = true; } else if (i != elem.len and self.currentNode.layout == .Compressed) { const cData = self.currentNode.layout.Compressed; const nodeChar = cData.chars[splitPos]; const keyChar = elem[i]; self.justSeeked = false; if (gtCase) { if (nodeChar > keyChar) { try self.nextStep(false); } else { try self.addChars(cData.chars); try self.nextStep(true); } } if (ltCase) { if (nodeChar < keyChar) { try self.seekGreatest(); self.data = self.currentNode.key.?; // I think this will panic in Zig, while the C code would // consider it a noop if EOF was set by seekGreatest() } else { try self.addChars(cData.chars); try self.prevStep(true); } } self.justSeeked = true; } else { self.justSeeked = false; if (self.currentNode.layout == .Compressed and self.currentNode.key != null and splitPos != 0 and ltCase) { self.data = self.currentNode.key.?; // Safe because we asserted this as part of the if contiditons } else { if (ltCase) try self.prevStep(false); if (gtCase) try self.nextStep(false); } self.justSeeked = true; } } else { // If we are here just eq was set but no match was found. self.EOF = true; } } pub const OperationResult = union(enum) { EOF, Found: RaxT.ValueT, }; pub fn next(self: *Self) !OperationResult { try self.nextStep(false); if (self.EOF) { return .EOF; } else { return OperationResult{ .Found = self.data.? }; } } pub fn prev() void {} pub fn randomWalk() void {} pub fn compare() void {} fn addChars(self: *Self, s: []const u8) !void { const oldLen = self.key.len; if (oldLen + s.len > self.keyMaxLen) { const newMax = (oldLen + s.len) * 2; if (self.key.ptr == &self.keyStaticBuf) { // still using the static buf self.key = try self.allocator.alloc(u8, newMax); std.mem.copy(u8, self.key, &self.keyStaticBuf); } else { // we were already heap memory self.key = try self.allocator.realloc(self.key, newMax); } self.key.len = oldLen; self.keyMaxLen = newMax; } // Test overlapping assumption. If wrong, need to add copyBackwards { const destPtr = @ptrToInt(self.key.ptr); const srcPtr = @ptrToInt(s.ptr); if (destPtr > srcPtr and (srcPtr + s.len) > destPtr) { @panic("how is s.ptr overlapping this way with dest??"); } } std.mem.copy(u8, self.key.ptr[oldLen..(oldLen + s.len)], s); self.key.len = oldLen + s.len; } fn delChars(self: *Self, n: usize) void { self.key.len -= n; } fn seekGreatest(self: *Self) !void { while (self.currentNode.size() > 0) { const oldNode = self.currentNode; switch (self.currentNode.layout) { .Compressed => |c| { try self.addChars(c.chars); self.currentNode = c.next; }, .Branching => |b| { const lastBranch = b[b.len - 1]; try self.addChars(@as(*const [1]u8, &lastBranch.char)); self.currentNode = lastBranch.child; }, } // We only push after addChars succeded. (might be not important) try self.stack.push(self.allocator, self.currentNode); } } fn nextStep(self: *Self, noupArg: bool) !void { if (self.EOF) return; if (self.justSeeked) { self.justSeeked = false; return; } var noup = noupArg; const origLen = self.key.len; const origStackLen = self.stack.stack.len; const origNode = self.currentNode; while (true) { if (!noup and self.currentNode.size() > 0) { try self.stack.push(self.allocator, self.currentNode); // Move down switch (self.currentNode.layout) { .Compressed => |c| { try self.addChars(c.chars); self.currentNode = c.next; }, .Branching => |b| { const firstBranch = b[0]; try self.addChars(@as(*const [1]u8, &firstBranch.char)); self.currentNode = firstBranch.child; }, } // Call the provided fn, if any. if (self.nodeFn) |f| f(self.currentNode); // Return if we found a key. if (self.currentNode.key) |k| { self.data = k; return; } } else { while (true) { const oldNoup = noup; // Stop when reaching head if (!noup and self.currentNode == self.tree.head) { self.EOF = true; self.stack.stack.len = origStackLen; self.key.len = origLen; self.currentNode = origNode; return; } // TODO: I don't get this const prevChildChar = self.key[self.key.len - 1]; if (!noup) { const old = self.currentNode; self.currentNode = self.stack.pop(); } else { noup = false; } // Delete chars that were discarded by going up. const toDel = switch (self.currentNode.layout) { .Compressed => |c| c.chars.len, .Branching => 1, }; self.delChars(toDel); // Try visiting the next child if there was at least // an additional child if (self.currentNode.layout != .Compressed and self.currentNode.layout.Branching.len > (if (oldNoup) @as(usize, 0) else 1)) { const branches = self.currentNode.layout.Branching; // Find the first child > prev var i: usize = 0; while (i < branches.len) : (i += 1) { if (branches[i].char > prevChildChar) break; } if (i != branches.len) { try self.addChars(@as(*const [1]u8, &branches[i].char)); try self.stack.push(self.allocator, self.currentNode); self.currentNode = branches[i].child; // Call the provided fn, if any. if (self.nodeFn) |f| f(self.currentNode); // Return if we found a key. if (self.currentNode.key) |k| { self.data = k; return; } // Break the inner loop break; } } } } } } fn prevStep(self: *Self, noupArg: bool) !void { if (self.EOF) return; if (self.justSeeked) { self.justSeeked = false; return; } var noup = noupArg; const origLen = self.key.len; const origStackLen = self.stack.stack.len; const origNode = self.currentNode; while (true) { const oldNoup = noup; // Stop when reaching head if (!noup and self.currentNode == self.tree.head) { self.EOF = true; self.stack.stack.len = origStackLen; self.key.len = origLen; self.currentNode = origNode; return; } // TODO: I don't get this const prevChildChar = self.key[self.key.len - 1]; if (!noup) { self.currentNode = self.stack.pop(); std.debug.warn("2. pop {*}\n", .{self.currentNode}); } else { noup = false; } // Delete chars that were discarded by going up. const toDel = switch (self.currentNode.layout) { .Compressed => |c| c.chars.len, .Branching => 1, }; self.delChars(toDel); // Try visiting the next child if there was at least // an additional child if (self.currentNode.layout != .Compressed and self.currentNode.layout.Branching.len > (if (oldNoup) @as(usize, 0) else 1)) { const branches = self.currentNode.layout.Branching; // Find the first child > prev var i: usize = branches.len - 1; while (i > 0) : (i -= 1) { if (branches[i].char > prevChildChar) break; } // If i == 0, then we didn't check the condition in the // above while loop. Need to check now. if (i != 0 or branches[i].char > prevChildChar) { try self.addChars(@as(*const [1]u8, &branches[i].char)); std.debug.warn("3. pushing {*}\n", .{self.currentNode}); try self.stack.push(self.allocator, branches[i].child); self.currentNode = branches[i].child; try self.seekGreatest(); } } // Return if we found a key. if (self.currentNode.key) |k| { self.data = k; return; } } } }; }
src/simple/iterator.zig
const std = @import("std"); const mem = std.mem; const wlr = @import("wlroots"); const xkb = @import("xkbcommon"); const c = @import("../c.zig"); const server = &@import("../main.zig").server; const util = @import("../util.zig"); const Error = @import("../command.zig").Error; const Mapping = @import("../Mapping.zig"); const PointerMapping = @import("../PointerMapping.zig"); const Seat = @import("../Seat.zig"); /// Create a new mapping for a given mode /// /// Example: /// map normal Mod4+Shift Return spawn foot pub fn map( allocator: *std.mem.Allocator, seat: *Seat, args: []const [:0]const u8, out: *?[]const u8, ) Error!void { const optionals = parseOptionalArgs(args[1..]); // offset caused by optional arguments const offset = optionals.i; if (args.len - offset < 5) return Error.NotEnoughArguments; if (optionals.release and optionals.repeat) return Error.ConflictingOptions; const mode_id = try modeNameToId(allocator, seat, args[1 + offset], out); const modifiers = try parseModifiers(allocator, args[2 + offset], out); const keysym = try parseKeysym(allocator, args[3 + offset], out); const mode_mappings = &server.config.modes.items[mode_id].mappings; const new = try Mapping.init(keysym, modifiers, optionals.release, optionals.repeat, args[4 + offset ..]); errdefer new.deinit(); if (mappingExists(mode_mappings, modifiers, keysym, optionals.release)) |current| { mode_mappings.items[current].deinit(); mode_mappings.items[current] = new; } else { // Repeating mappings borrow the Mapping directly. To prevent a // possible crash if the Mapping ArrayList is reallocated, stop any // currently repeating mappings. seat.clearRepeatingMapping(); try mode_mappings.append(new); } } /// Create a new pointer mapping for a given mode /// /// Example: /// map-pointer normal Mod4 BTN_LEFT move-view pub fn mapPointer( allocator: *std.mem.Allocator, seat: *Seat, args: []const [:0]const u8, out: *?[]const u8, ) Error!void { if (args.len < 5) return Error.NotEnoughArguments; if (args.len > 5) return Error.TooManyArguments; const mode_id = try modeNameToId(allocator, seat, args[1], out); const modifiers = try parseModifiers(allocator, args[2], out); const event_code = try parseEventCode(allocator, args[3], out); const action = if (std.mem.eql(u8, args[4], "move-view")) PointerMapping.Action.move else if (std.mem.eql(u8, args[4], "resize-view")) PointerMapping.Action.resize else { out.* = try std.fmt.allocPrint( allocator, "invalid pointer action {s}, must be move-view or resize-view", .{args[4]}, ); return Error.Other; }; const new = PointerMapping{ .event_code = event_code, .modifiers = modifiers, .action = action, }; const mode_pointer_mappings = &server.config.modes.items[mode_id].pointer_mappings; if (pointerMappingExists(mode_pointer_mappings, modifiers, event_code)) |current| { mode_pointer_mappings.items[current] = new; } else { try mode_pointer_mappings.append(new); } } fn modeNameToId(allocator: *std.mem.Allocator, seat: *Seat, mode_name: []const u8, out: *?[]const u8) !usize { const config = &server.config; return config.mode_to_id.get(mode_name) orelse { out.* = try std.fmt.allocPrint( allocator, "cannot add/remove mapping to/from non-existant mode '{s}'", .{mode_name}, ); return Error.Other; }; } /// Returns the index of the Mapping with matching modifiers, keysym and release, if any. fn mappingExists( mappings: *std.ArrayList(Mapping), modifiers: wlr.Keyboard.ModifierMask, keysym: xkb.Keysym, release: bool, ) ?usize { for (mappings.items) |mapping, i| { if (std.meta.eql(mapping.modifiers, modifiers) and mapping.keysym == keysym and mapping.release == release) { return i; } } return null; } /// Returns the index of the PointerMapping with matching modifiers and event code, if any. fn pointerMappingExists( pointer_mappings: *std.ArrayList(PointerMapping), modifiers: wlr.Keyboard.ModifierMask, event_code: u32, ) ?usize { for (pointer_mappings.items) |mapping, i| { if (std.meta.eql(mapping.modifiers, modifiers) and mapping.event_code == event_code) { return i; } } return null; } fn parseEventCode(allocator: *std.mem.Allocator, name: [:0]const u8, out: *?[]const u8) !u32 { const event_code = c.libevdev_event_code_from_name(c.EV_KEY, name); if (event_code < 1) { out.* = try std.fmt.allocPrint(allocator, "unknown button {s}", .{name}); return Error.Other; } return @intCast(u32, event_code); } fn parseKeysym(allocator: *std.mem.Allocator, name: [:0]const u8, out: *?[]const u8) !xkb.Keysym { const keysym = xkb.Keysym.fromName(name, .case_insensitive); if (keysym == .NoSymbol) { out.* = try std.fmt.allocPrint(allocator, "invalid keysym '{s}'", .{name}); return Error.Other; } return keysym; } fn parseModifiers( allocator: *std.mem.Allocator, modifiers_str: []const u8, out: *?[]const u8, ) !wlr.Keyboard.ModifierMask { var it = std.mem.split(modifiers_str, "+"); var modifiers = wlr.Keyboard.ModifierMask{}; outer: while (it.next()) |mod_name| { if (mem.eql(u8, mod_name, "None")) continue; inline for ([_]struct { name: []const u8, field_name: []const u8 }{ .{ .name = "Shift", .field_name = "shift" }, .{ .name = "Lock", .field_name = "caps" }, .{ .name = "Control", .field_name = "ctrl" }, .{ .name = "Mod1", .field_name = "alt" }, .{ .name = "Mod2", .field_name = "mod2" }, .{ .name = "Mod3", .field_name = "mod3" }, .{ .name = "Mod4", .field_name = "logo" }, .{ .name = "Mod5", .field_name = "mod5" }, }) |def| { if (std.mem.eql(u8, def.name, mod_name)) { @field(modifiers, def.field_name) = true; continue :outer; } } out.* = try std.fmt.allocPrint(allocator, "invalid modifier '{s}'", .{mod_name}); return Error.Other; } return modifiers; } const OptionalArgsContainer = struct { i: usize, release: bool, repeat: bool, }; /// Parses optional args (such as -release) and return the index of the first argument that is /// not an optional argument /// Returns an OptionalArgsContainer with the settings set according to the args /// Errors cant occur because it returns as soon as it gets an unknown argument fn parseOptionalArgs(args: []const []const u8) OptionalArgsContainer { // Set to defaults var parsed = OptionalArgsContainer{ // i is the number of arguments consumed .i = 0, .release = false, .repeat = false, }; var i: usize = 0; for (args) |arg| { if (std.mem.eql(u8, arg, "-release")) { parsed.release = true; i += 1; } else if (std.mem.eql(u8, arg, "-repeat")) { parsed.repeat = true; i += 1; } else { // Break if the arg is not an option parsed.i = i; break; } } return parsed; } /// Remove a mapping from a given mode /// /// Example: /// unmap normal Mod4+Shift Return pub fn unmap( allocator: *std.mem.Allocator, seat: *Seat, args: []const [:0]const u8, out: *?[]const u8, ) Error!void { const optionals = parseOptionalArgs(args[1..]); // offset caused by optional arguments const offset = optionals.i; if (args.len - offset < 4) return Error.NotEnoughArguments; const mode_id = try modeNameToId(allocator, seat, args[1 + offset], out); const modifiers = try parseModifiers(allocator, args[2 + offset], out); const keysym = try parseKeysym(allocator, args[3 + offset], out); const mode_mappings = &server.config.modes.items[mode_id].mappings; const mapping_idx = mappingExists(mode_mappings, modifiers, keysym, optionals.release) orelse return; // Repeating mappings borrow the Mapping directly. To prevent a possible // crash if the Mapping ArrayList is reallocated, stop any currently // repeating mappings. seat.clearRepeatingMapping(); var mapping = mode_mappings.swapRemove(mapping_idx); mapping.deinit(); } /// Remove a pointer mapping for a given mode /// /// Example: /// unmap-pointer normal Mod4 BTN_LEFT pub fn unmapPointer( allocator: *std.mem.Allocator, seat: *Seat, args: []const [:0]const u8, out: *?[]const u8, ) Error!void { if (args.len < 4) return Error.NotEnoughArguments; if (args.len > 4) return Error.TooManyArguments; const mode_id = try modeNameToId(allocator, seat, args[1], out); const modifiers = try parseModifiers(allocator, args[2], out); const event_code = try parseEventCode(allocator, args[3], out); const mode_pointer_mappings = &server.config.modes.items[mode_id].pointer_mappings; const mapping_idx = pointerMappingExists(mode_pointer_mappings, modifiers, event_code) orelse return; _ = mode_pointer_mappings.swapRemove(mapping_idx); }
source/river-0.1.0/river/command/map.zig
const std = @import("std"); const powi = std.math.powi; const print = std.debug.print; const split = std.mem.split; const tokenize = std.mem.tokenize; const testing = std.testing; const input = @embedFile("./input.txt"); const pattern_size = 10; const output_size = 4; pub fn main() anyerror!void { print("--- Part One ---\n", .{}); print("Result: {d}\n", .{part1()}); print("--- Part Two ---\n", .{}); print("Result: {d}\n", .{part2()}); } /// /// --- Part One --- /// fn part1() !u32 { var ans: u32 = 0; var input_iter = tokenize(u8, input, "\n"); while (input_iter.next()) |note| { var note_iter = split(u8, note, " | "); _ = note_iter.next(); var output_iter = tokenize(u8, note_iter.next().?, " "); while (output_iter.next()) |out| { if (out.len == 2 or out.len == 3 or out.len == 4 or out.len == 7) { ans += 1; } } } return ans; } test "day08.part1" { @setEvalBranchQuota(300_000); try testing.expectEqual(521, comptime try part1()); } /// /// --- Part Two --- /// fn part2() !u32 { var ans: u32 = 0; var input_iter = tokenize(u8, input, "\n"); while (input_iter.next()) |note| { var note_iter = split(u8, note, " | "); var patterns_iter = tokenize(u8, note_iter.next().?, " "); var masks: [10]u7 = undefined; while (patterns_iter.next()) |pat| { if (pat.len == 2 or pat.len == 3 or pat.len == 4 or pat.len == 7) { masks[pat.len] = makeMask(pat); } } var output_iter = tokenize(u8, note_iter.next().?, " "); var i: u32 = 0; while (output_iter.next()) |out| : (i += 1) { var digit: u32 = switch (out.len) { 2 => 1, 3 => 7, 4 => 4, 5 => matchAFiver(out, &masks), 6 => matchASixer(out, &masks), 7 => 8, else => unreachable, }; ans += digit * try powi(u32, 10, 3 - i); } } return ans; } test "day08.part2" { @setEvalBranchQuota(300_000); try testing.expectEqual(1016804, comptime try part2()); } /// /// makeMask creates a bitset mask for a given pattern /// fn makeMask(pattern: []const u8) u7 { var mask = std.StaticBitSet(7).initEmpty(); for (pattern) |c| { mask.set(c - 'a'); } return mask.mask; } /// /// matchAFiver matches a 5-character pattern and returns the corresponding digit /// fn matchAFiver(fiver: []const u8, masks: []const u7) u32 { var mask: u7 = makeMask(fiver); if (mask & masks[3] == masks[3]) { return 3; } if (mask | masks[3] | masks[4] == masks[7]) { return 2; } return 5; } /// /// matchASixer matches a 6-character pattern and returns the corresponding digit /// fn matchASixer(sixer: []const u8, masks: []const u7) u32 { var mask: u7 = makeMask(sixer); if (mask & masks[4] == masks[4]) { return 9; } if (mask & masks[4] & masks[3] != masks[2]) { return 6; } return 0; }
src/day08/day08.zig
pub const ENTITIES = [_]@import("main.zig").Entity{ .{ .entity = "&AElig", .codepoints = .{ .Single = 198 }, .characters = "\xc3\x86" }, .{ .entity = "&AElig;", .codepoints = .{ .Single = 198 }, .characters = "\xc3\x86" }, .{ .entity = "&AMP", .codepoints = .{ .Single = 38 }, .characters = "&" }, .{ .entity = "&AMP;", .codepoints = .{ .Single = 38 }, .characters = "&" }, .{ .entity = "&Aacute", .codepoints = .{ .Single = 193 }, .characters = "\xc3\x81" }, .{ .entity = "&Aacute;", .codepoints = .{ .Single = 193 }, .characters = "\xc3\x81" }, .{ .entity = "&Abreve;", .codepoints = .{ .Single = 258 }, .characters = "\xc4\x82" }, .{ .entity = "&Acirc", .codepoints = .{ .Single = 194 }, .characters = "\xc3\x82" }, .{ .entity = "&Acirc;", .codepoints = .{ .Single = 194 }, .characters = "\xc3\x82" }, .{ .entity = "&Acy;", .codepoints = .{ .Single = 1040 }, .characters = "\xd0\x90" }, .{ .entity = "&Afr;", .codepoints = .{ .Single = 120068 }, .characters = "\xf0\x9d\x94\x84" }, .{ .entity = "&Agrave", .codepoints = .{ .Single = 192 }, .characters = "\xc3\x80" }, .{ .entity = "&Agrave;", .codepoints = .{ .Single = 192 }, .characters = "\xc3\x80" }, .{ .entity = "&Alpha;", .codepoints = .{ .Single = 913 }, .characters = "\xce\x91" }, .{ .entity = "&Amacr;", .codepoints = .{ .Single = 256 }, .characters = "\xc4\x80" }, .{ .entity = "&And;", .codepoints = .{ .Single = 10835 }, .characters = "\xe2\xa9\x93" }, .{ .entity = "&Aogon;", .codepoints = .{ .Single = 260 }, .characters = "\xc4\x84" }, .{ .entity = "&Aopf;", .codepoints = .{ .Single = 120120 }, .characters = "\xf0\x9d\x94\xb8" }, .{ .entity = "&ApplyFunction;", .codepoints = .{ .Single = 8289 }, .characters = "\xe2\x81\xa1" }, .{ .entity = "&Aring", .codepoints = .{ .Single = 197 }, .characters = "\xc3\x85" }, .{ .entity = "&Aring;", .codepoints = .{ .Single = 197 }, .characters = "\xc3\x85" }, .{ .entity = "&Ascr;", .codepoints = .{ .Single = 119964 }, .characters = "\xf0\x9d\x92\x9c" }, .{ .entity = "&Assign;", .codepoints = .{ .Single = 8788 }, .characters = "\xe2\x89\x94" }, .{ .entity = "&Atilde", .codepoints = .{ .Single = 195 }, .characters = "\xc3\x83" }, .{ .entity = "&Atilde;", .codepoints = .{ .Single = 195 }, .characters = "\xc3\x83" }, .{ .entity = "&Auml", .codepoints = .{ .Single = 196 }, .characters = "\xc3\x84" }, .{ .entity = "&Auml;", .codepoints = .{ .Single = 196 }, .characters = "\xc3\x84" }, .{ .entity = "&Backslash;", .codepoints = .{ .Single = 8726 }, .characters = "\xe2\x88\x96" }, .{ .entity = "&Barv;", .codepoints = .{ .Single = 10983 }, .characters = "\xe2\xab\xa7" }, .{ .entity = "&Barwed;", .codepoints = .{ .Single = 8966 }, .characters = "\xe2\x8c\x86" }, .{ .entity = "&Bcy;", .codepoints = .{ .Single = 1041 }, .characters = "\xd0\x91" }, .{ .entity = "&Because;", .codepoints = .{ .Single = 8757 }, .characters = "\xe2\x88\xb5" }, .{ .entity = "&Bernoullis;", .codepoints = .{ .Single = 8492 }, .characters = "\xe2\x84\xac" }, .{ .entity = "&Beta;", .codepoints = .{ .Single = 914 }, .characters = "\xce\x92" }, .{ .entity = "&Bfr;", .codepoints = .{ .Single = 120069 }, .characters = "\xf0\x9d\x94\x85" }, .{ .entity = "&Bopf;", .codepoints = .{ .Single = 120121 }, .characters = "\xf0\x9d\x94\xb9" }, .{ .entity = "&Breve;", .codepoints = .{ .Single = 728 }, .characters = "\xcb\x98" }, .{ .entity = "&Bscr;", .codepoints = .{ .Single = 8492 }, .characters = "\xe2\x84\xac" }, .{ .entity = "&Bumpeq;", .codepoints = .{ .Single = 8782 }, .characters = "\xe2\x89\x8e" }, .{ .entity = "&CHcy;", .codepoints = .{ .Single = 1063 }, .characters = "\xd0\xa7" }, .{ .entity = "&COPY", .codepoints = .{ .Single = 169 }, .characters = "\xc2\xa9" }, .{ .entity = "&COPY;", .codepoints = .{ .Single = 169 }, .characters = "\xc2\xa9" }, .{ .entity = "&Cacute;", .codepoints = .{ .Single = 262 }, .characters = "\xc4\x86" }, .{ .entity = "&Cap;", .codepoints = .{ .Single = 8914 }, .characters = "\xe2\x8b\x92" }, .{ .entity = "&CapitalDifferentialD;", .codepoints = .{ .Single = 8517 }, .characters = "\xe2\x85\x85" }, .{ .entity = "&Cayleys;", .codepoints = .{ .Single = 8493 }, .characters = "\xe2\x84\xad" }, .{ .entity = "&Ccaron;", .codepoints = .{ .Single = 268 }, .characters = "\xc4\x8c" }, .{ .entity = "&Ccedil", .codepoints = .{ .Single = 199 }, .characters = "\xc3\x87" }, .{ .entity = "&Ccedil;", .codepoints = .{ .Single = 199 }, .characters = "\xc3\x87" }, .{ .entity = "&Ccirc;", .codepoints = .{ .Single = 264 }, .characters = "\xc4\x88" }, .{ .entity = "&Cconint;", .codepoints = .{ .Single = 8752 }, .characters = "\xe2\x88\xb0" }, .{ .entity = "&Cdot;", .codepoints = .{ .Single = 266 }, .characters = "\xc4\x8a" }, .{ .entity = "&Cedilla;", .codepoints = .{ .Single = 184 }, .characters = "\xc2\xb8" }, .{ .entity = "&CenterDot;", .codepoints = .{ .Single = 183 }, .characters = "\xc2\xb7" }, .{ .entity = "&Cfr;", .codepoints = .{ .Single = 8493 }, .characters = "\xe2\x84\xad" }, .{ .entity = "&Chi;", .codepoints = .{ .Single = 935 }, .characters = "\xce\xa7" }, .{ .entity = "&CircleDot;", .codepoints = .{ .Single = 8857 }, .characters = "\xe2\x8a\x99" }, .{ .entity = "&CircleMinus;", .codepoints = .{ .Single = 8854 }, .characters = "\xe2\x8a\x96" }, .{ .entity = "&CirclePlus;", .codepoints = .{ .Single = 8853 }, .characters = "\xe2\x8a\x95" }, .{ .entity = "&CircleTimes;", .codepoints = .{ .Single = 8855 }, .characters = "\xe2\x8a\x97" }, .{ .entity = "&ClockwiseContourIntegral;", .codepoints = .{ .Single = 8754 }, .characters = "\xe2\x88\xb2" }, .{ .entity = "&CloseCurlyDoubleQuote;", .codepoints = .{ .Single = 8221 }, .characters = "\xe2\x80\x9d" }, .{ .entity = "&CloseCurlyQuote;", .codepoints = .{ .Single = 8217 }, .characters = "\xe2\x80\x99" }, .{ .entity = "&Colon;", .codepoints = .{ .Single = 8759 }, .characters = "\xe2\x88\xb7" }, .{ .entity = "&Colone;", .codepoints = .{ .Single = 10868 }, .characters = "\xe2\xa9\xb4" }, .{ .entity = "&Congruent;", .codepoints = .{ .Single = 8801 }, .characters = "\xe2\x89\xa1" }, .{ .entity = "&Conint;", .codepoints = .{ .Single = 8751 }, .characters = "\xe2\x88\xaf" }, .{ .entity = "&ContourIntegral;", .codepoints = .{ .Single = 8750 }, .characters = "\xe2\x88\xae" }, .{ .entity = "&Copf;", .codepoints = .{ .Single = 8450 }, .characters = "\xe2\x84\x82" }, .{ .entity = "&Coproduct;", .codepoints = .{ .Single = 8720 }, .characters = "\xe2\x88\x90" }, .{ .entity = "&CounterClockwiseContourIntegral;", .codepoints = .{ .Single = 8755 }, .characters = "\xe2\x88\xb3" }, .{ .entity = "&Cross;", .codepoints = .{ .Single = 10799 }, .characters = "\xe2\xa8\xaf" }, .{ .entity = "&Cscr;", .codepoints = .{ .Single = 119966 }, .characters = "\xf0\x9d\x92\x9e" }, .{ .entity = "&Cup;", .codepoints = .{ .Single = 8915 }, .characters = "\xe2\x8b\x93" }, .{ .entity = "&CupCap;", .codepoints = .{ .Single = 8781 }, .characters = "\xe2\x89\x8d" }, .{ .entity = "&DD;", .codepoints = .{ .Single = 8517 }, .characters = "\xe2\x85\x85" }, .{ .entity = "&DDotrahd;", .codepoints = .{ .Single = 10513 }, .characters = "\xe2\xa4\x91" }, .{ .entity = "&DJcy;", .codepoints = .{ .Single = 1026 }, .characters = "\xd0\x82" }, .{ .entity = "&DScy;", .codepoints = .{ .Single = 1029 }, .characters = "\xd0\x85" }, .{ .entity = "&DZcy;", .codepoints = .{ .Single = 1039 }, .characters = "\xd0\x8f" }, .{ .entity = "&Dagger;", .codepoints = .{ .Single = 8225 }, .characters = "\xe2\x80\xa1" }, .{ .entity = "&Darr;", .codepoints = .{ .Single = 8609 }, .characters = "\xe2\x86\xa1" }, .{ .entity = "&Dashv;", .codepoints = .{ .Single = 10980 }, .characters = "\xe2\xab\xa4" }, .{ .entity = "&Dcaron;", .codepoints = .{ .Single = 270 }, .characters = "\xc4\x8e" }, .{ .entity = "&Dcy;", .codepoints = .{ .Single = 1044 }, .characters = "\xd0\x94" }, .{ .entity = "&Del;", .codepoints = .{ .Single = 8711 }, .characters = "\xe2\x88\x87" }, .{ .entity = "&Delta;", .codepoints = .{ .Single = 916 }, .characters = "\xce\x94" }, .{ .entity = "&Dfr;", .codepoints = .{ .Single = 120071 }, .characters = "\xf0\x9d\x94\x87" }, .{ .entity = "&DiacriticalAcute;", .codepoints = .{ .Single = 180 }, .characters = "\xc2\xb4" }, .{ .entity = "&DiacriticalDot;", .codepoints = .{ .Single = 729 }, .characters = "\xcb\x99" }, .{ .entity = "&DiacriticalDoubleAcute;", .codepoints = .{ .Single = 733 }, .characters = "\xcb\x9d" }, .{ .entity = "&DiacriticalGrave;", .codepoints = .{ .Single = 96 }, .characters = "`" }, .{ .entity = "&DiacriticalTilde;", .codepoints = .{ .Single = 732 }, .characters = "\xcb\x9c" }, .{ .entity = "&Diamond;", .codepoints = .{ .Single = 8900 }, .characters = "\xe2\x8b\x84" }, .{ .entity = "&DifferentialD;", .codepoints = .{ .Single = 8518 }, .characters = "\xe2\x85\x86" }, .{ .entity = "&Dopf;", .codepoints = .{ .Single = 120123 }, .characters = "\xf0\x9d\x94\xbb" }, .{ .entity = "&Dot;", .codepoints = .{ .Single = 168 }, .characters = "\xc2\xa8" }, .{ .entity = "&DotDot;", .codepoints = .{ .Single = 8412 }, .characters = "\xe2\x83\x9c" }, .{ .entity = "&DotEqual;", .codepoints = .{ .Single = 8784 }, .characters = "\xe2\x89\x90" }, .{ .entity = "&DoubleContourIntegral;", .codepoints = .{ .Single = 8751 }, .characters = "\xe2\x88\xaf" }, .{ .entity = "&DoubleDot;", .codepoints = .{ .Single = 168 }, .characters = "\xc2\xa8" }, .{ .entity = "&DoubleDownArrow;", .codepoints = .{ .Single = 8659 }, .characters = "\xe2\x87\x93" }, .{ .entity = "&DoubleLeftArrow;", .codepoints = .{ .Single = 8656 }, .characters = "\xe2\x87\x90" }, .{ .entity = "&DoubleLeftRightArrow;", .codepoints = .{ .Single = 8660 }, .characters = "\xe2\x87\x94" }, .{ .entity = "&DoubleLeftTee;", .codepoints = .{ .Single = 10980 }, .characters = "\xe2\xab\xa4" }, .{ .entity = "&DoubleLongLeftArrow;", .codepoints = .{ .Single = 10232 }, .characters = "\xe2\x9f\xb8" }, .{ .entity = "&DoubleLongLeftRightArrow;", .codepoints = .{ .Single = 10234 }, .characters = "\xe2\x9f\xba" }, .{ .entity = "&DoubleLongRightArrow;", .codepoints = .{ .Single = 10233 }, .characters = "\xe2\x9f\xb9" }, .{ .entity = "&DoubleRightArrow;", .codepoints = .{ .Single = 8658 }, .characters = "\xe2\x87\x92" }, .{ .entity = "&DoubleRightTee;", .codepoints = .{ .Single = 8872 }, .characters = "\xe2\x8a\xa8" }, .{ .entity = "&DoubleUpArrow;", .codepoints = .{ .Single = 8657 }, .characters = "\xe2\x87\x91" }, .{ .entity = "&DoubleUpDownArrow;", .codepoints = .{ .Single = 8661 }, .characters = "\xe2\x87\x95" }, .{ .entity = "&DoubleVerticalBar;", .codepoints = .{ .Single = 8741 }, .characters = "\xe2\x88\xa5" }, .{ .entity = "&DownArrow;", .codepoints = .{ .Single = 8595 }, .characters = "\xe2\x86\x93" }, .{ .entity = "&DownArrowBar;", .codepoints = .{ .Single = 10515 }, .characters = "\xe2\xa4\x93" }, .{ .entity = "&DownArrowUpArrow;", .codepoints = .{ .Single = 8693 }, .characters = "\xe2\x87\xb5" }, .{ .entity = "&DownBreve;", .codepoints = .{ .Single = 785 }, .characters = "\xcc\x91" }, .{ .entity = "&DownLeftRightVector;", .codepoints = .{ .Single = 10576 }, .characters = "\xe2\xa5\x90" }, .{ .entity = "&DownLeftTeeVector;", .codepoints = .{ .Single = 10590 }, .characters = "\xe2\xa5\x9e" }, .{ .entity = "&DownLeftVector;", .codepoints = .{ .Single = 8637 }, .characters = "\xe2\x86\xbd" }, .{ .entity = "&DownLeftVectorBar;", .codepoints = .{ .Single = 10582 }, .characters = "\xe2\xa5\x96" }, .{ .entity = "&DownRightTeeVector;", .codepoints = .{ .Single = 10591 }, .characters = "\xe2\xa5\x9f" }, .{ .entity = "&DownRightVector;", .codepoints = .{ .Single = 8641 }, .characters = "\xe2\x87\x81" }, .{ .entity = "&DownRightVectorBar;", .codepoints = .{ .Single = 10583 }, .characters = "\xe2\xa5\x97" }, .{ .entity = "&DownTee;", .codepoints = .{ .Single = 8868 }, .characters = "\xe2\x8a\xa4" }, .{ .entity = "&DownTeeArrow;", .codepoints = .{ .Single = 8615 }, .characters = "\xe2\x86\xa7" }, .{ .entity = "&Downarrow;", .codepoints = .{ .Single = 8659 }, .characters = "\xe2\x87\x93" }, .{ .entity = "&Dscr;", .codepoints = .{ .Single = 119967 }, .characters = "\xf0\x9d\x92\x9f" }, .{ .entity = "&Dstrok;", .codepoints = .{ .Single = 272 }, .characters = "\xc4\x90" }, .{ .entity = "&ENG;", .codepoints = .{ .Single = 330 }, .characters = "\xc5\x8a" }, .{ .entity = "&ETH", .codepoints = .{ .Single = 208 }, .characters = "\xc3\x90" }, .{ .entity = "&ETH;", .codepoints = .{ .Single = 208 }, .characters = "\xc3\x90" }, .{ .entity = "&Eacute", .codepoints = .{ .Single = 201 }, .characters = "\xc3\x89" }, .{ .entity = "&Eacute;", .codepoints = .{ .Single = 201 }, .characters = "\xc3\x89" }, .{ .entity = "&Ecaron;", .codepoints = .{ .Single = 282 }, .characters = "\xc4\x9a" }, .{ .entity = "&Ecirc", .codepoints = .{ .Single = 202 }, .characters = "\xc3\x8a" }, .{ .entity = "&Ecirc;", .codepoints = .{ .Single = 202 }, .characters = "\xc3\x8a" }, .{ .entity = "&Ecy;", .codepoints = .{ .Single = 1069 }, .characters = "\xd0\xad" }, .{ .entity = "&Edot;", .codepoints = .{ .Single = 278 }, .characters = "\xc4\x96" }, .{ .entity = "&Efr;", .codepoints = .{ .Single = 120072 }, .characters = "\xf0\x9d\x94\x88" }, .{ .entity = "&Egrave", .codepoints = .{ .Single = 200 }, .characters = "\xc3\x88" }, .{ .entity = "&Egrave;", .codepoints = .{ .Single = 200 }, .characters = "\xc3\x88" }, .{ .entity = "&Element;", .codepoints = .{ .Single = 8712 }, .characters = "\xe2\x88\x88" }, .{ .entity = "&Emacr;", .codepoints = .{ .Single = 274 }, .characters = "\xc4\x92" }, .{ .entity = "&EmptySmallSquare;", .codepoints = .{ .Single = 9723 }, .characters = "\xe2\x97\xbb" }, .{ .entity = "&EmptyVerySmallSquare;", .codepoints = .{ .Single = 9643 }, .characters = "\xe2\x96\xab" }, .{ .entity = "&Eogon;", .codepoints = .{ .Single = 280 }, .characters = "\xc4\x98" }, .{ .entity = "&Eopf;", .codepoints = .{ .Single = 120124 }, .characters = "\xf0\x9d\x94\xbc" }, .{ .entity = "&Epsilon;", .codepoints = .{ .Single = 917 }, .characters = "\xce\x95" }, .{ .entity = "&Equal;", .codepoints = .{ .Single = 10869 }, .characters = "\xe2\xa9\xb5" }, .{ .entity = "&EqualTilde;", .codepoints = .{ .Single = 8770 }, .characters = "\xe2\x89\x82" }, .{ .entity = "&Equilibrium;", .codepoints = .{ .Single = 8652 }, .characters = "\xe2\x87\x8c" }, .{ .entity = "&Escr;", .codepoints = .{ .Single = 8496 }, .characters = "\xe2\x84\xb0" }, .{ .entity = "&Esim;", .codepoints = .{ .Single = 10867 }, .characters = "\xe2\xa9\xb3" }, .{ .entity = "&Eta;", .codepoints = .{ .Single = 919 }, .characters = "\xce\x97" }, .{ .entity = "&Euml", .codepoints = .{ .Single = 203 }, .characters = "\xc3\x8b" }, .{ .entity = "&Euml;", .codepoints = .{ .Single = 203 }, .characters = "\xc3\x8b" }, .{ .entity = "&Exists;", .codepoints = .{ .Single = 8707 }, .characters = "\xe2\x88\x83" }, .{ .entity = "&ExponentialE;", .codepoints = .{ .Single = 8519 }, .characters = "\xe2\x85\x87" }, .{ .entity = "&Fcy;", .codepoints = .{ .Single = 1060 }, .characters = "\xd0\xa4" }, .{ .entity = "&Ffr;", .codepoints = .{ .Single = 120073 }, .characters = "\xf0\x9d\x94\x89" }, .{ .entity = "&FilledSmallSquare;", .codepoints = .{ .Single = 9724 }, .characters = "\xe2\x97\xbc" }, .{ .entity = "&FilledVerySmallSquare;", .codepoints = .{ .Single = 9642 }, .characters = "\xe2\x96\xaa" }, .{ .entity = "&Fopf;", .codepoints = .{ .Single = 120125 }, .characters = "\xf0\x9d\x94\xbd" }, .{ .entity = "&ForAll;", .codepoints = .{ .Single = 8704 }, .characters = "\xe2\x88\x80" }, .{ .entity = "&Fouriertrf;", .codepoints = .{ .Single = 8497 }, .characters = "\xe2\x84\xb1" }, .{ .entity = "&Fscr;", .codepoints = .{ .Single = 8497 }, .characters = "\xe2\x84\xb1" }, .{ .entity = "&GJcy;", .codepoints = .{ .Single = 1027 }, .characters = "\xd0\x83" }, .{ .entity = "&GT", .codepoints = .{ .Single = 62 }, .characters = ">" }, .{ .entity = "&GT;", .codepoints = .{ .Single = 62 }, .characters = ">" }, .{ .entity = "&Gamma;", .codepoints = .{ .Single = 915 }, .characters = "\xce\x93" }, .{ .entity = "&Gammad;", .codepoints = .{ .Single = 988 }, .characters = "\xcf\x9c" }, .{ .entity = "&Gbreve;", .codepoints = .{ .Single = 286 }, .characters = "\xc4\x9e" }, .{ .entity = "&Gcedil;", .codepoints = .{ .Single = 290 }, .characters = "\xc4\xa2" }, .{ .entity = "&Gcirc;", .codepoints = .{ .Single = 284 }, .characters = "\xc4\x9c" }, .{ .entity = "&Gcy;", .codepoints = .{ .Single = 1043 }, .characters = "\xd0\x93" }, .{ .entity = "&Gdot;", .codepoints = .{ .Single = 288 }, .characters = "\xc4\xa0" }, .{ .entity = "&Gfr;", .codepoints = .{ .Single = 120074 }, .characters = "\xf0\x9d\x94\x8a" }, .{ .entity = "&Gg;", .codepoints = .{ .Single = 8921 }, .characters = "\xe2\x8b\x99" }, .{ .entity = "&Gopf;", .codepoints = .{ .Single = 120126 }, .characters = "\xf0\x9d\x94\xbe" }, .{ .entity = "&GreaterEqual;", .codepoints = .{ .Single = 8805 }, .characters = "\xe2\x89\xa5" }, .{ .entity = "&GreaterEqualLess;", .codepoints = .{ .Single = 8923 }, .characters = "\xe2\x8b\x9b" }, .{ .entity = "&GreaterFullEqual;", .codepoints = .{ .Single = 8807 }, .characters = "\xe2\x89\xa7" }, .{ .entity = "&GreaterGreater;", .codepoints = .{ .Single = 10914 }, .characters = "\xe2\xaa\xa2" }, .{ .entity = "&GreaterLess;", .codepoints = .{ .Single = 8823 }, .characters = "\xe2\x89\xb7" }, .{ .entity = "&GreaterSlantEqual;", .codepoints = .{ .Single = 10878 }, .characters = "\xe2\xa9\xbe" }, .{ .entity = "&GreaterTilde;", .codepoints = .{ .Single = 8819 }, .characters = "\xe2\x89\xb3" }, .{ .entity = "&Gscr;", .codepoints = .{ .Single = 119970 }, .characters = "\xf0\x9d\x92\xa2" }, .{ .entity = "&Gt;", .codepoints = .{ .Single = 8811 }, .characters = "\xe2\x89\xab" }, .{ .entity = "&HARDcy;", .codepoints = .{ .Single = 1066 }, .characters = "\xd0\xaa" }, .{ .entity = "&Hacek;", .codepoints = .{ .Single = 711 }, .characters = "\xcb\x87" }, .{ .entity = "&Hat;", .codepoints = .{ .Single = 94 }, .characters = "^" }, .{ .entity = "&Hcirc;", .codepoints = .{ .Single = 292 }, .characters = "\xc4\xa4" }, .{ .entity = "&Hfr;", .codepoints = .{ .Single = 8460 }, .characters = "\xe2\x84\x8c" }, .{ .entity = "&HilbertSpace;", .codepoints = .{ .Single = 8459 }, .characters = "\xe2\x84\x8b" }, .{ .entity = "&Hopf;", .codepoints = .{ .Single = 8461 }, .characters = "\xe2\x84\x8d" }, .{ .entity = "&HorizontalLine;", .codepoints = .{ .Single = 9472 }, .characters = "\xe2\x94\x80" }, .{ .entity = "&Hscr;", .codepoints = .{ .Single = 8459 }, .characters = "\xe2\x84\x8b" }, .{ .entity = "&Hstrok;", .codepoints = .{ .Single = 294 }, .characters = "\xc4\xa6" }, .{ .entity = "&HumpDownHump;", .codepoints = .{ .Single = 8782 }, .characters = "\xe2\x89\x8e" }, .{ .entity = "&HumpEqual;", .codepoints = .{ .Single = 8783 }, .characters = "\xe2\x89\x8f" }, .{ .entity = "&IEcy;", .codepoints = .{ .Single = 1045 }, .characters = "\xd0\x95" }, .{ .entity = "&IJlig;", .codepoints = .{ .Single = 306 }, .characters = "\xc4\xb2" }, .{ .entity = "&IOcy;", .codepoints = .{ .Single = 1025 }, .characters = "\xd0\x81" }, .{ .entity = "&Iacute", .codepoints = .{ .Single = 205 }, .characters = "\xc3\x8d" }, .{ .entity = "&Iacute;", .codepoints = .{ .Single = 205 }, .characters = "\xc3\x8d" }, .{ .entity = "&Icirc", .codepoints = .{ .Single = 206 }, .characters = "\xc3\x8e" }, .{ .entity = "&Icirc;", .codepoints = .{ .Single = 206 }, .characters = "\xc3\x8e" }, .{ .entity = "&Icy;", .codepoints = .{ .Single = 1048 }, .characters = "\xd0\x98" }, .{ .entity = "&Idot;", .codepoints = .{ .Single = 304 }, .characters = "\xc4\xb0" }, .{ .entity = "&Ifr;", .codepoints = .{ .Single = 8465 }, .characters = "\xe2\x84\x91" }, .{ .entity = "&Igrave", .codepoints = .{ .Single = 204 }, .characters = "\xc3\x8c" }, .{ .entity = "&Igrave;", .codepoints = .{ .Single = 204 }, .characters = "\xc3\x8c" }, .{ .entity = "&Im;", .codepoints = .{ .Single = 8465 }, .characters = "\xe2\x84\x91" }, .{ .entity = "&Imacr;", .codepoints = .{ .Single = 298 }, .characters = "\xc4\xaa" }, .{ .entity = "&ImaginaryI;", .codepoints = .{ .Single = 8520 }, .characters = "\xe2\x85\x88" }, .{ .entity = "&Implies;", .codepoints = .{ .Single = 8658 }, .characters = "\xe2\x87\x92" }, .{ .entity = "&Int;", .codepoints = .{ .Single = 8748 }, .characters = "\xe2\x88\xac" }, .{ .entity = "&Integral;", .codepoints = .{ .Single = 8747 }, .characters = "\xe2\x88\xab" }, .{ .entity = "&Intersection;", .codepoints = .{ .Single = 8898 }, .characters = "\xe2\x8b\x82" }, .{ .entity = "&InvisibleComma;", .codepoints = .{ .Single = 8291 }, .characters = "\xe2\x81\xa3" }, .{ .entity = "&InvisibleTimes;", .codepoints = .{ .Single = 8290 }, .characters = "\xe2\x81\xa2" }, .{ .entity = "&Iogon;", .codepoints = .{ .Single = 302 }, .characters = "\xc4\xae" }, .{ .entity = "&Iopf;", .codepoints = .{ .Single = 120128 }, .characters = "\xf0\x9d\x95\x80" }, .{ .entity = "&Iota;", .codepoints = .{ .Single = 921 }, .characters = "\xce\x99" }, .{ .entity = "&Iscr;", .codepoints = .{ .Single = 8464 }, .characters = "\xe2\x84\x90" }, .{ .entity = "&Itilde;", .codepoints = .{ .Single = 296 }, .characters = "\xc4\xa8" }, .{ .entity = "&Iukcy;", .codepoints = .{ .Single = 1030 }, .characters = "\xd0\x86" }, .{ .entity = "&Iuml", .codepoints = .{ .Single = 207 }, .characters = "\xc3\x8f" }, .{ .entity = "&Iuml;", .codepoints = .{ .Single = 207 }, .characters = "\xc3\x8f" }, .{ .entity = "&Jcirc;", .codepoints = .{ .Single = 308 }, .characters = "\xc4\xb4" }, .{ .entity = "&Jcy;", .codepoints = .{ .Single = 1049 }, .characters = "\xd0\x99" }, .{ .entity = "&Jfr;", .codepoints = .{ .Single = 120077 }, .characters = "\xf0\x9d\x94\x8d" }, .{ .entity = "&Jopf;", .codepoints = .{ .Single = 120129 }, .characters = "\xf0\x9d\x95\x81" }, .{ .entity = "&Jscr;", .codepoints = .{ .Single = 119973 }, .characters = "\xf0\x9d\x92\xa5" }, .{ .entity = "&Jsercy;", .codepoints = .{ .Single = 1032 }, .characters = "\xd0\x88" }, .{ .entity = "&Jukcy;", .codepoints = .{ .Single = 1028 }, .characters = "\xd0\x84" }, .{ .entity = "&KHcy;", .codepoints = .{ .Single = 1061 }, .characters = "\xd0\xa5" }, .{ .entity = "&KJcy;", .codepoints = .{ .Single = 1036 }, .characters = "\xd0\x8c" }, .{ .entity = "&Kappa;", .codepoints = .{ .Single = 922 }, .characters = "\xce\x9a" }, .{ .entity = "&Kcedil;", .codepoints = .{ .Single = 310 }, .characters = "\xc4\xb6" }, .{ .entity = "&Kcy;", .codepoints = .{ .Single = 1050 }, .characters = "\xd0\x9a" }, .{ .entity = "&Kfr;", .codepoints = .{ .Single = 120078 }, .characters = "\xf0\x9d\x94\x8e" }, .{ .entity = "&Kopf;", .codepoints = .{ .Single = 120130 }, .characters = "\xf0\x9d\x95\x82" }, .{ .entity = "&Kscr;", .codepoints = .{ .Single = 119974 }, .characters = "\xf0\x9d\x92\xa6" }, .{ .entity = "&LJcy;", .codepoints = .{ .Single = 1033 }, .characters = "\xd0\x89" }, .{ .entity = "&LT", .codepoints = .{ .Single = 60 }, .characters = "<" }, .{ .entity = "&LT;", .codepoints = .{ .Single = 60 }, .characters = "<" }, .{ .entity = "&Lacute;", .codepoints = .{ .Single = 313 }, .characters = "\xc4\xb9" }, .{ .entity = "&Lambda;", .codepoints = .{ .Single = 923 }, .characters = "\xce\x9b" }, .{ .entity = "&Lang;", .codepoints = .{ .Single = 10218 }, .characters = "\xe2\x9f\xaa" }, .{ .entity = "&Laplacetrf;", .codepoints = .{ .Single = 8466 }, .characters = "\xe2\x84\x92" }, .{ .entity = "&Larr;", .codepoints = .{ .Single = 8606 }, .characters = "\xe2\x86\x9e" }, .{ .entity = "&Lcaron;", .codepoints = .{ .Single = 317 }, .characters = "\xc4\xbd" }, .{ .entity = "&Lcedil;", .codepoints = .{ .Single = 315 }, .characters = "\xc4\xbb" }, .{ .entity = "&Lcy;", .codepoints = .{ .Single = 1051 }, .characters = "\xd0\x9b" }, .{ .entity = "&LeftAngleBracket;", .codepoints = .{ .Single = 10216 }, .characters = "\xe2\x9f\xa8" }, .{ .entity = "&LeftArrow;", .codepoints = .{ .Single = 8592 }, .characters = "\xe2\x86\x90" }, .{ .entity = "&LeftArrowBar;", .codepoints = .{ .Single = 8676 }, .characters = "\xe2\x87\xa4" }, .{ .entity = "&LeftArrowRightArrow;", .codepoints = .{ .Single = 8646 }, .characters = "\xe2\x87\x86" }, .{ .entity = "&LeftCeiling;", .codepoints = .{ .Single = 8968 }, .characters = "\xe2\x8c\x88" }, .{ .entity = "&LeftDoubleBracket;", .codepoints = .{ .Single = 10214 }, .characters = "\xe2\x9f\xa6" }, .{ .entity = "&LeftDownTeeVector;", .codepoints = .{ .Single = 10593 }, .characters = "\xe2\xa5\xa1" }, .{ .entity = "&LeftDownVector;", .codepoints = .{ .Single = 8643 }, .characters = "\xe2\x87\x83" }, .{ .entity = "&LeftDownVectorBar;", .codepoints = .{ .Single = 10585 }, .characters = "\xe2\xa5\x99" }, .{ .entity = "&LeftFloor;", .codepoints = .{ .Single = 8970 }, .characters = "\xe2\x8c\x8a" }, .{ .entity = "&LeftRightArrow;", .codepoints = .{ .Single = 8596 }, .characters = "\xe2\x86\x94" }, .{ .entity = "&LeftRightVector;", .codepoints = .{ .Single = 10574 }, .characters = "\xe2\xa5\x8e" }, .{ .entity = "&LeftTee;", .codepoints = .{ .Single = 8867 }, .characters = "\xe2\x8a\xa3" }, .{ .entity = "&LeftTeeArrow;", .codepoints = .{ .Single = 8612 }, .characters = "\xe2\x86\xa4" }, .{ .entity = "&LeftTeeVector;", .codepoints = .{ .Single = 10586 }, .characters = "\xe2\xa5\x9a" }, .{ .entity = "&LeftTriangle;", .codepoints = .{ .Single = 8882 }, .characters = "\xe2\x8a\xb2" }, .{ .entity = "&LeftTriangleBar;", .codepoints = .{ .Single = 10703 }, .characters = "\xe2\xa7\x8f" }, .{ .entity = "&LeftTriangleEqual;", .codepoints = .{ .Single = 8884 }, .characters = "\xe2\x8a\xb4" }, .{ .entity = "&LeftUpDownVector;", .codepoints = .{ .Single = 10577 }, .characters = "\xe2\xa5\x91" }, .{ .entity = "&LeftUpTeeVector;", .codepoints = .{ .Single = 10592 }, .characters = "\xe2\xa5\xa0" }, .{ .entity = "&LeftUpVector;", .codepoints = .{ .Single = 8639 }, .characters = "\xe2\x86\xbf" }, .{ .entity = "&LeftUpVectorBar;", .codepoints = .{ .Single = 10584 }, .characters = "\xe2\xa5\x98" }, .{ .entity = "&LeftVector;", .codepoints = .{ .Single = 8636 }, .characters = "\xe2\x86\xbc" }, .{ .entity = "&LeftVectorBar;", .codepoints = .{ .Single = 10578 }, .characters = "\xe2\xa5\x92" }, .{ .entity = "&Leftarrow;", .codepoints = .{ .Single = 8656 }, .characters = "\xe2\x87\x90" }, .{ .entity = "&Leftrightarrow;", .codepoints = .{ .Single = 8660 }, .characters = "\xe2\x87\x94" }, .{ .entity = "&LessEqualGreater;", .codepoints = .{ .Single = 8922 }, .characters = "\xe2\x8b\x9a" }, .{ .entity = "&LessFullEqual;", .codepoints = .{ .Single = 8806 }, .characters = "\xe2\x89\xa6" }, .{ .entity = "&LessGreater;", .codepoints = .{ .Single = 8822 }, .characters = "\xe2\x89\xb6" }, .{ .entity = "&LessLess;", .codepoints = .{ .Single = 10913 }, .characters = "\xe2\xaa\xa1" }, .{ .entity = "&LessSlantEqual;", .codepoints = .{ .Single = 10877 }, .characters = "\xe2\xa9\xbd" }, .{ .entity = "&LessTilde;", .codepoints = .{ .Single = 8818 }, .characters = "\xe2\x89\xb2" }, .{ .entity = "&Lfr;", .codepoints = .{ .Single = 120079 }, .characters = "\xf0\x9d\x94\x8f" }, .{ .entity = "&Ll;", .codepoints = .{ .Single = 8920 }, .characters = "\xe2\x8b\x98" }, .{ .entity = "&Lleftarrow;", .codepoints = .{ .Single = 8666 }, .characters = "\xe2\x87\x9a" }, .{ .entity = "&Lmidot;", .codepoints = .{ .Single = 319 }, .characters = "\xc4\xbf" }, .{ .entity = "&LongLeftArrow;", .codepoints = .{ .Single = 10229 }, .characters = "\xe2\x9f\xb5" }, .{ .entity = "&LongLeftRightArrow;", .codepoints = .{ .Single = 10231 }, .characters = "\xe2\x9f\xb7" }, .{ .entity = "&LongRightArrow;", .codepoints = .{ .Single = 10230 }, .characters = "\xe2\x9f\xb6" }, .{ .entity = "&Longleftarrow;", .codepoints = .{ .Single = 10232 }, .characters = "\xe2\x9f\xb8" }, .{ .entity = "&Longleftrightarrow;", .codepoints = .{ .Single = 10234 }, .characters = "\xe2\x9f\xba" }, .{ .entity = "&Longrightarrow;", .codepoints = .{ .Single = 10233 }, .characters = "\xe2\x9f\xb9" }, .{ .entity = "&Lopf;", .codepoints = .{ .Single = 120131 }, .characters = "\xf0\x9d\x95\x83" }, .{ .entity = "&LowerLeftArrow;", .codepoints = .{ .Single = 8601 }, .characters = "\xe2\x86\x99" }, .{ .entity = "&LowerRightArrow;", .codepoints = .{ .Single = 8600 }, .characters = "\xe2\x86\x98" }, .{ .entity = "&Lscr;", .codepoints = .{ .Single = 8466 }, .characters = "\xe2\x84\x92" }, .{ .entity = "&Lsh;", .codepoints = .{ .Single = 8624 }, .characters = "\xe2\x86\xb0" }, .{ .entity = "&Lstrok;", .codepoints = .{ .Single = 321 }, .characters = "\xc5\x81" }, .{ .entity = "&Lt;", .codepoints = .{ .Single = 8810 }, .characters = "\xe2\x89\xaa" }, .{ .entity = "&Map;", .codepoints = .{ .Single = 10501 }, .characters = "\xe2\xa4\x85" }, .{ .entity = "&Mcy;", .codepoints = .{ .Single = 1052 }, .characters = "\xd0\x9c" }, .{ .entity = "&MediumSpace;", .codepoints = .{ .Single = 8287 }, .characters = "\xe2\x81\x9f" }, .{ .entity = "&Mellintrf;", .codepoints = .{ .Single = 8499 }, .characters = "\xe2\x84\xb3" }, .{ .entity = "&Mfr;", .codepoints = .{ .Single = 120080 }, .characters = "\xf0\x9d\x94\x90" }, .{ .entity = "&MinusPlus;", .codepoints = .{ .Single = 8723 }, .characters = "\xe2\x88\x93" }, .{ .entity = "&Mopf;", .codepoints = .{ .Single = 120132 }, .characters = "\xf0\x9d\x95\x84" }, .{ .entity = "&Mscr;", .codepoints = .{ .Single = 8499 }, .characters = "\xe2\x84\xb3" }, .{ .entity = "&Mu;", .codepoints = .{ .Single = 924 }, .characters = "\xce\x9c" }, .{ .entity = "&NJcy;", .codepoints = .{ .Single = 1034 }, .characters = "\xd0\x8a" }, .{ .entity = "&Nacute;", .codepoints = .{ .Single = 323 }, .characters = "\xc5\x83" }, .{ .entity = "&Ncaron;", .codepoints = .{ .Single = 327 }, .characters = "\xc5\x87" }, .{ .entity = "&Ncedil;", .codepoints = .{ .Single = 325 }, .characters = "\xc5\x85" }, .{ .entity = "&Ncy;", .codepoints = .{ .Single = 1053 }, .characters = "\xd0\x9d" }, .{ .entity = "&NegativeMediumSpace;", .codepoints = .{ .Single = 8203 }, .characters = "\xe2\x80\x8b" }, .{ .entity = "&NegativeThickSpace;", .codepoints = .{ .Single = 8203 }, .characters = "\xe2\x80\x8b" }, .{ .entity = "&NegativeThinSpace;", .codepoints = .{ .Single = 8203 }, .characters = "\xe2\x80\x8b" }, .{ .entity = "&NegativeVeryThinSpace;", .codepoints = .{ .Single = 8203 }, .characters = "\xe2\x80\x8b" }, .{ .entity = "&NestedGreaterGreater;", .codepoints = .{ .Single = 8811 }, .characters = "\xe2\x89\xab" }, .{ .entity = "&NestedLessLess;", .codepoints = .{ .Single = 8810 }, .characters = "\xe2\x89\xaa" }, .{ .entity = "&NewLine;", .codepoints = .{ .Single = 10 }, .characters = "\n" }, .{ .entity = "&Nfr;", .codepoints = .{ .Single = 120081 }, .characters = "\xf0\x9d\x94\x91" }, .{ .entity = "&NoBreak;", .codepoints = .{ .Single = 8288 }, .characters = "\xe2\x81\xa0" }, .{ .entity = "&NonBreakingSpace;", .codepoints = .{ .Single = 160 }, .characters = "\xc2\xa0" }, .{ .entity = "&Nopf;", .codepoints = .{ .Single = 8469 }, .characters = "\xe2\x84\x95" }, .{ .entity = "&Not;", .codepoints = .{ .Single = 10988 }, .characters = "\xe2\xab\xac" }, .{ .entity = "&NotCongruent;", .codepoints = .{ .Single = 8802 }, .characters = "\xe2\x89\xa2" }, .{ .entity = "&NotCupCap;", .codepoints = .{ .Single = 8813 }, .characters = "\xe2\x89\xad" }, .{ .entity = "&NotDoubleVerticalBar;", .codepoints = .{ .Single = 8742 }, .characters = "\xe2\x88\xa6" }, .{ .entity = "&NotElement;", .codepoints = .{ .Single = 8713 }, .characters = "\xe2\x88\x89" }, .{ .entity = "&NotEqual;", .codepoints = .{ .Single = 8800 }, .characters = "\xe2\x89\xa0" }, .{ .entity = "&NotEqualTilde;", .codepoints = .{ .Double = [2]u32{ 8770, 824 } }, .characters = "\xe2\x89\x82\xcc\xb8" }, .{ .entity = "&NotExists;", .codepoints = .{ .Single = 8708 }, .characters = "\xe2\x88\x84" }, .{ .entity = "&NotGreater;", .codepoints = .{ .Single = 8815 }, .characters = "\xe2\x89\xaf" }, .{ .entity = "&NotGreaterEqual;", .codepoints = .{ .Single = 8817 }, .characters = "\xe2\x89\xb1" }, .{ .entity = "&NotGreaterFullEqual;", .codepoints = .{ .Double = [2]u32{ 8807, 824 } }, .characters = "\xe2\x89\xa7\xcc\xb8" }, .{ .entity = "&NotGreaterGreater;", .codepoints = .{ .Double = [2]u32{ 8811, 824 } }, .characters = "\xe2\x89\xab\xcc\xb8" }, .{ .entity = "&NotGreaterLess;", .codepoints = .{ .Single = 8825 }, .characters = "\xe2\x89\xb9" }, .{ .entity = "&NotGreaterSlantEqual;", .codepoints = .{ .Double = [2]u32{ 10878, 824 } }, .characters = "\xe2\xa9\xbe\xcc\xb8" }, .{ .entity = "&NotGreaterTilde;", .codepoints = .{ .Single = 8821 }, .characters = "\xe2\x89\xb5" }, .{ .entity = "&NotHumpDownHump;", .codepoints = .{ .Double = [2]u32{ 8782, 824 } }, .characters = "\xe2\x89\x8e\xcc\xb8" }, .{ .entity = "&NotHumpEqual;", .codepoints = .{ .Double = [2]u32{ 8783, 824 } }, .characters = "\xe2\x89\x8f\xcc\xb8" }, .{ .entity = "&NotLeftTriangle;", .codepoints = .{ .Single = 8938 }, .characters = "\xe2\x8b\xaa" }, .{ .entity = "&NotLeftTriangleBar;", .codepoints = .{ .Double = [2]u32{ 10703, 824 } }, .characters = "\xe2\xa7\x8f\xcc\xb8" }, .{ .entity = "&NotLeftTriangleEqual;", .codepoints = .{ .Single = 8940 }, .characters = "\xe2\x8b\xac" }, .{ .entity = "&NotLess;", .codepoints = .{ .Single = 8814 }, .characters = "\xe2\x89\xae" }, .{ .entity = "&NotLessEqual;", .codepoints = .{ .Single = 8816 }, .characters = "\xe2\x89\xb0" }, .{ .entity = "&NotLessGreater;", .codepoints = .{ .Single = 8824 }, .characters = "\xe2\x89\xb8" }, .{ .entity = "&NotLessLess;", .codepoints = .{ .Double = [2]u32{ 8810, 824 } }, .characters = "\xe2\x89\xaa\xcc\xb8" }, .{ .entity = "&NotLessSlantEqual;", .codepoints = .{ .Double = [2]u32{ 10877, 824 } }, .characters = "\xe2\xa9\xbd\xcc\xb8" }, .{ .entity = "&NotLessTilde;", .codepoints = .{ .Single = 8820 }, .characters = "\xe2\x89\xb4" }, .{ .entity = "&NotNestedGreaterGreater;", .codepoints = .{ .Double = [2]u32{ 10914, 824 } }, .characters = "\xe2\xaa\xa2\xcc\xb8" }, .{ .entity = "&NotNestedLessLess;", .codepoints = .{ .Double = [2]u32{ 10913, 824 } }, .characters = "\xe2\xaa\xa1\xcc\xb8" }, .{ .entity = "&NotPrecedes;", .codepoints = .{ .Single = 8832 }, .characters = "\xe2\x8a\x80" }, .{ .entity = "&NotPrecedesEqual;", .codepoints = .{ .Double = [2]u32{ 10927, 824 } }, .characters = "\xe2\xaa\xaf\xcc\xb8" }, .{ .entity = "&NotPrecedesSlantEqual;", .codepoints = .{ .Single = 8928 }, .characters = "\xe2\x8b\xa0" }, .{ .entity = "&NotReverseElement;", .codepoints = .{ .Single = 8716 }, .characters = "\xe2\x88\x8c" }, .{ .entity = "&NotRightTriangle;", .codepoints = .{ .Single = 8939 }, .characters = "\xe2\x8b\xab" }, .{ .entity = "&NotRightTriangleBar;", .codepoints = .{ .Double = [2]u32{ 10704, 824 } }, .characters = "\xe2\xa7\x90\xcc\xb8" }, .{ .entity = "&NotRightTriangleEqual;", .codepoints = .{ .Single = 8941 }, .characters = "\xe2\x8b\xad" }, .{ .entity = "&NotSquareSubset;", .codepoints = .{ .Double = [2]u32{ 8847, 824 } }, .characters = "\xe2\x8a\x8f\xcc\xb8" }, .{ .entity = "&NotSquareSubsetEqual;", .codepoints = .{ .Single = 8930 }, .characters = "\xe2\x8b\xa2" }, .{ .entity = "&NotSquareSuperset;", .codepoints = .{ .Double = [2]u32{ 8848, 824 } }, .characters = "\xe2\x8a\x90\xcc\xb8" }, .{ .entity = "&NotSquareSupersetEqual;", .codepoints = .{ .Single = 8931 }, .characters = "\xe2\x8b\xa3" }, .{ .entity = "&NotSubset;", .codepoints = .{ .Double = [2]u32{ 8834, 8402 } }, .characters = "\xe2\x8a\x82\xe2\x83\x92" }, .{ .entity = "&NotSubsetEqual;", .codepoints = .{ .Single = 8840 }, .characters = "\xe2\x8a\x88" }, .{ .entity = "&NotSucceeds;", .codepoints = .{ .Single = 8833 }, .characters = "\xe2\x8a\x81" }, .{ .entity = "&NotSucceedsEqual;", .codepoints = .{ .Double = [2]u32{ 10928, 824 } }, .characters = "\xe2\xaa\xb0\xcc\xb8" }, .{ .entity = "&NotSucceedsSlantEqual;", .codepoints = .{ .Single = 8929 }, .characters = "\xe2\x8b\xa1" }, .{ .entity = "&NotSucceedsTilde;", .codepoints = .{ .Double = [2]u32{ 8831, 824 } }, .characters = "\xe2\x89\xbf\xcc\xb8" }, .{ .entity = "&NotSuperset;", .codepoints = .{ .Double = [2]u32{ 8835, 8402 } }, .characters = "\xe2\x8a\x83\xe2\x83\x92" }, .{ .entity = "&NotSupersetEqual;", .codepoints = .{ .Single = 8841 }, .characters = "\xe2\x8a\x89" }, .{ .entity = "&NotTilde;", .codepoints = .{ .Single = 8769 }, .characters = "\xe2\x89\x81" }, .{ .entity = "&NotTildeEqual;", .codepoints = .{ .Single = 8772 }, .characters = "\xe2\x89\x84" }, .{ .entity = "&NotTildeFullEqual;", .codepoints = .{ .Single = 8775 }, .characters = "\xe2\x89\x87" }, .{ .entity = "&NotTildeTilde;", .codepoints = .{ .Single = 8777 }, .characters = "\xe2\x89\x89" }, .{ .entity = "&NotVerticalBar;", .codepoints = .{ .Single = 8740 }, .characters = "\xe2\x88\xa4" }, .{ .entity = "&Nscr;", .codepoints = .{ .Single = 119977 }, .characters = "\xf0\x9d\x92\xa9" }, .{ .entity = "&Ntilde", .codepoints = .{ .Single = 209 }, .characters = "\xc3\x91" }, .{ .entity = "&Ntilde;", .codepoints = .{ .Single = 209 }, .characters = "\xc3\x91" }, .{ .entity = "&Nu;", .codepoints = .{ .Single = 925 }, .characters = "\xce\x9d" }, .{ .entity = "&OElig;", .codepoints = .{ .Single = 338 }, .characters = "\xc5\x92" }, .{ .entity = "&Oacute", .codepoints = .{ .Single = 211 }, .characters = "\xc3\x93" }, .{ .entity = "&Oacute;", .codepoints = .{ .Single = 211 }, .characters = "\xc3\x93" }, .{ .entity = "&Ocirc", .codepoints = .{ .Single = 212 }, .characters = "\xc3\x94" }, .{ .entity = "&Ocirc;", .codepoints = .{ .Single = 212 }, .characters = "\xc3\x94" }, .{ .entity = "&Ocy;", .codepoints = .{ .Single = 1054 }, .characters = "\xd0\x9e" }, .{ .entity = "&Odblac;", .codepoints = .{ .Single = 336 }, .characters = "\xc5\x90" }, .{ .entity = "&Ofr;", .codepoints = .{ .Single = 120082 }, .characters = "\xf0\x9d\x94\x92" }, .{ .entity = "&Ograve", .codepoints = .{ .Single = 210 }, .characters = "\xc3\x92" }, .{ .entity = "&Ograve;", .codepoints = .{ .Single = 210 }, .characters = "\xc3\x92" }, .{ .entity = "&Omacr;", .codepoints = .{ .Single = 332 }, .characters = "\xc5\x8c" }, .{ .entity = "&Omega;", .codepoints = .{ .Single = 937 }, .characters = "\xce\xa9" }, .{ .entity = "&Omicron;", .codepoints = .{ .Single = 927 }, .characters = "\xce\x9f" }, .{ .entity = "&Oopf;", .codepoints = .{ .Single = 120134 }, .characters = "\xf0\x9d\x95\x86" }, .{ .entity = "&OpenCurlyDoubleQuote;", .codepoints = .{ .Single = 8220 }, .characters = "\xe2\x80\x9c" }, .{ .entity = "&OpenCurlyQuote;", .codepoints = .{ .Single = 8216 }, .characters = "\xe2\x80\x98" }, .{ .entity = "&Or;", .codepoints = .{ .Single = 10836 }, .characters = "\xe2\xa9\x94" }, .{ .entity = "&Oscr;", .codepoints = .{ .Single = 119978 }, .characters = "\xf0\x9d\x92\xaa" }, .{ .entity = "&Oslash", .codepoints = .{ .Single = 216 }, .characters = "\xc3\x98" }, .{ .entity = "&Oslash;", .codepoints = .{ .Single = 216 }, .characters = "\xc3\x98" }, .{ .entity = "&Otilde", .codepoints = .{ .Single = 213 }, .characters = "\xc3\x95" }, .{ .entity = "&Otilde;", .codepoints = .{ .Single = 213 }, .characters = "\xc3\x95" }, .{ .entity = "&Otimes;", .codepoints = .{ .Single = 10807 }, .characters = "\xe2\xa8\xb7" }, .{ .entity = "&Ouml", .codepoints = .{ .Single = 214 }, .characters = "\xc3\x96" }, .{ .entity = "&Ouml;", .codepoints = .{ .Single = 214 }, .characters = "\xc3\x96" }, .{ .entity = "&OverBar;", .codepoints = .{ .Single = 8254 }, .characters = "\xe2\x80\xbe" }, .{ .entity = "&OverBrace;", .codepoints = .{ .Single = 9182 }, .characters = "\xe2\x8f\x9e" }, .{ .entity = "&OverBracket;", .codepoints = .{ .Single = 9140 }, .characters = "\xe2\x8e\xb4" }, .{ .entity = "&OverParenthesis;", .codepoints = .{ .Single = 9180 }, .characters = "\xe2\x8f\x9c" }, .{ .entity = "&PartialD;", .codepoints = .{ .Single = 8706 }, .characters = "\xe2\x88\x82" }, .{ .entity = "&Pcy;", .codepoints = .{ .Single = 1055 }, .characters = "\xd0\x9f" }, .{ .entity = "&Pfr;", .codepoints = .{ .Single = 120083 }, .characters = "\xf0\x9d\x94\x93" }, .{ .entity = "&Phi;", .codepoints = .{ .Single = 934 }, .characters = "\xce\xa6" }, .{ .entity = "&Pi;", .codepoints = .{ .Single = 928 }, .characters = "\xce\xa0" }, .{ .entity = "&PlusMinus;", .codepoints = .{ .Single = 177 }, .characters = "\xc2\xb1" }, .{ .entity = "&Poincareplane;", .codepoints = .{ .Single = 8460 }, .characters = "\xe2\x84\x8c" }, .{ .entity = "&Popf;", .codepoints = .{ .Single = 8473 }, .characters = "\xe2\x84\x99" }, .{ .entity = "&Pr;", .codepoints = .{ .Single = 10939 }, .characters = "\xe2\xaa\xbb" }, .{ .entity = "&Precedes;", .codepoints = .{ .Single = 8826 }, .characters = "\xe2\x89\xba" }, .{ .entity = "&PrecedesEqual;", .codepoints = .{ .Single = 10927 }, .characters = "\xe2\xaa\xaf" }, .{ .entity = "&PrecedesSlantEqual;", .codepoints = .{ .Single = 8828 }, .characters = "\xe2\x89\xbc" }, .{ .entity = "&PrecedesTilde;", .codepoints = .{ .Single = 8830 }, .characters = "\xe2\x89\xbe" }, .{ .entity = "&Prime;", .codepoints = .{ .Single = 8243 }, .characters = "\xe2\x80\xb3" }, .{ .entity = "&Product;", .codepoints = .{ .Single = 8719 }, .characters = "\xe2\x88\x8f" }, .{ .entity = "&Proportion;", .codepoints = .{ .Single = 8759 }, .characters = "\xe2\x88\xb7" }, .{ .entity = "&Proportional;", .codepoints = .{ .Single = 8733 }, .characters = "\xe2\x88\x9d" }, .{ .entity = "&Pscr;", .codepoints = .{ .Single = 119979 }, .characters = "\xf0\x9d\x92\xab" }, .{ .entity = "&Psi;", .codepoints = .{ .Single = 936 }, .characters = "\xce\xa8" }, .{ .entity = "&QUOT", .codepoints = .{ .Single = 34 }, .characters = "\"" }, .{ .entity = "&QUOT;", .codepoints = .{ .Single = 34 }, .characters = "\"" }, .{ .entity = "&Qfr;", .codepoints = .{ .Single = 120084 }, .characters = "\xf0\x9d\x94\x94" }, .{ .entity = "&Qopf;", .codepoints = .{ .Single = 8474 }, .characters = "\xe2\x84\x9a" }, .{ .entity = "&Qscr;", .codepoints = .{ .Single = 119980 }, .characters = "\xf0\x9d\x92\xac" }, .{ .entity = "&RBarr;", .codepoints = .{ .Single = 10512 }, .characters = "\xe2\xa4\x90" }, .{ .entity = "&REG", .codepoints = .{ .Single = 174 }, .characters = "\xc2\xae" }, .{ .entity = "&REG;", .codepoints = .{ .Single = 174 }, .characters = "\xc2\xae" }, .{ .entity = "&Racute;", .codepoints = .{ .Single = 340 }, .characters = "\xc5\x94" }, .{ .entity = "&Rang;", .codepoints = .{ .Single = 10219 }, .characters = "\xe2\x9f\xab" }, .{ .entity = "&Rarr;", .codepoints = .{ .Single = 8608 }, .characters = "\xe2\x86\xa0" }, .{ .entity = "&Rarrtl;", .codepoints = .{ .Single = 10518 }, .characters = "\xe2\xa4\x96" }, .{ .entity = "&Rcaron;", .codepoints = .{ .Single = 344 }, .characters = "\xc5\x98" }, .{ .entity = "&Rcedil;", .codepoints = .{ .Single = 342 }, .characters = "\xc5\x96" }, .{ .entity = "&Rcy;", .codepoints = .{ .Single = 1056 }, .characters = "\xd0\xa0" }, .{ .entity = "&Re;", .codepoints = .{ .Single = 8476 }, .characters = "\xe2\x84\x9c" }, .{ .entity = "&ReverseElement;", .codepoints = .{ .Single = 8715 }, .characters = "\xe2\x88\x8b" }, .{ .entity = "&ReverseEquilibrium;", .codepoints = .{ .Single = 8651 }, .characters = "\xe2\x87\x8b" }, .{ .entity = "&ReverseUpEquilibrium;", .codepoints = .{ .Single = 10607 }, .characters = "\xe2\xa5\xaf" }, .{ .entity = "&Rfr;", .codepoints = .{ .Single = 8476 }, .characters = "\xe2\x84\x9c" }, .{ .entity = "&Rho;", .codepoints = .{ .Single = 929 }, .characters = "\xce\xa1" }, .{ .entity = "&RightAngleBracket;", .codepoints = .{ .Single = 10217 }, .characters = "\xe2\x9f\xa9" }, .{ .entity = "&RightArrow;", .codepoints = .{ .Single = 8594 }, .characters = "\xe2\x86\x92" }, .{ .entity = "&RightArrowBar;", .codepoints = .{ .Single = 8677 }, .characters = "\xe2\x87\xa5" }, .{ .entity = "&RightArrowLeftArrow;", .codepoints = .{ .Single = 8644 }, .characters = "\xe2\x87\x84" }, .{ .entity = "&RightCeiling;", .codepoints = .{ .Single = 8969 }, .characters = "\xe2\x8c\x89" }, .{ .entity = "&RightDoubleBracket;", .codepoints = .{ .Single = 10215 }, .characters = "\xe2\x9f\xa7" }, .{ .entity = "&RightDownTeeVector;", .codepoints = .{ .Single = 10589 }, .characters = "\xe2\xa5\x9d" }, .{ .entity = "&RightDownVector;", .codepoints = .{ .Single = 8642 }, .characters = "\xe2\x87\x82" }, .{ .entity = "&RightDownVectorBar;", .codepoints = .{ .Single = 10581 }, .characters = "\xe2\xa5\x95" }, .{ .entity = "&RightFloor;", .codepoints = .{ .Single = 8971 }, .characters = "\xe2\x8c\x8b" }, .{ .entity = "&RightTee;", .codepoints = .{ .Single = 8866 }, .characters = "\xe2\x8a\xa2" }, .{ .entity = "&RightTeeArrow;", .codepoints = .{ .Single = 8614 }, .characters = "\xe2\x86\xa6" }, .{ .entity = "&RightTeeVector;", .codepoints = .{ .Single = 10587 }, .characters = "\xe2\xa5\x9b" }, .{ .entity = "&RightTriangle;", .codepoints = .{ .Single = 8883 }, .characters = "\xe2\x8a\xb3" }, .{ .entity = "&RightTriangleBar;", .codepoints = .{ .Single = 10704 }, .characters = "\xe2\xa7\x90" }, .{ .entity = "&RightTriangleEqual;", .codepoints = .{ .Single = 8885 }, .characters = "\xe2\x8a\xb5" }, .{ .entity = "&RightUpDownVector;", .codepoints = .{ .Single = 10575 }, .characters = "\xe2\xa5\x8f" }, .{ .entity = "&RightUpTeeVector;", .codepoints = .{ .Single = 10588 }, .characters = "\xe2\xa5\x9c" }, .{ .entity = "&RightUpVector;", .codepoints = .{ .Single = 8638 }, .characters = "\xe2\x86\xbe" }, .{ .entity = "&RightUpVectorBar;", .codepoints = .{ .Single = 10580 }, .characters = "\xe2\xa5\x94" }, .{ .entity = "&RightVector;", .codepoints = .{ .Single = 8640 }, .characters = "\xe2\x87\x80" }, .{ .entity = "&RightVectorBar;", .codepoints = .{ .Single = 10579 }, .characters = "\xe2\xa5\x93" }, .{ .entity = "&Rightarrow;", .codepoints = .{ .Single = 8658 }, .characters = "\xe2\x87\x92" }, .{ .entity = "&Ropf;", .codepoints = .{ .Single = 8477 }, .characters = "\xe2\x84\x9d" }, .{ .entity = "&RoundImplies;", .codepoints = .{ .Single = 10608 }, .characters = "\xe2\xa5\xb0" }, .{ .entity = "&Rrightarrow;", .codepoints = .{ .Single = 8667 }, .characters = "\xe2\x87\x9b" }, .{ .entity = "&Rscr;", .codepoints = .{ .Single = 8475 }, .characters = "\xe2\x84\x9b" }, .{ .entity = "&Rsh;", .codepoints = .{ .Single = 8625 }, .characters = "\xe2\x86\xb1" }, .{ .entity = "&RuleDelayed;", .codepoints = .{ .Single = 10740 }, .characters = "\xe2\xa7\xb4" }, .{ .entity = "&SHCHcy;", .codepoints = .{ .Single = 1065 }, .characters = "\xd0\xa9" }, .{ .entity = "&SHcy;", .codepoints = .{ .Single = 1064 }, .characters = "\xd0\xa8" }, .{ .entity = "&SOFTcy;", .codepoints = .{ .Single = 1068 }, .characters = "\xd0\xac" }, .{ .entity = "&Sacute;", .codepoints = .{ .Single = 346 }, .characters = "\xc5\x9a" }, .{ .entity = "&Sc;", .codepoints = .{ .Single = 10940 }, .characters = "\xe2\xaa\xbc" }, .{ .entity = "&Scaron;", .codepoints = .{ .Single = 352 }, .characters = "\xc5\xa0" }, .{ .entity = "&Scedil;", .codepoints = .{ .Single = 350 }, .characters = "\xc5\x9e" }, .{ .entity = "&Scirc;", .codepoints = .{ .Single = 348 }, .characters = "\xc5\x9c" }, .{ .entity = "&Scy;", .codepoints = .{ .Single = 1057 }, .characters = "\xd0\xa1" }, .{ .entity = "&Sfr;", .codepoints = .{ .Single = 120086 }, .characters = "\xf0\x9d\x94\x96" }, .{ .entity = "&ShortDownArrow;", .codepoints = .{ .Single = 8595 }, .characters = "\xe2\x86\x93" }, .{ .entity = "&ShortLeftArrow;", .codepoints = .{ .Single = 8592 }, .characters = "\xe2\x86\x90" }, .{ .entity = "&ShortRightArrow;", .codepoints = .{ .Single = 8594 }, .characters = "\xe2\x86\x92" }, .{ .entity = "&ShortUpArrow;", .codepoints = .{ .Single = 8593 }, .characters = "\xe2\x86\x91" }, .{ .entity = "&Sigma;", .codepoints = .{ .Single = 931 }, .characters = "\xce\xa3" }, .{ .entity = "&SmallCircle;", .codepoints = .{ .Single = 8728 }, .characters = "\xe2\x88\x98" }, .{ .entity = "&Sopf;", .codepoints = .{ .Single = 120138 }, .characters = "\xf0\x9d\x95\x8a" }, .{ .entity = "&Sqrt;", .codepoints = .{ .Single = 8730 }, .characters = "\xe2\x88\x9a" }, .{ .entity = "&Square;", .codepoints = .{ .Single = 9633 }, .characters = "\xe2\x96\xa1" }, .{ .entity = "&SquareIntersection;", .codepoints = .{ .Single = 8851 }, .characters = "\xe2\x8a\x93" }, .{ .entity = "&SquareSubset;", .codepoints = .{ .Single = 8847 }, .characters = "\xe2\x8a\x8f" }, .{ .entity = "&SquareSubsetEqual;", .codepoints = .{ .Single = 8849 }, .characters = "\xe2\x8a\x91" }, .{ .entity = "&SquareSuperset;", .codepoints = .{ .Single = 8848 }, .characters = "\xe2\x8a\x90" }, .{ .entity = "&SquareSupersetEqual;", .codepoints = .{ .Single = 8850 }, .characters = "\xe2\x8a\x92" }, .{ .entity = "&SquareUnion;", .codepoints = .{ .Single = 8852 }, .characters = "\xe2\x8a\x94" }, .{ .entity = "&Sscr;", .codepoints = .{ .Single = 119982 }, .characters = "\xf0\x9d\x92\xae" }, .{ .entity = "&Star;", .codepoints = .{ .Single = 8902 }, .characters = "\xe2\x8b\x86" }, .{ .entity = "&Sub;", .codepoints = .{ .Single = 8912 }, .characters = "\xe2\x8b\x90" }, .{ .entity = "&Subset;", .codepoints = .{ .Single = 8912 }, .characters = "\xe2\x8b\x90" }, .{ .entity = "&SubsetEqual;", .codepoints = .{ .Single = 8838 }, .characters = "\xe2\x8a\x86" }, .{ .entity = "&Succeeds;", .codepoints = .{ .Single = 8827 }, .characters = "\xe2\x89\xbb" }, .{ .entity = "&SucceedsEqual;", .codepoints = .{ .Single = 10928 }, .characters = "\xe2\xaa\xb0" }, .{ .entity = "&SucceedsSlantEqual;", .codepoints = .{ .Single = 8829 }, .characters = "\xe2\x89\xbd" }, .{ .entity = "&SucceedsTilde;", .codepoints = .{ .Single = 8831 }, .characters = "\xe2\x89\xbf" }, .{ .entity = "&SuchThat;", .codepoints = .{ .Single = 8715 }, .characters = "\xe2\x88\x8b" }, .{ .entity = "&Sum;", .codepoints = .{ .Single = 8721 }, .characters = "\xe2\x88\x91" }, .{ .entity = "&Sup;", .codepoints = .{ .Single = 8913 }, .characters = "\xe2\x8b\x91" }, .{ .entity = "&Superset;", .codepoints = .{ .Single = 8835 }, .characters = "\xe2\x8a\x83" }, .{ .entity = "&SupersetEqual;", .codepoints = .{ .Single = 8839 }, .characters = "\xe2\x8a\x87" }, .{ .entity = "&Supset;", .codepoints = .{ .Single = 8913 }, .characters = "\xe2\x8b\x91" }, .{ .entity = "&THORN", .codepoints = .{ .Single = 222 }, .characters = "\xc3\x9e" }, .{ .entity = "&THORN;", .codepoints = .{ .Single = 222 }, .characters = "\xc3\x9e" }, .{ .entity = "&TRADE;", .codepoints = .{ .Single = 8482 }, .characters = "\xe2\x84\xa2" }, .{ .entity = "&TSHcy;", .codepoints = .{ .Single = 1035 }, .characters = "\xd0\x8b" }, .{ .entity = "&TScy;", .codepoints = .{ .Single = 1062 }, .characters = "\xd0\xa6" }, .{ .entity = "&Tab;", .codepoints = .{ .Single = 9 }, .characters = "\t" }, .{ .entity = "&Tau;", .codepoints = .{ .Single = 932 }, .characters = "\xce\xa4" }, .{ .entity = "&Tcaron;", .codepoints = .{ .Single = 356 }, .characters = "\xc5\xa4" }, .{ .entity = "&Tcedil;", .codepoints = .{ .Single = 354 }, .characters = "\xc5\xa2" }, .{ .entity = "&Tcy;", .codepoints = .{ .Single = 1058 }, .characters = "\xd0\xa2" }, .{ .entity = "&Tfr;", .codepoints = .{ .Single = 120087 }, .characters = "\xf0\x9d\x94\x97" }, .{ .entity = "&Therefore;", .codepoints = .{ .Single = 8756 }, .characters = "\xe2\x88\xb4" }, .{ .entity = "&Theta;", .codepoints = .{ .Single = 920 }, .characters = "\xce\x98" }, .{ .entity = "&ThickSpace;", .codepoints = .{ .Double = [2]u32{ 8287, 8202 } }, .characters = "\xe2\x81\x9f\xe2\x80\x8a" }, .{ .entity = "&ThinSpace;", .codepoints = .{ .Single = 8201 }, .characters = "\xe2\x80\x89" }, .{ .entity = "&Tilde;", .codepoints = .{ .Single = 8764 }, .characters = "\xe2\x88\xbc" }, .{ .entity = "&TildeEqual;", .codepoints = .{ .Single = 8771 }, .characters = "\xe2\x89\x83" }, .{ .entity = "&TildeFullEqual;", .codepoints = .{ .Single = 8773 }, .characters = "\xe2\x89\x85" }, .{ .entity = "&TildeTilde;", .codepoints = .{ .Single = 8776 }, .characters = "\xe2\x89\x88" }, .{ .entity = "&Topf;", .codepoints = .{ .Single = 120139 }, .characters = "\xf0\x9d\x95\x8b" }, .{ .entity = "&TripleDot;", .codepoints = .{ .Single = 8411 }, .characters = "\xe2\x83\x9b" }, .{ .entity = "&Tscr;", .codepoints = .{ .Single = 119983 }, .characters = "\xf0\x9d\x92\xaf" }, .{ .entity = "&Tstrok;", .codepoints = .{ .Single = 358 }, .characters = "\xc5\xa6" }, .{ .entity = "&Uacute", .codepoints = .{ .Single = 218 }, .characters = "\xc3\x9a" }, .{ .entity = "&Uacute;", .codepoints = .{ .Single = 218 }, .characters = "\xc3\x9a" }, .{ .entity = "&Uarr;", .codepoints = .{ .Single = 8607 }, .characters = "\xe2\x86\x9f" }, .{ .entity = "&Uarrocir;", .codepoints = .{ .Single = 10569 }, .characters = "\xe2\xa5\x89" }, .{ .entity = "&Ubrcy;", .codepoints = .{ .Single = 1038 }, .characters = "\xd0\x8e" }, .{ .entity = "&Ubreve;", .codepoints = .{ .Single = 364 }, .characters = "\xc5\xac" }, .{ .entity = "&Ucirc", .codepoints = .{ .Single = 219 }, .characters = "\xc3\x9b" }, .{ .entity = "&Ucirc;", .codepoints = .{ .Single = 219 }, .characters = "\xc3\x9b" }, .{ .entity = "&Ucy;", .codepoints = .{ .Single = 1059 }, .characters = "\xd0\xa3" }, .{ .entity = "&Udblac;", .codepoints = .{ .Single = 368 }, .characters = "\xc5\xb0" }, .{ .entity = "&Ufr;", .codepoints = .{ .Single = 120088 }, .characters = "\xf0\x9d\x94\x98" }, .{ .entity = "&Ugrave", .codepoints = .{ .Single = 217 }, .characters = "\xc3\x99" }, .{ .entity = "&Ugrave;", .codepoints = .{ .Single = 217 }, .characters = "\xc3\x99" }, .{ .entity = "&Umacr;", .codepoints = .{ .Single = 362 }, .characters = "\xc5\xaa" }, .{ .entity = "&UnderBar;", .codepoints = .{ .Single = 95 }, .characters = "_" }, .{ .entity = "&UnderBrace;", .codepoints = .{ .Single = 9183 }, .characters = "\xe2\x8f\x9f" }, .{ .entity = "&UnderBracket;", .codepoints = .{ .Single = 9141 }, .characters = "\xe2\x8e\xb5" }, .{ .entity = "&UnderParenthesis;", .codepoints = .{ .Single = 9181 }, .characters = "\xe2\x8f\x9d" }, .{ .entity = "&Union;", .codepoints = .{ .Single = 8899 }, .characters = "\xe2\x8b\x83" }, .{ .entity = "&UnionPlus;", .codepoints = .{ .Single = 8846 }, .characters = "\xe2\x8a\x8e" }, .{ .entity = "&Uogon;", .codepoints = .{ .Single = 370 }, .characters = "\xc5\xb2" }, .{ .entity = "&Uopf;", .codepoints = .{ .Single = 120140 }, .characters = "\xf0\x9d\x95\x8c" }, .{ .entity = "&UpArrow;", .codepoints = .{ .Single = 8593 }, .characters = "\xe2\x86\x91" }, .{ .entity = "&UpArrowBar;", .codepoints = .{ .Single = 10514 }, .characters = "\xe2\xa4\x92" }, .{ .entity = "&UpArrowDownArrow;", .codepoints = .{ .Single = 8645 }, .characters = "\xe2\x87\x85" }, .{ .entity = "&UpDownArrow;", .codepoints = .{ .Single = 8597 }, .characters = "\xe2\x86\x95" }, .{ .entity = "&UpEquilibrium;", .codepoints = .{ .Single = 10606 }, .characters = "\xe2\xa5\xae" }, .{ .entity = "&UpTee;", .codepoints = .{ .Single = 8869 }, .characters = "\xe2\x8a\xa5" }, .{ .entity = "&UpTeeArrow;", .codepoints = .{ .Single = 8613 }, .characters = "\xe2\x86\xa5" }, .{ .entity = "&Uparrow;", .codepoints = .{ .Single = 8657 }, .characters = "\xe2\x87\x91" }, .{ .entity = "&Updownarrow;", .codepoints = .{ .Single = 8661 }, .characters = "\xe2\x87\x95" }, .{ .entity = "&UpperLeftArrow;", .codepoints = .{ .Single = 8598 }, .characters = "\xe2\x86\x96" }, .{ .entity = "&UpperRightArrow;", .codepoints = .{ .Single = 8599 }, .characters = "\xe2\x86\x97" }, .{ .entity = "&Upsi;", .codepoints = .{ .Single = 978 }, .characters = "\xcf\x92" }, .{ .entity = "&Upsilon;", .codepoints = .{ .Single = 933 }, .characters = "\xce\xa5" }, .{ .entity = "&Uring;", .codepoints = .{ .Single = 366 }, .characters = "\xc5\xae" }, .{ .entity = "&Uscr;", .codepoints = .{ .Single = 119984 }, .characters = "\xf0\x9d\x92\xb0" }, .{ .entity = "&Utilde;", .codepoints = .{ .Single = 360 }, .characters = "\xc5\xa8" }, .{ .entity = "&Uuml", .codepoints = .{ .Single = 220 }, .characters = "\xc3\x9c" }, .{ .entity = "&Uuml;", .codepoints = .{ .Single = 220 }, .characters = "\xc3\x9c" }, .{ .entity = "&VDash;", .codepoints = .{ .Single = 8875 }, .characters = "\xe2\x8a\xab" }, .{ .entity = "&Vbar;", .codepoints = .{ .Single = 10987 }, .characters = "\xe2\xab\xab" }, .{ .entity = "&Vcy;", .codepoints = .{ .Single = 1042 }, .characters = "\xd0\x92" }, .{ .entity = "&Vdash;", .codepoints = .{ .Single = 8873 }, .characters = "\xe2\x8a\xa9" }, .{ .entity = "&Vdashl;", .codepoints = .{ .Single = 10982 }, .characters = "\xe2\xab\xa6" }, .{ .entity = "&Vee;", .codepoints = .{ .Single = 8897 }, .characters = "\xe2\x8b\x81" }, .{ .entity = "&Verbar;", .codepoints = .{ .Single = 8214 }, .characters = "\xe2\x80\x96" }, .{ .entity = "&Vert;", .codepoints = .{ .Single = 8214 }, .characters = "\xe2\x80\x96" }, .{ .entity = "&VerticalBar;", .codepoints = .{ .Single = 8739 }, .characters = "\xe2\x88\xa3" }, .{ .entity = "&VerticalLine;", .codepoints = .{ .Single = 124 }, .characters = "|" }, .{ .entity = "&VerticalSeparator;", .codepoints = .{ .Single = 10072 }, .characters = "\xe2\x9d\x98" }, .{ .entity = "&VerticalTilde;", .codepoints = .{ .Single = 8768 }, .characters = "\xe2\x89\x80" }, .{ .entity = "&VeryThinSpace;", .codepoints = .{ .Single = 8202 }, .characters = "\xe2\x80\x8a" }, .{ .entity = "&Vfr;", .codepoints = .{ .Single = 120089 }, .characters = "\xf0\x9d\x94\x99" }, .{ .entity = "&Vopf;", .codepoints = .{ .Single = 120141 }, .characters = "\xf0\x9d\x95\x8d" }, .{ .entity = "&Vscr;", .codepoints = .{ .Single = 119985 }, .characters = "\xf0\x9d\x92\xb1" }, .{ .entity = "&Vvdash;", .codepoints = .{ .Single = 8874 }, .characters = "\xe2\x8a\xaa" }, .{ .entity = "&Wcirc;", .codepoints = .{ .Single = 372 }, .characters = "\xc5\xb4" }, .{ .entity = "&Wedge;", .codepoints = .{ .Single = 8896 }, .characters = "\xe2\x8b\x80" }, .{ .entity = "&Wfr;", .codepoints = .{ .Single = 120090 }, .characters = "\xf0\x9d\x94\x9a" }, .{ .entity = "&Wopf;", .codepoints = .{ .Single = 120142 }, .characters = "\xf0\x9d\x95\x8e" }, .{ .entity = "&Wscr;", .codepoints = .{ .Single = 119986 }, .characters = "\xf0\x9d\x92\xb2" }, .{ .entity = "&Xfr;", .codepoints = .{ .Single = 120091 }, .characters = "\xf0\x9d\x94\x9b" }, .{ .entity = "&Xi;", .codepoints = .{ .Single = 926 }, .characters = "\xce\x9e" }, .{ .entity = "&Xopf;", .codepoints = .{ .Single = 120143 }, .characters = "\xf0\x9d\x95\x8f" }, .{ .entity = "&Xscr;", .codepoints = .{ .Single = 119987 }, .characters = "\xf0\x9d\x92\xb3" }, .{ .entity = "&YAcy;", .codepoints = .{ .Single = 1071 }, .characters = "\xd0\xaf" }, .{ .entity = "&YIcy;", .codepoints = .{ .Single = 1031 }, .characters = "\xd0\x87" }, .{ .entity = "&YUcy;", .codepoints = .{ .Single = 1070 }, .characters = "\xd0\xae" }, .{ .entity = "&Yacute", .codepoints = .{ .Single = 221 }, .characters = "\xc3\x9d" }, .{ .entity = "&Yacute;", .codepoints = .{ .Single = 221 }, .characters = "\xc3\x9d" }, .{ .entity = "&Ycirc;", .codepoints = .{ .Single = 374 }, .characters = "\xc5\xb6" }, .{ .entity = "&Ycy;", .codepoints = .{ .Single = 1067 }, .characters = "\xd0\xab" }, .{ .entity = "&Yfr;", .codepoints = .{ .Single = 120092 }, .characters = "\xf0\x9d\x94\x9c" }, .{ .entity = "&Yopf;", .codepoints = .{ .Single = 120144 }, .characters = "\xf0\x9d\x95\x90" }, .{ .entity = "&Yscr;", .codepoints = .{ .Single = 119988 }, .characters = "\xf0\x9d\x92\xb4" }, .{ .entity = "&Yuml;", .codepoints = .{ .Single = 376 }, .characters = "\xc5\xb8" }, .{ .entity = "&ZHcy;", .codepoints = .{ .Single = 1046 }, .characters = "\xd0\x96" }, .{ .entity = "&Zacute;", .codepoints = .{ .Single = 377 }, .characters = "\xc5\xb9" }, .{ .entity = "&Zcaron;", .codepoints = .{ .Single = 381 }, .characters = "\xc5\xbd" }, .{ .entity = "&Zcy;", .codepoints = .{ .Single = 1047 }, .characters = "\xd0\x97" }, .{ .entity = "&Zdot;", .codepoints = .{ .Single = 379 }, .characters = "\xc5\xbb" }, .{ .entity = "&ZeroWidthSpace;", .codepoints = .{ .Single = 8203 }, .characters = "\xe2\x80\x8b" }, .{ .entity = "&Zeta;", .codepoints = .{ .Single = 918 }, .characters = "\xce\x96" }, .{ .entity = "&Zfr;", .codepoints = .{ .Single = 8488 }, .characters = "\xe2\x84\xa8" }, .{ .entity = "&Zopf;", .codepoints = .{ .Single = 8484 }, .characters = "\xe2\x84\xa4" }, .{ .entity = "&Zscr;", .codepoints = .{ .Single = 119989 }, .characters = "\xf0\x9d\x92\xb5" }, .{ .entity = "&aacute", .codepoints = .{ .Single = 225 }, .characters = "\xc3\xa1" }, .{ .entity = "&aacute;", .codepoints = .{ .Single = 225 }, .characters = "\xc3\xa1" }, .{ .entity = "&abreve;", .codepoints = .{ .Single = 259 }, .characters = "\xc4\x83" }, .{ .entity = "&ac;", .codepoints = .{ .Single = 8766 }, .characters = "\xe2\x88\xbe" }, .{ .entity = "&acE;", .codepoints = .{ .Double = [2]u32{ 8766, 819 } }, .characters = "\xe2\x88\xbe\xcc\xb3" }, .{ .entity = "&acd;", .codepoints = .{ .Single = 8767 }, .characters = "\xe2\x88\xbf" }, .{ .entity = "&acirc", .codepoints = .{ .Single = 226 }, .characters = "\xc3\xa2" }, .{ .entity = "&acirc;", .codepoints = .{ .Single = 226 }, .characters = "\xc3\xa2" }, .{ .entity = "&acute", .codepoints = .{ .Single = 180 }, .characters = "\xc2\xb4" }, .{ .entity = "&acute;", .codepoints = .{ .Single = 180 }, .characters = "\xc2\xb4" }, .{ .entity = "&acy;", .codepoints = .{ .Single = 1072 }, .characters = "\xd0\xb0" }, .{ .entity = "&aelig", .codepoints = .{ .Single = 230 }, .characters = "\xc3\xa6" }, .{ .entity = "&aelig;", .codepoints = .{ .Single = 230 }, .characters = "\xc3\xa6" }, .{ .entity = "&af;", .codepoints = .{ .Single = 8289 }, .characters = "\xe2\x81\xa1" }, .{ .entity = "&afr;", .codepoints = .{ .Single = 120094 }, .characters = "\xf0\x9d\x94\x9e" }, .{ .entity = "&agrave", .codepoints = .{ .Single = 224 }, .characters = "\xc3\xa0" }, .{ .entity = "&agrave;", .codepoints = .{ .Single = 224 }, .characters = "\xc3\xa0" }, .{ .entity = "&alefsym;", .codepoints = .{ .Single = 8501 }, .characters = "\xe2\x84\xb5" }, .{ .entity = "&aleph;", .codepoints = .{ .Single = 8501 }, .characters = "\xe2\x84\xb5" }, .{ .entity = "&alpha;", .codepoints = .{ .Single = 945 }, .characters = "\xce\xb1" }, .{ .entity = "&amacr;", .codepoints = .{ .Single = 257 }, .characters = "\xc4\x81" }, .{ .entity = "&amalg;", .codepoints = .{ .Single = 10815 }, .characters = "\xe2\xa8\xbf" }, .{ .entity = "&amp", .codepoints = .{ .Single = 38 }, .characters = "&" }, .{ .entity = "&amp;", .codepoints = .{ .Single = 38 }, .characters = "&" }, .{ .entity = "&and;", .codepoints = .{ .Single = 8743 }, .characters = "\xe2\x88\xa7" }, .{ .entity = "&andand;", .codepoints = .{ .Single = 10837 }, .characters = "\xe2\xa9\x95" }, .{ .entity = "&andd;", .codepoints = .{ .Single = 10844 }, .characters = "\xe2\xa9\x9c" }, .{ .entity = "&andslope;", .codepoints = .{ .Single = 10840 }, .characters = "\xe2\xa9\x98" }, .{ .entity = "&andv;", .codepoints = .{ .Single = 10842 }, .characters = "\xe2\xa9\x9a" }, .{ .entity = "&ang;", .codepoints = .{ .Single = 8736 }, .characters = "\xe2\x88\xa0" }, .{ .entity = "&ange;", .codepoints = .{ .Single = 10660 }, .characters = "\xe2\xa6\xa4" }, .{ .entity = "&angle;", .codepoints = .{ .Single = 8736 }, .characters = "\xe2\x88\xa0" }, .{ .entity = "&angmsd;", .codepoints = .{ .Single = 8737 }, .characters = "\xe2\x88\xa1" }, .{ .entity = "&angmsdaa;", .codepoints = .{ .Single = 10664 }, .characters = "\xe2\xa6\xa8" }, .{ .entity = "&angmsdab;", .codepoints = .{ .Single = 10665 }, .characters = "\xe2\xa6\xa9" }, .{ .entity = "&angmsdac;", .codepoints = .{ .Single = 10666 }, .characters = "\xe2\xa6\xaa" }, .{ .entity = "&angmsdad;", .codepoints = .{ .Single = 10667 }, .characters = "\xe2\xa6\xab" }, .{ .entity = "&angmsdae;", .codepoints = .{ .Single = 10668 }, .characters = "\xe2\xa6\xac" }, .{ .entity = "&angmsdaf;", .codepoints = .{ .Single = 10669 }, .characters = "\xe2\xa6\xad" }, .{ .entity = "&angmsdag;", .codepoints = .{ .Single = 10670 }, .characters = "\xe2\xa6\xae" }, .{ .entity = "&angmsdah;", .codepoints = .{ .Single = 10671 }, .characters = "\xe2\xa6\xaf" }, .{ .entity = "&angrt;", .codepoints = .{ .Single = 8735 }, .characters = "\xe2\x88\x9f" }, .{ .entity = "&angrtvb;", .codepoints = .{ .Single = 8894 }, .characters = "\xe2\x8a\xbe" }, .{ .entity = "&angrtvbd;", .codepoints = .{ .Single = 10653 }, .characters = "\xe2\xa6\x9d" }, .{ .entity = "&angsph;", .codepoints = .{ .Single = 8738 }, .characters = "\xe2\x88\xa2" }, .{ .entity = "&angst;", .codepoints = .{ .Single = 197 }, .characters = "\xc3\x85" }, .{ .entity = "&angzarr;", .codepoints = .{ .Single = 9084 }, .characters = "\xe2\x8d\xbc" }, .{ .entity = "&aogon;", .codepoints = .{ .Single = 261 }, .characters = "\xc4\x85" }, .{ .entity = "&aopf;", .codepoints = .{ .Single = 120146 }, .characters = "\xf0\x9d\x95\x92" }, .{ .entity = "&ap;", .codepoints = .{ .Single = 8776 }, .characters = "\xe2\x89\x88" }, .{ .entity = "&apE;", .codepoints = .{ .Single = 10864 }, .characters = "\xe2\xa9\xb0" }, .{ .entity = "&apacir;", .codepoints = .{ .Single = 10863 }, .characters = "\xe2\xa9\xaf" }, .{ .entity = "&ape;", .codepoints = .{ .Single = 8778 }, .characters = "\xe2\x89\x8a" }, .{ .entity = "&apid;", .codepoints = .{ .Single = 8779 }, .characters = "\xe2\x89\x8b" }, .{ .entity = "&apos;", .codepoints = .{ .Single = 39 }, .characters = "'" }, .{ .entity = "&approx;", .codepoints = .{ .Single = 8776 }, .characters = "\xe2\x89\x88" }, .{ .entity = "&approxeq;", .codepoints = .{ .Single = 8778 }, .characters = "\xe2\x89\x8a" }, .{ .entity = "&aring", .codepoints = .{ .Single = 229 }, .characters = "\xc3\xa5" }, .{ .entity = "&aring;", .codepoints = .{ .Single = 229 }, .characters = "\xc3\xa5" }, .{ .entity = "&ascr;", .codepoints = .{ .Single = 119990 }, .characters = "\xf0\x9d\x92\xb6" }, .{ .entity = "&ast;", .codepoints = .{ .Single = 42 }, .characters = "*" }, .{ .entity = "&asymp;", .codepoints = .{ .Single = 8776 }, .characters = "\xe2\x89\x88" }, .{ .entity = "&asympeq;", .codepoints = .{ .Single = 8781 }, .characters = "\xe2\x89\x8d" }, .{ .entity = "&atilde", .codepoints = .{ .Single = 227 }, .characters = "\xc3\xa3" }, .{ .entity = "&atilde;", .codepoints = .{ .Single = 227 }, .characters = "\xc3\xa3" }, .{ .entity = "&auml", .codepoints = .{ .Single = 228 }, .characters = "\xc3\xa4" }, .{ .entity = "&auml;", .codepoints = .{ .Single = 228 }, .characters = "\xc3\xa4" }, .{ .entity = "&awconint;", .codepoints = .{ .Single = 8755 }, .characters = "\xe2\x88\xb3" }, .{ .entity = "&awint;", .codepoints = .{ .Single = 10769 }, .characters = "\xe2\xa8\x91" }, .{ .entity = "&bNot;", .codepoints = .{ .Single = 10989 }, .characters = "\xe2\xab\xad" }, .{ .entity = "&backcong;", .codepoints = .{ .Single = 8780 }, .characters = "\xe2\x89\x8c" }, .{ .entity = "&backepsilon;", .codepoints = .{ .Single = 1014 }, .characters = "\xcf\xb6" }, .{ .entity = "&backprime;", .codepoints = .{ .Single = 8245 }, .characters = "\xe2\x80\xb5" }, .{ .entity = "&backsim;", .codepoints = .{ .Single = 8765 }, .characters = "\xe2\x88\xbd" }, .{ .entity = "&backsimeq;", .codepoints = .{ .Single = 8909 }, .characters = "\xe2\x8b\x8d" }, .{ .entity = "&barvee;", .codepoints = .{ .Single = 8893 }, .characters = "\xe2\x8a\xbd" }, .{ .entity = "&barwed;", .codepoints = .{ .Single = 8965 }, .characters = "\xe2\x8c\x85" }, .{ .entity = "&barwedge;", .codepoints = .{ .Single = 8965 }, .characters = "\xe2\x8c\x85" }, .{ .entity = "&bbrk;", .codepoints = .{ .Single = 9141 }, .characters = "\xe2\x8e\xb5" }, .{ .entity = "&bbrktbrk;", .codepoints = .{ .Single = 9142 }, .characters = "\xe2\x8e\xb6" }, .{ .entity = "&bcong;", .codepoints = .{ .Single = 8780 }, .characters = "\xe2\x89\x8c" }, .{ .entity = "&bcy;", .codepoints = .{ .Single = 1073 }, .characters = "\xd0\xb1" }, .{ .entity = "&bdquo;", .codepoints = .{ .Single = 8222 }, .characters = "\xe2\x80\x9e" }, .{ .entity = "&becaus;", .codepoints = .{ .Single = 8757 }, .characters = "\xe2\x88\xb5" }, .{ .entity = "&because;", .codepoints = .{ .Single = 8757 }, .characters = "\xe2\x88\xb5" }, .{ .entity = "&bemptyv;", .codepoints = .{ .Single = 10672 }, .characters = "\xe2\xa6\xb0" }, .{ .entity = "&bepsi;", .codepoints = .{ .Single = 1014 }, .characters = "\xcf\xb6" }, .{ .entity = "&bernou;", .codepoints = .{ .Single = 8492 }, .characters = "\xe2\x84\xac" }, .{ .entity = "&beta;", .codepoints = .{ .Single = 946 }, .characters = "\xce\xb2" }, .{ .entity = "&beth;", .codepoints = .{ .Single = 8502 }, .characters = "\xe2\x84\xb6" }, .{ .entity = "&between;", .codepoints = .{ .Single = 8812 }, .characters = "\xe2\x89\xac" }, .{ .entity = "&bfr;", .codepoints = .{ .Single = 120095 }, .characters = "\xf0\x9d\x94\x9f" }, .{ .entity = "&bigcap;", .codepoints = .{ .Single = 8898 }, .characters = "\xe2\x8b\x82" }, .{ .entity = "&bigcirc;", .codepoints = .{ .Single = 9711 }, .characters = "\xe2\x97\xaf" }, .{ .entity = "&bigcup;", .codepoints = .{ .Single = 8899 }, .characters = "\xe2\x8b\x83" }, .{ .entity = "&bigodot;", .codepoints = .{ .Single = 10752 }, .characters = "\xe2\xa8\x80" }, .{ .entity = "&bigoplus;", .codepoints = .{ .Single = 10753 }, .characters = "\xe2\xa8\x81" }, .{ .entity = "&bigotimes;", .codepoints = .{ .Single = 10754 }, .characters = "\xe2\xa8\x82" }, .{ .entity = "&bigsqcup;", .codepoints = .{ .Single = 10758 }, .characters = "\xe2\xa8\x86" }, .{ .entity = "&bigstar;", .codepoints = .{ .Single = 9733 }, .characters = "\xe2\x98\x85" }, .{ .entity = "&bigtriangledown;", .codepoints = .{ .Single = 9661 }, .characters = "\xe2\x96\xbd" }, .{ .entity = "&bigtriangleup;", .codepoints = .{ .Single = 9651 }, .characters = "\xe2\x96\xb3" }, .{ .entity = "&biguplus;", .codepoints = .{ .Single = 10756 }, .characters = "\xe2\xa8\x84" }, .{ .entity = "&bigvee;", .codepoints = .{ .Single = 8897 }, .characters = "\xe2\x8b\x81" }, .{ .entity = "&bigwedge;", .codepoints = .{ .Single = 8896 }, .characters = "\xe2\x8b\x80" }, .{ .entity = "&bkarow;", .codepoints = .{ .Single = 10509 }, .characters = "\xe2\xa4\x8d" }, .{ .entity = "&blacklozenge;", .codepoints = .{ .Single = 10731 }, .characters = "\xe2\xa7\xab" }, .{ .entity = "&blacksquare;", .codepoints = .{ .Single = 9642 }, .characters = "\xe2\x96\xaa" }, .{ .entity = "&blacktriangle;", .codepoints = .{ .Single = 9652 }, .characters = "\xe2\x96\xb4" }, .{ .entity = "&blacktriangledown;", .codepoints = .{ .Single = 9662 }, .characters = "\xe2\x96\xbe" }, .{ .entity = "&blacktriangleleft;", .codepoints = .{ .Single = 9666 }, .characters = "\xe2\x97\x82" }, .{ .entity = "&blacktriangleright;", .codepoints = .{ .Single = 9656 }, .characters = "\xe2\x96\xb8" }, .{ .entity = "&blank;", .codepoints = .{ .Single = 9251 }, .characters = "\xe2\x90\xa3" }, .{ .entity = "&blk12;", .codepoints = .{ .Single = 9618 }, .characters = "\xe2\x96\x92" }, .{ .entity = "&blk14;", .codepoints = .{ .Single = 9617 }, .characters = "\xe2\x96\x91" }, .{ .entity = "&blk34;", .codepoints = .{ .Single = 9619 }, .characters = "\xe2\x96\x93" }, .{ .entity = "&block;", .codepoints = .{ .Single = 9608 }, .characters = "\xe2\x96\x88" }, .{ .entity = "&bne;", .codepoints = .{ .Double = [2]u32{ 61, 8421 } }, .characters = "=\xe2\x83\xa5" }, .{ .entity = "&bnequiv;", .codepoints = .{ .Double = [2]u32{ 8801, 8421 } }, .characters = "\xe2\x89\xa1\xe2\x83\xa5" }, .{ .entity = "&bnot;", .codepoints = .{ .Single = 8976 }, .characters = "\xe2\x8c\x90" }, .{ .entity = "&bopf;", .codepoints = .{ .Single = 120147 }, .characters = "\xf0\x9d\x95\x93" }, .{ .entity = "&bot;", .codepoints = .{ .Single = 8869 }, .characters = "\xe2\x8a\xa5" }, .{ .entity = "&bottom;", .codepoints = .{ .Single = 8869 }, .characters = "\xe2\x8a\xa5" }, .{ .entity = "&bowtie;", .codepoints = .{ .Single = 8904 }, .characters = "\xe2\x8b\x88" }, .{ .entity = "&boxDL;", .codepoints = .{ .Single = 9559 }, .characters = "\xe2\x95\x97" }, .{ .entity = "&boxDR;", .codepoints = .{ .Single = 9556 }, .characters = "\xe2\x95\x94" }, .{ .entity = "&boxDl;", .codepoints = .{ .Single = 9558 }, .characters = "\xe2\x95\x96" }, .{ .entity = "&boxDr;", .codepoints = .{ .Single = 9555 }, .characters = "\xe2\x95\x93" }, .{ .entity = "&boxH;", .codepoints = .{ .Single = 9552 }, .characters = "\xe2\x95\x90" }, .{ .entity = "&boxHD;", .codepoints = .{ .Single = 9574 }, .characters = "\xe2\x95\xa6" }, .{ .entity = "&boxHU;", .codepoints = .{ .Single = 9577 }, .characters = "\xe2\x95\xa9" }, .{ .entity = "&boxHd;", .codepoints = .{ .Single = 9572 }, .characters = "\xe2\x95\xa4" }, .{ .entity = "&boxHu;", .codepoints = .{ .Single = 9575 }, .characters = "\xe2\x95\xa7" }, .{ .entity = "&boxUL;", .codepoints = .{ .Single = 9565 }, .characters = "\xe2\x95\x9d" }, .{ .entity = "&boxUR;", .codepoints = .{ .Single = 9562 }, .characters = "\xe2\x95\x9a" }, .{ .entity = "&boxUl;", .codepoints = .{ .Single = 9564 }, .characters = "\xe2\x95\x9c" }, .{ .entity = "&boxUr;", .codepoints = .{ .Single = 9561 }, .characters = "\xe2\x95\x99" }, .{ .entity = "&boxV;", .codepoints = .{ .Single = 9553 }, .characters = "\xe2\x95\x91" }, .{ .entity = "&boxVH;", .codepoints = .{ .Single = 9580 }, .characters = "\xe2\x95\xac" }, .{ .entity = "&boxVL;", .codepoints = .{ .Single = 9571 }, .characters = "\xe2\x95\xa3" }, .{ .entity = "&boxVR;", .codepoints = .{ .Single = 9568 }, .characters = "\xe2\x95\xa0" }, .{ .entity = "&boxVh;", .codepoints = .{ .Single = 9579 }, .characters = "\xe2\x95\xab" }, .{ .entity = "&boxVl;", .codepoints = .{ .Single = 9570 }, .characters = "\xe2\x95\xa2" }, .{ .entity = "&boxVr;", .codepoints = .{ .Single = 9567 }, .characters = "\xe2\x95\x9f" }, .{ .entity = "&boxbox;", .codepoints = .{ .Single = 10697 }, .characters = "\xe2\xa7\x89" }, .{ .entity = "&boxdL;", .codepoints = .{ .Single = 9557 }, .characters = "\xe2\x95\x95" }, .{ .entity = "&boxdR;", .codepoints = .{ .Single = 9554 }, .characters = "\xe2\x95\x92" }, .{ .entity = "&boxdl;", .codepoints = .{ .Single = 9488 }, .characters = "\xe2\x94\x90" }, .{ .entity = "&boxdr;", .codepoints = .{ .Single = 9484 }, .characters = "\xe2\x94\x8c" }, .{ .entity = "&boxh;", .codepoints = .{ .Single = 9472 }, .characters = "\xe2\x94\x80" }, .{ .entity = "&boxhD;", .codepoints = .{ .Single = 9573 }, .characters = "\xe2\x95\xa5" }, .{ .entity = "&boxhU;", .codepoints = .{ .Single = 9576 }, .characters = "\xe2\x95\xa8" }, .{ .entity = "&boxhd;", .codepoints = .{ .Single = 9516 }, .characters = "\xe2\x94\xac" }, .{ .entity = "&boxhu;", .codepoints = .{ .Single = 9524 }, .characters = "\xe2\x94\xb4" }, .{ .entity = "&boxminus;", .codepoints = .{ .Single = 8863 }, .characters = "\xe2\x8a\x9f" }, .{ .entity = "&boxplus;", .codepoints = .{ .Single = 8862 }, .characters = "\xe2\x8a\x9e" }, .{ .entity = "&boxtimes;", .codepoints = .{ .Single = 8864 }, .characters = "\xe2\x8a\xa0" }, .{ .entity = "&boxuL;", .codepoints = .{ .Single = 9563 }, .characters = "\xe2\x95\x9b" }, .{ .entity = "&boxuR;", .codepoints = .{ .Single = 9560 }, .characters = "\xe2\x95\x98" }, .{ .entity = "&boxul;", .codepoints = .{ .Single = 9496 }, .characters = "\xe2\x94\x98" }, .{ .entity = "&boxur;", .codepoints = .{ .Single = 9492 }, .characters = "\xe2\x94\x94" }, .{ .entity = "&boxv;", .codepoints = .{ .Single = 9474 }, .characters = "\xe2\x94\x82" }, .{ .entity = "&boxvH;", .codepoints = .{ .Single = 9578 }, .characters = "\xe2\x95\xaa" }, .{ .entity = "&boxvL;", .codepoints = .{ .Single = 9569 }, .characters = "\xe2\x95\xa1" }, .{ .entity = "&boxvR;", .codepoints = .{ .Single = 9566 }, .characters = "\xe2\x95\x9e" }, .{ .entity = "&boxvh;", .codepoints = .{ .Single = 9532 }, .characters = "\xe2\x94\xbc" }, .{ .entity = "&boxvl;", .codepoints = .{ .Single = 9508 }, .characters = "\xe2\x94\xa4" }, .{ .entity = "&boxvr;", .codepoints = .{ .Single = 9500 }, .characters = "\xe2\x94\x9c" }, .{ .entity = "&bprime;", .codepoints = .{ .Single = 8245 }, .characters = "\xe2\x80\xb5" }, .{ .entity = "&breve;", .codepoints = .{ .Single = 728 }, .characters = "\xcb\x98" }, .{ .entity = "&brvbar", .codepoints = .{ .Single = 166 }, .characters = "\xc2\xa6" }, .{ .entity = "&brvbar;", .codepoints = .{ .Single = 166 }, .characters = "\xc2\xa6" }, .{ .entity = "&bscr;", .codepoints = .{ .Single = 119991 }, .characters = "\xf0\x9d\x92\xb7" }, .{ .entity = "&bsemi;", .codepoints = .{ .Single = 8271 }, .characters = "\xe2\x81\x8f" }, .{ .entity = "&bsim;", .codepoints = .{ .Single = 8765 }, .characters = "\xe2\x88\xbd" }, .{ .entity = "&bsime;", .codepoints = .{ .Single = 8909 }, .characters = "\xe2\x8b\x8d" }, .{ .entity = "&bsol;", .codepoints = .{ .Single = 92 }, .characters = "\\" }, .{ .entity = "&bsolb;", .codepoints = .{ .Single = 10693 }, .characters = "\xe2\xa7\x85" }, .{ .entity = "&bsolhsub;", .codepoints = .{ .Single = 10184 }, .characters = "\xe2\x9f\x88" }, .{ .entity = "&bull;", .codepoints = .{ .Single = 8226 }, .characters = "\xe2\x80\xa2" }, .{ .entity = "&bullet;", .codepoints = .{ .Single = 8226 }, .characters = "\xe2\x80\xa2" }, .{ .entity = "&bump;", .codepoints = .{ .Single = 8782 }, .characters = "\xe2\x89\x8e" }, .{ .entity = "&bumpE;", .codepoints = .{ .Single = 10926 }, .characters = "\xe2\xaa\xae" }, .{ .entity = "&bumpe;", .codepoints = .{ .Single = 8783 }, .characters = "\xe2\x89\x8f" }, .{ .entity = "&bumpeq;", .codepoints = .{ .Single = 8783 }, .characters = "\xe2\x89\x8f" }, .{ .entity = "&cacute;", .codepoints = .{ .Single = 263 }, .characters = "\xc4\x87" }, .{ .entity = "&cap;", .codepoints = .{ .Single = 8745 }, .characters = "\xe2\x88\xa9" }, .{ .entity = "&capand;", .codepoints = .{ .Single = 10820 }, .characters = "\xe2\xa9\x84" }, .{ .entity = "&capbrcup;", .codepoints = .{ .Single = 10825 }, .characters = "\xe2\xa9\x89" }, .{ .entity = "&capcap;", .codepoints = .{ .Single = 10827 }, .characters = "\xe2\xa9\x8b" }, .{ .entity = "&capcup;", .codepoints = .{ .Single = 10823 }, .characters = "\xe2\xa9\x87" }, .{ .entity = "&capdot;", .codepoints = .{ .Single = 10816 }, .characters = "\xe2\xa9\x80" }, .{ .entity = "&caps;", .codepoints = .{ .Double = [2]u32{ 8745, 65024 } }, .characters = "\xe2\x88\xa9\xef\xb8\x80" }, .{ .entity = "&caret;", .codepoints = .{ .Single = 8257 }, .characters = "\xe2\x81\x81" }, .{ .entity = "&caron;", .codepoints = .{ .Single = 711 }, .characters = "\xcb\x87" }, .{ .entity = "&ccaps;", .codepoints = .{ .Single = 10829 }, .characters = "\xe2\xa9\x8d" }, .{ .entity = "&ccaron;", .codepoints = .{ .Single = 269 }, .characters = "\xc4\x8d" }, .{ .entity = "&ccedil", .codepoints = .{ .Single = 231 }, .characters = "\xc3\xa7" }, .{ .entity = "&ccedil;", .codepoints = .{ .Single = 231 }, .characters = "\xc3\xa7" }, .{ .entity = "&ccirc;", .codepoints = .{ .Single = 265 }, .characters = "\xc4\x89" }, .{ .entity = "&ccups;", .codepoints = .{ .Single = 10828 }, .characters = "\xe2\xa9\x8c" }, .{ .entity = "&ccupssm;", .codepoints = .{ .Single = 10832 }, .characters = "\xe2\xa9\x90" }, .{ .entity = "&cdot;", .codepoints = .{ .Single = 267 }, .characters = "\xc4\x8b" }, .{ .entity = "&cedil", .codepoints = .{ .Single = 184 }, .characters = "\xc2\xb8" }, .{ .entity = "&cedil;", .codepoints = .{ .Single = 184 }, .characters = "\xc2\xb8" }, .{ .entity = "&cemptyv;", .codepoints = .{ .Single = 10674 }, .characters = "\xe2\xa6\xb2" }, .{ .entity = "&cent", .codepoints = .{ .Single = 162 }, .characters = "\xc2\xa2" }, .{ .entity = "&cent;", .codepoints = .{ .Single = 162 }, .characters = "\xc2\xa2" }, .{ .entity = "&centerdot;", .codepoints = .{ .Single = 183 }, .characters = "\xc2\xb7" }, .{ .entity = "&cfr;", .codepoints = .{ .Single = 120096 }, .characters = "\xf0\x9d\x94\xa0" }, .{ .entity = "&chcy;", .codepoints = .{ .Single = 1095 }, .characters = "\xd1\x87" }, .{ .entity = "&check;", .codepoints = .{ .Single = 10003 }, .characters = "\xe2\x9c\x93" }, .{ .entity = "&checkmark;", .codepoints = .{ .Single = 10003 }, .characters = "\xe2\x9c\x93" }, .{ .entity = "&chi;", .codepoints = .{ .Single = 967 }, .characters = "\xcf\x87" }, .{ .entity = "&cir;", .codepoints = .{ .Single = 9675 }, .characters = "\xe2\x97\x8b" }, .{ .entity = "&cirE;", .codepoints = .{ .Single = 10691 }, .characters = "\xe2\xa7\x83" }, .{ .entity = "&circ;", .codepoints = .{ .Single = 710 }, .characters = "\xcb\x86" }, .{ .entity = "&circeq;", .codepoints = .{ .Single = 8791 }, .characters = "\xe2\x89\x97" }, .{ .entity = "&circlearrowleft;", .codepoints = .{ .Single = 8634 }, .characters = "\xe2\x86\xba" }, .{ .entity = "&circlearrowright;", .codepoints = .{ .Single = 8635 }, .characters = "\xe2\x86\xbb" }, .{ .entity = "&circledR;", .codepoints = .{ .Single = 174 }, .characters = "\xc2\xae" }, .{ .entity = "&circledS;", .codepoints = .{ .Single = 9416 }, .characters = "\xe2\x93\x88" }, .{ .entity = "&circledast;", .codepoints = .{ .Single = 8859 }, .characters = "\xe2\x8a\x9b" }, .{ .entity = "&circledcirc;", .codepoints = .{ .Single = 8858 }, .characters = "\xe2\x8a\x9a" }, .{ .entity = "&circleddash;", .codepoints = .{ .Single = 8861 }, .characters = "\xe2\x8a\x9d" }, .{ .entity = "&cire;", .codepoints = .{ .Single = 8791 }, .characters = "\xe2\x89\x97" }, .{ .entity = "&cirfnint;", .codepoints = .{ .Single = 10768 }, .characters = "\xe2\xa8\x90" }, .{ .entity = "&cirmid;", .codepoints = .{ .Single = 10991 }, .characters = "\xe2\xab\xaf" }, .{ .entity = "&cirscir;", .codepoints = .{ .Single = 10690 }, .characters = "\xe2\xa7\x82" }, .{ .entity = "&clubs;", .codepoints = .{ .Single = 9827 }, .characters = "\xe2\x99\xa3" }, .{ .entity = "&clubsuit;", .codepoints = .{ .Single = 9827 }, .characters = "\xe2\x99\xa3" }, .{ .entity = "&colon;", .codepoints = .{ .Single = 58 }, .characters = ":" }, .{ .entity = "&colone;", .codepoints = .{ .Single = 8788 }, .characters = "\xe2\x89\x94" }, .{ .entity = "&coloneq;", .codepoints = .{ .Single = 8788 }, .characters = "\xe2\x89\x94" }, .{ .entity = "&comma;", .codepoints = .{ .Single = 44 }, .characters = "," }, .{ .entity = "&commat;", .codepoints = .{ .Single = 64 }, .characters = "@" }, .{ .entity = "&comp;", .codepoints = .{ .Single = 8705 }, .characters = "\xe2\x88\x81" }, .{ .entity = "&compfn;", .codepoints = .{ .Single = 8728 }, .characters = "\xe2\x88\x98" }, .{ .entity = "&complement;", .codepoints = .{ .Single = 8705 }, .characters = "\xe2\x88\x81" }, .{ .entity = "&complexes;", .codepoints = .{ .Single = 8450 }, .characters = "\xe2\x84\x82" }, .{ .entity = "&cong;", .codepoints = .{ .Single = 8773 }, .characters = "\xe2\x89\x85" }, .{ .entity = "&congdot;", .codepoints = .{ .Single = 10861 }, .characters = "\xe2\xa9\xad" }, .{ .entity = "&conint;", .codepoints = .{ .Single = 8750 }, .characters = "\xe2\x88\xae" }, .{ .entity = "&copf;", .codepoints = .{ .Single = 120148 }, .characters = "\xf0\x9d\x95\x94" }, .{ .entity = "&coprod;", .codepoints = .{ .Single = 8720 }, .characters = "\xe2\x88\x90" }, .{ .entity = "&copy", .codepoints = .{ .Single = 169 }, .characters = "\xc2\xa9" }, .{ .entity = "&copy;", .codepoints = .{ .Single = 169 }, .characters = "\xc2\xa9" }, .{ .entity = "&copysr;", .codepoints = .{ .Single = 8471 }, .characters = "\xe2\x84\x97" }, .{ .entity = "&crarr;", .codepoints = .{ .Single = 8629 }, .characters = "\xe2\x86\xb5" }, .{ .entity = "&cross;", .codepoints = .{ .Single = 10007 }, .characters = "\xe2\x9c\x97" }, .{ .entity = "&cscr;", .codepoints = .{ .Single = 119992 }, .characters = "\xf0\x9d\x92\xb8" }, .{ .entity = "&csub;", .codepoints = .{ .Single = 10959 }, .characters = "\xe2\xab\x8f" }, .{ .entity = "&csube;", .codepoints = .{ .Single = 10961 }, .characters = "\xe2\xab\x91" }, .{ .entity = "&csup;", .codepoints = .{ .Single = 10960 }, .characters = "\xe2\xab\x90" }, .{ .entity = "&csupe;", .codepoints = .{ .Single = 10962 }, .characters = "\xe2\xab\x92" }, .{ .entity = "&ctdot;", .codepoints = .{ .Single = 8943 }, .characters = "\xe2\x8b\xaf" }, .{ .entity = "&cudarrl;", .codepoints = .{ .Single = 10552 }, .characters = "\xe2\xa4\xb8" }, .{ .entity = "&cudarrr;", .codepoints = .{ .Single = 10549 }, .characters = "\xe2\xa4\xb5" }, .{ .entity = "&cuepr;", .codepoints = .{ .Single = 8926 }, .characters = "\xe2\x8b\x9e" }, .{ .entity = "&cuesc;", .codepoints = .{ .Single = 8927 }, .characters = "\xe2\x8b\x9f" }, .{ .entity = "&cularr;", .codepoints = .{ .Single = 8630 }, .characters = "\xe2\x86\xb6" }, .{ .entity = "&cularrp;", .codepoints = .{ .Single = 10557 }, .characters = "\xe2\xa4\xbd" }, .{ .entity = "&cup;", .codepoints = .{ .Single = 8746 }, .characters = "\xe2\x88\xaa" }, .{ .entity = "&cupbrcap;", .codepoints = .{ .Single = 10824 }, .characters = "\xe2\xa9\x88" }, .{ .entity = "&cupcap;", .codepoints = .{ .Single = 10822 }, .characters = "\xe2\xa9\x86" }, .{ .entity = "&cupcup;", .codepoints = .{ .Single = 10826 }, .characters = "\xe2\xa9\x8a" }, .{ .entity = "&cupdot;", .codepoints = .{ .Single = 8845 }, .characters = "\xe2\x8a\x8d" }, .{ .entity = "&cupor;", .codepoints = .{ .Single = 10821 }, .characters = "\xe2\xa9\x85" }, .{ .entity = "&cups;", .codepoints = .{ .Double = [2]u32{ 8746, 65024 } }, .characters = "\xe2\x88\xaa\xef\xb8\x80" }, .{ .entity = "&curarr;", .codepoints = .{ .Single = 8631 }, .characters = "\xe2\x86\xb7" }, .{ .entity = "&curarrm;", .codepoints = .{ .Single = 10556 }, .characters = "\xe2\xa4\xbc" }, .{ .entity = "&curlyeqprec;", .codepoints = .{ .Single = 8926 }, .characters = "\xe2\x8b\x9e" }, .{ .entity = "&curlyeqsucc;", .codepoints = .{ .Single = 8927 }, .characters = "\xe2\x8b\x9f" }, .{ .entity = "&curlyvee;", .codepoints = .{ .Single = 8910 }, .characters = "\xe2\x8b\x8e" }, .{ .entity = "&curlywedge;", .codepoints = .{ .Single = 8911 }, .characters = "\xe2\x8b\x8f" }, .{ .entity = "&curren", .codepoints = .{ .Single = 164 }, .characters = "\xc2\xa4" }, .{ .entity = "&curren;", .codepoints = .{ .Single = 164 }, .characters = "\xc2\xa4" }, .{ .entity = "&curvearrowleft;", .codepoints = .{ .Single = 8630 }, .characters = "\xe2\x86\xb6" }, .{ .entity = "&curvearrowright;", .codepoints = .{ .Single = 8631 }, .characters = "\xe2\x86\xb7" }, .{ .entity = "&cuvee;", .codepoints = .{ .Single = 8910 }, .characters = "\xe2\x8b\x8e" }, .{ .entity = "&cuwed;", .codepoints = .{ .Single = 8911 }, .characters = "\xe2\x8b\x8f" }, .{ .entity = "&cwconint;", .codepoints = .{ .Single = 8754 }, .characters = "\xe2\x88\xb2" }, .{ .entity = "&cwint;", .codepoints = .{ .Single = 8753 }, .characters = "\xe2\x88\xb1" }, .{ .entity = "&cylcty;", .codepoints = .{ .Single = 9005 }, .characters = "\xe2\x8c\xad" }, .{ .entity = "&dArr;", .codepoints = .{ .Single = 8659 }, .characters = "\xe2\x87\x93" }, .{ .entity = "&dHar;", .codepoints = .{ .Single = 10597 }, .characters = "\xe2\xa5\xa5" }, .{ .entity = "&dagger;", .codepoints = .{ .Single = 8224 }, .characters = "\xe2\x80\xa0" }, .{ .entity = "&daleth;", .codepoints = .{ .Single = 8504 }, .characters = "\xe2\x84\xb8" }, .{ .entity = "&darr;", .codepoints = .{ .Single = 8595 }, .characters = "\xe2\x86\x93" }, .{ .entity = "&dash;", .codepoints = .{ .Single = 8208 }, .characters = "\xe2\x80\x90" }, .{ .entity = "&dashv;", .codepoints = .{ .Single = 8867 }, .characters = "\xe2\x8a\xa3" }, .{ .entity = "&dbkarow;", .codepoints = .{ .Single = 10511 }, .characters = "\xe2\xa4\x8f" }, .{ .entity = "&dblac;", .codepoints = .{ .Single = 733 }, .characters = "\xcb\x9d" }, .{ .entity = "&dcaron;", .codepoints = .{ .Single = 271 }, .characters = "\xc4\x8f" }, .{ .entity = "&dcy;", .codepoints = .{ .Single = 1076 }, .characters = "\xd0\xb4" }, .{ .entity = "&dd;", .codepoints = .{ .Single = 8518 }, .characters = "\xe2\x85\x86" }, .{ .entity = "&ddagger;", .codepoints = .{ .Single = 8225 }, .characters = "\xe2\x80\xa1" }, .{ .entity = "&ddarr;", .codepoints = .{ .Single = 8650 }, .characters = "\xe2\x87\x8a" }, .{ .entity = "&ddotseq;", .codepoints = .{ .Single = 10871 }, .characters = "\xe2\xa9\xb7" }, .{ .entity = "&deg", .codepoints = .{ .Single = 176 }, .characters = "\xc2\xb0" }, .{ .entity = "&deg;", .codepoints = .{ .Single = 176 }, .characters = "\xc2\xb0" }, .{ .entity = "&delta;", .codepoints = .{ .Single = 948 }, .characters = "\xce\xb4" }, .{ .entity = "&demptyv;", .codepoints = .{ .Single = 10673 }, .characters = "\xe2\xa6\xb1" }, .{ .entity = "&dfisht;", .codepoints = .{ .Single = 10623 }, .characters = "\xe2\xa5\xbf" }, .{ .entity = "&dfr;", .codepoints = .{ .Single = 120097 }, .characters = "\xf0\x9d\x94\xa1" }, .{ .entity = "&dharl;", .codepoints = .{ .Single = 8643 }, .characters = "\xe2\x87\x83" }, .{ .entity = "&dharr;", .codepoints = .{ .Single = 8642 }, .characters = "\xe2\x87\x82" }, .{ .entity = "&diam;", .codepoints = .{ .Single = 8900 }, .characters = "\xe2\x8b\x84" }, .{ .entity = "&diamond;", .codepoints = .{ .Single = 8900 }, .characters = "\xe2\x8b\x84" }, .{ .entity = "&diamondsuit;", .codepoints = .{ .Single = 9830 }, .characters = "\xe2\x99\xa6" }, .{ .entity = "&diams;", .codepoints = .{ .Single = 9830 }, .characters = "\xe2\x99\xa6" }, .{ .entity = "&die;", .codepoints = .{ .Single = 168 }, .characters = "\xc2\xa8" }, .{ .entity = "&digamma;", .codepoints = .{ .Single = 989 }, .characters = "\xcf\x9d" }, .{ .entity = "&disin;", .codepoints = .{ .Single = 8946 }, .characters = "\xe2\x8b\xb2" }, .{ .entity = "&div;", .codepoints = .{ .Single = 247 }, .characters = "\xc3\xb7" }, .{ .entity = "&divide", .codepoints = .{ .Single = 247 }, .characters = "\xc3\xb7" }, .{ .entity = "&divide;", .codepoints = .{ .Single = 247 }, .characters = "\xc3\xb7" }, .{ .entity = "&divideontimes;", .codepoints = .{ .Single = 8903 }, .characters = "\xe2\x8b\x87" }, .{ .entity = "&divonx;", .codepoints = .{ .Single = 8903 }, .characters = "\xe2\x8b\x87" }, .{ .entity = "&djcy;", .codepoints = .{ .Single = 1106 }, .characters = "\xd1\x92" }, .{ .entity = "&dlcorn;", .codepoints = .{ .Single = 8990 }, .characters = "\xe2\x8c\x9e" }, .{ .entity = "&dlcrop;", .codepoints = .{ .Single = 8973 }, .characters = "\xe2\x8c\x8d" }, .{ .entity = "&dollar;", .codepoints = .{ .Single = 36 }, .characters = "$" }, .{ .entity = "&dopf;", .codepoints = .{ .Single = 120149 }, .characters = "\xf0\x9d\x95\x95" }, .{ .entity = "&dot;", .codepoints = .{ .Single = 729 }, .characters = "\xcb\x99" }, .{ .entity = "&doteq;", .codepoints = .{ .Single = 8784 }, .characters = "\xe2\x89\x90" }, .{ .entity = "&doteqdot;", .codepoints = .{ .Single = 8785 }, .characters = "\xe2\x89\x91" }, .{ .entity = "&dotminus;", .codepoints = .{ .Single = 8760 }, .characters = "\xe2\x88\xb8" }, .{ .entity = "&dotplus;", .codepoints = .{ .Single = 8724 }, .characters = "\xe2\x88\x94" }, .{ .entity = "&dotsquare;", .codepoints = .{ .Single = 8865 }, .characters = "\xe2\x8a\xa1" }, .{ .entity = "&doublebarwedge;", .codepoints = .{ .Single = 8966 }, .characters = "\xe2\x8c\x86" }, .{ .entity = "&downarrow;", .codepoints = .{ .Single = 8595 }, .characters = "\xe2\x86\x93" }, .{ .entity = "&downdownarrows;", .codepoints = .{ .Single = 8650 }, .characters = "\xe2\x87\x8a" }, .{ .entity = "&downharpoonleft;", .codepoints = .{ .Single = 8643 }, .characters = "\xe2\x87\x83" }, .{ .entity = "&downharpoonright;", .codepoints = .{ .Single = 8642 }, .characters = "\xe2\x87\x82" }, .{ .entity = "&drbkarow;", .codepoints = .{ .Single = 10512 }, .characters = "\xe2\xa4\x90" }, .{ .entity = "&drcorn;", .codepoints = .{ .Single = 8991 }, .characters = "\xe2\x8c\x9f" }, .{ .entity = "&drcrop;", .codepoints = .{ .Single = 8972 }, .characters = "\xe2\x8c\x8c" }, .{ .entity = "&dscr;", .codepoints = .{ .Single = 119993 }, .characters = "\xf0\x9d\x92\xb9" }, .{ .entity = "&dscy;", .codepoints = .{ .Single = 1109 }, .characters = "\xd1\x95" }, .{ .entity = "&dsol;", .codepoints = .{ .Single = 10742 }, .characters = "\xe2\xa7\xb6" }, .{ .entity = "&dstrok;", .codepoints = .{ .Single = 273 }, .characters = "\xc4\x91" }, .{ .entity = "&dtdot;", .codepoints = .{ .Single = 8945 }, .characters = "\xe2\x8b\xb1" }, .{ .entity = "&dtri;", .codepoints = .{ .Single = 9663 }, .characters = "\xe2\x96\xbf" }, .{ .entity = "&dtrif;", .codepoints = .{ .Single = 9662 }, .characters = "\xe2\x96\xbe" }, .{ .entity = "&duarr;", .codepoints = .{ .Single = 8693 }, .characters = "\xe2\x87\xb5" }, .{ .entity = "&duhar;", .codepoints = .{ .Single = 10607 }, .characters = "\xe2\xa5\xaf" }, .{ .entity = "&dwangle;", .codepoints = .{ .Single = 10662 }, .characters = "\xe2\xa6\xa6" }, .{ .entity = "&dzcy;", .codepoints = .{ .Single = 1119 }, .characters = "\xd1\x9f" }, .{ .entity = "&dzigrarr;", .codepoints = .{ .Single = 10239 }, .characters = "\xe2\x9f\xbf" }, .{ .entity = "&eDDot;", .codepoints = .{ .Single = 10871 }, .characters = "\xe2\xa9\xb7" }, .{ .entity = "&eDot;", .codepoints = .{ .Single = 8785 }, .characters = "\xe2\x89\x91" }, .{ .entity = "&eacute", .codepoints = .{ .Single = 233 }, .characters = "\xc3\xa9" }, .{ .entity = "&eacute;", .codepoints = .{ .Single = 233 }, .characters = "\xc3\xa9" }, .{ .entity = "&easter;", .codepoints = .{ .Single = 10862 }, .characters = "\xe2\xa9\xae" }, .{ .entity = "&ecaron;", .codepoints = .{ .Single = 283 }, .characters = "\xc4\x9b" }, .{ .entity = "&ecir;", .codepoints = .{ .Single = 8790 }, .characters = "\xe2\x89\x96" }, .{ .entity = "&ecirc", .codepoints = .{ .Single = 234 }, .characters = "\xc3\xaa" }, .{ .entity = "&ecirc;", .codepoints = .{ .Single = 234 }, .characters = "\xc3\xaa" }, .{ .entity = "&ecolon;", .codepoints = .{ .Single = 8789 }, .characters = "\xe2\x89\x95" }, .{ .entity = "&ecy;", .codepoints = .{ .Single = 1101 }, .characters = "\xd1\x8d" }, .{ .entity = "&edot;", .codepoints = .{ .Single = 279 }, .characters = "\xc4\x97" }, .{ .entity = "&ee;", .codepoints = .{ .Single = 8519 }, .characters = "\xe2\x85\x87" }, .{ .entity = "&efDot;", .codepoints = .{ .Single = 8786 }, .characters = "\xe2\x89\x92" }, .{ .entity = "&efr;", .codepoints = .{ .Single = 120098 }, .characters = "\xf0\x9d\x94\xa2" }, .{ .entity = "&eg;", .codepoints = .{ .Single = 10906 }, .characters = "\xe2\xaa\x9a" }, .{ .entity = "&egrave", .codepoints = .{ .Single = 232 }, .characters = "\xc3\xa8" }, .{ .entity = "&egrave;", .codepoints = .{ .Single = 232 }, .characters = "\xc3\xa8" }, .{ .entity = "&egs;", .codepoints = .{ .Single = 10902 }, .characters = "\xe2\xaa\x96" }, .{ .entity = "&egsdot;", .codepoints = .{ .Single = 10904 }, .characters = "\xe2\xaa\x98" }, .{ .entity = "&el;", .codepoints = .{ .Single = 10905 }, .characters = "\xe2\xaa\x99" }, .{ .entity = "&elinters;", .codepoints = .{ .Single = 9191 }, .characters = "\xe2\x8f\xa7" }, .{ .entity = "&ell;", .codepoints = .{ .Single = 8467 }, .characters = "\xe2\x84\x93" }, .{ .entity = "&els;", .codepoints = .{ .Single = 10901 }, .characters = "\xe2\xaa\x95" }, .{ .entity = "&elsdot;", .codepoints = .{ .Single = 10903 }, .characters = "\xe2\xaa\x97" }, .{ .entity = "&emacr;", .codepoints = .{ .Single = 275 }, .characters = "\xc4\x93" }, .{ .entity = "&empty;", .codepoints = .{ .Single = 8709 }, .characters = "\xe2\x88\x85" }, .{ .entity = "&emptyset;", .codepoints = .{ .Single = 8709 }, .characters = "\xe2\x88\x85" }, .{ .entity = "&emptyv;", .codepoints = .{ .Single = 8709 }, .characters = "\xe2\x88\x85" }, .{ .entity = "&emsp13;", .codepoints = .{ .Single = 8196 }, .characters = "\xe2\x80\x84" }, .{ .entity = "&emsp14;", .codepoints = .{ .Single = 8197 }, .characters = "\xe2\x80\x85" }, .{ .entity = "&emsp;", .codepoints = .{ .Single = 8195 }, .characters = "\xe2\x80\x83" }, .{ .entity = "&eng;", .codepoints = .{ .Single = 331 }, .characters = "\xc5\x8b" }, .{ .entity = "&ensp;", .codepoints = .{ .Single = 8194 }, .characters = "\xe2\x80\x82" }, .{ .entity = "&eogon;", .codepoints = .{ .Single = 281 }, .characters = "\xc4\x99" }, .{ .entity = "&eopf;", .codepoints = .{ .Single = 120150 }, .characters = "\xf0\x9d\x95\x96" }, .{ .entity = "&epar;", .codepoints = .{ .Single = 8917 }, .characters = "\xe2\x8b\x95" }, .{ .entity = "&eparsl;", .codepoints = .{ .Single = 10723 }, .characters = "\xe2\xa7\xa3" }, .{ .entity = "&eplus;", .codepoints = .{ .Single = 10865 }, .characters = "\xe2\xa9\xb1" }, .{ .entity = "&epsi;", .codepoints = .{ .Single = 949 }, .characters = "\xce\xb5" }, .{ .entity = "&epsilon;", .codepoints = .{ .Single = 949 }, .characters = "\xce\xb5" }, .{ .entity = "&epsiv;", .codepoints = .{ .Single = 1013 }, .characters = "\xcf\xb5" }, .{ .entity = "&eqcirc;", .codepoints = .{ .Single = 8790 }, .characters = "\xe2\x89\x96" }, .{ .entity = "&eqcolon;", .codepoints = .{ .Single = 8789 }, .characters = "\xe2\x89\x95" }, .{ .entity = "&eqsim;", .codepoints = .{ .Single = 8770 }, .characters = "\xe2\x89\x82" }, .{ .entity = "&eqslantgtr;", .codepoints = .{ .Single = 10902 }, .characters = "\xe2\xaa\x96" }, .{ .entity = "&eqslantless;", .codepoints = .{ .Single = 10901 }, .characters = "\xe2\xaa\x95" }, .{ .entity = "&equals;", .codepoints = .{ .Single = 61 }, .characters = "=" }, .{ .entity = "&equest;", .codepoints = .{ .Single = 8799 }, .characters = "\xe2\x89\x9f" }, .{ .entity = "&equiv;", .codepoints = .{ .Single = 8801 }, .characters = "\xe2\x89\xa1" }, .{ .entity = "&equivDD;", .codepoints = .{ .Single = 10872 }, .characters = "\xe2\xa9\xb8" }, .{ .entity = "&eqvparsl;", .codepoints = .{ .Single = 10725 }, .characters = "\xe2\xa7\xa5" }, .{ .entity = "&erDot;", .codepoints = .{ .Single = 8787 }, .characters = "\xe2\x89\x93" }, .{ .entity = "&erarr;", .codepoints = .{ .Single = 10609 }, .characters = "\xe2\xa5\xb1" }, .{ .entity = "&escr;", .codepoints = .{ .Single = 8495 }, .characters = "\xe2\x84\xaf" }, .{ .entity = "&esdot;", .codepoints = .{ .Single = 8784 }, .characters = "\xe2\x89\x90" }, .{ .entity = "&esim;", .codepoints = .{ .Single = 8770 }, .characters = "\xe2\x89\x82" }, .{ .entity = "&eta;", .codepoints = .{ .Single = 951 }, .characters = "\xce\xb7" }, .{ .entity = "&eth", .codepoints = .{ .Single = 240 }, .characters = "\xc3\xb0" }, .{ .entity = "&eth;", .codepoints = .{ .Single = 240 }, .characters = "\xc3\xb0" }, .{ .entity = "&euml", .codepoints = .{ .Single = 235 }, .characters = "\xc3\xab" }, .{ .entity = "&euml;", .codepoints = .{ .Single = 235 }, .characters = "\xc3\xab" }, .{ .entity = "&euro;", .codepoints = .{ .Single = 8364 }, .characters = "\xe2\x82\xac" }, .{ .entity = "&excl;", .codepoints = .{ .Single = 33 }, .characters = "!" }, .{ .entity = "&exist;", .codepoints = .{ .Single = 8707 }, .characters = "\xe2\x88\x83" }, .{ .entity = "&expectation;", .codepoints = .{ .Single = 8496 }, .characters = "\xe2\x84\xb0" }, .{ .entity = "&exponentiale;", .codepoints = .{ .Single = 8519 }, .characters = "\xe2\x85\x87" }, .{ .entity = "&fallingdotseq;", .codepoints = .{ .Single = 8786 }, .characters = "\xe2\x89\x92" }, .{ .entity = "&fcy;", .codepoints = .{ .Single = 1092 }, .characters = "\xd1\x84" }, .{ .entity = "&female;", .codepoints = .{ .Single = 9792 }, .characters = "\xe2\x99\x80" }, .{ .entity = "&ffilig;", .codepoints = .{ .Single = 64259 }, .characters = "\xef\xac\x83" }, .{ .entity = "&fflig;", .codepoints = .{ .Single = 64256 }, .characters = "\xef\xac\x80" }, .{ .entity = "&ffllig;", .codepoints = .{ .Single = 64260 }, .characters = "\xef\xac\x84" }, .{ .entity = "&ffr;", .codepoints = .{ .Single = 120099 }, .characters = "\xf0\x9d\x94\xa3" }, .{ .entity = "&filig;", .codepoints = .{ .Single = 64257 }, .characters = "\xef\xac\x81" }, .{ .entity = "&fjlig;", .codepoints = .{ .Double = [2]u32{ 102, 106 } }, .characters = "fj" }, .{ .entity = "&flat;", .codepoints = .{ .Single = 9837 }, .characters = "\xe2\x99\xad" }, .{ .entity = "&fllig;", .codepoints = .{ .Single = 64258 }, .characters = "\xef\xac\x82" }, .{ .entity = "&fltns;", .codepoints = .{ .Single = 9649 }, .characters = "\xe2\x96\xb1" }, .{ .entity = "&fnof;", .codepoints = .{ .Single = 402 }, .characters = "\xc6\x92" }, .{ .entity = "&fopf;", .codepoints = .{ .Single = 120151 }, .characters = "\xf0\x9d\x95\x97" }, .{ .entity = "&forall;", .codepoints = .{ .Single = 8704 }, .characters = "\xe2\x88\x80" }, .{ .entity = "&fork;", .codepoints = .{ .Single = 8916 }, .characters = "\xe2\x8b\x94" }, .{ .entity = "&forkv;", .codepoints = .{ .Single = 10969 }, .characters = "\xe2\xab\x99" }, .{ .entity = "&fpartint;", .codepoints = .{ .Single = 10765 }, .characters = "\xe2\xa8\x8d" }, .{ .entity = "&frac12", .codepoints = .{ .Single = 189 }, .characters = "\xc2\xbd" }, .{ .entity = "&frac12;", .codepoints = .{ .Single = 189 }, .characters = "\xc2\xbd" }, .{ .entity = "&frac13;", .codepoints = .{ .Single = 8531 }, .characters = "\xe2\x85\x93" }, .{ .entity = "&frac14", .codepoints = .{ .Single = 188 }, .characters = "\xc2\xbc" }, .{ .entity = "&frac14;", .codepoints = .{ .Single = 188 }, .characters = "\xc2\xbc" }, .{ .entity = "&frac15;", .codepoints = .{ .Single = 8533 }, .characters = "\xe2\x85\x95" }, .{ .entity = "&frac16;", .codepoints = .{ .Single = 8537 }, .characters = "\xe2\x85\x99" }, .{ .entity = "&frac18;", .codepoints = .{ .Single = 8539 }, .characters = "\xe2\x85\x9b" }, .{ .entity = "&frac23;", .codepoints = .{ .Single = 8532 }, .characters = "\xe2\x85\x94" }, .{ .entity = "&frac25;", .codepoints = .{ .Single = 8534 }, .characters = "\xe2\x85\x96" }, .{ .entity = "&frac34", .codepoints = .{ .Single = 190 }, .characters = "\xc2\xbe" }, .{ .entity = "&frac34;", .codepoints = .{ .Single = 190 }, .characters = "\xc2\xbe" }, .{ .entity = "&frac35;", .codepoints = .{ .Single = 8535 }, .characters = "\xe2\x85\x97" }, .{ .entity = "&frac38;", .codepoints = .{ .Single = 8540 }, .characters = "\xe2\x85\x9c" }, .{ .entity = "&frac45;", .codepoints = .{ .Single = 8536 }, .characters = "\xe2\x85\x98" }, .{ .entity = "&frac56;", .codepoints = .{ .Single = 8538 }, .characters = "\xe2\x85\x9a" }, .{ .entity = "&frac58;", .codepoints = .{ .Single = 8541 }, .characters = "\xe2\x85\x9d" }, .{ .entity = "&frac78;", .codepoints = .{ .Single = 8542 }, .characters = "\xe2\x85\x9e" }, .{ .entity = "&frasl;", .codepoints = .{ .Single = 8260 }, .characters = "\xe2\x81\x84" }, .{ .entity = "&frown;", .codepoints = .{ .Single = 8994 }, .characters = "\xe2\x8c\xa2" }, .{ .entity = "&fscr;", .codepoints = .{ .Single = 119995 }, .characters = "\xf0\x9d\x92\xbb" }, .{ .entity = "&gE;", .codepoints = .{ .Single = 8807 }, .characters = "\xe2\x89\xa7" }, .{ .entity = "&gEl;", .codepoints = .{ .Single = 10892 }, .characters = "\xe2\xaa\x8c" }, .{ .entity = "&gacute;", .codepoints = .{ .Single = 501 }, .characters = "\xc7\xb5" }, .{ .entity = "&gamma;", .codepoints = .{ .Single = 947 }, .characters = "\xce\xb3" }, .{ .entity = "&gammad;", .codepoints = .{ .Single = 989 }, .characters = "\xcf\x9d" }, .{ .entity = "&gap;", .codepoints = .{ .Single = 10886 }, .characters = "\xe2\xaa\x86" }, .{ .entity = "&gbreve;", .codepoints = .{ .Single = 287 }, .characters = "\xc4\x9f" }, .{ .entity = "&gcirc;", .codepoints = .{ .Single = 285 }, .characters = "\xc4\x9d" }, .{ .entity = "&gcy;", .codepoints = .{ .Single = 1075 }, .characters = "\xd0\xb3" }, .{ .entity = "&gdot;", .codepoints = .{ .Single = 289 }, .characters = "\xc4\xa1" }, .{ .entity = "&ge;", .codepoints = .{ .Single = 8805 }, .characters = "\xe2\x89\xa5" }, .{ .entity = "&gel;", .codepoints = .{ .Single = 8923 }, .characters = "\xe2\x8b\x9b" }, .{ .entity = "&geq;", .codepoints = .{ .Single = 8805 }, .characters = "\xe2\x89\xa5" }, .{ .entity = "&geqq;", .codepoints = .{ .Single = 8807 }, .characters = "\xe2\x89\xa7" }, .{ .entity = "&geqslant;", .codepoints = .{ .Single = 10878 }, .characters = "\xe2\xa9\xbe" }, .{ .entity = "&ges;", .codepoints = .{ .Single = 10878 }, .characters = "\xe2\xa9\xbe" }, .{ .entity = "&gescc;", .codepoints = .{ .Single = 10921 }, .characters = "\xe2\xaa\xa9" }, .{ .entity = "&gesdot;", .codepoints = .{ .Single = 10880 }, .characters = "\xe2\xaa\x80" }, .{ .entity = "&gesdoto;", .codepoints = .{ .Single = 10882 }, .characters = "\xe2\xaa\x82" }, .{ .entity = "&gesdotol;", .codepoints = .{ .Single = 10884 }, .characters = "\xe2\xaa\x84" }, .{ .entity = "&gesl;", .codepoints = .{ .Double = [2]u32{ 8923, 65024 } }, .characters = "\xe2\x8b\x9b\xef\xb8\x80" }, .{ .entity = "&gesles;", .codepoints = .{ .Single = 10900 }, .characters = "\xe2\xaa\x94" }, .{ .entity = "&gfr;", .codepoints = .{ .Single = 120100 }, .characters = "\xf0\x9d\x94\xa4" }, .{ .entity = "&gg;", .codepoints = .{ .Single = 8811 }, .characters = "\xe2\x89\xab" }, .{ .entity = "&ggg;", .codepoints = .{ .Single = 8921 }, .characters = "\xe2\x8b\x99" }, .{ .entity = "&gimel;", .codepoints = .{ .Single = 8503 }, .characters = "\xe2\x84\xb7" }, .{ .entity = "&gjcy;", .codepoints = .{ .Single = 1107 }, .characters = "\xd1\x93" }, .{ .entity = "&gl;", .codepoints = .{ .Single = 8823 }, .characters = "\xe2\x89\xb7" }, .{ .entity = "&glE;", .codepoints = .{ .Single = 10898 }, .characters = "\xe2\xaa\x92" }, .{ .entity = "&gla;", .codepoints = .{ .Single = 10917 }, .characters = "\xe2\xaa\xa5" }, .{ .entity = "&glj;", .codepoints = .{ .Single = 10916 }, .characters = "\xe2\xaa\xa4" }, .{ .entity = "&gnE;", .codepoints = .{ .Single = 8809 }, .characters = "\xe2\x89\xa9" }, .{ .entity = "&gnap;", .codepoints = .{ .Single = 10890 }, .characters = "\xe2\xaa\x8a" }, .{ .entity = "&gnapprox;", .codepoints = .{ .Single = 10890 }, .characters = "\xe2\xaa\x8a" }, .{ .entity = "&gne;", .codepoints = .{ .Single = 10888 }, .characters = "\xe2\xaa\x88" }, .{ .entity = "&gneq;", .codepoints = .{ .Single = 10888 }, .characters = "\xe2\xaa\x88" }, .{ .entity = "&gneqq;", .codepoints = .{ .Single = 8809 }, .characters = "\xe2\x89\xa9" }, .{ .entity = "&gnsim;", .codepoints = .{ .Single = 8935 }, .characters = "\xe2\x8b\xa7" }, .{ .entity = "&gopf;", .codepoints = .{ .Single = 120152 }, .characters = "\xf0\x9d\x95\x98" }, .{ .entity = "&grave;", .codepoints = .{ .Single = 96 }, .characters = "`" }, .{ .entity = "&gscr;", .codepoints = .{ .Single = 8458 }, .characters = "\xe2\x84\x8a" }, .{ .entity = "&gsim;", .codepoints = .{ .Single = 8819 }, .characters = "\xe2\x89\xb3" }, .{ .entity = "&gsime;", .codepoints = .{ .Single = 10894 }, .characters = "\xe2\xaa\x8e" }, .{ .entity = "&gsiml;", .codepoints = .{ .Single = 10896 }, .characters = "\xe2\xaa\x90" }, .{ .entity = "&gt", .codepoints = .{ .Single = 62 }, .characters = ">" }, .{ .entity = "&gt;", .codepoints = .{ .Single = 62 }, .characters = ">" }, .{ .entity = "&gtcc;", .codepoints = .{ .Single = 10919 }, .characters = "\xe2\xaa\xa7" }, .{ .entity = "&gtcir;", .codepoints = .{ .Single = 10874 }, .characters = "\xe2\xa9\xba" }, .{ .entity = "&gtdot;", .codepoints = .{ .Single = 8919 }, .characters = "\xe2\x8b\x97" }, .{ .entity = "&gtlPar;", .codepoints = .{ .Single = 10645 }, .characters = "\xe2\xa6\x95" }, .{ .entity = "&gtquest;", .codepoints = .{ .Single = 10876 }, .characters = "\xe2\xa9\xbc" }, .{ .entity = "&gtrapprox;", .codepoints = .{ .Single = 10886 }, .characters = "\xe2\xaa\x86" }, .{ .entity = "&gtrarr;", .codepoints = .{ .Single = 10616 }, .characters = "\xe2\xa5\xb8" }, .{ .entity = "&gtrdot;", .codepoints = .{ .Single = 8919 }, .characters = "\xe2\x8b\x97" }, .{ .entity = "&gtreqless;", .codepoints = .{ .Single = 8923 }, .characters = "\xe2\x8b\x9b" }, .{ .entity = "&gtreqqless;", .codepoints = .{ .Single = 10892 }, .characters = "\xe2\xaa\x8c" }, .{ .entity = "&gtrless;", .codepoints = .{ .Single = 8823 }, .characters = "\xe2\x89\xb7" }, .{ .entity = "&gtrsim;", .codepoints = .{ .Single = 8819 }, .characters = "\xe2\x89\xb3" }, .{ .entity = "&gvertneqq;", .codepoints = .{ .Double = [2]u32{ 8809, 65024 } }, .characters = "\xe2\x89\xa9\xef\xb8\x80" }, .{ .entity = "&gvnE;", .codepoints = .{ .Double = [2]u32{ 8809, 65024 } }, .characters = "\xe2\x89\xa9\xef\xb8\x80" }, .{ .entity = "&hArr;", .codepoints = .{ .Single = 8660 }, .characters = "\xe2\x87\x94" }, .{ .entity = "&hairsp;", .codepoints = .{ .Single = 8202 }, .characters = "\xe2\x80\x8a" }, .{ .entity = "&half;", .codepoints = .{ .Single = 189 }, .characters = "\xc2\xbd" }, .{ .entity = "&hamilt;", .codepoints = .{ .Single = 8459 }, .characters = "\xe2\x84\x8b" }, .{ .entity = "&hardcy;", .codepoints = .{ .Single = 1098 }, .characters = "\xd1\x8a" }, .{ .entity = "&harr;", .codepoints = .{ .Single = 8596 }, .characters = "\xe2\x86\x94" }, .{ .entity = "&harrcir;", .codepoints = .{ .Single = 10568 }, .characters = "\xe2\xa5\x88" }, .{ .entity = "&harrw;", .codepoints = .{ .Single = 8621 }, .characters = "\xe2\x86\xad" }, .{ .entity = "&hbar;", .codepoints = .{ .Single = 8463 }, .characters = "\xe2\x84\x8f" }, .{ .entity = "&hcirc;", .codepoints = .{ .Single = 293 }, .characters = "\xc4\xa5" }, .{ .entity = "&hearts;", .codepoints = .{ .Single = 9829 }, .characters = "\xe2\x99\xa5" }, .{ .entity = "&heartsuit;", .codepoints = .{ .Single = 9829 }, .characters = "\xe2\x99\xa5" }, .{ .entity = "&hellip;", .codepoints = .{ .Single = 8230 }, .characters = "\xe2\x80\xa6" }, .{ .entity = "&hercon;", .codepoints = .{ .Single = 8889 }, .characters = "\xe2\x8a\xb9" }, .{ .entity = "&hfr;", .codepoints = .{ .Single = 120101 }, .characters = "\xf0\x9d\x94\xa5" }, .{ .entity = "&hksearow;", .codepoints = .{ .Single = 10533 }, .characters = "\xe2\xa4\xa5" }, .{ .entity = "&hkswarow;", .codepoints = .{ .Single = 10534 }, .characters = "\xe2\xa4\xa6" }, .{ .entity = "&hoarr;", .codepoints = .{ .Single = 8703 }, .characters = "\xe2\x87\xbf" }, .{ .entity = "&homtht;", .codepoints = .{ .Single = 8763 }, .characters = "\xe2\x88\xbb" }, .{ .entity = "&hookleftarrow;", .codepoints = .{ .Single = 8617 }, .characters = "\xe2\x86\xa9" }, .{ .entity = "&hookrightarrow;", .codepoints = .{ .Single = 8618 }, .characters = "\xe2\x86\xaa" }, .{ .entity = "&hopf;", .codepoints = .{ .Single = 120153 }, .characters = "\xf0\x9d\x95\x99" }, .{ .entity = "&horbar;", .codepoints = .{ .Single = 8213 }, .characters = "\xe2\x80\x95" }, .{ .entity = "&hscr;", .codepoints = .{ .Single = 119997 }, .characters = "\xf0\x9d\x92\xbd" }, .{ .entity = "&hslash;", .codepoints = .{ .Single = 8463 }, .characters = "\xe2\x84\x8f" }, .{ .entity = "&hstrok;", .codepoints = .{ .Single = 295 }, .characters = "\xc4\xa7" }, .{ .entity = "&hybull;", .codepoints = .{ .Single = 8259 }, .characters = "\xe2\x81\x83" }, .{ .entity = "&hyphen;", .codepoints = .{ .Single = 8208 }, .characters = "\xe2\x80\x90" }, .{ .entity = "&iacute", .codepoints = .{ .Single = 237 }, .characters = "\xc3\xad" }, .{ .entity = "&iacute;", .codepoints = .{ .Single = 237 }, .characters = "\xc3\xad" }, .{ .entity = "&ic;", .codepoints = .{ .Single = 8291 }, .characters = "\xe2\x81\xa3" }, .{ .entity = "&icirc", .codepoints = .{ .Single = 238 }, .characters = "\xc3\xae" }, .{ .entity = "&icirc;", .codepoints = .{ .Single = 238 }, .characters = "\xc3\xae" }, .{ .entity = "&icy;", .codepoints = .{ .Single = 1080 }, .characters = "\xd0\xb8" }, .{ .entity = "&iecy;", .codepoints = .{ .Single = 1077 }, .characters = "\xd0\xb5" }, .{ .entity = "&iexcl", .codepoints = .{ .Single = 161 }, .characters = "\xc2\xa1" }, .{ .entity = "&iexcl;", .codepoints = .{ .Single = 161 }, .characters = "\xc2\xa1" }, .{ .entity = "&iff;", .codepoints = .{ .Single = 8660 }, .characters = "\xe2\x87\x94" }, .{ .entity = "&ifr;", .codepoints = .{ .Single = 120102 }, .characters = "\xf0\x9d\x94\xa6" }, .{ .entity = "&igrave", .codepoints = .{ .Single = 236 }, .characters = "\xc3\xac" }, .{ .entity = "&igrave;", .codepoints = .{ .Single = 236 }, .characters = "\xc3\xac" }, .{ .entity = "&ii;", .codepoints = .{ .Single = 8520 }, .characters = "\xe2\x85\x88" }, .{ .entity = "&iiiint;", .codepoints = .{ .Single = 10764 }, .characters = "\xe2\xa8\x8c" }, .{ .entity = "&iiint;", .codepoints = .{ .Single = 8749 }, .characters = "\xe2\x88\xad" }, .{ .entity = "&iinfin;", .codepoints = .{ .Single = 10716 }, .characters = "\xe2\xa7\x9c" }, .{ .entity = "&iiota;", .codepoints = .{ .Single = 8489 }, .characters = "\xe2\x84\xa9" }, .{ .entity = "&ijlig;", .codepoints = .{ .Single = 307 }, .characters = "\xc4\xb3" }, .{ .entity = "&imacr;", .codepoints = .{ .Single = 299 }, .characters = "\xc4\xab" }, .{ .entity = "&image;", .codepoints = .{ .Single = 8465 }, .characters = "\xe2\x84\x91" }, .{ .entity = "&imagline;", .codepoints = .{ .Single = 8464 }, .characters = "\xe2\x84\x90" }, .{ .entity = "&imagpart;", .codepoints = .{ .Single = 8465 }, .characters = "\xe2\x84\x91" }, .{ .entity = "&imath;", .codepoints = .{ .Single = 305 }, .characters = "\xc4\xb1" }, .{ .entity = "&imof;", .codepoints = .{ .Single = 8887 }, .characters = "\xe2\x8a\xb7" }, .{ .entity = "&imped;", .codepoints = .{ .Single = 437 }, .characters = "\xc6\xb5" }, .{ .entity = "&in;", .codepoints = .{ .Single = 8712 }, .characters = "\xe2\x88\x88" }, .{ .entity = "&incare;", .codepoints = .{ .Single = 8453 }, .characters = "\xe2\x84\x85" }, .{ .entity = "&infin;", .codepoints = .{ .Single = 8734 }, .characters = "\xe2\x88\x9e" }, .{ .entity = "&infintie;", .codepoints = .{ .Single = 10717 }, .characters = "\xe2\xa7\x9d" }, .{ .entity = "&inodot;", .codepoints = .{ .Single = 305 }, .characters = "\xc4\xb1" }, .{ .entity = "&int;", .codepoints = .{ .Single = 8747 }, .characters = "\xe2\x88\xab" }, .{ .entity = "&intcal;", .codepoints = .{ .Single = 8890 }, .characters = "\xe2\x8a\xba" }, .{ .entity = "&integers;", .codepoints = .{ .Single = 8484 }, .characters = "\xe2\x84\xa4" }, .{ .entity = "&intercal;", .codepoints = .{ .Single = 8890 }, .characters = "\xe2\x8a\xba" }, .{ .entity = "&intlarhk;", .codepoints = .{ .Single = 10775 }, .characters = "\xe2\xa8\x97" }, .{ .entity = "&intprod;", .codepoints = .{ .Single = 10812 }, .characters = "\xe2\xa8\xbc" }, .{ .entity = "&iocy;", .codepoints = .{ .Single = 1105 }, .characters = "\xd1\x91" }, .{ .entity = "&iogon;", .codepoints = .{ .Single = 303 }, .characters = "\xc4\xaf" }, .{ .entity = "&iopf;", .codepoints = .{ .Single = 120154 }, .characters = "\xf0\x9d\x95\x9a" }, .{ .entity = "&iota;", .codepoints = .{ .Single = 953 }, .characters = "\xce\xb9" }, .{ .entity = "&iprod;", .codepoints = .{ .Single = 10812 }, .characters = "\xe2\xa8\xbc" }, .{ .entity = "&iquest", .codepoints = .{ .Single = 191 }, .characters = "\xc2\xbf" }, .{ .entity = "&iquest;", .codepoints = .{ .Single = 191 }, .characters = "\xc2\xbf" }, .{ .entity = "&iscr;", .codepoints = .{ .Single = 119998 }, .characters = "\xf0\x9d\x92\xbe" }, .{ .entity = "&isin;", .codepoints = .{ .Single = 8712 }, .characters = "\xe2\x88\x88" }, .{ .entity = "&isinE;", .codepoints = .{ .Single = 8953 }, .characters = "\xe2\x8b\xb9" }, .{ .entity = "&isindot;", .codepoints = .{ .Single = 8949 }, .characters = "\xe2\x8b\xb5" }, .{ .entity = "&isins;", .codepoints = .{ .Single = 8948 }, .characters = "\xe2\x8b\xb4" }, .{ .entity = "&isinsv;", .codepoints = .{ .Single = 8947 }, .characters = "\xe2\x8b\xb3" }, .{ .entity = "&isinv;", .codepoints = .{ .Single = 8712 }, .characters = "\xe2\x88\x88" }, .{ .entity = "&it;", .codepoints = .{ .Single = 8290 }, .characters = "\xe2\x81\xa2" }, .{ .entity = "&itilde;", .codepoints = .{ .Single = 297 }, .characters = "\xc4\xa9" }, .{ .entity = "&iukcy;", .codepoints = .{ .Single = 1110 }, .characters = "\xd1\x96" }, .{ .entity = "&iuml", .codepoints = .{ .Single = 239 }, .characters = "\xc3\xaf" }, .{ .entity = "&iuml;", .codepoints = .{ .Single = 239 }, .characters = "\xc3\xaf" }, .{ .entity = "&jcirc;", .codepoints = .{ .Single = 309 }, .characters = "\xc4\xb5" }, .{ .entity = "&jcy;", .codepoints = .{ .Single = 1081 }, .characters = "\xd0\xb9" }, .{ .entity = "&jfr;", .codepoints = .{ .Single = 120103 }, .characters = "\xf0\x9d\x94\xa7" }, .{ .entity = "&jmath;", .codepoints = .{ .Single = 567 }, .characters = "\xc8\xb7" }, .{ .entity = "&jopf;", .codepoints = .{ .Single = 120155 }, .characters = "\xf0\x9d\x95\x9b" }, .{ .entity = "&jscr;", .codepoints = .{ .Single = 119999 }, .characters = "\xf0\x9d\x92\xbf" }, .{ .entity = "&jsercy;", .codepoints = .{ .Single = 1112 }, .characters = "\xd1\x98" }, .{ .entity = "&jukcy;", .codepoints = .{ .Single = 1108 }, .characters = "\xd1\x94" }, .{ .entity = "&kappa;", .codepoints = .{ .Single = 954 }, .characters = "\xce\xba" }, .{ .entity = "&kappav;", .codepoints = .{ .Single = 1008 }, .characters = "\xcf\xb0" }, .{ .entity = "&kcedil;", .codepoints = .{ .Single = 311 }, .characters = "\xc4\xb7" }, .{ .entity = "&kcy;", .codepoints = .{ .Single = 1082 }, .characters = "\xd0\xba" }, .{ .entity = "&kfr;", .codepoints = .{ .Single = 120104 }, .characters = "\xf0\x9d\x94\xa8" }, .{ .entity = "&kgreen;", .codepoints = .{ .Single = 312 }, .characters = "\xc4\xb8" }, .{ .entity = "&khcy;", .codepoints = .{ .Single = 1093 }, .characters = "\xd1\x85" }, .{ .entity = "&kjcy;", .codepoints = .{ .Single = 1116 }, .characters = "\xd1\x9c" }, .{ .entity = "&kopf;", .codepoints = .{ .Single = 120156 }, .characters = "\xf0\x9d\x95\x9c" }, .{ .entity = "&kscr;", .codepoints = .{ .Single = 120000 }, .characters = "\xf0\x9d\x93\x80" }, .{ .entity = "&lAarr;", .codepoints = .{ .Single = 8666 }, .characters = "\xe2\x87\x9a" }, .{ .entity = "&lArr;", .codepoints = .{ .Single = 8656 }, .characters = "\xe2\x87\x90" }, .{ .entity = "&lAtail;", .codepoints = .{ .Single = 10523 }, .characters = "\xe2\xa4\x9b" }, .{ .entity = "&lBarr;", .codepoints = .{ .Single = 10510 }, .characters = "\xe2\xa4\x8e" }, .{ .entity = "&lE;", .codepoints = .{ .Single = 8806 }, .characters = "\xe2\x89\xa6" }, .{ .entity = "&lEg;", .codepoints = .{ .Single = 10891 }, .characters = "\xe2\xaa\x8b" }, .{ .entity = "&lHar;", .codepoints = .{ .Single = 10594 }, .characters = "\xe2\xa5\xa2" }, .{ .entity = "&lacute;", .codepoints = .{ .Single = 314 }, .characters = "\xc4\xba" }, .{ .entity = "&laemptyv;", .codepoints = .{ .Single = 10676 }, .characters = "\xe2\xa6\xb4" }, .{ .entity = "&lagran;", .codepoints = .{ .Single = 8466 }, .characters = "\xe2\x84\x92" }, .{ .entity = "&lambda;", .codepoints = .{ .Single = 955 }, .characters = "\xce\xbb" }, .{ .entity = "&lang;", .codepoints = .{ .Single = 10216 }, .characters = "\xe2\x9f\xa8" }, .{ .entity = "&langd;", .codepoints = .{ .Single = 10641 }, .characters = "\xe2\xa6\x91" }, .{ .entity = "&langle;", .codepoints = .{ .Single = 10216 }, .characters = "\xe2\x9f\xa8" }, .{ .entity = "&lap;", .codepoints = .{ .Single = 10885 }, .characters = "\xe2\xaa\x85" }, .{ .entity = "&laquo", .codepoints = .{ .Single = 171 }, .characters = "\xc2\xab" }, .{ .entity = "&laquo;", .codepoints = .{ .Single = 171 }, .characters = "\xc2\xab" }, .{ .entity = "&larr;", .codepoints = .{ .Single = 8592 }, .characters = "\xe2\x86\x90" }, .{ .entity = "&larrb;", .codepoints = .{ .Single = 8676 }, .characters = "\xe2\x87\xa4" }, .{ .entity = "&larrbfs;", .codepoints = .{ .Single = 10527 }, .characters = "\xe2\xa4\x9f" }, .{ .entity = "&larrfs;", .codepoints = .{ .Single = 10525 }, .characters = "\xe2\xa4\x9d" }, .{ .entity = "&larrhk;", .codepoints = .{ .Single = 8617 }, .characters = "\xe2\x86\xa9" }, .{ .entity = "&larrlp;", .codepoints = .{ .Single = 8619 }, .characters = "\xe2\x86\xab" }, .{ .entity = "&larrpl;", .codepoints = .{ .Single = 10553 }, .characters = "\xe2\xa4\xb9" }, .{ .entity = "&larrsim;", .codepoints = .{ .Single = 10611 }, .characters = "\xe2\xa5\xb3" }, .{ .entity = "&larrtl;", .codepoints = .{ .Single = 8610 }, .characters = "\xe2\x86\xa2" }, .{ .entity = "&lat;", .codepoints = .{ .Single = 10923 }, .characters = "\xe2\xaa\xab" }, .{ .entity = "&latail;", .codepoints = .{ .Single = 10521 }, .characters = "\xe2\xa4\x99" }, .{ .entity = "&late;", .codepoints = .{ .Single = 10925 }, .characters = "\xe2\xaa\xad" }, .{ .entity = "&lates;", .codepoints = .{ .Double = [2]u32{ 10925, 65024 } }, .characters = "\xe2\xaa\xad\xef\xb8\x80" }, .{ .entity = "&lbarr;", .codepoints = .{ .Single = 10508 }, .characters = "\xe2\xa4\x8c" }, .{ .entity = "&lbbrk;", .codepoints = .{ .Single = 10098 }, .characters = "\xe2\x9d\xb2" }, .{ .entity = "&lbrace;", .codepoints = .{ .Single = 123 }, .characters = "{" }, .{ .entity = "&lbrack;", .codepoints = .{ .Single = 91 }, .characters = "[" }, .{ .entity = "&lbrke;", .codepoints = .{ .Single = 10635 }, .characters = "\xe2\xa6\x8b" }, .{ .entity = "&lbrksld;", .codepoints = .{ .Single = 10639 }, .characters = "\xe2\xa6\x8f" }, .{ .entity = "&lbrkslu;", .codepoints = .{ .Single = 10637 }, .characters = "\xe2\xa6\x8d" }, .{ .entity = "&lcaron;", .codepoints = .{ .Single = 318 }, .characters = "\xc4\xbe" }, .{ .entity = "&lcedil;", .codepoints = .{ .Single = 316 }, .characters = "\xc4\xbc" }, .{ .entity = "&lceil;", .codepoints = .{ .Single = 8968 }, .characters = "\xe2\x8c\x88" }, .{ .entity = "&lcub;", .codepoints = .{ .Single = 123 }, .characters = "{" }, .{ .entity = "&lcy;", .codepoints = .{ .Single = 1083 }, .characters = "\xd0\xbb" }, .{ .entity = "&ldca;", .codepoints = .{ .Single = 10550 }, .characters = "\xe2\xa4\xb6" }, .{ .entity = "&ldquo;", .codepoints = .{ .Single = 8220 }, .characters = "\xe2\x80\x9c" }, .{ .entity = "&ldquor;", .codepoints = .{ .Single = 8222 }, .characters = "\xe2\x80\x9e" }, .{ .entity = "&ldrdhar;", .codepoints = .{ .Single = 10599 }, .characters = "\xe2\xa5\xa7" }, .{ .entity = "&ldrushar;", .codepoints = .{ .Single = 10571 }, .characters = "\xe2\xa5\x8b" }, .{ .entity = "&ldsh;", .codepoints = .{ .Single = 8626 }, .characters = "\xe2\x86\xb2" }, .{ .entity = "&le;", .codepoints = .{ .Single = 8804 }, .characters = "\xe2\x89\xa4" }, .{ .entity = "&leftarrow;", .codepoints = .{ .Single = 8592 }, .characters = "\xe2\x86\x90" }, .{ .entity = "&leftarrowtail;", .codepoints = .{ .Single = 8610 }, .characters = "\xe2\x86\xa2" }, .{ .entity = "&leftharpoondown;", .codepoints = .{ .Single = 8637 }, .characters = "\xe2\x86\xbd" }, .{ .entity = "&leftharpoonup;", .codepoints = .{ .Single = 8636 }, .characters = "\xe2\x86\xbc" }, .{ .entity = "&leftleftarrows;", .codepoints = .{ .Single = 8647 }, .characters = "\xe2\x87\x87" }, .{ .entity = "&leftrightarrow;", .codepoints = .{ .Single = 8596 }, .characters = "\xe2\x86\x94" }, .{ .entity = "&leftrightarrows;", .codepoints = .{ .Single = 8646 }, .characters = "\xe2\x87\x86" }, .{ .entity = "&leftrightharpoons;", .codepoints = .{ .Single = 8651 }, .characters = "\xe2\x87\x8b" }, .{ .entity = "&leftrightsquigarrow;", .codepoints = .{ .Single = 8621 }, .characters = "\xe2\x86\xad" }, .{ .entity = "&leftthreetimes;", .codepoints = .{ .Single = 8907 }, .characters = "\xe2\x8b\x8b" }, .{ .entity = "&leg;", .codepoints = .{ .Single = 8922 }, .characters = "\xe2\x8b\x9a" }, .{ .entity = "&leq;", .codepoints = .{ .Single = 8804 }, .characters = "\xe2\x89\xa4" }, .{ .entity = "&leqq;", .codepoints = .{ .Single = 8806 }, .characters = "\xe2\x89\xa6" }, .{ .entity = "&leqslant;", .codepoints = .{ .Single = 10877 }, .characters = "\xe2\xa9\xbd" }, .{ .entity = "&les;", .codepoints = .{ .Single = 10877 }, .characters = "\xe2\xa9\xbd" }, .{ .entity = "&lescc;", .codepoints = .{ .Single = 10920 }, .characters = "\xe2\xaa\xa8" }, .{ .entity = "&lesdot;", .codepoints = .{ .Single = 10879 }, .characters = "\xe2\xa9\xbf" }, .{ .entity = "&lesdoto;", .codepoints = .{ .Single = 10881 }, .characters = "\xe2\xaa\x81" }, .{ .entity = "&lesdotor;", .codepoints = .{ .Single = 10883 }, .characters = "\xe2\xaa\x83" }, .{ .entity = "&lesg;", .codepoints = .{ .Double = [2]u32{ 8922, 65024 } }, .characters = "\xe2\x8b\x9a\xef\xb8\x80" }, .{ .entity = "&lesges;", .codepoints = .{ .Single = 10899 }, .characters = "\xe2\xaa\x93" }, .{ .entity = "&lessapprox;", .codepoints = .{ .Single = 10885 }, .characters = "\xe2\xaa\x85" }, .{ .entity = "&lessdot;", .codepoints = .{ .Single = 8918 }, .characters = "\xe2\x8b\x96" }, .{ .entity = "&lesseqgtr;", .codepoints = .{ .Single = 8922 }, .characters = "\xe2\x8b\x9a" }, .{ .entity = "&lesseqqgtr;", .codepoints = .{ .Single = 10891 }, .characters = "\xe2\xaa\x8b" }, .{ .entity = "&lessgtr;", .codepoints = .{ .Single = 8822 }, .characters = "\xe2\x89\xb6" }, .{ .entity = "&lesssim;", .codepoints = .{ .Single = 8818 }, .characters = "\xe2\x89\xb2" }, .{ .entity = "&lfisht;", .codepoints = .{ .Single = 10620 }, .characters = "\xe2\xa5\xbc" }, .{ .entity = "&lfloor;", .codepoints = .{ .Single = 8970 }, .characters = "\xe2\x8c\x8a" }, .{ .entity = "&lfr;", .codepoints = .{ .Single = 120105 }, .characters = "\xf0\x9d\x94\xa9" }, .{ .entity = "&lg;", .codepoints = .{ .Single = 8822 }, .characters = "\xe2\x89\xb6" }, .{ .entity = "&lgE;", .codepoints = .{ .Single = 10897 }, .characters = "\xe2\xaa\x91" }, .{ .entity = "&lhard;", .codepoints = .{ .Single = 8637 }, .characters = "\xe2\x86\xbd" }, .{ .entity = "&lharu;", .codepoints = .{ .Single = 8636 }, .characters = "\xe2\x86\xbc" }, .{ .entity = "&lharul;", .codepoints = .{ .Single = 10602 }, .characters = "\xe2\xa5\xaa" }, .{ .entity = "&lhblk;", .codepoints = .{ .Single = 9604 }, .characters = "\xe2\x96\x84" }, .{ .entity = "&ljcy;", .codepoints = .{ .Single = 1113 }, .characters = "\xd1\x99" }, .{ .entity = "&ll;", .codepoints = .{ .Single = 8810 }, .characters = "\xe2\x89\xaa" }, .{ .entity = "&llarr;", .codepoints = .{ .Single = 8647 }, .characters = "\xe2\x87\x87" }, .{ .entity = "&llcorner;", .codepoints = .{ .Single = 8990 }, .characters = "\xe2\x8c\x9e" }, .{ .entity = "&llhard;", .codepoints = .{ .Single = 10603 }, .characters = "\xe2\xa5\xab" }, .{ .entity = "&lltri;", .codepoints = .{ .Single = 9722 }, .characters = "\xe2\x97\xba" }, .{ .entity = "&lmidot;", .codepoints = .{ .Single = 320 }, .characters = "\xc5\x80" }, .{ .entity = "&lmoust;", .codepoints = .{ .Single = 9136 }, .characters = "\xe2\x8e\xb0" }, .{ .entity = "&lmoustache;", .codepoints = .{ .Single = 9136 }, .characters = "\xe2\x8e\xb0" }, .{ .entity = "&lnE;", .codepoints = .{ .Single = 8808 }, .characters = "\xe2\x89\xa8" }, .{ .entity = "&lnap;", .codepoints = .{ .Single = 10889 }, .characters = "\xe2\xaa\x89" }, .{ .entity = "&lnapprox;", .codepoints = .{ .Single = 10889 }, .characters = "\xe2\xaa\x89" }, .{ .entity = "&lne;", .codepoints = .{ .Single = 10887 }, .characters = "\xe2\xaa\x87" }, .{ .entity = "&lneq;", .codepoints = .{ .Single = 10887 }, .characters = "\xe2\xaa\x87" }, .{ .entity = "&lneqq;", .codepoints = .{ .Single = 8808 }, .characters = "\xe2\x89\xa8" }, .{ .entity = "&lnsim;", .codepoints = .{ .Single = 8934 }, .characters = "\xe2\x8b\xa6" }, .{ .entity = "&loang;", .codepoints = .{ .Single = 10220 }, .characters = "\xe2\x9f\xac" }, .{ .entity = "&loarr;", .codepoints = .{ .Single = 8701 }, .characters = "\xe2\x87\xbd" }, .{ .entity = "&lobrk;", .codepoints = .{ .Single = 10214 }, .characters = "\xe2\x9f\xa6" }, .{ .entity = "&longleftarrow;", .codepoints = .{ .Single = 10229 }, .characters = "\xe2\x9f\xb5" }, .{ .entity = "&longleftrightarrow;", .codepoints = .{ .Single = 10231 }, .characters = "\xe2\x9f\xb7" }, .{ .entity = "&longmapsto;", .codepoints = .{ .Single = 10236 }, .characters = "\xe2\x9f\xbc" }, .{ .entity = "&longrightarrow;", .codepoints = .{ .Single = 10230 }, .characters = "\xe2\x9f\xb6" }, .{ .entity = "&looparrowleft;", .codepoints = .{ .Single = 8619 }, .characters = "\xe2\x86\xab" }, .{ .entity = "&looparrowright;", .codepoints = .{ .Single = 8620 }, .characters = "\xe2\x86\xac" }, .{ .entity = "&lopar;", .codepoints = .{ .Single = 10629 }, .characters = "\xe2\xa6\x85" }, .{ .entity = "&lopf;", .codepoints = .{ .Single = 120157 }, .characters = "\xf0\x9d\x95\x9d" }, .{ .entity = "&loplus;", .codepoints = .{ .Single = 10797 }, .characters = "\xe2\xa8\xad" }, .{ .entity = "&lotimes;", .codepoints = .{ .Single = 10804 }, .characters = "\xe2\xa8\xb4" }, .{ .entity = "&lowast;", .codepoints = .{ .Single = 8727 }, .characters = "\xe2\x88\x97" }, .{ .entity = "&lowbar;", .codepoints = .{ .Single = 95 }, .characters = "_" }, .{ .entity = "&loz;", .codepoints = .{ .Single = 9674 }, .characters = "\xe2\x97\x8a" }, .{ .entity = "&lozenge;", .codepoints = .{ .Single = 9674 }, .characters = "\xe2\x97\x8a" }, .{ .entity = "&lozf;", .codepoints = .{ .Single = 10731 }, .characters = "\xe2\xa7\xab" }, .{ .entity = "&lpar;", .codepoints = .{ .Single = 40 }, .characters = "(" }, .{ .entity = "&lparlt;", .codepoints = .{ .Single = 10643 }, .characters = "\xe2\xa6\x93" }, .{ .entity = "&lrarr;", .codepoints = .{ .Single = 8646 }, .characters = "\xe2\x87\x86" }, .{ .entity = "&lrcorner;", .codepoints = .{ .Single = 8991 }, .characters = "\xe2\x8c\x9f" }, .{ .entity = "&lrhar;", .codepoints = .{ .Single = 8651 }, .characters = "\xe2\x87\x8b" }, .{ .entity = "&lrhard;", .codepoints = .{ .Single = 10605 }, .characters = "\xe2\xa5\xad" }, .{ .entity = "&lrm;", .codepoints = .{ .Single = 8206 }, .characters = "\xe2\x80\x8e" }, .{ .entity = "&lrtri;", .codepoints = .{ .Single = 8895 }, .characters = "\xe2\x8a\xbf" }, .{ .entity = "&lsaquo;", .codepoints = .{ .Single = 8249 }, .characters = "\xe2\x80\xb9" }, .{ .entity = "&lscr;", .codepoints = .{ .Single = 120001 }, .characters = "\xf0\x9d\x93\x81" }, .{ .entity = "&lsh;", .codepoints = .{ .Single = 8624 }, .characters = "\xe2\x86\xb0" }, .{ .entity = "&lsim;", .codepoints = .{ .Single = 8818 }, .characters = "\xe2\x89\xb2" }, .{ .entity = "&lsime;", .codepoints = .{ .Single = 10893 }, .characters = "\xe2\xaa\x8d" }, .{ .entity = "&lsimg;", .codepoints = .{ .Single = 10895 }, .characters = "\xe2\xaa\x8f" }, .{ .entity = "&lsqb;", .codepoints = .{ .Single = 91 }, .characters = "[" }, .{ .entity = "&lsquo;", .codepoints = .{ .Single = 8216 }, .characters = "\xe2\x80\x98" }, .{ .entity = "&lsquor;", .codepoints = .{ .Single = 8218 }, .characters = "\xe2\x80\x9a" }, .{ .entity = "&lstrok;", .codepoints = .{ .Single = 322 }, .characters = "\xc5\x82" }, .{ .entity = "&lt", .codepoints = .{ .Single = 60 }, .characters = "<" }, .{ .entity = "&lt;", .codepoints = .{ .Single = 60 }, .characters = "<" }, .{ .entity = "&ltcc;", .codepoints = .{ .Single = 10918 }, .characters = "\xe2\xaa\xa6" }, .{ .entity = "&ltcir;", .codepoints = .{ .Single = 10873 }, .characters = "\xe2\xa9\xb9" }, .{ .entity = "&ltdot;", .codepoints = .{ .Single = 8918 }, .characters = "\xe2\x8b\x96" }, .{ .entity = "&lthree;", .codepoints = .{ .Single = 8907 }, .characters = "\xe2\x8b\x8b" }, .{ .entity = "&ltimes;", .codepoints = .{ .Single = 8905 }, .characters = "\xe2\x8b\x89" }, .{ .entity = "&ltlarr;", .codepoints = .{ .Single = 10614 }, .characters = "\xe2\xa5\xb6" }, .{ .entity = "&ltquest;", .codepoints = .{ .Single = 10875 }, .characters = "\xe2\xa9\xbb" }, .{ .entity = "&ltrPar;", .codepoints = .{ .Single = 10646 }, .characters = "\xe2\xa6\x96" }, .{ .entity = "&ltri;", .codepoints = .{ .Single = 9667 }, .characters = "\xe2\x97\x83" }, .{ .entity = "&ltrie;", .codepoints = .{ .Single = 8884 }, .characters = "\xe2\x8a\xb4" }, .{ .entity = "&ltrif;", .codepoints = .{ .Single = 9666 }, .characters = "\xe2\x97\x82" }, .{ .entity = "&lurdshar;", .codepoints = .{ .Single = 10570 }, .characters = "\xe2\xa5\x8a" }, .{ .entity = "&luruhar;", .codepoints = .{ .Single = 10598 }, .characters = "\xe2\xa5\xa6" }, .{ .entity = "&lvertneqq;", .codepoints = .{ .Double = [2]u32{ 8808, 65024 } }, .characters = "\xe2\x89\xa8\xef\xb8\x80" }, .{ .entity = "&lvnE;", .codepoints = .{ .Double = [2]u32{ 8808, 65024 } }, .characters = "\xe2\x89\xa8\xef\xb8\x80" }, .{ .entity = "&mDDot;", .codepoints = .{ .Single = 8762 }, .characters = "\xe2\x88\xba" }, .{ .entity = "&macr", .codepoints = .{ .Single = 175 }, .characters = "\xc2\xaf" }, .{ .entity = "&macr;", .codepoints = .{ .Single = 175 }, .characters = "\xc2\xaf" }, .{ .entity = "&male;", .codepoints = .{ .Single = 9794 }, .characters = "\xe2\x99\x82" }, .{ .entity = "&malt;", .codepoints = .{ .Single = 10016 }, .characters = "\xe2\x9c\xa0" }, .{ .entity = "&maltese;", .codepoints = .{ .Single = 10016 }, .characters = "\xe2\x9c\xa0" }, .{ .entity = "&map;", .codepoints = .{ .Single = 8614 }, .characters = "\xe2\x86\xa6" }, .{ .entity = "&mapsto;", .codepoints = .{ .Single = 8614 }, .characters = "\xe2\x86\xa6" }, .{ .entity = "&mapstodown;", .codepoints = .{ .Single = 8615 }, .characters = "\xe2\x86\xa7" }, .{ .entity = "&mapstoleft;", .codepoints = .{ .Single = 8612 }, .characters = "\xe2\x86\xa4" }, .{ .entity = "&mapstoup;", .codepoints = .{ .Single = 8613 }, .characters = "\xe2\x86\xa5" }, .{ .entity = "&marker;", .codepoints = .{ .Single = 9646 }, .characters = "\xe2\x96\xae" }, .{ .entity = "&mcomma;", .codepoints = .{ .Single = 10793 }, .characters = "\xe2\xa8\xa9" }, .{ .entity = "&mcy;", .codepoints = .{ .Single = 1084 }, .characters = "\xd0\xbc" }, .{ .entity = "&mdash;", .codepoints = .{ .Single = 8212 }, .characters = "\xe2\x80\x94" }, .{ .entity = "&measuredangle;", .codepoints = .{ .Single = 8737 }, .characters = "\xe2\x88\xa1" }, .{ .entity = "&mfr;", .codepoints = .{ .Single = 120106 }, .characters = "\xf0\x9d\x94\xaa" }, .{ .entity = "&mho;", .codepoints = .{ .Single = 8487 }, .characters = "\xe2\x84\xa7" }, .{ .entity = "&micro", .codepoints = .{ .Single = 181 }, .characters = "\xc2\xb5" }, .{ .entity = "&micro;", .codepoints = .{ .Single = 181 }, .characters = "\xc2\xb5" }, .{ .entity = "&mid;", .codepoints = .{ .Single = 8739 }, .characters = "\xe2\x88\xa3" }, .{ .entity = "&midast;", .codepoints = .{ .Single = 42 }, .characters = "*" }, .{ .entity = "&midcir;", .codepoints = .{ .Single = 10992 }, .characters = "\xe2\xab\xb0" }, .{ .entity = "&middot", .codepoints = .{ .Single = 183 }, .characters = "\xc2\xb7" }, .{ .entity = "&middot;", .codepoints = .{ .Single = 183 }, .characters = "\xc2\xb7" }, .{ .entity = "&minus;", .codepoints = .{ .Single = 8722 }, .characters = "\xe2\x88\x92" }, .{ .entity = "&minusb;", .codepoints = .{ .Single = 8863 }, .characters = "\xe2\x8a\x9f" }, .{ .entity = "&minusd;", .codepoints = .{ .Single = 8760 }, .characters = "\xe2\x88\xb8" }, .{ .entity = "&minusdu;", .codepoints = .{ .Single = 10794 }, .characters = "\xe2\xa8\xaa" }, .{ .entity = "&mlcp;", .codepoints = .{ .Single = 10971 }, .characters = "\xe2\xab\x9b" }, .{ .entity = "&mldr;", .codepoints = .{ .Single = 8230 }, .characters = "\xe2\x80\xa6" }, .{ .entity = "&mnplus;", .codepoints = .{ .Single = 8723 }, .characters = "\xe2\x88\x93" }, .{ .entity = "&models;", .codepoints = .{ .Single = 8871 }, .characters = "\xe2\x8a\xa7" }, .{ .entity = "&mopf;", .codepoints = .{ .Single = 120158 }, .characters = "\xf0\x9d\x95\x9e" }, .{ .entity = "&mp;", .codepoints = .{ .Single = 8723 }, .characters = "\xe2\x88\x93" }, .{ .entity = "&mscr;", .codepoints = .{ .Single = 120002 }, .characters = "\xf0\x9d\x93\x82" }, .{ .entity = "&mstpos;", .codepoints = .{ .Single = 8766 }, .characters = "\xe2\x88\xbe" }, .{ .entity = "&mu;", .codepoints = .{ .Single = 956 }, .characters = "\xce\xbc" }, .{ .entity = "&multimap;", .codepoints = .{ .Single = 8888 }, .characters = "\xe2\x8a\xb8" }, .{ .entity = "&mumap;", .codepoints = .{ .Single = 8888 }, .characters = "\xe2\x8a\xb8" }, .{ .entity = "&nGg;", .codepoints = .{ .Double = [2]u32{ 8921, 824 } }, .characters = "\xe2\x8b\x99\xcc\xb8" }, .{ .entity = "&nGt;", .codepoints = .{ .Double = [2]u32{ 8811, 8402 } }, .characters = "\xe2\x89\xab\xe2\x83\x92" }, .{ .entity = "&nGtv;", .codepoints = .{ .Double = [2]u32{ 8811, 824 } }, .characters = "\xe2\x89\xab\xcc\xb8" }, .{ .entity = "&nLeftarrow;", .codepoints = .{ .Single = 8653 }, .characters = "\xe2\x87\x8d" }, .{ .entity = "&nLeftrightarrow;", .codepoints = .{ .Single = 8654 }, .characters = "\xe2\x87\x8e" }, .{ .entity = "&nLl;", .codepoints = .{ .Double = [2]u32{ 8920, 824 } }, .characters = "\xe2\x8b\x98\xcc\xb8" }, .{ .entity = "&nLt;", .codepoints = .{ .Double = [2]u32{ 8810, 8402 } }, .characters = "\xe2\x89\xaa\xe2\x83\x92" }, .{ .entity = "&nLtv;", .codepoints = .{ .Double = [2]u32{ 8810, 824 } }, .characters = "\xe2\x89\xaa\xcc\xb8" }, .{ .entity = "&nRightarrow;", .codepoints = .{ .Single = 8655 }, .characters = "\xe2\x87\x8f" }, .{ .entity = "&nVDash;", .codepoints = .{ .Single = 8879 }, .characters = "\xe2\x8a\xaf" }, .{ .entity = "&nVdash;", .codepoints = .{ .Single = 8878 }, .characters = "\xe2\x8a\xae" }, .{ .entity = "&nabla;", .codepoints = .{ .Single = 8711 }, .characters = "\xe2\x88\x87" }, .{ .entity = "&nacute;", .codepoints = .{ .Single = 324 }, .characters = "\xc5\x84" }, .{ .entity = "&nang;", .codepoints = .{ .Double = [2]u32{ 8736, 8402 } }, .characters = "\xe2\x88\xa0\xe2\x83\x92" }, .{ .entity = "&nap;", .codepoints = .{ .Single = 8777 }, .characters = "\xe2\x89\x89" }, .{ .entity = "&napE;", .codepoints = .{ .Double = [2]u32{ 10864, 824 } }, .characters = "\xe2\xa9\xb0\xcc\xb8" }, .{ .entity = "&napid;", .codepoints = .{ .Double = [2]u32{ 8779, 824 } }, .characters = "\xe2\x89\x8b\xcc\xb8" }, .{ .entity = "&napos;", .codepoints = .{ .Single = 329 }, .characters = "\xc5\x89" }, .{ .entity = "&napprox;", .codepoints = .{ .Single = 8777 }, .characters = "\xe2\x89\x89" }, .{ .entity = "&natur;", .codepoints = .{ .Single = 9838 }, .characters = "\xe2\x99\xae" }, .{ .entity = "&natural;", .codepoints = .{ .Single = 9838 }, .characters = "\xe2\x99\xae" }, .{ .entity = "&naturals;", .codepoints = .{ .Single = 8469 }, .characters = "\xe2\x84\x95" }, .{ .entity = "&nbsp", .codepoints = .{ .Single = 160 }, .characters = "\xc2\xa0" }, .{ .entity = "&nbsp;", .codepoints = .{ .Single = 160 }, .characters = "\xc2\xa0" }, .{ .entity = "&nbump;", .codepoints = .{ .Double = [2]u32{ 8782, 824 } }, .characters = "\xe2\x89\x8e\xcc\xb8" }, .{ .entity = "&nbumpe;", .codepoints = .{ .Double = [2]u32{ 8783, 824 } }, .characters = "\xe2\x89\x8f\xcc\xb8" }, .{ .entity = "&ncap;", .codepoints = .{ .Single = 10819 }, .characters = "\xe2\xa9\x83" }, .{ .entity = "&ncaron;", .codepoints = .{ .Single = 328 }, .characters = "\xc5\x88" }, .{ .entity = "&ncedil;", .codepoints = .{ .Single = 326 }, .characters = "\xc5\x86" }, .{ .entity = "&ncong;", .codepoints = .{ .Single = 8775 }, .characters = "\xe2\x89\x87" }, .{ .entity = "&ncongdot;", .codepoints = .{ .Double = [2]u32{ 10861, 824 } }, .characters = "\xe2\xa9\xad\xcc\xb8" }, .{ .entity = "&ncup;", .codepoints = .{ .Single = 10818 }, .characters = "\xe2\xa9\x82" }, .{ .entity = "&ncy;", .codepoints = .{ .Single = 1085 }, .characters = "\xd0\xbd" }, .{ .entity = "&ndash;", .codepoints = .{ .Single = 8211 }, .characters = "\xe2\x80\x93" }, .{ .entity = "&ne;", .codepoints = .{ .Single = 8800 }, .characters = "\xe2\x89\xa0" }, .{ .entity = "&neArr;", .codepoints = .{ .Single = 8663 }, .characters = "\xe2\x87\x97" }, .{ .entity = "&nearhk;", .codepoints = .{ .Single = 10532 }, .characters = "\xe2\xa4\xa4" }, .{ .entity = "&nearr;", .codepoints = .{ .Single = 8599 }, .characters = "\xe2\x86\x97" }, .{ .entity = "&nearrow;", .codepoints = .{ .Single = 8599 }, .characters = "\xe2\x86\x97" }, .{ .entity = "&nedot;", .codepoints = .{ .Double = [2]u32{ 8784, 824 } }, .characters = "\xe2\x89\x90\xcc\xb8" }, .{ .entity = "&nequiv;", .codepoints = .{ .Single = 8802 }, .characters = "\xe2\x89\xa2" }, .{ .entity = "&nesear;", .codepoints = .{ .Single = 10536 }, .characters = "\xe2\xa4\xa8" }, .{ .entity = "&nesim;", .codepoints = .{ .Double = [2]u32{ 8770, 824 } }, .characters = "\xe2\x89\x82\xcc\xb8" }, .{ .entity = "&nexist;", .codepoints = .{ .Single = 8708 }, .characters = "\xe2\x88\x84" }, .{ .entity = "&nexists;", .codepoints = .{ .Single = 8708 }, .characters = "\xe2\x88\x84" }, .{ .entity = "&nfr;", .codepoints = .{ .Single = 120107 }, .characters = "\xf0\x9d\x94\xab" }, .{ .entity = "&ngE;", .codepoints = .{ .Double = [2]u32{ 8807, 824 } }, .characters = "\xe2\x89\xa7\xcc\xb8" }, .{ .entity = "&nge;", .codepoints = .{ .Single = 8817 }, .characters = "\xe2\x89\xb1" }, .{ .entity = "&ngeq;", .codepoints = .{ .Single = 8817 }, .characters = "\xe2\x89\xb1" }, .{ .entity = "&ngeqq;", .codepoints = .{ .Double = [2]u32{ 8807, 824 } }, .characters = "\xe2\x89\xa7\xcc\xb8" }, .{ .entity = "&ngeqslant;", .codepoints = .{ .Double = [2]u32{ 10878, 824 } }, .characters = "\xe2\xa9\xbe\xcc\xb8" }, .{ .entity = "&nges;", .codepoints = .{ .Double = [2]u32{ 10878, 824 } }, .characters = "\xe2\xa9\xbe\xcc\xb8" }, .{ .entity = "&ngsim;", .codepoints = .{ .Single = 8821 }, .characters = "\xe2\x89\xb5" }, .{ .entity = "&ngt;", .codepoints = .{ .Single = 8815 }, .characters = "\xe2\x89\xaf" }, .{ .entity = "&ngtr;", .codepoints = .{ .Single = 8815 }, .characters = "\xe2\x89\xaf" }, .{ .entity = "&nhArr;", .codepoints = .{ .Single = 8654 }, .characters = "\xe2\x87\x8e" }, .{ .entity = "&nharr;", .codepoints = .{ .Single = 8622 }, .characters = "\xe2\x86\xae" }, .{ .entity = "&nhpar;", .codepoints = .{ .Single = 10994 }, .characters = "\xe2\xab\xb2" }, .{ .entity = "&ni;", .codepoints = .{ .Single = 8715 }, .characters = "\xe2\x88\x8b" }, .{ .entity = "&nis;", .codepoints = .{ .Single = 8956 }, .characters = "\xe2\x8b\xbc" }, .{ .entity = "&nisd;", .codepoints = .{ .Single = 8954 }, .characters = "\xe2\x8b\xba" }, .{ .entity = "&niv;", .codepoints = .{ .Single = 8715 }, .characters = "\xe2\x88\x8b" }, .{ .entity = "&njcy;", .codepoints = .{ .Single = 1114 }, .characters = "\xd1\x9a" }, .{ .entity = "&nlArr;", .codepoints = .{ .Single = 8653 }, .characters = "\xe2\x87\x8d" }, .{ .entity = "&nlE;", .codepoints = .{ .Double = [2]u32{ 8806, 824 } }, .characters = "\xe2\x89\xa6\xcc\xb8" }, .{ .entity = "&nlarr;", .codepoints = .{ .Single = 8602 }, .characters = "\xe2\x86\x9a" }, .{ .entity = "&nldr;", .codepoints = .{ .Single = 8229 }, .characters = "\xe2\x80\xa5" }, .{ .entity = "&nle;", .codepoints = .{ .Single = 8816 }, .characters = "\xe2\x89\xb0" }, .{ .entity = "&nleftarrow;", .codepoints = .{ .Single = 8602 }, .characters = "\xe2\x86\x9a" }, .{ .entity = "&nleftrightarrow;", .codepoints = .{ .Single = 8622 }, .characters = "\xe2\x86\xae" }, .{ .entity = "&nleq;", .codepoints = .{ .Single = 8816 }, .characters = "\xe2\x89\xb0" }, .{ .entity = "&nleqq;", .codepoints = .{ .Double = [2]u32{ 8806, 824 } }, .characters = "\xe2\x89\xa6\xcc\xb8" }, .{ .entity = "&nleqslant;", .codepoints = .{ .Double = [2]u32{ 10877, 824 } }, .characters = "\xe2\xa9\xbd\xcc\xb8" }, .{ .entity = "&nles;", .codepoints = .{ .Double = [2]u32{ 10877, 824 } }, .characters = "\xe2\xa9\xbd\xcc\xb8" }, .{ .entity = "&nless;", .codepoints = .{ .Single = 8814 }, .characters = "\xe2\x89\xae" }, .{ .entity = "&nlsim;", .codepoints = .{ .Single = 8820 }, .characters = "\xe2\x89\xb4" }, .{ .entity = "&nlt;", .codepoints = .{ .Single = 8814 }, .characters = "\xe2\x89\xae" }, .{ .entity = "&nltri;", .codepoints = .{ .Single = 8938 }, .characters = "\xe2\x8b\xaa" }, .{ .entity = "&nltrie;", .codepoints = .{ .Single = 8940 }, .characters = "\xe2\x8b\xac" }, .{ .entity = "&nmid;", .codepoints = .{ .Single = 8740 }, .characters = "\xe2\x88\xa4" }, .{ .entity = "&nopf;", .codepoints = .{ .Single = 120159 }, .characters = "\xf0\x9d\x95\x9f" }, .{ .entity = "&not", .codepoints = .{ .Single = 172 }, .characters = "\xc2\xac" }, .{ .entity = "&not;", .codepoints = .{ .Single = 172 }, .characters = "\xc2\xac" }, .{ .entity = "&notin;", .codepoints = .{ .Single = 8713 }, .characters = "\xe2\x88\x89" }, .{ .entity = "&notinE;", .codepoints = .{ .Double = [2]u32{ 8953, 824 } }, .characters = "\xe2\x8b\xb9\xcc\xb8" }, .{ .entity = "&notindot;", .codepoints = .{ .Double = [2]u32{ 8949, 824 } }, .characters = "\xe2\x8b\xb5\xcc\xb8" }, .{ .entity = "&notinva;", .codepoints = .{ .Single = 8713 }, .characters = "\xe2\x88\x89" }, .{ .entity = "&notinvb;", .codepoints = .{ .Single = 8951 }, .characters = "\xe2\x8b\xb7" }, .{ .entity = "&notinvc;", .codepoints = .{ .Single = 8950 }, .characters = "\xe2\x8b\xb6" }, .{ .entity = "&notni;", .codepoints = .{ .Single = 8716 }, .characters = "\xe2\x88\x8c" }, .{ .entity = "&notniva;", .codepoints = .{ .Single = 8716 }, .characters = "\xe2\x88\x8c" }, .{ .entity = "&notnivb;", .codepoints = .{ .Single = 8958 }, .characters = "\xe2\x8b\xbe" }, .{ .entity = "&notnivc;", .codepoints = .{ .Single = 8957 }, .characters = "\xe2\x8b\xbd" }, .{ .entity = "&npar;", .codepoints = .{ .Single = 8742 }, .characters = "\xe2\x88\xa6" }, .{ .entity = "&nparallel;", .codepoints = .{ .Single = 8742 }, .characters = "\xe2\x88\xa6" }, .{ .entity = "&nparsl;", .codepoints = .{ .Double = [2]u32{ 11005, 8421 } }, .characters = "\xe2\xab\xbd\xe2\x83\xa5" }, .{ .entity = "&npart;", .codepoints = .{ .Double = [2]u32{ 8706, 824 } }, .characters = "\xe2\x88\x82\xcc\xb8" }, .{ .entity = "&npolint;", .codepoints = .{ .Single = 10772 }, .characters = "\xe2\xa8\x94" }, .{ .entity = "&npr;", .codepoints = .{ .Single = 8832 }, .characters = "\xe2\x8a\x80" }, .{ .entity = "&nprcue;", .codepoints = .{ .Single = 8928 }, .characters = "\xe2\x8b\xa0" }, .{ .entity = "&npre;", .codepoints = .{ .Double = [2]u32{ 10927, 824 } }, .characters = "\xe2\xaa\xaf\xcc\xb8" }, .{ .entity = "&nprec;", .codepoints = .{ .Single = 8832 }, .characters = "\xe2\x8a\x80" }, .{ .entity = "&npreceq;", .codepoints = .{ .Double = [2]u32{ 10927, 824 } }, .characters = "\xe2\xaa\xaf\xcc\xb8" }, .{ .entity = "&nrArr;", .codepoints = .{ .Single = 8655 }, .characters = "\xe2\x87\x8f" }, .{ .entity = "&nrarr;", .codepoints = .{ .Single = 8603 }, .characters = "\xe2\x86\x9b" }, .{ .entity = "&nrarrc;", .codepoints = .{ .Double = [2]u32{ 10547, 824 } }, .characters = "\xe2\xa4\xb3\xcc\xb8" }, .{ .entity = "&nrarrw;", .codepoints = .{ .Double = [2]u32{ 8605, 824 } }, .characters = "\xe2\x86\x9d\xcc\xb8" }, .{ .entity = "&nrightarrow;", .codepoints = .{ .Single = 8603 }, .characters = "\xe2\x86\x9b" }, .{ .entity = "&nrtri;", .codepoints = .{ .Single = 8939 }, .characters = "\xe2\x8b\xab" }, .{ .entity = "&nrtrie;", .codepoints = .{ .Single = 8941 }, .characters = "\xe2\x8b\xad" }, .{ .entity = "&nsc;", .codepoints = .{ .Single = 8833 }, .characters = "\xe2\x8a\x81" }, .{ .entity = "&nsccue;", .codepoints = .{ .Single = 8929 }, .characters = "\xe2\x8b\xa1" }, .{ .entity = "&nsce;", .codepoints = .{ .Double = [2]u32{ 10928, 824 } }, .characters = "\xe2\xaa\xb0\xcc\xb8" }, .{ .entity = "&nscr;", .codepoints = .{ .Single = 120003 }, .characters = "\xf0\x9d\x93\x83" }, .{ .entity = "&nshortmid;", .codepoints = .{ .Single = 8740 }, .characters = "\xe2\x88\xa4" }, .{ .entity = "&nshortparallel;", .codepoints = .{ .Single = 8742 }, .characters = "\xe2\x88\xa6" }, .{ .entity = "&nsim;", .codepoints = .{ .Single = 8769 }, .characters = "\xe2\x89\x81" }, .{ .entity = "&nsime;", .codepoints = .{ .Single = 8772 }, .characters = "\xe2\x89\x84" }, .{ .entity = "&nsimeq;", .codepoints = .{ .Single = 8772 }, .characters = "\xe2\x89\x84" }, .{ .entity = "&nsmid;", .codepoints = .{ .Single = 8740 }, .characters = "\xe2\x88\xa4" }, .{ .entity = "&nspar;", .codepoints = .{ .Single = 8742 }, .characters = "\xe2\x88\xa6" }, .{ .entity = "&nsqsube;", .codepoints = .{ .Single = 8930 }, .characters = "\xe2\x8b\xa2" }, .{ .entity = "&nsqsupe;", .codepoints = .{ .Single = 8931 }, .characters = "\xe2\x8b\xa3" }, .{ .entity = "&nsub;", .codepoints = .{ .Single = 8836 }, .characters = "\xe2\x8a\x84" }, .{ .entity = "&nsubE;", .codepoints = .{ .Double = [2]u32{ 10949, 824 } }, .characters = "\xe2\xab\x85\xcc\xb8" }, .{ .entity = "&nsube;", .codepoints = .{ .Single = 8840 }, .characters = "\xe2\x8a\x88" }, .{ .entity = "&nsubset;", .codepoints = .{ .Double = [2]u32{ 8834, 8402 } }, .characters = "\xe2\x8a\x82\xe2\x83\x92" }, .{ .entity = "&nsubseteq;", .codepoints = .{ .Single = 8840 }, .characters = "\xe2\x8a\x88" }, .{ .entity = "&nsubseteqq;", .codepoints = .{ .Double = [2]u32{ 10949, 824 } }, .characters = "\xe2\xab\x85\xcc\xb8" }, .{ .entity = "&nsucc;", .codepoints = .{ .Single = 8833 }, .characters = "\xe2\x8a\x81" }, .{ .entity = "&nsucceq;", .codepoints = .{ .Double = [2]u32{ 10928, 824 } }, .characters = "\xe2\xaa\xb0\xcc\xb8" }, .{ .entity = "&nsup;", .codepoints = .{ .Single = 8837 }, .characters = "\xe2\x8a\x85" }, .{ .entity = "&nsupE;", .codepoints = .{ .Double = [2]u32{ 10950, 824 } }, .characters = "\xe2\xab\x86\xcc\xb8" }, .{ .entity = "&nsupe;", .codepoints = .{ .Single = 8841 }, .characters = "\xe2\x8a\x89" }, .{ .entity = "&nsupset;", .codepoints = .{ .Double = [2]u32{ 8835, 8402 } }, .characters = "\xe2\x8a\x83\xe2\x83\x92" }, .{ .entity = "&nsupseteq;", .codepoints = .{ .Single = 8841 }, .characters = "\xe2\x8a\x89" }, .{ .entity = "&nsupseteqq;", .codepoints = .{ .Double = [2]u32{ 10950, 824 } }, .characters = "\xe2\xab\x86\xcc\xb8" }, .{ .entity = "&ntgl;", .codepoints = .{ .Single = 8825 }, .characters = "\xe2\x89\xb9" }, .{ .entity = "&ntilde", .codepoints = .{ .Single = 241 }, .characters = "\xc3\xb1" }, .{ .entity = "&ntilde;", .codepoints = .{ .Single = 241 }, .characters = "\xc3\xb1" }, .{ .entity = "&ntlg;", .codepoints = .{ .Single = 8824 }, .characters = "\xe2\x89\xb8" }, .{ .entity = "&ntriangleleft;", .codepoints = .{ .Single = 8938 }, .characters = "\xe2\x8b\xaa" }, .{ .entity = "&ntrianglelefteq;", .codepoints = .{ .Single = 8940 }, .characters = "\xe2\x8b\xac" }, .{ .entity = "&ntriangleright;", .codepoints = .{ .Single = 8939 }, .characters = "\xe2\x8b\xab" }, .{ .entity = "&ntrianglerighteq;", .codepoints = .{ .Single = 8941 }, .characters = "\xe2\x8b\xad" }, .{ .entity = "&nu;", .codepoints = .{ .Single = 957 }, .characters = "\xce\xbd" }, .{ .entity = "&num;", .codepoints = .{ .Single = 35 }, .characters = "#" }, .{ .entity = "&numero;", .codepoints = .{ .Single = 8470 }, .characters = "\xe2\x84\x96" }, .{ .entity = "&numsp;", .codepoints = .{ .Single = 8199 }, .characters = "\xe2\x80\x87" }, .{ .entity = "&nvDash;", .codepoints = .{ .Single = 8877 }, .characters = "\xe2\x8a\xad" }, .{ .entity = "&nvHarr;", .codepoints = .{ .Single = 10500 }, .characters = "\xe2\xa4\x84" }, .{ .entity = "&nvap;", .codepoints = .{ .Double = [2]u32{ 8781, 8402 } }, .characters = "\xe2\x89\x8d\xe2\x83\x92" }, .{ .entity = "&nvdash;", .codepoints = .{ .Single = 8876 }, .characters = "\xe2\x8a\xac" }, .{ .entity = "&nvge;", .codepoints = .{ .Double = [2]u32{ 8805, 8402 } }, .characters = "\xe2\x89\xa5\xe2\x83\x92" }, .{ .entity = "&nvgt;", .codepoints = .{ .Double = [2]u32{ 62, 8402 } }, .characters = ">\xe2\x83\x92" }, .{ .entity = "&nvinfin;", .codepoints = .{ .Single = 10718 }, .characters = "\xe2\xa7\x9e" }, .{ .entity = "&nvlArr;", .codepoints = .{ .Single = 10498 }, .characters = "\xe2\xa4\x82" }, .{ .entity = "&nvle;", .codepoints = .{ .Double = [2]u32{ 8804, 8402 } }, .characters = "\xe2\x89\xa4\xe2\x83\x92" }, .{ .entity = "&nvlt;", .codepoints = .{ .Double = [2]u32{ 60, 8402 } }, .characters = "<\xe2\x83\x92" }, .{ .entity = "&nvltrie;", .codepoints = .{ .Double = [2]u32{ 8884, 8402 } }, .characters = "\xe2\x8a\xb4\xe2\x83\x92" }, .{ .entity = "&nvrArr;", .codepoints = .{ .Single = 10499 }, .characters = "\xe2\xa4\x83" }, .{ .entity = "&nvrtrie;", .codepoints = .{ .Double = [2]u32{ 8885, 8402 } }, .characters = "\xe2\x8a\xb5\xe2\x83\x92" }, .{ .entity = "&nvsim;", .codepoints = .{ .Double = [2]u32{ 8764, 8402 } }, .characters = "\xe2\x88\xbc\xe2\x83\x92" }, .{ .entity = "&nwArr;", .codepoints = .{ .Single = 8662 }, .characters = "\xe2\x87\x96" }, .{ .entity = "&nwarhk;", .codepoints = .{ .Single = 10531 }, .characters = "\xe2\xa4\xa3" }, .{ .entity = "&nwarr;", .codepoints = .{ .Single = 8598 }, .characters = "\xe2\x86\x96" }, .{ .entity = "&nwarrow;", .codepoints = .{ .Single = 8598 }, .characters = "\xe2\x86\x96" }, .{ .entity = "&nwnear;", .codepoints = .{ .Single = 10535 }, .characters = "\xe2\xa4\xa7" }, .{ .entity = "&oS;", .codepoints = .{ .Single = 9416 }, .characters = "\xe2\x93\x88" }, .{ .entity = "&oacute", .codepoints = .{ .Single = 243 }, .characters = "\xc3\xb3" }, .{ .entity = "&oacute;", .codepoints = .{ .Single = 243 }, .characters = "\xc3\xb3" }, .{ .entity = "&oast;", .codepoints = .{ .Single = 8859 }, .characters = "\xe2\x8a\x9b" }, .{ .entity = "&ocir;", .codepoints = .{ .Single = 8858 }, .characters = "\xe2\x8a\x9a" }, .{ .entity = "&ocirc", .codepoints = .{ .Single = 244 }, .characters = "\xc3\xb4" }, .{ .entity = "&ocirc;", .codepoints = .{ .Single = 244 }, .characters = "\xc3\xb4" }, .{ .entity = "&ocy;", .codepoints = .{ .Single = 1086 }, .characters = "\xd0\xbe" }, .{ .entity = "&odash;", .codepoints = .{ .Single = 8861 }, .characters = "\xe2\x8a\x9d" }, .{ .entity = "&odblac;", .codepoints = .{ .Single = 337 }, .characters = "\xc5\x91" }, .{ .entity = "&odiv;", .codepoints = .{ .Single = 10808 }, .characters = "\xe2\xa8\xb8" }, .{ .entity = "&odot;", .codepoints = .{ .Single = 8857 }, .characters = "\xe2\x8a\x99" }, .{ .entity = "&odsold;", .codepoints = .{ .Single = 10684 }, .characters = "\xe2\xa6\xbc" }, .{ .entity = "&oelig;", .codepoints = .{ .Single = 339 }, .characters = "\xc5\x93" }, .{ .entity = "&ofcir;", .codepoints = .{ .Single = 10687 }, .characters = "\xe2\xa6\xbf" }, .{ .entity = "&ofr;", .codepoints = .{ .Single = 120108 }, .characters = "\xf0\x9d\x94\xac" }, .{ .entity = "&ogon;", .codepoints = .{ .Single = 731 }, .characters = "\xcb\x9b" }, .{ .entity = "&ograve", .codepoints = .{ .Single = 242 }, .characters = "\xc3\xb2" }, .{ .entity = "&ograve;", .codepoints = .{ .Single = 242 }, .characters = "\xc3\xb2" }, .{ .entity = "&ogt;", .codepoints = .{ .Single = 10689 }, .characters = "\xe2\xa7\x81" }, .{ .entity = "&ohbar;", .codepoints = .{ .Single = 10677 }, .characters = "\xe2\xa6\xb5" }, .{ .entity = "&ohm;", .codepoints = .{ .Single = 937 }, .characters = "\xce\xa9" }, .{ .entity = "&oint;", .codepoints = .{ .Single = 8750 }, .characters = "\xe2\x88\xae" }, .{ .entity = "&olarr;", .codepoints = .{ .Single = 8634 }, .characters = "\xe2\x86\xba" }, .{ .entity = "&olcir;", .codepoints = .{ .Single = 10686 }, .characters = "\xe2\xa6\xbe" }, .{ .entity = "&olcross;", .codepoints = .{ .Single = 10683 }, .characters = "\xe2\xa6\xbb" }, .{ .entity = "&oline;", .codepoints = .{ .Single = 8254 }, .characters = "\xe2\x80\xbe" }, .{ .entity = "&olt;", .codepoints = .{ .Single = 10688 }, .characters = "\xe2\xa7\x80" }, .{ .entity = "&omacr;", .codepoints = .{ .Single = 333 }, .characters = "\xc5\x8d" }, .{ .entity = "&omega;", .codepoints = .{ .Single = 969 }, .characters = "\xcf\x89" }, .{ .entity = "&omicron;", .codepoints = .{ .Single = 959 }, .characters = "\xce\xbf" }, .{ .entity = "&omid;", .codepoints = .{ .Single = 10678 }, .characters = "\xe2\xa6\xb6" }, .{ .entity = "&ominus;", .codepoints = .{ .Single = 8854 }, .characters = "\xe2\x8a\x96" }, .{ .entity = "&oopf;", .codepoints = .{ .Single = 120160 }, .characters = "\xf0\x9d\x95\xa0" }, .{ .entity = "&opar;", .codepoints = .{ .Single = 10679 }, .characters = "\xe2\xa6\xb7" }, .{ .entity = "&operp;", .codepoints = .{ .Single = 10681 }, .characters = "\xe2\xa6\xb9" }, .{ .entity = "&oplus;", .codepoints = .{ .Single = 8853 }, .characters = "\xe2\x8a\x95" }, .{ .entity = "&or;", .codepoints = .{ .Single = 8744 }, .characters = "\xe2\x88\xa8" }, .{ .entity = "&orarr;", .codepoints = .{ .Single = 8635 }, .characters = "\xe2\x86\xbb" }, .{ .entity = "&ord;", .codepoints = .{ .Single = 10845 }, .characters = "\xe2\xa9\x9d" }, .{ .entity = "&order;", .codepoints = .{ .Single = 8500 }, .characters = "\xe2\x84\xb4" }, .{ .entity = "&orderof;", .codepoints = .{ .Single = 8500 }, .characters = "\xe2\x84\xb4" }, .{ .entity = "&ordf", .codepoints = .{ .Single = 170 }, .characters = "\xc2\xaa" }, .{ .entity = "&ordf;", .codepoints = .{ .Single = 170 }, .characters = "\xc2\xaa" }, .{ .entity = "&ordm", .codepoints = .{ .Single = 186 }, .characters = "\xc2\xba" }, .{ .entity = "&ordm;", .codepoints = .{ .Single = 186 }, .characters = "\xc2\xba" }, .{ .entity = "&origof;", .codepoints = .{ .Single = 8886 }, .characters = "\xe2\x8a\xb6" }, .{ .entity = "&oror;", .codepoints = .{ .Single = 10838 }, .characters = "\xe2\xa9\x96" }, .{ .entity = "&orslope;", .codepoints = .{ .Single = 10839 }, .characters = "\xe2\xa9\x97" }, .{ .entity = "&orv;", .codepoints = .{ .Single = 10843 }, .characters = "\xe2\xa9\x9b" }, .{ .entity = "&oscr;", .codepoints = .{ .Single = 8500 }, .characters = "\xe2\x84\xb4" }, .{ .entity = "&oslash", .codepoints = .{ .Single = 248 }, .characters = "\xc3\xb8" }, .{ .entity = "&oslash;", .codepoints = .{ .Single = 248 }, .characters = "\xc3\xb8" }, .{ .entity = "&osol;", .codepoints = .{ .Single = 8856 }, .characters = "\xe2\x8a\x98" }, .{ .entity = "&otilde", .codepoints = .{ .Single = 245 }, .characters = "\xc3\xb5" }, .{ .entity = "&otilde;", .codepoints = .{ .Single = 245 }, .characters = "\xc3\xb5" }, .{ .entity = "&otimes;", .codepoints = .{ .Single = 8855 }, .characters = "\xe2\x8a\x97" }, .{ .entity = "&otimesas;", .codepoints = .{ .Single = 10806 }, .characters = "\xe2\xa8\xb6" }, .{ .entity = "&ouml", .codepoints = .{ .Single = 246 }, .characters = "\xc3\xb6" }, .{ .entity = "&ouml;", .codepoints = .{ .Single = 246 }, .characters = "\xc3\xb6" }, .{ .entity = "&ovbar;", .codepoints = .{ .Single = 9021 }, .characters = "\xe2\x8c\xbd" }, .{ .entity = "&par;", .codepoints = .{ .Single = 8741 }, .characters = "\xe2\x88\xa5" }, .{ .entity = "&para", .codepoints = .{ .Single = 182 }, .characters = "\xc2\xb6" }, .{ .entity = "&para;", .codepoints = .{ .Single = 182 }, .characters = "\xc2\xb6" }, .{ .entity = "&parallel;", .codepoints = .{ .Single = 8741 }, .characters = "\xe2\x88\xa5" }, .{ .entity = "&parsim;", .codepoints = .{ .Single = 10995 }, .characters = "\xe2\xab\xb3" }, .{ .entity = "&parsl;", .codepoints = .{ .Single = 11005 }, .characters = "\xe2\xab\xbd" }, .{ .entity = "&part;", .codepoints = .{ .Single = 8706 }, .characters = "\xe2\x88\x82" }, .{ .entity = "&pcy;", .codepoints = .{ .Single = 1087 }, .characters = "\xd0\xbf" }, .{ .entity = "&percnt;", .codepoints = .{ .Single = 37 }, .characters = "%" }, .{ .entity = "&period;", .codepoints = .{ .Single = 46 }, .characters = "." }, .{ .entity = "&permil;", .codepoints = .{ .Single = 8240 }, .characters = "\xe2\x80\xb0" }, .{ .entity = "&perp;", .codepoints = .{ .Single = 8869 }, .characters = "\xe2\x8a\xa5" }, .{ .entity = "&pertenk;", .codepoints = .{ .Single = 8241 }, .characters = "\xe2\x80\xb1" }, .{ .entity = "&pfr;", .codepoints = .{ .Single = 120109 }, .characters = "\xf0\x9d\x94\xad" }, .{ .entity = "&phi;", .codepoints = .{ .Single = 966 }, .characters = "\xcf\x86" }, .{ .entity = "&phiv;", .codepoints = .{ .Single = 981 }, .characters = "\xcf\x95" }, .{ .entity = "&phmmat;", .codepoints = .{ .Single = 8499 }, .characters = "\xe2\x84\xb3" }, .{ .entity = "&phone;", .codepoints = .{ .Single = 9742 }, .characters = "\xe2\x98\x8e" }, .{ .entity = "&pi;", .codepoints = .{ .Single = 960 }, .characters = "\xcf\x80" }, .{ .entity = "&pitchfork;", .codepoints = .{ .Single = 8916 }, .characters = "\xe2\x8b\x94" }, .{ .entity = "&piv;", .codepoints = .{ .Single = 982 }, .characters = "\xcf\x96" }, .{ .entity = "&planck;", .codepoints = .{ .Single = 8463 }, .characters = "\xe2\x84\x8f" }, .{ .entity = "&planckh;", .codepoints = .{ .Single = 8462 }, .characters = "\xe2\x84\x8e" }, .{ .entity = "&plankv;", .codepoints = .{ .Single = 8463 }, .characters = "\xe2\x84\x8f" }, .{ .entity = "&plus;", .codepoints = .{ .Single = 43 }, .characters = "+" }, .{ .entity = "&plusacir;", .codepoints = .{ .Single = 10787 }, .characters = "\xe2\xa8\xa3" }, .{ .entity = "&plusb;", .codepoints = .{ .Single = 8862 }, .characters = "\xe2\x8a\x9e" }, .{ .entity = "&pluscir;", .codepoints = .{ .Single = 10786 }, .characters = "\xe2\xa8\xa2" }, .{ .entity = "&plusdo;", .codepoints = .{ .Single = 8724 }, .characters = "\xe2\x88\x94" }, .{ .entity = "&plusdu;", .codepoints = .{ .Single = 10789 }, .characters = "\xe2\xa8\xa5" }, .{ .entity = "&pluse;", .codepoints = .{ .Single = 10866 }, .characters = "\xe2\xa9\xb2" }, .{ .entity = "&plusmn", .codepoints = .{ .Single = 177 }, .characters = "\xc2\xb1" }, .{ .entity = "&plusmn;", .codepoints = .{ .Single = 177 }, .characters = "\xc2\xb1" }, .{ .entity = "&plussim;", .codepoints = .{ .Single = 10790 }, .characters = "\xe2\xa8\xa6" }, .{ .entity = "&plustwo;", .codepoints = .{ .Single = 10791 }, .characters = "\xe2\xa8\xa7" }, .{ .entity = "&pm;", .codepoints = .{ .Single = 177 }, .characters = "\xc2\xb1" }, .{ .entity = "&pointint;", .codepoints = .{ .Single = 10773 }, .characters = "\xe2\xa8\x95" }, .{ .entity = "&popf;", .codepoints = .{ .Single = 120161 }, .characters = "\xf0\x9d\x95\xa1" }, .{ .entity = "&pound", .codepoints = .{ .Single = 163 }, .characters = "\xc2\xa3" }, .{ .entity = "&pound;", .codepoints = .{ .Single = 163 }, .characters = "\xc2\xa3" }, .{ .entity = "&pr;", .codepoints = .{ .Single = 8826 }, .characters = "\xe2\x89\xba" }, .{ .entity = "&prE;", .codepoints = .{ .Single = 10931 }, .characters = "\xe2\xaa\xb3" }, .{ .entity = "&prap;", .codepoints = .{ .Single = 10935 }, .characters = "\xe2\xaa\xb7" }, .{ .entity = "&prcue;", .codepoints = .{ .Single = 8828 }, .characters = "\xe2\x89\xbc" }, .{ .entity = "&pre;", .codepoints = .{ .Single = 10927 }, .characters = "\xe2\xaa\xaf" }, .{ .entity = "&prec;", .codepoints = .{ .Single = 8826 }, .characters = "\xe2\x89\xba" }, .{ .entity = "&precapprox;", .codepoints = .{ .Single = 10935 }, .characters = "\xe2\xaa\xb7" }, .{ .entity = "&preccurlyeq;", .codepoints = .{ .Single = 8828 }, .characters = "\xe2\x89\xbc" }, .{ .entity = "&preceq;", .codepoints = .{ .Single = 10927 }, .characters = "\xe2\xaa\xaf" }, .{ .entity = "&precnapprox;", .codepoints = .{ .Single = 10937 }, .characters = "\xe2\xaa\xb9" }, .{ .entity = "&precneqq;", .codepoints = .{ .Single = 10933 }, .characters = "\xe2\xaa\xb5" }, .{ .entity = "&precnsim;", .codepoints = .{ .Single = 8936 }, .characters = "\xe2\x8b\xa8" }, .{ .entity = "&precsim;", .codepoints = .{ .Single = 8830 }, .characters = "\xe2\x89\xbe" }, .{ .entity = "&prime;", .codepoints = .{ .Single = 8242 }, .characters = "\xe2\x80\xb2" }, .{ .entity = "&primes;", .codepoints = .{ .Single = 8473 }, .characters = "\xe2\x84\x99" }, .{ .entity = "&prnE;", .codepoints = .{ .Single = 10933 }, .characters = "\xe2\xaa\xb5" }, .{ .entity = "&prnap;", .codepoints = .{ .Single = 10937 }, .characters = "\xe2\xaa\xb9" }, .{ .entity = "&prnsim;", .codepoints = .{ .Single = 8936 }, .characters = "\xe2\x8b\xa8" }, .{ .entity = "&prod;", .codepoints = .{ .Single = 8719 }, .characters = "\xe2\x88\x8f" }, .{ .entity = "&profalar;", .codepoints = .{ .Single = 9006 }, .characters = "\xe2\x8c\xae" }, .{ .entity = "&profline;", .codepoints = .{ .Single = 8978 }, .characters = "\xe2\x8c\x92" }, .{ .entity = "&profsurf;", .codepoints = .{ .Single = 8979 }, .characters = "\xe2\x8c\x93" }, .{ .entity = "&prop;", .codepoints = .{ .Single = 8733 }, .characters = "\xe2\x88\x9d" }, .{ .entity = "&propto;", .codepoints = .{ .Single = 8733 }, .characters = "\xe2\x88\x9d" }, .{ .entity = "&prsim;", .codepoints = .{ .Single = 8830 }, .characters = "\xe2\x89\xbe" }, .{ .entity = "&prurel;", .codepoints = .{ .Single = 8880 }, .characters = "\xe2\x8a\xb0" }, .{ .entity = "&pscr;", .codepoints = .{ .Single = 120005 }, .characters = "\xf0\x9d\x93\x85" }, .{ .entity = "&psi;", .codepoints = .{ .Single = 968 }, .characters = "\xcf\x88" }, .{ .entity = "&puncsp;", .codepoints = .{ .Single = 8200 }, .characters = "\xe2\x80\x88" }, .{ .entity = "&qfr;", .codepoints = .{ .Single = 120110 }, .characters = "\xf0\x9d\x94\xae" }, .{ .entity = "&qint;", .codepoints = .{ .Single = 10764 }, .characters = "\xe2\xa8\x8c" }, .{ .entity = "&qopf;", .codepoints = .{ .Single = 120162 }, .characters = "\xf0\x9d\x95\xa2" }, .{ .entity = "&qprime;", .codepoints = .{ .Single = 8279 }, .characters = "\xe2\x81\x97" }, .{ .entity = "&qscr;", .codepoints = .{ .Single = 120006 }, .characters = "\xf0\x9d\x93\x86" }, .{ .entity = "&quaternions;", .codepoints = .{ .Single = 8461 }, .characters = "\xe2\x84\x8d" }, .{ .entity = "&quatint;", .codepoints = .{ .Single = 10774 }, .characters = "\xe2\xa8\x96" }, .{ .entity = "&quest;", .codepoints = .{ .Single = 63 }, .characters = "?" }, .{ .entity = "&questeq;", .codepoints = .{ .Single = 8799 }, .characters = "\xe2\x89\x9f" }, .{ .entity = "&quot", .codepoints = .{ .Single = 34 }, .characters = "\"" }, .{ .entity = "&quot;", .codepoints = .{ .Single = 34 }, .characters = "\"" }, .{ .entity = "&rAarr;", .codepoints = .{ .Single = 8667 }, .characters = "\xe2\x87\x9b" }, .{ .entity = "&rArr;", .codepoints = .{ .Single = 8658 }, .characters = "\xe2\x87\x92" }, .{ .entity = "&rAtail;", .codepoints = .{ .Single = 10524 }, .characters = "\xe2\xa4\x9c" }, .{ .entity = "&rBarr;", .codepoints = .{ .Single = 10511 }, .characters = "\xe2\xa4\x8f" }, .{ .entity = "&rHar;", .codepoints = .{ .Single = 10596 }, .characters = "\xe2\xa5\xa4" }, .{ .entity = "&race;", .codepoints = .{ .Double = [2]u32{ 8765, 817 } }, .characters = "\xe2\x88\xbd\xcc\xb1" }, .{ .entity = "&racute;", .codepoints = .{ .Single = 341 }, .characters = "\xc5\x95" }, .{ .entity = "&radic;", .codepoints = .{ .Single = 8730 }, .characters = "\xe2\x88\x9a" }, .{ .entity = "&raemptyv;", .codepoints = .{ .Single = 10675 }, .characters = "\xe2\xa6\xb3" }, .{ .entity = "&rang;", .codepoints = .{ .Single = 10217 }, .characters = "\xe2\x9f\xa9" }, .{ .entity = "&rangd;", .codepoints = .{ .Single = 10642 }, .characters = "\xe2\xa6\x92" }, .{ .entity = "&range;", .codepoints = .{ .Single = 10661 }, .characters = "\xe2\xa6\xa5" }, .{ .entity = "&rangle;", .codepoints = .{ .Single = 10217 }, .characters = "\xe2\x9f\xa9" }, .{ .entity = "&raquo", .codepoints = .{ .Single = 187 }, .characters = "\xc2\xbb" }, .{ .entity = "&raquo;", .codepoints = .{ .Single = 187 }, .characters = "\xc2\xbb" }, .{ .entity = "&rarr;", .codepoints = .{ .Single = 8594 }, .characters = "\xe2\x86\x92" }, .{ .entity = "&rarrap;", .codepoints = .{ .Single = 10613 }, .characters = "\xe2\xa5\xb5" }, .{ .entity = "&rarrb;", .codepoints = .{ .Single = 8677 }, .characters = "\xe2\x87\xa5" }, .{ .entity = "&rarrbfs;", .codepoints = .{ .Single = 10528 }, .characters = "\xe2\xa4\xa0" }, .{ .entity = "&rarrc;", .codepoints = .{ .Single = 10547 }, .characters = "\xe2\xa4\xb3" }, .{ .entity = "&rarrfs;", .codepoints = .{ .Single = 10526 }, .characters = "\xe2\xa4\x9e" }, .{ .entity = "&rarrhk;", .codepoints = .{ .Single = 8618 }, .characters = "\xe2\x86\xaa" }, .{ .entity = "&rarrlp;", .codepoints = .{ .Single = 8620 }, .characters = "\xe2\x86\xac" }, .{ .entity = "&rarrpl;", .codepoints = .{ .Single = 10565 }, .characters = "\xe2\xa5\x85" }, .{ .entity = "&rarrsim;", .codepoints = .{ .Single = 10612 }, .characters = "\xe2\xa5\xb4" }, .{ .entity = "&rarrtl;", .codepoints = .{ .Single = 8611 }, .characters = "\xe2\x86\xa3" }, .{ .entity = "&rarrw;", .codepoints = .{ .Single = 8605 }, .characters = "\xe2\x86\x9d" }, .{ .entity = "&ratail;", .codepoints = .{ .Single = 10522 }, .characters = "\xe2\xa4\x9a" }, .{ .entity = "&ratio;", .codepoints = .{ .Single = 8758 }, .characters = "\xe2\x88\xb6" }, .{ .entity = "&rationals;", .codepoints = .{ .Single = 8474 }, .characters = "\xe2\x84\x9a" }, .{ .entity = "&rbarr;", .codepoints = .{ .Single = 10509 }, .characters = "\xe2\xa4\x8d" }, .{ .entity = "&rbbrk;", .codepoints = .{ .Single = 10099 }, .characters = "\xe2\x9d\xb3" }, .{ .entity = "&rbrace;", .codepoints = .{ .Single = 125 }, .characters = "}" }, .{ .entity = "&rbrack;", .codepoints = .{ .Single = 93 }, .characters = "]" }, .{ .entity = "&rbrke;", .codepoints = .{ .Single = 10636 }, .characters = "\xe2\xa6\x8c" }, .{ .entity = "&rbrksld;", .codepoints = .{ .Single = 10638 }, .characters = "\xe2\xa6\x8e" }, .{ .entity = "&rbrkslu;", .codepoints = .{ .Single = 10640 }, .characters = "\xe2\xa6\x90" }, .{ .entity = "&rcaron;", .codepoints = .{ .Single = 345 }, .characters = "\xc5\x99" }, .{ .entity = "&rcedil;", .codepoints = .{ .Single = 343 }, .characters = "\xc5\x97" }, .{ .entity = "&rceil;", .codepoints = .{ .Single = 8969 }, .characters = "\xe2\x8c\x89" }, .{ .entity = "&rcub;", .codepoints = .{ .Single = 125 }, .characters = "}" }, .{ .entity = "&rcy;", .codepoints = .{ .Single = 1088 }, .characters = "\xd1\x80" }, .{ .entity = "&rdca;", .codepoints = .{ .Single = 10551 }, .characters = "\xe2\xa4\xb7" }, .{ .entity = "&rdldhar;", .codepoints = .{ .Single = 10601 }, .characters = "\xe2\xa5\xa9" }, .{ .entity = "&rdquo;", .codepoints = .{ .Single = 8221 }, .characters = "\xe2\x80\x9d" }, .{ .entity = "&rdquor;", .codepoints = .{ .Single = 8221 }, .characters = "\xe2\x80\x9d" }, .{ .entity = "&rdsh;", .codepoints = .{ .Single = 8627 }, .characters = "\xe2\x86\xb3" }, .{ .entity = "&real;", .codepoints = .{ .Single = 8476 }, .characters = "\xe2\x84\x9c" }, .{ .entity = "&realine;", .codepoints = .{ .Single = 8475 }, .characters = "\xe2\x84\x9b" }, .{ .entity = "&realpart;", .codepoints = .{ .Single = 8476 }, .characters = "\xe2\x84\x9c" }, .{ .entity = "&reals;", .codepoints = .{ .Single = 8477 }, .characters = "\xe2\x84\x9d" }, .{ .entity = "&rect;", .codepoints = .{ .Single = 9645 }, .characters = "\xe2\x96\xad" }, .{ .entity = "&reg", .codepoints = .{ .Single = 174 }, .characters = "\xc2\xae" }, .{ .entity = "&reg;", .codepoints = .{ .Single = 174 }, .characters = "\xc2\xae" }, .{ .entity = "&rfisht;", .codepoints = .{ .Single = 10621 }, .characters = "\xe2\xa5\xbd" }, .{ .entity = "&rfloor;", .codepoints = .{ .Single = 8971 }, .characters = "\xe2\x8c\x8b" }, .{ .entity = "&rfr;", .codepoints = .{ .Single = 120111 }, .characters = "\xf0\x9d\x94\xaf" }, .{ .entity = "&rhard;", .codepoints = .{ .Single = 8641 }, .characters = "\xe2\x87\x81" }, .{ .entity = "&rharu;", .codepoints = .{ .Single = 8640 }, .characters = "\xe2\x87\x80" }, .{ .entity = "&rharul;", .codepoints = .{ .Single = 10604 }, .characters = "\xe2\xa5\xac" }, .{ .entity = "&rho;", .codepoints = .{ .Single = 961 }, .characters = "\xcf\x81" }, .{ .entity = "&rhov;", .codepoints = .{ .Single = 1009 }, .characters = "\xcf\xb1" }, .{ .entity = "&rightarrow;", .codepoints = .{ .Single = 8594 }, .characters = "\xe2\x86\x92" }, .{ .entity = "&rightarrowtail;", .codepoints = .{ .Single = 8611 }, .characters = "\xe2\x86\xa3" }, .{ .entity = "&rightharpoondown;", .codepoints = .{ .Single = 8641 }, .characters = "\xe2\x87\x81" }, .{ .entity = "&rightharpoonup;", .codepoints = .{ .Single = 8640 }, .characters = "\xe2\x87\x80" }, .{ .entity = "&rightleftarrows;", .codepoints = .{ .Single = 8644 }, .characters = "\xe2\x87\x84" }, .{ .entity = "&rightleftharpoons;", .codepoints = .{ .Single = 8652 }, .characters = "\xe2\x87\x8c" }, .{ .entity = "&rightrightarrows;", .codepoints = .{ .Single = 8649 }, .characters = "\xe2\x87\x89" }, .{ .entity = "&rightsquigarrow;", .codepoints = .{ .Single = 8605 }, .characters = "\xe2\x86\x9d" }, .{ .entity = "&rightthreetimes;", .codepoints = .{ .Single = 8908 }, .characters = "\xe2\x8b\x8c" }, .{ .entity = "&ring;", .codepoints = .{ .Single = 730 }, .characters = "\xcb\x9a" }, .{ .entity = "&risingdotseq;", .codepoints = .{ .Single = 8787 }, .characters = "\xe2\x89\x93" }, .{ .entity = "&rlarr;", .codepoints = .{ .Single = 8644 }, .characters = "\xe2\x87\x84" }, .{ .entity = "&rlhar;", .codepoints = .{ .Single = 8652 }, .characters = "\xe2\x87\x8c" }, .{ .entity = "&rlm;", .codepoints = .{ .Single = 8207 }, .characters = "\xe2\x80\x8f" }, .{ .entity = "&rmoust;", .codepoints = .{ .Single = 9137 }, .characters = "\xe2\x8e\xb1" }, .{ .entity = "&rmoustache;", .codepoints = .{ .Single = 9137 }, .characters = "\xe2\x8e\xb1" }, .{ .entity = "&rnmid;", .codepoints = .{ .Single = 10990 }, .characters = "\xe2\xab\xae" }, .{ .entity = "&roang;", .codepoints = .{ .Single = 10221 }, .characters = "\xe2\x9f\xad" }, .{ .entity = "&roarr;", .codepoints = .{ .Single = 8702 }, .characters = "\xe2\x87\xbe" }, .{ .entity = "&robrk;", .codepoints = .{ .Single = 10215 }, .characters = "\xe2\x9f\xa7" }, .{ .entity = "&ropar;", .codepoints = .{ .Single = 10630 }, .characters = "\xe2\xa6\x86" }, .{ .entity = "&ropf;", .codepoints = .{ .Single = 120163 }, .characters = "\xf0\x9d\x95\xa3" }, .{ .entity = "&roplus;", .codepoints = .{ .Single = 10798 }, .characters = "\xe2\xa8\xae" }, .{ .entity = "&rotimes;", .codepoints = .{ .Single = 10805 }, .characters = "\xe2\xa8\xb5" }, .{ .entity = "&rpar;", .codepoints = .{ .Single = 41 }, .characters = ")" }, .{ .entity = "&rpargt;", .codepoints = .{ .Single = 10644 }, .characters = "\xe2\xa6\x94" }, .{ .entity = "&rppolint;", .codepoints = .{ .Single = 10770 }, .characters = "\xe2\xa8\x92" }, .{ .entity = "&rrarr;", .codepoints = .{ .Single = 8649 }, .characters = "\xe2\x87\x89" }, .{ .entity = "&rsaquo;", .codepoints = .{ .Single = 8250 }, .characters = "\xe2\x80\xba" }, .{ .entity = "&rscr;", .codepoints = .{ .Single = 120007 }, .characters = "\xf0\x9d\x93\x87" }, .{ .entity = "&rsh;", .codepoints = .{ .Single = 8625 }, .characters = "\xe2\x86\xb1" }, .{ .entity = "&rsqb;", .codepoints = .{ .Single = 93 }, .characters = "]" }, .{ .entity = "&rsquo;", .codepoints = .{ .Single = 8217 }, .characters = "\xe2\x80\x99" }, .{ .entity = "&rsquor;", .codepoints = .{ .Single = 8217 }, .characters = "\xe2\x80\x99" }, .{ .entity = "&rthree;", .codepoints = .{ .Single = 8908 }, .characters = "\xe2\x8b\x8c" }, .{ .entity = "&rtimes;", .codepoints = .{ .Single = 8906 }, .characters = "\xe2\x8b\x8a" }, .{ .entity = "&rtri;", .codepoints = .{ .Single = 9657 }, .characters = "\xe2\x96\xb9" }, .{ .entity = "&rtrie;", .codepoints = .{ .Single = 8885 }, .characters = "\xe2\x8a\xb5" }, .{ .entity = "&rtrif;", .codepoints = .{ .Single = 9656 }, .characters = "\xe2\x96\xb8" }, .{ .entity = "&rtriltri;", .codepoints = .{ .Single = 10702 }, .characters = "\xe2\xa7\x8e" }, .{ .entity = "&ruluhar;", .codepoints = .{ .Single = 10600 }, .characters = "\xe2\xa5\xa8" }, .{ .entity = "&rx;", .codepoints = .{ .Single = 8478 }, .characters = "\xe2\x84\x9e" }, .{ .entity = "&sacute;", .codepoints = .{ .Single = 347 }, .characters = "\xc5\x9b" }, .{ .entity = "&sbquo;", .codepoints = .{ .Single = 8218 }, .characters = "\xe2\x80\x9a" }, .{ .entity = "&sc;", .codepoints = .{ .Single = 8827 }, .characters = "\xe2\x89\xbb" }, .{ .entity = "&scE;", .codepoints = .{ .Single = 10932 }, .characters = "\xe2\xaa\xb4" }, .{ .entity = "&scap;", .codepoints = .{ .Single = 10936 }, .characters = "\xe2\xaa\xb8" }, .{ .entity = "&scaron;", .codepoints = .{ .Single = 353 }, .characters = "\xc5\xa1" }, .{ .entity = "&sccue;", .codepoints = .{ .Single = 8829 }, .characters = "\xe2\x89\xbd" }, .{ .entity = "&sce;", .codepoints = .{ .Single = 10928 }, .characters = "\xe2\xaa\xb0" }, .{ .entity = "&scedil;", .codepoints = .{ .Single = 351 }, .characters = "\xc5\x9f" }, .{ .entity = "&scirc;", .codepoints = .{ .Single = 349 }, .characters = "\xc5\x9d" }, .{ .entity = "&scnE;", .codepoints = .{ .Single = 10934 }, .characters = "\xe2\xaa\xb6" }, .{ .entity = "&scnap;", .codepoints = .{ .Single = 10938 }, .characters = "\xe2\xaa\xba" }, .{ .entity = "&scnsim;", .codepoints = .{ .Single = 8937 }, .characters = "\xe2\x8b\xa9" }, .{ .entity = "&scpolint;", .codepoints = .{ .Single = 10771 }, .characters = "\xe2\xa8\x93" }, .{ .entity = "&scsim;", .codepoints = .{ .Single = 8831 }, .characters = "\xe2\x89\xbf" }, .{ .entity = "&scy;", .codepoints = .{ .Single = 1089 }, .characters = "\xd1\x81" }, .{ .entity = "&sdot;", .codepoints = .{ .Single = 8901 }, .characters = "\xe2\x8b\x85" }, .{ .entity = "&sdotb;", .codepoints = .{ .Single = 8865 }, .characters = "\xe2\x8a\xa1" }, .{ .entity = "&sdote;", .codepoints = .{ .Single = 10854 }, .characters = "\xe2\xa9\xa6" }, .{ .entity = "&seArr;", .codepoints = .{ .Single = 8664 }, .characters = "\xe2\x87\x98" }, .{ .entity = "&searhk;", .codepoints = .{ .Single = 10533 }, .characters = "\xe2\xa4\xa5" }, .{ .entity = "&searr;", .codepoints = .{ .Single = 8600 }, .characters = "\xe2\x86\x98" }, .{ .entity = "&searrow;", .codepoints = .{ .Single = 8600 }, .characters = "\xe2\x86\x98" }, .{ .entity = "&sect", .codepoints = .{ .Single = 167 }, .characters = "\xc2\xa7" }, .{ .entity = "&sect;", .codepoints = .{ .Single = 167 }, .characters = "\xc2\xa7" }, .{ .entity = "&semi;", .codepoints = .{ .Single = 59 }, .characters = ";" }, .{ .entity = "&seswar;", .codepoints = .{ .Single = 10537 }, .characters = "\xe2\xa4\xa9" }, .{ .entity = "&setminus;", .codepoints = .{ .Single = 8726 }, .characters = "\xe2\x88\x96" }, .{ .entity = "&setmn;", .codepoints = .{ .Single = 8726 }, .characters = "\xe2\x88\x96" }, .{ .entity = "&sext;", .codepoints = .{ .Single = 10038 }, .characters = "\xe2\x9c\xb6" }, .{ .entity = "&sfr;", .codepoints = .{ .Single = 120112 }, .characters = "\xf0\x9d\x94\xb0" }, .{ .entity = "&sfrown;", .codepoints = .{ .Single = 8994 }, .characters = "\xe2\x8c\xa2" }, .{ .entity = "&sharp;", .codepoints = .{ .Single = 9839 }, .characters = "\xe2\x99\xaf" }, .{ .entity = "&shchcy;", .codepoints = .{ .Single = 1097 }, .characters = "\xd1\x89" }, .{ .entity = "&shcy;", .codepoints = .{ .Single = 1096 }, .characters = "\xd1\x88" }, .{ .entity = "&shortmid;", .codepoints = .{ .Single = 8739 }, .characters = "\xe2\x88\xa3" }, .{ .entity = "&shortparallel;", .codepoints = .{ .Single = 8741 }, .characters = "\xe2\x88\xa5" }, .{ .entity = "&shy", .codepoints = .{ .Single = 173 }, .characters = "\xc2\xad" }, .{ .entity = "&shy;", .codepoints = .{ .Single = 173 }, .characters = "\xc2\xad" }, .{ .entity = "&sigma;", .codepoints = .{ .Single = 963 }, .characters = "\xcf\x83" }, .{ .entity = "&sigmaf;", .codepoints = .{ .Single = 962 }, .characters = "\xcf\x82" }, .{ .entity = "&sigmav;", .codepoints = .{ .Single = 962 }, .characters = "\xcf\x82" }, .{ .entity = "&sim;", .codepoints = .{ .Single = 8764 }, .characters = "\xe2\x88\xbc" }, .{ .entity = "&simdot;", .codepoints = .{ .Single = 10858 }, .characters = "\xe2\xa9\xaa" }, .{ .entity = "&sime;", .codepoints = .{ .Single = 8771 }, .characters = "\xe2\x89\x83" }, .{ .entity = "&simeq;", .codepoints = .{ .Single = 8771 }, .characters = "\xe2\x89\x83" }, .{ .entity = "&simg;", .codepoints = .{ .Single = 10910 }, .characters = "\xe2\xaa\x9e" }, .{ .entity = "&simgE;", .codepoints = .{ .Single = 10912 }, .characters = "\xe2\xaa\xa0" }, .{ .entity = "&siml;", .codepoints = .{ .Single = 10909 }, .characters = "\xe2\xaa\x9d" }, .{ .entity = "&simlE;", .codepoints = .{ .Single = 10911 }, .characters = "\xe2\xaa\x9f" }, .{ .entity = "&simne;", .codepoints = .{ .Single = 8774 }, .characters = "\xe2\x89\x86" }, .{ .entity = "&simplus;", .codepoints = .{ .Single = 10788 }, .characters = "\xe2\xa8\xa4" }, .{ .entity = "&simrarr;", .codepoints = .{ .Single = 10610 }, .characters = "\xe2\xa5\xb2" }, .{ .entity = "&slarr;", .codepoints = .{ .Single = 8592 }, .characters = "\xe2\x86\x90" }, .{ .entity = "&smallsetminus;", .codepoints = .{ .Single = 8726 }, .characters = "\xe2\x88\x96" }, .{ .entity = "&smashp;", .codepoints = .{ .Single = 10803 }, .characters = "\xe2\xa8\xb3" }, .{ .entity = "&smeparsl;", .codepoints = .{ .Single = 10724 }, .characters = "\xe2\xa7\xa4" }, .{ .entity = "&smid;", .codepoints = .{ .Single = 8739 }, .characters = "\xe2\x88\xa3" }, .{ .entity = "&smile;", .codepoints = .{ .Single = 8995 }, .characters = "\xe2\x8c\xa3" }, .{ .entity = "&smt;", .codepoints = .{ .Single = 10922 }, .characters = "\xe2\xaa\xaa" }, .{ .entity = "&smte;", .codepoints = .{ .Single = 10924 }, .characters = "\xe2\xaa\xac" }, .{ .entity = "&smtes;", .codepoints = .{ .Double = [2]u32{ 10924, 65024 } }, .characters = "\xe2\xaa\xac\xef\xb8\x80" }, .{ .entity = "&softcy;", .codepoints = .{ .Single = 1100 }, .characters = "\xd1\x8c" }, .{ .entity = "&sol;", .codepoints = .{ .Single = 47 }, .characters = "/" }, .{ .entity = "&solb;", .codepoints = .{ .Single = 10692 }, .characters = "\xe2\xa7\x84" }, .{ .entity = "&solbar;", .codepoints = .{ .Single = 9023 }, .characters = "\xe2\x8c\xbf" }, .{ .entity = "&sopf;", .codepoints = .{ .Single = 120164 }, .characters = "\xf0\x9d\x95\xa4" }, .{ .entity = "&spades;", .codepoints = .{ .Single = 9824 }, .characters = "\xe2\x99\xa0" }, .{ .entity = "&spadesuit;", .codepoints = .{ .Single = 9824 }, .characters = "\xe2\x99\xa0" }, .{ .entity = "&spar;", .codepoints = .{ .Single = 8741 }, .characters = "\xe2\x88\xa5" }, .{ .entity = "&sqcap;", .codepoints = .{ .Single = 8851 }, .characters = "\xe2\x8a\x93" }, .{ .entity = "&sqcaps;", .codepoints = .{ .Double = [2]u32{ 8851, 65024 } }, .characters = "\xe2\x8a\x93\xef\xb8\x80" }, .{ .entity = "&sqcup;", .codepoints = .{ .Single = 8852 }, .characters = "\xe2\x8a\x94" }, .{ .entity = "&sqcups;", .codepoints = .{ .Double = [2]u32{ 8852, 65024 } }, .characters = "\xe2\x8a\x94\xef\xb8\x80" }, .{ .entity = "&sqsub;", .codepoints = .{ .Single = 8847 }, .characters = "\xe2\x8a\x8f" }, .{ .entity = "&sqsube;", .codepoints = .{ .Single = 8849 }, .characters = "\xe2\x8a\x91" }, .{ .entity = "&sqsubset;", .codepoints = .{ .Single = 8847 }, .characters = "\xe2\x8a\x8f" }, .{ .entity = "&sqsubseteq;", .codepoints = .{ .Single = 8849 }, .characters = "\xe2\x8a\x91" }, .{ .entity = "&sqsup;", .codepoints = .{ .Single = 8848 }, .characters = "\xe2\x8a\x90" }, .{ .entity = "&sqsupe;", .codepoints = .{ .Single = 8850 }, .characters = "\xe2\x8a\x92" }, .{ .entity = "&sqsupset;", .codepoints = .{ .Single = 8848 }, .characters = "\xe2\x8a\x90" }, .{ .entity = "&sqsupseteq;", .codepoints = .{ .Single = 8850 }, .characters = "\xe2\x8a\x92" }, .{ .entity = "&squ;", .codepoints = .{ .Single = 9633 }, .characters = "\xe2\x96\xa1" }, .{ .entity = "&square;", .codepoints = .{ .Single = 9633 }, .characters = "\xe2\x96\xa1" }, .{ .entity = "&squarf;", .codepoints = .{ .Single = 9642 }, .characters = "\xe2\x96\xaa" }, .{ .entity = "&squf;", .codepoints = .{ .Single = 9642 }, .characters = "\xe2\x96\xaa" }, .{ .entity = "&srarr;", .codepoints = .{ .Single = 8594 }, .characters = "\xe2\x86\x92" }, .{ .entity = "&sscr;", .codepoints = .{ .Single = 120008 }, .characters = "\xf0\x9d\x93\x88" }, .{ .entity = "&ssetmn;", .codepoints = .{ .Single = 8726 }, .characters = "\xe2\x88\x96" }, .{ .entity = "&ssmile;", .codepoints = .{ .Single = 8995 }, .characters = "\xe2\x8c\xa3" }, .{ .entity = "&sstarf;", .codepoints = .{ .Single = 8902 }, .characters = "\xe2\x8b\x86" }, .{ .entity = "&star;", .codepoints = .{ .Single = 9734 }, .characters = "\xe2\x98\x86" }, .{ .entity = "&starf;", .codepoints = .{ .Single = 9733 }, .characters = "\xe2\x98\x85" }, .{ .entity = "&straightepsilon;", .codepoints = .{ .Single = 1013 }, .characters = "\xcf\xb5" }, .{ .entity = "&straightphi;", .codepoints = .{ .Single = 981 }, .characters = "\xcf\x95" }, .{ .entity = "&strns;", .codepoints = .{ .Single = 175 }, .characters = "\xc2\xaf" }, .{ .entity = "&sub;", .codepoints = .{ .Single = 8834 }, .characters = "\xe2\x8a\x82" }, .{ .entity = "&subE;", .codepoints = .{ .Single = 10949 }, .characters = "\xe2\xab\x85" }, .{ .entity = "&subdot;", .codepoints = .{ .Single = 10941 }, .characters = "\xe2\xaa\xbd" }, .{ .entity = "&sube;", .codepoints = .{ .Single = 8838 }, .characters = "\xe2\x8a\x86" }, .{ .entity = "&subedot;", .codepoints = .{ .Single = 10947 }, .characters = "\xe2\xab\x83" }, .{ .entity = "&submult;", .codepoints = .{ .Single = 10945 }, .characters = "\xe2\xab\x81" }, .{ .entity = "&subnE;", .codepoints = .{ .Single = 10955 }, .characters = "\xe2\xab\x8b" }, .{ .entity = "&subne;", .codepoints = .{ .Single = 8842 }, .characters = "\xe2\x8a\x8a" }, .{ .entity = "&subplus;", .codepoints = .{ .Single = 10943 }, .characters = "\xe2\xaa\xbf" }, .{ .entity = "&subrarr;", .codepoints = .{ .Single = 10617 }, .characters = "\xe2\xa5\xb9" }, .{ .entity = "&subset;", .codepoints = .{ .Single = 8834 }, .characters = "\xe2\x8a\x82" }, .{ .entity = "&subseteq;", .codepoints = .{ .Single = 8838 }, .characters = "\xe2\x8a\x86" }, .{ .entity = "&subseteqq;", .codepoints = .{ .Single = 10949 }, .characters = "\xe2\xab\x85" }, .{ .entity = "&subsetneq;", .codepoints = .{ .Single = 8842 }, .characters = "\xe2\x8a\x8a" }, .{ .entity = "&subsetneqq;", .codepoints = .{ .Single = 10955 }, .characters = "\xe2\xab\x8b" }, .{ .entity = "&subsim;", .codepoints = .{ .Single = 10951 }, .characters = "\xe2\xab\x87" }, .{ .entity = "&subsub;", .codepoints = .{ .Single = 10965 }, .characters = "\xe2\xab\x95" }, .{ .entity = "&subsup;", .codepoints = .{ .Single = 10963 }, .characters = "\xe2\xab\x93" }, .{ .entity = "&succ;", .codepoints = .{ .Single = 8827 }, .characters = "\xe2\x89\xbb" }, .{ .entity = "&succapprox;", .codepoints = .{ .Single = 10936 }, .characters = "\xe2\xaa\xb8" }, .{ .entity = "&succcurlyeq;", .codepoints = .{ .Single = 8829 }, .characters = "\xe2\x89\xbd" }, .{ .entity = "&succeq;", .codepoints = .{ .Single = 10928 }, .characters = "\xe2\xaa\xb0" }, .{ .entity = "&succnapprox;", .codepoints = .{ .Single = 10938 }, .characters = "\xe2\xaa\xba" }, .{ .entity = "&succneqq;", .codepoints = .{ .Single = 10934 }, .characters = "\xe2\xaa\xb6" }, .{ .entity = "&succnsim;", .codepoints = .{ .Single = 8937 }, .characters = "\xe2\x8b\xa9" }, .{ .entity = "&succsim;", .codepoints = .{ .Single = 8831 }, .characters = "\xe2\x89\xbf" }, .{ .entity = "&sum;", .codepoints = .{ .Single = 8721 }, .characters = "\xe2\x88\x91" }, .{ .entity = "&sung;", .codepoints = .{ .Single = 9834 }, .characters = "\xe2\x99\xaa" }, .{ .entity = "&sup1", .codepoints = .{ .Single = 185 }, .characters = "\xc2\xb9" }, .{ .entity = "&sup1;", .codepoints = .{ .Single = 185 }, .characters = "\xc2\xb9" }, .{ .entity = "&sup2", .codepoints = .{ .Single = 178 }, .characters = "\xc2\xb2" }, .{ .entity = "&sup2;", .codepoints = .{ .Single = 178 }, .characters = "\xc2\xb2" }, .{ .entity = "&sup3", .codepoints = .{ .Single = 179 }, .characters = "\xc2\xb3" }, .{ .entity = "&sup3;", .codepoints = .{ .Single = 179 }, .characters = "\xc2\xb3" }, .{ .entity = "&sup;", .codepoints = .{ .Single = 8835 }, .characters = "\xe2\x8a\x83" }, .{ .entity = "&supE;", .codepoints = .{ .Single = 10950 }, .characters = "\xe2\xab\x86" }, .{ .entity = "&supdot;", .codepoints = .{ .Single = 10942 }, .characters = "\xe2\xaa\xbe" }, .{ .entity = "&supdsub;", .codepoints = .{ .Single = 10968 }, .characters = "\xe2\xab\x98" }, .{ .entity = "&supe;", .codepoints = .{ .Single = 8839 }, .characters = "\xe2\x8a\x87" }, .{ .entity = "&supedot;", .codepoints = .{ .Single = 10948 }, .characters = "\xe2\xab\x84" }, .{ .entity = "&suphsol;", .codepoints = .{ .Single = 10185 }, .characters = "\xe2\x9f\x89" }, .{ .entity = "&suphsub;", .codepoints = .{ .Single = 10967 }, .characters = "\xe2\xab\x97" }, .{ .entity = "&suplarr;", .codepoints = .{ .Single = 10619 }, .characters = "\xe2\xa5\xbb" }, .{ .entity = "&supmult;", .codepoints = .{ .Single = 10946 }, .characters = "\xe2\xab\x82" }, .{ .entity = "&supnE;", .codepoints = .{ .Single = 10956 }, .characters = "\xe2\xab\x8c" }, .{ .entity = "&supne;", .codepoints = .{ .Single = 8843 }, .characters = "\xe2\x8a\x8b" }, .{ .entity = "&supplus;", .codepoints = .{ .Single = 10944 }, .characters = "\xe2\xab\x80" }, .{ .entity = "&supset;", .codepoints = .{ .Single = 8835 }, .characters = "\xe2\x8a\x83" }, .{ .entity = "&supseteq;", .codepoints = .{ .Single = 8839 }, .characters = "\xe2\x8a\x87" }, .{ .entity = "&supseteqq;", .codepoints = .{ .Single = 10950 }, .characters = "\xe2\xab\x86" }, .{ .entity = "&supsetneq;", .codepoints = .{ .Single = 8843 }, .characters = "\xe2\x8a\x8b" }, .{ .entity = "&supsetneqq;", .codepoints = .{ .Single = 10956 }, .characters = "\xe2\xab\x8c" }, .{ .entity = "&supsim;", .codepoints = .{ .Single = 10952 }, .characters = "\xe2\xab\x88" }, .{ .entity = "&supsub;", .codepoints = .{ .Single = 10964 }, .characters = "\xe2\xab\x94" }, .{ .entity = "&supsup;", .codepoints = .{ .Single = 10966 }, .characters = "\xe2\xab\x96" }, .{ .entity = "&swArr;", .codepoints = .{ .Single = 8665 }, .characters = "\xe2\x87\x99" }, .{ .entity = "&swarhk;", .codepoints = .{ .Single = 10534 }, .characters = "\xe2\xa4\xa6" }, .{ .entity = "&swarr;", .codepoints = .{ .Single = 8601 }, .characters = "\xe2\x86\x99" }, .{ .entity = "&swarrow;", .codepoints = .{ .Single = 8601 }, .characters = "\xe2\x86\x99" }, .{ .entity = "&swnwar;", .codepoints = .{ .Single = 10538 }, .characters = "\xe2\xa4\xaa" }, .{ .entity = "&szlig", .codepoints = .{ .Single = 223 }, .characters = "\xc3\x9f" }, .{ .entity = "&szlig;", .codepoints = .{ .Single = 223 }, .characters = "\xc3\x9f" }, .{ .entity = "&target;", .codepoints = .{ .Single = 8982 }, .characters = "\xe2\x8c\x96" }, .{ .entity = "&tau;", .codepoints = .{ .Single = 964 }, .characters = "\xcf\x84" }, .{ .entity = "&tbrk;", .codepoints = .{ .Single = 9140 }, .characters = "\xe2\x8e\xb4" }, .{ .entity = "&tcaron;", .codepoints = .{ .Single = 357 }, .characters = "\xc5\xa5" }, .{ .entity = "&tcedil;", .codepoints = .{ .Single = 355 }, .characters = "\xc5\xa3" }, .{ .entity = "&tcy;", .codepoints = .{ .Single = 1090 }, .characters = "\xd1\x82" }, .{ .entity = "&tdot;", .codepoints = .{ .Single = 8411 }, .characters = "\xe2\x83\x9b" }, .{ .entity = "&telrec;", .codepoints = .{ .Single = 8981 }, .characters = "\xe2\x8c\x95" }, .{ .entity = "&tfr;", .codepoints = .{ .Single = 120113 }, .characters = "\xf0\x9d\x94\xb1" }, .{ .entity = "&there4;", .codepoints = .{ .Single = 8756 }, .characters = "\xe2\x88\xb4" }, .{ .entity = "&therefore;", .codepoints = .{ .Single = 8756 }, .characters = "\xe2\x88\xb4" }, .{ .entity = "&theta;", .codepoints = .{ .Single = 952 }, .characters = "\xce\xb8" }, .{ .entity = "&thetasym;", .codepoints = .{ .Single = 977 }, .characters = "\xcf\x91" }, .{ .entity = "&thetav;", .codepoints = .{ .Single = 977 }, .characters = "\xcf\x91" }, .{ .entity = "&thickapprox;", .codepoints = .{ .Single = 8776 }, .characters = "\xe2\x89\x88" }, .{ .entity = "&thicksim;", .codepoints = .{ .Single = 8764 }, .characters = "\xe2\x88\xbc" }, .{ .entity = "&thinsp;", .codepoints = .{ .Single = 8201 }, .characters = "\xe2\x80\x89" }, .{ .entity = "&thkap;", .codepoints = .{ .Single = 8776 }, .characters = "\xe2\x89\x88" }, .{ .entity = "&thksim;", .codepoints = .{ .Single = 8764 }, .characters = "\xe2\x88\xbc" }, .{ .entity = "&thorn", .codepoints = .{ .Single = 254 }, .characters = "\xc3\xbe" }, .{ .entity = "&thorn;", .codepoints = .{ .Single = 254 }, .characters = "\xc3\xbe" }, .{ .entity = "&tilde;", .codepoints = .{ .Single = 732 }, .characters = "\xcb\x9c" }, .{ .entity = "&times", .codepoints = .{ .Single = 215 }, .characters = "\xc3\x97" }, .{ .entity = "&times;", .codepoints = .{ .Single = 215 }, .characters = "\xc3\x97" }, .{ .entity = "&timesb;", .codepoints = .{ .Single = 8864 }, .characters = "\xe2\x8a\xa0" }, .{ .entity = "&timesbar;", .codepoints = .{ .Single = 10801 }, .characters = "\xe2\xa8\xb1" }, .{ .entity = "&timesd;", .codepoints = .{ .Single = 10800 }, .characters = "\xe2\xa8\xb0" }, .{ .entity = "&tint;", .codepoints = .{ .Single = 8749 }, .characters = "\xe2\x88\xad" }, .{ .entity = "&toea;", .codepoints = .{ .Single = 10536 }, .characters = "\xe2\xa4\xa8" }, .{ .entity = "&top;", .codepoints = .{ .Single = 8868 }, .characters = "\xe2\x8a\xa4" }, .{ .entity = "&topbot;", .codepoints = .{ .Single = 9014 }, .characters = "\xe2\x8c\xb6" }, .{ .entity = "&topcir;", .codepoints = .{ .Single = 10993 }, .characters = "\xe2\xab\xb1" }, .{ .entity = "&topf;", .codepoints = .{ .Single = 120165 }, .characters = "\xf0\x9d\x95\xa5" }, .{ .entity = "&topfork;", .codepoints = .{ .Single = 10970 }, .characters = "\xe2\xab\x9a" }, .{ .entity = "&tosa;", .codepoints = .{ .Single = 10537 }, .characters = "\xe2\xa4\xa9" }, .{ .entity = "&tprime;", .codepoints = .{ .Single = 8244 }, .characters = "\xe2\x80\xb4" }, .{ .entity = "&trade;", .codepoints = .{ .Single = 8482 }, .characters = "\xe2\x84\xa2" }, .{ .entity = "&triangle;", .codepoints = .{ .Single = 9653 }, .characters = "\xe2\x96\xb5" }, .{ .entity = "&triangledown;", .codepoints = .{ .Single = 9663 }, .characters = "\xe2\x96\xbf" }, .{ .entity = "&triangleleft;", .codepoints = .{ .Single = 9667 }, .characters = "\xe2\x97\x83" }, .{ .entity = "&trianglelefteq;", .codepoints = .{ .Single = 8884 }, .characters = "\xe2\x8a\xb4" }, .{ .entity = "&triangleq;", .codepoints = .{ .Single = 8796 }, .characters = "\xe2\x89\x9c" }, .{ .entity = "&triangleright;", .codepoints = .{ .Single = 9657 }, .characters = "\xe2\x96\xb9" }, .{ .entity = "&trianglerighteq;", .codepoints = .{ .Single = 8885 }, .characters = "\xe2\x8a\xb5" }, .{ .entity = "&tridot;", .codepoints = .{ .Single = 9708 }, .characters = "\xe2\x97\xac" }, .{ .entity = "&trie;", .codepoints = .{ .Single = 8796 }, .characters = "\xe2\x89\x9c" }, .{ .entity = "&triminus;", .codepoints = .{ .Single = 10810 }, .characters = "\xe2\xa8\xba" }, .{ .entity = "&triplus;", .codepoints = .{ .Single = 10809 }, .characters = "\xe2\xa8\xb9" }, .{ .entity = "&trisb;", .codepoints = .{ .Single = 10701 }, .characters = "\xe2\xa7\x8d" }, .{ .entity = "&tritime;", .codepoints = .{ .Single = 10811 }, .characters = "\xe2\xa8\xbb" }, .{ .entity = "&trpezium;", .codepoints = .{ .Single = 9186 }, .characters = "\xe2\x8f\xa2" }, .{ .entity = "&tscr;", .codepoints = .{ .Single = 120009 }, .characters = "\xf0\x9d\x93\x89" }, .{ .entity = "&tscy;", .codepoints = .{ .Single = 1094 }, .characters = "\xd1\x86" }, .{ .entity = "&tshcy;", .codepoints = .{ .Single = 1115 }, .characters = "\xd1\x9b" }, .{ .entity = "&tstrok;", .codepoints = .{ .Single = 359 }, .characters = "\xc5\xa7" }, .{ .entity = "&twixt;", .codepoints = .{ .Single = 8812 }, .characters = "\xe2\x89\xac" }, .{ .entity = "&twoheadleftarrow;", .codepoints = .{ .Single = 8606 }, .characters = "\xe2\x86\x9e" }, .{ .entity = "&twoheadrightarrow;", .codepoints = .{ .Single = 8608 }, .characters = "\xe2\x86\xa0" }, .{ .entity = "&uArr;", .codepoints = .{ .Single = 8657 }, .characters = "\xe2\x87\x91" }, .{ .entity = "&uHar;", .codepoints = .{ .Single = 10595 }, .characters = "\xe2\xa5\xa3" }, .{ .entity = "&uacute", .codepoints = .{ .Single = 250 }, .characters = "\xc3\xba" }, .{ .entity = "&uacute;", .codepoints = .{ .Single = 250 }, .characters = "\xc3\xba" }, .{ .entity = "&uarr;", .codepoints = .{ .Single = 8593 }, .characters = "\xe2\x86\x91" }, .{ .entity = "&ubrcy;", .codepoints = .{ .Single = 1118 }, .characters = "\xd1\x9e" }, .{ .entity = "&ubreve;", .codepoints = .{ .Single = 365 }, .characters = "\xc5\xad" }, .{ .entity = "&ucirc", .codepoints = .{ .Single = 251 }, .characters = "\xc3\xbb" }, .{ .entity = "&ucirc;", .codepoints = .{ .Single = 251 }, .characters = "\xc3\xbb" }, .{ .entity = "&ucy;", .codepoints = .{ .Single = 1091 }, .characters = "\xd1\x83" }, .{ .entity = "&udarr;", .codepoints = .{ .Single = 8645 }, .characters = "\xe2\x87\x85" }, .{ .entity = "&udblac;", .codepoints = .{ .Single = 369 }, .characters = "\xc5\xb1" }, .{ .entity = "&udhar;", .codepoints = .{ .Single = 10606 }, .characters = "\xe2\xa5\xae" }, .{ .entity = "&ufisht;", .codepoints = .{ .Single = 10622 }, .characters = "\xe2\xa5\xbe" }, .{ .entity = "&ufr;", .codepoints = .{ .Single = 120114 }, .characters = "\xf0\x9d\x94\xb2" }, .{ .entity = "&ugrave", .codepoints = .{ .Single = 249 }, .characters = "\xc3\xb9" }, .{ .entity = "&ugrave;", .codepoints = .{ .Single = 249 }, .characters = "\xc3\xb9" }, .{ .entity = "&uharl;", .codepoints = .{ .Single = 8639 }, .characters = "\xe2\x86\xbf" }, .{ .entity = "&uharr;", .codepoints = .{ .Single = 8638 }, .characters = "\xe2\x86\xbe" }, .{ .entity = "&uhblk;", .codepoints = .{ .Single = 9600 }, .characters = "\xe2\x96\x80" }, .{ .entity = "&ulcorn;", .codepoints = .{ .Single = 8988 }, .characters = "\xe2\x8c\x9c" }, .{ .entity = "&ulcorner;", .codepoints = .{ .Single = 8988 }, .characters = "\xe2\x8c\x9c" }, .{ .entity = "&ulcrop;", .codepoints = .{ .Single = 8975 }, .characters = "\xe2\x8c\x8f" }, .{ .entity = "&ultri;", .codepoints = .{ .Single = 9720 }, .characters = "\xe2\x97\xb8" }, .{ .entity = "&umacr;", .codepoints = .{ .Single = 363 }, .characters = "\xc5\xab" }, .{ .entity = "&uml", .codepoints = .{ .Single = 168 }, .characters = "\xc2\xa8" }, .{ .entity = "&uml;", .codepoints = .{ .Single = 168 }, .characters = "\xc2\xa8" }, .{ .entity = "&uogon;", .codepoints = .{ .Single = 371 }, .characters = "\xc5\xb3" }, .{ .entity = "&uopf;", .codepoints = .{ .Single = 120166 }, .characters = "\xf0\x9d\x95\xa6" }, .{ .entity = "&uparrow;", .codepoints = .{ .Single = 8593 }, .characters = "\xe2\x86\x91" }, .{ .entity = "&updownarrow;", .codepoints = .{ .Single = 8597 }, .characters = "\xe2\x86\x95" }, .{ .entity = "&upharpoonleft;", .codepoints = .{ .Single = 8639 }, .characters = "\xe2\x86\xbf" }, .{ .entity = "&upharpoonright;", .codepoints = .{ .Single = 8638 }, .characters = "\xe2\x86\xbe" }, .{ .entity = "&uplus;", .codepoints = .{ .Single = 8846 }, .characters = "\xe2\x8a\x8e" }, .{ .entity = "&upsi;", .codepoints = .{ .Single = 965 }, .characters = "\xcf\x85" }, .{ .entity = "&upsih;", .codepoints = .{ .Single = 978 }, .characters = "\xcf\x92" }, .{ .entity = "&upsilon;", .codepoints = .{ .Single = 965 }, .characters = "\xcf\x85" }, .{ .entity = "&upuparrows;", .codepoints = .{ .Single = 8648 }, .characters = "\xe2\x87\x88" }, .{ .entity = "&urcorn;", .codepoints = .{ .Single = 8989 }, .characters = "\xe2\x8c\x9d" }, .{ .entity = "&urcorner;", .codepoints = .{ .Single = 8989 }, .characters = "\xe2\x8c\x9d" }, .{ .entity = "&urcrop;", .codepoints = .{ .Single = 8974 }, .characters = "\xe2\x8c\x8e" }, .{ .entity = "&uring;", .codepoints = .{ .Single = 367 }, .characters = "\xc5\xaf" }, .{ .entity = "&urtri;", .codepoints = .{ .Single = 9721 }, .characters = "\xe2\x97\xb9" }, .{ .entity = "&uscr;", .codepoints = .{ .Single = 120010 }, .characters = "\xf0\x9d\x93\x8a" }, .{ .entity = "&utdot;", .codepoints = .{ .Single = 8944 }, .characters = "\xe2\x8b\xb0" }, .{ .entity = "&utilde;", .codepoints = .{ .Single = 361 }, .characters = "\xc5\xa9" }, .{ .entity = "&utri;", .codepoints = .{ .Single = 9653 }, .characters = "\xe2\x96\xb5" }, .{ .entity = "&utrif;", .codepoints = .{ .Single = 9652 }, .characters = "\xe2\x96\xb4" }, .{ .entity = "&uuarr;", .codepoints = .{ .Single = 8648 }, .characters = "\xe2\x87\x88" }, .{ .entity = "&uuml", .codepoints = .{ .Single = 252 }, .characters = "\xc3\xbc" }, .{ .entity = "&uuml;", .codepoints = .{ .Single = 252 }, .characters = "\xc3\xbc" }, .{ .entity = "&uwangle;", .codepoints = .{ .Single = 10663 }, .characters = "\xe2\xa6\xa7" }, .{ .entity = "&vArr;", .codepoints = .{ .Single = 8661 }, .characters = "\xe2\x87\x95" }, .{ .entity = "&vBar;", .codepoints = .{ .Single = 10984 }, .characters = "\xe2\xab\xa8" }, .{ .entity = "&vBarv;", .codepoints = .{ .Single = 10985 }, .characters = "\xe2\xab\xa9" }, .{ .entity = "&vDash;", .codepoints = .{ .Single = 8872 }, .characters = "\xe2\x8a\xa8" }, .{ .entity = "&vangrt;", .codepoints = .{ .Single = 10652 }, .characters = "\xe2\xa6\x9c" }, .{ .entity = "&varepsilon;", .codepoints = .{ .Single = 1013 }, .characters = "\xcf\xb5" }, .{ .entity = "&varkappa;", .codepoints = .{ .Single = 1008 }, .characters = "\xcf\xb0" }, .{ .entity = "&varnothing;", .codepoints = .{ .Single = 8709 }, .characters = "\xe2\x88\x85" }, .{ .entity = "&varphi;", .codepoints = .{ .Single = 981 }, .characters = "\xcf\x95" }, .{ .entity = "&varpi;", .codepoints = .{ .Single = 982 }, .characters = "\xcf\x96" }, .{ .entity = "&varpropto;", .codepoints = .{ .Single = 8733 }, .characters = "\xe2\x88\x9d" }, .{ .entity = "&varr;", .codepoints = .{ .Single = 8597 }, .characters = "\xe2\x86\x95" }, .{ .entity = "&varrho;", .codepoints = .{ .Single = 1009 }, .characters = "\xcf\xb1" }, .{ .entity = "&varsigma;", .codepoints = .{ .Single = 962 }, .characters = "\xcf\x82" }, .{ .entity = "&varsubsetneq;", .codepoints = .{ .Double = [2]u32{ 8842, 65024 } }, .characters = "\xe2\x8a\x8a\xef\xb8\x80" }, .{ .entity = "&varsubsetneqq;", .codepoints = .{ .Double = [2]u32{ 10955, 65024 } }, .characters = "\xe2\xab\x8b\xef\xb8\x80" }, .{ .entity = "&varsupsetneq;", .codepoints = .{ .Double = [2]u32{ 8843, 65024 } }, .characters = "\xe2\x8a\x8b\xef\xb8\x80" }, .{ .entity = "&varsupsetneqq;", .codepoints = .{ .Double = [2]u32{ 10956, 65024 } }, .characters = "\xe2\xab\x8c\xef\xb8\x80" }, .{ .entity = "&vartheta;", .codepoints = .{ .Single = 977 }, .characters = "\xcf\x91" }, .{ .entity = "&vartriangleleft;", .codepoints = .{ .Single = 8882 }, .characters = "\xe2\x8a\xb2" }, .{ .entity = "&vartriangleright;", .codepoints = .{ .Single = 8883 }, .characters = "\xe2\x8a\xb3" }, .{ .entity = "&vcy;", .codepoints = .{ .Single = 1074 }, .characters = "\xd0\xb2" }, .{ .entity = "&vdash;", .codepoints = .{ .Single = 8866 }, .characters = "\xe2\x8a\xa2" }, .{ .entity = "&vee;", .codepoints = .{ .Single = 8744 }, .characters = "\xe2\x88\xa8" }, .{ .entity = "&veebar;", .codepoints = .{ .Single = 8891 }, .characters = "\xe2\x8a\xbb" }, .{ .entity = "&veeeq;", .codepoints = .{ .Single = 8794 }, .characters = "\xe2\x89\x9a" }, .{ .entity = "&vellip;", .codepoints = .{ .Single = 8942 }, .characters = "\xe2\x8b\xae" }, .{ .entity = "&verbar;", .codepoints = .{ .Single = 124 }, .characters = "|" }, .{ .entity = "&vert;", .codepoints = .{ .Single = 124 }, .characters = "|" }, .{ .entity = "&vfr;", .codepoints = .{ .Single = 120115 }, .characters = "\xf0\x9d\x94\xb3" }, .{ .entity = "&vltri;", .codepoints = .{ .Single = 8882 }, .characters = "\xe2\x8a\xb2" }, .{ .entity = "&vnsub;", .codepoints = .{ .Double = [2]u32{ 8834, 8402 } }, .characters = "\xe2\x8a\x82\xe2\x83\x92" }, .{ .entity = "&vnsup;", .codepoints = .{ .Double = [2]u32{ 8835, 8402 } }, .characters = "\xe2\x8a\x83\xe2\x83\x92" }, .{ .entity = "&vopf;", .codepoints = .{ .Single = 120167 }, .characters = "\xf0\x9d\x95\xa7" }, .{ .entity = "&vprop;", .codepoints = .{ .Single = 8733 }, .characters = "\xe2\x88\x9d" }, .{ .entity = "&vrtri;", .codepoints = .{ .Single = 8883 }, .characters = "\xe2\x8a\xb3" }, .{ .entity = "&vscr;", .codepoints = .{ .Single = 120011 }, .characters = "\xf0\x9d\x93\x8b" }, .{ .entity = "&vsubnE;", .codepoints = .{ .Double = [2]u32{ 10955, 65024 } }, .characters = "\xe2\xab\x8b\xef\xb8\x80" }, .{ .entity = "&vsubne;", .codepoints = .{ .Double = [2]u32{ 8842, 65024 } }, .characters = "\xe2\x8a\x8a\xef\xb8\x80" }, .{ .entity = "&vsupnE;", .codepoints = .{ .Double = [2]u32{ 10956, 65024 } }, .characters = "\xe2\xab\x8c\xef\xb8\x80" }, .{ .entity = "&vsupne;", .codepoints = .{ .Double = [2]u32{ 8843, 65024 } }, .characters = "\xe2\x8a\x8b\xef\xb8\x80" }, .{ .entity = "&vzigzag;", .codepoints = .{ .Single = 10650 }, .characters = "\xe2\xa6\x9a" }, .{ .entity = "&wcirc;", .codepoints = .{ .Single = 373 }, .characters = "\xc5\xb5" }, .{ .entity = "&wedbar;", .codepoints = .{ .Single = 10847 }, .characters = "\xe2\xa9\x9f" }, .{ .entity = "&wedge;", .codepoints = .{ .Single = 8743 }, .characters = "\xe2\x88\xa7" }, .{ .entity = "&wedgeq;", .codepoints = .{ .Single = 8793 }, .characters = "\xe2\x89\x99" }, .{ .entity = "&weierp;", .codepoints = .{ .Single = 8472 }, .characters = "\xe2\x84\x98" }, .{ .entity = "&wfr;", .codepoints = .{ .Single = 120116 }, .characters = "\xf0\x9d\x94\xb4" }, .{ .entity = "&wopf;", .codepoints = .{ .Single = 120168 }, .characters = "\xf0\x9d\x95\xa8" }, .{ .entity = "&wp;", .codepoints = .{ .Single = 8472 }, .characters = "\xe2\x84\x98" }, .{ .entity = "&wr;", .codepoints = .{ .Single = 8768 }, .characters = "\xe2\x89\x80" }, .{ .entity = "&wreath;", .codepoints = .{ .Single = 8768 }, .characters = "\xe2\x89\x80" }, .{ .entity = "&wscr;", .codepoints = .{ .Single = 120012 }, .characters = "\xf0\x9d\x93\x8c" }, .{ .entity = "&xcap;", .codepoints = .{ .Single = 8898 }, .characters = "\xe2\x8b\x82" }, .{ .entity = "&xcirc;", .codepoints = .{ .Single = 9711 }, .characters = "\xe2\x97\xaf" }, .{ .entity = "&xcup;", .codepoints = .{ .Single = 8899 }, .characters = "\xe2\x8b\x83" }, .{ .entity = "&xdtri;", .codepoints = .{ .Single = 9661 }, .characters = "\xe2\x96\xbd" }, .{ .entity = "&xfr;", .codepoints = .{ .Single = 120117 }, .characters = "\xf0\x9d\x94\xb5" }, .{ .entity = "&xhArr;", .codepoints = .{ .Single = 10234 }, .characters = "\xe2\x9f\xba" }, .{ .entity = "&xharr;", .codepoints = .{ .Single = 10231 }, .characters = "\xe2\x9f\xb7" }, .{ .entity = "&xi;", .codepoints = .{ .Single = 958 }, .characters = "\xce\xbe" }, .{ .entity = "&xlArr;", .codepoints = .{ .Single = 10232 }, .characters = "\xe2\x9f\xb8" }, .{ .entity = "&xlarr;", .codepoints = .{ .Single = 10229 }, .characters = "\xe2\x9f\xb5" }, .{ .entity = "&xmap;", .codepoints = .{ .Single = 10236 }, .characters = "\xe2\x9f\xbc" }, .{ .entity = "&xnis;", .codepoints = .{ .Single = 8955 }, .characters = "\xe2\x8b\xbb" }, .{ .entity = "&xodot;", .codepoints = .{ .Single = 10752 }, .characters = "\xe2\xa8\x80" }, .{ .entity = "&xopf;", .codepoints = .{ .Single = 120169 }, .characters = "\xf0\x9d\x95\xa9" }, .{ .entity = "&xoplus;", .codepoints = .{ .Single = 10753 }, .characters = "\xe2\xa8\x81" }, .{ .entity = "&xotime;", .codepoints = .{ .Single = 10754 }, .characters = "\xe2\xa8\x82" }, .{ .entity = "&xrArr;", .codepoints = .{ .Single = 10233 }, .characters = "\xe2\x9f\xb9" }, .{ .entity = "&xrarr;", .codepoints = .{ .Single = 10230 }, .characters = "\xe2\x9f\xb6" }, .{ .entity = "&xscr;", .codepoints = .{ .Single = 120013 }, .characters = "\xf0\x9d\x93\x8d" }, .{ .entity = "&xsqcup;", .codepoints = .{ .Single = 10758 }, .characters = "\xe2\xa8\x86" }, .{ .entity = "&xuplus;", .codepoints = .{ .Single = 10756 }, .characters = "\xe2\xa8\x84" }, .{ .entity = "&xutri;", .codepoints = .{ .Single = 9651 }, .characters = "\xe2\x96\xb3" }, .{ .entity = "&xvee;", .codepoints = .{ .Single = 8897 }, .characters = "\xe2\x8b\x81" }, .{ .entity = "&xwedge;", .codepoints = .{ .Single = 8896 }, .characters = "\xe2\x8b\x80" }, .{ .entity = "&yacute", .codepoints = .{ .Single = 253 }, .characters = "\xc3\xbd" }, .{ .entity = "&yacute;", .codepoints = .{ .Single = 253 }, .characters = "\xc3\xbd" }, .{ .entity = "&yacy;", .codepoints = .{ .Single = 1103 }, .characters = "\xd1\x8f" }, .{ .entity = "&ycirc;", .codepoints = .{ .Single = 375 }, .characters = "\xc5\xb7" }, .{ .entity = "&ycy;", .codepoints = .{ .Single = 1099 }, .characters = "\xd1\x8b" }, .{ .entity = "&yen", .codepoints = .{ .Single = 165 }, .characters = "\xc2\xa5" }, .{ .entity = "&yen;", .codepoints = .{ .Single = 165 }, .characters = "\xc2\xa5" }, .{ .entity = "&yfr;", .codepoints = .{ .Single = 120118 }, .characters = "\xf0\x9d\x94\xb6" }, .{ .entity = "&yicy;", .codepoints = .{ .Single = 1111 }, .characters = "\xd1\x97" }, .{ .entity = "&yopf;", .codepoints = .{ .Single = 120170 }, .characters = "\xf0\x9d\x95\xaa" }, .{ .entity = "&yscr;", .codepoints = .{ .Single = 120014 }, .characters = "\xf0\x9d\x93\x8e" }, .{ .entity = "&yucy;", .codepoints = .{ .Single = 1102 }, .characters = "\xd1\x8e" }, .{ .entity = "&yuml", .codepoints = .{ .Single = 255 }, .characters = "\xc3\xbf" }, .{ .entity = "&yuml;", .codepoints = .{ .Single = 255 }, .characters = "\xc3\xbf" }, .{ .entity = "&zacute;", .codepoints = .{ .Single = 378 }, .characters = "\xc5\xba" }, .{ .entity = "&zcaron;", .codepoints = .{ .Single = 382 }, .characters = "\xc5\xbe" }, .{ .entity = "&zcy;", .codepoints = .{ .Single = 1079 }, .characters = "\xd0\xb7" }, .{ .entity = "&zdot;", .codepoints = .{ .Single = 380 }, .characters = "\xc5\xbc" }, .{ .entity = "&zeetrf;", .codepoints = .{ .Single = 8488 }, .characters = "\xe2\x84\xa8" }, .{ .entity = "&zeta;", .codepoints = .{ .Single = 950 }, .characters = "\xce\xb6" }, .{ .entity = "&zfr;", .codepoints = .{ .Single = 120119 }, .characters = "\xf0\x9d\x94\xb7" }, .{ .entity = "&zhcy;", .codepoints = .{ .Single = 1078 }, .characters = "\xd0\xb6" }, .{ .entity = "&zigrarr;", .codepoints = .{ .Single = 8669 }, .characters = "\xe2\x87\x9d" }, .{ .entity = "&zopf;", .codepoints = .{ .Single = 120171 }, .characters = "\xf0\x9d\x95\xab" }, .{ .entity = "&zscr;", .codepoints = .{ .Single = 120015 }, .characters = "\xf0\x9d\x93\x8f" }, .{ .entity = "&zwj;", .codepoints = .{ .Single = 8205 }, .characters = "\xe2\x80\x8d" }, .{ .entity = "&zwnj;", .codepoints = .{ .Single = 8204 }, .characters = "\xe2\x80\x8c" }, };
src/entities.zig
const std = @import("std"); fn getRelativePath() []const u8 { comptime var src: std.builtin.SourceLocation = @src(); return std.fs.path.dirname(src.file).? ++ std.fs.path.sep_str; } fn getSrcPath() []const u8 { comptime var src: std.builtin.SourceLocation = @src(); return std.fs.path.dirname(src.file).? ++ std.fs.path.sep_str ++ "src" ++ std.fs.path.sep_str; } pub fn link(b: *std.build.Builder, exe: *std.build.LibExeObjStep, target: std.build.Target) void { // Link step exe.linkLibrary(getLib(b, target)); exe.addPackage(getPackage()); } pub fn getLib(b: *std.build.Builder, target: std.build.Target) *std.build.LibExeObjStep { _=target; comptime var path = getRelativePath(); var wren = b.addStaticLibrary("wren", null); wren.linkLibC(); var flagContainer = std.ArrayList([]const u8).init(std.heap.page_allocator); if (b.is_release) flagContainer.append("-Os") catch unreachable; wren.addIncludeDir(path ++ "deps/wren/src/include"); // Uncomment this line and comment the block below to use // the amalgamated source instead of separate source files // wren.addCSourceFile(path ++ "deps/wren/build/wren.c", flagContainer.items); { wren.addIncludeDir(path ++ "deps/wren/src/include"); wren.addIncludeDir(path ++ "deps/wren/src/vm"); wren.addIncludeDir(path ++ "deps/wren/src/optional"); wren.addIncludeDir(path ++ "c"); wren.addCSourceFile(path ++ "deps/wren/src/vm/wren_compiler.c",flagContainer.items); wren.addCSourceFile(path ++ "deps/wren/src/vm/wren_core.c",flagContainer.items); wren.addCSourceFile(path ++ "deps/wren/src/vm/wren_debug.c",flagContainer.items); wren.addCSourceFile(path ++ "deps/wren/src/vm/wren_primitive.c",flagContainer.items); wren.addCSourceFile(path ++ "deps/wren/src/vm/wren_utils.c",flagContainer.items); wren.addCSourceFile(path ++ "deps/wren/src/vm/wren_value.c",flagContainer.items); wren.addCSourceFile(path ++ "deps/wren/src/vm/wren_vm.c",flagContainer.items); wren.addCSourceFile(path ++ "deps/wren/src/optional/wren_opt_meta.c",flagContainer.items); wren.addCSourceFile(path ++ "deps/wren/src/optional/wren_opt_random.c",flagContainer.items); wren.addCSourceFile(path ++ "c/wren_vm_ext.c",flagContainer.items); } return wren; } pub fn getPackage() std.build.Pkg { comptime var path = getSrcPath(); return .{ .name = "wren", .path = std.build.FileSource{ .path = path ++ "wren.zig" } }; }
lib.zig
const std = @import("std"); const net = std.net; const mem = std.mem; const fs = std.fs; const os = std.os; const builtin = std.builtin; const proto = @import("protocol.zig"); const callbacks = @import("init.zig"); const WireBuffer = @import("wire.zig").WireBuffer; const Connector = @import("connector.zig").Connector; const Channel = @import("channel.zig").Channel; const Table = @import("table.zig").Table; pub const Connection = struct { connector: Connector, in_use_channels: u2048, // Hear me out... max_channels: u16, const Self = @This(); pub fn init(rx_memory: []u8, tx_memory: []u8) Connection { return Connection{ .connector = Connector{ .rx_buffer = WireBuffer.init(rx_memory[0..]), .tx_buffer = WireBuffer.init(tx_memory[0..]), .channel = 0, }, .in_use_channels = 1, .max_channels = 32, }; } pub fn connect(self: *Self, address: net.Address) !void { const file = try net.tcpConnectToAddress(address); const n = try file.write("AMQP\x00\x00\x09\x01"); self.connector.file = file; self.connector.connection = self; var start = try proto.Connection.awaitStart(&self.connector); const remote_host = start.server_properties.lookup([]u8, "cluster_name"); std.log.debug("Connected to {} AMQP server (version {}.{})\nmechanisms: {}\nlocale: {}\n", .{ remote_host, start.version_major, start.version_minor, start.mechanisms, start.locales, }); var props_buffer: [1024]u8 = undefined; var client_properties: Table = Table.init(props_buffer[0..]); client_properties.insertLongString("product", "Zig AMQP Library"); client_properties.insertLongString("platform", "Zig 0.7.0"); // TODO: it's annoying having 3 lines for a single initialisation // UPDATE: thoughts. We can at least get rid of the caps_wb if Table.init // does its own WireBuffer init from the backing buffer. // Also, perhaps we can offer a raw slice backed Table.init and, // say, a Table.initAllocator() that takes an allocator instead. // This gives users the freedom to decide how they want to deal // with memory. var caps_buf: [1024]u8 = undefined; var capabilities: Table = Table.init(caps_buf[0..]); capabilities.insertBool("authentication_failure_close", true); capabilities.insertBool("basic.nack", true); capabilities.insertBool("connection.blocked", true); capabilities.insertBool("consumer_cancel_notify", true); capabilities.insertBool("publisher_confirms", true); client_properties.insertTable("capabilities", &capabilities); client_properties.insertLongString("information", "See https://github.com/malcolmstill/zig-amqp"); client_properties.insertLongString("version", "0.0.1"); // TODO: We want to be able to call start_ok_resp as a function // rather than having to deal with buffers. // UPDATE: the above TODO is what we now have, but we require extra // buffers, and how do we size them. It would be nice to // avoid allocations. try proto.Connection.startOkAsync(&self.connector, &client_properties, "PLAIN", "\x00guest\x00guest", "en_US"); var tune = try proto.Connection.awaitTune(&self.connector); self.max_channels = tune.channel_max; try proto.Connection.tuneOkAsync(&self.connector, @bitSizeOf(u2048) - 1, tune.frame_max, tune.heartbeat); var open_repsonse = try proto.Connection.openSync(&self.connector, "/"); } pub fn deinit(self: *Self) void { self.file.close(); } pub fn channel(self: *Self) !Channel { const next_available_channel = try self.nextChannel(); var ch = Channel.init(next_available_channel, self); _ = try proto.Channel.openSync(&ch.connector); return ch; } fn nextChannel(self: *Self) !u16 { var i: u16 = 1; while (i < self.max_channels and i < @bitSizeOf(u2048)) : (i += 1) { const bit: u2048 = 1; const shift: u11 = @intCast(u11, i); if (self.in_use_channels & (bit << shift) == 0) { self.in_use_channels |= (bit << shift); return i; } } return error.NoFreeChannel; } pub fn freeChannel(self: *Self, channel_id: u16) void { if (channel_id >= @bitSizeOf(u2048)) return; // Look it's late okay... const bit: u2048 = 1; self.in_use_channels &= ~(bit << @intCast(u11, channel_id)); if (std.builtin.mode == .Debug) std.debug.warn("Freed channel {}, in_use_channels: {}\n", .{ channel_id, @popCount(u2048, self.in_use_channels) }); } }; const testing = std.testing; test "read / write / shift volatility" { var server_rx_memory: [128]u8 = [_]u8{0} ** 128; var server_tx_memory: [128]u8 = [_]u8{0} ** 128; var client_rx_memory: [128]u8 = [_]u8{0} ** 128; var client_tx_memory: [128]u8 = [_]u8{0} ** 128; var server_rx_buf = WireBuffer.init(server_rx_memory[0..]); var server_tx_buf = WireBuffer.init(server_tx_memory[0..]); var client_rx_buf = WireBuffer.init(client_rx_memory[0..]); var client_tx_buf = WireBuffer.init(client_tx_memory[0..]); const f = try os.pipe(); defer os.close(f[0]); defer os.close(f[1]); var server_connector = Connector{ .file = fs.File{ .handle = f[0], }, .rx_buffer = server_rx_buf, .tx_buffer = server_tx_buf, .channel = 0, }; var client_connector = Connector{ .file = fs.File{ .handle = f[1], }, .rx_buffer = server_rx_buf, .tx_buffer = server_tx_buf, .channel = 0, }; try proto.Connection.blockedAsync(&client_connector, "hello"); try proto.Connection.blockedAsync(&client_connector, "world"); // volatile values should be valid until at least the next call that // modifies the underlying buffers var block = try server_connector.awaitMethod(proto.Connection.Blocked); testing.expect(mem.eql(u8, block.reason, "hello")); var block2 = try proto.Connection.awaitBlocked(&server_connector); // alternative form of await testing.expect(mem.eql(u8, block2.reason, "world")); // Due to volatility, block.reason may not remain "hello" // 1. Having called awaitBlocked a second time, we're actually still good // as before messages are still in their original location in the buffer: testing.expect(mem.eql(u8, block.reason, "hello")); // 2. If another message is written and we copy it to the front of the buffer (shift) // and then await again, we find that block.reason is now "overw" instead of "hello" try proto.Connection.blockedAsync(&client_connector, "overwritten"); server_connector.rx_buffer.shift(); var block3 = try server_connector.awaitMethod(proto.Connection.Blocked); testing.expect(mem.eql(u8, block.reason, "overw")); }
src/connection.zig
const Elf = @This(); const std = @import("std"); const mem = std.mem; const assert = std.debug.assert; const Allocator = std.mem.Allocator; const fs = std.fs; const elf = std.elf; const log = std.log.scoped(.link); const DW = std.dwarf; const leb128 = std.leb; const ir = @import("../ir.zig"); const Module = @import("../Module.zig"); const Compilation = @import("../Compilation.zig"); const codegen = @import("../codegen.zig"); const trace = @import("../tracy.zig").trace; const Package = @import("../Package.zig"); const Value = @import("../value.zig").Value; const Type = @import("../type.zig").Type; const link = @import("../link.zig"); const File = link.File; const build_options = @import("build_options"); const target_util = @import("../target.zig"); const glibc = @import("../glibc.zig"); const Cache = @import("../Cache.zig"); const default_entry_addr = 0x8000000; pub const base_tag: File.Tag = .elf; base: File, ptr_width: PtrWidth, /// Stored in native-endian format, depending on target endianness needs to be bswapped on read/write. /// Same order as in the file. sections: std.ArrayListUnmanaged(elf.Elf64_Shdr) = std.ArrayListUnmanaged(elf.Elf64_Shdr){}, shdr_table_offset: ?u64 = null, /// Stored in native-endian format, depending on target endianness needs to be bswapped on read/write. /// Same order as in the file. program_headers: std.ArrayListUnmanaged(elf.Elf64_Phdr) = std.ArrayListUnmanaged(elf.Elf64_Phdr){}, phdr_table_offset: ?u64 = null, /// The index into the program headers of a PT_LOAD program header with Read and Execute flags phdr_load_re_index: ?u16 = null, /// The index into the program headers of the global offset table. /// It needs PT_LOAD and Read flags. phdr_got_index: ?u16 = null, entry_addr: ?u64 = null, debug_strtab: std.ArrayListUnmanaged(u8) = std.ArrayListUnmanaged(u8){}, shstrtab: std.ArrayListUnmanaged(u8) = std.ArrayListUnmanaged(u8){}, shstrtab_index: ?u16 = null, text_section_index: ?u16 = null, symtab_section_index: ?u16 = null, got_section_index: ?u16 = null, debug_info_section_index: ?u16 = null, debug_abbrev_section_index: ?u16 = null, debug_str_section_index: ?u16 = null, debug_aranges_section_index: ?u16 = null, debug_line_section_index: ?u16 = null, debug_abbrev_table_offset: ?u64 = null, /// The same order as in the file. ELF requires global symbols to all be after the /// local symbols, they cannot be mixed. So we must buffer all the global symbols and /// write them at the end. These are only the local symbols. The length of this array /// is the value used for sh_info in the .symtab section. local_symbols: std.ArrayListUnmanaged(elf.Elf64_Sym) = .{}, global_symbols: std.ArrayListUnmanaged(elf.Elf64_Sym) = .{}, local_symbol_free_list: std.ArrayListUnmanaged(u32) = .{}, global_symbol_free_list: std.ArrayListUnmanaged(u32) = .{}, offset_table_free_list: std.ArrayListUnmanaged(u32) = .{}, /// Same order as in the file. The value is the absolute vaddr value. /// If the vaddr of the executable program header changes, the entire /// offset table needs to be rewritten. offset_table: std.ArrayListUnmanaged(u64) = .{}, phdr_table_dirty: bool = false, shdr_table_dirty: bool = false, shstrtab_dirty: bool = false, debug_strtab_dirty: bool = false, offset_table_count_dirty: bool = false, debug_abbrev_section_dirty: bool = false, debug_aranges_section_dirty: bool = false, debug_info_header_dirty: bool = false, debug_line_header_dirty: bool = false, error_flags: File.ErrorFlags = File.ErrorFlags{}, /// A list of text blocks that have surplus capacity. This list can have false /// positives, as functions grow and shrink over time, only sometimes being added /// or removed from the freelist. /// /// A text block has surplus capacity when its overcapacity value is greater than /// minimum_text_block_size * alloc_num / alloc_den. That is, when it has so /// much extra capacity, that we could fit a small new symbol in it, itself with /// ideal_capacity or more. /// /// Ideal capacity is defined by size * alloc_num / alloc_den. /// /// Overcapacity is measured by actual_capacity - ideal_capacity. Note that /// overcapacity can be negative. A simple way to have negative overcapacity is to /// allocate a fresh text block, which will have ideal capacity, and then grow it /// by 1 byte. It will then have -1 overcapacity. text_block_free_list: std.ArrayListUnmanaged(*TextBlock) = .{}, last_text_block: ?*TextBlock = null, /// A list of `SrcFn` whose Line Number Programs have surplus capacity. /// This is the same concept as `text_block_free_list`; see those doc comments. dbg_line_fn_free_list: std.AutoHashMapUnmanaged(*SrcFn, void) = .{}, dbg_line_fn_first: ?*SrcFn = null, dbg_line_fn_last: ?*SrcFn = null, /// A list of `TextBlock` whose corresponding .debug_info tags have surplus capacity. /// This is the same concept as `text_block_free_list`; see those doc comments. dbg_info_decl_free_list: std.AutoHashMapUnmanaged(*TextBlock, void) = .{}, dbg_info_decl_first: ?*TextBlock = null, dbg_info_decl_last: ?*TextBlock = null, /// `alloc_num / alloc_den` is the factor of padding when allocating. const alloc_num = 4; const alloc_den = 3; /// In order for a slice of bytes to be considered eligible to keep metadata pointing at /// it as a possible place to put new symbols, it must have enough room for this many bytes /// (plus extra for reserved capacity). const minimum_text_block_size = 64; const min_text_capacity = minimum_text_block_size * alloc_num / alloc_den; pub const PtrWidth = enum { p32, p64 }; pub const TextBlock = struct { /// Each decl always gets a local symbol with the fully qualified name. /// The vaddr and size are found here directly. /// The file offset is found by computing the vaddr offset from the section vaddr /// the symbol references, and adding that to the file offset of the section. /// If this field is 0, it means the codegen size = 0 and there is no symbol or /// offset table entry. local_sym_index: u32, /// This field is undefined for symbols with size = 0. offset_table_index: u32, /// Points to the previous and next neighbors, based on the `text_offset`. /// This can be used to find, for example, the capacity of this `TextBlock`. prev: ?*TextBlock, next: ?*TextBlock, /// Previous/next linked list pointers. This value is `next ^ prev`. /// This is the linked list node for this Decl's corresponding .debug_info tag. dbg_info_prev: ?*TextBlock, dbg_info_next: ?*TextBlock, /// Offset into .debug_info pointing to the tag for this Decl. dbg_info_off: u32, /// Size of the .debug_info tag for this Decl, not including padding. dbg_info_len: u32, pub const empty = TextBlock{ .local_sym_index = 0, .offset_table_index = undefined, .prev = null, .next = null, .dbg_info_prev = null, .dbg_info_next = null, .dbg_info_off = undefined, .dbg_info_len = undefined, }; /// Returns how much room there is to grow in virtual address space. /// File offset relocation happens transparently, so it is not included in /// this calculation. fn capacity(self: TextBlock, elf_file: Elf) u64 { const self_sym = elf_file.local_symbols.items[self.local_sym_index]; if (self.next) |next| { const next_sym = elf_file.local_symbols.items[next.local_sym_index]; return next_sym.st_value - self_sym.st_value; } else { // We are the last block. The capacity is limited only by virtual address space. return std.math.maxInt(u32) - self_sym.st_value; } } fn freeListEligible(self: TextBlock, elf_file: Elf) bool { // No need to keep a free list node for the last block. const next = self.next orelse return false; const self_sym = elf_file.local_symbols.items[self.local_sym_index]; const next_sym = elf_file.local_symbols.items[next.local_sym_index]; const cap = next_sym.st_value - self_sym.st_value; const ideal_cap = self_sym.st_size * alloc_num / alloc_den; if (cap <= ideal_cap) return false; const surplus = cap - ideal_cap; return surplus >= min_text_capacity; } }; pub const Export = struct { sym_index: ?u32 = null, }; pub const SrcFn = struct { /// Offset from the beginning of the Debug Line Program header that contains this function. off: u32, /// Size of the line number program component belonging to this function, not /// including padding. len: u32, /// Points to the previous and next neighbors, based on the offset from .debug_line. /// This can be used to find, for example, the capacity of this `SrcFn`. prev: ?*SrcFn, next: ?*SrcFn, pub const empty: SrcFn = .{ .off = 0, .len = 0, .prev = null, .next = null, }; }; pub fn openPath(allocator: *Allocator, sub_path: []const u8, options: link.Options) !*Elf { assert(options.object_format == .elf); if (options.use_llvm) return error.LLVMBackendUnimplementedForELF; // TODO const file = try options.emit.?.directory.handle.createFile(sub_path, .{ .truncate = false, .read = true, .mode = link.determineMode(options), }); errdefer file.close(); const self = try createEmpty(allocator, options); errdefer self.base.destroy(); self.base.file = file; self.shdr_table_dirty = true; // Index 0 is always a null symbol. try self.local_symbols.append(allocator, .{ .st_name = 0, .st_info = 0, .st_other = 0, .st_shndx = 0, .st_value = 0, .st_size = 0, }); // There must always be a null section in index 0 try self.sections.append(allocator, .{ .sh_name = 0, .sh_type = elf.SHT_NULL, .sh_flags = 0, .sh_addr = 0, .sh_offset = 0, .sh_size = 0, .sh_link = 0, .sh_info = 0, .sh_addralign = 0, .sh_entsize = 0, }); try self.populateMissingMetadata(); return self; } pub fn createEmpty(gpa: *Allocator, options: link.Options) !*Elf { const ptr_width: PtrWidth = switch (options.target.cpu.arch.ptrBitWidth()) { 0...32 => .p32, 33...64 => .p64, else => return error.UnsupportedELFArchitecture, }; const self = try gpa.create(Elf); self.* = .{ .base = .{ .tag = .elf, .options = options, .allocator = gpa, .file = null, }, .ptr_width = ptr_width, }; return self; } pub fn deinit(self: *Elf) void { self.sections.deinit(self.base.allocator); self.program_headers.deinit(self.base.allocator); self.shstrtab.deinit(self.base.allocator); self.debug_strtab.deinit(self.base.allocator); self.local_symbols.deinit(self.base.allocator); self.global_symbols.deinit(self.base.allocator); self.global_symbol_free_list.deinit(self.base.allocator); self.local_symbol_free_list.deinit(self.base.allocator); self.offset_table_free_list.deinit(self.base.allocator); self.text_block_free_list.deinit(self.base.allocator); self.dbg_line_fn_free_list.deinit(self.base.allocator); self.dbg_info_decl_free_list.deinit(self.base.allocator); self.offset_table.deinit(self.base.allocator); } pub fn getDeclVAddr(self: *Elf, decl: *const Module.Decl) u64 { assert(decl.link.elf.local_sym_index != 0); return self.local_symbols.items[decl.link.elf.local_sym_index].st_value; } fn getDebugLineProgramOff(self: Elf) u32 { return self.dbg_line_fn_first.?.off; } fn getDebugLineProgramEnd(self: Elf) u32 { return self.dbg_line_fn_last.?.off + self.dbg_line_fn_last.?.len; } /// Returns end pos of collision, if any. fn detectAllocCollision(self: *Elf, start: u64, size: u64) ?u64 { const small_ptr = self.ptr_width == .p32; const ehdr_size: u64 = if (small_ptr) @sizeOf(elf.Elf32_Ehdr) else @sizeOf(elf.Elf64_Ehdr); if (start < ehdr_size) return ehdr_size; const end = start + satMul(size, alloc_num) / alloc_den; if (self.shdr_table_offset) |off| { const shdr_size: u64 = if (small_ptr) @sizeOf(elf.Elf32_Shdr) else @sizeOf(elf.Elf64_Shdr); const tight_size = self.sections.items.len * shdr_size; const increased_size = satMul(tight_size, alloc_num) / alloc_den; const test_end = off + increased_size; if (end > off and start < test_end) { return test_end; } } if (self.phdr_table_offset) |off| { const phdr_size: u64 = if (small_ptr) @sizeOf(elf.Elf32_Phdr) else @sizeOf(elf.Elf64_Phdr); const tight_size = self.sections.items.len * phdr_size; const increased_size = satMul(tight_size, alloc_num) / alloc_den; const test_end = off + increased_size; if (end > off and start < test_end) { return test_end; } } for (self.sections.items) |section| { const increased_size = satMul(section.sh_size, alloc_num) / alloc_den; const test_end = section.sh_offset + increased_size; if (end > section.sh_offset and start < test_end) { return test_end; } } for (self.program_headers.items) |program_header| { const increased_size = satMul(program_header.p_filesz, alloc_num) / alloc_den; const test_end = program_header.p_offset + increased_size; if (end > program_header.p_offset and start < test_end) { return test_end; } } return null; } fn allocatedSize(self: *Elf, start: u64) u64 { if (start == 0) return 0; var min_pos: u64 = std.math.maxInt(u64); if (self.shdr_table_offset) |off| { if (off > start and off < min_pos) min_pos = off; } if (self.phdr_table_offset) |off| { if (off > start and off < min_pos) min_pos = off; } for (self.sections.items) |section| { if (section.sh_offset <= start) continue; if (section.sh_offset < min_pos) min_pos = section.sh_offset; } for (self.program_headers.items) |program_header| { if (program_header.p_offset <= start) continue; if (program_header.p_offset < min_pos) min_pos = program_header.p_offset; } return min_pos - start; } fn findFreeSpace(self: *Elf, object_size: u64, min_alignment: u16) u64 { var start: u64 = 0; while (self.detectAllocCollision(start, object_size)) |item_end| { start = mem.alignForwardGeneric(u64, item_end, min_alignment); } return start; } /// TODO Improve this to use a table. fn makeString(self: *Elf, bytes: []const u8) !u32 { try self.shstrtab.ensureCapacity(self.base.allocator, self.shstrtab.items.len + bytes.len + 1); const result = self.shstrtab.items.len; self.shstrtab.appendSliceAssumeCapacity(bytes); self.shstrtab.appendAssumeCapacity(0); return @intCast(u32, result); } /// TODO Improve this to use a table. fn makeDebugString(self: *Elf, bytes: []const u8) !u32 { try self.debug_strtab.ensureCapacity(self.base.allocator, self.debug_strtab.items.len + bytes.len + 1); const result = self.debug_strtab.items.len; self.debug_strtab.appendSliceAssumeCapacity(bytes); self.debug_strtab.appendAssumeCapacity(0); return @intCast(u32, result); } fn getString(self: *Elf, str_off: u32) []const u8 { assert(str_off < self.shstrtab.items.len); return mem.spanZ(@ptrCast([*:0]const u8, self.shstrtab.items.ptr + str_off)); } fn updateString(self: *Elf, old_str_off: u32, new_name: []const u8) !u32 { const existing_name = self.getString(old_str_off); if (mem.eql(u8, existing_name, new_name)) { return old_str_off; } return self.makeString(new_name); } pub fn populateMissingMetadata(self: *Elf) !void { const small_ptr = switch (self.ptr_width) { .p32 => true, .p64 => false, }; const ptr_size: u8 = self.ptrWidthBytes(); if (self.phdr_load_re_index == null) { self.phdr_load_re_index = @intCast(u16, self.program_headers.items.len); const file_size = self.base.options.program_code_size_hint; const p_align = 0x1000; const off = self.findFreeSpace(file_size, p_align); log.debug("found PT_LOAD free space 0x{x} to 0x{x}\n", .{ off, off + file_size }); const entry_addr: u64 = self.entry_addr orelse if (self.base.options.target.cpu.arch == .spu_2) @as(u64, 0) else default_entry_addr; try self.program_headers.append(self.base.allocator, .{ .p_type = elf.PT_LOAD, .p_offset = off, .p_filesz = file_size, .p_vaddr = entry_addr, .p_paddr = entry_addr, .p_memsz = file_size, .p_align = p_align, .p_flags = elf.PF_X | elf.PF_R, }); self.entry_addr = null; self.phdr_table_dirty = true; } if (self.phdr_got_index == null) { self.phdr_got_index = @intCast(u16, self.program_headers.items.len); const file_size = @as(u64, ptr_size) * self.base.options.symbol_count_hint; // We really only need ptr alignment but since we are using PROGBITS, linux requires // page align. const p_align = if (self.base.options.target.os.tag == .linux) 0x1000 else @as(u16, ptr_size); const off = self.findFreeSpace(file_size, p_align); log.debug("found PT_LOAD free space 0x{x} to 0x{x}\n", .{ off, off + file_size }); // TODO instead of hard coding the vaddr, make a function to find a vaddr to put things at. // we'll need to re-use that function anyway, in case the GOT grows and overlaps something // else in virtual memory. const got_addr: u32 = if (self.base.options.target.cpu.arch.ptrBitWidth() >= 32) 0x4000000 else 0x8000; try self.program_headers.append(self.base.allocator, .{ .p_type = elf.PT_LOAD, .p_offset = off, .p_filesz = file_size, .p_vaddr = got_addr, .p_paddr = got_addr, .p_memsz = file_size, .p_align = p_align, .p_flags = elf.PF_R, }); self.phdr_table_dirty = true; } if (self.shstrtab_index == null) { self.shstrtab_index = @intCast(u16, self.sections.items.len); assert(self.shstrtab.items.len == 0); try self.shstrtab.append(self.base.allocator, 0); // need a 0 at position 0 const off = self.findFreeSpace(self.shstrtab.items.len, 1); log.debug("found shstrtab free space 0x{x} to 0x{x}\n", .{ off, off + self.shstrtab.items.len }); try self.sections.append(self.base.allocator, .{ .sh_name = try self.makeString(".shstrtab"), .sh_type = elf.SHT_STRTAB, .sh_flags = 0, .sh_addr = 0, .sh_offset = off, .sh_size = self.shstrtab.items.len, .sh_link = 0, .sh_info = 0, .sh_addralign = 1, .sh_entsize = 0, }); self.shstrtab_dirty = true; self.shdr_table_dirty = true; } if (self.text_section_index == null) { self.text_section_index = @intCast(u16, self.sections.items.len); const phdr = &self.program_headers.items[self.phdr_load_re_index.?]; try self.sections.append(self.base.allocator, .{ .sh_name = try self.makeString(".text"), .sh_type = elf.SHT_PROGBITS, .sh_flags = elf.SHF_ALLOC | elf.SHF_EXECINSTR, .sh_addr = phdr.p_vaddr, .sh_offset = phdr.p_offset, .sh_size = phdr.p_filesz, .sh_link = 0, .sh_info = 0, .sh_addralign = phdr.p_align, .sh_entsize = 0, }); self.shdr_table_dirty = true; } if (self.got_section_index == null) { self.got_section_index = @intCast(u16, self.sections.items.len); const phdr = &self.program_headers.items[self.phdr_got_index.?]; try self.sections.append(self.base.allocator, .{ .sh_name = try self.makeString(".got"), .sh_type = elf.SHT_PROGBITS, .sh_flags = elf.SHF_ALLOC, .sh_addr = phdr.p_vaddr, .sh_offset = phdr.p_offset, .sh_size = phdr.p_filesz, .sh_link = 0, .sh_info = 0, .sh_addralign = phdr.p_align, .sh_entsize = 0, }); self.shdr_table_dirty = true; } if (self.symtab_section_index == null) { self.symtab_section_index = @intCast(u16, self.sections.items.len); const min_align: u16 = if (small_ptr) @alignOf(elf.Elf32_Sym) else @alignOf(elf.Elf64_Sym); const each_size: u64 = if (small_ptr) @sizeOf(elf.Elf32_Sym) else @sizeOf(elf.Elf64_Sym); const file_size = self.base.options.symbol_count_hint * each_size; const off = self.findFreeSpace(file_size, min_align); log.debug("found symtab free space 0x{x} to 0x{x}\n", .{ off, off + file_size }); try self.sections.append(self.base.allocator, .{ .sh_name = try self.makeString(".symtab"), .sh_type = elf.SHT_SYMTAB, .sh_flags = 0, .sh_addr = 0, .sh_offset = off, .sh_size = file_size, // The section header index of the associated string table. .sh_link = self.shstrtab_index.?, .sh_info = @intCast(u32, self.local_symbols.items.len), .sh_addralign = min_align, .sh_entsize = each_size, }); self.shdr_table_dirty = true; try self.writeSymbol(0); } if (self.debug_str_section_index == null) { self.debug_str_section_index = @intCast(u16, self.sections.items.len); assert(self.debug_strtab.items.len == 0); try self.sections.append(self.base.allocator, .{ .sh_name = try self.makeString(".debug_str"), .sh_type = elf.SHT_PROGBITS, .sh_flags = elf.SHF_MERGE | elf.SHF_STRINGS, .sh_addr = 0, .sh_offset = 0, .sh_size = self.debug_strtab.items.len, .sh_link = 0, .sh_info = 0, .sh_addralign = 1, .sh_entsize = 1, }); self.debug_strtab_dirty = true; self.shdr_table_dirty = true; } if (self.debug_info_section_index == null) { self.debug_info_section_index = @intCast(u16, self.sections.items.len); const file_size_hint = 200; const p_align = 1; const off = self.findFreeSpace(file_size_hint, p_align); log.debug("found .debug_info free space 0x{x} to 0x{x}\n", .{ off, off + file_size_hint, }); try self.sections.append(self.base.allocator, .{ .sh_name = try self.makeString(".debug_info"), .sh_type = elf.SHT_PROGBITS, .sh_flags = 0, .sh_addr = 0, .sh_offset = off, .sh_size = file_size_hint, .sh_link = 0, .sh_info = 0, .sh_addralign = p_align, .sh_entsize = 0, }); self.shdr_table_dirty = true; self.debug_info_header_dirty = true; } if (self.debug_abbrev_section_index == null) { self.debug_abbrev_section_index = @intCast(u16, self.sections.items.len); const file_size_hint = 128; const p_align = 1; const off = self.findFreeSpace(file_size_hint, p_align); log.debug("found .debug_abbrev free space 0x{x} to 0x{x}\n", .{ off, off + file_size_hint, }); try self.sections.append(self.base.allocator, .{ .sh_name = try self.makeString(".debug_abbrev"), .sh_type = elf.SHT_PROGBITS, .sh_flags = 0, .sh_addr = 0, .sh_offset = off, .sh_size = file_size_hint, .sh_link = 0, .sh_info = 0, .sh_addralign = p_align, .sh_entsize = 0, }); self.shdr_table_dirty = true; self.debug_abbrev_section_dirty = true; } if (self.debug_aranges_section_index == null) { self.debug_aranges_section_index = @intCast(u16, self.sections.items.len); const file_size_hint = 160; const p_align = 16; const off = self.findFreeSpace(file_size_hint, p_align); log.debug("found .debug_aranges free space 0x{x} to 0x{x}\n", .{ off, off + file_size_hint, }); try self.sections.append(self.base.allocator, .{ .sh_name = try self.makeString(".debug_aranges"), .sh_type = elf.SHT_PROGBITS, .sh_flags = 0, .sh_addr = 0, .sh_offset = off, .sh_size = file_size_hint, .sh_link = 0, .sh_info = 0, .sh_addralign = p_align, .sh_entsize = 0, }); self.shdr_table_dirty = true; self.debug_aranges_section_dirty = true; } if (self.debug_line_section_index == null) { self.debug_line_section_index = @intCast(u16, self.sections.items.len); const file_size_hint = 250; const p_align = 1; const off = self.findFreeSpace(file_size_hint, p_align); log.debug("found .debug_line free space 0x{x} to 0x{x}\n", .{ off, off + file_size_hint, }); try self.sections.append(self.base.allocator, .{ .sh_name = try self.makeString(".debug_line"), .sh_type = elf.SHT_PROGBITS, .sh_flags = 0, .sh_addr = 0, .sh_offset = off, .sh_size = file_size_hint, .sh_link = 0, .sh_info = 0, .sh_addralign = p_align, .sh_entsize = 0, }); self.shdr_table_dirty = true; self.debug_line_header_dirty = true; } const shsize: u64 = switch (self.ptr_width) { .p32 => @sizeOf(elf.Elf32_Shdr), .p64 => @sizeOf(elf.Elf64_Shdr), }; const shalign: u16 = switch (self.ptr_width) { .p32 => @alignOf(elf.Elf32_Shdr), .p64 => @alignOf(elf.Elf64_Shdr), }; if (self.shdr_table_offset == null) { self.shdr_table_offset = self.findFreeSpace(self.sections.items.len * shsize, shalign); self.shdr_table_dirty = true; } const phsize: u64 = switch (self.ptr_width) { .p32 => @sizeOf(elf.Elf32_Phdr), .p64 => @sizeOf(elf.Elf64_Phdr), }; const phalign: u16 = switch (self.ptr_width) { .p32 => @alignOf(elf.Elf32_Phdr), .p64 => @alignOf(elf.Elf64_Phdr), }; if (self.phdr_table_offset == null) { self.phdr_table_offset = self.findFreeSpace(self.program_headers.items.len * phsize, phalign); self.phdr_table_dirty = true; } { // Iterate over symbols, populating free_list and last_text_block. if (self.local_symbols.items.len != 1) { @panic("TODO implement setting up free_list and last_text_block from existing ELF file"); } // We are starting with an empty file. The default values are correct, null and empty list. } } pub const abbrev_compile_unit = 1; pub const abbrev_subprogram = 2; pub const abbrev_subprogram_retvoid = 3; pub const abbrev_base_type = 4; pub const abbrev_pad1 = 5; pub const abbrev_parameter = 6; pub fn flush(self: *Elf, comp: *Compilation) !void { if (build_options.have_llvm and self.base.options.use_lld) { return self.linkWithLLD(comp); } else { switch (self.base.options.effectiveOutputMode()) { .Exe, .Obj => {}, .Lib => return error.TODOImplementWritingLibFiles, } return self.flushModule(comp); } } pub fn flushModule(self: *Elf, comp: *Compilation) !void { const tracy = trace(@src()); defer tracy.end(); // TODO This linker code currently assumes there is only 1 compilation unit and it corresponds to the // Zig source code. const module = self.base.options.module orelse return error.LinkingWithoutZigSourceUnimplemented; const target_endian = self.base.options.target.cpu.arch.endian(); const foreign_endian = target_endian != std.Target.current.cpu.arch.endian(); const ptr_width_bytes: u8 = self.ptrWidthBytes(); const init_len_size: usize = switch (self.ptr_width) { .p32 => 4, .p64 => 12, }; // Unfortunately these have to be buffered and done at the end because ELF does not allow // mixing local and global symbols within a symbol table. try self.writeAllGlobalSymbols(); if (self.debug_abbrev_section_dirty) { const debug_abbrev_sect = &self.sections.items[self.debug_abbrev_section_index.?]; // These are LEB encoded but since the values are all less than 127 // we can simply append these bytes. const abbrev_buf = [_]u8{ abbrev_compile_unit, DW.TAG_compile_unit, DW.CHILDREN_yes, // header DW.AT_stmt_list, DW.FORM_sec_offset, DW.AT_low_pc, DW.FORM_addr, DW.AT_high_pc, DW.FORM_addr, DW.AT_name, DW.FORM_strp, DW.AT_comp_dir, DW.FORM_strp, DW.AT_producer, DW.FORM_strp, DW.AT_language, DW.FORM_data2, 0, 0, // table sentinel abbrev_subprogram, DW.TAG_subprogram, DW.CHILDREN_yes, // header DW.AT_low_pc, DW.FORM_addr, DW.AT_high_pc, DW.FORM_data4, DW.AT_type, DW.FORM_ref4, DW.AT_name, DW.FORM_string, 0, 0, // table sentinel abbrev_subprogram_retvoid, DW.TAG_subprogram, DW.CHILDREN_yes, // header DW.AT_low_pc, DW.FORM_addr, DW.AT_high_pc, DW.FORM_data4, DW.AT_name, DW.FORM_string, 0, 0, // table sentinel abbrev_base_type, DW.TAG_base_type, DW.CHILDREN_no, // header DW.AT_encoding, DW.FORM_data1, DW.AT_byte_size, DW.FORM_data1, DW.AT_name, DW.FORM_string, 0, 0, // table sentinel abbrev_pad1, DW.TAG_unspecified_type, DW.CHILDREN_no, // header 0, 0, // table sentinel abbrev_parameter, DW.TAG_formal_parameter, DW.CHILDREN_no, // header DW.AT_location, DW.FORM_exprloc, DW.AT_type, DW.FORM_ref4, DW.AT_name, DW.FORM_string, 0, 0, // table sentinel 0, 0, 0, // section sentinel }; const needed_size = abbrev_buf.len; const allocated_size = self.allocatedSize(debug_abbrev_sect.sh_offset); if (needed_size > allocated_size) { debug_abbrev_sect.sh_size = 0; // free the space debug_abbrev_sect.sh_offset = self.findFreeSpace(needed_size, 1); } debug_abbrev_sect.sh_size = needed_size; log.debug(".debug_abbrev start=0x{x} end=0x{x}\n", .{ debug_abbrev_sect.sh_offset, debug_abbrev_sect.sh_offset + needed_size, }); const abbrev_offset = 0; self.debug_abbrev_table_offset = abbrev_offset; try self.base.file.?.pwriteAll(&abbrev_buf, debug_abbrev_sect.sh_offset + abbrev_offset); if (!self.shdr_table_dirty) { // Then it won't get written with the others and we need to do it. try self.writeSectHeader(self.debug_abbrev_section_index.?); } self.debug_abbrev_section_dirty = false; } if (self.debug_info_header_dirty) debug_info: { // If this value is null it means there is an error in the module; // leave debug_info_header_dirty=true. const first_dbg_info_decl = self.dbg_info_decl_first orelse break :debug_info; const last_dbg_info_decl = self.dbg_info_decl_last.?; const debug_info_sect = &self.sections.items[self.debug_info_section_index.?]; var di_buf = std.ArrayList(u8).init(self.base.allocator); defer di_buf.deinit(); // We have a function to compute the upper bound size, because it's needed // for determining where to put the offset of the first `LinkBlock`. try di_buf.ensureCapacity(self.dbgInfoNeededHeaderBytes()); // initial length - length of the .debug_info contribution for this compilation unit, // not including the initial length itself. // We have to come back and write it later after we know the size. const after_init_len = di_buf.items.len + init_len_size; // +1 for the final 0 that ends the compilation unit children. const dbg_info_end = last_dbg_info_decl.dbg_info_off + last_dbg_info_decl.dbg_info_len + 1; const init_len = dbg_info_end - after_init_len; switch (self.ptr_width) { .p32 => { mem.writeInt(u32, di_buf.addManyAsArrayAssumeCapacity(4), @intCast(u32, init_len), target_endian); }, .p64 => { di_buf.appendNTimesAssumeCapacity(0xff, 4); mem.writeInt(u64, di_buf.addManyAsArrayAssumeCapacity(8), init_len, target_endian); }, } mem.writeInt(u16, di_buf.addManyAsArrayAssumeCapacity(2), 4, target_endian); // DWARF version const abbrev_offset = self.debug_abbrev_table_offset.?; switch (self.ptr_width) { .p32 => { mem.writeInt(u32, di_buf.addManyAsArrayAssumeCapacity(4), @intCast(u32, abbrev_offset), target_endian); di_buf.appendAssumeCapacity(4); // address size }, .p64 => { mem.writeInt(u64, di_buf.addManyAsArrayAssumeCapacity(8), abbrev_offset, target_endian); di_buf.appendAssumeCapacity(8); // address size }, } // Write the form for the compile unit, which must match the abbrev table above. const name_strp = try self.makeDebugString(module.root_pkg.root_src_path); const comp_dir_strp = try self.makeDebugString(module.root_pkg.root_src_directory.path orelse "."); const producer_strp = try self.makeDebugString(link.producer_string); // Currently only one compilation unit is supported, so the address range is simply // identical to the main program header virtual address and memory size. const text_phdr = &self.program_headers.items[self.phdr_load_re_index.?]; const low_pc = text_phdr.p_vaddr; const high_pc = text_phdr.p_vaddr + text_phdr.p_memsz; di_buf.appendAssumeCapacity(abbrev_compile_unit); self.writeDwarfAddrAssumeCapacity(&di_buf, 0); // DW.AT_stmt_list, DW.FORM_sec_offset self.writeDwarfAddrAssumeCapacity(&di_buf, low_pc); self.writeDwarfAddrAssumeCapacity(&di_buf, high_pc); self.writeDwarfAddrAssumeCapacity(&di_buf, name_strp); self.writeDwarfAddrAssumeCapacity(&di_buf, comp_dir_strp); self.writeDwarfAddrAssumeCapacity(&di_buf, producer_strp); // We are still waiting on dwarf-std.org to assign DW_LANG_Zig a number: // http://dwarfstd.org/ShowIssue.php?issue=171115.1 // Until then we say it is C99. mem.writeInt(u16, di_buf.addManyAsArrayAssumeCapacity(2), DW.LANG_C99, target_endian); if (di_buf.items.len > first_dbg_info_decl.dbg_info_off) { // Move the first N decls to the end to make more padding for the header. @panic("TODO: handle .debug_info header exceeding its padding"); } const jmp_amt = first_dbg_info_decl.dbg_info_off - di_buf.items.len; try self.pwriteDbgInfoNops(0, di_buf.items, jmp_amt, false, debug_info_sect.sh_offset); self.debug_info_header_dirty = false; } if (self.debug_aranges_section_dirty) { const debug_aranges_sect = &self.sections.items[self.debug_aranges_section_index.?]; var di_buf = std.ArrayList(u8).init(self.base.allocator); defer di_buf.deinit(); // Enough for all the data without resizing. When support for more compilation units // is added, the size of this section will become more variable. try di_buf.ensureCapacity(100); // initial length - length of the .debug_aranges contribution for this compilation unit, // not including the initial length itself. // We have to come back and write it later after we know the size. const init_len_index = di_buf.items.len; di_buf.items.len += init_len_size; const after_init_len = di_buf.items.len; mem.writeInt(u16, di_buf.addManyAsArrayAssumeCapacity(2), 2, target_endian); // version // When more than one compilation unit is supported, this will be the offset to it. // For now it is always at offset 0 in .debug_info. self.writeDwarfAddrAssumeCapacity(&di_buf, 0); // .debug_info offset di_buf.appendAssumeCapacity(ptr_width_bytes); // address_size di_buf.appendAssumeCapacity(0); // segment_selector_size const end_header_offset = di_buf.items.len; const begin_entries_offset = mem.alignForward(end_header_offset, ptr_width_bytes * 2); di_buf.appendNTimesAssumeCapacity(0, begin_entries_offset - end_header_offset); // Currently only one compilation unit is supported, so the address range is simply // identical to the main program header virtual address and memory size. const text_phdr = &self.program_headers.items[self.phdr_load_re_index.?]; self.writeDwarfAddrAssumeCapacity(&di_buf, text_phdr.p_vaddr); self.writeDwarfAddrAssumeCapacity(&di_buf, text_phdr.p_memsz); // Sentinel. self.writeDwarfAddrAssumeCapacity(&di_buf, 0); self.writeDwarfAddrAssumeCapacity(&di_buf, 0); // Go back and populate the initial length. const init_len = di_buf.items.len - after_init_len; switch (self.ptr_width) { .p32 => { mem.writeInt(u32, di_buf.items[init_len_index..][0..4], @intCast(u32, init_len), target_endian); }, .p64 => { // initial length - length of the .debug_aranges contribution for this compilation unit, // not including the initial length itself. di_buf.items[init_len_index..][0..4].* = [_]u8{ 0xff, 0xff, 0xff, 0xff }; mem.writeInt(u64, di_buf.items[init_len_index + 4 ..][0..8], init_len, target_endian); }, } const needed_size = di_buf.items.len; const allocated_size = self.allocatedSize(debug_aranges_sect.sh_offset); if (needed_size > allocated_size) { debug_aranges_sect.sh_size = 0; // free the space debug_aranges_sect.sh_offset = self.findFreeSpace(needed_size, 16); } debug_aranges_sect.sh_size = needed_size; log.debug(".debug_aranges start=0x{x} end=0x{x}\n", .{ debug_aranges_sect.sh_offset, debug_aranges_sect.sh_offset + needed_size, }); try self.base.file.?.pwriteAll(di_buf.items, debug_aranges_sect.sh_offset); if (!self.shdr_table_dirty) { // Then it won't get written with the others and we need to do it. try self.writeSectHeader(self.debug_aranges_section_index.?); } self.debug_aranges_section_dirty = false; } if (self.debug_line_header_dirty) debug_line: { if (self.dbg_line_fn_first == null) { break :debug_line; // Error in module; leave debug_line_header_dirty=true. } const dbg_line_prg_off = self.getDebugLineProgramOff(); const dbg_line_prg_end = self.getDebugLineProgramEnd(); assert(dbg_line_prg_end != 0); const debug_line_sect = &self.sections.items[self.debug_line_section_index.?]; var di_buf = std.ArrayList(u8).init(self.base.allocator); defer di_buf.deinit(); // The size of this header is variable, depending on the number of directories, // files, and padding. We have a function to compute the upper bound size, however, // because it's needed for determining where to put the offset of the first `SrcFn`. try di_buf.ensureCapacity(self.dbgLineNeededHeaderBytes()); // initial length - length of the .debug_line contribution for this compilation unit, // not including the initial length itself. const after_init_len = di_buf.items.len + init_len_size; const init_len = dbg_line_prg_end - after_init_len; switch (self.ptr_width) { .p32 => { mem.writeInt(u32, di_buf.addManyAsArrayAssumeCapacity(4), @intCast(u32, init_len), target_endian); }, .p64 => { di_buf.appendNTimesAssumeCapacity(0xff, 4); mem.writeInt(u64, di_buf.addManyAsArrayAssumeCapacity(8), init_len, target_endian); }, } mem.writeInt(u16, di_buf.addManyAsArrayAssumeCapacity(2), 4, target_endian); // version // Empirically, debug info consumers do not respect this field, or otherwise // consider it to be an error when it does not point exactly to the end of the header. // Therefore we rely on the NOP jump at the beginning of the Line Number Program for // padding rather than this field. const before_header_len = di_buf.items.len; di_buf.items.len += ptr_width_bytes; // We will come back and write this. const after_header_len = di_buf.items.len; const opcode_base = DW.LNS_set_isa + 1; di_buf.appendSliceAssumeCapacity(&[_]u8{ 1, // minimum_instruction_length 1, // maximum_operations_per_instruction 1, // default_is_stmt 1, // line_base (signed) 1, // line_range opcode_base, // Standard opcode lengths. The number of items here is based on `opcode_base`. // The value is the number of LEB128 operands the instruction takes. 0, // `DW.LNS_copy` 1, // `DW.LNS_advance_pc` 1, // `DW.LNS_advance_line` 1, // `DW.LNS_set_file` 1, // `DW.LNS_set_column` 0, // `DW.LNS_negate_stmt` 0, // `DW.LNS_set_basic_block` 0, // `DW.LNS_const_add_pc` 1, // `DW.LNS_fixed_advance_pc` 0, // `DW.LNS_set_prologue_end` 0, // `DW.LNS_set_epilogue_begin` 1, // `DW.LNS_set_isa` 0, // include_directories (none except the compilation unit cwd) }); // file_names[0] di_buf.appendSliceAssumeCapacity(module.root_pkg.root_src_path); // relative path name di_buf.appendSliceAssumeCapacity(&[_]u8{ 0, // null byte for the relative path name 0, // directory_index 0, // mtime (TODO supply this) 0, // file size bytes (TODO supply this) 0, // file_names sentinel }); const header_len = di_buf.items.len - after_header_len; switch (self.ptr_width) { .p32 => { mem.writeInt(u32, di_buf.items[before_header_len..][0..4], @intCast(u32, header_len), target_endian); }, .p64 => { mem.writeInt(u64, di_buf.items[before_header_len..][0..8], header_len, target_endian); }, } // We use NOPs because consumers empirically do not respect the header length field. if (di_buf.items.len > dbg_line_prg_off) { // Move the first N files to the end to make more padding for the header. @panic("TODO: handle .debug_line header exceeding its padding"); } const jmp_amt = dbg_line_prg_off - di_buf.items.len; try self.pwriteDbgLineNops(0, di_buf.items, jmp_amt, debug_line_sect.sh_offset); self.debug_line_header_dirty = false; } if (self.phdr_table_dirty) { const phsize: u64 = switch (self.ptr_width) { .p32 => @sizeOf(elf.Elf32_Phdr), .p64 => @sizeOf(elf.Elf64_Phdr), }; const phalign: u16 = switch (self.ptr_width) { .p32 => @alignOf(elf.Elf32_Phdr), .p64 => @alignOf(elf.Elf64_Phdr), }; const allocated_size = self.allocatedSize(self.phdr_table_offset.?); const needed_size = self.program_headers.items.len * phsize; if (needed_size > allocated_size) { self.phdr_table_offset = null; // free the space self.phdr_table_offset = self.findFreeSpace(needed_size, phalign); } switch (self.ptr_width) { .p32 => { const buf = try self.base.allocator.alloc(elf.Elf32_Phdr, self.program_headers.items.len); defer self.base.allocator.free(buf); for (buf) |*phdr, i| { phdr.* = progHeaderTo32(self.program_headers.items[i]); if (foreign_endian) { bswapAllFields(elf.Elf32_Phdr, phdr); } } try self.base.file.?.pwriteAll(mem.sliceAsBytes(buf), self.phdr_table_offset.?); }, .p64 => { const buf = try self.base.allocator.alloc(elf.Elf64_Phdr, self.program_headers.items.len); defer self.base.allocator.free(buf); for (buf) |*phdr, i| { phdr.* = self.program_headers.items[i]; if (foreign_endian) { bswapAllFields(elf.Elf64_Phdr, phdr); } } try self.base.file.?.pwriteAll(mem.sliceAsBytes(buf), self.phdr_table_offset.?); }, } self.phdr_table_dirty = false; } { const shstrtab_sect = &self.sections.items[self.shstrtab_index.?]; if (self.shstrtab_dirty or self.shstrtab.items.len != shstrtab_sect.sh_size) { const allocated_size = self.allocatedSize(shstrtab_sect.sh_offset); const needed_size = self.shstrtab.items.len; if (needed_size > allocated_size) { shstrtab_sect.sh_size = 0; // free the space shstrtab_sect.sh_offset = self.findFreeSpace(needed_size, 1); } shstrtab_sect.sh_size = needed_size; log.debug("writing shstrtab start=0x{x} end=0x{x}\n", .{ shstrtab_sect.sh_offset, shstrtab_sect.sh_offset + needed_size }); try self.base.file.?.pwriteAll(self.shstrtab.items, shstrtab_sect.sh_offset); if (!self.shdr_table_dirty) { // Then it won't get written with the others and we need to do it. try self.writeSectHeader(self.shstrtab_index.?); } self.shstrtab_dirty = false; } } { const debug_strtab_sect = &self.sections.items[self.debug_str_section_index.?]; if (self.debug_strtab_dirty or self.debug_strtab.items.len != debug_strtab_sect.sh_size) { const allocated_size = self.allocatedSize(debug_strtab_sect.sh_offset); const needed_size = self.debug_strtab.items.len; if (needed_size > allocated_size) { debug_strtab_sect.sh_size = 0; // free the space debug_strtab_sect.sh_offset = self.findFreeSpace(needed_size, 1); } debug_strtab_sect.sh_size = needed_size; log.debug("debug_strtab start=0x{x} end=0x{x}\n", .{ debug_strtab_sect.sh_offset, debug_strtab_sect.sh_offset + needed_size }); try self.base.file.?.pwriteAll(self.debug_strtab.items, debug_strtab_sect.sh_offset); if (!self.shdr_table_dirty) { // Then it won't get written with the others and we need to do it. try self.writeSectHeader(self.debug_str_section_index.?); } self.debug_strtab_dirty = false; } } if (self.shdr_table_dirty) { const shsize: u64 = switch (self.ptr_width) { .p32 => @sizeOf(elf.Elf32_Shdr), .p64 => @sizeOf(elf.Elf64_Shdr), }; const shalign: u16 = switch (self.ptr_width) { .p32 => @alignOf(elf.Elf32_Shdr), .p64 => @alignOf(elf.Elf64_Shdr), }; const allocated_size = self.allocatedSize(self.shdr_table_offset.?); const needed_size = self.sections.items.len * shsize; if (needed_size > allocated_size) { self.shdr_table_offset = null; // free the space self.shdr_table_offset = self.findFreeSpace(needed_size, shalign); } switch (self.ptr_width) { .p32 => { const buf = try self.base.allocator.alloc(elf.Elf32_Shdr, self.sections.items.len); defer self.base.allocator.free(buf); for (buf) |*shdr, i| { shdr.* = sectHeaderTo32(self.sections.items[i]); log.debug("writing section {}\n", .{shdr.*}); if (foreign_endian) { bswapAllFields(elf.Elf32_Shdr, shdr); } } try self.base.file.?.pwriteAll(mem.sliceAsBytes(buf), self.shdr_table_offset.?); }, .p64 => { const buf = try self.base.allocator.alloc(elf.Elf64_Shdr, self.sections.items.len); defer self.base.allocator.free(buf); for (buf) |*shdr, i| { shdr.* = self.sections.items[i]; log.debug("writing section {}\n", .{shdr.*}); if (foreign_endian) { bswapAllFields(elf.Elf64_Shdr, shdr); } } try self.base.file.?.pwriteAll(mem.sliceAsBytes(buf), self.shdr_table_offset.?); }, } self.shdr_table_dirty = false; } if (self.entry_addr == null and self.base.options.effectiveOutputMode() == .Exe) { log.debug("flushing. no_entry_point_found = true\n", .{}); self.error_flags.no_entry_point_found = true; } else { log.debug("flushing. no_entry_point_found = false\n", .{}); self.error_flags.no_entry_point_found = false; try self.writeElfHeader(); } // The point of flush() is to commit changes, so in theory, nothing should // be dirty after this. However, it is possible for some things to remain // dirty because they fail to be written in the event of compile errors, // such as debug_line_header_dirty and debug_info_header_dirty. assert(!self.debug_abbrev_section_dirty); assert(!self.debug_aranges_section_dirty); assert(!self.phdr_table_dirty); assert(!self.shdr_table_dirty); assert(!self.shstrtab_dirty); assert(!self.debug_strtab_dirty); } fn linkWithLLD(self: *Elf, comp: *Compilation) !void { const tracy = trace(@src()); defer tracy.end(); var arena_allocator = std.heap.ArenaAllocator.init(self.base.allocator); defer arena_allocator.deinit(); const arena = &arena_allocator.allocator; const directory = self.base.options.emit.?.directory; // Just an alias to make it shorter to type. // If there is no Zig code to compile, then we should skip flushing the output file because it // will not be part of the linker line anyway. const module_obj_path: ?[]const u8 = if (self.base.options.module) |module| blk: { const use_stage1 = build_options.is_stage1 and self.base.options.use_llvm; if (use_stage1) { const obj_basename = try std.zig.binNameAlloc(arena, .{ .root_name = self.base.options.root_name, .target = self.base.options.target, .output_mode = .Obj, }); const o_directory = self.base.options.module.?.zig_cache_artifact_directory; const full_obj_path = try o_directory.join(arena, &[_][]const u8{obj_basename}); break :blk full_obj_path; } try self.flushModule(comp); const obj_basename = self.base.intermediary_basename.?; const full_obj_path = try directory.join(arena, &[_][]const u8{obj_basename}); break :blk full_obj_path; } else null; const is_obj = self.base.options.output_mode == .Obj; const is_lib = self.base.options.output_mode == .Lib; const is_dyn_lib = self.base.options.link_mode == .Dynamic and is_lib; const is_exe_or_dyn_lib = is_dyn_lib or self.base.options.output_mode == .Exe; const have_dynamic_linker = self.base.options.link_libc and self.base.options.link_mode == .Dynamic and is_exe_or_dyn_lib; const link_in_crt = self.base.options.link_libc and self.base.options.output_mode == .Exe; const target = self.base.options.target; const gc_sections = self.base.options.gc_sections orelse !is_obj; const stack_size = self.base.options.stack_size_override orelse 16777216; const allow_shlib_undefined = self.base.options.allow_shlib_undefined orelse !self.base.options.is_native_os; const compiler_rt_path: ?[]const u8 = if (self.base.options.include_compiler_rt) blk: { if (is_exe_or_dyn_lib) { break :blk comp.compiler_rt_static_lib.?.full_object_path; } else { break :blk comp.compiler_rt_obj.?.full_object_path; } } else null; // Here we want to determine whether we can save time by not invoking LLD when the // output is unchanged. None of the linker options or the object files that are being // linked are in the hash that namespaces the directory we are outputting to. Therefore, // we must hash those now, and the resulting digest will form the "id" of the linking // job we are about to perform. // After a successful link, we store the id in the metadata of a symlink named "id.txt" in // the artifact directory. So, now, we check if this symlink exists, and if it matches // our digest. If so, we can skip linking. Otherwise, we proceed with invoking LLD. const id_symlink_basename = "lld.id"; var man: Cache.Manifest = undefined; defer if (!self.base.options.disable_lld_caching) man.deinit(); var digest: [Cache.hex_digest_len]u8 = undefined; if (!self.base.options.disable_lld_caching) { man = comp.cache_parent.obtain(); // We are about to obtain this lock, so here we give other processes a chance first. self.base.releaseLock(); try man.addOptionalFile(self.base.options.linker_script); try man.addOptionalFile(self.base.options.version_script); try man.addListOfFiles(self.base.options.objects); for (comp.c_object_table.items()) |entry| { _ = try man.addFile(entry.key.status.success.object_path, null); } try man.addOptionalFile(module_obj_path); try man.addOptionalFile(compiler_rt_path); // We can skip hashing libc and libc++ components that we are in charge of building from Zig // installation sources because they are always a product of the compiler version + target information. man.hash.add(stack_size); man.hash.addOptional(self.base.options.image_base_override); man.hash.add(gc_sections); man.hash.add(self.base.options.eh_frame_hdr); man.hash.add(self.base.options.emit_relocs); man.hash.add(self.base.options.rdynamic); man.hash.addListOfBytes(self.base.options.extra_lld_args); man.hash.addListOfBytes(self.base.options.lib_dirs); man.hash.addListOfBytes(self.base.options.rpath_list); man.hash.add(self.base.options.each_lib_rpath); man.hash.add(self.base.options.is_compiler_rt_or_libc); man.hash.add(self.base.options.z_nodelete); man.hash.add(self.base.options.z_defs); if (self.base.options.link_libc) { man.hash.add(self.base.options.libc_installation != null); if (self.base.options.libc_installation) |libc_installation| { man.hash.addBytes(libc_installation.crt_dir.?); } if (have_dynamic_linker) { man.hash.addOptionalBytes(self.base.options.dynamic_linker); } } man.hash.addOptionalBytes(self.base.options.soname); man.hash.addOptional(self.base.options.version); man.hash.addStringSet(self.base.options.system_libs); man.hash.add(allow_shlib_undefined); man.hash.add(self.base.options.bind_global_refs_locally); // We don't actually care whether it's a cache hit or miss; we just need the digest and the lock. _ = try man.hit(); digest = man.final(); var prev_digest_buf: [digest.len]u8 = undefined; const prev_digest: []u8 = Cache.readSmallFile( directory.handle, id_symlink_basename, &prev_digest_buf, ) catch |err| blk: { log.debug("ELF LLD new_digest={} error: {}", .{ digest, @errorName(err) }); // Handle this as a cache miss. break :blk prev_digest_buf[0..0]; }; if (mem.eql(u8, prev_digest, &digest)) { log.debug("ELF LLD digest={} match - skipping invocation", .{digest}); // Hot diggity dog! The output binary is already there. self.base.lock = man.toOwnedLock(); return; } log.debug("ELF LLD prev_digest={} new_digest={}", .{ prev_digest, digest }); // We are about to change the output file to be different, so we invalidate the build hash now. directory.handle.deleteFile(id_symlink_basename) catch |err| switch (err) { error.FileNotFound => {}, else => |e| return e, }; } // Create an LLD command line and invoke it. var argv = std.ArrayList([]const u8).init(self.base.allocator); defer argv.deinit(); // The first argument is ignored as LLD is called as a library, set it // anyway to the correct LLD driver name for this target so that it's // correctly printed when `verbose_link` is true. This is needed for some // tools such as CMake when Zig is used as C compiler. try argv.append("ld.lld"); if (is_obj) { try argv.append("-r"); } try argv.append("-error-limit=0"); if (self.base.options.output_mode == .Exe) { try argv.append("-z"); try argv.append(try std.fmt.allocPrint(arena, "stack-size={}", .{stack_size})); } if (self.base.options.image_base_override) |image_base| { try argv.append(try std.fmt.allocPrint(arena, "--image-base={d}", .{image_base})); } if (self.base.options.linker_script) |linker_script| { try argv.append("-T"); try argv.append(linker_script); } if (gc_sections) { try argv.append("--gc-sections"); } if (self.base.options.eh_frame_hdr) { try argv.append("--eh-frame-hdr"); } if (self.base.options.emit_relocs) { try argv.append("--emit-relocs"); } if (self.base.options.rdynamic) { try argv.append("--export-dynamic"); } try argv.appendSlice(self.base.options.extra_lld_args); if (self.base.options.z_nodelete) { try argv.append("-z"); try argv.append("nodelete"); } if (self.base.options.z_defs) { try argv.append("-z"); try argv.append("defs"); } if (getLDMOption(target)) |ldm| { // Any target ELF will use the freebsd osabi if suffixed with "_fbsd". const arg = if (target.os.tag == .freebsd) try std.fmt.allocPrint(arena, "{}_fbsd", .{ldm}) else ldm; try argv.append("-m"); try argv.append(arg); } if (self.base.options.link_mode == .Static) { if (target.cpu.arch.isARM() or target.cpu.arch.isThumb()) { try argv.append("-Bstatic"); } else { try argv.append("-static"); } } else if (is_dyn_lib) { try argv.append("-shared"); } if (self.base.options.pie and self.base.options.output_mode == .Exe) { try argv.append("-pie"); } const full_out_path = try directory.join(arena, &[_][]const u8{self.base.options.emit.?.sub_path}); try argv.append("-o"); try argv.append(full_out_path); if (link_in_crt) { const crt1o: []const u8 = o: { if (target.os.tag == .netbsd or target.os.tag == .openbsd) { break :o "crt0.o"; } else if (target.isAndroid()) { if (self.base.options.link_mode == .Dynamic) { break :o "crtbegin_dynamic.o"; } else { break :o "crtbegin_static.o"; } } else if (self.base.options.link_mode == .Static) { if (self.base.options.pie) { break :o "rcrt1.o"; } else { break :o "crt1.o"; } } else { break :o "Scrt1.o"; } }; try argv.append(try comp.get_libc_crt_file(arena, crt1o)); if (target_util.libc_needs_crti_crtn(target)) { try argv.append(try comp.get_libc_crt_file(arena, "crti.o")); } if (target.os.tag == .openbsd) { try argv.append(try comp.get_libc_crt_file(arena, "crtbegin.o")); } } // rpaths var rpath_table = std.StringHashMap(void).init(self.base.allocator); defer rpath_table.deinit(); for (self.base.options.rpath_list) |rpath| { if ((try rpath_table.fetchPut(rpath, {})) == null) { try argv.append("-rpath"); try argv.append(rpath); } } if (self.base.options.each_lib_rpath) { var test_path = std.ArrayList(u8).init(self.base.allocator); defer test_path.deinit(); for (self.base.options.lib_dirs) |lib_dir_path| { for (self.base.options.system_libs.items()) |entry| { const link_lib = entry.key; test_path.shrinkRetainingCapacity(0); const sep = fs.path.sep_str; try test_path.writer().print("{s}" ++ sep ++ "lib{s}.so", .{ lib_dir_path, link_lib }); fs.cwd().access(test_path.items, .{}) catch |err| switch (err) { error.FileNotFound => continue, else => |e| return e, }; if ((try rpath_table.fetchPut(lib_dir_path, {})) == null) { try argv.append("-rpath"); try argv.append(lib_dir_path); } } } } for (self.base.options.lib_dirs) |lib_dir| { try argv.append("-L"); try argv.append(lib_dir); } if (self.base.options.link_libc) { if (self.base.options.libc_installation) |libc_installation| { try argv.append("-L"); try argv.append(libc_installation.crt_dir.?); } if (have_dynamic_linker) { if (self.base.options.dynamic_linker) |dynamic_linker| { try argv.append("-dynamic-linker"); try argv.append(dynamic_linker); } } } if (is_dyn_lib) { if (self.base.options.soname) |soname| { try argv.append("-soname"); try argv.append(soname); } if (self.base.options.version_script) |version_script| { try argv.append("-version-script"); try argv.append(version_script); } } // Positional arguments to the linker such as object files. try argv.appendSlice(self.base.options.objects); for (comp.c_object_table.items()) |entry| { try argv.append(entry.key.status.success.object_path); } if (module_obj_path) |p| { try argv.append(p); } // libc if (is_exe_or_dyn_lib and !self.base.options.is_compiler_rt_or_libc and !self.base.options.link_libc) { try argv.append(comp.libc_static_lib.?.full_object_path); } // compiler-rt if (compiler_rt_path) |p| { try argv.append(p); } // Shared libraries. const system_libs = self.base.options.system_libs.items(); try argv.ensureCapacity(argv.items.len + system_libs.len); for (system_libs) |entry| { const link_lib = entry.key; // By this time, we depend on these libs being dynamically linked libraries and not static libraries // (the check for that needs to be earlier), but they could be full paths to .so files, in which // case we want to avoid prepending "-l". const ext = Compilation.classifyFileExt(link_lib); const arg = if (ext == .shared_library) link_lib else try std.fmt.allocPrint(arena, "-l{}", .{link_lib}); argv.appendAssumeCapacity(arg); } if (!is_obj) { // libc++ dep if (self.base.options.link_libcpp) { try argv.append(comp.libcxxabi_static_lib.?.full_object_path); try argv.append(comp.libcxx_static_lib.?.full_object_path); } // libc dep if (self.base.options.link_libc) { if (self.base.options.libc_installation != null) { if (self.base.options.link_mode == .Static) { try argv.append("--start-group"); try argv.append("-lc"); try argv.append("-lm"); try argv.append("--end-group"); } else { try argv.append("-lc"); try argv.append("-lm"); } if (target.os.tag == .freebsd or target.os.tag == .netbsd) { try argv.append("-lpthread"); } } else if (target.isGnuLibC()) { try argv.append(comp.libunwind_static_lib.?.full_object_path); for (glibc.libs) |lib| { const lib_path = try std.fmt.allocPrint(arena, "{s}{c}lib{s}.so.{d}", .{ comp.glibc_so_files.?.dir_path, fs.path.sep, lib.name, lib.sover, }); try argv.append(lib_path); } try argv.append(try comp.get_libc_crt_file(arena, "libc_nonshared.a")); } else if (target.isMusl()) { try argv.append(comp.libunwind_static_lib.?.full_object_path); try argv.append(try comp.get_libc_crt_file(arena, "libc.a")); } else if (self.base.options.link_libcpp) { try argv.append(comp.libunwind_static_lib.?.full_object_path); } else { unreachable; // Compiler was supposed to emit an error for not being able to provide libc. } } } // crt end if (link_in_crt) { if (target.isAndroid()) { try argv.append(try comp.get_libc_crt_file(arena, "crtend_android.o")); } else if (target.os.tag == .openbsd) { try argv.append(try comp.get_libc_crt_file(arena, "crtend.o")); } else if (target_util.libc_needs_crti_crtn(target)) { try argv.append(try comp.get_libc_crt_file(arena, "crtn.o")); } } if (allow_shlib_undefined) { try argv.append("--allow-shlib-undefined"); } if (self.base.options.bind_global_refs_locally) { try argv.append("-Bsymbolic"); } if (self.base.options.verbose_link) { Compilation.dump_argv(argv.items); } // Oh, snapplesauce! We need null terminated argv. const new_argv = try arena.allocSentinel(?[*:0]const u8, argv.items.len, null); for (argv.items) |arg, i| { new_argv[i] = try arena.dupeZ(u8, arg); } var stderr_context: LLDContext = .{ .elf = self, .data = std.ArrayList(u8).init(self.base.allocator), }; defer stderr_context.data.deinit(); var stdout_context: LLDContext = .{ .elf = self, .data = std.ArrayList(u8).init(self.base.allocator), }; defer stdout_context.data.deinit(); const llvm = @import("../llvm.zig"); const ok = llvm.Link( .ELF, new_argv.ptr, new_argv.len, append_diagnostic, @ptrToInt(&stdout_context), @ptrToInt(&stderr_context), ); if (stderr_context.oom or stdout_context.oom) return error.OutOfMemory; if (stdout_context.data.items.len != 0) { std.log.warn("unexpected LLD stdout: {}", .{stdout_context.data.items}); } if (!ok) { // TODO parse this output and surface with the Compilation API rather than // directly outputting to stderr here. std.debug.print("{}", .{stderr_context.data.items}); return error.LLDReportedFailure; } if (stderr_context.data.items.len != 0) { std.log.warn("unexpected LLD stderr: {}", .{stderr_context.data.items}); } if (!self.base.options.disable_lld_caching) { // Update the file with the digest. If it fails we can continue; it only // means that the next invocation will have an unnecessary cache miss. Cache.writeSmallFile(directory.handle, id_symlink_basename, &digest) catch |err| { std.log.warn("failed to save linking hash digest file: {}", .{@errorName(err)}); }; // Again failure here only means an unnecessary cache miss. man.writeManifest() catch |err| { std.log.warn("failed to write cache manifest when linking: {}", .{@errorName(err)}); }; // We hang on to this lock so that the output file path can be used without // other processes clobbering it. self.base.lock = man.toOwnedLock(); } } const LLDContext = struct { data: std.ArrayList(u8), elf: *Elf, oom: bool = false, }; fn append_diagnostic(context: usize, ptr: [*]const u8, len: usize) callconv(.C) void { const lld_context = @intToPtr(*LLDContext, context); const msg = ptr[0..len]; lld_context.data.appendSlice(msg) catch |err| switch (err) { error.OutOfMemory => lld_context.oom = true, }; } fn writeDwarfAddrAssumeCapacity(self: *Elf, buf: *std.ArrayList(u8), addr: u64) void { const target_endian = self.base.options.target.cpu.arch.endian(); switch (self.ptr_width) { .p32 => mem.writeInt(u32, buf.addManyAsArrayAssumeCapacity(4), @intCast(u32, addr), target_endian), .p64 => mem.writeInt(u64, buf.addManyAsArrayAssumeCapacity(8), addr, target_endian), } } fn writeElfHeader(self: *Elf) !void { var hdr_buf: [@sizeOf(elf.Elf64_Ehdr)]u8 = undefined; var index: usize = 0; hdr_buf[0..4].* = "\x7fELF".*; index += 4; hdr_buf[index] = switch (self.ptr_width) { .p32 => elf.ELFCLASS32, .p64 => elf.ELFCLASS64, }; index += 1; const endian = self.base.options.target.cpu.arch.endian(); hdr_buf[index] = switch (endian) { .Little => elf.ELFDATA2LSB, .Big => elf.ELFDATA2MSB, }; index += 1; hdr_buf[index] = 1; // ELF version index += 1; // OS ABI, often set to 0 regardless of target platform // ABI Version, possibly used by glibc but not by static executables // padding mem.set(u8, hdr_buf[index..][0..9], 0); index += 9; assert(index == 16); const elf_type = switch (self.base.options.effectiveOutputMode()) { .Exe => elf.ET.EXEC, .Obj => elf.ET.REL, .Lib => switch (self.base.options.link_mode) { .Static => elf.ET.REL, .Dynamic => elf.ET.DYN, }, }; mem.writeInt(u16, hdr_buf[index..][0..2], @enumToInt(elf_type), endian); index += 2; const machine = self.base.options.target.cpu.arch.toElfMachine(); mem.writeInt(u16, hdr_buf[index..][0..2], @enumToInt(machine), endian); index += 2; // ELF Version, again mem.writeInt(u32, hdr_buf[index..][0..4], 1, endian); index += 4; const e_entry = if (elf_type == .REL) 0 else self.entry_addr.?; switch (self.ptr_width) { .p32 => { mem.writeInt(u32, hdr_buf[index..][0..4], @intCast(u32, e_entry), endian); index += 4; // e_phoff mem.writeInt(u32, hdr_buf[index..][0..4], @intCast(u32, self.phdr_table_offset.?), endian); index += 4; // e_shoff mem.writeInt(u32, hdr_buf[index..][0..4], @intCast(u32, self.shdr_table_offset.?), endian); index += 4; }, .p64 => { // e_entry mem.writeInt(u64, hdr_buf[index..][0..8], e_entry, endian); index += 8; // e_phoff mem.writeInt(u64, hdr_buf[index..][0..8], self.phdr_table_offset.?, endian); index += 8; // e_shoff mem.writeInt(u64, hdr_buf[index..][0..8], self.shdr_table_offset.?, endian); index += 8; }, } const e_flags = 0; mem.writeInt(u32, hdr_buf[index..][0..4], e_flags, endian); index += 4; const e_ehsize: u16 = switch (self.ptr_width) { .p32 => @sizeOf(elf.Elf32_Ehdr), .p64 => @sizeOf(elf.Elf64_Ehdr), }; mem.writeInt(u16, hdr_buf[index..][0..2], e_ehsize, endian); index += 2; const e_phentsize: u16 = switch (self.ptr_width) { .p32 => @sizeOf(elf.Elf32_Phdr), .p64 => @sizeOf(elf.Elf64_Phdr), }; mem.writeInt(u16, hdr_buf[index..][0..2], e_phentsize, endian); index += 2; const e_phnum = @intCast(u16, self.program_headers.items.len); mem.writeInt(u16, hdr_buf[index..][0..2], e_phnum, endian); index += 2; const e_shentsize: u16 = switch (self.ptr_width) { .p32 => @sizeOf(elf.Elf32_Shdr), .p64 => @sizeOf(elf.Elf64_Shdr), }; mem.writeInt(u16, hdr_buf[index..][0..2], e_shentsize, endian); index += 2; const e_shnum = @intCast(u16, self.sections.items.len); mem.writeInt(u16, hdr_buf[index..][0..2], e_shnum, endian); index += 2; mem.writeInt(u16, hdr_buf[index..][0..2], self.shstrtab_index.?, endian); index += 2; assert(index == e_ehsize); try self.base.file.?.pwriteAll(hdr_buf[0..index], 0); } fn freeTextBlock(self: *Elf, text_block: *TextBlock) void { var already_have_free_list_node = false; { var i: usize = 0; // TODO turn text_block_free_list into a hash map while (i < self.text_block_free_list.items.len) { if (self.text_block_free_list.items[i] == text_block) { _ = self.text_block_free_list.swapRemove(i); continue; } if (self.text_block_free_list.items[i] == text_block.prev) { already_have_free_list_node = true; } i += 1; } } // TODO process free list for dbg info just like we do above for vaddrs if (self.last_text_block == text_block) { // TODO shrink the .text section size here self.last_text_block = text_block.prev; } if (self.dbg_info_decl_first == text_block) { self.dbg_info_decl_first = text_block.dbg_info_next; } if (self.dbg_info_decl_last == text_block) { // TODO shrink the .debug_info section size here self.dbg_info_decl_last = text_block.dbg_info_prev; } if (text_block.prev) |prev| { prev.next = text_block.next; if (!already_have_free_list_node and prev.freeListEligible(self.*)) { // The free list is heuristics, it doesn't have to be perfect, so we can // ignore the OOM here. self.text_block_free_list.append(self.base.allocator, prev) catch {}; } } else { text_block.prev = null; } if (text_block.next) |next| { next.prev = text_block.prev; } else { text_block.next = null; } if (text_block.dbg_info_prev) |prev| { prev.dbg_info_next = text_block.dbg_info_next; // TODO the free list logic like we do for text blocks above } else { text_block.dbg_info_prev = null; } if (text_block.dbg_info_next) |next| { next.dbg_info_prev = text_block.dbg_info_prev; } else { text_block.dbg_info_next = null; } } fn shrinkTextBlock(self: *Elf, text_block: *TextBlock, new_block_size: u64) void { // TODO check the new capacity, and if it crosses the size threshold into a big enough // capacity, insert a free list node for it. } fn growTextBlock(self: *Elf, text_block: *TextBlock, new_block_size: u64, alignment: u64) !u64 { const sym = self.local_symbols.items[text_block.local_sym_index]; const align_ok = mem.alignBackwardGeneric(u64, sym.st_value, alignment) == sym.st_value; const need_realloc = !align_ok or new_block_size > text_block.capacity(self.*); if (!need_realloc) return sym.st_value; return self.allocateTextBlock(text_block, new_block_size, alignment); } fn allocateTextBlock(self: *Elf, text_block: *TextBlock, new_block_size: u64, alignment: u64) !u64 { const phdr = &self.program_headers.items[self.phdr_load_re_index.?]; const shdr = &self.sections.items[self.text_section_index.?]; const new_block_ideal_capacity = new_block_size * alloc_num / alloc_den; // We use these to indicate our intention to update metadata, placing the new block, // and possibly removing a free list node. // It would be simpler to do it inside the for loop below, but that would cause a // problem if an error was returned later in the function. So this action // is actually carried out at the end of the function, when errors are no longer possible. var block_placement: ?*TextBlock = null; var free_list_removal: ?usize = null; // First we look for an appropriately sized free list node. // The list is unordered. We'll just take the first thing that works. const vaddr = blk: { var i: usize = 0; while (i < self.text_block_free_list.items.len) { const big_block = self.text_block_free_list.items[i]; // We now have a pointer to a live text block that has too much capacity. // Is it enough that we could fit this new text block? const sym = self.local_symbols.items[big_block.local_sym_index]; const capacity = big_block.capacity(self.*); const ideal_capacity = capacity * alloc_num / alloc_den; const ideal_capacity_end_vaddr = sym.st_value + ideal_capacity; const capacity_end_vaddr = sym.st_value + capacity; const new_start_vaddr_unaligned = capacity_end_vaddr - new_block_ideal_capacity; const new_start_vaddr = mem.alignBackwardGeneric(u64, new_start_vaddr_unaligned, alignment); if (new_start_vaddr < ideal_capacity_end_vaddr) { // Additional bookkeeping here to notice if this free list node // should be deleted because the block that it points to has grown to take up // more of the extra capacity. if (!big_block.freeListEligible(self.*)) { _ = self.text_block_free_list.swapRemove(i); } else { i += 1; } continue; } // At this point we know that we will place the new block here. But the // remaining question is whether there is still yet enough capacity left // over for there to still be a free list node. const remaining_capacity = new_start_vaddr - ideal_capacity_end_vaddr; const keep_free_list_node = remaining_capacity >= min_text_capacity; // Set up the metadata to be updated, after errors are no longer possible. block_placement = big_block; if (!keep_free_list_node) { free_list_removal = i; } break :blk new_start_vaddr; } else if (self.last_text_block) |last| { const sym = self.local_symbols.items[last.local_sym_index]; const ideal_capacity = sym.st_size * alloc_num / alloc_den; const ideal_capacity_end_vaddr = sym.st_value + ideal_capacity; const new_start_vaddr = mem.alignForwardGeneric(u64, ideal_capacity_end_vaddr, alignment); // Set up the metadata to be updated, after errors are no longer possible. block_placement = last; break :blk new_start_vaddr; } else { break :blk phdr.p_vaddr; } }; const expand_text_section = block_placement == null or block_placement.?.next == null; if (expand_text_section) { const text_capacity = self.allocatedSize(shdr.sh_offset); const needed_size = (vaddr + new_block_size) - phdr.p_vaddr; if (needed_size > text_capacity) { // Must move the entire text section. const new_offset = self.findFreeSpace(needed_size, 0x1000); const text_size = if (self.last_text_block) |last| blk: { const sym = self.local_symbols.items[last.local_sym_index]; break :blk (sym.st_value + sym.st_size) - phdr.p_vaddr; } else 0; const amt = try self.base.file.?.copyRangeAll(shdr.sh_offset, self.base.file.?, new_offset, text_size); if (amt != text_size) return error.InputOutput; shdr.sh_offset = new_offset; phdr.p_offset = new_offset; } self.last_text_block = text_block; shdr.sh_size = needed_size; phdr.p_memsz = needed_size; phdr.p_filesz = needed_size; // The .debug_info section has `low_pc` and `high_pc` values which is the virtual address // range of the compilation unit. When we expand the text section, this range changes, // so the DW_TAG_compile_unit tag of the .debug_info section becomes dirty. self.debug_info_header_dirty = true; // This becomes dirty for the same reason. We could potentially make this more // fine-grained with the addition of support for more compilation units. It is planned to // model each package as a different compilation unit. self.debug_aranges_section_dirty = true; self.phdr_table_dirty = true; // TODO look into making only the one program header dirty self.shdr_table_dirty = true; // TODO look into making only the one section dirty } // This function can also reallocate a text block. // In this case we need to "unplug" it from its previous location before // plugging it in to its new location. if (text_block.prev) |prev| { prev.next = text_block.next; } if (text_block.next) |next| { next.prev = text_block.prev; } if (block_placement) |big_block| { text_block.prev = big_block; text_block.next = big_block.next; big_block.next = text_block; } else { text_block.prev = null; text_block.next = null; } if (free_list_removal) |i| { _ = self.text_block_free_list.swapRemove(i); } return vaddr; } pub fn allocateDeclIndexes(self: *Elf, decl: *Module.Decl) !void { if (decl.link.elf.local_sym_index != 0) return; try self.local_symbols.ensureCapacity(self.base.allocator, self.local_symbols.items.len + 1); try self.offset_table.ensureCapacity(self.base.allocator, self.offset_table.items.len + 1); if (self.local_symbol_free_list.popOrNull()) |i| { log.debug("reusing symbol index {} for {}\n", .{ i, decl.name }); decl.link.elf.local_sym_index = i; } else { log.debug("allocating symbol index {} for {}\n", .{ self.local_symbols.items.len, decl.name }); decl.link.elf.local_sym_index = @intCast(u32, self.local_symbols.items.len); _ = self.local_symbols.addOneAssumeCapacity(); } if (self.offset_table_free_list.popOrNull()) |i| { decl.link.elf.offset_table_index = i; } else { decl.link.elf.offset_table_index = @intCast(u32, self.offset_table.items.len); _ = self.offset_table.addOneAssumeCapacity(); self.offset_table_count_dirty = true; } const phdr = &self.program_headers.items[self.phdr_load_re_index.?]; self.local_symbols.items[decl.link.elf.local_sym_index] = .{ .st_name = 0, .st_info = 0, .st_other = 0, .st_shndx = 0, .st_value = phdr.p_vaddr, .st_size = 0, }; self.offset_table.items[decl.link.elf.offset_table_index] = 0; } pub fn freeDecl(self: *Elf, decl: *Module.Decl) void { // Appending to free lists is allowed to fail because the free lists are heuristics based anyway. self.freeTextBlock(&decl.link.elf); if (decl.link.elf.local_sym_index != 0) { self.local_symbol_free_list.append(self.base.allocator, decl.link.elf.local_sym_index) catch {}; self.offset_table_free_list.append(self.base.allocator, decl.link.elf.offset_table_index) catch {}; self.local_symbols.items[decl.link.elf.local_sym_index].st_info = 0; decl.link.elf.local_sym_index = 0; } // TODO make this logic match freeTextBlock. Maybe abstract the logic out since the same thing // is desired for both. _ = self.dbg_line_fn_free_list.remove(&decl.fn_link.elf); if (decl.fn_link.elf.prev) |prev| { _ = self.dbg_line_fn_free_list.put(self.base.allocator, prev, {}) catch {}; prev.next = decl.fn_link.elf.next; if (decl.fn_link.elf.next) |next| { next.prev = prev; } else { self.dbg_line_fn_last = prev; } } else if (decl.fn_link.elf.next) |next| { self.dbg_line_fn_first = next; next.prev = null; } if (self.dbg_line_fn_first == &decl.fn_link.elf) { self.dbg_line_fn_first = decl.fn_link.elf.next; } if (self.dbg_line_fn_last == &decl.fn_link.elf) { self.dbg_line_fn_last = decl.fn_link.elf.prev; } } pub fn updateDecl(self: *Elf, module: *Module, decl: *Module.Decl) !void { const tracy = trace(@src()); defer tracy.end(); var code_buffer = std.ArrayList(u8).init(self.base.allocator); defer code_buffer.deinit(); var dbg_line_buffer = std.ArrayList(u8).init(self.base.allocator); defer dbg_line_buffer.deinit(); var dbg_info_buffer = std.ArrayList(u8).init(self.base.allocator); defer dbg_info_buffer.deinit(); var dbg_info_type_relocs: File.DbgInfoTypeRelocsTable = .{}; defer { var it = dbg_info_type_relocs.iterator(); while (it.next()) |entry| { entry.value.relocs.deinit(self.base.allocator); } dbg_info_type_relocs.deinit(self.base.allocator); } const typed_value = decl.typed_value.most_recent.typed_value; const is_fn: bool = switch (typed_value.ty.zigTypeTag()) { .Fn => true, else => false, }; if (is_fn) { const zir_dumps = if (std.builtin.is_test) &[0][]const u8{} else build_options.zir_dumps; if (zir_dumps.len != 0) { for (zir_dumps) |fn_name| { if (mem.eql(u8, mem.spanZ(decl.name), fn_name)) { std.debug.print("\n{}\n", .{decl.name}); typed_value.val.cast(Value.Payload.Function).?.func.dump(module.*); } } } // For functions we need to add a prologue to the debug line program. try dbg_line_buffer.ensureCapacity(26); const line_off: u28 = blk: { if (decl.scope.cast(Module.Scope.Container)) |container_scope| { const tree = container_scope.file_scope.contents.tree; const file_ast_decls = tree.root_node.decls(); // TODO Look into improving the performance here by adding a token-index-to-line // lookup table. Currently this involves scanning over the source code for newlines. const fn_proto = file_ast_decls[decl.src_index].castTag(.FnProto).?; const block = fn_proto.getBodyNode().?.castTag(.Block).?; const line_delta = std.zig.lineDelta(tree.source, 0, tree.token_locs[block.lbrace].start); break :blk @intCast(u28, line_delta); } else if (decl.scope.cast(Module.Scope.ZIRModule)) |zir_module| { const byte_off = zir_module.contents.module.decls[decl.src_index].inst.src; const line_delta = std.zig.lineDelta(zir_module.source.bytes, 0, byte_off); break :blk @intCast(u28, line_delta); } else { unreachable; } }; const ptr_width_bytes = self.ptrWidthBytes(); dbg_line_buffer.appendSliceAssumeCapacity(&[_]u8{ DW.LNS_extended_op, ptr_width_bytes + 1, DW.LNE_set_address, }); // This is the "relocatable" vaddr, corresponding to `code_buffer` index `0`. assert(dbg_line_vaddr_reloc_index == dbg_line_buffer.items.len); dbg_line_buffer.items.len += ptr_width_bytes; dbg_line_buffer.appendAssumeCapacity(DW.LNS_advance_line); // This is the "relocatable" relative line offset from the previous function's end curly // to this function's begin curly. assert(self.getRelocDbgLineOff() == dbg_line_buffer.items.len); // Here we use a ULEB128-fixed-4 to make sure this field can be overwritten later. leb128.writeUnsignedFixed(4, dbg_line_buffer.addManyAsArrayAssumeCapacity(4), line_off); dbg_line_buffer.appendAssumeCapacity(DW.LNS_set_file); assert(self.getRelocDbgFileIndex() == dbg_line_buffer.items.len); // Once we support more than one source file, this will have the ability to be more // than one possible value. const file_index = 1; leb128.writeUnsignedFixed(4, dbg_line_buffer.addManyAsArrayAssumeCapacity(4), file_index); // Emit a line for the begin curly with prologue_end=false. The codegen will // do the work of setting prologue_end=true and epilogue_begin=true. dbg_line_buffer.appendAssumeCapacity(DW.LNS_copy); // .debug_info subprogram const decl_name_with_null = decl.name[0 .. mem.lenZ(decl.name) + 1]; try dbg_info_buffer.ensureCapacity(dbg_info_buffer.items.len + 25 + decl_name_with_null.len); const fn_ret_type = typed_value.ty.fnReturnType(); const fn_ret_has_bits = fn_ret_type.hasCodeGenBits(); if (fn_ret_has_bits) { dbg_info_buffer.appendAssumeCapacity(abbrev_subprogram); } else { dbg_info_buffer.appendAssumeCapacity(abbrev_subprogram_retvoid); } // These get overwritten after generating the machine code. These values are // "relocations" and have to be in this fixed place so that functions can be // moved in virtual address space. assert(dbg_info_low_pc_reloc_index == dbg_info_buffer.items.len); dbg_info_buffer.items.len += ptr_width_bytes; // DW.AT_low_pc, DW.FORM_addr assert(self.getRelocDbgInfoSubprogramHighPC() == dbg_info_buffer.items.len); dbg_info_buffer.items.len += 4; // DW.AT_high_pc, DW.FORM_data4 if (fn_ret_has_bits) { const gop = try dbg_info_type_relocs.getOrPut(self.base.allocator, fn_ret_type); if (!gop.found_existing) { gop.entry.value = .{ .off = undefined, .relocs = .{}, }; } try gop.entry.value.relocs.append(self.base.allocator, @intCast(u32, dbg_info_buffer.items.len)); dbg_info_buffer.items.len += 4; // DW.AT_type, DW.FORM_ref4 } dbg_info_buffer.appendSliceAssumeCapacity(decl_name_with_null); // DW.AT_name, DW.FORM_string } else { // TODO implement .debug_info for global variables } const res = try codegen.generateSymbol(&self.base, decl.src(), typed_value, &code_buffer, .{ .dwarf = .{ .dbg_line = &dbg_line_buffer, .dbg_info = &dbg_info_buffer, .dbg_info_type_relocs = &dbg_info_type_relocs, }, }); const code = switch (res) { .externally_managed => |x| x, .appended => code_buffer.items, .fail => |em| { decl.analysis = .codegen_failure; try module.failed_decls.put(module.gpa, decl, em); return; }, }; const required_alignment = typed_value.ty.abiAlignment(self.base.options.target); const stt_bits: u8 = if (is_fn) elf.STT_FUNC else elf.STT_OBJECT; assert(decl.link.elf.local_sym_index != 0); // Caller forgot to allocateDeclIndexes() const local_sym = &self.local_symbols.items[decl.link.elf.local_sym_index]; if (local_sym.st_size != 0) { const capacity = decl.link.elf.capacity(self.*); const need_realloc = code.len > capacity or !mem.isAlignedGeneric(u64, local_sym.st_value, required_alignment); if (need_realloc) { const vaddr = try self.growTextBlock(&decl.link.elf, code.len, required_alignment); log.debug("growing {} from 0x{x} to 0x{x}\n", .{ decl.name, local_sym.st_value, vaddr }); if (vaddr != local_sym.st_value) { local_sym.st_value = vaddr; log.debug(" (writing new offset table entry)\n", .{}); self.offset_table.items[decl.link.elf.offset_table_index] = vaddr; try self.writeOffsetTableEntry(decl.link.elf.offset_table_index); } } else if (code.len < local_sym.st_size) { self.shrinkTextBlock(&decl.link.elf, code.len); } local_sym.st_size = code.len; local_sym.st_name = try self.updateString(local_sym.st_name, mem.spanZ(decl.name)); local_sym.st_info = (elf.STB_LOCAL << 4) | stt_bits; local_sym.st_other = 0; local_sym.st_shndx = self.text_section_index.?; // TODO this write could be avoided if no fields of the symbol were changed. try self.writeSymbol(decl.link.elf.local_sym_index); } else { const decl_name = mem.spanZ(decl.name); const name_str_index = try self.makeString(decl_name); const vaddr = try self.allocateTextBlock(&decl.link.elf, code.len, required_alignment); log.debug("allocated text block for {} at 0x{x}\n", .{ decl_name, vaddr }); errdefer self.freeTextBlock(&decl.link.elf); local_sym.* = .{ .st_name = name_str_index, .st_info = (elf.STB_LOCAL << 4) | stt_bits, .st_other = 0, .st_shndx = self.text_section_index.?, .st_value = vaddr, .st_size = code.len, }; self.offset_table.items[decl.link.elf.offset_table_index] = vaddr; try self.writeSymbol(decl.link.elf.local_sym_index); try self.writeOffsetTableEntry(decl.link.elf.offset_table_index); } const section_offset = local_sym.st_value - self.program_headers.items[self.phdr_load_re_index.?].p_vaddr; const file_offset = self.sections.items[self.text_section_index.?].sh_offset + section_offset; try self.base.file.?.pwriteAll(code, file_offset); const target_endian = self.base.options.target.cpu.arch.endian(); const text_block = &decl.link.elf; // If the Decl is a function, we need to update the .debug_line program. if (is_fn) { // Perform the relocations based on vaddr. switch (self.ptr_width) { .p32 => { { const ptr = dbg_line_buffer.items[dbg_line_vaddr_reloc_index..][0..4]; mem.writeInt(u32, ptr, @intCast(u32, local_sym.st_value), target_endian); } { const ptr = dbg_info_buffer.items[dbg_info_low_pc_reloc_index..][0..4]; mem.writeInt(u32, ptr, @intCast(u32, local_sym.st_value), target_endian); } }, .p64 => { { const ptr = dbg_line_buffer.items[dbg_line_vaddr_reloc_index..][0..8]; mem.writeInt(u64, ptr, local_sym.st_value, target_endian); } { const ptr = dbg_info_buffer.items[dbg_info_low_pc_reloc_index..][0..8]; mem.writeInt(u64, ptr, local_sym.st_value, target_endian); } }, } { const ptr = dbg_info_buffer.items[self.getRelocDbgInfoSubprogramHighPC()..][0..4]; mem.writeInt(u32, ptr, @intCast(u32, local_sym.st_size), target_endian); } try dbg_line_buffer.appendSlice(&[_]u8{ DW.LNS_extended_op, 1, DW.LNE_end_sequence }); // Now we have the full contents and may allocate a region to store it. // This logic is nearly identical to the logic below in `updateDeclDebugInfo` for // `TextBlock` and the .debug_info. If you are editing this logic, you // probably need to edit that logic too. const debug_line_sect = &self.sections.items[self.debug_line_section_index.?]; const src_fn = &decl.fn_link.elf; src_fn.len = @intCast(u32, dbg_line_buffer.items.len); if (self.dbg_line_fn_last) |last| { if (src_fn.next) |next| { // Update existing function - non-last item. if (src_fn.off + src_fn.len + min_nop_size > next.off) { // It grew too big, so we move it to a new location. if (src_fn.prev) |prev| { _ = self.dbg_line_fn_free_list.put(self.base.allocator, prev, {}) catch {}; prev.next = src_fn.next; } next.prev = src_fn.prev; src_fn.next = null; // Populate where it used to be with NOPs. const file_pos = debug_line_sect.sh_offset + src_fn.off; try self.pwriteDbgLineNops(0, &[0]u8{}, src_fn.len, file_pos); // TODO Look at the free list before appending at the end. src_fn.prev = last; last.next = src_fn; self.dbg_line_fn_last = src_fn; src_fn.off = last.off + (last.len * alloc_num / alloc_den); } } else if (src_fn.prev == null) { // Append new function. // TODO Look at the free list before appending at the end. src_fn.prev = last; last.next = src_fn; self.dbg_line_fn_last = src_fn; src_fn.off = last.off + (last.len * alloc_num / alloc_den); } } else { // This is the first function of the Line Number Program. self.dbg_line_fn_first = src_fn; self.dbg_line_fn_last = src_fn; src_fn.off = self.dbgLineNeededHeaderBytes() * alloc_num / alloc_den; } const last_src_fn = self.dbg_line_fn_last.?; const needed_size = last_src_fn.off + last_src_fn.len; if (needed_size != debug_line_sect.sh_size) { if (needed_size > self.allocatedSize(debug_line_sect.sh_offset)) { const new_offset = self.findFreeSpace(needed_size, 1); const existing_size = last_src_fn.off; log.debug("moving .debug_line section: {} bytes from 0x{x} to 0x{x}\n", .{ existing_size, debug_line_sect.sh_offset, new_offset, }); const amt = try self.base.file.?.copyRangeAll(debug_line_sect.sh_offset, self.base.file.?, new_offset, existing_size); if (amt != existing_size) return error.InputOutput; debug_line_sect.sh_offset = new_offset; } debug_line_sect.sh_size = needed_size; self.shdr_table_dirty = true; // TODO look into making only the one section dirty self.debug_line_header_dirty = true; } const prev_padding_size: u32 = if (src_fn.prev) |prev| src_fn.off - (prev.off + prev.len) else 0; const next_padding_size: u32 = if (src_fn.next) |next| next.off - (src_fn.off + src_fn.len) else 0; // We only have support for one compilation unit so far, so the offsets are directly // from the .debug_line section. const file_pos = debug_line_sect.sh_offset + src_fn.off; try self.pwriteDbgLineNops(prev_padding_size, dbg_line_buffer.items, next_padding_size, file_pos); // .debug_info - End the TAG_subprogram children. try dbg_info_buffer.append(0); } // Now we emit the .debug_info types of the Decl. These will count towards the size of // the buffer, so we have to do it before computing the offset, and we can't perform the actual // relocations yet. var it = dbg_info_type_relocs.iterator(); while (it.next()) |entry| { entry.value.off = @intCast(u32, dbg_info_buffer.items.len); try self.addDbgInfoType(entry.key, &dbg_info_buffer); } try self.updateDeclDebugInfoAllocation(text_block, @intCast(u32, dbg_info_buffer.items.len)); // Now that we have the offset assigned we can finally perform type relocations. it = dbg_info_type_relocs.iterator(); while (it.next()) |entry| { for (entry.value.relocs.items) |off| { mem.writeInt( u32, dbg_info_buffer.items[off..][0..4], text_block.dbg_info_off + entry.value.off, target_endian, ); } } try self.writeDeclDebugInfo(text_block, dbg_info_buffer.items); // Since we updated the vaddr and the size, each corresponding export symbol also needs to be updated. const decl_exports = module.decl_exports.get(decl) orelse &[0]*Module.Export{}; return self.updateDeclExports(module, decl, decl_exports); } /// Asserts the type has codegen bits. fn addDbgInfoType(self: *Elf, ty: Type, dbg_info_buffer: *std.ArrayList(u8)) !void { switch (ty.zigTypeTag()) { .Void => unreachable, .NoReturn => unreachable, .Bool => { try dbg_info_buffer.appendSlice(&[_]u8{ abbrev_base_type, DW.ATE_boolean, // DW.AT_encoding , DW.FORM_data1 1, // DW.AT_byte_size, DW.FORM_data1 'b', 'o', 'o', 'l', 0, // DW.AT_name, DW.FORM_string }); }, .Int => { const info = ty.intInfo(self.base.options.target); try dbg_info_buffer.ensureCapacity(dbg_info_buffer.items.len + 12); dbg_info_buffer.appendAssumeCapacity(abbrev_base_type); // DW.AT_encoding, DW.FORM_data1 dbg_info_buffer.appendAssumeCapacity(switch (info.signedness) { .signed => DW.ATE_signed, .unsigned => DW.ATE_unsigned, }); // DW.AT_byte_size, DW.FORM_data1 dbg_info_buffer.appendAssumeCapacity(@intCast(u8, ty.abiSize(self.base.options.target))); // DW.AT_name, DW.FORM_string try dbg_info_buffer.writer().print("{}\x00", .{ty}); }, else => { std.log.scoped(.compiler).err("TODO implement .debug_info for type '{}'", .{ty}); try dbg_info_buffer.append(abbrev_pad1); }, } } fn updateDeclDebugInfoAllocation(self: *Elf, text_block: *TextBlock, len: u32) !void { const tracy = trace(@src()); defer tracy.end(); // This logic is nearly identical to the logic above in `updateDecl` for // `SrcFn` and the line number programs. If you are editing this logic, you // probably need to edit that logic too. const debug_info_sect = &self.sections.items[self.debug_info_section_index.?]; text_block.dbg_info_len = len; if (self.dbg_info_decl_last) |last| { if (text_block.dbg_info_next) |next| { // Update existing Decl - non-last item. if (text_block.dbg_info_off + text_block.dbg_info_len + min_nop_size > next.dbg_info_off) { // It grew too big, so we move it to a new location. if (text_block.dbg_info_prev) |prev| { _ = self.dbg_info_decl_free_list.put(self.base.allocator, prev, {}) catch {}; prev.dbg_info_next = text_block.dbg_info_next; } next.dbg_info_prev = text_block.dbg_info_prev; text_block.dbg_info_next = null; // Populate where it used to be with NOPs. const file_pos = debug_info_sect.sh_offset + text_block.dbg_info_off; try self.pwriteDbgInfoNops(0, &[0]u8{}, text_block.dbg_info_len, false, file_pos); // TODO Look at the free list before appending at the end. text_block.dbg_info_prev = last; last.dbg_info_next = text_block; self.dbg_info_decl_last = text_block; text_block.dbg_info_off = last.dbg_info_off + (last.dbg_info_len * alloc_num / alloc_den); } } else if (text_block.dbg_info_prev == null) { // Append new Decl. // TODO Look at the free list before appending at the end. text_block.dbg_info_prev = last; last.dbg_info_next = text_block; self.dbg_info_decl_last = text_block; text_block.dbg_info_off = last.dbg_info_off + (last.dbg_info_len * alloc_num / alloc_den); } } else { // This is the first Decl of the .debug_info self.dbg_info_decl_first = text_block; self.dbg_info_decl_last = text_block; text_block.dbg_info_off = self.dbgInfoNeededHeaderBytes() * alloc_num / alloc_den; } } fn writeDeclDebugInfo(self: *Elf, text_block: *TextBlock, dbg_info_buf: []const u8) !void { const tracy = trace(@src()); defer tracy.end(); // This logic is nearly identical to the logic above in `updateDecl` for // `SrcFn` and the line number programs. If you are editing this logic, you // probably need to edit that logic too. const debug_info_sect = &self.sections.items[self.debug_info_section_index.?]; const last_decl = self.dbg_info_decl_last.?; // +1 for a trailing zero to end the children of the decl tag. const needed_size = last_decl.dbg_info_off + last_decl.dbg_info_len + 1; if (needed_size != debug_info_sect.sh_size) { if (needed_size > self.allocatedSize(debug_info_sect.sh_offset)) { const new_offset = self.findFreeSpace(needed_size, 1); const existing_size = last_decl.dbg_info_off; log.debug("moving .debug_info section: {} bytes from 0x{x} to 0x{x}\n", .{ existing_size, debug_info_sect.sh_offset, new_offset, }); const amt = try self.base.file.?.copyRangeAll(debug_info_sect.sh_offset, self.base.file.?, new_offset, existing_size); if (amt != existing_size) return error.InputOutput; debug_info_sect.sh_offset = new_offset; } debug_info_sect.sh_size = needed_size; self.shdr_table_dirty = true; // TODO look into making only the one section dirty self.debug_info_header_dirty = true; } const prev_padding_size: u32 = if (text_block.dbg_info_prev) |prev| text_block.dbg_info_off - (prev.dbg_info_off + prev.dbg_info_len) else 0; const next_padding_size: u32 = if (text_block.dbg_info_next) |next| next.dbg_info_off - (text_block.dbg_info_off + text_block.dbg_info_len) else 0; // To end the children of the decl tag. const trailing_zero = text_block.dbg_info_next == null; // We only have support for one compilation unit so far, so the offsets are directly // from the .debug_info section. const file_pos = debug_info_sect.sh_offset + text_block.dbg_info_off; try self.pwriteDbgInfoNops(prev_padding_size, dbg_info_buf, next_padding_size, trailing_zero, file_pos); } pub fn updateDeclExports( self: *Elf, module: *Module, decl: *const Module.Decl, exports: []const *Module.Export, ) !void { const tracy = trace(@src()); defer tracy.end(); try self.global_symbols.ensureCapacity(self.base.allocator, self.global_symbols.items.len + exports.len); const typed_value = decl.typed_value.most_recent.typed_value; if (decl.link.elf.local_sym_index == 0) return; const decl_sym = self.local_symbols.items[decl.link.elf.local_sym_index]; for (exports) |exp| { if (exp.options.section) |section_name| { if (!mem.eql(u8, section_name, ".text")) { try module.failed_exports.ensureCapacity(module.gpa, module.failed_exports.items().len + 1); module.failed_exports.putAssumeCapacityNoClobber( exp, try Compilation.ErrorMsg.create(self.base.allocator, 0, "Unimplemented: ExportOptions.section", .{}), ); continue; } } const stb_bits: u8 = switch (exp.options.linkage) { .Internal => elf.STB_LOCAL, .Strong => blk: { if (mem.eql(u8, exp.options.name, "_start")) { self.entry_addr = decl_sym.st_value; } break :blk elf.STB_GLOBAL; }, .Weak => elf.STB_WEAK, .LinkOnce => { try module.failed_exports.ensureCapacity(module.gpa, module.failed_exports.items().len + 1); module.failed_exports.putAssumeCapacityNoClobber( exp, try Compilation.ErrorMsg.create(self.base.allocator, 0, "Unimplemented: GlobalLinkage.LinkOnce", .{}), ); continue; }, }; const stt_bits: u8 = @truncate(u4, decl_sym.st_info); if (exp.link.elf.sym_index) |i| { const sym = &self.global_symbols.items[i]; sym.* = .{ .st_name = try self.updateString(sym.st_name, exp.options.name), .st_info = (stb_bits << 4) | stt_bits, .st_other = 0, .st_shndx = self.text_section_index.?, .st_value = decl_sym.st_value, .st_size = decl_sym.st_size, }; } else { const name = try self.makeString(exp.options.name); const i = if (self.global_symbol_free_list.popOrNull()) |i| i else blk: { _ = self.global_symbols.addOneAssumeCapacity(); break :blk self.global_symbols.items.len - 1; }; self.global_symbols.items[i] = .{ .st_name = name, .st_info = (stb_bits << 4) | stt_bits, .st_other = 0, .st_shndx = self.text_section_index.?, .st_value = decl_sym.st_value, .st_size = decl_sym.st_size, }; exp.link.elf.sym_index = @intCast(u32, i); } } } /// Must be called only after a successful call to `updateDecl`. pub fn updateDeclLineNumber(self: *Elf, module: *Module, decl: *const Module.Decl) !void { const tracy = trace(@src()); defer tracy.end(); const container_scope = decl.scope.cast(Module.Scope.Container).?; const tree = container_scope.file_scope.contents.tree; const file_ast_decls = tree.root_node.decls(); // TODO Look into improving the performance here by adding a token-index-to-line // lookup table. Currently this involves scanning over the source code for newlines. const fn_proto = file_ast_decls[decl.src_index].castTag(.FnProto).?; const block = fn_proto.getBodyNode().?.castTag(.Block).?; const line_delta = std.zig.lineDelta(tree.source, 0, tree.token_locs[block.lbrace].start); const casted_line_off = @intCast(u28, line_delta); const shdr = &self.sections.items[self.debug_line_section_index.?]; const file_pos = shdr.sh_offset + decl.fn_link.elf.off + self.getRelocDbgLineOff(); var data: [4]u8 = undefined; leb128.writeUnsignedFixed(4, &data, casted_line_off); try self.base.file.?.pwriteAll(&data, file_pos); } pub fn deleteExport(self: *Elf, exp: Export) void { const sym_index = exp.sym_index orelse return; self.global_symbol_free_list.append(self.base.allocator, sym_index) catch {}; self.global_symbols.items[sym_index].st_info = 0; } fn writeProgHeader(self: *Elf, index: usize) !void { const foreign_endian = self.base.options.target.cpu.arch.endian() != std.Target.current.cpu.arch.endian(); const offset = self.program_headers.items[index].p_offset; switch (self.ptr_width) { .p32 => { var phdr = [1]elf.Elf32_Phdr{progHeaderTo32(self.program_headers.items[index])}; if (foreign_endian) { bswapAllFields(elf.Elf32_Phdr, &phdr[0]); } return self.base.file.?.pwriteAll(mem.sliceAsBytes(&phdr), offset); }, .p64 => { var phdr = [1]elf.Elf64_Phdr{self.program_headers.items[index]}; if (foreign_endian) { bswapAllFields(elf.Elf64_Phdr, &phdr[0]); } return self.base.file.?.pwriteAll(mem.sliceAsBytes(&phdr), offset); }, } } fn writeSectHeader(self: *Elf, index: usize) !void { const foreign_endian = self.base.options.target.cpu.arch.endian() != std.Target.current.cpu.arch.endian(); switch (self.ptr_width) { .p32 => { var shdr: [1]elf.Elf32_Shdr = undefined; shdr[0] = sectHeaderTo32(self.sections.items[index]); if (foreign_endian) { bswapAllFields(elf.Elf32_Shdr, &shdr[0]); } const offset = self.shdr_table_offset.? + index * @sizeOf(elf.Elf32_Shdr); return self.base.file.?.pwriteAll(mem.sliceAsBytes(&shdr), offset); }, .p64 => { var shdr = [1]elf.Elf64_Shdr{self.sections.items[index]}; if (foreign_endian) { bswapAllFields(elf.Elf64_Shdr, &shdr[0]); } const offset = self.shdr_table_offset.? + index * @sizeOf(elf.Elf64_Shdr); return self.base.file.?.pwriteAll(mem.sliceAsBytes(&shdr), offset); }, } } fn writeOffsetTableEntry(self: *Elf, index: usize) !void { const shdr = &self.sections.items[self.got_section_index.?]; const phdr = &self.program_headers.items[self.phdr_got_index.?]; const entry_size: u16 = self.archPtrWidthBytes(); if (self.offset_table_count_dirty) { // TODO Also detect virtual address collisions. const allocated_size = self.allocatedSize(shdr.sh_offset); const needed_size = self.offset_table.items.len * entry_size; if (needed_size > allocated_size) { // Must move the entire got section. const new_offset = self.findFreeSpace(needed_size, entry_size); const amt = try self.base.file.?.copyRangeAll(shdr.sh_offset, self.base.file.?, new_offset, shdr.sh_size); if (amt != shdr.sh_size) return error.InputOutput; shdr.sh_offset = new_offset; phdr.p_offset = new_offset; } shdr.sh_size = needed_size; phdr.p_memsz = needed_size; phdr.p_filesz = needed_size; self.shdr_table_dirty = true; // TODO look into making only the one section dirty self.phdr_table_dirty = true; // TODO look into making only the one program header dirty self.offset_table_count_dirty = false; } const endian = self.base.options.target.cpu.arch.endian(); const off = shdr.sh_offset + @as(u64, entry_size) * index; switch (entry_size) { 2 => { var buf: [2]u8 = undefined; mem.writeInt(u16, &buf, @intCast(u16, self.offset_table.items[index]), endian); try self.base.file.?.pwriteAll(&buf, off); }, 4 => { var buf: [4]u8 = undefined; mem.writeInt(u32, &buf, @intCast(u32, self.offset_table.items[index]), endian); try self.base.file.?.pwriteAll(&buf, off); }, 8 => { var buf: [8]u8 = undefined; mem.writeInt(u64, &buf, self.offset_table.items[index], endian); try self.base.file.?.pwriteAll(&buf, off); }, else => unreachable, } } fn writeSymbol(self: *Elf, index: usize) !void { const tracy = trace(@src()); defer tracy.end(); const syms_sect = &self.sections.items[self.symtab_section_index.?]; // Make sure we are not pointlessly writing symbol data that will have to get relocated // due to running out of space. if (self.local_symbols.items.len != syms_sect.sh_info) { const sym_size: u64 = switch (self.ptr_width) { .p32 => @sizeOf(elf.Elf32_Sym), .p64 => @sizeOf(elf.Elf64_Sym), }; const sym_align: u16 = switch (self.ptr_width) { .p32 => @alignOf(elf.Elf32_Sym), .p64 => @alignOf(elf.Elf64_Sym), }; const needed_size = (self.local_symbols.items.len + self.global_symbols.items.len) * sym_size; if (needed_size > self.allocatedSize(syms_sect.sh_offset)) { // Move all the symbols to a new file location. const new_offset = self.findFreeSpace(needed_size, sym_align); const existing_size = @as(u64, syms_sect.sh_info) * sym_size; const amt = try self.base.file.?.copyRangeAll(syms_sect.sh_offset, self.base.file.?, new_offset, existing_size); if (amt != existing_size) return error.InputOutput; syms_sect.sh_offset = new_offset; } syms_sect.sh_info = @intCast(u32, self.local_symbols.items.len); syms_sect.sh_size = needed_size; // anticipating adding the global symbols later self.shdr_table_dirty = true; // TODO look into only writing one section } const foreign_endian = self.base.options.target.cpu.arch.endian() != std.Target.current.cpu.arch.endian(); switch (self.ptr_width) { .p32 => { var sym = [1]elf.Elf32_Sym{ .{ .st_name = self.local_symbols.items[index].st_name, .st_value = @intCast(u32, self.local_symbols.items[index].st_value), .st_size = @intCast(u32, self.local_symbols.items[index].st_size), .st_info = self.local_symbols.items[index].st_info, .st_other = self.local_symbols.items[index].st_other, .st_shndx = self.local_symbols.items[index].st_shndx, }, }; if (foreign_endian) { bswapAllFields(elf.Elf32_Sym, &sym[0]); } const off = syms_sect.sh_offset + @sizeOf(elf.Elf32_Sym) * index; try self.base.file.?.pwriteAll(mem.sliceAsBytes(sym[0..1]), off); }, .p64 => { var sym = [1]elf.Elf64_Sym{self.local_symbols.items[index]}; if (foreign_endian) { bswapAllFields(elf.Elf64_Sym, &sym[0]); } const off = syms_sect.sh_offset + @sizeOf(elf.Elf64_Sym) * index; try self.base.file.?.pwriteAll(mem.sliceAsBytes(sym[0..1]), off); }, } } fn writeAllGlobalSymbols(self: *Elf) !void { const syms_sect = &self.sections.items[self.symtab_section_index.?]; const sym_size: u64 = switch (self.ptr_width) { .p32 => @sizeOf(elf.Elf32_Sym), .p64 => @sizeOf(elf.Elf64_Sym), }; const foreign_endian = self.base.options.target.cpu.arch.endian() != std.Target.current.cpu.arch.endian(); const global_syms_off = syms_sect.sh_offset + self.local_symbols.items.len * sym_size; switch (self.ptr_width) { .p32 => { const buf = try self.base.allocator.alloc(elf.Elf32_Sym, self.global_symbols.items.len); defer self.base.allocator.free(buf); for (buf) |*sym, i| { sym.* = .{ .st_name = self.global_symbols.items[i].st_name, .st_value = @intCast(u32, self.global_symbols.items[i].st_value), .st_size = @intCast(u32, self.global_symbols.items[i].st_size), .st_info = self.global_symbols.items[i].st_info, .st_other = self.global_symbols.items[i].st_other, .st_shndx = self.global_symbols.items[i].st_shndx, }; if (foreign_endian) { bswapAllFields(elf.Elf32_Sym, sym); } } try self.base.file.?.pwriteAll(mem.sliceAsBytes(buf), global_syms_off); }, .p64 => { const buf = try self.base.allocator.alloc(elf.Elf64_Sym, self.global_symbols.items.len); defer self.base.allocator.free(buf); for (buf) |*sym, i| { sym.* = .{ .st_name = self.global_symbols.items[i].st_name, .st_value = self.global_symbols.items[i].st_value, .st_size = self.global_symbols.items[i].st_size, .st_info = self.global_symbols.items[i].st_info, .st_other = self.global_symbols.items[i].st_other, .st_shndx = self.global_symbols.items[i].st_shndx, }; if (foreign_endian) { bswapAllFields(elf.Elf64_Sym, sym); } } try self.base.file.?.pwriteAll(mem.sliceAsBytes(buf), global_syms_off); }, } } /// Always 4 or 8 depending on whether this is 32-bit ELF or 64-bit ELF. fn ptrWidthBytes(self: Elf) u8 { return switch (self.ptr_width) { .p32 => 4, .p64 => 8, }; } /// Does not necessarily match `ptrWidthBytes` for example can be 2 bytes /// in a 32-bit ELF file. fn archPtrWidthBytes(self: Elf) u8 { return @intCast(u8, self.base.options.target.cpu.arch.ptrBitWidth() / 8); } /// The reloc offset for the virtual address of a function in its Line Number Program. /// Size is a virtual address integer. const dbg_line_vaddr_reloc_index = 3; /// The reloc offset for the virtual address of a function in its .debug_info TAG_subprogram. /// Size is a virtual address integer. const dbg_info_low_pc_reloc_index = 1; /// The reloc offset for the line offset of a function from the previous function's line. /// It's a fixed-size 4-byte ULEB128. fn getRelocDbgLineOff(self: Elf) usize { return dbg_line_vaddr_reloc_index + self.ptrWidthBytes() + 1; } fn getRelocDbgFileIndex(self: Elf) usize { return self.getRelocDbgLineOff() + 5; } fn getRelocDbgInfoSubprogramHighPC(self: Elf) u32 { return dbg_info_low_pc_reloc_index + self.ptrWidthBytes(); } fn dbgLineNeededHeaderBytes(self: Elf) u32 { const directory_entry_format_count = 1; const file_name_entry_format_count = 1; const directory_count = 1; const file_name_count = 1; const root_src_dir_path_len = if (self.base.options.module.?.root_pkg.root_src_directory.path) |p| p.len else 1; // "." return @intCast(u32, 53 + directory_entry_format_count * 2 + file_name_entry_format_count * 2 + directory_count * 8 + file_name_count * 8 + // These are encoded as DW.FORM_string rather than DW.FORM_strp as we would like // because of a workaround for readelf and gdb failing to understand DWARFv5 correctly. root_src_dir_path_len + self.base.options.module.?.root_pkg.root_src_path.len); } fn dbgInfoNeededHeaderBytes(self: Elf) u32 { return 120; } const min_nop_size = 2; /// Writes to the file a buffer, prefixed and suffixed by the specified number of /// bytes of NOPs. Asserts each padding size is at least `min_nop_size` and total padding bytes /// are less than 126,976 bytes (if this limit is ever reached, this function can be /// improved to make more than one pwritev call, or the limit can be raised by a fixed /// amount by increasing the length of `vecs`). fn pwriteDbgLineNops( self: *Elf, prev_padding_size: usize, buf: []const u8, next_padding_size: usize, offset: u64, ) !void { const tracy = trace(@src()); defer tracy.end(); const page_of_nops = [1]u8{DW.LNS_negate_stmt} ** 4096; const three_byte_nop = [3]u8{ DW.LNS_advance_pc, 0b1000_0000, 0 }; var vecs: [32]std.os.iovec_const = undefined; var vec_index: usize = 0; { var padding_left = prev_padding_size; if (padding_left % 2 != 0) { vecs[vec_index] = .{ .iov_base = &three_byte_nop, .iov_len = three_byte_nop.len, }; vec_index += 1; padding_left -= three_byte_nop.len; } while (padding_left > page_of_nops.len) { vecs[vec_index] = .{ .iov_base = &page_of_nops, .iov_len = page_of_nops.len, }; vec_index += 1; padding_left -= page_of_nops.len; } if (padding_left > 0) { vecs[vec_index] = .{ .iov_base = &page_of_nops, .iov_len = padding_left, }; vec_index += 1; } } vecs[vec_index] = .{ .iov_base = buf.ptr, .iov_len = buf.len, }; vec_index += 1; { var padding_left = next_padding_size; if (padding_left % 2 != 0) { vecs[vec_index] = .{ .iov_base = &three_byte_nop, .iov_len = three_byte_nop.len, }; vec_index += 1; padding_left -= three_byte_nop.len; } while (padding_left > page_of_nops.len) { vecs[vec_index] = .{ .iov_base = &page_of_nops, .iov_len = page_of_nops.len, }; vec_index += 1; padding_left -= page_of_nops.len; } if (padding_left > 0) { vecs[vec_index] = .{ .iov_base = &page_of_nops, .iov_len = padding_left, }; vec_index += 1; } } try self.base.file.?.pwritevAll(vecs[0..vec_index], offset - prev_padding_size); } /// Writes to the file a buffer, prefixed and suffixed by the specified number of /// bytes of padding. fn pwriteDbgInfoNops( self: *Elf, prev_padding_size: usize, buf: []const u8, next_padding_size: usize, trailing_zero: bool, offset: u64, ) !void { const tracy = trace(@src()); defer tracy.end(); const page_of_nops = [1]u8{abbrev_pad1} ** 4096; var vecs: [32]std.os.iovec_const = undefined; var vec_index: usize = 0; { var padding_left = prev_padding_size; while (padding_left > page_of_nops.len) { vecs[vec_index] = .{ .iov_base = &page_of_nops, .iov_len = page_of_nops.len, }; vec_index += 1; padding_left -= page_of_nops.len; } if (padding_left > 0) { vecs[vec_index] = .{ .iov_base = &page_of_nops, .iov_len = padding_left, }; vec_index += 1; } } vecs[vec_index] = .{ .iov_base = buf.ptr, .iov_len = buf.len, }; vec_index += 1; { var padding_left = next_padding_size; while (padding_left > page_of_nops.len) { vecs[vec_index] = .{ .iov_base = &page_of_nops, .iov_len = page_of_nops.len, }; vec_index += 1; padding_left -= page_of_nops.len; } if (padding_left > 0) { vecs[vec_index] = .{ .iov_base = &page_of_nops, .iov_len = padding_left, }; vec_index += 1; } } if (trailing_zero) { var zbuf = [1]u8{0}; vecs[vec_index] = .{ .iov_base = &zbuf, .iov_len = zbuf.len, }; vec_index += 1; } try self.base.file.?.pwritevAll(vecs[0..vec_index], offset - prev_padding_size); } /// Saturating multiplication fn satMul(a: anytype, b: anytype) @TypeOf(a, b) { const T = @TypeOf(a, b); return std.math.mul(T, a, b) catch std.math.maxInt(T); } fn bswapAllFields(comptime S: type, ptr: *S) void { @panic("TODO implement bswapAllFields"); } fn progHeaderTo32(phdr: elf.Elf64_Phdr) elf.Elf32_Phdr { return .{ .p_type = phdr.p_type, .p_flags = phdr.p_flags, .p_offset = @intCast(u32, phdr.p_offset), .p_vaddr = @intCast(u32, phdr.p_vaddr), .p_paddr = @intCast(u32, phdr.p_paddr), .p_filesz = @intCast(u32, phdr.p_filesz), .p_memsz = @intCast(u32, phdr.p_memsz), .p_align = @intCast(u32, phdr.p_align), }; } fn sectHeaderTo32(shdr: elf.Elf64_Shdr) elf.Elf32_Shdr { return .{ .sh_name = shdr.sh_name, .sh_type = shdr.sh_type, .sh_flags = @intCast(u32, shdr.sh_flags), .sh_addr = @intCast(u32, shdr.sh_addr), .sh_offset = @intCast(u32, shdr.sh_offset), .sh_size = @intCast(u32, shdr.sh_size), .sh_link = shdr.sh_link, .sh_info = shdr.sh_info, .sh_addralign = @intCast(u32, shdr.sh_addralign), .sh_entsize = @intCast(u32, shdr.sh_entsize), }; } fn getLDMOption(target: std.Target) ?[]const u8 { switch (target.cpu.arch) { .i386 => return "elf_i386", .aarch64 => return "aarch64linux", .aarch64_be => return "aarch64_be_linux", .arm, .thumb => return "armelf_linux_eabi", .armeb, .thumbeb => return "armebelf_linux_eabi", .powerpc => return "elf32ppclinux", .powerpc64 => return "elf64ppc", .powerpc64le => return "elf64lppc", .sparc, .sparcel => return "elf32_sparc", .sparcv9 => return "elf64_sparc", .mips => return "elf32btsmip", .mipsel => return "elf32ltsmip", .mips64 => return "elf64btsmip", .mips64el => return "elf64ltsmip", .s390x => return "elf64_s390", .x86_64 => { if (target.abi == .gnux32) { return "elf32_x86_64"; } else { return "elf_x86_64"; } }, .riscv32 => return "elf32lriscv", .riscv64 => return "elf64lriscv", else => return null, } }
src/link/Elf.zig
const std = @import("../std.zig"); const math = std.math; const expect = std.testing.expect; /// Returns the cube root of x. /// /// Special Cases: /// - cbrt(+-0) = +-0 /// - cbrt(+-inf) = +-inf /// - cbrt(nan) = nan pub fn cbrt(x: var) @typeOf(x) { const T = @typeOf(x); return switch (T) { f32 => cbrt32(x), f64 => cbrt64(x), else => @compileError("cbrt not implemented for " ++ @typeName(T)), }; } fn cbrt32(x: f32) f32 { const B1: u32 = 709958130; // (127 - 127.0 / 3 - 0.03306235651) * 2^23 const B2: u32 = 642849266; // (127 - 127.0 / 3 - 24 / 3 - 0.03306235651) * 2^23 var u = @bitCast(u32, x); var hx = u & 0x7FFFFFFF; // cbrt(nan, inf) = itself if (hx >= 0x7F800000) { return x + x; } // cbrt to ~5bits if (hx < 0x00800000) { // cbrt(+-0) = itself if (hx == 0) { return x; } u = @bitCast(u32, x * 0x1.0p24); hx = u & 0x7FFFFFFF; hx = hx / 3 + B2; } else { hx = hx / 3 + B1; } u &= 0x80000000; u |= hx; // first step newton to 16 bits var t: f64 = @bitCast(f32, u); var r: f64 = t * t * t; t = t * (@as(f64, x) + x + r) / (x + r + r); // second step newton to 47 bits r = t * t * t; t = t * (@as(f64, x) + x + r) / (x + r + r); return @floatCast(f32, t); } fn cbrt64(x: f64) f64 { const B1: u32 = 715094163; // (1023 - 1023 / 3 - 0.03306235651 * 2^20 const B2: u32 = 696219795; // (1023 - 1023 / 3 - 54 / 3 - 0.03306235651 * 2^20 // |1 / cbrt(x) - p(x)| < 2^(23.5) const P0: f64 = 1.87595182427177009643; const P1: f64 = -1.88497979543377169875; const P2: f64 = 1.621429720105354466140; const P3: f64 = -0.758397934778766047437; const P4: f64 = 0.145996192886612446982; var u = @bitCast(u64, x); var hx = @intCast(u32, u >> 32) & 0x7FFFFFFF; // cbrt(nan, inf) = itself if (hx >= 0x7FF00000) { return x + x; } // cbrt to ~5bits if (hx < 0x00100000) { u = @bitCast(u64, x * 0x1.0p54); hx = @intCast(u32, u >> 32) & 0x7FFFFFFF; // cbrt(0) is itself if (hx == 0) { return 0; } hx = hx / 3 + B2; } else { hx = hx / 3 + B1; } u &= 1 << 63; u |= @as(u64, hx) << 32; var t = @bitCast(f64, u); // cbrt to 23 bits // cbrt(x) = t * cbrt(x / t^3) ~= t * P(t^3 / x) var r = (t * t) * (t / x); t = t * ((P0 + r * (P1 + r * P2)) + ((r * r) * r) * (P3 + r * P4)); // Round t away from 0 to 23 bits u = @bitCast(u64, t); u = (u + 0x80000000) & 0xFFFFFFFFC0000000; t = @bitCast(f64, u); // one step newton to 53 bits const s = t * t; var q = x / s; var w = t + t; q = (q - t) / (w + q); return t + t * q; } test "math.cbrt" { expect(cbrt(@as(f32, 0.0)) == cbrt32(0.0)); expect(cbrt(@as(f64, 0.0)) == cbrt64(0.0)); } test "math.cbrt32" { const epsilon = 0.000001; expect(cbrt32(0.0) == 0.0); expect(math.approxEq(f32, cbrt32(0.2), 0.584804, epsilon)); expect(math.approxEq(f32, cbrt32(0.8923), 0.962728, epsilon)); expect(math.approxEq(f32, cbrt32(1.5), 1.144714, epsilon)); expect(math.approxEq(f32, cbrt32(37.45), 3.345676, epsilon)); expect(math.approxEq(f32, cbrt32(123123.234375), 49.748501, epsilon)); } test "math.cbrt64" { const epsilon = 0.000001; expect(cbrt64(0.0) == 0.0); expect(math.approxEq(f64, cbrt64(0.2), 0.584804, epsilon)); expect(math.approxEq(f64, cbrt64(0.8923), 0.962728, epsilon)); expect(math.approxEq(f64, cbrt64(1.5), 1.144714, epsilon)); expect(math.approxEq(f64, cbrt64(37.45), 3.345676, epsilon)); expect(math.approxEq(f64, cbrt64(123123.234375), 49.748501, epsilon)); } test "math.cbrt.special" { expect(cbrt32(0.0) == 0.0); expect(cbrt32(-0.0) == -0.0); expect(math.isPositiveInf(cbrt32(math.inf(f32)))); expect(math.isNegativeInf(cbrt32(-math.inf(f32)))); expect(math.isNan(cbrt32(math.nan(f32)))); } test "math.cbrt64.special" { expect(cbrt64(0.0) == 0.0); expect(cbrt64(-0.0) == -0.0); expect(math.isPositiveInf(cbrt64(math.inf(f64)))); expect(math.isNegativeInf(cbrt64(-math.inf(f64)))); expect(math.isNan(cbrt64(math.nan(f64)))); }
lib/std/math/cbrt.zig
const std = @import("std"); const builtin = @import("builtin"); const is_test = builtin.is_test; const fp_t = f32; const rep_t = u32; const srep_t = i32; const typeWidth = rep_t.bit_count; const significandBits = std.math.floatMantissaBits(fp_t); const exponentBits = std.math.floatExponentBits(fp_t); const signBit = (@as(rep_t, 1) << (significandBits + exponentBits)); const absMask = signBit - 1; const implicitBit = @as(rep_t, 1) << significandBits; const significandMask = implicitBit - 1; const exponentMask = absMask ^ significandMask; const infRep = @bitCast(rep_t, std.math.inf(fp_t)); // TODO https://github.com/ziglang/zig/issues/641 // and then make the return types of some of these functions the enum instead of c_int const LE_LESS = @as(c_int, -1); const LE_EQUAL = @as(c_int, 0); const LE_GREATER = @as(c_int, 1); const LE_UNORDERED = @as(c_int, 1); pub extern fn __lesf2(a: fp_t, b: fp_t) c_int { @setRuntimeSafety(is_test); const aInt: srep_t = @bitCast(srep_t, a); const bInt: srep_t = @bitCast(srep_t, b); const aAbs: rep_t = @bitCast(rep_t, aInt) & absMask; const bAbs: rep_t = @bitCast(rep_t, bInt) & absMask; // If either a or b is NaN, they are unordered. if (aAbs > infRep or bAbs > infRep) return LE_UNORDERED; // If a and b are both zeros, they are equal. if ((aAbs | bAbs) == 0) return LE_EQUAL; // If at least one of a and b is positive, we get the same result comparing // a and b as signed integers as we would with a fp_ting-point compare. if ((aInt & bInt) >= 0) { if (aInt < bInt) { return LE_LESS; } else if (aInt == bInt) { return LE_EQUAL; } else return LE_GREATER; } // Otherwise, both are negative, so we need to flip the sense of the // comparison to get the correct result. (This assumes a twos- or ones- // complement integer representation; if integers are represented in a // sign-magnitude representation, then this flip is incorrect). else { if (aInt > bInt) { return LE_LESS; } else if (aInt == bInt) { return LE_EQUAL; } else return LE_GREATER; } } // TODO https://github.com/ziglang/zig/issues/641 // and then make the return types of some of these functions the enum instead of c_int const GE_LESS = @as(c_int, -1); const GE_EQUAL = @as(c_int, 0); const GE_GREATER = @as(c_int, 1); const GE_UNORDERED = @as(c_int, -1); // Note: different from LE_UNORDERED pub extern fn __gesf2(a: fp_t, b: fp_t) c_int { @setRuntimeSafety(is_test); const aInt: srep_t = @bitCast(srep_t, a); const bInt: srep_t = @bitCast(srep_t, b); const aAbs: rep_t = @bitCast(rep_t, aInt) & absMask; const bAbs: rep_t = @bitCast(rep_t, bInt) & absMask; if (aAbs > infRep or bAbs > infRep) return GE_UNORDERED; if ((aAbs | bAbs) == 0) return GE_EQUAL; if ((aInt & bInt) >= 0) { if (aInt < bInt) { return GE_LESS; } else if (aInt == bInt) { return GE_EQUAL; } else return GE_GREATER; } else { if (aInt > bInt) { return GE_LESS; } else if (aInt == bInt) { return GE_EQUAL; } else return GE_GREATER; } } pub extern fn __unordsf2(a: fp_t, b: fp_t) c_int { @setRuntimeSafety(is_test); const aAbs: rep_t = @bitCast(rep_t, a) & absMask; const bAbs: rep_t = @bitCast(rep_t, b) & absMask; return @boolToInt(aAbs > infRep or bAbs > infRep); } pub extern fn __eqsf2(a: fp_t, b: fp_t) c_int { return __lesf2(a, b); } pub extern fn __ltsf2(a: fp_t, b: fp_t) c_int { return __lesf2(a, b); } pub extern fn __nesf2(a: fp_t, b: fp_t) c_int { return __lesf2(a, b); } pub extern fn __gtsf2(a: fp_t, b: fp_t) c_int { return __gesf2(a, b); } test "import comparesf2" { _ = @import("comparesf2_test.zig"); }
lib/std/special/compiler_rt/comparesf2.zig
const std = @import("std"); const mem = std.mem; const fs = std.fs; const process = std.process; const Token = std.zig.Token; const ast = std.zig.ast; const TokenIndex = std.zig.ast.TokenIndex; const Compilation = @import("compilation.zig").Compilation; const Scope = @import("scope.zig").Scope; pub const Color = enum { Auto, Off, On, }; pub const Span = struct { first: ast.TokenIndex, last: ast.TokenIndex, pub fn token(i: TokenIndex) Span { return Span{ .first = i, .last = i, }; } pub fn node(n: *ast.Node) Span { return Span{ .first = n.firstToken(), .last = n.lastToken(), }; } }; pub const Msg = struct { text: []u8, realpath: []u8, data: Data, const Data = union(enum) { Cli: Cli, PathAndTree: PathAndTree, ScopeAndComp: ScopeAndComp, }; const PathAndTree = struct { span: Span, tree: *ast.Tree, allocator: *mem.Allocator, }; const ScopeAndComp = struct { span: Span, tree_scope: *Scope.AstTree, compilation: *Compilation, }; const Cli = struct { allocator: *mem.Allocator, }; pub fn destroy(self: *Msg) void { switch (self.data) { .Cli => |cli| { cli.allocator.free(self.text); cli.allocator.free(self.realpath); cli.allocator.destroy(self); }, .PathAndTree => |path_and_tree| { path_and_tree.allocator.free(self.text); path_and_tree.allocator.free(self.realpath); path_and_tree.allocator.destroy(self); }, .ScopeAndComp => |scope_and_comp| { scope_and_comp.tree_scope.base.deref(scope_and_comp.compilation); scope_and_comp.compilation.gpa().free(self.text); scope_and_comp.compilation.gpa().free(self.realpath); scope_and_comp.compilation.gpa().destroy(self); }, } } fn getAllocator(self: *const Msg) *mem.Allocator { switch (self.data) { .Cli => |cli| return cli.allocator, .PathAndTree => |path_and_tree| { return path_and_tree.allocator; }, .ScopeAndComp => |scope_and_comp| { return scope_and_comp.compilation.gpa(); }, } } pub fn getTree(self: *const Msg) *ast.Tree { switch (self.data) { .Cli => unreachable, .PathAndTree => |path_and_tree| { return path_and_tree.tree; }, .ScopeAndComp => |scope_and_comp| { return scope_and_comp.tree_scope.tree; }, } } pub fn getSpan(self: *const Msg) Span { return switch (self.data) { .Cli => unreachable, .PathAndTree => |path_and_tree| path_and_tree.span, .ScopeAndComp => |scope_and_comp| scope_and_comp.span, }; } /// Takes ownership of text /// References tree_scope, and derefs when the msg is freed pub fn createFromScope(comp: *Compilation, tree_scope: *Scope.AstTree, span: Span, text: []u8) !*Msg { const realpath = try mem.dupe(comp.gpa(), u8, tree_scope.root().realpath); errdefer comp.gpa().free(realpath); const msg = try comp.gpa().create(Msg); msg.* = Msg{ .text = text, .realpath = realpath, .data = Data{ .ScopeAndComp = ScopeAndComp{ .tree_scope = tree_scope, .compilation = comp, .span = span, }, }, }; tree_scope.base.ref(); return msg; } /// Caller owns returned Msg and must free with `allocator` /// allocator will additionally be used for printing messages later. pub fn createFromCli(comp: *Compilation, realpath: []const u8, text: []u8) !*Msg { const realpath_copy = try mem.dupe(comp.gpa(), u8, realpath); errdefer comp.gpa().free(realpath_copy); const msg = try comp.gpa().create(Msg); msg.* = Msg{ .text = text, .realpath = realpath_copy, .data = Data{ .Cli = Cli{ .allocator = comp.gpa() }, }, }; return msg; } pub fn createFromParseErrorAndScope( comp: *Compilation, tree_scope: *Scope.AstTree, parse_error: *const ast.Error, ) !*Msg { const loc_token = parse_error.loc(); var text_buf = try std.Buffer.initSize(comp.gpa(), 0); defer text_buf.deinit(); const realpath_copy = try mem.dupe(comp.gpa(), u8, tree_scope.root().realpath); errdefer comp.gpa().free(realpath_copy); var out_stream = &std.io.BufferOutStream.init(&text_buf).stream; try parse_error.render(&tree_scope.tree.tokens, out_stream); const msg = try comp.gpa().create(Msg); msg.* = Msg{ .text = undefined, .realpath = realpath_copy, .data = Data{ .ScopeAndComp = ScopeAndComp{ .tree_scope = tree_scope, .compilation = comp, .span = Span{ .first = loc_token, .last = loc_token, }, }, }, }; tree_scope.base.ref(); msg.text = text_buf.toOwnedSlice(); return msg; } /// `realpath` must outlive the returned Msg /// `tree` must outlive the returned Msg /// Caller owns returned Msg and must free with `allocator` /// allocator will additionally be used for printing messages later. pub fn createFromParseError( allocator: *mem.Allocator, parse_error: *const ast.Error, tree: *ast.Tree, realpath: []const u8, ) !*Msg { const loc_token = parse_error.loc(); var text_buf = try std.Buffer.initSize(allocator, 0); defer text_buf.deinit(); const realpath_copy = try mem.dupe(allocator, u8, realpath); errdefer allocator.free(realpath_copy); var out_stream = &std.io.BufferOutStream.init(&text_buf).stream; try parse_error.render(&tree.tokens, out_stream); const msg = try allocator.create(Msg); msg.* = Msg{ .text = undefined, .realpath = realpath_copy, .data = Data{ .PathAndTree = PathAndTree{ .allocator = allocator, .tree = tree, .span = Span{ .first = loc_token, .last = loc_token, }, }, }, }; msg.text = text_buf.toOwnedSlice(); errdefer allocator.destroy(msg); return msg; } pub fn printToStream(msg: *const Msg, stream: var, color_on: bool) !void { switch (msg.data) { .Cli => { try stream.print("{}:-:-: error: {}\n", msg.realpath, msg.text); return; }, else => {}, } const allocator = msg.getAllocator(); const tree = msg.getTree(); const cwd = try process.getCwdAlloc(allocator); defer allocator.free(cwd); const relpath = try fs.path.relative(allocator, cwd, msg.realpath); defer allocator.free(relpath); const path = if (relpath.len < msg.realpath.len) relpath else msg.realpath; const span = msg.getSpan(); const first_token = tree.tokens.at(span.first); const last_token = tree.tokens.at(span.last); const start_loc = tree.tokenLocationPtr(0, first_token); const end_loc = tree.tokenLocationPtr(first_token.end, last_token); if (!color_on) { try stream.print( "{}:{}:{}: error: {}\n", path, start_loc.line + 1, start_loc.column + 1, msg.text, ); return; } try stream.print( "{}:{}:{}: error: {}\n{}\n", path, start_loc.line + 1, start_loc.column + 1, msg.text, tree.source[start_loc.line_start..start_loc.line_end], ); try stream.writeByteNTimes(' ', start_loc.column); try stream.writeByteNTimes('~', last_token.end - first_token.start); try stream.write("\n"); } pub fn printToFile(msg: *const Msg, file: fs.File, color: Color) !void { const color_on = switch (color) { .Auto => file.isTty(), .On => true, .Off => false, }; var stream = &file.outStream().stream; return msg.printToStream(stream, color_on); } };
src-self-hosted/errmsg.zig
const aoc = @import("../aoc.zig"); const std = @import("std"); const Memory = std.AutoHashMap(usize, usize); pub fn run(problem: *aoc.Problem) !aoc.Solution { var mem1 = Memory.init(problem.allocator); defer mem1.deinit(); var mem2 = Memory.init(problem.allocator); defer mem2.deinit(); var mask: []const u8 = undefined; while (problem.line()) |line| { var tokens = std.mem.tokenize(u8, line, "= "); const lhs = tokens.next().?; const rhs = tokens.next().?; if (std.mem.eql(u8, lhs, "mask")) { mask = rhs; } else { const address = try std.fmt.parseInt(usize, lhs[4..std.mem.indexOf(u8, lhs, "]").?], 10); const value = try std.fmt.parseInt(usize, rhs, 10); var value1: usize = 0; var address2: usize = 0; var address_masks = std.ArrayList(usize).init(problem.allocator); defer address_masks.deinit(); for (mask) |bit, idx| { const res_mask = @intCast(usize, 1) << @intCast(u6, mask.len - idx - 1); switch (bit) { '0' => address2 |= address & res_mask, '1' => { value1 |= res_mask; address2 |= res_mask; }, 'X' => { value1 |= value & res_mask; try address_masks.append(res_mask); }, else => unreachable } } try mem1.put(address, value1); try putFloatingAddresses(address2, value, &mem2, address_masks.items); } } return problem.solution(sumMemory(&mem1), sumMemory(&mem2)); } fn putFloatingAddresses(address: usize, value: usize, mem: *Memory, address_masks: []const usize) anyerror!void { if (address_masks.len == 0) { try mem.put(address, value); } else { const mask = address_masks[0]; try putFloatingAddresses(address, value, mem, address_masks[1..]); try putFloatingAddresses(address | mask, value, mem, address_masks[1..]); } } fn sumMemory(mem: *const Memory) usize { var res: usize = 0; var iter = mem.iterator(); while (iter.next()) |kv| { res += kv.value_ptr.*; } return res; }
src/main/zig/2020/day14.zig
const std = @import("std"); const fs = std.fs; const io = std.io; const info = std.log.info; const print = std.debug.print; const fmt = std.fmt; const ArrayList = std.ArrayList; const assert = std.debug.assert; const utils = @import("utils.zig"); var gpa = std.heap.GeneralPurposeAllocator(.{}){}; const Game = struct { allo: *std.mem.Allocator, hands: [2]ArrayList(u8), past_hands: ArrayList([]u8), pub fn init(allo: *std.mem.Allocator) Game { return .{ .allo = allo, .hands = .{ ArrayList(u8).init(allo), ArrayList(u8).init(allo), }, .past_hands = ArrayList([]u8).init(allo), }; } pub fn deinit(self: *Game) void { for (self.hands) |hand| { hand.deinit(); } for (self.past_hands.items) |past_hand| { self.allo.free(past_hand); } self.past_hands.deinit(); } pub fn load_card(self: *Game, hand_idx: usize, card: u8) void { self.hands[hand_idx].append(card) catch unreachable; } pub fn play_normal_round(self: *Game) ?usize { // game over if one player has no cards const winner_with_cards = self.player_with_all_cards(); if (winner_with_cards != null) return winner_with_cards; // could order the hands in reverse for a bit more optimal solution const a_card = self.hands[0].orderedRemove(0); const b_card = self.hands[1].orderedRemove(0); if (a_card > b_card) { self.hands[0].append(a_card) catch unreachable; self.hands[0].append(b_card) catch unreachable; } else { self.hands[1].append(b_card) catch unreachable; self.hands[1].append(a_card) catch unreachable; } return null; } pub fn play_recursive_round(self: *Game) ?usize { // game over if one player has no cards const winner_with_cards = self.player_with_all_cards(); if (winner_with_cards != null) return winner_with_cards; // game over if duplicate hand - player 1 wins if (self.is_duplicate_hand()) return 0; // add p1 hand to history const dup = self.allo.dupe(u8, self.hands[0].items) catch unreachable; self.past_hands.append(dup) catch unreachable; // could order the hands in reverse for a bit more optimal solution const a_card = self.hands[0].orderedRemove(0); const b_card = self.hands[1].orderedRemove(0); // check if we need to recurse const recurse = a_card <= self.hands[0].items.len and b_card <= self.hands[1].items.len; const round_winner: usize = if (recurse) blk: { // setup recursive game var recursive_game = Game.init(self.allo); recursive_game.hands[0].appendSlice(self.hands[0].items[0..a_card]) catch unreachable; recursive_game.hands[1].appendSlice(self.hands[1].items[0..b_card]) catch unreachable; // play game until winner is determined while (true) { const winner = recursive_game.play_recursive_round(); if (winner != null) { recursive_game.deinit(); break :blk winner orelse unreachable; } } } else blk: { break :blk switch (a_card > b_card) { true => @as(usize, 0), false => @as(usize, 1), }; }; // do regular winning conditions //if (round_winner == @as(usize, 0)) { if (round_winner == @intCast(usize, 0)) { self.hands[0].append(a_card) catch unreachable; self.hands[0].append(b_card) catch unreachable; } else { self.hands[1].append(b_card) catch unreachable; self.hands[1].append(a_card) catch unreachable; } return null; } pub fn player_with_all_cards(self: *Game) ?usize { // we could store this value, but i am opting not to var total_cards: usize = 0; for (self.hands) |hand| { total_cards += hand.items.len; } for (self.hands) |hand, i| { if (hand.items.len == total_cards) return i; } return null; } pub fn is_duplicate_hand(self: *Game) bool { const p1_hand = self.hands[0].items; for (self.past_hands.items) |past_hand| { if (std.mem.eql(u8, past_hand, p1_hand)) { return true; } } return false; } pub fn get_highest_score(self: *Game) usize { var high_score: usize = 0; for (self.hands) |hand| { var hand_score: usize = 0; for (hand.items) |card, i| { hand_score += card * (hand.items.len - i); } if (hand_score > high_score) { high_score = hand_score; } } return high_score; } }; pub fn main() !void { const begin = @divTrunc(std.time.nanoTimestamp(), 1000); // setup // defer _ = gpa.deinit(); var allo = &gpa.allocator; var lines: std.mem.TokenIterator = try utils.readInputLines(allo, "./input1"); defer allo.free(lines.buffer); var p1: usize = 0; var p2: usize = 0; // setup done // setup p1 var game_1 = Game.init(allo); defer game_1.deinit(); // setup p2 var game_2 = Game.init(allo); defer game_2.deinit(); // load cards to both games var hand_idx: isize = -1; while (lines.next()) |line| { if (line.len == 0) { continue; } if (std.mem.indexOf(u8, line, "Player") != null) { hand_idx += 1; continue; } const card_value = try fmt.parseUnsigned(u8, line, 10); game_1.load_card(@intCast(usize, hand_idx), card_value); game_2.load_card(@intCast(usize, hand_idx), card_value); } // play part 1 while (game_1.play_normal_round() == null) {} p1 = game_1.get_highest_score(); print("p1: {}\n", .{p1}); // play part 2 while (game_2.play_recursive_round() == null) {} p2 = game_2.get_highest_score(); print("p2: {}\n", .{p2}); // end const delta = @divTrunc(std.time.nanoTimestamp(), 1000) - begin; print("all done in {} microseconds\n", .{delta}); }
day_22/src/main.zig
const std = @import("std"); // Based on <https://rosettacode.org/wiki/Combinations#Nim> because I don't // remember this stuff off the top of my head. pub fn Combination(comptime T: type, comptime size: usize) type { comptime { if (size == 0) { @compileError("size=0 not permitted for combinations"); } } return struct { const Self = @This(); const Type = T; const Result = [size]T; const Size = size; data: []const T, c: [size]T, i: [size]usize, first: bool, pub fn init(data: []const T) Self { var self = Self{ .data = data, .c = undefined, .i = undefined, .first = data.len < size, }; for (self.i) |_, i| { self.i[i] = i; } return self; } fn result(self: *Self) Result { for (self.i) |dataIdx, resultIdx| { self.c[resultIdx] = self.data[dataIdx]; } return self.c; } pub fn next(self: *Self) ?Result { if (!self.first) { self.first = true; return self.result(); } const len = self.data.len; var i = size - 1; self.i[i] += 1; if (self.i[i] <= len - 1) { return self.result(); } while (self.i[i] >= len - size + i) { if (i == 0) { return null; } i -= 1; } self.i[i] += 1; while (i < size - 1) { self.i[i + 1] = self.i[i] + 1; i += 1; } return self.result(); } }; } test "combinations" { const expectEqual = std.testing.expectEqual; const expectEqualSlices = std.testing.expectEqualSlices; const C2 = Combination(i32, 2); comptime expectEqual(i32, C2.Type); comptime expectEqual(2, C2.Size); const data = &[_]C2.Type{ 4, 3, 2, 1 }; const want = [_][2]C2.Type{ .{ 4, 3 }, .{ 4, 2 }, .{ 4, 1 }, .{ 3, 2 }, .{ 3, 1 }, .{ 2, 1 }, }; var n2 = C2.init(data); var i: usize = 0; while (n2.next()) |pair| { const wanted = want[i]; expectEqualSlices(C2.Type, &pair, &wanted); i += 1; } expectEqual(want.len, i); // Expect that we get the desired number of results. }
lib/nil/combination.zig
pub const ERROR = @import("error.zig"); pub extern "advapi32" stdcallcc fn CryptAcquireContextA(phProv: &HCRYPTPROV, pszContainer: ?LPCSTR, pszProvider: ?LPCSTR, dwProvType: DWORD, dwFlags: DWORD) BOOL; pub extern "advapi32" stdcallcc fn CryptReleaseContext(hProv: HCRYPTPROV, dwFlags: DWORD) BOOL; pub extern "advapi32" stdcallcc fn CryptGenRandom(hProv: HCRYPTPROV, dwLen: DWORD, pbBuffer: &BYTE) BOOL; pub extern "kernel32" stdcallcc fn CloseHandle(hObject: HANDLE) BOOL; pub extern "kernel32" stdcallcc fn CreateDirectoryA(lpPathName: LPCSTR, lpSecurityAttributes: ?&SECURITY_ATTRIBUTES) BOOL; pub extern "kernel32" stdcallcc fn CreateFileA(lpFileName: LPCSTR, dwDesiredAccess: DWORD, dwShareMode: DWORD, lpSecurityAttributes: ?LPSECURITY_ATTRIBUTES, dwCreationDisposition: DWORD, dwFlagsAndAttributes: DWORD, hTemplateFile: ?HANDLE) HANDLE; pub extern "kernel32" stdcallcc fn CreatePipe(hReadPipe: &HANDLE, hWritePipe: &HANDLE, lpPipeAttributes: &const SECURITY_ATTRIBUTES, nSize: DWORD) BOOL; pub extern "kernel32" stdcallcc fn CreateProcessA(lpApplicationName: ?LPCSTR, lpCommandLine: LPSTR, lpProcessAttributes: ?&SECURITY_ATTRIBUTES, lpThreadAttributes: ?&SECURITY_ATTRIBUTES, bInheritHandles: BOOL, dwCreationFlags: DWORD, lpEnvironment: ?&c_void, lpCurrentDirectory: ?LPCSTR, lpStartupInfo: &STARTUPINFOA, lpProcessInformation: &PROCESS_INFORMATION) BOOL; pub extern "kernel32" stdcallcc fn CreateSymbolicLinkA(lpSymlinkFileName: LPCSTR, lpTargetFileName: LPCSTR, dwFlags: DWORD) BOOLEAN; pub extern "kernel32" stdcallcc fn DeleteFileA(lpFileName: LPCSTR) BOOL; pub extern "kernel32" stdcallcc fn ExitProcess(exit_code: UINT) noreturn; pub extern "kernel32" stdcallcc fn FreeEnvironmentStringsA(penv: LPCH) BOOL; pub extern "kernel32" stdcallcc fn GetCommandLineA() LPSTR; pub extern "kernel32" stdcallcc fn GetConsoleMode(in_hConsoleHandle: HANDLE, out_lpMode: &DWORD) BOOL; pub extern "kernel32" stdcallcc fn GetCurrentDirectoryA(nBufferLength: WORD, lpBuffer: ?LPSTR) DWORD; pub extern "kernel32" stdcallcc fn GetEnvironmentStringsA() ?LPCH; pub extern "kernel32" stdcallcc fn GetEnvironmentVariableA(lpName: LPCSTR, lpBuffer: LPSTR, nSize: DWORD) DWORD; pub extern "kernel32" stdcallcc fn GetExitCodeProcess(hProcess: HANDLE, lpExitCode: &DWORD) BOOL; pub extern "kernel32" stdcallcc fn GetFileSizeEx(hFile: HANDLE, lpFileSize: &LARGE_INTEGER) BOOL; pub extern "kernel32" stdcallcc fn GetModuleFileNameA(hModule: ?HMODULE, lpFilename: LPSTR, nSize: DWORD) DWORD; pub extern "kernel32" stdcallcc fn GetLastError() DWORD; pub extern "kernel32" stdcallcc fn GetFileInformationByHandleEx(in_hFile: HANDLE, in_FileInformationClass: FILE_INFO_BY_HANDLE_CLASS, out_lpFileInformation: &c_void, in_dwBufferSize: DWORD) BOOL; pub extern "kernel32" stdcallcc fn GetFinalPathNameByHandleA(hFile: HANDLE, lpszFilePath: LPSTR, cchFilePath: DWORD, dwFlags: DWORD) DWORD; pub extern "kernel32" stdcallcc fn GetProcessHeap() ?HANDLE; pub extern "kernel32" stdcallcc fn GetSystemTimeAsFileTime(?&FILETIME) void; pub extern "kernel32" stdcallcc fn HeapCreate(flOptions: DWORD, dwInitialSize: SIZE_T, dwMaximumSize: SIZE_T) ?HANDLE; pub extern "kernel32" stdcallcc fn HeapDestroy(hHeap: HANDLE) BOOL; pub extern "kernel32" stdcallcc fn HeapReAlloc(hHeap: HANDLE, dwFlags: DWORD, lpMem: &c_void, dwBytes: SIZE_T) ?&c_void; pub extern "kernel32" stdcallcc fn HeapSize(hHeap: HANDLE, dwFlags: DWORD, lpMem: &const c_void) SIZE_T; pub extern "kernel32" stdcallcc fn HeapValidate(hHeap: HANDLE, dwFlags: DWORD, lpMem: &const c_void) BOOL; pub extern "kernel32" stdcallcc fn HeapCompact(hHeap: HANDLE, dwFlags: DWORD) SIZE_T; pub extern "kernel32" stdcallcc fn HeapSummary(hHeap: HANDLE, dwFlags: DWORD, lpSummary: LPHEAP_SUMMARY) BOOL; pub extern "kernel32" stdcallcc fn GetStdHandle(in_nStdHandle: DWORD) ?HANDLE; pub extern "kernel32" stdcallcc fn HeapAlloc(hHeap: HANDLE, dwFlags: DWORD, dwBytes: SIZE_T) ?&c_void; pub extern "kernel32" stdcallcc fn HeapFree(hHeap: HANDLE, dwFlags: DWORD, lpMem: &c_void) BOOL; pub extern "kernel32" stdcallcc fn MoveFileExA(lpExistingFileName: LPCSTR, lpNewFileName: LPCSTR, dwFlags: DWORD) BOOL; pub extern "kernel32" stdcallcc fn QueryPerformanceCounter(lpPerformanceCount: &LARGE_INTEGER) BOOL; pub extern "kernel32" stdcallcc fn QueryPerformanceFrequency(lpFrequency: &LARGE_INTEGER) BOOL; pub extern "kernel32" stdcallcc fn PathFileExists(pszPath: ?LPCTSTR) BOOL; pub extern "kernel32" stdcallcc fn ReadFile(in_hFile: HANDLE, out_lpBuffer: &c_void, in_nNumberOfBytesToRead: DWORD, out_lpNumberOfBytesRead: &DWORD, in_out_lpOverlapped: ?&OVERLAPPED) BOOL; pub extern "kernel32" stdcallcc fn SetFilePointerEx(in_fFile: HANDLE, in_liDistanceToMove: LARGE_INTEGER, out_opt_ldNewFilePointer: ?&LARGE_INTEGER, in_dwMoveMethod: DWORD) BOOL; pub extern "kernel32" stdcallcc fn SetHandleInformation(hObject: HANDLE, dwMask: DWORD, dwFlags: DWORD) BOOL; pub extern "kernel32" stdcallcc fn Sleep(dwMilliseconds: DWORD) void; pub extern "kernel32" stdcallcc fn TerminateProcess(hProcess: HANDLE, uExitCode: UINT) BOOL; pub extern "kernel32" stdcallcc fn WaitForSingleObject(hHandle: HANDLE, dwMilliseconds: DWORD) DWORD; pub extern "kernel32" stdcallcc fn WriteFile(in_hFile: HANDLE, in_lpBuffer: &const c_void, in_nNumberOfBytesToWrite: DWORD, out_lpNumberOfBytesWritten: ?&DWORD, in_out_lpOverlapped: ?&OVERLAPPED) BOOL; //TODO: call unicode versions instead of relying on ANSI code page pub extern "kernel32" stdcallcc fn LoadLibraryA(lpLibFileName: LPCSTR) ?HMODULE; pub extern "kernel32" stdcallcc fn FreeLibrary(hModule: HMODULE) BOOL; pub extern "user32" stdcallcc fn MessageBoxA(hWnd: ?HANDLE, lpText: ?LPCTSTR, lpCaption: ?LPCTSTR, uType: UINT) c_int; pub const PROV_RSA_FULL = 1; pub const BOOL = c_int; pub const BOOLEAN = BYTE; pub const BYTE = u8; pub const CHAR = u8; pub const DWORD = u32; pub const FLOAT = f32; pub const HANDLE = &c_void; pub const HCRYPTPROV = ULONG_PTR; pub const HINSTANCE = &@OpaqueType(); pub const HMODULE = &@OpaqueType(); pub const INT = c_int; pub const LPBYTE = &BYTE; pub const LPCH = &CHAR; pub const LPCSTR = &const CHAR; pub const LPCTSTR = &const TCHAR; pub const LPCVOID = &const c_void; pub const LPDWORD = &DWORD; pub const LPSTR = &CHAR; pub const LPTSTR = if (UNICODE) LPWSTR else LPSTR; pub const LPVOID = &c_void; pub const LPWSTR = &WCHAR; pub const PVOID = &c_void; pub const PWSTR = &WCHAR; pub const SIZE_T = usize; pub const TCHAR = if (UNICODE) WCHAR else u8; pub const UINT = c_uint; pub const ULONG_PTR = usize; pub const UNICODE = false; pub const WCHAR = u16; pub const WORD = u16; pub const LARGE_INTEGER = i64; pub const FILETIME = i64; pub const TRUE = 1; pub const FALSE = 0; /// The standard input device. Initially, this is the console input buffer, CONIN$. pub const STD_INPUT_HANDLE = @maxValue(DWORD) - 10 + 1; /// The standard output device. Initially, this is the active console screen buffer, CONOUT$. pub const STD_OUTPUT_HANDLE = @maxValue(DWORD) - 11 + 1; /// The standard error device. Initially, this is the active console screen buffer, CONOUT$. pub const STD_ERROR_HANDLE = @maxValue(DWORD) - 12 + 1; pub const INVALID_HANDLE_VALUE = @intToPtr(HANDLE, @maxValue(usize)); pub const OVERLAPPED = extern struct { Internal: ULONG_PTR, InternalHigh: ULONG_PTR, Pointer: PVOID, hEvent: HANDLE, }; pub const LPOVERLAPPED = &OVERLAPPED; pub const MAX_PATH = 260; // TODO issue #305 pub const FILE_INFO_BY_HANDLE_CLASS = u32; pub const FileBasicInfo = 0; pub const FileStandardInfo = 1; pub const FileNameInfo = 2; pub const FileRenameInfo = 3; pub const FileDispositionInfo = 4; pub const FileAllocationInfo = 5; pub const FileEndOfFileInfo = 6; pub const FileStreamInfo = 7; pub const FileCompressionInfo = 8; pub const FileAttributeTagInfo = 9; pub const FileIdBothDirectoryInfo = 10; pub const FileIdBothDirectoryRestartInfo = 11; pub const FileIoPriorityHintInfo = 12; pub const FileRemoteProtocolInfo = 13; pub const FileFullDirectoryInfo = 14; pub const FileFullDirectoryRestartInfo = 15; pub const FileStorageInfo = 16; pub const FileAlignmentInfo = 17; pub const FileIdInfo = 18; pub const FileIdExtdDirectoryInfo = 19; pub const FileIdExtdDirectoryRestartInfo = 20; pub const FILE_NAME_INFO = extern struct { FileNameLength: DWORD, FileName: [1]WCHAR, }; /// Return the normalized drive name. This is the default. pub const FILE_NAME_NORMALIZED = 0x0; /// Return the opened file name (not normalized). pub const FILE_NAME_OPENED = 0x8; /// Return the path with the drive letter. This is the default. pub const VOLUME_NAME_DOS = 0x0; /// Return the path with a volume GUID path instead of the drive name. pub const VOLUME_NAME_GUID = 0x1; /// Return the path with no drive information. pub const VOLUME_NAME_NONE = 0x4; /// Return the path with the volume device path. pub const VOLUME_NAME_NT = 0x2; pub const SECURITY_ATTRIBUTES = extern struct { nLength: DWORD, lpSecurityDescriptor: ?&c_void, bInheritHandle: BOOL, }; pub const PSECURITY_ATTRIBUTES = &SECURITY_ATTRIBUTES; pub const LPSECURITY_ATTRIBUTES = &SECURITY_ATTRIBUTES; pub const GENERIC_READ = 0x80000000; pub const GENERIC_WRITE = 0x40000000; pub const GENERIC_EXECUTE = 0x20000000; pub const GENERIC_ALL = 0x10000000; pub const FILE_SHARE_DELETE = 0x00000004; pub const FILE_SHARE_READ = 0x00000001; pub const FILE_SHARE_WRITE = 0x00000002; pub const CREATE_ALWAYS = 2; pub const CREATE_NEW = 1; pub const OPEN_ALWAYS = 4; pub const OPEN_EXISTING = 3; pub const TRUNCATE_EXISTING = 5; pub const FILE_ATTRIBUTE_ARCHIVE = 0x20; pub const FILE_ATTRIBUTE_ENCRYPTED = 0x4000; pub const FILE_ATTRIBUTE_HIDDEN = 0x2; pub const FILE_ATTRIBUTE_NORMAL = 0x80; pub const FILE_ATTRIBUTE_OFFLINE = 0x1000; pub const FILE_ATTRIBUTE_READONLY = 0x1; pub const FILE_ATTRIBUTE_SYSTEM = 0x4; pub const FILE_ATTRIBUTE_TEMPORARY = 0x100; pub const PROCESS_INFORMATION = extern struct { hProcess: HANDLE, hThread: HANDLE, dwProcessId: DWORD, dwThreadId: DWORD, }; pub const STARTUPINFOA = extern struct { cb: DWORD, lpReserved: ?LPSTR, lpDesktop: ?LPSTR, lpTitle: ?LPSTR, dwX: DWORD, dwY: DWORD, dwXSize: DWORD, dwYSize: DWORD, dwXCountChars: DWORD, dwYCountChars: DWORD, dwFillAttribute: DWORD, dwFlags: DWORD, wShowWindow: WORD, cbReserved2: WORD, lpReserved2: ?LPBYTE, hStdInput: ?HANDLE, hStdOutput: ?HANDLE, hStdError: ?HANDLE, }; pub const STARTF_FORCEONFEEDBACK = 0x00000040; pub const STARTF_FORCEOFFFEEDBACK = 0x00000080; pub const STARTF_PREVENTPINNING = 0x00002000; pub const STARTF_RUNFULLSCREEN = 0x00000020; pub const STARTF_TITLEISAPPID = 0x00001000; pub const STARTF_TITLEISLINKNAME = 0x00000800; pub const STARTF_UNTRUSTEDSOURCE = 0x00008000; pub const STARTF_USECOUNTCHARS = 0x00000008; pub const STARTF_USEFILLATTRIBUTE = 0x00000010; pub const STARTF_USEHOTKEY = 0x00000200; pub const STARTF_USEPOSITION = 0x00000004; pub const STARTF_USESHOWWINDOW = 0x00000001; pub const STARTF_USESIZE = 0x00000002; pub const STARTF_USESTDHANDLES = 0x00000100; pub const INFINITE = 4294967295; pub const WAIT_ABANDONED = 0x00000080; pub const WAIT_OBJECT_0 = 0x00000000; pub const WAIT_TIMEOUT = 0x00000102; pub const WAIT_FAILED = 0xFFFFFFFF; pub const HANDLE_FLAG_INHERIT = 0x00000001; pub const HANDLE_FLAG_PROTECT_FROM_CLOSE = 0x00000002; pub const MOVEFILE_COPY_ALLOWED = 2; pub const MOVEFILE_CREATE_HARDLINK = 16; pub const MOVEFILE_DELAY_UNTIL_REBOOT = 4; pub const MOVEFILE_FAIL_IF_NOT_TRACKABLE = 32; pub const MOVEFILE_REPLACE_EXISTING = 1; pub const MOVEFILE_WRITE_THROUGH = 8; pub const FILE_BEGIN = 0; pub const FILE_CURRENT = 1; pub const FILE_END = 2; pub const HEAP_CREATE_ENABLE_EXECUTE = 0x00040000; pub const HEAP_GENERATE_EXCEPTIONS = 0x00000004; pub const HEAP_NO_SERIALIZE = 0x00000001; test "import" { _ = @import("util.zig"); }
std/os/windows/index.zig
const mecha = @import("../mecha.zig"); const std = @import("std"); const ascii = std.ascii; const debug = std.debug; const math = std.math; const mem = std.mem; const testing = std.testing; /// Constructs a parser that parses a single ascii bytes based on /// a `predicate`. If the `predicate` returns true, the parser will /// return the byte parsed and the rest of the string. Otherwise /// the parser will fail. pub fn wrap(comptime predicate: fn (u8) bool) mecha.Parser(u8) { const Res = mecha.Result(u8); return struct { fn func(_: *mem.Allocator, str: []const u8) mecha.Error!Res { if (str.len == 0 or !predicate(str[0])) return error.ParserFailed; return Res{ .value = str[0], .rest = str[1..] }; } }.func; } /// Constructs a parser that only succeeds if the string starts with `i`. pub fn char(comptime i: u8) mecha.Parser(void) { return comptime mecha.discard(range(i, i)); } test "char" { inline for ([_]void{{}} ** 255) |_, i| { const c = comptime @intCast(u8, i); try testWithPredicate(char(c), rangePred(c, c)); } } pub fn rangePred(comptime start: u8, comptime end: u8) fn (u8) bool { return struct { fn pred(c: u8) bool { return switch (c) { start...end => true, else => false, }; } }.pred; } /// Constructs a parser that only succeeds if the string starts with /// a codepoint that is in between `start` and `end` inclusively. /// The parser's result will be the codepoint parsed. pub fn range(comptime start: u8, comptime end: u8) mecha.Parser(u8) { return wrap(comptime rangePred(start, end)); } /// Creates a parser that succeeds and parses one ascii character if /// `parser` fails to parse the input string. pub fn not(comptime parser: anytype) mecha.Parser(u8) { const Res = mecha.Result(u8); return struct { fn res(allocator: *mem.Allocator, str: []const u8) mecha.Error!Res { if (str.len == 0) return error.ParserFailed; _ = parser(allocator, str) catch |e| switch (e) { error.ParserFailed => return Res{ .value = str[0], .rest = str[1..] }, else => return e, }; return error.ParserFailed; } }.res; } test "not" { try testWithPredicate(not(alpha), struct { fn pred(c: u8) bool { return !ascii.isAlpha(c); } }.pred); } /// Construct a parser that succeeds if the string starts with a /// character that is a digit in `base`. The parser's result will be /// the character parsed. pub fn digit(comptime base: u8) mecha.Parser(u8) { debug.assert(base != 0); if (base <= 10) return range('0', '0' + (base - 1)); return comptime mecha.oneOf(.{ range('0', '9'), range('a', 'a' + (base - 11)), range('A', 'A' + (base - 11)), }); } test "digit" { try testWithPredicate(digit(2), struct { fn pred(c: u8) bool { return switch (c) { '0'...'1' => true, else => false, }; } }.pred); try testWithPredicate(digit(10), struct { fn pred(c: u8) bool { return switch (c) { '0'...'9' => true, else => false, }; } }.pred); try testWithPredicate(digit(16), struct { fn pred(c: u8) bool { return switch (c) { '0'...'9', 'a'...'f', 'A'...'F' => true, else => false, }; } }.pred); } pub const alphanum = wrap(ascii.isAlNum); pub const alpha = wrap(ascii.isAlpha); pub const blank = wrap(ascii.isBlank); pub const cntrl = wrap(ascii.isCntrl); pub const graph = wrap(ascii.isGraph); pub const lower = wrap(ascii.isLower); pub const print = wrap(ascii.isPrint); pub const punct = wrap(ascii.isPunct); pub const space = wrap(ascii.isSpace); pub const upper = wrap(ascii.isUpper); pub const valid = wrap(ascii.isASCII); test "" { try testWithPredicate(alpha, ascii.isAlpha); try testWithPredicate(alphanum, ascii.isAlNum); try testWithPredicate(blank, ascii.isBlank); try testWithPredicate(cntrl, ascii.isCntrl); try testWithPredicate(graph, ascii.isGraph); try testWithPredicate(lower, ascii.isLower); try testWithPredicate(print, ascii.isPrint); try testWithPredicate(punct, ascii.isPunct); try testWithPredicate(space, ascii.isSpace); try testWithPredicate(upper, ascii.isUpper); try testWithPredicate(valid, ascii.isASCII); } fn testWithPredicate(parser: anytype, pred: fn (u8) bool) !void { const allocator = testing.failing_allocator; for ([_]void{{}} ** 255) |_, i| { const c = comptime @intCast(u8, i); if (pred(c)) switch (@TypeOf(parser)) { mecha.Parser(u8) => try mecha.expectResult(u8, .{ .value = c }, parser(allocator, &[_]u8{c})), mecha.Parser(void) => try mecha.expectResult(void, .{ .value = {} }, parser(allocator, &[_]u8{c})), else => comptime unreachable, } else switch (@TypeOf(parser)) { mecha.Parser(u8) => try mecha.expectResult(u8, error.ParserFailed, parser(allocator, &[_]u8{c})), mecha.Parser(void) => try mecha.expectResult(void, error.ParserFailed, parser(allocator, &[_]u8{c})), else => comptime unreachable, } } }
src/ascii.zig
const builtin = @import("builtin"); const std = @import("std"); const pkgs = @import("deps.zig").pkgs; pub fn build(b: *std.build.Builder) !void { // Standard target options allows the person running `zig build` to choose // what target to build for. Here we do not override the defaults, which // means any target is allowed, and the default is native. Other options // for restricting supported target set are available. // We want the target to be aarch64-linux for deploys const target = std.zig.CrossTarget{ .cpu_arch = .aarch64, .os_tag = .linux, }; // Standard release options allow the person running `zig build` to select // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. // const mode = b.standardReleaseOptions(); const exe = b.addExecutable("bootstrap", "src/main.zig"); pkgs.addAllTo(exe); exe.setTarget(target); exe.setBuildMode(.ReleaseSafe); const debug = b.option(bool, "debug", "Debug mode (do not strip executable)") orelse false; exe.strip = !debug; exe.install(); // TODO: We can cross-compile of course, but stripping and zip commands // may vary if (std.builtin.os.tag == .linux) { // Package step const package_step = b.step("package", "Package the function"); package_step.dependOn(b.getInstallStep()); // strip may not be installed or work for the target arch // TODO: make this much less fragile const strip = if (debug) try std.fmt.allocPrint(b.allocator, "true", .{}) else try std.fmt.allocPrint(b.allocator, "[ -x /usr/aarch64-linux-gnu/bin/strip ] && /usr/aarch64-linux-gnu/bin/strip {s}", .{b.getInstallPath(exe.install_step.?.dest_dir, exe.install_step.?.artifact.out_filename)}); defer b.allocator.free(strip); package_step.dependOn(&b.addSystemCommand(&.{ "/bin/sh", "-c", strip }).step); const function_zip = b.getInstallPath(exe.install_step.?.dest_dir, "function.zip"); const zip = try std.fmt.allocPrint(b.allocator, "zip -qj9 {s} {s}", .{ function_zip, b.getInstallPath(exe.install_step.?.dest_dir, exe.install_step.?.artifact.out_filename) }); defer b.allocator.free(zip); package_step.dependOn(&b.addSystemCommand(&.{ "/bin/sh", "-c", zip }).step); // Deployment const deploy_step = b.step("deploy", "Deploy the function"); var deal_with_iam = true; if (b.args) |args| { for (args) |arg| { if (std.mem.eql(u8, "--role", arg)) { deal_with_iam = false; break; } } } var iam_role: []u8 = &.{}; const iam_step = b.step("iam", "Create/Get IAM role for function"); deploy_step.dependOn(iam_step); // iam_step will either be a noop or all the stuff below if (deal_with_iam) { // if someone adds '-- --role arn...' to the command line, we don't // need to do anything with the iam role. Otherwise, we'll create/ // get the IAM role and stick the name in a file in our destination // directory to be used later const iam_role_name_file = b.getInstallPath(exe.install_step.?.dest_dir, "iam_role_name"); iam_role = try std.fmt.allocPrint(b.allocator, "--role $(cat {s})", .{iam_role_name_file}); // defer b.allocator.free(iam_role); if (!fileExists(iam_role_name_file)) { // Role get/creation command const ifstatement_fmt = \\ if aws iam get-role --role-name lambda_basic_execution 2>&1 |grep -q NoSuchEntity; then aws iam create-role --output text --query Role.Arn --role-name lambda_basic_execution --assume-role-policy-document '{ \\ "Version": "2012-10-17", \\ "Statement": [ \\ { \\ "Sid": "", \\ "Effect": "Allow", \\ "Principal": { \\ "Service": "lambda.amazonaws.com" \\ }, \\ "Action": "sts:AssumeRole" \\ } \\ ]}' > /dev/null; fi && \ \\ aws iam attach-role-policy --policy-arn arn:aws:iam::aws:policy/AWSLambdaExecute --role-name lambda_basic_execution && \ \\ aws iam get-role --role-name lambda_basic_execution --query Role.Arn --output text > ; const ifstatement = try std.mem.concat(b.allocator, u8, &[_][]const u8{ ifstatement_fmt, iam_role_name_file }); defer b.allocator.free(ifstatement); iam_step.dependOn(&b.addSystemCommand(&.{ "/bin/sh", "-c", ifstatement }).step); } } const function_name = b.option([]const u8, "function-name", "Function name for Lambda [zig-fn]") orelse "zig-fn"; const function_name_file = b.getInstallPath(exe.install_step.?.dest_dir, function_name); const ifstatement = "if [ ! -f {s} ] || [ {s} -nt {s} ]; then if aws lambda get-function --function-name {s} 2>&1 |grep -q ResourceNotFoundException; then echo not found > /dev/null; {s}; else echo found > /dev/null; {s}; fi; fi"; // The architectures option was introduced in 2.2.43 released 2021-10-01 // We want to use arm64 here because it is both faster and cheaper for most // Amazon Linux 2 is the only arm64 supported option const not_found = "aws lambda create-function --architectures arm64 --runtime provided.al2 --function-name {s} --zip-file fileb://{s} --handler not_applicable {s} && touch {s}"; const not_found_fmt = try std.fmt.allocPrint(b.allocator, not_found, .{ function_name, function_zip, iam_role, function_name_file }); defer b.allocator.free(not_found_fmt); const found = "aws lambda update-function-code --function-name {s} --zip-file fileb://{s} && touch {s}"; const found_fmt = try std.fmt.allocPrint(b.allocator, found, .{ function_name, function_zip, function_name_file }); defer b.allocator.free(found_fmt); var found_final: []const u8 = undefined; var not_found_final: []const u8 = undefined; if (b.args) |args| { found_final = try addArgs(b.allocator, found_fmt, args); not_found_final = try addArgs(b.allocator, not_found_fmt, args); } else { found_final = found_fmt; not_found_final = not_found_fmt; } const cmd = try std.fmt.allocPrint(b.allocator, ifstatement, .{ function_name_file, std.fs.path.dirname(exe.root_src.?.path), function_name_file, function_name, not_found_fmt, found_fmt, }); defer b.allocator.free(cmd); // std.debug.print("{s}\n", .{cmd}); deploy_step.dependOn(package_step); deploy_step.dependOn(&b.addSystemCommand(&.{ "/bin/sh", "-c", cmd }).step); // TODO: Looks like IquanaTLS isn't playing nicely with payloads this small // const payload = b.option([]const u8, "payload", "Lambda payload [{\"foo\":\"bar\"}]") orelse // \\ {"foo": "bar"}" // ; const payload = b.option([]const u8, "payload", "Lambda payload [{\"foo\":\"bar\", \"baz\": \"qux\"}]") orelse \\ {"foo": "bar", "baz": "qux"}" ; const run_script = \\ f=$(mktemp) && \ \\ logs=$(aws lambda invoke \ \\ --cli-binary-format raw-in-base64-out \ \\ --invocation-type RequestResponse \ \\ --function-name {s} \ \\ --payload '{s}' \ \\ --log-type Tail \ \\ --query LogResult \ \\ --output text "$f" |base64 -d) && \ \\ cat "$f" && rm "$f" && \ \\ echo && echo && echo "$logs" ; const run_script_fmt = try std.fmt.allocPrint(b.allocator, run_script, .{ function_name, payload }); defer b.allocator.free(run_script_fmt); const run_cmd = b.addSystemCommand(&.{ "/bin/sh", "-c", run_script_fmt }); run_cmd.step.dependOn(deploy_step); if (b.args) |args| { run_cmd.addArgs(args); } const run_step = b.step("run", "Run the app"); run_step.dependOn(&run_cmd.step); } } fn fileExists(file_name: []const u8) bool { const file = std.fs.openFileAbsolute(file_name, .{}) catch return false; defer file.close(); return true; } fn addArgs(allocator: *std.mem.Allocator, original: []const u8, args: [][]const u8) ![]const u8 { var rc = original; for (args) |arg| { rc = try std.mem.concat(allocator, u8, &.{ rc, " ", arg }); } return rc; }
build.zig
const std = @import("std"); const expect = std.testing.expect; const assert = std.debug.assert; const mem = std.mem; const fmt = std.fmt; const Allocator = mem.Allocator; const ArrayList = std.ArrayList; const GeneralPurposeAllocator = std.heap.GeneralPurposeAllocator; const Input = @import("input.zig"); pub fn main() !void { var gpa = GeneralPurposeAllocator(.{}){}; defer { const leaked = gpa.deinit(); if (leaked) expect(false) catch @panic("TEST FAIL"); } const allocator = &gpa.allocator; // TODO: read input from _inputs/*.txt //var day2InputList = ArrayList([]const u8).init(allocator); //defer day2InputList.deinit(); //try day2InputList.appendSlice(&Input.input); //std.log.info("Day 2 (Part 1): {}", .{try day2(allocator, day2InputList, false)}); //std.log.info("Day 2 (Part 2): {}", .{try day2(allocator, day2InputList, true)}); } fn day2(allocator: *Allocator, commands: ArrayList([]const u8), calculate_aim: bool) !u32 { var horizontal: u32 = 0; var depth: u32 = 0; var aim: u32 = 0; var pairs = ArrayList([]const u8).init(allocator); defer pairs.deinit(); for (commands.items) |line, _| { defer pairs.clearAndFree(); var line_iter = mem.split(line, " "); var index: u32 = 0; while (line_iter.next()) |token| : (index += 1) { try pairs.append(token); } assert(pairs.items.len == 2); const command = pairs.items[0]; const number: u32 = fmt.parseInt(u32, pairs.items[1], 10) catch 0; if (mem.eql(u8, command, "forward")) { horizontal += number; if (calculate_aim) depth += (aim * number); } if (mem.eql(u8, command, "down")) { if (calculate_aim) { aim += number; } else { depth += number; } } if (mem.eql(u8, command, "up")) { if (calculate_aim) { aim -= number; } else { depth -= number; } } } return horizontal * depth; } test "Day 2a" { const allocator = std.testing.allocator; var input = ArrayList([]const u8).init(allocator); defer input.deinit(); try input.appendSlice(&Input.test_input); const results = try day2(allocator, input, false); try expect(results == 150); } test "Day 2b" { const allocator = std.testing.allocator; var input = ArrayList([]const u8).init(allocator); defer input.deinit(); try input.appendSlice(&Input.test_input); const results = try day2(allocator, input, true); try expect(results == 900); }
2021/zig/src/day2/main.zig
const std = @import("std"); const c = @import("c.zig"); const EGLContext = @import("egl.zig").EGLContext; const JNI = @import("jni.zig").JNI; const android = @import("android-support.zig"); const build_options = @import("build_options"); pub const panic = android.panic; pub const log = android.log; const app_log = std.log.scoped(.app); /// Entry point for our application. /// This struct provides the interface to the android support package. pub const AndroidApp = struct { const Self = @This(); const TouchPoint = struct { /// if null, then fade out index: ?i32, intensity: f32, x: f32, y: f32, age: i64, }; allocator: *std.mem.Allocator, activity: *android.ANativeActivity, thread: ?*std.Thread = null, running: bool = true, egl_lock: std.Mutex = std.Mutex{}, egl: ?EGLContext = null, egl_init: bool = true, input_lock: std.Mutex = std.Mutex{}, input: ?*android.AInputQueue = null, config: ?*android.AConfiguration = null, touch_points: [16]?TouchPoint = [1]?TouchPoint{null} ** 16, screen_width: f32 = undefined, screen_height: f32 = undefined, /// This is the entry point which initializes a application /// that has stored its previous state. /// `stored_state` is that state, the memory is only valid for this function. pub fn initRestore(allocator: *std.mem.Allocator, activity: *android.ANativeActivity, stored_state: []const u8) !Self { return Self{ .allocator = allocator, .activity = activity, }; } /// This is the entry point which initializes a application /// that has no previous state. pub fn initFresh(allocator: *std.mem.Allocator, activity: *android.ANativeActivity) !Self { return Self{ .allocator = allocator, .activity = activity, }; } /// This function is called when the application is successfully initialized. /// It should create a background thread that processes the events and runs until /// the application gets destroyed. pub fn start(self: *Self) !void { // This code somehow crashes yet. Needs more investigations // { // var jni = JNI.init(self.activity); // defer jni.deinit(); // // Must be called from main thread… // _ = jni.AndroidMakeFullscreen(); // } self.thread = try std.Thread.spawn(self, mainLoop); } /// Uninitialize the application. /// Don't forget to stop your background thread here! pub fn deinit(self: *Self) void { @atomicStore(bool, &self.running, false, .SeqCst); if (self.thread) |thread| { thread.wait(); self.thread = null; } if (self.config) |config| { android.AConfiguration_delete(config); } self.* = undefined; } pub fn onNativeWindowCreated(self: *Self, window: *android.ANativeWindow) void { var held = self.egl_lock.acquire(); defer held.release(); if (self.egl) |*old| { old.deinit(); } self.screen_width = @intToFloat(f32, android.ANativeWindow_getWidth(window)); self.screen_height = @intToFloat(f32, android.ANativeWindow_getHeight(window)); self.egl = EGLContext.init(window) catch |err| blk: { app_log.err("Failed to initialize EGL for window: {}\n", .{err}); break :blk null; }; self.egl_init = true; } pub fn onNativeWindowDestroyed(self: *Self, window: *android.ANativeWindow) void { var held = self.egl_lock.acquire(); defer held.release(); if (self.egl) |*old| { old.deinit(); } self.egl = null; } pub fn onInputQueueCreated(self: *Self, input: *android.AInputQueue) void { var held = self.input_lock.acquire(); defer held.release(); self.input = input; } pub fn onInputQueueDestroyed(self: *Self, input: *android.AInputQueue) void { var held = self.input_lock.acquire(); defer held.release(); self.input = null; } fn printConfig(config: *android.AConfiguration) void { var lang: [2]u8 = undefined; var country: [2]u8 = undefined; android.AConfiguration_getLanguage(config, &lang); android.AConfiguration_getCountry(config, &country); app_log.debug( \\MCC: {} \\MNC: {} \\Language: {} \\Country: {} \\Orientation: {} \\Touchscreen: {} \\Density: {} \\Keyboard: {} \\Navigation: {} \\KeysHidden: {} \\NavHidden: {} \\SdkVersion: {} \\ScreenSize: {} \\ScreenLong: {} \\UiModeType: {} \\UiModeNight: {} \\ , .{ android.AConfiguration_getMcc(config), android.AConfiguration_getMnc(config), &lang, &country, android.AConfiguration_getOrientation(config), android.AConfiguration_getTouchscreen(config), android.AConfiguration_getDensity(config), android.AConfiguration_getKeyboard(config), android.AConfiguration_getNavigation(config), android.AConfiguration_getKeysHidden(config), android.AConfiguration_getNavHidden(config), android.AConfiguration_getSdkVersion(config), android.AConfiguration_getScreenSize(config), android.AConfiguration_getScreenLong(config), android.AConfiguration_getUiModeType(config), android.AConfiguration_getUiModeNight(config), }); } fn processKeyEvent(self: *Self, event: *android.AInputEvent) !bool { const event_type = @intToEnum(android.AKeyEventActionType, android.AKeyEvent_getAction(event)); std.log.scoped(.input).debug( \\Key Press Event: {} \\Flags: {} \\KeyCode: {} \\ScanCode: {} \\MetaState: {} \\RepeatCount: {} \\DownTime: {} \\EventTime: {} \\ , .{ event_type, android.AKeyEvent_getFlags(event), android.AKeyEvent_getKeyCode(event), android.AKeyEvent_getScanCode(event), android.AKeyEvent_getMetaState(event), android.AKeyEvent_getRepeatCount(event), android.AKeyEvent_getDownTime(event), android.AKeyEvent_getEventTime(event), }); if (event_type == .AKEY_EVENT_ACTION_DOWN) { var jni = JNI.init(self.activity); defer jni.deinit(); var codepoint = jni.AndroidGetUnicodeChar( android.AKeyEvent_getKeyCode(event), android.AKeyEvent_getMetaState(event), ); var buf: [8]u8 = undefined; var len = std.unicode.utf8Encode(codepoint, &buf) catch 0; var key_text = buf[0..len]; std.log.scoped(.input).info("Pressed key: '{}' U+{X}", .{ key_text, codepoint }); } return false; } fn insertPoint(self: *Self, point: TouchPoint) void { std.debug.assert(point.index != null); var oldest: *TouchPoint = undefined; for (self.touch_points) |*opt, i| { if (opt.*) |*pt| { if (pt.index != null and pt.index.? == point.index.?) { pt.* = point; return; } if (i == 0) { oldest = pt; } else { if (pt.age < oldest.age) { oldest = pt; } } } else { opt.* = point; return; } } oldest.* = point; } fn processMotionEvent(self: *Self, event: *android.AInputEvent) !bool { const event_type = @intToEnum(android.AMotionEventActionType, android.AMotionEvent_getAction(event)); { var jni = JNI.init(self.activity); defer jni.deinit(); // Show/Hide keyboard // _ = jni.AndroidDisplayKeyboard(true); // this allows you to send the app in the background // const success = jni.AndroidSendToBack(true); // std.app_log.debug(.app, "SendToBack() = {}\n", .{success}); // This is a demo on how to request permissions: // if (event_type == .AMOTION_EVENT_ACTION_UP) { // if (!JNI.AndroidHasPermissions(self.activity, "android.permission.RECORD_AUDIO")) { // JNI.AndroidRequestAppPermissions(self.activity, "android.permission.RECORD_AUDIO"); // } // } } std.log.scoped(.input).debug( \\Motion Event {} \\Flags: {} \\MetaState: {} \\ButtonState: {} \\EdgeFlags: {} \\DownTime: {} \\EventTime: {} \\XOffset: {} \\YOffset: {} \\XPrecision: {} \\YPrecision: {} \\PointerCount: {} \\ , .{ event_type, android.AMotionEvent_getFlags(event), android.AMotionEvent_getMetaState(event), android.AMotionEvent_getButtonState(event), android.AMotionEvent_getEdgeFlags(event), android.AMotionEvent_getDownTime(event), android.AMotionEvent_getEventTime(event), android.AMotionEvent_getXOffset(event), android.AMotionEvent_getYOffset(event), android.AMotionEvent_getXPrecision(event), android.AMotionEvent_getYPrecision(event), android.AMotionEvent_getPointerCount(event), }); var i: usize = 0; var cnt = android.AMotionEvent_getPointerCount(event); while (i < cnt) : (i += 1) { std.log.scoped(.input).debug( \\Pointer {}: \\ PointerId: {} \\ ToolType: {} \\ RawX: {d} \\ RawY: {d} \\ X: {d} \\ Y: {d} \\ Pressure: {} \\ Size: {} \\ TouchMajor: {} \\ TouchMinor: {} \\ ToolMajor: {} \\ ToolMinor: {} \\ Orientation: {} \\ , .{ i, android.AMotionEvent_getPointerId(event, i), android.AMotionEvent_getToolType(event, i), android.AMotionEvent_getRawX(event, i), android.AMotionEvent_getRawY(event, i), android.AMotionEvent_getX(event, i), android.AMotionEvent_getY(event, i), android.AMotionEvent_getPressure(event, i), android.AMotionEvent_getSize(event, i), android.AMotionEvent_getTouchMajor(event, i), android.AMotionEvent_getTouchMinor(event, i), android.AMotionEvent_getToolMajor(event, i), android.AMotionEvent_getToolMinor(event, i), android.AMotionEvent_getOrientation(event, i), }); self.insertPoint(TouchPoint{ .x = android.AMotionEvent_getX(event, i), .y = android.AMotionEvent_getY(event, i), .index = android.AMotionEvent_getPointerId(event, i), .age = android.AMotionEvent_getEventTime(event), .intensity = 1.0, }); } return false; } fn mainLoop(self: *Self) !void { var loop: usize = 0; app_log.notice("mainLoop() started\n", .{}); self.config = blk: { var cfg = android.AConfiguration_new() orelse return error.OutOfMemory; android.AConfiguration_fromAssetManager(cfg, self.activity.assetManager); break :blk cfg; }; if (self.config) |cfg| { printConfig(cfg); } const GLuint = c.GLuint; var touch_program: GLuint = undefined; var shaded_program: GLuint = undefined; var uPos: c.GLint = undefined; var uAspect: c.GLint = undefined; var uIntensity: c.GLint = undefined; var uTransform: c.GLint = undefined; while (@atomicLoad(bool, &self.running, .SeqCst)) { // Input process { // we lock the handle of our input so we don't have a race condition var held = self.input_lock.acquire(); defer held.release(); if (self.input) |input| { var event: ?*android.AInputEvent = undefined; while (android.AInputQueue_getEvent(input, &event) >= 0) { std.debug.assert(event != null); if (android.AInputQueue_preDispatchEvent(input, event) != 0) { continue; } const event_type = @intToEnum(android.AInputEventType, android.AInputEvent_getType(event)); const handled = switch (event_type) { .AINPUT_EVENT_TYPE_KEY => try self.processKeyEvent(event.?), .AINPUT_EVENT_TYPE_MOTION => try self.processMotionEvent(event.?), else => blk: { std.log.scoped(.input).debug("Unhandled input event type ({})\n", .{event_type}); break :blk false; }, }; // if (app.onInputEvent != NULL) // handled = app.onInputEvent(app, event); android.AInputQueue_finishEvent(input, event, if (handled) @as(c_int, 1) else @as(c_int, 0)); } } } // Render process { // same for the EGL context var held = self.egl_lock.acquire(); defer held.release(); if (self.egl) |egl| { try egl.makeCurrent(); if (self.egl_init) { app_log.info( \\GL Vendor: {s} \\GL Renderer: {s} \\GL Version: {s} \\GL Extensions: {s} \\ , .{ std.mem.span(c.glGetString(c.GL_VENDOR)), std.mem.span(c.glGetString(c.GL_RENDERER)), std.mem.span(c.glGetString(c.GL_VERSION)), std.mem.span(c.glGetString(c.GL_EXTENSIONS)), }); touch_program = c.glCreateProgram(); { var ps = c.glCreateShader(c.GL_VERTEX_SHADER); var fs = c.glCreateShader(c.GL_FRAGMENT_SHADER); var ps_code = \\attribute vec2 vPosition; \\varying vec2 uv; \\void main() { \\ uv = vPosition; \\ gl_Position = vec4(2.0 * uv - 1.0, 0.0, 1.0); \\} \\ ; var fs_code = \\varying vec2 uv; \\uniform vec2 uPos; \\uniform float uAspect; \\uniform float uIntensity; \\void main() { \\ vec2 rel = uv - uPos; \\ rel.x *= uAspect; \\ gl_FragColor = vec4(vec3(pow(uIntensity * clamp(1.0 - 10.0 * length(rel), 0.0, 1.0), 2.2)), 1.0); \\} \\ ; c.glShaderSource(ps, 1, @ptrCast([*c]const [*c]const u8, &ps_code), null); c.glShaderSource(fs, 1, @ptrCast([*c]const [*c]const u8, &fs_code), null); c.glCompileShader(ps); c.glCompileShader(fs); c.glAttachShader(touch_program, ps); c.glAttachShader(touch_program, fs); c.glBindAttribLocation(touch_program, 0, "vPosition"); c.glLinkProgram(touch_program); c.glDetachShader(touch_program, ps); c.glDetachShader(touch_program, fs); } uPos = c.glGetUniformLocation(touch_program, "uPos"); uAspect = c.glGetUniformLocation(touch_program, "uAspect"); uIntensity = c.glGetUniformLocation(touch_program, "uIntensity"); shaded_program = c.glCreateProgram(); { var ps = c.glCreateShader(c.GL_VERTEX_SHADER); var fs = c.glCreateShader(c.GL_FRAGMENT_SHADER); var ps_code = \\attribute vec3 vPosition; \\attribute vec3 vNormal; \\uniform mat4 uTransform; \\varying vec3 normal; \\void main() { \\ normal = mat3(uTransform) * vNormal; \\ gl_Position = uTransform * vec4(vPosition, 1.0); \\} \\ ; var fs_code = \\varying vec3 normal; \\void main() { \\ vec3 base_color = vec3(0.968,0.643,0.113); // #F7A41D \\ vec3 ldir = normalize(vec3(0.3, 0.4, 2.0)); \\ float l = 0.3 + 0.8 * clamp(-dot(normal, ldir), 0.0, 1.0); \\ gl_FragColor = vec4(l * base_color,1); \\} \\ ; c.glShaderSource(ps, 1, @ptrCast([*c]const [*c]const u8, &ps_code), null); c.glShaderSource(fs, 1, @ptrCast([*c]const [*c]const u8, &fs_code), null); c.glCompileShader(ps); c.glCompileShader(fs); c.glAttachShader(shaded_program, ps); c.glAttachShader(shaded_program, fs); c.glBindAttribLocation(shaded_program, 0, "vPosition"); c.glBindAttribLocation(shaded_program, 1, "vNormal"); c.glLinkProgram(shaded_program); c.glDetachShader(shaded_program, ps); c.glDetachShader(shaded_program, fs); } uTransform = c.glGetUniformLocation(shaded_program, "uTransform"); self.egl_init = false; } const t = @intToFloat(f32, loop) / 100.0; c.glClearColor( 0.5 + 0.5 * std.math.sin(t + 0.0), 0.5 + 0.5 * std.math.sin(t + 1.0), 0.5 + 0.5 * std.math.sin(t + 2.0), 1.0, ); c.glClear(c.GL_COLOR_BUFFER_BIT); c.glUseProgram(touch_program); const vVertices = [_]c.GLfloat{ 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, }; c.glVertexAttribPointer(0, 2, c.GL_FLOAT, c.GL_FALSE, 0, &vVertices); c.glEnableVertexAttribArray(0); c.glDisableVertexAttribArray(1); c.glDisable(c.GL_DEPTH_TEST); c.glEnable(c.GL_BLEND); c.glBlendFunc(c.GL_ONE, c.GL_ONE); c.glBlendEquation(c.GL_FUNC_ADD); for (self.touch_points) |*pt| { if (pt.*) |*point| { c.glUniform1f(uAspect, self.screen_width / self.screen_height); c.glUniform2f(uPos, point.x / self.screen_width, 1.0 - point.y / self.screen_height); c.glUniform1f(uIntensity, point.intensity); c.glDrawArrays(c.GL_TRIANGLE_STRIP, 0, 4); point.intensity -= 0.05; if (point.intensity <= 0.0) { pt.* = null; } } } c.glEnableVertexAttribArray(0); c.glVertexAttribPointer(0, 3, c.GL_FLOAT, c.GL_FALSE, @sizeOf(MeshVertex), &mesh[0].pos); c.glEnableVertexAttribArray(1); c.glVertexAttribPointer(1, 3, c.GL_FLOAT, c.GL_FALSE, @sizeOf(MeshVertex), &mesh[0].normal); c.glUseProgram(shaded_program); c.glClearDepthf(1.0); c.glClear(c.GL_DEPTH_BUFFER_BIT); c.glDisable(c.GL_BLEND); c.glEnable(c.GL_DEPTH_TEST); var matrix = [4][4]f32{ [4]f32{ 1, 0, 0, 0 }, [4]f32{ 0, 1, 0, 0 }, [4]f32{ 0, 0, 1, 0 }, [4]f32{ 0, 0, 0, 1 }, }; matrix[1][1] = self.screen_width / self.screen_height; matrix[0][0] = std.math.sin(t); matrix[2][0] = std.math.cos(t); matrix[0][2] = std.math.cos(t); matrix[2][2] = -std.math.sin(t); c.glUniformMatrix4fv(uTransform, 1, c.GL_FALSE, @ptrCast([*]const f32, &matrix)); c.glDrawArrays(c.GL_TRIANGLES, 0, mesh.len); try egl.swapBuffers(); } } loop += 1; std.time.sleep(10 * std.time.ns_per_ms); } app_log.notice("mainLoop() finished\n", .{}); } }; const MeshVertex = extern struct { pos: Vector4, normal: Vector4, }; const Vector4 = extern struct { x: f32, y: f32, z: f32, w: f32 = 1.0, fn readFromSlice(slice: []const u8) Vector4 { return Vector4{ .x = @bitCast(f32, std.mem.readIntLittle(u32, slice[0..4])), .y = @bitCast(f32, std.mem.readIntLittle(u32, slice[4..8])), .z = @bitCast(f32, std.mem.readIntLittle(u32, slice[8..12])), .w = 1.0, }; } }; const mesh = comptime blk: { const stl_data = @embedFile("logo.stl"); const count = std.mem.readIntLittle(u32, stl_data[80..][0..4]); var slice: []const u8 = stl_data[84..]; var array: [3 * count]MeshVertex = undefined; var index: usize = 0; @setEvalBranchQuota(10_000); while (index < count) : (index += 1) { const normal = Vector4.readFromSlice(slice[0..]); const v1 = Vector4.readFromSlice(slice[12..]); const v2 = Vector4.readFromSlice(slice[24..]); const v3 = Vector4.readFromSlice(slice[36..]); const attrib_count = std.mem.readIntLittle(u16, slice[48..50]); array[3 * index + 0] = MeshVertex{ .pos = v1, .normal = normal, }; array[3 * index + 1] = MeshVertex{ .pos = v2, .normal = normal, }; array[3 * index + 2] = MeshVertex{ .pos = v3, .normal = normal, }; slice = slice[50 + attrib_count ..]; } break :blk array; };
src/main.zig
const std = @import("std"); const assert = std.debug.assert; const warn = std.debug.warn; const builtin = @import("builtin"); const TypeId = builtin.TypeId; const Timer = std.os.time.Timer; const DefaultPrng = std.rand.DefaultPrng; /// Compiler Seg faults: /// #0 0x00007f4479d32bf0 in llvm::Value::getContext() const () from /usr/lib/libLLVM-6.0.so /// #1 0x00007f4479cd07f0 in llvm::SwitchInst::SwitchInst(llvm::Value*, llvm::BasicBlock*, unsigned int, llvm::Instruction*) () from /usr/lib/libLLVM-6.0.so /// #2 0x00007f4479c61845 in LLVMBuildSwitch () from /usr/lib/libLLVM-6.0.so /// #3 0x000055e869c63221 in ir_render_switch_br (g=0x55e86ad49660, executable=0x55e86adbe0f0, instruction=0x55e86afb4380) at ../src/codegen.cpp:3872 /// #4 0x000055e869c68ef8 in ir_render_instruction (g=0x55e86ad49660, executable=0x55e86adbe0f0, instruction=0x55e86afb4380) at ../src/codegen.cpp:5245 /// #5 0x000055e869c696d1 in ir_render (g=0x55e86ad49660, fn_entry=0x55e86adbdf90) at ../src/codegen.cpp:5380 /// #6 0x000055e869c6db70 in do_code_gen (g=0x55e86ad49660) at ../src/codegen.cpp:6376 /// #7 0x000055e869c7441d in codegen_build_and_link (g=0x55e86ad49660) at ../src/codegen.cpp:8229 /// #8 0x000055e869ce5739 in main (argc=4, argv=0x7fffdaaa5ee8) at ../src/main.cpp:972 //test "undefined.u0" { // var val: u0 = undefined; // switch (val) { // 0 => assert(val == 0), // } //} var once: bool = false; var prng: DefaultPrng = undefined; fn seed() u64 { var timer = Timer.start() catch return 123; return timer.read(); } fn rand() u64 { if (!once) { once = true; prng = DefaultPrng.init(seed()); } return prng.random.scalar(u64); } /// $ zig test ux-semantics.zig /// Trunc only produces integer /// trunc i64 %3 to void, !dbg !780 /// LLVM ERROR: Broken module found, compilation aborted! //test "undefined.u0.truncate.u0.rand.FAILS" { // var i: u8 = 32; // while (i > 0) : (i -= 1) { // var val: u0 = undefined; // val = @truncate(u0, rand()); // assert(val == 0); // } //} test "undefined.u0.truncate.u0.literal.OK" { var i: u8 = 32; while (i > 0) : (i -= 1) { var val: u0 = undefined; val = @truncate(u0, 123); assert(val == 0); } } test "undefined.u1" { var i: u8 = 32; while (i > 0) : (i -= 1) { var val: u1 = undefined; val = @truncate(u1, rand()); switch (val) { 0 => assert(val == 0), 1 => assert(val == 1), } } } test "assignment.u0" { var val: u0 = 0; assert(val == 0); // val = 1; // Expected an error, got error: integer value 1 cannot be implicitly casted to type 'u0'. // It seems possible this could be done via some // unsafe cast or call to a external function, assert(val == 0); // but if it did the result read back must always 0. } test "assignment.u1" { var val: u1 = 0; assert(val == 0); val = 1; assert(val == 1); } test "sizeof.u0" { assert(@sizeOf(u0) == 0); var val: u0 = 0; assert(@sizeOf(@typeOf(val)) == 0); } test "sizeof.u1" { assert(@sizeOf(u1) == 1); var val: u1 = 1; assert(@sizeOf(@typeOf(val)) == 1); } test "intCast.u0" { var val: u0 = 0; assert(@intCast(u8, val) == 0); } test "intCast.u1" { var val: u1 = 1; assert(@intCast(u8, val) == 1); } test "address.u0" { var val: u0 = 0; assert(val == 0); var pVal = &val; assert(pVal == &val); assert(pVal.* == 0); pVal.* = 0; assert(val == 0); assert(pVal.* == 0); } test "address.u1" { var val: u1 = 0; assert(val == 0); var pVal = &val; assert(pVal == &val); assert(pVal.* == 0); pVal.* = 1; assert(val == 1); assert(pVal.* == 1); } fn S1field(comptime T1: type) type { return struct { f1: T1, }; } test "struct.S1field.u8" { const S1f = S1field(u8); var s1f = S1f { .f1 = 0,}; assert(s1f.f1 == 0); assert(@sizeOf(S1f) == 1); assert(@offsetOf(S1f, "f1") == 0); } /// Compile fails, see https://github.com/ziglang/zig/issues/1564 /// /// $ zig test ux-semantics.zig /// /home/wink/prgs/ziglang/zig-ux-semantics/ux-semantics.zig:226:27: error: zero-bit field 'f1' in struct 'S1field(u0)' has no offset /// assert(@offsetOf(S1f, "f1") == 0); // error: zero-bit field ... /// ^ //test "struct.S1field.u0" { // const S1f = S1field(u0); // var s1f = S1f { .f1 = 0,}; // assert(s1f.f1 == 0); // assert(@sizeOf(S1f) == 0); // assert(@offsetOf(S1f, "f1") == 0); // error: zero-bit field ... //} fn displayF1ValOffsetAddr(s1: var) void { warn("s1.f1={} offset(s1.f1)={} &s1.f1={*}\n", s1.f1, @intCast(usize, @offsetOf(@typeOf(s1), "f1")), &s1.f1); } test "displayF1ValOffsetAddr.u1" { warn("\n"); const S1f = S1field(u1); var s1f = S1f { .f1 = 0,}; displayF1ValOffsetAddr(s1f); } test "displayF1ValOffsetAddr.i128" { warn("\n"); const S1f = S1field(i128); var s1f = S1f { .f1 = 0,}; displayF1ValOffsetAddr(s1f); } /// Compile fails, same error as test "struct.S1field.u0" /// /// /home/wink/prgs/ziglang/zig-ux-semantics/ux-semantics.zig:170:55: error: zero-bit field 'f1' in struct 'S1field(u0)' has no offset /// s1.f1, @intCast(usize, @offsetOf(@typeOf(s1), "f1")), &s1.f1); /// ^ /// /home/wink/prgs/ziglang/zig-ux-semantics/ux-semantics.zig:198:27: note: called from here /// displayF1ValOffsetAddr(s1f); /// ^ //test "displayF1ValOffsetAddr.u0" { // const S1f = S1field(u0); // var s1f = S1f { .f1 = 0,}; // displayF1ValOffsetAddr(s1f); //}
ux-semantics.zig
const std = @import("std"); const fmt = std.fmt; const os = std.os; const c = @import("c_imports.zig").c; const allocator = std.heap.c_allocator; const buffer = @import("buffer.zig"); const config = @import("config.zig"); const Config = config.Config; const EditorSyntax = @import("syntax.zig").EditorSyntax; const HLDB = @import("syntax.zig").HLDB; // static variables in the original BYOTE var quit_times: usize = KILO_QUIT_TIMES; // in editorProcessKeypress() var efc_last_match: isize = -1; // in editorFindCallback() var efc_direction: i16 = 1; // in editorFindCallback() var efc_saved_hl_line: usize = undefined; // in editorFindCallback() var efc_saved_hl: ?[]EditorHighlight = null; // in editorFindCallback() //// defines //// const KILO_VERSION = @import("defines.zig").KILO_VERSION; const KILO_QUIT_TIMES = @import("defines.zig").KILO_QUIT_TIMES; const EditorKey = @import("defines.zig").EditorKey; const EditorHighlight = @import("defines.zig").EditorHighlight; //// data //// const TerminalError = error { Tcsetattr, Tcgetattr, Termcap, TerminalRead, TerminalWrite, }; //// prototypes - unnecessary for Zig //// //// terminal //// fn ctrl(k: u8) u8 { return k & 0x1F; } fn disableRawMode(cfg: *Config) void { _ = c.tcsetattr(os.STDIN_FILENO, c.TCSAFLUSH, &cfg.orig_termios); // TODO return error.Tcgetattr; } fn enableRawMode(cfg: *Config) TerminalError!void { var ret = c.tcgetattr(os.STDIN_FILENO, &(cfg.orig_termios)); if (ret == -1) { return error.Tcgetattr; } var raw: c.termios = cfg.orig_termios; raw.c_iflag &= ~u16(c.BRKINT | c.ICRNL | c.INPCK | c.ISTRIP | c.IXON); raw.c_oflag &= ~u16(c.OPOST); raw.c_cflag |= u16(c.CS8); raw.c_lflag &= ~u16(c.ECHO | c.ICANON | c.IEXTEN | c.ISIG); raw.c_cc[c.VMIN] = 0; raw.c_cc[c.VTIME] = 1; ret = c.tcsetattr(os.STDIN_FILENO, c.TCSAFLUSH, &raw); if (ret == -1) { return error.Tcsetattr; } } fn editorReadKey() !u16 { const stdin_file = try std.io.getStdIn(); var keybuf: [32]u8 = undefined; // TODO stdin_file.read() is a blocking I/O call, // so this loop shouldn't be necessary. var num_chars_read: usize = 0; while (num_chars_read == 0) { num_chars_read = try stdin_file.read(keybuf[0..1]); } if (keybuf[0] == '\x1b') { _ = stdin_file.read(keybuf[1..2]) catch return '\x1b'; _ = stdin_file.read(keybuf[2..3]) catch return '\x1b'; if (keybuf[1] == '[') { if (keybuf[2] >= '0' and keybuf[2] <= '9') { _ = stdin_file.read(keybuf[3..4]) catch return '\x1b'; if (keybuf[3] == '~') { switch (keybuf[2]) { '1' => return @enumToInt(EditorKey.Home), '3' => return @enumToInt(EditorKey.Delete), '4' => return @enumToInt(EditorKey.End), '5' => return @enumToInt(EditorKey.PgUp), '6' => return @enumToInt(EditorKey.PgDn), '7' => return @enumToInt(EditorKey.Home), '8' => return @enumToInt(EditorKey.End), else => {}, } } } else { switch (keybuf[2]) { 'A' => return @enumToInt(EditorKey.ArrowUp), 'B' => return @enumToInt(EditorKey.ArrowDown), 'C' => return @enumToInt(EditorKey.ArrowRight), 'D' => return @enumToInt(EditorKey.ArrowLeft), 'H' => return @enumToInt(EditorKey.Home), 'F' => return @enumToInt(EditorKey.End), else => {}, } } } else if (keybuf[1] == 'O') { switch (keybuf[2]) { 'H' => return @enumToInt(EditorKey.Home), 'F' => return @enumToInt(EditorKey.End), else => {}, } } return '\x1b'; } else { return u16(keybuf[0]); } } fn getCursorPosition() TerminalError![2]u16 { var ret = c.write(c.STDOUT_FILENO, c"\x1b[6n", 4); if (ret != 4) return error.TerminalWrite; // The terminal answers with something like "\x1b[24;80\x00". Read it. var buf: [32]u8 = undefined; for (buf) |*value, i| { var ret2 = c.read(c.STDIN_FILENO, value, 1); if (ret2 != 1 or value.* == 'R') { buf[i + 1] = '\x00'; break; } } // Parse buf. if (buf[0] != '\x1b' or buf[1] != '[') return error.Termcap; var rowPos: c_int = undefined; var colPos: c_int = undefined; ret = c.sscanf(buf[2..].ptr, c"%d;%d", &rowPos, &colPos); if (ret != 2) { return error.Termcap; } return [2]u16{@intCast(u16, colPos), @intCast(u16, rowPos)}; } fn getWindowSize() TerminalError![2]u16 { var ws: c.winsize = undefined; var ret = c.ioctl(c.STDOUT_FILENO, c.TIOCGWINSZ, &ws); if (ret != -1 and ws.ws_col != 0) { var result = [2]u16{ws.ws_col, ws.ws_row}; return result; } // ioctl didn't work. Now, move the cursor to bottom right of the screen, // then return the cursor position as the screen size. var ret2 = c.write(c.STDOUT_FILENO, c"\x1b[999C\x1b[999B", 12); if (ret2 != 12) { // return error.TerminalWrite; // WORKAROUND This kills compiler. } return getCursorPosition(); } //// syntax highlighting //// // is_separator -- see buffer.is_separator() // editorUpdateSyntax -- see buffer.Row.updateSyntax() // editorSyntaxToColor -- see defines.EditorHighlight.color() fn editorSelectSyntaxHighlight(cfg: *Config) !void { cfg.syntax = null; const filename = cfg.filename orelse return; for (HLDB) |hldb| { for (hldb.fileMatch) |fm| { if (std.mem.endsWith(u8, filename, fm)) { cfg.syntax = &hldb; for (cfg.rows.toSlice()) |row| { try row.updateSyntax(); } return; } } } } //// row operations //// // editorRowCxToRx -- see buffer.Row.screenColumn() // editorRowRxToCx -- see buffer.Row.screenColToCharsIndex() // editorUpdateRow -- see buffer.Row.render() fn editorInsertRow(cfg: *Config, at: usize, s: []const u8) !void { if (at > cfg.numRows) return; var r: *buffer.Row = try buffer.Row.initFromString(cfg, &s[0..]); for (cfg.rows.toSlice()[at..]) |row| { row.idx += 1; } r.idx = at; try r.render(); try cfg.rows.insert(at, r); cfg.numRows += 1; cfg.dirty += 1; } fn editorFreeRow(row: *buffer.Row) void { row.deinit(); } fn editorDelRow(cfg: *Config, at: usize) void { if (at >= cfg.numRows) return; editorFreeRow(cfg.rows.at(at)); _ = cfg.rows.orderedRemove(at); for (cfg.rows.toSlice()) |row| { row.idx -= 1; } cfg.numRows -= 1; cfg.dirty += 1; } fn editorRowInsertChar( cfg: *Config, row: *buffer.Row, insert_at: usize, ch: u8 ) !void { try row.insertChar(insert_at, ch); cfg.dirty += 1; } fn editorRowAppendString(cfg: *Config, row: *buffer.Row, s: []u8) !void { try row.appendString(s); cfg.dirty += 1; } fn editorRowDelChar(cfg: *Config, row: *buffer.Row, at: usize) !void { try row.delChar(at); cfg.dirty += 1; } //// editor operations //// fn editorInsertChar(cfg: *Config, ch: u8) !void { if (cfg.cursorY == cfg.numRows) { try editorInsertRow(cfg, cfg.numRows, ""); } try editorRowInsertChar(cfg, cfg.rows.at(cfg.cursorY), cfg.cursorX, ch); cfg.cursorX += 1; } fn editorInsertNewline(cfg: *Config) !void { if (cfg.cursorX == 0) { try editorInsertRow(cfg, cfg.cursorY, ""); } else { var row = cfg.rows.at(cfg.cursorY); try editorInsertRow(cfg, cfg.cursorY + 1, row.chars[cfg.cursorX ..]); row = cfg.rows.at(cfg.cursorY); row.chars = row.chars[0 .. cfg.cursorX]; try row.render(); } cfg.cursorY += 1; cfg.cursorX = 0; } fn editorDelChar(cfg: *Config) !void { if (cfg.cursorY == cfg.numRows) return; if (cfg.cursorX == 0 and cfg.cursorY == 0) return; const row = cfg.rows.at(cfg.cursorY); if (cfg.cursorX > 0) { try editorRowDelChar(cfg, row, cfg.cursorX - 1); cfg.cursorX -= 1; } else { cfg.cursorX = cfg.rows.at(cfg.cursorY - 1).len(); try editorRowAppendString(cfg, cfg.rows.at(cfg.cursorY - 1), row.chars); editorDelRow(cfg, cfg.cursorY); cfg.cursorY -= 1; } } //// file i/o //// // Caller must free the result. fn editorRowsToString(cfg: *Config) ![]u8 { var totalLen: usize = 0; var idx_row: usize = 0; while (idx_row < cfg.numRows): (idx_row += 1) { totalLen += cfg.rows.at(idx_row).len() + 1; } var result: []u8 = try allocator.alloc(u8, totalLen); var idx_result: usize = 0; for (cfg.rows.toSlice()) |row| { std.mem.copy(u8, result[idx_result .. idx_result + row.len()], row.chars[0..]); idx_result += row.len(); result[idx_result] = '\n'; idx_result += 1; } return result; } fn editorOpen(cfg: *Config, filename: []u8) !void { if (cfg.filename) |f| { allocator.free(f); } cfg.filename = try std.mem.dupe(allocator, u8, filename); try editorSelectSyntaxHighlight(cfg); var file: std.fs.File = try std.fs.File.openRead(filename); defer file.close(); var line_buf = try std.Buffer.initSize(allocator, 0); defer line_buf.deinit(); while (file.inStream().stream .readUntilDelimiterBuffer(&line_buf, '\n', c.LINE_MAX)) { try editorInsertRow(cfg, cfg.numRows, line_buf.toSlice()); } else |err| switch (err) { error.EndOfStream => {}, else => return err, } cfg.dirty = 0; } fn editorSave(cfg: *Config) !void { var filename: []u8 = undefined; if (cfg.filename) |f| { filename = f; } else { var resp = try editorPrompt(cfg, "Save as: {s} (ESC to cancel)", null); if (resp) |f| { filename = f; cfg.filename = f; try editorSelectSyntaxHighlight(cfg); } else { try editorSetStatusMessage(cfg, "Save aborted"); return; } } const buf = try editorRowsToString(cfg); defer allocator.free(buf); if (std.io.writeFile(filename, buf)) |_| { cfg.dirty = 0; try editorSetStatusMessage(cfg, "{} bytes written to disk", buf.len); } else |err| { try editorSetStatusMessage(cfg, "Can't save! I/O error: {}", err); } } //// find //// fn editorFindCallback(cfg: *Config, query: []u8, ch: u16 ) anyerror!void { // This function in the origital BYOTE has some static variables. // They are global variables in this Zig version. // // efc_last_match -- index of the row that the last match was on, // or -1 if there was no last match // efc_direction -- 1 for searching forward, -1 backward // efc_saved_hl_line -- copy of Row.hl before highlighting // efc_saved_hl -- line number for efc_saved_hl_line if (efc_saved_hl) |shl| { const row = cfg.rows.at(efc_saved_hl_line); for (shl) |v, idx| { row.hl[idx] = v; } allocator.free(shl); efc_saved_hl = null; } if (ch == '\r' or ch == '\x1b') { efc_last_match = -1; efc_direction = 1; return; } else if (ch == @enumToInt(EditorKey.ArrowRight) or ch == @enumToInt(EditorKey.ArrowDown)) { efc_direction = 1; } else if (ch == @enumToInt(EditorKey.ArrowLeft) or ch == @enumToInt(EditorKey.ArrowUp)) { efc_direction = -1; } else { efc_last_match = -1; efc_direction = 1; } if (efc_last_match == -1) efc_direction = 1; var current: i16 = @intCast(i16, efc_last_match); // current row var idx: u16 = 0; while (idx < cfg.rows.count()): (idx += 1) { current += efc_direction; if (current == -1) { // wrap to bottom of file current = @intCast(i16, cfg.numRows) - 1; } else if (current == @intCast(i16, cfg.numRows)) { // wrap to beginning of file current = 0; } var row = cfg.rows.at(@intCast(usize, current)); if (row.find(query, 0)) |col| { efc_last_match = current; cfg.cursorY = @intCast(u16, current); cfg.cursorX = row.screenColToCharsIndex(col); cfg.rowOffset = cfg.numRows; efc_saved_hl_line = @intCast(usize, current); efc_saved_hl = try allocator.alloc(EditorHighlight, row.len()); for (row.hl) |v, i| { efc_saved_hl.?[i] = v; } std.mem.set(EditorHighlight, row.hl[col .. col + query.len], EditorHighlight.Match); break; } } } fn editorFind(cfg: *Config) !void { const saved_cursorX = cfg.cursorX; const saved_cursorY = cfg.cursorY; const saved_colOffset = cfg.colOffset; const saved_rowOffset = cfg.rowOffset; const query = try editorPrompt(cfg, "Search: {s} (Use ESC/Arrows/Enter)", editorFindCallback); if (query) |q| { allocator.free(q); } else { cfg.cursorX = saved_cursorX; cfg.cursorY = saved_cursorY; cfg.colOffset = saved_colOffset; cfg.rowOffset = saved_rowOffset; } } //// append buffer //// const AppendBuffer = struct { buf: []u8, pub fn init(cfg: *const Config) !AppendBuffer { const initial_size: usize = 32; return AppendBuffer { .buf = try allocator.alloc(u8, initial_size), }; } pub fn free(self: AppendBuffer) void { allocator.free(self.buf); } pub fn append(self: *AppendBuffer, s: []const u8) !void { const oldlen = self.buf.len; self.buf = try allocator.realloc(self.buf, oldlen + s.len); for (s) |data, index| { self.buf[oldlen + index] = data; } } }; //// output //// fn editorScroll(cfg: *Config) void { cfg.cursorX_rendered = 0; if (cfg.cursorY < cfg.numRows) { cfg.cursorX_rendered = cfg.rows.at(cfg.cursorY).screenColumn(cfg.cursorX); } // Is cursor above the visible window? if (cfg.cursorY < cfg.rowOffset) { cfg.rowOffset = cfg.cursorY; } // Is cursor past the bottom of the visible window? if (cfg.cursorY >= cfg.rowOffset + cfg.screenRows) { cfg.rowOffset = cfg.cursorY - cfg.screenRows + 1; } if (cfg.cursorX_rendered < cfg.colOffset) { cfg.colOffset = cfg.cursorX_rendered; } if (cfg.cursorX_rendered >= cfg.colOffset + cfg.screenCols) { cfg.colOffset = cfg.cursorX_rendered - cfg.screenCols + 1; } } fn editorDrawRows(cfg: *const Config, abuf: *AppendBuffer) !void { var y: u32 = 0; while (y < cfg.screenRows): (y += 1) { var filerow: u32 = y + cfg.rowOffset; if (filerow >= cfg.numRows) { if (cfg.numRows == 0 and y == cfg.screenRows / 3) { var welcome: [80]u8 = undefined; var output = try std.fmt.bufPrint(welcome[0..], "Kilo editor -- version {}", KILO_VERSION); if (output.len > cfg.screenRows) output = output[0..cfg.screenRows]; var padding: usize = (cfg.screenCols - output.len) / 2; if (padding > 0) { try abuf.append("~"); padding -= 1; } while (padding > 0): (padding -= 1) { try abuf.append(" "); } try abuf.append(output); } else { try abuf.append("~"); } } else { const renderedChars: []u8 = cfg.rows.at(filerow).renderedChars; var len = renderedChars.len; if (len < cfg.colOffset) { // Cursor is past EoL; show nothing. len = 0; } else { len -= cfg.colOffset; } len = std.math.min(len, cfg.screenCols); const hl = cfg.rows.at(filerow).hl; var current_color: ?u8 = null; // null == Normal var j: usize = 0; while (j < len): (j += 1) { const ch: []u8 = renderedChars[cfg.colOffset + j .. cfg.colOffset + j + 1]; if (std.ascii.isCntrl(ch[0])) { const sym = [1]u8{ if (ch[0] <= 26) '@' + ch[0] else '?' }; try abuf.append("\x1b[7m"); try abuf.append(sym); try abuf.append("\x1b[m"); if (current_color) |cc| { var buf: [16]u8 = undefined; const clen = try std.fmt.bufPrint(buf[0..], "\x1b[{d}m", cc); try abuf.append(clen); } } else if (hl[cfg.colOffset + j] == EditorHighlight.Normal) { if (current_color) |_| { try abuf.append("\x1b[39m"); // normal color text current_color = null; } try abuf.append(ch); } else { const color = hl[cfg.colOffset + j].color(); if (current_color == null or current_color.? != color) { current_color = color; const clen = try std.fmt.allocPrint(allocator, "\x1b[{d}m", color); defer allocator.free(clen); try abuf.append(clen); } try abuf.append(ch); } } try abuf.append("\x1b[39m"); } try abuf.append("\x1b[K"); // Erase to EOL try abuf.append("\r\n"); } } fn editorDrawStatusBar(cfg: *const Config, abuf: *AppendBuffer) !void { try abuf.append("\x1b[7m"); // inverted color // file name to show in the status line, up to 20 chars var filename: []const u8 = undefined; if (cfg.filename) |f| { if (f.len > 20) { filename = f[0..20]; } else filename = f; } else { filename = "[No Name]"[0..]; } var status = try std.fmt.allocPrint(allocator, "{} - {} lines {}", filename, cfg.numRows, if (cfg.dirty > 0) "(modified)" else "" ); defer allocator.free(status); var right_status = try std.fmt.allocPrint(allocator, "{} | {}/{}", if (cfg.syntax) |s| s.fileType else "no ft", cfg.cursorY + 1, cfg.numRows); defer allocator.free(right_status); var len = @intCast(u16, status.len); len = std.math.min(len, cfg.screenCols); try abuf.append(status); while (len < cfg.screenCols) { if (cfg.screenCols - len == @intCast(u16, right_status.len)) { try abuf.append(right_status); break; } else { try abuf.append(" "); len += 1; } } try abuf.append("\x1b[m"); // back to normal text formatting try abuf.append("\r\n"); } fn editorDrawMessageBar(cfg: *Config, abuf: *AppendBuffer) !void { var sm = cfg.statusMsg orelse return; try abuf.append("\x1b[K"); var msglen = std.math.min(sm.len, cfg.screenCols); if ((msglen > 0) and ((std.time.timestamp() - cfg.statusMsgTime) < 5)) { try abuf.append(sm); } } fn editorRefreshScreen(cfg: *Config) !void { editorScroll(cfg); const abuf: *AppendBuffer = &(try AppendBuffer.init(cfg)); defer abuf.free(); try abuf.append("\x1b[?25l"); try abuf.append("\x1b[H"); try editorDrawRows(cfg, abuf); try editorDrawStatusBar(cfg, abuf); try editorDrawMessageBar(cfg, abuf); var buf: [32]u8 = undefined; var output = try std.fmt.bufPrint(buf[0..], "\x1b[{};{}H", (cfg.cursorY - cfg.rowOffset) + 1, cfg.cursorX_rendered + 1); try abuf.append(output); try abuf.append("\x1b[?25h"); _ = c.write(c.STDOUT_FILENO, abuf.buf.ptr, abuf.buf.len); } fn editorSetStatusMessage( cfg: *Config, comptime format: []const u8, args: ... ) !void { if (cfg.statusMsg) |sm| { allocator.free(sm); } cfg.statusMsg = try std.fmt.allocPrint(allocator, format, args); cfg.statusMsgTime = std.time.timestamp(); } //// input //// // Caller must free the result. fn editorPrompt( cfg: *Config, comptime prompt: []const u8, callback: ?fn (cfg: *Config, prompt: []u8, ch: u16) anyerror!void ) !?[]u8 { var buf = try std.Buffer.init(allocator, ""); while (true) { try editorSetStatusMessage(cfg, prompt, buf.toSlice()[0..]); try editorRefreshScreen(cfg); const ch = try editorReadKey(); if (ch == @enumToInt(EditorKey.Delete) or ch == ctrl('h') or ch == @enumToInt(EditorKey.Backspace) or ch == @enumToInt(EditorKey.Backspace2)) { if (buf.len() != 0) { buf.shrink(buf.len() - 1); } } else if (ch == '\x1b') { // input is cancelled try editorSetStatusMessage(cfg, ""); if (callback) |cb| { try cb(cfg, buf.toSlice(), ch); } buf.deinit(); return null; } else if (ch == '\r') { if (buf.len() != 0) { try editorSetStatusMessage(cfg, ""); if (callback) |cb| { try cb(cfg, buf.toSlice(), ch); } return buf.toSlice(); } } else if (ch < 128 and !std.ascii.isCntrl(@intCast(u8, ch))) { try buf.appendByte(@intCast(u8, ch)); } if (callback) |cb| { try cb(cfg, buf.toSlice(), ch); } } } fn editorMoveCursor(cfg: *Config, key: u16) void { // buffer.Row that the cursor is at. null means past-EoF. var row: ?*(buffer.Row) = if (cfg.cursorY >= cfg.rows.len) null else cfg.rows.at(cfg.cursorY); switch (key) { @enumToInt(EditorKey.ArrowLeft) => { if (cfg.cursorX > 0) { cfg.cursorX -= 1; } else if (cfg.cursorY > 0) { cfg.cursorY -= 1; cfg.cursorX = cfg.rows.at(cfg.cursorY).len(); } }, @enumToInt(EditorKey.ArrowRight) => { if (row != null and cfg.cursorX < row.?.len()) { cfg.cursorX += 1; } else if (row != null and cfg.cursorX == row.?.len()) { cfg.cursorY += 1; cfg.cursorX = 0; } }, @enumToInt(EditorKey.ArrowUp) => { if (cfg.cursorY > 0) cfg.cursorY -= 1; }, @enumToInt(EditorKey.ArrowDown) => { if (cfg.cursorY < cfg.numRows) cfg.cursorY += 1; }, else => {}, } // If the cursor is past EoL, correct it. row = if (cfg.cursorY >= cfg.numRows) null else cfg.rows.at(cfg.cursorY); var rowlen = if (row == null) u16(0) else row.?.len(); if (cfg.cursorX > rowlen) { cfg.cursorX = rowlen; } } fn editorProcessKeypress(cfg: *Config) !void { // quit_times = ...; // variable of static int in the original BYOTE var key = try editorReadKey(); switch (key) { '\r' => try editorInsertNewline(cfg), comptime ctrl('q') => { if (cfg.dirty > 0 and quit_times > 0) { try editorSetStatusMessage(cfg, "WARNING! File has unsaved changes. Press Ctrl-Q {} more times to quit.", quit_times); quit_times -= 1; return; } const stdout_file = try std.io.getStdOut(); _ = c.write(c.STDOUT_FILENO, c"\x1b[2J", 4); _ = c.write(c.STDOUT_FILENO, c"\x1b[H", 3); c.exit(0); // TODO }, comptime ctrl('s') => try editorSave(cfg), @enumToInt(EditorKey.Home) => { cfg.cursorX = 0; }, @enumToInt(EditorKey.End) => { if (cfg.cursorY < cfg.numRows) cfg.cursorX = cfg.rows.at(cfg.cursorY).len(); }, comptime ctrl('f') => try editorFind(cfg), @enumToInt(EditorKey.Backspace), @enumToInt(EditorKey.Backspace2), @enumToInt(EditorKey.Delete) => { if (key == @enumToInt(EditorKey.Delete)) { editorMoveCursor(cfg, @enumToInt(EditorKey.ArrowRight)); } try editorDelChar(cfg); }, @enumToInt(EditorKey.PgUp), @enumToInt(EditorKey.PgDn) => { if (key == @enumToInt(EditorKey.PgUp)) { cfg.cursorY = cfg.rowOffset; } else if (key == @enumToInt(EditorKey.PgDn)) { cfg.cursorY = cfg.rowOffset + cfg.screenRows - 1; if (cfg.cursorY > cfg.numRows) cfg.cursorY = cfg.numRows; } var times = cfg.screenRows; while (times > 0): (times -= 1) { editorMoveCursor(cfg, if (key == @enumToInt(EditorKey.PgUp)) @enumToInt(EditorKey.ArrowUp) else @enumToInt(EditorKey.ArrowDown)); } }, @enumToInt(EditorKey.ArrowUp), @enumToInt(EditorKey.ArrowDown), @enumToInt(EditorKey.ArrowLeft), @enumToInt(EditorKey.ArrowRight) => editorMoveCursor(cfg, key), comptime ctrl('l'), @enumToInt(EditorKey.Esc) => {}, // TODO else => { try editorInsertChar(cfg, @intCast(u8, key)); }, } quit_times = KILO_QUIT_TIMES; } //// init //// fn initEditor(cfg: *Config) !void { cfg.cursorX = 0; cfg.cursorY = 0; cfg.cursorX_rendered = 0; cfg.rowOffset = 0; cfg.colOffset = 0; cfg.numRows = 0; var ret = try getWindowSize(); cfg.screenCols = ret[0]; cfg.screenRows = ret[1]; cfg.screenRows -= 2; // for status line } fn main_sub() !u8 { // command line args var args_it = std.process.args(); const ego = try args_it.next(allocator).?; const filename_opt: ?[]u8 = if (args_it.next(allocator)) |foo| blk: { break :blk try foo; } else null; var cfg = Config.init(); try enableRawMode(&cfg); defer disableRawMode(&cfg); try initEditor(&cfg); if (filename_opt) |filename| { try editorOpen(&cfg, filename); } try editorSetStatusMessage(&cfg, "HELP: Ctrl-S = save | Ctrl-Q = quit | Ctrl-F = find"); while (true) { try editorRefreshScreen(&cfg); try editorProcessKeypress(&cfg); } return 0; } pub fn main() u8 { if (main_sub()) |v| { return 0; } else |err| { return 1; } } // eof
kilo.zig
const is_test = @import("builtin").is_test; const std = @import("std"); const math = std.math; const testing = std.testing; const warn = std.debug.warn; const fixint = @import("fixint.zig").fixint; fn test__fixint(comptime fp_t: type, comptime fixint_t: type, a: fp_t, expected: fixint_t) void { const x = fixint(fp_t, fixint_t, a); //warn("a={} x={}:{x} expected={}:{x})\n", .{a, x, x, expected, expected}); testing.expect(x == expected); } test "fixint.i1" { test__fixint(f32, i1, -math.inf_f32, -1); test__fixint(f32, i1, -math.f32_max, -1); test__fixint(f32, i1, -2.0, -1); test__fixint(f32, i1, -1.1, -1); test__fixint(f32, i1, -1.0, -1); test__fixint(f32, i1, -0.9, 0); test__fixint(f32, i1, -0.1, 0); test__fixint(f32, i1, -math.f32_min, 0); test__fixint(f32, i1, -0.0, 0); test__fixint(f32, i1, 0.0, 0); test__fixint(f32, i1, math.f32_min, 0); test__fixint(f32, i1, 0.1, 0); test__fixint(f32, i1, 0.9, 0); test__fixint(f32, i1, 1.0, 0); test__fixint(f32, i1, 2.0, 0); test__fixint(f32, i1, math.f32_max, 0); test__fixint(f32, i1, math.inf_f32, 0); } test "fixint.i2" { test__fixint(f32, i2, -math.inf_f32, -2); test__fixint(f32, i2, -math.f32_max, -2); test__fixint(f32, i2, -2.0, -2); test__fixint(f32, i2, -1.9, -1); test__fixint(f32, i2, -1.1, -1); test__fixint(f32, i2, -1.0, -1); test__fixint(f32, i2, -0.9, 0); test__fixint(f32, i2, -0.1, 0); test__fixint(f32, i2, -math.f32_min, 0); test__fixint(f32, i2, -0.0, 0); test__fixint(f32, i2, 0.0, 0); test__fixint(f32, i2, math.f32_min, 0); test__fixint(f32, i2, 0.1, 0); test__fixint(f32, i2, 0.9, 0); test__fixint(f32, i2, 1.0, 1); test__fixint(f32, i2, 2.0, 1); test__fixint(f32, i2, math.f32_max, 1); test__fixint(f32, i2, math.inf_f32, 1); } test "fixint.i3" { test__fixint(f32, i3, -math.inf_f32, -4); test__fixint(f32, i3, -math.f32_max, -4); test__fixint(f32, i3, -4.0, -4); test__fixint(f32, i3, -3.0, -3); test__fixint(f32, i3, -2.0, -2); test__fixint(f32, i3, -1.9, -1); test__fixint(f32, i3, -1.1, -1); test__fixint(f32, i3, -1.0, -1); test__fixint(f32, i3, -0.9, 0); test__fixint(f32, i3, -0.1, 0); test__fixint(f32, i3, -math.f32_min, 0); test__fixint(f32, i3, -0.0, 0); test__fixint(f32, i3, 0.0, 0); test__fixint(f32, i3, math.f32_min, 0); test__fixint(f32, i3, 0.1, 0); test__fixint(f32, i3, 0.9, 0); test__fixint(f32, i3, 1.0, 1); test__fixint(f32, i3, 2.0, 2); test__fixint(f32, i3, 3.0, 3); test__fixint(f32, i3, 4.0, 3); test__fixint(f32, i3, math.f32_max, 3); test__fixint(f32, i3, math.inf_f32, 3); } test "fixint.i32" { test__fixint(f64, i32, -math.inf_f64, math.minInt(i32)); test__fixint(f64, i32, -math.f64_max, math.minInt(i32)); test__fixint(f64, i32, @as(f64, math.minInt(i32)), math.minInt(i32)); test__fixint(f64, i32, @as(f64, math.minInt(i32)) + 1, math.minInt(i32) + 1); test__fixint(f64, i32, -2.0, -2); test__fixint(f64, i32, -1.9, -1); test__fixint(f64, i32, -1.1, -1); test__fixint(f64, i32, -1.0, -1); test__fixint(f64, i32, -0.9, 0); test__fixint(f64, i32, -0.1, 0); test__fixint(f64, i32, -math.f32_min, 0); test__fixint(f64, i32, -0.0, 0); test__fixint(f64, i32, 0.0, 0); test__fixint(f64, i32, math.f32_min, 0); test__fixint(f64, i32, 0.1, 0); test__fixint(f64, i32, 0.9, 0); test__fixint(f64, i32, 1.0, 1); test__fixint(f64, i32, @as(f64, math.maxInt(i32)) - 1, math.maxInt(i32) - 1); test__fixint(f64, i32, @as(f64, math.maxInt(i32)), math.maxInt(i32)); test__fixint(f64, i32, math.f64_max, math.maxInt(i32)); test__fixint(f64, i32, math.inf_f64, math.maxInt(i32)); } test "fixint.i64" { test__fixint(f64, i64, -math.inf_f64, math.minInt(i64)); test__fixint(f64, i64, -math.f64_max, math.minInt(i64)); test__fixint(f64, i64, @as(f64, math.minInt(i64)), math.minInt(i64)); test__fixint(f64, i64, @as(f64, math.minInt(i64)) + 1, math.minInt(i64)); test__fixint(f64, i64, @as(f64, math.minInt(i64) / 2), math.minInt(i64) / 2); test__fixint(f64, i64, -2.0, -2); test__fixint(f64, i64, -1.9, -1); test__fixint(f64, i64, -1.1, -1); test__fixint(f64, i64, -1.0, -1); test__fixint(f64, i64, -0.9, 0); test__fixint(f64, i64, -0.1, 0); test__fixint(f64, i64, -math.f32_min, 0); test__fixint(f64, i64, -0.0, 0); test__fixint(f64, i64, 0.0, 0); test__fixint(f64, i64, math.f32_min, 0); test__fixint(f64, i64, 0.1, 0); test__fixint(f64, i64, 0.9, 0); test__fixint(f64, i64, 1.0, 1); test__fixint(f64, i64, @as(f64, math.maxInt(i64)) - 1, math.maxInt(i64)); test__fixint(f64, i64, @as(f64, math.maxInt(i64)), math.maxInt(i64)); test__fixint(f64, i64, math.f64_max, math.maxInt(i64)); test__fixint(f64, i64, math.inf_f64, math.maxInt(i64)); } test "fixint.i128" { test__fixint(f64, i128, -math.inf_f64, math.minInt(i128)); test__fixint(f64, i128, -math.f64_max, math.minInt(i128)); test__fixint(f64, i128, @as(f64, math.minInt(i128)), math.minInt(i128)); test__fixint(f64, i128, @as(f64, math.minInt(i128)) + 1, math.minInt(i128)); test__fixint(f64, i128, -2.0, -2); test__fixint(f64, i128, -1.9, -1); test__fixint(f64, i128, -1.1, -1); test__fixint(f64, i128, -1.0, -1); test__fixint(f64, i128, -0.9, 0); test__fixint(f64, i128, -0.1, 0); test__fixint(f64, i128, -math.f32_min, 0); test__fixint(f64, i128, -0.0, 0); test__fixint(f64, i128, 0.0, 0); test__fixint(f64, i128, math.f32_min, 0); test__fixint(f64, i128, 0.1, 0); test__fixint(f64, i128, 0.9, 0); test__fixint(f64, i128, 1.0, 1); test__fixint(f64, i128, @as(f64, math.maxInt(i128)) - 1, math.maxInt(i128)); test__fixint(f64, i128, @as(f64, math.maxInt(i128)), math.maxInt(i128)); test__fixint(f64, i128, math.f64_max, math.maxInt(i128)); test__fixint(f64, i128, math.inf_f64, math.maxInt(i128)); }
lib/std/special/compiler_rt/fixint_test.zig
const __ashrdi3 = @import("shift.zig").__ashrdi3; const testing = @import("std").testing; fn test__ashrdi3(a: i64, b: i32, expected: u64) void { const x = __ashrdi3(a, b); testing.expectEqual(@bitCast(i64, expected), x); } test "ashrdi3" { test__ashrdi3(@bitCast(i64, @as(u64, 0x0123456789ABCDEF)), 0, 0x123456789ABCDEF); test__ashrdi3(@bitCast(i64, @as(u64, 0x0123456789ABCDEF)), 1, 0x91A2B3C4D5E6F7); test__ashrdi3(@bitCast(i64, @as(u64, 0x0123456789ABCDEF)), 2, 0x48D159E26AF37B); test__ashrdi3(@bitCast(i64, @as(u64, 0x0123456789ABCDEF)), 3, 0x2468ACF13579BD); test__ashrdi3(@bitCast(i64, @as(u64, 0x0123456789ABCDEF)), 4, 0x123456789ABCDE); test__ashrdi3(@bitCast(i64, @as(u64, 0x0123456789ABCDEF)), 28, 0x12345678); test__ashrdi3(@bitCast(i64, @as(u64, 0x0123456789ABCDEF)), 29, 0x91A2B3C); test__ashrdi3(@bitCast(i64, @as(u64, 0x0123456789ABCDEF)), 30, 0x48D159E); test__ashrdi3(@bitCast(i64, @as(u64, 0x0123456789ABCDEF)), 31, 0x2468ACF); test__ashrdi3(@bitCast(i64, @as(u64, 0x0123456789ABCDEF)), 32, 0x1234567); test__ashrdi3(@bitCast(i64, @as(u64, 0x0123456789ABCDEF)), 33, 0x91A2B3); test__ashrdi3(@bitCast(i64, @as(u64, 0x0123456789ABCDEF)), 34, 0x48D159); test__ashrdi3(@bitCast(i64, @as(u64, 0x0123456789ABCDEF)), 35, 0x2468AC); test__ashrdi3(@bitCast(i64, @as(u64, 0x0123456789ABCDEF)), 36, 0x123456); test__ashrdi3(@bitCast(i64, @as(u64, 0x0123456789ABCDEF)), 60, 0); test__ashrdi3(@bitCast(i64, @as(u64, 0x0123456789ABCDEF)), 61, 0); test__ashrdi3(@bitCast(i64, @as(u64, 0x0123456789ABCDEF)), 62, 0); test__ashrdi3(@bitCast(i64, @as(u64, 0x0123456789ABCDEF)), 63, 0); test__ashrdi3(@bitCast(i64, @as(u64, 0xFEDCBA9876543210)), 0, 0xFEDCBA9876543210); test__ashrdi3(@bitCast(i64, @as(u64, 0xFEDCBA9876543210)), 1, 0xFF6E5D4C3B2A1908); test__ashrdi3(@bitCast(i64, @as(u64, 0xFEDCBA9876543210)), 2, 0xFFB72EA61D950C84); test__ashrdi3(@bitCast(i64, @as(u64, 0xFEDCBA9876543210)), 3, 0xFFDB97530ECA8642); test__ashrdi3(@bitCast(i64, @as(u64, 0xFEDCBA9876543210)), 4, 0xFFEDCBA987654321); test__ashrdi3(@bitCast(i64, @as(u64, 0xFEDCBA9876543210)), 28, 0xFFFFFFFFEDCBA987); test__ashrdi3(@bitCast(i64, @as(u64, 0xFEDCBA9876543210)), 29, 0xFFFFFFFFF6E5D4C3); test__ashrdi3(@bitCast(i64, @as(u64, 0xFEDCBA9876543210)), 30, 0xFFFFFFFFFB72EA61); test__ashrdi3(@bitCast(i64, @as(u64, 0xFEDCBA9876543210)), 31, 0xFFFFFFFFFDB97530); test__ashrdi3(@bitCast(i64, @as(u64, 0xFEDCBA9876543210)), 32, 0xFFFFFFFFFEDCBA98); test__ashrdi3(@bitCast(i64, @as(u64, 0xFEDCBA9876543210)), 33, 0xFFFFFFFFFF6E5D4C); test__ashrdi3(@bitCast(i64, @as(u64, 0xFEDCBA9876543210)), 34, 0xFFFFFFFFFFB72EA6); test__ashrdi3(@bitCast(i64, @as(u64, 0xFEDCBA9876543210)), 35, 0xFFFFFFFFFFDB9753); test__ashrdi3(@bitCast(i64, @as(u64, 0xFEDCBA9876543210)), 36, 0xFFFFFFFFFFEDCBA9); test__ashrdi3(@bitCast(i64, @as(u64, 0xAEDCBA9876543210)), 60, 0xFFFFFFFFFFFFFFFA); test__ashrdi3(@bitCast(i64, @as(u64, 0xAEDCBA9876543210)), 61, 0xFFFFFFFFFFFFFFFD); test__ashrdi3(@bitCast(i64, @as(u64, 0xAEDCBA9876543210)), 62, 0xFFFFFFFFFFFFFFFE); test__ashrdi3(@bitCast(i64, @as(u64, 0xAEDCBA9876543210)), 63, 0xFFFFFFFFFFFFFFFF); }
lib/std/special/compiler_rt/ashrdi3_test.zig
const std = @import("std"); const mem = std.mem; const fmt = std.fmt; const testing = std.testing; use @import("ip"); test "" { _ = @import("./ipv4.zig"); _ = @import("./ipv6.zig"); } test "IpAddress.isIpv4()" { const ip = IpAddress{ .V4 = IpV4Address.init(192, 168, 0, 1), }; testing.expect(ip.isIpv4()); testing.expect(ip.isIpv6() == false); } test "IpAddress.isIpv6()" { const ip = IpAddress{ .V6 = IpV6Address.init(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff), }; testing.expect(ip.isIpv6()); testing.expect(ip.isIpv4() == false); } test "IpAddress.isUnspecified()" { testing.expect((IpAddress{ .V4 = IpV4Address.init(0, 0, 0, 0), }).isUnspecified()); testing.expect((IpAddress{ .V4 = IpV4Address.init(192, 168, 0, 1), }).isUnspecified() == false); testing.expect((IpAddress{ .V6 = IpV6Address.init(0, 0, 0, 0, 0, 0, 0, 0), }).isUnspecified()); testing.expect((IpAddress{ .V6 = IpV6Address.init(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff), }).isUnspecified() == false); } test "IpAddress.isLoopback()" { testing.expect((IpAddress{ .V4 = IpV4Address.init(127, 0, 0, 1), }).isLoopback()); testing.expect((IpAddress{ .V4 = IpV4Address.init(192, 168, 0, 1), }).isLoopback() == false); testing.expect((IpAddress{ .V6 = IpV6Address.init(0, 0, 0, 0, 0, 0, 0, 0x1), }).isLoopback()); testing.expect((IpAddress{ .V6 = IpV6Address.init(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff), }).isLoopback() == false); } test "IpAddress.isMulticast()" { testing.expect((IpAddress{ .V4 = IpV4Address.init(236, 168, 10, 65), }).isMulticast()); testing.expect((IpAddress{ .V4 = IpV4Address.init(172, 16, 10, 65), }).isMulticast() == false); testing.expect((IpAddress{ .V6 = IpV6Address.init(0xff00, 0, 0, 0, 0, 0, 0, 0), }).isMulticast()); testing.expect((IpAddress{ .V6 = IpV6Address.init(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff), }).isMulticast() == false); } test "IpAddress.isDocumentation()" { testing.expect((IpAddress{ .V4 = IpV4Address.init(203, 0, 113, 6), }).isDocumentation()); testing.expect((IpAddress{ .V4 = IpV4Address.init(193, 34, 17, 19), }).isDocumentation() == false); testing.expect((IpAddress{ .V6 = IpV6Address.init(0x2001, 0xdb8, 0, 0, 0, 0, 0, 0), }).isDocumentation()); testing.expect((IpAddress{ .V6 = IpV6Address.init(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff), }).isDocumentation() == false); } test "IpAddress.isGloballyRoutable()" { testing.expect((IpAddress{ .V4 = IpV4Address.init(10, 254, 0, 0), }).isGloballyRoutable() == false); testing.expect((IpAddress{ .V4 = IpV4Address.init(80, 9, 12, 3), }).isGloballyRoutable()); testing.expect((IpAddress{ .V6 = IpV6Address.init(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff), }).isGloballyRoutable()); testing.expect((IpAddress{ .V6 = IpV6Address.init(0, 0, 0x1c9, 0, 0, 0xafc8, 0, 0x1), }).isGloballyRoutable()); testing.expect((IpAddress{ .V6 = IpV6Address.init(0, 0, 0, 0, 0, 0, 0, 0x1), }).isGloballyRoutable() == false); } test "IpAddress.equals()" { testing.expect((IpAddress{ .V4 = IpV4Address.init(127, 0, 0, 1), }).equals(IpAddress{ .V4 = IpV4Address.Localhost })); testing.expect((IpAddress{ .V6 = IpV6Address.init(0, 0, 0, 0, 0, 0, 0, 1), }).equals(IpAddress{ .V6 = IpV6Address.Localhost })); testing.expect((IpAddress{ .V6 = IpV6Address.init(0, 0, 0, 0, 0, 0, 0, 1), }).equals(IpAddress{ .V4 = IpV4Address.init(127, 0, 0, 1) }) == false); } fn testFormatIpAddress(address: IpAddress, expected: []const u8) !void { var buffer: [1024]u8 = undefined; const buf = buffer[0..]; const result = try fmt.bufPrint(buf, "{}", address); testing.expectEqualSlices(u8, result, expected); } test "IpAddress.format()" { try testFormatIpAddress(IpAddress{ .V4 = IpV4Address.init(192, 168, 0, 1), }, "192.168.0.1"); try testFormatIpAddress(IpAddress{ .V6 = IpV6Address.init(0x2001, 0xdb8, 0x85a3, 0x8d3, 0x1319, 0x8a2e, 0x370, 0x7348), }, "2001:db8:85a3:8d3:1319:8a2e:370:7348"); } fn testIpParseError(addr: []const u8, expected_error: ParseError) void { testing.expectError(expected_error, IpAddress.parse(addr)); } test "IpAddress.parse()" { const parsed = try IpAddress.parse("127.0.0.1"); testing.expect(parsed.equals(IpAddress{ .V4 = IpV4Address.Localhost, })); testIpParseError("256.0.0.1", ParseError.Overflow); testIpParseError("x.0.0.1", ParseError.InvalidCharacter); testIpParseError("127.0.0.1.1", ParseError.TooManyOctets); testIpParseError("127.0.0.", ParseError.Incomplete); testIpParseError("100..0.1", ParseError.InvalidCharacter); }
test/main.zig
const std = @import("std"); const ascii = std.ascii; const testing = std.testing; const Impl = @import("../impl.zig").Impl; const CallbackHandler = @import("../callback_handler.zig").CallbackHandler; const iup = @import("iup.zig"); const interop = @import("interop.zig"); const ChildrenIterator = iup.ChildrenIterator; pub const Handle = interop.Handle; pub const Fill = @import("elements/fill.zig").Fill; pub const DetachBox = @import("elements/detach_box.zig").DetachBox; pub const Split = @import("elements/split.zig").Split; pub const HBox = @import("elements/h_box.zig").HBox; pub const Label = @import("elements/label.zig").Label; pub const Tree = @import("elements/tree.zig").Tree; pub const BackgroundBox = @import("elements/background_box.zig").BackgroundBox; pub const Normalizer = @import("elements/normalizer.zig").Normalizer; pub const FontDlg = @import("elements/font_dlg.zig").FontDlg; pub const FlatList = @import("elements/flat_list.zig").FlatList; pub const Thread = @import("elements/thread.zig").Thread; pub const AnimatedLabel = @import("elements/animated_label.zig").AnimatedLabel; pub const ColorDlg = @import("elements/color_dlg.zig").ColorDlg; pub const Timer = @import("elements/timer.zig").Timer; pub const VBox = @import("elements/v_box.zig").VBox; pub const Tabs = @import("elements/tabs.zig").Tabs; pub const Multiline = @import("elements/multiline.zig").Multiline; pub const FlatFrame = @import("elements/flat_frame.zig").FlatFrame; pub const Image = @import("elements/image.zig").Image; pub const DropButton = @import("elements/drop_button.zig").DropButton; pub const Space = @import("elements/space.zig").Space; pub const FlatSeparator = @import("elements/flat_separator.zig").FlatSeparator; pub const SBox = @import("elements/s_box.zig").SBox; pub const FlatLabel = @import("elements/flat_label.zig").FlatLabel; pub const Param = @import("elements/param.zig").Param; pub const Button = @import("elements/button.zig").Button; pub const FileDlg = @import("elements/file_dlg.zig").FileDlg; pub const List = @import("elements/list.zig").List; pub const ZBox = @import("elements/z_box.zig").ZBox; pub const ScrollBox = @import("elements/scroll_box.zig").ScrollBox; pub const DatePick = @import("elements/date_pick.zig").DatePick; pub const Spin = @import("elements/spin.zig").Spin; pub const Clipboard = @import("elements/clipboard.zig").Clipboard; pub const SubMenu = @import("elements/sub_menu.zig").SubMenu; pub const GridBox = @import("elements/grid_box.zig").GridBox; pub const ImageRgba = @import("elements/image_rgba.zig").ImageRgba; pub const Text = @import("elements/text.zig").Text; pub const Radio = @import("elements/radio.zig").Radio; pub const Gauge = @import("elements/gauge.zig").Gauge; pub const ColorBar = @import("elements/color_bar.zig").ColorBar; pub const ProgressDlg = @import("elements/progress_dlg.zig").ProgressDlg; pub const Val = @import("elements/val.zig").Val; pub const Dial = @import("elements/dial.zig").Dial; pub const MultiBox = @import("elements/multi_box.zig").MultiBox; pub const Expander = @import("elements/expander.zig").Expander; pub const CBox = @import("elements/c_box.zig").CBox; pub const Separator = @import("elements/separator.zig").Separator; pub const Menu = @import("elements/menu.zig").Menu; pub const FlatVal = @import("elements/flat_val.zig").FlatVal; pub const FlatToggle = @import("elements/flat_toggle.zig").FlatToggle; pub const Calendar = @import("elements/calendar.zig").Calendar; pub const Item = @import("elements/item.zig").Item; pub const ParamBox = @import("elements/param_box.zig").ParamBox; pub const FlatButton = @import("elements/flat_button.zig").FlatButton; pub const Canvas = @import("elements/canvas.zig").Canvas; pub const Dialog = @import("elements/dialog.zig").Dialog; pub const User = @import("elements/user.zig").User; pub const ColorBrowser = @import("elements/color_browser.zig").ColorBrowser; pub const Toggle = @import("elements/toggle.zig").Toggle; pub const SpinBox = @import("elements/spin_box.zig").SpinBox; pub const Link = @import("elements/link.zig").Link; pub const ImageRgb = @import("elements/image_rgb.zig").ImageRgb; pub const FlatTree = @import("elements/flat_tree.zig").FlatTree; pub const ProgressBar = @import("elements/progress_bar.zig").ProgressBar; pub const FlatScrollBox = @import("elements/flat_scroll_box.zig").FlatScrollBox; pub const MessageDlg = @import("elements/message_dlg.zig").MessageDlg; pub const Frame = @import("elements/frame.zig").Frame; pub const FlatTabs = @import("elements/flat_tabs.zig").FlatTabs; /// /// IUP contains several user interface elements. /// The library’s main characteristic is the use of native elements. /// This means that the drawing and management of a button or text box is done by the native interface system, not by IUP. /// This makes the application’s appearance more similar to other applications in that system. On the other hand, the application’s appearance can vary from one system to another. /// /// But this is valid only for the standard elements, many additional elements are drawn by IUP. /// Composition elements are not visible, so they are independent from the native system. /// /// Each element has an unique creation function, and all of its management is done by means of attributes and callbacks, using functions common to all the elements. This simple but powerful approach is one of the advantages of using IUP. /// Elements are automatically destroyed when the dialog is destroyed. pub const Element = union(enum) { Fill: *Fill, DetachBox: *DetachBox, Split: *Split, HBox: *HBox, Label: *Label, Tree: *Tree, BackgroundBox: *BackgroundBox, Normalizer: *Normalizer, FontDlg: *FontDlg, FlatList: *FlatList, Thread: *Thread, AnimatedLabel: *AnimatedLabel, ColorDlg: *ColorDlg, Timer: *Timer, VBox: *VBox, Tabs: *Tabs, Multiline: *Multiline, FlatFrame: *FlatFrame, Image: *Image, DropButton: *DropButton, Space: *Space, FlatSeparator: *FlatSeparator, SBox: *SBox, FlatLabel: *FlatLabel, Param: *Param, Button: *Button, FileDlg: *FileDlg, List: *List, ZBox: *ZBox, ScrollBox: *ScrollBox, DatePick: *DatePick, Spin: *Spin, Clipboard: *Clipboard, SubMenu: *SubMenu, GridBox: *GridBox, ImageRgba: *ImageRgba, Text: *Text, Radio: *Radio, Gauge: *Gauge, ColorBar: *ColorBar, ProgressDlg: *ProgressDlg, Val: *Val, Dial: *Dial, MultiBox: *MultiBox, Expander: *Expander, CBox: *CBox, Separator: *Separator, Menu: *Menu, FlatVal: *FlatVal, FlatToggle: *FlatToggle, Calendar: *Calendar, Item: *Item, ParamBox: *ParamBox, FlatButton: *FlatButton, Canvas: *Canvas, Dialog: *Dialog, User: *User, ColorBrowser: *ColorBrowser, Toggle: *Toggle, SpinBox: *SpinBox, Link: *Link, ImageRgb: *ImageRgb, FlatTree: *FlatTree, ProgressBar: *ProgressBar, FlatScrollBox: *FlatScrollBox, MessageDlg: *MessageDlg, Frame: *Frame, FlatTabs: *FlatTabs, Unknown: *Handle, pub fn fromType(comptime T: type, handle: anytype) Element { switch (T) { Fill, *Fill => return .{ .Fill = @ptrCast(*Fill, handle) }, DetachBox, *DetachBox => return .{ .DetachBox = @ptrCast(*DetachBox, handle) }, Split, *Split => return .{ .Split = @ptrCast(*Split, handle) }, HBox, *HBox => return .{ .HBox = @ptrCast(*HBox, handle) }, Label, *Label => return .{ .Label = @ptrCast(*Label, handle) }, Tree, *Tree => return .{ .Tree = @ptrCast(*Tree, handle) }, BackgroundBox, *BackgroundBox => return .{ .BackgroundBox = @ptrCast(*BackgroundBox, handle) }, Normalizer, *Normalizer => return .{ .Normalizer = @ptrCast(*Normalizer, handle) }, FontDlg, *FontDlg => return .{ .FontDlg = @ptrCast(*FontDlg, handle) }, FlatList, *FlatList => return .{ .FlatList = @ptrCast(*FlatList, handle) }, Thread, *Thread => return .{ .Thread = @ptrCast(*Thread, handle) }, AnimatedLabel, *AnimatedLabel => return .{ .AnimatedLabel = @ptrCast(*AnimatedLabel, handle) }, ColorDlg, *ColorDlg => return .{ .ColorDlg = @ptrCast(*ColorDlg, handle) }, Timer, *Timer => return .{ .Timer = @ptrCast(*Timer, handle) }, VBox, *VBox => return .{ .VBox = @ptrCast(*VBox, handle) }, Tabs, *Tabs => return .{ .Tabs = @ptrCast(*Tabs, handle) }, Multiline, *Multiline => return .{ .Multiline = @ptrCast(*Multiline, handle) }, FlatFrame, *FlatFrame => return .{ .FlatFrame = @ptrCast(*FlatFrame, handle) }, Image, *Image => return .{ .Image = @ptrCast(*Image, handle) }, DropButton, *DropButton => return .{ .DropButton = @ptrCast(*DropButton, handle) }, Space, *Space => return .{ .Space = @ptrCast(*Space, handle) }, FlatSeparator, *FlatSeparator => return .{ .FlatSeparator = @ptrCast(*FlatSeparator, handle) }, SBox, *SBox => return .{ .SBox = @ptrCast(*SBox, handle) }, FlatLabel, *FlatLabel => return .{ .FlatLabel = @ptrCast(*FlatLabel, handle) }, Param, *Param => return .{ .Param = @ptrCast(*Param, handle) }, Button, *Button => return .{ .Button = @ptrCast(*Button, handle) }, FileDlg, *FileDlg => return .{ .FileDlg = @ptrCast(*FileDlg, handle) }, List, *List => return .{ .List = @ptrCast(*List, handle) }, ZBox, *ZBox => return .{ .ZBox = @ptrCast(*ZBox, handle) }, ScrollBox, *ScrollBox => return .{ .ScrollBox = @ptrCast(*ScrollBox, handle) }, DatePick, *DatePick => return .{ .DatePick = @ptrCast(*DatePick, handle) }, Spin, *Spin => return .{ .Spin = @ptrCast(*Spin, handle) }, Clipboard, *Clipboard => return .{ .Clipboard = @ptrCast(*Clipboard, handle) }, SubMenu, *SubMenu => return .{ .SubMenu = @ptrCast(*SubMenu, handle) }, GridBox, *GridBox => return .{ .GridBox = @ptrCast(*GridBox, handle) }, ImageRgba, *ImageRgba => return .{ .ImageRgba = @ptrCast(*ImageRgba, handle) }, Text, *Text => return .{ .Text = @ptrCast(*Text, handle) }, Radio, *Radio => return .{ .Radio = @ptrCast(*Radio, handle) }, Gauge, *Gauge => return .{ .Gauge = @ptrCast(*Gauge, handle) }, ColorBar, *ColorBar => return .{ .ColorBar = @ptrCast(*ColorBar, handle) }, ProgressDlg, *ProgressDlg => return .{ .ProgressDlg = @ptrCast(*ProgressDlg, handle) }, Val, *Val => return .{ .Val = @ptrCast(*Val, handle) }, Dial, *Dial => return .{ .Dial = @ptrCast(*Dial, handle) }, MultiBox, *MultiBox => return .{ .MultiBox = @ptrCast(*MultiBox, handle) }, Expander, *Expander => return .{ .Expander = @ptrCast(*Expander, handle) }, CBox, *CBox => return .{ .CBox = @ptrCast(*CBox, handle) }, Separator, *Separator => return .{ .Separator = @ptrCast(*Separator, handle) }, Menu, *Menu => return .{ .Menu = @ptrCast(*Menu, handle) }, FlatVal, *FlatVal => return .{ .FlatVal = @ptrCast(*FlatVal, handle) }, FlatToggle, *FlatToggle => return .{ .FlatToggle = @ptrCast(*FlatToggle, handle) }, Calendar, *Calendar => return .{ .Calendar = @ptrCast(*Calendar, handle) }, Item, *Item => return .{ .Item = @ptrCast(*Item, handle) }, ParamBox, *ParamBox => return .{ .ParamBox = @ptrCast(*ParamBox, handle) }, FlatButton, *FlatButton => return .{ .FlatButton = @ptrCast(*FlatButton, handle) }, Canvas, *Canvas => return .{ .Canvas = @ptrCast(*Canvas, handle) }, Dialog, *Dialog => return .{ .Dialog = @ptrCast(*Dialog, handle) }, User, *User => return .{ .User = @ptrCast(*User, handle) }, ColorBrowser, *ColorBrowser => return .{ .ColorBrowser = @ptrCast(*ColorBrowser, handle) }, Toggle, *Toggle => return .{ .Toggle = @ptrCast(*Toggle, handle) }, SpinBox, *SpinBox => return .{ .SpinBox = @ptrCast(*SpinBox, handle) }, Link, *Link => return .{ .Link = @ptrCast(*Link, handle) }, ImageRgb, *ImageRgb => return .{ .ImageRgb = @ptrCast(*ImageRgb, handle) }, FlatTree, *FlatTree => return .{ .FlatTree = @ptrCast(*FlatTree, handle) }, ProgressBar, *ProgressBar => return .{ .ProgressBar = @ptrCast(*ProgressBar, handle) }, FlatScrollBox, *FlatScrollBox => return .{ .FlatScrollBox = @ptrCast(*FlatScrollBox, handle) }, MessageDlg, *MessageDlg => return .{ .MessageDlg = @ptrCast(*MessageDlg, handle) }, Frame, *Frame => return .{ .Frame = @ptrCast(*Frame, handle) }, FlatTabs, *FlatTabs => return .{ .FlatTabs = @ptrCast(*FlatTabs, handle) }, else => @compileError("Type " ++ @typeName(T) ++ " cannot be converted to a Element"), } } pub fn fromRef(reference: anytype) Element { const referenceType = @TypeOf(reference); const typeInfo = @typeInfo(referenceType); if (comptime typeInfo == .Pointer) { const childType = typeInfo.Pointer.child; switch (childType) { Fill => return .{ .Fill = reference }, DetachBox => return .{ .DetachBox = reference }, Split => return .{ .Split = reference }, HBox => return .{ .HBox = reference }, Label => return .{ .Label = reference }, Tree => return .{ .Tree = reference }, BackgroundBox => return .{ .BackgroundBox = reference }, Normalizer => return .{ .Normalizer = reference }, FontDlg => return .{ .FontDlg = reference }, FlatList => return .{ .FlatList = reference }, Thread => return .{ .Thread = reference }, AnimatedLabel => return .{ .AnimatedLabel = reference }, ColorDlg => return .{ .ColorDlg = reference }, Timer => return .{ .Timer = reference }, VBox => return .{ .VBox = reference }, Tabs => return .{ .Tabs = reference }, Multiline => return .{ .Multiline = reference }, FlatFrame => return .{ .FlatFrame = reference }, Image => return .{ .Image = reference }, DropButton => return .{ .DropButton = reference }, Space => return .{ .Space = reference }, FlatSeparator => return .{ .FlatSeparator = reference }, SBox => return .{ .SBox = reference }, FlatLabel => return .{ .FlatLabel = reference }, Param => return .{ .Param = reference }, Button => return .{ .Button = reference }, FileDlg => return .{ .FileDlg = reference }, List => return .{ .List = reference }, ZBox => return .{ .ZBox = reference }, ScrollBox => return .{ .ScrollBox = reference }, DatePick => return .{ .DatePick = reference }, Spin => return .{ .Spin = reference }, Clipboard => return .{ .Clipboard = reference }, SubMenu => return .{ .SubMenu = reference }, GridBox => return .{ .GridBox = reference }, ImageRgba => return .{ .ImageRgba = reference }, Text => return .{ .Text = reference }, Radio => return .{ .Radio = reference }, Gauge => return .{ .Gauge = reference }, ColorBar => return .{ .ColorBar = reference }, ProgressDlg => return .{ .ProgressDlg = reference }, Val => return .{ .Val = reference }, Dial => return .{ .Dial = reference }, MultiBox => return .{ .MultiBox = reference }, Expander => return .{ .Expander = reference }, CBox => return .{ .CBox = reference }, Separator => return .{ .Separator = reference }, Menu => return .{ .Menu = reference }, FlatVal => return .{ .FlatVal = reference }, FlatToggle => return .{ .FlatToggle = reference }, Calendar => return .{ .Calendar = reference }, Item => return .{ .Item = reference }, ParamBox => return .{ .ParamBox = reference }, FlatButton => return .{ .FlatButton = reference }, Canvas => return .{ .Canvas = reference }, Dialog => return .{ .Dialog = reference }, User => return .{ .User = reference }, ColorBrowser => return .{ .ColorBrowser = reference }, Toggle => return .{ .Toggle = reference }, SpinBox => return .{ .SpinBox = reference }, Link => return .{ .Link = reference }, ImageRgb => return .{ .ImageRgb = reference }, FlatTree => return .{ .FlatTree = reference }, ProgressBar => return .{ .ProgressBar = reference }, FlatScrollBox => return .{ .FlatScrollBox = reference }, MessageDlg => return .{ .MessageDlg = reference }, Frame => return .{ .Frame = reference }, FlatTabs => return .{ .FlatTabs = reference }, else => @compileError("Type " ++ @typeName(referenceType) ++ " cannot be converted to a Element"), } } else { @compileError("Reference to a element expected"); } } pub fn fromClassName(className: []const u8, handle: anytype) Element { if (ascii.eqlIgnoreCase(className, Fill.CLASS_NAME)) return .{ .Fill = @ptrCast(*Fill, handle) }; if (ascii.eqlIgnoreCase(className, DetachBox.CLASS_NAME)) return .{ .DetachBox = @ptrCast(*DetachBox, handle) }; if (ascii.eqlIgnoreCase(className, Split.CLASS_NAME)) return .{ .Split = @ptrCast(*Split, handle) }; if (ascii.eqlIgnoreCase(className, HBox.CLASS_NAME)) return .{ .HBox = @ptrCast(*HBox, handle) }; if (ascii.eqlIgnoreCase(className, Label.CLASS_NAME)) return .{ .Label = @ptrCast(*Label, handle) }; if (ascii.eqlIgnoreCase(className, Tree.CLASS_NAME)) return .{ .Tree = @ptrCast(*Tree, handle) }; if (ascii.eqlIgnoreCase(className, BackgroundBox.CLASS_NAME)) return .{ .BackgroundBox = @ptrCast(*BackgroundBox, handle) }; if (ascii.eqlIgnoreCase(className, Normalizer.CLASS_NAME)) return .{ .Normalizer = @ptrCast(*Normalizer, handle) }; if (ascii.eqlIgnoreCase(className, FontDlg.CLASS_NAME)) return .{ .FontDlg = @ptrCast(*FontDlg, handle) }; if (ascii.eqlIgnoreCase(className, FlatList.CLASS_NAME)) return .{ .FlatList = @ptrCast(*FlatList, handle) }; if (ascii.eqlIgnoreCase(className, Thread.CLASS_NAME)) return .{ .Thread = @ptrCast(*Thread, handle) }; if (ascii.eqlIgnoreCase(className, AnimatedLabel.CLASS_NAME)) return .{ .AnimatedLabel = @ptrCast(*AnimatedLabel, handle) }; if (ascii.eqlIgnoreCase(className, ColorDlg.CLASS_NAME)) return .{ .ColorDlg = @ptrCast(*ColorDlg, handle) }; if (ascii.eqlIgnoreCase(className, Timer.CLASS_NAME)) return .{ .Timer = @ptrCast(*Timer, handle) }; if (ascii.eqlIgnoreCase(className, VBox.CLASS_NAME)) return .{ .VBox = @ptrCast(*VBox, handle) }; if (ascii.eqlIgnoreCase(className, Tabs.CLASS_NAME)) return .{ .Tabs = @ptrCast(*Tabs, handle) }; if (ascii.eqlIgnoreCase(className, Multiline.CLASS_NAME)) return .{ .Multiline = @ptrCast(*Multiline, handle) }; if (ascii.eqlIgnoreCase(className, FlatFrame.CLASS_NAME)) return .{ .FlatFrame = @ptrCast(*FlatFrame, handle) }; if (ascii.eqlIgnoreCase(className, Image.CLASS_NAME)) return .{ .Image = @ptrCast(*Image, handle) }; if (ascii.eqlIgnoreCase(className, DropButton.CLASS_NAME)) return .{ .DropButton = @ptrCast(*DropButton, handle) }; if (ascii.eqlIgnoreCase(className, Space.CLASS_NAME)) return .{ .Space = @ptrCast(*Space, handle) }; if (ascii.eqlIgnoreCase(className, FlatSeparator.CLASS_NAME)) return .{ .FlatSeparator = @ptrCast(*FlatSeparator, handle) }; if (ascii.eqlIgnoreCase(className, SBox.CLASS_NAME)) return .{ .SBox = @ptrCast(*SBox, handle) }; if (ascii.eqlIgnoreCase(className, FlatLabel.CLASS_NAME)) return .{ .FlatLabel = @ptrCast(*FlatLabel, handle) }; if (ascii.eqlIgnoreCase(className, Param.CLASS_NAME)) return .{ .Param = @ptrCast(*Param, handle) }; if (ascii.eqlIgnoreCase(className, Button.CLASS_NAME)) return .{ .Button = @ptrCast(*Button, handle) }; if (ascii.eqlIgnoreCase(className, FileDlg.CLASS_NAME)) return .{ .FileDlg = @ptrCast(*FileDlg, handle) }; if (ascii.eqlIgnoreCase(className, List.CLASS_NAME)) return .{ .List = @ptrCast(*List, handle) }; if (ascii.eqlIgnoreCase(className, ZBox.CLASS_NAME)) return .{ .ZBox = @ptrCast(*ZBox, handle) }; if (ascii.eqlIgnoreCase(className, ScrollBox.CLASS_NAME)) return .{ .ScrollBox = @ptrCast(*ScrollBox, handle) }; if (ascii.eqlIgnoreCase(className, DatePick.CLASS_NAME)) return .{ .DatePick = @ptrCast(*DatePick, handle) }; if (ascii.eqlIgnoreCase(className, Spin.CLASS_NAME)) return .{ .Spin = @ptrCast(*Spin, handle) }; if (ascii.eqlIgnoreCase(className, Clipboard.CLASS_NAME)) return .{ .Clipboard = @ptrCast(*Clipboard, handle) }; if (ascii.eqlIgnoreCase(className, SubMenu.CLASS_NAME)) return .{ .SubMenu = @ptrCast(*SubMenu, handle) }; if (ascii.eqlIgnoreCase(className, GridBox.CLASS_NAME)) return .{ .GridBox = @ptrCast(*GridBox, handle) }; if (ascii.eqlIgnoreCase(className, ImageRgba.CLASS_NAME)) return .{ .ImageRgba = @ptrCast(*ImageRgba, handle) }; if (ascii.eqlIgnoreCase(className, Text.CLASS_NAME)) return .{ .Text = @ptrCast(*Text, handle) }; if (ascii.eqlIgnoreCase(className, Radio.CLASS_NAME)) return .{ .Radio = @ptrCast(*Radio, handle) }; if (ascii.eqlIgnoreCase(className, Gauge.CLASS_NAME)) return .{ .Gauge = @ptrCast(*Gauge, handle) }; if (ascii.eqlIgnoreCase(className, ColorBar.CLASS_NAME)) return .{ .ColorBar = @ptrCast(*ColorBar, handle) }; if (ascii.eqlIgnoreCase(className, ProgressDlg.CLASS_NAME)) return .{ .ProgressDlg = @ptrCast(*ProgressDlg, handle) }; if (ascii.eqlIgnoreCase(className, Val.CLASS_NAME)) return .{ .Val = @ptrCast(*Val, handle) }; if (ascii.eqlIgnoreCase(className, Dial.CLASS_NAME)) return .{ .Dial = @ptrCast(*Dial, handle) }; if (ascii.eqlIgnoreCase(className, MultiBox.CLASS_NAME)) return .{ .MultiBox = @ptrCast(*MultiBox, handle) }; if (ascii.eqlIgnoreCase(className, Expander.CLASS_NAME)) return .{ .Expander = @ptrCast(*Expander, handle) }; if (ascii.eqlIgnoreCase(className, CBox.CLASS_NAME)) return .{ .CBox = @ptrCast(*CBox, handle) }; if (ascii.eqlIgnoreCase(className, Separator.CLASS_NAME)) return .{ .Separator = @ptrCast(*Separator, handle) }; if (ascii.eqlIgnoreCase(className, Menu.CLASS_NAME)) return .{ .Menu = @ptrCast(*Menu, handle) }; if (ascii.eqlIgnoreCase(className, FlatVal.CLASS_NAME)) return .{ .FlatVal = @ptrCast(*FlatVal, handle) }; if (ascii.eqlIgnoreCase(className, FlatToggle.CLASS_NAME)) return .{ .FlatToggle = @ptrCast(*FlatToggle, handle) }; if (ascii.eqlIgnoreCase(className, Calendar.CLASS_NAME)) return .{ .Calendar = @ptrCast(*Calendar, handle) }; if (ascii.eqlIgnoreCase(className, Item.CLASS_NAME)) return .{ .Item = @ptrCast(*Item, handle) }; if (ascii.eqlIgnoreCase(className, ParamBox.CLASS_NAME)) return .{ .ParamBox = @ptrCast(*ParamBox, handle) }; if (ascii.eqlIgnoreCase(className, FlatButton.CLASS_NAME)) return .{ .FlatButton = @ptrCast(*FlatButton, handle) }; if (ascii.eqlIgnoreCase(className, Canvas.CLASS_NAME)) return .{ .Canvas = @ptrCast(*Canvas, handle) }; if (ascii.eqlIgnoreCase(className, Dialog.CLASS_NAME)) return .{ .Dialog = @ptrCast(*Dialog, handle) }; if (ascii.eqlIgnoreCase(className, User.CLASS_NAME)) return .{ .User = @ptrCast(*User, handle) }; if (ascii.eqlIgnoreCase(className, ColorBrowser.CLASS_NAME)) return .{ .ColorBrowser = @ptrCast(*ColorBrowser, handle) }; if (ascii.eqlIgnoreCase(className, Toggle.CLASS_NAME)) return .{ .Toggle = @ptrCast(*Toggle, handle) }; if (ascii.eqlIgnoreCase(className, SpinBox.CLASS_NAME)) return .{ .SpinBox = @ptrCast(*SpinBox, handle) }; if (ascii.eqlIgnoreCase(className, Link.CLASS_NAME)) return .{ .Link = @ptrCast(*Link, handle) }; if (ascii.eqlIgnoreCase(className, ImageRgb.CLASS_NAME)) return .{ .ImageRgb = @ptrCast(*ImageRgb, handle) }; if (ascii.eqlIgnoreCase(className, FlatTree.CLASS_NAME)) return .{ .FlatTree = @ptrCast(*FlatTree, handle) }; if (ascii.eqlIgnoreCase(className, ProgressBar.CLASS_NAME)) return .{ .ProgressBar = @ptrCast(*ProgressBar, handle) }; if (ascii.eqlIgnoreCase(className, FlatScrollBox.CLASS_NAME)) return .{ .FlatScrollBox = @ptrCast(*FlatScrollBox, handle) }; if (ascii.eqlIgnoreCase(className, MessageDlg.CLASS_NAME)) return .{ .MessageDlg = @ptrCast(*MessageDlg, handle) }; if (ascii.eqlIgnoreCase(className, Frame.CLASS_NAME)) return .{ .Frame = @ptrCast(*Frame, handle) }; if (ascii.eqlIgnoreCase(className, FlatTabs.CLASS_NAME)) return .{ .FlatTabs = @ptrCast(*FlatTabs, handle) }; return .{ .Unknown = @ptrCast(*Handle, handle) }; } pub fn getHandle(self: Element) *Handle { switch (self) { .Fill => |value| return @ptrCast(*Handle, value), .DetachBox => |value| return @ptrCast(*Handle, value), .Split => |value| return @ptrCast(*Handle, value), .HBox => |value| return @ptrCast(*Handle, value), .Label => |value| return @ptrCast(*Handle, value), .Tree => |value| return @ptrCast(*Handle, value), .BackgroundBox => |value| return @ptrCast(*Handle, value), .Normalizer => |value| return @ptrCast(*Handle, value), .FontDlg => |value| return @ptrCast(*Handle, value), .FlatList => |value| return @ptrCast(*Handle, value), .Thread => |value| return @ptrCast(*Handle, value), .AnimatedLabel => |value| return @ptrCast(*Handle, value), .ColorDlg => |value| return @ptrCast(*Handle, value), .Timer => |value| return @ptrCast(*Handle, value), .VBox => |value| return @ptrCast(*Handle, value), .Tabs => |value| return @ptrCast(*Handle, value), .Multiline => |value| return @ptrCast(*Handle, value), .FlatFrame => |value| return @ptrCast(*Handle, value), .Image => |value| return @ptrCast(*Handle, value), .DropButton => |value| return @ptrCast(*Handle, value), .Space => |value| return @ptrCast(*Handle, value), .FlatSeparator => |value| return @ptrCast(*Handle, value), .SBox => |value| return @ptrCast(*Handle, value), .FlatLabel => |value| return @ptrCast(*Handle, value), .Param => |value| return @ptrCast(*Handle, value), .Button => |value| return @ptrCast(*Handle, value), .FileDlg => |value| return @ptrCast(*Handle, value), .List => |value| return @ptrCast(*Handle, value), .ZBox => |value| return @ptrCast(*Handle, value), .ScrollBox => |value| return @ptrCast(*Handle, value), .DatePick => |value| return @ptrCast(*Handle, value), .Spin => |value| return @ptrCast(*Handle, value), .Clipboard => |value| return @ptrCast(*Handle, value), .SubMenu => |value| return @ptrCast(*Handle, value), .GridBox => |value| return @ptrCast(*Handle, value), .ImageRgba => |value| return @ptrCast(*Handle, value), .Text => |value| return @ptrCast(*Handle, value), .Radio => |value| return @ptrCast(*Handle, value), .Gauge => |value| return @ptrCast(*Handle, value), .ColorBar => |value| return @ptrCast(*Handle, value), .ProgressDlg => |value| return @ptrCast(*Handle, value), .Val => |value| return @ptrCast(*Handle, value), .Dial => |value| return @ptrCast(*Handle, value), .MultiBox => |value| return @ptrCast(*Handle, value), .Expander => |value| return @ptrCast(*Handle, value), .CBox => |value| return @ptrCast(*Handle, value), .Separator => |value| return @ptrCast(*Handle, value), .Menu => |value| return @ptrCast(*Handle, value), .FlatVal => |value| return @ptrCast(*Handle, value), .FlatToggle => |value| return @ptrCast(*Handle, value), .Calendar => |value| return @ptrCast(*Handle, value), .Item => |value| return @ptrCast(*Handle, value), .ParamBox => |value| return @ptrCast(*Handle, value), .FlatButton => |value| return @ptrCast(*Handle, value), .Canvas => |value| return @ptrCast(*Handle, value), .Dialog => |value| return @ptrCast(*Handle, value), .User => |value| return @ptrCast(*Handle, value), .ColorBrowser => |value| return @ptrCast(*Handle, value), .Toggle => |value| return @ptrCast(*Handle, value), .SpinBox => |value| return @ptrCast(*Handle, value), .Link => |value| return @ptrCast(*Handle, value), .ImageRgb => |value| return @ptrCast(*Handle, value), .FlatTree => |value| return @ptrCast(*Handle, value), .ProgressBar => |value| return @ptrCast(*Handle, value), .FlatScrollBox => |value| return @ptrCast(*Handle, value), .MessageDlg => |value| return @ptrCast(*Handle, value), .Frame => |value| return @ptrCast(*Handle, value), .FlatTabs => |value| return @ptrCast(*Handle, value), .Unknown => |value| return @ptrCast(*Handle, value), } } pub fn children(self: Element) ChildrenIterator { switch (self) { .DetachBox => |value| return value.children(), .Split => |value| return value.children(), .HBox => |value| return value.children(), .BackgroundBox => |value| return value.children(), .VBox => |value| return value.children(), .Tabs => |value| return value.children(), .FlatFrame => |value| return value.children(), .SBox => |value| return value.children(), .ZBox => |value| return value.children(), .ScrollBox => |value| return value.children(), .SubMenu => |value| return value.children(), .GridBox => |value| return value.children(), .Radio => |value| return value.children(), .MultiBox => |value| return value.children(), .Expander => |value| return value.children(), .CBox => |value| return value.children(), .Menu => |value| return value.children(), .ParamBox => |value| return value.children(), .Dialog => |value| return value.children(), .User => |value| return value.children(), .SpinBox => |value| return value.children(), .FlatScrollBox => |value| return value.children(), .Frame => |value| return value.children(), .FlatTabs => |value| return value.children(), else => return ChildrenIterator.NoChildren, } } pub fn eql(self: Element, other: Element) bool { return @ptrToInt(self.getHandle()) == @ptrToInt(other.getHandle()); } pub fn deinit(self: Element) void { switch (self) { .Fill => |element| element.deinit(), .DetachBox => |element| element.deinit(), .Split => |element| element.deinit(), .HBox => |element| element.deinit(), .Label => |element| element.deinit(), .Tree => |element| element.deinit(), .BackgroundBox => |element| element.deinit(), .Normalizer => |element| element.deinit(), .FontDlg => |element| element.deinit(), .FlatList => |element| element.deinit(), .Thread => |element| element.deinit(), .AnimatedLabel => |element| element.deinit(), .ColorDlg => |element| element.deinit(), .Timer => |element| element.deinit(), .VBox => |element| element.deinit(), .Tabs => |element| element.deinit(), .Multiline => |element| element.deinit(), .FlatFrame => |element| element.deinit(), .Image => |element| element.deinit(), .DropButton => |element| element.deinit(), .Space => |element| element.deinit(), .FlatSeparator => |element| element.deinit(), .SBox => |element| element.deinit(), .FlatLabel => |element| element.deinit(), .Param => |element| element.deinit(), .Button => |element| element.deinit(), .FileDlg => |element| element.deinit(), .List => |element| element.deinit(), .ZBox => |element| element.deinit(), .ScrollBox => |element| element.deinit(), .DatePick => |element| element.deinit(), .Spin => |element| element.deinit(), .Clipboard => |element| element.deinit(), .SubMenu => |element| element.deinit(), .GridBox => |element| element.deinit(), .ImageRgba => |element| element.deinit(), .Text => |element| element.deinit(), .Radio => |element| element.deinit(), .Gauge => |element| element.deinit(), .ColorBar => |element| element.deinit(), .ProgressDlg => |element| element.deinit(), .Val => |element| element.deinit(), .Dial => |element| element.deinit(), .MultiBox => |element| element.deinit(), .Expander => |element| element.deinit(), .CBox => |element| element.deinit(), .Separator => |element| element.deinit(), .Menu => |element| element.deinit(), .FlatVal => |element| element.deinit(), .FlatToggle => |element| element.deinit(), .Calendar => |element| element.deinit(), .Item => |element| element.deinit(), .ParamBox => |element| element.deinit(), .FlatButton => |element| element.deinit(), .Canvas => |element| element.deinit(), .Dialog => |element| element.deinit(), .User => |element| element.deinit(), .ColorBrowser => |element| element.deinit(), .Toggle => |element| element.deinit(), .SpinBox => |element| element.deinit(), .Link => |element| element.deinit(), .ImageRgb => |element| element.deinit(), .FlatTree => |element| element.deinit(), .ProgressBar => |element| element.deinit(), .FlatScrollBox => |element| element.deinit(), .MessageDlg => |element| element.deinit(), .Frame => |element| element.deinit(), .FlatTabs => |element| element.deinit(), else => unreachable, } } pub fn setAttribute(self: Element, attribute: [:0]const u8, value: [:0]const u8) void { interop.setStrAttribute(self.getHandle(), attribute, .{}, value); } pub fn getAttribute(self: Element, attribute: [:0]const u8) [:0]const u8 { return interop.getStrAttribute(self.getHandle(), attribute, .{}); } pub fn setTag(self: Element, comptime T: type, attribute: [:0]const u8, value: ?*T) void { interop.setPtrAttribute(T, self.getHandle(), attribute, .{}, value); } pub fn getTag(self: Element, comptime T: type, attribute: [:0]const u8) ?*T { return interop.getPtrAttribute(T, self.getHandle(), attribute, .{}); } }; test "retrieve element fromType" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var handle = try iup.Label.init().unwrap(); defer handle.deinit(); var fromType = Element.fromType(iup.Label, handle); try testing.expect(fromType == .Label); try testing.expect(@ptrToInt(fromType.Label) == @ptrToInt(handle)); } test "retrieve element fromRef" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var handle = try iup.Label.init().unwrap(); defer handle.deinit(); var fromRef = Element.fromRef(handle); try testing.expect(fromRef == .Label); try testing.expect(@ptrToInt(fromRef.Label) == @ptrToInt(handle)); } test "retrieve element fromClassName" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var handle = try iup.Label.init().unwrap(); defer handle.deinit(); var fromClassName = Element.fromClassName(Label.CLASS_NAME, handle); try testing.expect(fromClassName == .Label); try testing.expect(@ptrToInt(fromClassName.Label) == @ptrToInt(handle)); } test "getHandle" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var handle = try iup.Label.init().unwrap(); defer handle.deinit(); var element = Element{ .Label = handle }; var value = element.getHandle(); try testing.expect(@ptrToInt(handle) == @ptrToInt(value)); } test "children" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var parent = try iup.HBox.init().unwrap(); var child1 = try iup.HBox.init().unwrap(); var child2 = try iup.HBox.init().unwrap(); try parent.appendChild(child1); try parent.appendChild(child2); var element = Element{ .HBox = parent }; var children = element.children(); if (children.next()) |ret1| { try testing.expect(ret1 == .HBox); try testing.expect(ret1.HBox == child1); } else { try testing.expect(false); } if (children.next()) |ret2| { try testing.expect(ret2 == .HBox); try testing.expect(ret2.HBox == child2); } else { try testing.expect(false); } var ret3 = children.next(); try testing.expect(ret3 == null); } test "eql" { try iup.MainLoop.open(); defer iup.MainLoop.close(); var l1 = Element.fromRef(try iup.Label.init().unwrap()); defer l1.deinit(); var l2 = Element.fromRef(try iup.Label.init().unwrap()); defer l2.deinit(); var l1_copy = l1; try testing.expect(l1.eql(l1)); try testing.expect(l2.eql(l2)); try testing.expect(l1.eql(l1_copy)); try testing.expect(!l1.eql(l2)); try testing.expect(!l2.eql(l1)); }
src/elements.zig
pub const E_SURFACE_CONTENTS_LOST = @as(u32, 2150301728); pub const MAX_ERROR_MESSAGE_CHARS = @as(u32, 512); pub const CastingSourceInfo_Property_PreferredSourceUriScheme = "PreferredSourceUriScheme"; pub const CastingSourceInfo_Property_CastingTypes = "CastingTypes"; pub const CastingSourceInfo_Property_ProtectedMedia = "ProtectedMedia"; pub const CLSID_SoftwareBitmapNativeFactory = Guid.initString("84e65691-8602-4a84-be46-708be9cd4b74"); pub const CLSID_AudioFrameNativeFactory = Guid.initString("16a0a3b9-9f65-4102-9367-2cda3a4f372a"); pub const CLSID_VideoFrameNativeFactory = Guid.initString("d194386a-04e3-4814-8100-b2b0ae6d78c7"); //-------------------------------------------------------------------------------- // Section: Types (119) //-------------------------------------------------------------------------------- pub const EventRegistrationToken = extern struct { value: i64, }; pub const __AnonymousRecord_roapi_L45_C9 = extern struct { placeholder: usize, // TODO: why is this type empty? }; // TODO: this type has a FreeFunc 'WindowsDeleteString', what can Zig do with this information? pub const HSTRING = *opaque{}; pub const HSTRING_BUFFER = *opaque{}; pub const ROPARAMIIDHANDLE = isize; pub const APARTMENT_SHUTDOWN_REGISTRATION_COOKIE = isize; pub const ACTIVATIONTYPE = enum(i32) { UNCATEGORIZED = 0, FROM_MONIKER = 1, FROM_DATA = 2, FROM_STORAGE = 4, FROM_STREAM = 8, FROM_FILE = 16, }; pub const ACTIVATIONTYPE_UNCATEGORIZED = ACTIVATIONTYPE.UNCATEGORIZED; pub const ACTIVATIONTYPE_FROM_MONIKER = ACTIVATIONTYPE.FROM_MONIKER; pub const ACTIVATIONTYPE_FROM_DATA = ACTIVATIONTYPE.FROM_DATA; pub const ACTIVATIONTYPE_FROM_STORAGE = ACTIVATIONTYPE.FROM_STORAGE; pub const ACTIVATIONTYPE_FROM_STREAM = ACTIVATIONTYPE.FROM_STREAM; pub const ACTIVATIONTYPE_FROM_FILE = ACTIVATIONTYPE.FROM_FILE; // TODO: this type is limited to platform 'windows8.1' const IID_IAgileReference_Value = @import("../zig.zig").Guid.initString("c03f6a43-65a4-9818-987e-e0b810d2a6f2"); pub const IID_IAgileReference = &IID_IAgileReference_Value; pub const IAgileReference = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, Resolve: fn( self: *const IAgileReference, riid: ?*const Guid, ppvObjectReference: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IAgileReference_Resolve(self: *const T, riid: ?*const Guid, ppvObjectReference: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IAgileReference.VTable, self.vtable).Resolve(@ptrCast(*const IAgileReference, self), riid, ppvObjectReference); } };} pub usingnamespace MethodMixin(@This()); }; // TODO: this type is limited to platform 'windows8.0' const IID_IApartmentShutdown_Value = @import("../zig.zig").Guid.initString("a2f05a09-27a2-42b5-bc0e-ac163ef49d9b"); pub const IID_IApartmentShutdown = &IID_IApartmentShutdown_Value; pub const IApartmentShutdown = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, OnUninitialize: fn( self: *const IApartmentShutdown, ui64ApartmentIdentifier: u64, ) callconv(@import("std").os.windows.WINAPI) void, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IApartmentShutdown_OnUninitialize(self: *const T, ui64ApartmentIdentifier: u64) callconv(.Inline) void { return @ptrCast(*const IApartmentShutdown.VTable, self.vtable).OnUninitialize(@ptrCast(*const IApartmentShutdown, self), ui64ApartmentIdentifier); } };} pub usingnamespace MethodMixin(@This()); }; pub const ServerInformation = extern struct { dwServerPid: u32, dwServerTid: u32, ui64ServerAddress: u64, }; pub const AgileReferenceOptions = enum(i32) { FAULT = 0, LAYEDMARSHAL = 1, }; pub const AGILEREFERENCE_DEFAULT = AgileReferenceOptions.FAULT; pub const AGILEREFERENCE_DELAYEDMARSHAL = AgileReferenceOptions.LAYEDMARSHAL; // TODO: this type is limited to platform 'windows10.0.15063' const IID_ISpatialInteractionManagerInterop_Value = @import("../zig.zig").Guid.initString("5c4ee536-6a98-4b86-a170-587013d6fd4b"); pub const IID_ISpatialInteractionManagerInterop = &IID_ISpatialInteractionManagerInterop_Value; pub const ISpatialInteractionManagerInterop = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, GetForWindow: fn( self: *const ISpatialInteractionManagerInterop, window: ?HWND, riid: ?*const Guid, spatialInteractionManager: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISpatialInteractionManagerInterop_GetForWindow(self: *const T, window: ?HWND, riid: ?*const Guid, spatialInteractionManager: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const ISpatialInteractionManagerInterop.VTable, self.vtable).GetForWindow(@ptrCast(*const ISpatialInteractionManagerInterop, self), window, riid, spatialInteractionManager); } };} pub usingnamespace MethodMixin(@This()); }; // TODO: this type is limited to platform 'windows10.0.15063' const IID_IHolographicSpaceInterop_Value = @import("../zig.zig").Guid.initString("5c4ee536-6a98-4b86-a170-587013d6fd4b"); pub const IID_IHolographicSpaceInterop = &IID_IHolographicSpaceInterop_Value; pub const IHolographicSpaceInterop = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, CreateForWindow: fn( self: *const IHolographicSpaceInterop, window: ?HWND, riid: ?*const Guid, holographicSpace: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IHolographicSpaceInterop_CreateForWindow(self: *const T, window: ?HWND, riid: ?*const Guid, holographicSpace: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IHolographicSpaceInterop.VTable, self.vtable).CreateForWindow(@ptrCast(*const IHolographicSpaceInterop, self), window, riid, holographicSpace); } };} pub usingnamespace MethodMixin(@This()); }; pub const HSTRING_HEADER = extern struct { Reserved: extern union { Reserved1: ?*c_void, Reserved2: [24]CHAR, }, }; pub const TrustLevel = enum(i32) { BaseTrust = 0, PartialTrust = 1, FullTrust = 2, }; pub const BaseTrust = TrustLevel.BaseTrust; pub const PartialTrust = TrustLevel.PartialTrust; pub const FullTrust = TrustLevel.FullTrust; // TODO: this type is limited to platform 'windows8.0' const IID_IInspectable_Value = @import("../zig.zig").Guid.initString("af86e2e0-b12d-4c6a-9c5a-d7aa65101e90"); pub const IID_IInspectable = &IID_IInspectable_Value; pub const IInspectable = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, GetIids: fn( self: *const IInspectable, iidCount: ?*u32, iids: ?[*]?*Guid, ) callconv(@import("std").os.windows.WINAPI) HRESULT, GetRuntimeClassName: fn( self: *const IInspectable, className: ?*?HSTRING, ) callconv(@import("std").os.windows.WINAPI) HRESULT, GetTrustLevel: fn( self: *const IInspectable, trustLevel: ?*TrustLevel, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IInspectable_GetIids(self: *const T, iidCount: ?*u32, iids: ?[*]?*Guid) callconv(.Inline) HRESULT { return @ptrCast(*const IInspectable.VTable, self.vtable).GetIids(@ptrCast(*const IInspectable, self), iidCount, iids); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IInspectable_GetRuntimeClassName(self: *const T, className: ?*?HSTRING) callconv(.Inline) HRESULT { return @ptrCast(*const IInspectable.VTable, self.vtable).GetRuntimeClassName(@ptrCast(*const IInspectable, self), className); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IInspectable_GetTrustLevel(self: *const T, trustLevel: ?*TrustLevel) callconv(.Inline) HRESULT { return @ptrCast(*const IInspectable.VTable, self.vtable).GetTrustLevel(@ptrCast(*const IInspectable, self), trustLevel); } };} pub usingnamespace MethodMixin(@This()); }; pub const PINSPECT_HSTRING_CALLBACK = fn( context: ?*c_void, readAddress: usize, length: u32, buffer: [*:0]u8, ) callconv(@import("std").os.windows.WINAPI) HRESULT; pub const PINSPECT_HSTRING_CALLBACK2 = fn( context: ?*c_void, readAddress: u64, length: u32, buffer: [*:0]u8, ) callconv(@import("std").os.windows.WINAPI) HRESULT; pub const DISPATCHERQUEUE_THREAD_APARTMENTTYPE = enum(i32) { NONE = 0, ASTA = 1, STA = 2, }; pub const DQTAT_COM_NONE = DISPATCHERQUEUE_THREAD_APARTMENTTYPE.NONE; pub const DQTAT_COM_ASTA = DISPATCHERQUEUE_THREAD_APARTMENTTYPE.ASTA; pub const DQTAT_COM_STA = DISPATCHERQUEUE_THREAD_APARTMENTTYPE.STA; pub const DISPATCHERQUEUE_THREAD_TYPE = enum(i32) { DEDICATED = 1, CURRENT = 2, }; pub const DQTYPE_THREAD_DEDICATED = DISPATCHERQUEUE_THREAD_TYPE.DEDICATED; pub const DQTYPE_THREAD_CURRENT = DISPATCHERQUEUE_THREAD_TYPE.CURRENT; pub const DispatcherQueueOptions = extern struct { dwSize: u32, threadType: DISPATCHERQUEUE_THREAD_TYPE, apartmentType: DISPATCHERQUEUE_THREAD_APARTMENTTYPE, }; const IID_IAccountsSettingsPaneInterop_Value = @import("../zig.zig").Guid.initString("d3ee12ad-3865-4362-9746-b75a682df0e6"); pub const IID_IAccountsSettingsPaneInterop = &IID_IAccountsSettingsPaneInterop_Value; pub const IAccountsSettingsPaneInterop = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, GetForWindow: fn( self: *const IAccountsSettingsPaneInterop, appWindow: ?HWND, riid: ?*const Guid, accountsSettingsPane: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, ShowManageAccountsForWindowAsync: fn( self: *const IAccountsSettingsPaneInterop, appWindow: ?HWND, riid: ?*const Guid, asyncAction: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, ShowAddAccountForWindowAsync: fn( self: *const IAccountsSettingsPaneInterop, appWindow: ?HWND, riid: ?*const Guid, asyncAction: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IAccountsSettingsPaneInterop_GetForWindow(self: *const T, appWindow: ?HWND, riid: ?*const Guid, accountsSettingsPane: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IAccountsSettingsPaneInterop.VTable, self.vtable).GetForWindow(@ptrCast(*const IAccountsSettingsPaneInterop, self), appWindow, riid, accountsSettingsPane); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IAccountsSettingsPaneInterop_ShowManageAccountsForWindowAsync(self: *const T, appWindow: ?HWND, riid: ?*const Guid, asyncAction: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IAccountsSettingsPaneInterop.VTable, self.vtable).ShowManageAccountsForWindowAsync(@ptrCast(*const IAccountsSettingsPaneInterop, self), appWindow, riid, asyncAction); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IAccountsSettingsPaneInterop_ShowAddAccountForWindowAsync(self: *const T, appWindow: ?HWND, riid: ?*const Guid, asyncAction: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IAccountsSettingsPaneInterop.VTable, self.vtable).ShowAddAccountForWindowAsync(@ptrCast(*const IAccountsSettingsPaneInterop, self), appWindow, riid, asyncAction); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IAppServiceConnectionExtendedExecution_Value = @import("../zig.zig").Guid.initString("65219584-f9cb-4ae3-81f9-a28a6ca450d9"); pub const IID_IAppServiceConnectionExtendedExecution = &IID_IAppServiceConnectionExtendedExecution_Value; pub const IAppServiceConnectionExtendedExecution = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, OpenForExtendedExecutionAsync: fn( self: *const IAppServiceConnectionExtendedExecution, riid: ?*const Guid, operation: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IAppServiceConnectionExtendedExecution_OpenForExtendedExecutionAsync(self: *const T, riid: ?*const Guid, operation: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IAppServiceConnectionExtendedExecution.VTable, self.vtable).OpenForExtendedExecutionAsync(@ptrCast(*const IAppServiceConnectionExtendedExecution, self), riid, operation); } };} pub usingnamespace MethodMixin(@This()); }; const IID_ICorrelationVectorSource_Value = @import("../zig.zig").Guid.initString("152b8a3b-b9b9-4685-b56e-974847bc7545"); pub const IID_ICorrelationVectorSource = &IID_ICorrelationVectorSource_Value; pub const ICorrelationVectorSource = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, // TODO: this function has a "SpecialName", should Zig do anything with this? get_CorrelationVector: fn( self: *const ICorrelationVectorSource, cv: ?*?HSTRING, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICorrelationVectorSource_get_CorrelationVector(self: *const T, cv: ?*?HSTRING) callconv(.Inline) HRESULT { return @ptrCast(*const ICorrelationVectorSource.VTable, self.vtable).get_CorrelationVector(@ptrCast(*const ICorrelationVectorSource, self), cv); } };} pub usingnamespace MethodMixin(@This()); }; pub const CASTING_CONNECTION_ERROR_STATUS = enum(i32) { SUCCEEDED = 0, DEVICE_DID_NOT_RESPOND = 1, DEVICE_ERROR = 2, DEVICE_LOCKED = 3, PROTECTED_PLAYBACK_FAILED = 4, INVALID_CASTING_SOURCE = 5, UNKNOWN = 6, }; pub const CASTING_CONNECTION_ERROR_STATUS_SUCCEEDED = CASTING_CONNECTION_ERROR_STATUS.SUCCEEDED; pub const CASTING_CONNECTION_ERROR_STATUS_DEVICE_DID_NOT_RESPOND = CASTING_CONNECTION_ERROR_STATUS.DEVICE_DID_NOT_RESPOND; pub const CASTING_CONNECTION_ERROR_STATUS_DEVICE_ERROR = CASTING_CONNECTION_ERROR_STATUS.DEVICE_ERROR; pub const CASTING_CONNECTION_ERROR_STATUS_DEVICE_LOCKED = CASTING_CONNECTION_ERROR_STATUS.DEVICE_LOCKED; pub const CASTING_CONNECTION_ERROR_STATUS_PROTECTED_PLAYBACK_FAILED = CASTING_CONNECTION_ERROR_STATUS.PROTECTED_PLAYBACK_FAILED; pub const CASTING_CONNECTION_ERROR_STATUS_INVALID_CASTING_SOURCE = CASTING_CONNECTION_ERROR_STATUS.INVALID_CASTING_SOURCE; pub const CASTING_CONNECTION_ERROR_STATUS_UNKNOWN = CASTING_CONNECTION_ERROR_STATUS.UNKNOWN; pub const CASTING_CONNECTION_STATE = enum(i32) { DISCONNECTED = 0, CONNECTED = 1, RENDERING = 2, DISCONNECTING = 3, CONNECTING = 4, }; pub const CASTING_CONNECTION_STATE_DISCONNECTED = CASTING_CONNECTION_STATE.DISCONNECTED; pub const CASTING_CONNECTION_STATE_CONNECTED = CASTING_CONNECTION_STATE.CONNECTED; pub const CASTING_CONNECTION_STATE_RENDERING = CASTING_CONNECTION_STATE.RENDERING; pub const CASTING_CONNECTION_STATE_DISCONNECTING = CASTING_CONNECTION_STATE.DISCONNECTING; pub const CASTING_CONNECTION_STATE_CONNECTING = CASTING_CONNECTION_STATE.CONNECTING; const IID_ICastingEventHandler_Value = @import("../zig.zig").Guid.initString("c79a6cb7-bebd-47a6-a2ad-4d45ad79c7bc"); pub const IID_ICastingEventHandler = &IID_ICastingEventHandler_Value; pub const ICastingEventHandler = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, OnStateChanged: fn( self: *const ICastingEventHandler, newState: CASTING_CONNECTION_STATE, ) callconv(@import("std").os.windows.WINAPI) HRESULT, OnError: fn( self: *const ICastingEventHandler, errorStatus: CASTING_CONNECTION_ERROR_STATUS, errorMessage: ?[*:0]const u16, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICastingEventHandler_OnStateChanged(self: *const T, newState: CASTING_CONNECTION_STATE) callconv(.Inline) HRESULT { return @ptrCast(*const ICastingEventHandler.VTable, self.vtable).OnStateChanged(@ptrCast(*const ICastingEventHandler, self), newState); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICastingEventHandler_OnError(self: *const T, errorStatus: CASTING_CONNECTION_ERROR_STATUS, errorMessage: ?[*:0]const u16) callconv(.Inline) HRESULT { return @ptrCast(*const ICastingEventHandler.VTable, self.vtable).OnError(@ptrCast(*const ICastingEventHandler, self), errorStatus, errorMessage); } };} pub usingnamespace MethodMixin(@This()); }; const IID_ICastingController_Value = @import("../zig.zig").Guid.initString("f0a56423-a664-4fbd-8b43-409a45e8d9a1"); pub const IID_ICastingController = &IID_ICastingController_Value; pub const ICastingController = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, Initialize: fn( self: *const ICastingController, castingEngine: ?*IUnknown, castingSource: ?*IUnknown, ) callconv(@import("std").os.windows.WINAPI) HRESULT, Connect: fn( self: *const ICastingController, ) callconv(@import("std").os.windows.WINAPI) HRESULT, Disconnect: fn( self: *const ICastingController, ) callconv(@import("std").os.windows.WINAPI) HRESULT, Advise: fn( self: *const ICastingController, eventHandler: ?*ICastingEventHandler, cookie: ?*u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, UnAdvise: fn( self: *const ICastingController, cookie: u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICastingController_Initialize(self: *const T, castingEngine: ?*IUnknown, castingSource: ?*IUnknown) callconv(.Inline) HRESULT { return @ptrCast(*const ICastingController.VTable, self.vtable).Initialize(@ptrCast(*const ICastingController, self), castingEngine, castingSource); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICastingController_Connect(self: *const T) callconv(.Inline) HRESULT { return @ptrCast(*const ICastingController.VTable, self.vtable).Connect(@ptrCast(*const ICastingController, self)); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICastingController_Disconnect(self: *const T) callconv(.Inline) HRESULT { return @ptrCast(*const ICastingController.VTable, self.vtable).Disconnect(@ptrCast(*const ICastingController, self)); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICastingController_Advise(self: *const T, eventHandler: ?*ICastingEventHandler, cookie: ?*u32) callconv(.Inline) HRESULT { return @ptrCast(*const ICastingController.VTable, self.vtable).Advise(@ptrCast(*const ICastingController, self), eventHandler, cookie); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICastingController_UnAdvise(self: *const T, cookie: u32) callconv(.Inline) HRESULT { return @ptrCast(*const ICastingController.VTable, self.vtable).UnAdvise(@ptrCast(*const ICastingController, self), cookie); } };} pub usingnamespace MethodMixin(@This()); }; const IID_ICastingSourceInfo_Value = @import("../zig.zig").Guid.initString("45101ab7-7c3a-4bce-9500-12c09024b298"); pub const IID_ICastingSourceInfo = &IID_ICastingSourceInfo_Value; pub const ICastingSourceInfo = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, GetController: fn( self: *const ICastingSourceInfo, controller: ?*?*ICastingController, ) callconv(@import("std").os.windows.WINAPI) HRESULT, GetProperties: fn( self: *const ICastingSourceInfo, props: ?*?*INamedPropertyStore, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICastingSourceInfo_GetController(self: *const T, controller: ?*?*ICastingController) callconv(.Inline) HRESULT { return @ptrCast(*const ICastingSourceInfo.VTable, self.vtable).GetController(@ptrCast(*const ICastingSourceInfo, self), controller); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICastingSourceInfo_GetProperties(self: *const T, props: ?*?*INamedPropertyStore) callconv(.Inline) HRESULT { return @ptrCast(*const ICastingSourceInfo.VTable, self.vtable).GetProperties(@ptrCast(*const ICastingSourceInfo, self), props); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IDragDropManagerInterop_Value = @import("../zig.zig").Guid.initString("5ad8cba7-4c01-4dac-9074-827894292d63"); pub const IID_IDragDropManagerInterop = &IID_IDragDropManagerInterop_Value; pub const IDragDropManagerInterop = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, GetForWindow: fn( self: *const IDragDropManagerInterop, hwnd: ?HWND, riid: ?*const Guid, ppv: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IDragDropManagerInterop_GetForWindow(self: *const T, hwnd: ?HWND, riid: ?*const Guid, ppv: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IDragDropManagerInterop.VTable, self.vtable).GetForWindow(@ptrCast(*const IDragDropManagerInterop, self), hwnd, riid, ppv); } };} pub usingnamespace MethodMixin(@This()); }; // TODO: this type is limited to platform 'windows10.0.14393' const IID_IInputPaneInterop_Value = @import("../zig.zig").Guid.initString("75cf2c57-9195-4931-8332-f0b409e916af"); pub const IID_IInputPaneInterop = &IID_IInputPaneInterop_Value; pub const IInputPaneInterop = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, GetForWindow: fn( self: *const IInputPaneInterop, appWindow: ?HWND, riid: ?*const Guid, inputPane: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IInputPaneInterop_GetForWindow(self: *const T, appWindow: ?HWND, riid: ?*const Guid, inputPane: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IInputPaneInterop.VTable, self.vtable).GetForWindow(@ptrCast(*const IInputPaneInterop, self), appWindow, riid, inputPane); } };} pub usingnamespace MethodMixin(@This()); }; // TODO: this type is limited to platform 'windows8.0' const IID_IPlayToManagerInterop_Value = @import("../zig.zig").Guid.initString("24394699-1f2c-4eb3-8cd7-0ec1da42a540"); pub const IID_IPlayToManagerInterop = &IID_IPlayToManagerInterop_Value; pub const IPlayToManagerInterop = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, GetForWindow: fn( self: *const IPlayToManagerInterop, appWindow: ?HWND, riid: ?*const Guid, playToManager: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, ShowPlayToUIForWindow: fn( self: *const IPlayToManagerInterop, appWindow: ?HWND, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IPlayToManagerInterop_GetForWindow(self: *const T, appWindow: ?HWND, riid: ?*const Guid, playToManager: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IPlayToManagerInterop.VTable, self.vtable).GetForWindow(@ptrCast(*const IPlayToManagerInterop, self), appWindow, riid, playToManager); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IPlayToManagerInterop_ShowPlayToUIForWindow(self: *const T, appWindow: ?HWND) callconv(.Inline) HRESULT { return @ptrCast(*const IPlayToManagerInterop.VTable, self.vtable).ShowPlayToUIForWindow(@ptrCast(*const IPlayToManagerInterop, self), appWindow); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IPrinting3DManagerInterop_Value = @import("../zig.zig").Guid.initString("9ca31010-1484-4587-b26b-dddf9f9caecd"); pub const IID_IPrinting3DManagerInterop = &IID_IPrinting3DManagerInterop_Value; pub const IPrinting3DManagerInterop = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, GetForWindow: fn( self: *const IPrinting3DManagerInterop, appWindow: ?HWND, riid: ?*const Guid, printManager: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, ShowPrintUIForWindowAsync: fn( self: *const IPrinting3DManagerInterop, appWindow: ?HWND, riid: ?*const Guid, asyncOperation: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IPrinting3DManagerInterop_GetForWindow(self: *const T, appWindow: ?HWND, riid: ?*const Guid, printManager: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IPrinting3DManagerInterop.VTable, self.vtable).GetForWindow(@ptrCast(*const IPrinting3DManagerInterop, self), appWindow, riid, printManager); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IPrinting3DManagerInterop_ShowPrintUIForWindowAsync(self: *const T, appWindow: ?HWND, riid: ?*const Guid, asyncOperation: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IPrinting3DManagerInterop.VTable, self.vtable).ShowPrintUIForWindowAsync(@ptrCast(*const IPrinting3DManagerInterop, self), appWindow, riid, asyncOperation); } };} pub usingnamespace MethodMixin(@This()); }; // TODO: this type is limited to platform 'windows8.0' const IID_IPrintManagerInterop_Value = @import("../zig.zig").Guid.initString("c5435a42-8d43-4e7b-a68a-ef311e392087"); pub const IID_IPrintManagerInterop = &IID_IPrintManagerInterop_Value; pub const IPrintManagerInterop = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, GetForWindow: fn( self: *const IPrintManagerInterop, appWindow: ?HWND, riid: ?*const Guid, printManager: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, ShowPrintUIForWindowAsync: fn( self: *const IPrintManagerInterop, appWindow: ?HWND, riid: ?*const Guid, asyncOperation: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IPrintManagerInterop_GetForWindow(self: *const T, appWindow: ?HWND, riid: ?*const Guid, printManager: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IPrintManagerInterop.VTable, self.vtable).GetForWindow(@ptrCast(*const IPrintManagerInterop, self), appWindow, riid, printManager); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IPrintManagerInterop_ShowPrintUIForWindowAsync(self: *const T, appWindow: ?HWND, riid: ?*const Guid, asyncOperation: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IPrintManagerInterop.VTable, self.vtable).ShowPrintUIForWindowAsync(@ptrCast(*const IPrintManagerInterop, self), appWindow, riid, asyncOperation); } };} pub usingnamespace MethodMixin(@This()); }; const IID_ICorrelationVectorInformation_Value = @import("../zig.zig").Guid.initString("83c78b3c-d88b-4950-aa6e-22b8d22aabd3"); pub const IID_ICorrelationVectorInformation = &IID_ICorrelationVectorInformation_Value; pub const ICorrelationVectorInformation = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, // TODO: this function has a "SpecialName", should Zig do anything with this? get_LastCorrelationVectorForThread: fn( self: *const ICorrelationVectorInformation, cv: ?*?HSTRING, ) callconv(@import("std").os.windows.WINAPI) HRESULT, // TODO: this function has a "SpecialName", should Zig do anything with this? get_NextCorrelationVectorForThread: fn( self: *const ICorrelationVectorInformation, cv: ?*?HSTRING, ) callconv(@import("std").os.windows.WINAPI) HRESULT, // TODO: this function has a "SpecialName", should Zig do anything with this? put_NextCorrelationVectorForThread: fn( self: *const ICorrelationVectorInformation, cv: ?HSTRING, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICorrelationVectorInformation_get_LastCorrelationVectorForThread(self: *const T, cv: ?*?HSTRING) callconv(.Inline) HRESULT { return @ptrCast(*const ICorrelationVectorInformation.VTable, self.vtable).get_LastCorrelationVectorForThread(@ptrCast(*const ICorrelationVectorInformation, self), cv); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICorrelationVectorInformation_get_NextCorrelationVectorForThread(self: *const T, cv: ?*?HSTRING) callconv(.Inline) HRESULT { return @ptrCast(*const ICorrelationVectorInformation.VTable, self.vtable).get_NextCorrelationVectorForThread(@ptrCast(*const ICorrelationVectorInformation, self), cv); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICorrelationVectorInformation_put_NextCorrelationVectorForThread(self: *const T, cv: ?HSTRING) callconv(.Inline) HRESULT { return @ptrCast(*const ICorrelationVectorInformation.VTable, self.vtable).put_NextCorrelationVectorForThread(@ptrCast(*const ICorrelationVectorInformation, self), cv); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IUIViewSettingsInterop_Value = @import("../zig.zig").Guid.initString("3694dbf9-8f68-44be-8ff5-195c98ede8a6"); pub const IID_IUIViewSettingsInterop = &IID_IUIViewSettingsInterop_Value; pub const IUIViewSettingsInterop = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, GetForWindow: fn( self: *const IUIViewSettingsInterop, hwnd: ?HWND, riid: ?*const Guid, ppv: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IUIViewSettingsInterop_GetForWindow(self: *const T, hwnd: ?HWND, riid: ?*const Guid, ppv: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IUIViewSettingsInterop.VTable, self.vtable).GetForWindow(@ptrCast(*const IUIViewSettingsInterop, self), hwnd, riid, ppv); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IUserActivityInterop_Value = @import("../zig.zig").Guid.initString("1ade314d-0e0a-40d9-824c-9a088a50059f"); pub const IID_IUserActivityInterop = &IID_IUserActivityInterop_Value; pub const IUserActivityInterop = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, CreateSessionForWindow: fn( self: *const IUserActivityInterop, window: ?HWND, iid: ?*const Guid, value: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IUserActivityInterop_CreateSessionForWindow(self: *const T, window: ?HWND, iid: ?*const Guid, value: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IUserActivityInterop.VTable, self.vtable).CreateSessionForWindow(@ptrCast(*const IUserActivityInterop, self), window, iid, value); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IUserActivitySourceHostInterop_Value = @import("../zig.zig").Guid.initString("c15df8bc-8844-487a-b85b-7578e0f61419"); pub const IID_IUserActivitySourceHostInterop = &IID_IUserActivitySourceHostInterop_Value; pub const IUserActivitySourceHostInterop = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, SetActivitySourceHost: fn( self: *const IUserActivitySourceHostInterop, activitySourceHost: ?HSTRING, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IUserActivitySourceHostInterop_SetActivitySourceHost(self: *const T, activitySourceHost: ?HSTRING) callconv(.Inline) HRESULT { return @ptrCast(*const IUserActivitySourceHostInterop.VTable, self.vtable).SetActivitySourceHost(@ptrCast(*const IUserActivitySourceHostInterop, self), activitySourceHost); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IUserActivityRequestManagerInterop_Value = @import("../zig.zig").Guid.initString("dd69f876-9699-4715-9095-e37ea30dfa1b"); pub const IID_IUserActivityRequestManagerInterop = &IID_IUserActivityRequestManagerInterop_Value; pub const IUserActivityRequestManagerInterop = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, GetForWindow: fn( self: *const IUserActivityRequestManagerInterop, window: ?HWND, iid: ?*const Guid, value: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IUserActivityRequestManagerInterop_GetForWindow(self: *const T, window: ?HWND, iid: ?*const Guid, value: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IUserActivityRequestManagerInterop.VTable, self.vtable).GetForWindow(@ptrCast(*const IUserActivityRequestManagerInterop, self), window, iid, value); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IUserConsentVerifierInterop_Value = @import("../zig.zig").Guid.initString("39e050c3-4e74-441a-8dc0-b81104df949c"); pub const IID_IUserConsentVerifierInterop = &IID_IUserConsentVerifierInterop_Value; pub const IUserConsentVerifierInterop = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, RequestVerificationForWindowAsync: fn( self: *const IUserConsentVerifierInterop, appWindow: ?HWND, message: ?HSTRING, riid: ?*const Guid, asyncOperation: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IUserConsentVerifierInterop_RequestVerificationForWindowAsync(self: *const T, appWindow: ?HWND, message: ?HSTRING, riid: ?*const Guid, asyncOperation: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IUserConsentVerifierInterop.VTable, self.vtable).RequestVerificationForWindowAsync(@ptrCast(*const IUserConsentVerifierInterop, self), appWindow, message, riid, asyncOperation); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IWebAuthenticationCoreManagerInterop_Value = @import("../zig.zig").Guid.initString("f4b8e804-811e-4436-b69c-44cb67b72084"); pub const IID_IWebAuthenticationCoreManagerInterop = &IID_IWebAuthenticationCoreManagerInterop_Value; pub const IWebAuthenticationCoreManagerInterop = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, RequestTokenForWindowAsync: fn( self: *const IWebAuthenticationCoreManagerInterop, appWindow: ?HWND, request: ?*IInspectable, riid: ?*const Guid, asyncInfo: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, RequestTokenWithWebAccountForWindowAsync: fn( self: *const IWebAuthenticationCoreManagerInterop, appWindow: ?HWND, request: ?*IInspectable, webAccount: ?*IInspectable, riid: ?*const Guid, asyncInfo: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IWebAuthenticationCoreManagerInterop_RequestTokenForWindowAsync(self: *const T, appWindow: ?HWND, request: ?*IInspectable, riid: ?*const Guid, asyncInfo: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IWebAuthenticationCoreManagerInterop.VTable, self.vtable).RequestTokenForWindowAsync(@ptrCast(*const IWebAuthenticationCoreManagerInterop, self), appWindow, request, riid, asyncInfo); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IWebAuthenticationCoreManagerInterop_RequestTokenWithWebAccountForWindowAsync(self: *const T, appWindow: ?HWND, request: ?*IInspectable, webAccount: ?*IInspectable, riid: ?*const Guid, asyncInfo: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IWebAuthenticationCoreManagerInterop.VTable, self.vtable).RequestTokenWithWebAccountForWindowAsync(@ptrCast(*const IWebAuthenticationCoreManagerInterop, self), appWindow, request, webAccount, riid, asyncInfo); } };} pub usingnamespace MethodMixin(@This()); }; pub const PFN_PDF_CREATE_RENDERER = fn( param0: ?*IDXGIDevice, param1: ?*?*IPdfRendererNative, ) callconv(@import("std").os.windows.WINAPI) HRESULT; pub const PDF_RENDER_PARAMS = extern struct { SourceRect: D2D_RECT_F, DestinationWidth: u32, DestinationHeight: u32, BackgroundColor: D2D_COLOR_F, IgnoreHighContrast: BOOLEAN, }; const IID_IPdfRendererNative_Value = @import("../zig.zig").Guid.initString("7d9dcd91-d277-4947-8527-07a0daeda94a"); pub const IID_IPdfRendererNative = &IID_IPdfRendererNative_Value; pub const IPdfRendererNative = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, RenderPageToSurface: fn( self: *const IPdfRendererNative, pdfPage: ?*IUnknown, pSurface: ?*IDXGISurface, offset: POINT, pRenderParams: ?*PDF_RENDER_PARAMS, ) callconv(@import("std").os.windows.WINAPI) HRESULT, RenderPageToDeviceContext: fn( self: *const IPdfRendererNative, pdfPage: ?*IUnknown, pD2DDeviceContext: ?*ID2D1DeviceContext, pRenderParams: ?*PDF_RENDER_PARAMS, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IPdfRendererNative_RenderPageToSurface(self: *const T, pdfPage: ?*IUnknown, pSurface: ?*IDXGISurface, offset: POINT, pRenderParams: ?*PDF_RENDER_PARAMS) callconv(.Inline) HRESULT { return @ptrCast(*const IPdfRendererNative.VTable, self.vtable).RenderPageToSurface(@ptrCast(*const IPdfRendererNative, self), pdfPage, pSurface, offset, pRenderParams); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IPdfRendererNative_RenderPageToDeviceContext(self: *const T, pdfPage: ?*IUnknown, pD2DDeviceContext: ?*ID2D1DeviceContext, pRenderParams: ?*PDF_RENDER_PARAMS) callconv(.Inline) HRESULT { return @ptrCast(*const IPdfRendererNative.VTable, self.vtable).RenderPageToDeviceContext(@ptrCast(*const IPdfRendererNative, self), pdfPage, pD2DDeviceContext, pRenderParams); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IDisplayDeviceInterop_Value = @import("../zig.zig").Guid.initString("64338358-366a-471b-bd56-dd8ef48e439b"); pub const IID_IDisplayDeviceInterop = &IID_IDisplayDeviceInterop_Value; pub const IDisplayDeviceInterop = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, CreateSharedHandle: fn( self: *const IDisplayDeviceInterop, pObject: ?*IInspectable, pSecurityAttributes: ?*const SECURITY_ATTRIBUTES, Access: u32, Name: ?HSTRING, pHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) HRESULT, OpenSharedHandle: fn( self: *const IDisplayDeviceInterop, NTHandle: ?HANDLE, riid: Guid, ppvObj: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IDisplayDeviceInterop_CreateSharedHandle(self: *const T, pObject: ?*IInspectable, pSecurityAttributes: ?*const SECURITY_ATTRIBUTES, Access: u32, Name: ?HSTRING, pHandle: ?*?HANDLE) callconv(.Inline) HRESULT { return @ptrCast(*const IDisplayDeviceInterop.VTable, self.vtable).CreateSharedHandle(@ptrCast(*const IDisplayDeviceInterop, self), pObject, pSecurityAttributes, Access, Name, pHandle); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IDisplayDeviceInterop_OpenSharedHandle(self: *const T, NTHandle: ?HANDLE, riid: Guid, ppvObj: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IDisplayDeviceInterop.VTable, self.vtable).OpenSharedHandle(@ptrCast(*const IDisplayDeviceInterop, self), NTHandle, riid, ppvObj); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IDisplayPathInterop_Value = @import("../zig.zig").Guid.initString("a6ba4205-e59e-4e71-b25b-4e436d21ee3d"); pub const IID_IDisplayPathInterop = &IID_IDisplayPathInterop_Value; pub const IDisplayPathInterop = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, CreateSourcePresentationHandle: fn( self: *const IDisplayPathInterop, pValue: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) HRESULT, GetSourceId: fn( self: *const IDisplayPathInterop, pSourceId: ?*u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IDisplayPathInterop_CreateSourcePresentationHandle(self: *const T, pValue: ?*?HANDLE) callconv(.Inline) HRESULT { return @ptrCast(*const IDisplayPathInterop.VTable, self.vtable).CreateSourcePresentationHandle(@ptrCast(*const IDisplayPathInterop, self), pValue); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IDisplayPathInterop_GetSourceId(self: *const T, pSourceId: ?*u32) callconv(.Inline) HRESULT { return @ptrCast(*const IDisplayPathInterop.VTable, self.vtable).GetSourceId(@ptrCast(*const IDisplayPathInterop, self), pSourceId); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IGraphicsCaptureItemInterop_Value = @import("../zig.zig").Guid.initString("3628e81b-3cac-4c60-b7f4-23ce0e0c3356"); pub const IID_IGraphicsCaptureItemInterop = &IID_IGraphicsCaptureItemInterop_Value; pub const IGraphicsCaptureItemInterop = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, CreateForWindow: fn( self: *const IGraphicsCaptureItemInterop, window: ?HWND, riid: ?*const Guid, result: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, CreateForMonitor: fn( self: *const IGraphicsCaptureItemInterop, monitor: ?HMONITOR, riid: ?*const Guid, result: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IGraphicsCaptureItemInterop_CreateForWindow(self: *const T, window: ?HWND, riid: ?*const Guid, result: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IGraphicsCaptureItemInterop.VTable, self.vtable).CreateForWindow(@ptrCast(*const IGraphicsCaptureItemInterop, self), window, riid, result); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IGraphicsCaptureItemInterop_CreateForMonitor(self: *const T, monitor: ?HMONITOR, riid: ?*const Guid, result: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IGraphicsCaptureItemInterop.VTable, self.vtable).CreateForMonitor(@ptrCast(*const IGraphicsCaptureItemInterop, self), monitor, riid, result); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IDirect3DDxgiInterfaceAccess_Value = @import("../zig.zig").Guid.initString("a9b3d012-3df2-4ee3-b8d1-8695f457d3c1"); pub const IID_IDirect3DDxgiInterfaceAccess = &IID_IDirect3DDxgiInterfaceAccess_Value; pub const IDirect3DDxgiInterfaceAccess = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, GetInterface: fn( self: *const IDirect3DDxgiInterfaceAccess, iid: ?*const Guid, p: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IDirect3DDxgiInterfaceAccess_GetInterface(self: *const T, iid: ?*const Guid, p: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IDirect3DDxgiInterfaceAccess.VTable, self.vtable).GetInterface(@ptrCast(*const IDirect3DDxgiInterfaceAccess, self), iid, p); } };} pub usingnamespace MethodMixin(@This()); }; const IID_ISoftwareBitmapNative_Value = @import("../zig.zig").Guid.initString("94bc8415-04ea-4b2e-af13-4de95aa898eb"); pub const IID_ISoftwareBitmapNative = &IID_ISoftwareBitmapNative_Value; pub const ISoftwareBitmapNative = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, GetData: fn( self: *const ISoftwareBitmapNative, riid: ?*const Guid, ppv: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISoftwareBitmapNative_GetData(self: *const T, riid: ?*const Guid, ppv: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const ISoftwareBitmapNative.VTable, self.vtable).GetData(@ptrCast(*const ISoftwareBitmapNative, self), riid, ppv); } };} pub usingnamespace MethodMixin(@This()); }; const IID_ISoftwareBitmapNativeFactory_Value = @import("../zig.zig").Guid.initString("c3c181ec-2914-4791-af02-02d224a10b43"); pub const IID_ISoftwareBitmapNativeFactory = &IID_ISoftwareBitmapNativeFactory_Value; pub const ISoftwareBitmapNativeFactory = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, CreateFromWICBitmap: fn( self: *const ISoftwareBitmapNativeFactory, data: ?*IWICBitmap, forceReadOnly: BOOL, riid: ?*const Guid, ppv: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, CreateFromMF2DBuffer2: fn( self: *const ISoftwareBitmapNativeFactory, data: ?*IMF2DBuffer2, subtype: ?*const Guid, width: u32, height: u32, forceReadOnly: BOOL, minDisplayAperture: ?*const MFVideoArea, riid: ?*const Guid, ppv: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISoftwareBitmapNativeFactory_CreateFromWICBitmap(self: *const T, data: ?*IWICBitmap, forceReadOnly: BOOL, riid: ?*const Guid, ppv: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const ISoftwareBitmapNativeFactory.VTable, self.vtable).CreateFromWICBitmap(@ptrCast(*const ISoftwareBitmapNativeFactory, self), data, forceReadOnly, riid, ppv); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISoftwareBitmapNativeFactory_CreateFromMF2DBuffer2(self: *const T, data: ?*IMF2DBuffer2, subtype: ?*const Guid, width: u32, height: u32, forceReadOnly: BOOL, minDisplayAperture: ?*const MFVideoArea, riid: ?*const Guid, ppv: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const ISoftwareBitmapNativeFactory.VTable, self.vtable).CreateFromMF2DBuffer2(@ptrCast(*const ISoftwareBitmapNativeFactory, self), data, subtype, width, height, forceReadOnly, minDisplayAperture, riid, ppv); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IAudioFrameNative_Value = @import("../zig.zig").Guid.initString("20be1e2e-930f-4746-9335-3c332f255093"); pub const IID_IAudioFrameNative = &IID_IAudioFrameNative_Value; pub const IAudioFrameNative = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, GetData: fn( self: *const IAudioFrameNative, riid: ?*const Guid, ppv: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IAudioFrameNative_GetData(self: *const T, riid: ?*const Guid, ppv: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IAudioFrameNative.VTable, self.vtable).GetData(@ptrCast(*const IAudioFrameNative, self), riid, ppv); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IVideoFrameNative_Value = @import("../zig.zig").Guid.initString("26ba702b-314a-4620-aaf6-7a51aa58fa18"); pub const IID_IVideoFrameNative = &IID_IVideoFrameNative_Value; pub const IVideoFrameNative = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, GetData: fn( self: *const IVideoFrameNative, riid: ?*const Guid, ppv: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, GetDevice: fn( self: *const IVideoFrameNative, riid: ?*const Guid, ppv: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IVideoFrameNative_GetData(self: *const T, riid: ?*const Guid, ppv: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IVideoFrameNative.VTable, self.vtable).GetData(@ptrCast(*const IVideoFrameNative, self), riid, ppv); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IVideoFrameNative_GetDevice(self: *const T, riid: ?*const Guid, ppv: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IVideoFrameNative.VTable, self.vtable).GetDevice(@ptrCast(*const IVideoFrameNative, self), riid, ppv); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IAudioFrameNativeFactory_Value = @import("../zig.zig").Guid.initString("7bd67cf8-bf7d-43e6-af8d-b170ee0c0110"); pub const IID_IAudioFrameNativeFactory = &IID_IAudioFrameNativeFactory_Value; pub const IAudioFrameNativeFactory = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, CreateFromMFSample: fn( self: *const IAudioFrameNativeFactory, data: ?*IMFSample, forceReadOnly: BOOL, riid: ?*const Guid, ppv: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IAudioFrameNativeFactory_CreateFromMFSample(self: *const T, data: ?*IMFSample, forceReadOnly: BOOL, riid: ?*const Guid, ppv: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IAudioFrameNativeFactory.VTable, self.vtable).CreateFromMFSample(@ptrCast(*const IAudioFrameNativeFactory, self), data, forceReadOnly, riid, ppv); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IVideoFrameNativeFactory_Value = @import("../zig.zig").Guid.initString("69e3693e-8e1e-4e63-ac4c-7fdc21d9731d"); pub const IID_IVideoFrameNativeFactory = &IID_IVideoFrameNativeFactory_Value; pub const IVideoFrameNativeFactory = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, CreateFromMFSample: fn( self: *const IVideoFrameNativeFactory, data: ?*IMFSample, subtype: ?*const Guid, width: u32, height: u32, forceReadOnly: BOOL, minDisplayAperture: ?*const MFVideoArea, device: ?*IMFDXGIDeviceManager, riid: ?*const Guid, ppv: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IVideoFrameNativeFactory_CreateFromMFSample(self: *const T, data: ?*IMFSample, subtype: ?*const Guid, width: u32, height: u32, forceReadOnly: BOOL, minDisplayAperture: ?*const MFVideoArea, device: ?*IMFDXGIDeviceManager, riid: ?*const Guid, ppv: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IVideoFrameNativeFactory.VTable, self.vtable).CreateFromMFSample(@ptrCast(*const IVideoFrameNativeFactory, self), data, subtype, width, height, forceReadOnly, minDisplayAperture, device, riid, ppv); } };} pub usingnamespace MethodMixin(@This()); }; const IID_ISurfaceImageSourceNative_Value = @import("../zig.zig").Guid.initString("f2e9edc1-d307-4525-9886-0fafaa44163c"); pub const IID_ISurfaceImageSourceNative = &IID_ISurfaceImageSourceNative_Value; pub const ISurfaceImageSourceNative = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, SetDevice: fn( self: *const ISurfaceImageSourceNative, device: ?*IDXGIDevice, ) callconv(@import("std").os.windows.WINAPI) HRESULT, BeginDraw: fn( self: *const ISurfaceImageSourceNative, updateRect: RECT, surface: ?*?*IDXGISurface, offset: ?*POINT, ) callconv(@import("std").os.windows.WINAPI) HRESULT, EndDraw: fn( self: *const ISurfaceImageSourceNative, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISurfaceImageSourceNative_SetDevice(self: *const T, device: ?*IDXGIDevice) callconv(.Inline) HRESULT { return @ptrCast(*const ISurfaceImageSourceNative.VTable, self.vtable).SetDevice(@ptrCast(*const ISurfaceImageSourceNative, self), device); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISurfaceImageSourceNative_BeginDraw(self: *const T, updateRect: RECT, surface: ?*?*IDXGISurface, offset: ?*POINT) callconv(.Inline) HRESULT { return @ptrCast(*const ISurfaceImageSourceNative.VTable, self.vtable).BeginDraw(@ptrCast(*const ISurfaceImageSourceNative, self), updateRect, surface, offset); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISurfaceImageSourceNative_EndDraw(self: *const T) callconv(.Inline) HRESULT { return @ptrCast(*const ISurfaceImageSourceNative.VTable, self.vtable).EndDraw(@ptrCast(*const ISurfaceImageSourceNative, self)); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IVirtualSurfaceUpdatesCallbackNative_Value = @import("../zig.zig").Guid.initString("dbf2e947-8e6c-4254-9eee-7738f71386c9"); pub const IID_IVirtualSurfaceUpdatesCallbackNative = &IID_IVirtualSurfaceUpdatesCallbackNative_Value; pub const IVirtualSurfaceUpdatesCallbackNative = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, UpdatesNeeded: fn( self: *const IVirtualSurfaceUpdatesCallbackNative, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IVirtualSurfaceUpdatesCallbackNative_UpdatesNeeded(self: *const T) callconv(.Inline) HRESULT { return @ptrCast(*const IVirtualSurfaceUpdatesCallbackNative.VTable, self.vtable).UpdatesNeeded(@ptrCast(*const IVirtualSurfaceUpdatesCallbackNative, self)); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IVirtualSurfaceImageSourceNative_Value = @import("../zig.zig").Guid.initString("e9550983-360b-4f53-b391-afd695078691"); pub const IID_IVirtualSurfaceImageSourceNative = &IID_IVirtualSurfaceImageSourceNative_Value; pub const IVirtualSurfaceImageSourceNative = extern struct { pub const VTable = extern struct { base: ISurfaceImageSourceNative.VTable, Invalidate: fn( self: *const IVirtualSurfaceImageSourceNative, updateRect: RECT, ) callconv(@import("std").os.windows.WINAPI) HRESULT, GetUpdateRectCount: fn( self: *const IVirtualSurfaceImageSourceNative, count: ?*u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, GetUpdateRects: fn( self: *const IVirtualSurfaceImageSourceNative, updates: [*]RECT, count: u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, GetVisibleBounds: fn( self: *const IVirtualSurfaceImageSourceNative, bounds: ?*RECT, ) callconv(@import("std").os.windows.WINAPI) HRESULT, RegisterForUpdatesNeeded: fn( self: *const IVirtualSurfaceImageSourceNative, callback: ?*IVirtualSurfaceUpdatesCallbackNative, ) callconv(@import("std").os.windows.WINAPI) HRESULT, Resize: fn( self: *const IVirtualSurfaceImageSourceNative, newWidth: i32, newHeight: i32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace ISurfaceImageSourceNative.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IVirtualSurfaceImageSourceNative_Invalidate(self: *const T, updateRect: RECT) callconv(.Inline) HRESULT { return @ptrCast(*const IVirtualSurfaceImageSourceNative.VTable, self.vtable).Invalidate(@ptrCast(*const IVirtualSurfaceImageSourceNative, self), updateRect); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IVirtualSurfaceImageSourceNative_GetUpdateRectCount(self: *const T, count: ?*u32) callconv(.Inline) HRESULT { return @ptrCast(*const IVirtualSurfaceImageSourceNative.VTable, self.vtable).GetUpdateRectCount(@ptrCast(*const IVirtualSurfaceImageSourceNative, self), count); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IVirtualSurfaceImageSourceNative_GetUpdateRects(self: *const T, updates: [*]RECT, count: u32) callconv(.Inline) HRESULT { return @ptrCast(*const IVirtualSurfaceImageSourceNative.VTable, self.vtable).GetUpdateRects(@ptrCast(*const IVirtualSurfaceImageSourceNative, self), updates, count); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IVirtualSurfaceImageSourceNative_GetVisibleBounds(self: *const T, bounds: ?*RECT) callconv(.Inline) HRESULT { return @ptrCast(*const IVirtualSurfaceImageSourceNative.VTable, self.vtable).GetVisibleBounds(@ptrCast(*const IVirtualSurfaceImageSourceNative, self), bounds); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IVirtualSurfaceImageSourceNative_RegisterForUpdatesNeeded(self: *const T, callback: ?*IVirtualSurfaceUpdatesCallbackNative) callconv(.Inline) HRESULT { return @ptrCast(*const IVirtualSurfaceImageSourceNative.VTable, self.vtable).RegisterForUpdatesNeeded(@ptrCast(*const IVirtualSurfaceImageSourceNative, self), callback); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IVirtualSurfaceImageSourceNative_Resize(self: *const T, newWidth: i32, newHeight: i32) callconv(.Inline) HRESULT { return @ptrCast(*const IVirtualSurfaceImageSourceNative.VTable, self.vtable).Resize(@ptrCast(*const IVirtualSurfaceImageSourceNative, self), newWidth, newHeight); } };} pub usingnamespace MethodMixin(@This()); }; const IID_ISwapChainBackgroundPanelNative_Value = @import("../zig.zig").Guid.initString("43bebd4e-add5-4035-8f85-5608d08e9dc9"); pub const IID_ISwapChainBackgroundPanelNative = &IID_ISwapChainBackgroundPanelNative_Value; pub const ISwapChainBackgroundPanelNative = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, SetSwapChain: fn( self: *const ISwapChainBackgroundPanelNative, swapChain: ?*IDXGISwapChain, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISwapChainBackgroundPanelNative_SetSwapChain(self: *const T, swapChain: ?*IDXGISwapChain) callconv(.Inline) HRESULT { return @ptrCast(*const ISwapChainBackgroundPanelNative.VTable, self.vtable).SetSwapChain(@ptrCast(*const ISwapChainBackgroundPanelNative, self), swapChain); } };} pub usingnamespace MethodMixin(@This()); }; const IID_ISurfaceImageSourceManagerNative_Value = @import("../zig.zig").Guid.initString("4c8798b7-1d88-4a0f-b59b-b93f600de8c8"); pub const IID_ISurfaceImageSourceManagerNative = &IID_ISurfaceImageSourceManagerNative_Value; pub const ISurfaceImageSourceManagerNative = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, FlushAllSurfacesWithDevice: fn( self: *const ISurfaceImageSourceManagerNative, device: ?*IUnknown, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISurfaceImageSourceManagerNative_FlushAllSurfacesWithDevice(self: *const T, device: ?*IUnknown) callconv(.Inline) HRESULT { return @ptrCast(*const ISurfaceImageSourceManagerNative.VTable, self.vtable).FlushAllSurfacesWithDevice(@ptrCast(*const ISurfaceImageSourceManagerNative, self), device); } };} pub usingnamespace MethodMixin(@This()); }; const IID_ISurfaceImageSourceNativeWithD2D_Value = @import("../zig.zig").Guid.initString("54298223-41e1-4a41-9c08-02e8256864a1"); pub const IID_ISurfaceImageSourceNativeWithD2D = &IID_ISurfaceImageSourceNativeWithD2D_Value; pub const ISurfaceImageSourceNativeWithD2D = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, SetDevice: fn( self: *const ISurfaceImageSourceNativeWithD2D, device: ?*IUnknown, ) callconv(@import("std").os.windows.WINAPI) HRESULT, BeginDraw: fn( self: *const ISurfaceImageSourceNativeWithD2D, updateRect: ?*const RECT, iid: ?*const Guid, updateObject: ?*?*c_void, offset: ?*POINT, ) callconv(@import("std").os.windows.WINAPI) HRESULT, EndDraw: fn( self: *const ISurfaceImageSourceNativeWithD2D, ) callconv(@import("std").os.windows.WINAPI) HRESULT, SuspendDraw: fn( self: *const ISurfaceImageSourceNativeWithD2D, ) callconv(@import("std").os.windows.WINAPI) HRESULT, ResumeDraw: fn( self: *const ISurfaceImageSourceNativeWithD2D, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISurfaceImageSourceNativeWithD2D_SetDevice(self: *const T, device: ?*IUnknown) callconv(.Inline) HRESULT { return @ptrCast(*const ISurfaceImageSourceNativeWithD2D.VTable, self.vtable).SetDevice(@ptrCast(*const ISurfaceImageSourceNativeWithD2D, self), device); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISurfaceImageSourceNativeWithD2D_BeginDraw(self: *const T, updateRect: ?*const RECT, iid: ?*const Guid, updateObject: ?*?*c_void, offset: ?*POINT) callconv(.Inline) HRESULT { return @ptrCast(*const ISurfaceImageSourceNativeWithD2D.VTable, self.vtable).BeginDraw(@ptrCast(*const ISurfaceImageSourceNativeWithD2D, self), updateRect, iid, updateObject, offset); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISurfaceImageSourceNativeWithD2D_EndDraw(self: *const T) callconv(.Inline) HRESULT { return @ptrCast(*const ISurfaceImageSourceNativeWithD2D.VTable, self.vtable).EndDraw(@ptrCast(*const ISurfaceImageSourceNativeWithD2D, self)); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISurfaceImageSourceNativeWithD2D_SuspendDraw(self: *const T) callconv(.Inline) HRESULT { return @ptrCast(*const ISurfaceImageSourceNativeWithD2D.VTable, self.vtable).SuspendDraw(@ptrCast(*const ISurfaceImageSourceNativeWithD2D, self)); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISurfaceImageSourceNativeWithD2D_ResumeDraw(self: *const T) callconv(.Inline) HRESULT { return @ptrCast(*const ISurfaceImageSourceNativeWithD2D.VTable, self.vtable).ResumeDraw(@ptrCast(*const ISurfaceImageSourceNativeWithD2D, self)); } };} pub usingnamespace MethodMixin(@This()); }; const IID_ISwapChainPanelNative_Value = @import("../zig.zig").Guid.initString("f92f19d2-3ade-45a6-a20c-f6f1ea90554b"); pub const IID_ISwapChainPanelNative = &IID_ISwapChainPanelNative_Value; pub const ISwapChainPanelNative = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, SetSwapChain: fn( self: *const ISwapChainPanelNative, swapChain: ?*IDXGISwapChain, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISwapChainPanelNative_SetSwapChain(self: *const T, swapChain: ?*IDXGISwapChain) callconv(.Inline) HRESULT { return @ptrCast(*const ISwapChainPanelNative.VTable, self.vtable).SetSwapChain(@ptrCast(*const ISwapChainPanelNative, self), swapChain); } };} pub usingnamespace MethodMixin(@This()); }; const IID_ISwapChainPanelNative2_Value = @import("../zig.zig").Guid.initString("d5a2f60c-37b2-44a2-937b-8d8eb9726821"); pub const IID_ISwapChainPanelNative2 = &IID_ISwapChainPanelNative2_Value; pub const ISwapChainPanelNative2 = extern struct { pub const VTable = extern struct { base: ISwapChainPanelNative.VTable, SetSwapChainHandle: fn( self: *const ISwapChainPanelNative2, swapChainHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace ISwapChainPanelNative.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISwapChainPanelNative2_SetSwapChainHandle(self: *const T, swapChainHandle: ?HANDLE) callconv(.Inline) HRESULT { return @ptrCast(*const ISwapChainPanelNative2.VTable, self.vtable).SetSwapChainHandle(@ptrCast(*const ISwapChainPanelNative2, self), swapChainHandle); } };} pub usingnamespace MethodMixin(@This()); }; pub const GRAPHICS_EFFECT_PROPERTY_MAPPING = enum(i32) { UNKNOWN = 0, DIRECT = 1, VECTORX = 2, VECTORY = 3, VECTORZ = 4, VECTORW = 5, RECT_TO_VECTOR4 = 6, RADIANS_TO_DEGREES = 7, COLORMATRIX_ALPHA_MODE = 8, COLOR_TO_VECTOR3 = 9, COLOR_TO_VECTOR4 = 10, }; pub const GRAPHICS_EFFECT_PROPERTY_MAPPING_UNKNOWN = GRAPHICS_EFFECT_PROPERTY_MAPPING.UNKNOWN; pub const GRAPHICS_EFFECT_PROPERTY_MAPPING_DIRECT = GRAPHICS_EFFECT_PROPERTY_MAPPING.DIRECT; pub const GRAPHICS_EFFECT_PROPERTY_MAPPING_VECTORX = GRAPHICS_EFFECT_PROPERTY_MAPPING.VECTORX; pub const GRAPHICS_EFFECT_PROPERTY_MAPPING_VECTORY = GRAPHICS_EFFECT_PROPERTY_MAPPING.VECTORY; pub const GRAPHICS_EFFECT_PROPERTY_MAPPING_VECTORZ = GRAPHICS_EFFECT_PROPERTY_MAPPING.VECTORZ; pub const GRAPHICS_EFFECT_PROPERTY_MAPPING_VECTORW = GRAPHICS_EFFECT_PROPERTY_MAPPING.VECTORW; pub const GRAPHICS_EFFECT_PROPERTY_MAPPING_RECT_TO_VECTOR4 = GRAPHICS_EFFECT_PROPERTY_MAPPING.RECT_TO_VECTOR4; pub const GRAPHICS_EFFECT_PROPERTY_MAPPING_RADIANS_TO_DEGREES = GRAPHICS_EFFECT_PROPERTY_MAPPING.RADIANS_TO_DEGREES; pub const GRAPHICS_EFFECT_PROPERTY_MAPPING_COLORMATRIX_ALPHA_MODE = GRAPHICS_EFFECT_PROPERTY_MAPPING.COLORMATRIX_ALPHA_MODE; pub const GRAPHICS_EFFECT_PROPERTY_MAPPING_COLOR_TO_VECTOR3 = GRAPHICS_EFFECT_PROPERTY_MAPPING.COLOR_TO_VECTOR3; pub const GRAPHICS_EFFECT_PROPERTY_MAPPING_COLOR_TO_VECTOR4 = GRAPHICS_EFFECT_PROPERTY_MAPPING.COLOR_TO_VECTOR4; const IID_IGraphicsEffectD2D1Interop_Value = @import("../zig.zig").Guid.initString("2fc57384-a068-44d7-a331-30982fcf7177"); pub const IID_IGraphicsEffectD2D1Interop = &IID_IGraphicsEffectD2D1Interop_Value; pub const IGraphicsEffectD2D1Interop = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, GetEffectId: fn( self: *const IGraphicsEffectD2D1Interop, id: ?*Guid, ) callconv(@import("std").os.windows.WINAPI) HRESULT, GetNamedPropertyMapping: fn( self: *const IGraphicsEffectD2D1Interop, name: ?[*:0]const u16, index: ?*u32, mapping: ?*GRAPHICS_EFFECT_PROPERTY_MAPPING, ) callconv(@import("std").os.windows.WINAPI) HRESULT, GetPropertyCount: fn( self: *const IGraphicsEffectD2D1Interop, count: ?*u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, GetProperty: fn( self: *const IGraphicsEffectD2D1Interop, index: u32, value: ?**struct{comment: []const u8 = "MissingClrType IPropertyValue.Windows.Foundation"}, ) callconv(@import("std").os.windows.WINAPI) HRESULT, GetSource: fn( self: *const IGraphicsEffectD2D1Interop, index: u32, source: ?**struct{comment: []const u8 = "MissingClrType IGraphicsEffectSource.Windows.Graphics.Effects"}, ) callconv(@import("std").os.windows.WINAPI) HRESULT, GetSourceCount: fn( self: *const IGraphicsEffectD2D1Interop, count: ?*u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IGraphicsEffectD2D1Interop_GetEffectId(self: *const T, id: ?*Guid) callconv(.Inline) HRESULT { return @ptrCast(*const IGraphicsEffectD2D1Interop.VTable, self.vtable).GetEffectId(@ptrCast(*const IGraphicsEffectD2D1Interop, self), id); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IGraphicsEffectD2D1Interop_GetNamedPropertyMapping(self: *const T, name: ?[*:0]const u16, index: ?*u32, mapping: ?*GRAPHICS_EFFECT_PROPERTY_MAPPING) callconv(.Inline) HRESULT { return @ptrCast(*const IGraphicsEffectD2D1Interop.VTable, self.vtable).GetNamedPropertyMapping(@ptrCast(*const IGraphicsEffectD2D1Interop, self), name, index, mapping); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IGraphicsEffectD2D1Interop_GetPropertyCount(self: *const T, count: ?*u32) callconv(.Inline) HRESULT { return @ptrCast(*const IGraphicsEffectD2D1Interop.VTable, self.vtable).GetPropertyCount(@ptrCast(*const IGraphicsEffectD2D1Interop, self), count); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IGraphicsEffectD2D1Interop_GetProperty(self: *const T, index: u32, value: ?**struct{comment: []const u8 = "MissingClrType IPropertyValue.Windows.Foundation"}) callconv(.Inline) HRESULT { return @ptrCast(*const IGraphicsEffectD2D1Interop.VTable, self.vtable).GetProperty(@ptrCast(*const IGraphicsEffectD2D1Interop, self), index, value); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IGraphicsEffectD2D1Interop_GetSource(self: *const T, index: u32, source: ?**struct{comment: []const u8 = "MissingClrType IGraphicsEffectSource.Windows.Graphics.Effects"}) callconv(.Inline) HRESULT { return @ptrCast(*const IGraphicsEffectD2D1Interop.VTable, self.vtable).GetSource(@ptrCast(*const IGraphicsEffectD2D1Interop, self), index, source); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IGraphicsEffectD2D1Interop_GetSourceCount(self: *const T, count: ?*u32) callconv(.Inline) HRESULT { return @ptrCast(*const IGraphicsEffectD2D1Interop.VTable, self.vtable).GetSourceCount(@ptrCast(*const IGraphicsEffectD2D1Interop, self), count); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IGeometrySource2DInterop_Value = @import("../zig.zig").Guid.initString("0657af73-53fd-47cf-84ff-c8492d2a80a3"); pub const IID_IGeometrySource2DInterop = &IID_IGeometrySource2DInterop_Value; pub const IGeometrySource2DInterop = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, GetGeometry: fn( self: *const IGeometrySource2DInterop, value: ?*?*ID2D1Geometry, ) callconv(@import("std").os.windows.WINAPI) HRESULT, TryGetGeometryUsingFactory: fn( self: *const IGeometrySource2DInterop, factory: ?*ID2D1Factory, value: ?*?*ID2D1Geometry, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IGeometrySource2DInterop_GetGeometry(self: *const T, value: ?*?*ID2D1Geometry) callconv(.Inline) HRESULT { return @ptrCast(*const IGeometrySource2DInterop.VTable, self.vtable).GetGeometry(@ptrCast(*const IGeometrySource2DInterop, self), value); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IGeometrySource2DInterop_TryGetGeometryUsingFactory(self: *const T, factory: ?*ID2D1Factory, value: ?*?*ID2D1Geometry) callconv(.Inline) HRESULT { return @ptrCast(*const IGeometrySource2DInterop.VTable, self.vtable).TryGetGeometryUsingFactory(@ptrCast(*const IGeometrySource2DInterop, self), factory, value); } };} pub usingnamespace MethodMixin(@This()); }; const IID_ICompositionDrawingSurfaceInterop_Value = @import("../zig.zig").Guid.initString("fd04e6e3-fe0c-4c3c-ab19-a07601a576ee"); pub const IID_ICompositionDrawingSurfaceInterop = &IID_ICompositionDrawingSurfaceInterop_Value; pub const ICompositionDrawingSurfaceInterop = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, BeginDraw: fn( self: *const ICompositionDrawingSurfaceInterop, updateRect: ?*const RECT, iid: ?*const Guid, updateObject: ?*?*c_void, updateOffset: ?*POINT, ) callconv(@import("std").os.windows.WINAPI) HRESULT, EndDraw: fn( self: *const ICompositionDrawingSurfaceInterop, ) callconv(@import("std").os.windows.WINAPI) HRESULT, Resize: fn( self: *const ICompositionDrawingSurfaceInterop, sizePixels: SIZE, ) callconv(@import("std").os.windows.WINAPI) HRESULT, Scroll: fn( self: *const ICompositionDrawingSurfaceInterop, scrollRect: ?*const RECT, clipRect: ?*const RECT, offsetX: i32, offsetY: i32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, ResumeDraw: fn( self: *const ICompositionDrawingSurfaceInterop, ) callconv(@import("std").os.windows.WINAPI) HRESULT, SuspendDraw: fn( self: *const ICompositionDrawingSurfaceInterop, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICompositionDrawingSurfaceInterop_BeginDraw(self: *const T, updateRect: ?*const RECT, iid: ?*const Guid, updateObject: ?*?*c_void, updateOffset: ?*POINT) callconv(.Inline) HRESULT { return @ptrCast(*const ICompositionDrawingSurfaceInterop.VTable, self.vtable).BeginDraw(@ptrCast(*const ICompositionDrawingSurfaceInterop, self), updateRect, iid, updateObject, updateOffset); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICompositionDrawingSurfaceInterop_EndDraw(self: *const T) callconv(.Inline) HRESULT { return @ptrCast(*const ICompositionDrawingSurfaceInterop.VTable, self.vtable).EndDraw(@ptrCast(*const ICompositionDrawingSurfaceInterop, self)); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICompositionDrawingSurfaceInterop_Resize(self: *const T, sizePixels: SIZE) callconv(.Inline) HRESULT { return @ptrCast(*const ICompositionDrawingSurfaceInterop.VTable, self.vtable).Resize(@ptrCast(*const ICompositionDrawingSurfaceInterop, self), sizePixels); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICompositionDrawingSurfaceInterop_Scroll(self: *const T, scrollRect: ?*const RECT, clipRect: ?*const RECT, offsetX: i32, offsetY: i32) callconv(.Inline) HRESULT { return @ptrCast(*const ICompositionDrawingSurfaceInterop.VTable, self.vtable).Scroll(@ptrCast(*const ICompositionDrawingSurfaceInterop, self), scrollRect, clipRect, offsetX, offsetY); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICompositionDrawingSurfaceInterop_ResumeDraw(self: *const T) callconv(.Inline) HRESULT { return @ptrCast(*const ICompositionDrawingSurfaceInterop.VTable, self.vtable).ResumeDraw(@ptrCast(*const ICompositionDrawingSurfaceInterop, self)); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICompositionDrawingSurfaceInterop_SuspendDraw(self: *const T) callconv(.Inline) HRESULT { return @ptrCast(*const ICompositionDrawingSurfaceInterop.VTable, self.vtable).SuspendDraw(@ptrCast(*const ICompositionDrawingSurfaceInterop, self)); } };} pub usingnamespace MethodMixin(@This()); }; const IID_ICompositionDrawingSurfaceInterop2_Value = @import("../zig.zig").Guid.initString("41e64aae-98c0-4239-8e95-a330dd6aa18b"); pub const IID_ICompositionDrawingSurfaceInterop2 = &IID_ICompositionDrawingSurfaceInterop2_Value; pub const ICompositionDrawingSurfaceInterop2 = extern struct { pub const VTable = extern struct { base: ICompositionDrawingSurfaceInterop.VTable, CopySurface: fn( self: *const ICompositionDrawingSurfaceInterop2, destinationResource: ?*IUnknown, destinationOffsetX: i32, destinationOffsetY: i32, sourceRectangle: ?*const RECT, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace ICompositionDrawingSurfaceInterop.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICompositionDrawingSurfaceInterop2_CopySurface(self: *const T, destinationResource: ?*IUnknown, destinationOffsetX: i32, destinationOffsetY: i32, sourceRectangle: ?*const RECT) callconv(.Inline) HRESULT { return @ptrCast(*const ICompositionDrawingSurfaceInterop2.VTable, self.vtable).CopySurface(@ptrCast(*const ICompositionDrawingSurfaceInterop2, self), destinationResource, destinationOffsetX, destinationOffsetY, sourceRectangle); } };} pub usingnamespace MethodMixin(@This()); }; const IID_ICompositionGraphicsDeviceInterop_Value = @import("../zig.zig").Guid.initString("a116ff71-f8bf-4c8a-9c98-70779a32a9c8"); pub const IID_ICompositionGraphicsDeviceInterop = &IID_ICompositionGraphicsDeviceInterop_Value; pub const ICompositionGraphicsDeviceInterop = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, GetRenderingDevice: fn( self: *const ICompositionGraphicsDeviceInterop, value: ?*?*IUnknown, ) callconv(@import("std").os.windows.WINAPI) HRESULT, SetRenderingDevice: fn( self: *const ICompositionGraphicsDeviceInterop, value: ?*IUnknown, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICompositionGraphicsDeviceInterop_GetRenderingDevice(self: *const T, value: ?*?*IUnknown) callconv(.Inline) HRESULT { return @ptrCast(*const ICompositionGraphicsDeviceInterop.VTable, self.vtable).GetRenderingDevice(@ptrCast(*const ICompositionGraphicsDeviceInterop, self), value); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICompositionGraphicsDeviceInterop_SetRenderingDevice(self: *const T, value: ?*IUnknown) callconv(.Inline) HRESULT { return @ptrCast(*const ICompositionGraphicsDeviceInterop.VTable, self.vtable).SetRenderingDevice(@ptrCast(*const ICompositionGraphicsDeviceInterop, self), value); } };} pub usingnamespace MethodMixin(@This()); }; const IID_ICompositorInterop_Value = @import("../zig.zig").Guid.initString("25297d5c-3ad4-4c9c-b5cf-e36a38512330"); pub const IID_ICompositorInterop = &IID_ICompositorInterop_Value; pub const ICompositorInterop = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, CreateCompositionSurfaceForHandle: fn( self: *const ICompositorInterop, swapChain: ?HANDLE, result: ?**struct{comment: []const u8 = "MissingClrType ICompositionSurface.Windows.UI.Composition"}, ) callconv(@import("std").os.windows.WINAPI) HRESULT, CreateCompositionSurfaceForSwapChain: fn( self: *const ICompositorInterop, swapChain: ?*IUnknown, result: ?**struct{comment: []const u8 = "MissingClrType ICompositionSurface.Windows.UI.Composition"}, ) callconv(@import("std").os.windows.WINAPI) HRESULT, CreateGraphicsDevice: fn( self: *const ICompositorInterop, renderingDevice: ?*IUnknown, result: ?**struct{comment: []const u8 = "MissingClrType CompositionGraphicsDevice.Windows.UI.Composition"}, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICompositorInterop_CreateCompositionSurfaceForHandle(self: *const T, swapChain: ?HANDLE, result: ?**struct{comment: []const u8 = "MissingClrType ICompositionSurface.Windows.UI.Composition"}) callconv(.Inline) HRESULT { return @ptrCast(*const ICompositorInterop.VTable, self.vtable).CreateCompositionSurfaceForHandle(@ptrCast(*const ICompositorInterop, self), swapChain, result); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICompositorInterop_CreateCompositionSurfaceForSwapChain(self: *const T, swapChain: ?*IUnknown, result: ?**struct{comment: []const u8 = "MissingClrType ICompositionSurface.Windows.UI.Composition"}) callconv(.Inline) HRESULT { return @ptrCast(*const ICompositorInterop.VTable, self.vtable).CreateCompositionSurfaceForSwapChain(@ptrCast(*const ICompositorInterop, self), swapChain, result); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICompositorInterop_CreateGraphicsDevice(self: *const T, renderingDevice: ?*IUnknown, result: ?**struct{comment: []const u8 = "MissingClrType CompositionGraphicsDevice.Windows.UI.Composition"}) callconv(.Inline) HRESULT { return @ptrCast(*const ICompositorInterop.VTable, self.vtable).CreateGraphicsDevice(@ptrCast(*const ICompositorInterop, self), renderingDevice, result); } };} pub usingnamespace MethodMixin(@This()); }; const IID_ISwapChainInterop_Value = @import("../zig.zig").Guid.initString("26f496a0-7f38-45fb-88f7-faaabe67dd59"); pub const IID_ISwapChainInterop = &IID_ISwapChainInterop_Value; pub const ISwapChainInterop = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, SetSwapChain: fn( self: *const ISwapChainInterop, swapChain: ?*IUnknown, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISwapChainInterop_SetSwapChain(self: *const T, swapChain: ?*IUnknown) callconv(.Inline) HRESULT { return @ptrCast(*const ISwapChainInterop.VTable, self.vtable).SetSwapChain(@ptrCast(*const ISwapChainInterop, self), swapChain); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IVisualInteractionSourceInterop_Value = @import("../zig.zig").Guid.initString("11f62cd1-2f9d-42d3-b05f-d6790d9e9f8e"); pub const IID_IVisualInteractionSourceInterop = &IID_IVisualInteractionSourceInterop_Value; pub const IVisualInteractionSourceInterop = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, TryRedirectForManipulation: fn( self: *const IVisualInteractionSourceInterop, pointerInfo: ?*const POINTER_INFO, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IVisualInteractionSourceInterop_TryRedirectForManipulation(self: *const T, pointerInfo: ?*const POINTER_INFO) callconv(.Inline) HRESULT { return @ptrCast(*const IVisualInteractionSourceInterop.VTable, self.vtable).TryRedirectForManipulation(@ptrCast(*const IVisualInteractionSourceInterop, self), pointerInfo); } };} pub usingnamespace MethodMixin(@This()); }; const IID_ICompositionCapabilitiesInteropFactory_Value = @import("../zig.zig").Guid.initString("2c9db356-e70d-4642-8298-bc4aa5b4865c"); pub const IID_ICompositionCapabilitiesInteropFactory = &IID_ICompositionCapabilitiesInteropFactory_Value; pub const ICompositionCapabilitiesInteropFactory = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, GetForWindow: fn( self: *const ICompositionCapabilitiesInteropFactory, hwnd: ?HWND, result: ?**struct{comment: []const u8 = "MissingClrType CompositionCapabilities.Windows.UI.Composition"}, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICompositionCapabilitiesInteropFactory_GetForWindow(self: *const T, hwnd: ?HWND, result: ?**struct{comment: []const u8 = "MissingClrType CompositionCapabilities.Windows.UI.Composition"}) callconv(.Inline) HRESULT { return @ptrCast(*const ICompositionCapabilitiesInteropFactory.VTable, self.vtable).GetForWindow(@ptrCast(*const ICompositionCapabilitiesInteropFactory, self), hwnd, result); } };} pub usingnamespace MethodMixin(@This()); }; const IID_ICompositorDesktopInterop_Value = @import("../zig.zig").Guid.initString("29e691fa-4567-4dca-b319-d0f207eb6807"); pub const IID_ICompositorDesktopInterop = &IID_ICompositorDesktopInterop_Value; pub const ICompositorDesktopInterop = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, CreateDesktopWindowTarget: fn( self: *const ICompositorDesktopInterop, hwndTarget: ?HWND, isTopmost: BOOL, result: ?**struct{comment: []const u8 = "MissingClrType DesktopWindowTarget.Windows.UI.Composition.Desktop"}, ) callconv(@import("std").os.windows.WINAPI) HRESULT, EnsureOnThread: fn( self: *const ICompositorDesktopInterop, threadId: u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICompositorDesktopInterop_CreateDesktopWindowTarget(self: *const T, hwndTarget: ?HWND, isTopmost: BOOL, result: ?**struct{comment: []const u8 = "MissingClrType DesktopWindowTarget.Windows.UI.Composition.Desktop"}) callconv(.Inline) HRESULT { return @ptrCast(*const ICompositorDesktopInterop.VTable, self.vtable).CreateDesktopWindowTarget(@ptrCast(*const ICompositorDesktopInterop, self), hwndTarget, isTopmost, result); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ICompositorDesktopInterop_EnsureOnThread(self: *const T, threadId: u32) callconv(.Inline) HRESULT { return @ptrCast(*const ICompositorDesktopInterop.VTable, self.vtable).EnsureOnThread(@ptrCast(*const ICompositorDesktopInterop, self), threadId); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IDesktopWindowTargetInterop_Value = @import("../zig.zig").Guid.initString("35dbf59e-e3f9-45b0-81e7-fe75f4145dc9"); pub const IID_IDesktopWindowTargetInterop = &IID_IDesktopWindowTargetInterop_Value; pub const IDesktopWindowTargetInterop = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, // TODO: this function has a "SpecialName", should Zig do anything with this? get_Hwnd: fn( self: *const IDesktopWindowTargetInterop, value: ?*?HWND, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IDesktopWindowTargetInterop_get_Hwnd(self: *const T, value: ?*?HWND) callconv(.Inline) HRESULT { return @ptrCast(*const IDesktopWindowTargetInterop.VTable, self.vtable).get_Hwnd(@ptrCast(*const IDesktopWindowTargetInterop, self), value); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IDesktopWindowContentBridgeInterop_Value = @import("../zig.zig").Guid.initString("37642806-f421-4fd0-9f82-23ae7c776182"); pub const IID_IDesktopWindowContentBridgeInterop = &IID_IDesktopWindowContentBridgeInterop_Value; pub const IDesktopWindowContentBridgeInterop = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, Initialize: fn( self: *const IDesktopWindowContentBridgeInterop, compositor: *struct{comment: []const u8 = "MissingClrType Compositor.Windows.UI.Composition"}, parentHwnd: ?HWND, ) callconv(@import("std").os.windows.WINAPI) HRESULT, // TODO: this function has a "SpecialName", should Zig do anything with this? get_Hwnd: fn( self: *const IDesktopWindowContentBridgeInterop, value: ?*?HWND, ) callconv(@import("std").os.windows.WINAPI) HRESULT, // TODO: this function has a "SpecialName", should Zig do anything with this? get_AppliedScaleFactor: fn( self: *const IDesktopWindowContentBridgeInterop, value: ?*f32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IDesktopWindowContentBridgeInterop_Initialize(self: *const T, compositor: *struct{comment: []const u8 = "MissingClrType Compositor.Windows.UI.Composition"}, parentHwnd: ?HWND) callconv(.Inline) HRESULT { return @ptrCast(*const IDesktopWindowContentBridgeInterop.VTable, self.vtable).Initialize(@ptrCast(*const IDesktopWindowContentBridgeInterop, self), compositor, parentHwnd); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IDesktopWindowContentBridgeInterop_get_Hwnd(self: *const T, value: ?*?HWND) callconv(.Inline) HRESULT { return @ptrCast(*const IDesktopWindowContentBridgeInterop.VTable, self.vtable).get_Hwnd(@ptrCast(*const IDesktopWindowContentBridgeInterop, self), value); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IDesktopWindowContentBridgeInterop_get_AppliedScaleFactor(self: *const T, value: ?*f32) callconv(.Inline) HRESULT { return @ptrCast(*const IDesktopWindowContentBridgeInterop.VTable, self.vtable).get_AppliedScaleFactor(@ptrCast(*const IDesktopWindowContentBridgeInterop, self), value); } };} pub usingnamespace MethodMixin(@This()); }; // TODO: this type is limited to platform 'windows8.0' const IID_IRestrictedErrorInfo_Value = @import("../zig.zig").Guid.initString("82ba7092-4c88-427d-a7bc-16dd93feb67e"); pub const IID_IRestrictedErrorInfo = &IID_IRestrictedErrorInfo_Value; pub const IRestrictedErrorInfo = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, GetErrorDetails: fn( self: *const IRestrictedErrorInfo, description: ?*?BSTR, @"error": ?*HRESULT, restrictedDescription: ?*?BSTR, capabilitySid: ?*?BSTR, ) callconv(@import("std").os.windows.WINAPI) HRESULT, GetReference: fn( self: *const IRestrictedErrorInfo, reference: ?*?BSTR, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IRestrictedErrorInfo_GetErrorDetails(self: *const T, description: ?*?BSTR, @"error": ?*HRESULT, restrictedDescription: ?*?BSTR, capabilitySid: ?*?BSTR) callconv(.Inline) HRESULT { return @ptrCast(*const IRestrictedErrorInfo.VTable, self.vtable).GetErrorDetails(@ptrCast(*const IRestrictedErrorInfo, self), description, @"error", restrictedDescription, capabilitySid); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IRestrictedErrorInfo_GetReference(self: *const T, reference: ?*?BSTR) callconv(.Inline) HRESULT { return @ptrCast(*const IRestrictedErrorInfo.VTable, self.vtable).GetReference(@ptrCast(*const IRestrictedErrorInfo, self), reference); } };} pub usingnamespace MethodMixin(@This()); }; // TODO: this type is limited to platform 'windows8.1' const IID_ILanguageExceptionErrorInfo_Value = @import("../zig.zig").Guid.initString("04a2dbf3-df83-116c-0946-0812abf6e07d"); pub const IID_ILanguageExceptionErrorInfo = &IID_ILanguageExceptionErrorInfo_Value; pub const ILanguageExceptionErrorInfo = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, GetLanguageException: fn( self: *const ILanguageExceptionErrorInfo, languageException: ?*?*IUnknown, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ILanguageExceptionErrorInfo_GetLanguageException(self: *const T, languageException: ?*?*IUnknown) callconv(.Inline) HRESULT { return @ptrCast(*const ILanguageExceptionErrorInfo.VTable, self.vtable).GetLanguageException(@ptrCast(*const ILanguageExceptionErrorInfo, self), languageException); } };} pub usingnamespace MethodMixin(@This()); }; // TODO: this type is limited to platform 'windows10.0.15063' const IID_ILanguageExceptionTransform_Value = @import("../zig.zig").Guid.initString("feb5a271-a6cd-45ce-880a-696706badc65"); pub const IID_ILanguageExceptionTransform = &IID_ILanguageExceptionTransform_Value; pub const ILanguageExceptionTransform = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, GetTransformedRestrictedErrorInfo: fn( self: *const ILanguageExceptionTransform, restrictedErrorInfo: ?*?*IRestrictedErrorInfo, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ILanguageExceptionTransform_GetTransformedRestrictedErrorInfo(self: *const T, restrictedErrorInfo: ?*?*IRestrictedErrorInfo) callconv(.Inline) HRESULT { return @ptrCast(*const ILanguageExceptionTransform.VTable, self.vtable).GetTransformedRestrictedErrorInfo(@ptrCast(*const ILanguageExceptionTransform, self), restrictedErrorInfo); } };} pub usingnamespace MethodMixin(@This()); }; // TODO: this type is limited to platform 'windows10.0.15063' const IID_ILanguageExceptionStackBackTrace_Value = @import("../zig.zig").Guid.initString("cbe53fb5-f967-4258-8d34-42f5e25833de"); pub const IID_ILanguageExceptionStackBackTrace = &IID_ILanguageExceptionStackBackTrace_Value; pub const ILanguageExceptionStackBackTrace = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, GetStackBackTrace: fn( self: *const ILanguageExceptionStackBackTrace, maxFramesToCapture: u32, stackBackTrace: ?*usize, framesCaptured: ?*u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ILanguageExceptionStackBackTrace_GetStackBackTrace(self: *const T, maxFramesToCapture: u32, stackBackTrace: ?*usize, framesCaptured: ?*u32) callconv(.Inline) HRESULT { return @ptrCast(*const ILanguageExceptionStackBackTrace.VTable, self.vtable).GetStackBackTrace(@ptrCast(*const ILanguageExceptionStackBackTrace, self), maxFramesToCapture, stackBackTrace, framesCaptured); } };} pub usingnamespace MethodMixin(@This()); }; // TODO: this type is limited to platform 'windows10.0.15063' const IID_ILanguageExceptionErrorInfo2_Value = @import("../zig.zig").Guid.initString("5746e5c4-5b97-424c-b620-2822915734dd"); pub const IID_ILanguageExceptionErrorInfo2 = &IID_ILanguageExceptionErrorInfo2_Value; pub const ILanguageExceptionErrorInfo2 = extern struct { pub const VTable = extern struct { base: ILanguageExceptionErrorInfo.VTable, GetPreviousLanguageExceptionErrorInfo: fn( self: *const ILanguageExceptionErrorInfo2, previousLanguageExceptionErrorInfo: ?*?*ILanguageExceptionErrorInfo2, ) callconv(@import("std").os.windows.WINAPI) HRESULT, CapturePropagationContext: fn( self: *const ILanguageExceptionErrorInfo2, languageException: ?*IUnknown, ) callconv(@import("std").os.windows.WINAPI) HRESULT, GetPropagationContextHead: fn( self: *const ILanguageExceptionErrorInfo2, propagatedLanguageExceptionErrorInfoHead: ?*?*ILanguageExceptionErrorInfo2, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace ILanguageExceptionErrorInfo.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ILanguageExceptionErrorInfo2_GetPreviousLanguageExceptionErrorInfo(self: *const T, previousLanguageExceptionErrorInfo: ?*?*ILanguageExceptionErrorInfo2) callconv(.Inline) HRESULT { return @ptrCast(*const ILanguageExceptionErrorInfo2.VTable, self.vtable).GetPreviousLanguageExceptionErrorInfo(@ptrCast(*const ILanguageExceptionErrorInfo2, self), previousLanguageExceptionErrorInfo); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ILanguageExceptionErrorInfo2_CapturePropagationContext(self: *const T, languageException: ?*IUnknown) callconv(.Inline) HRESULT { return @ptrCast(*const ILanguageExceptionErrorInfo2.VTable, self.vtable).CapturePropagationContext(@ptrCast(*const ILanguageExceptionErrorInfo2, self), languageException); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ILanguageExceptionErrorInfo2_GetPropagationContextHead(self: *const T, propagatedLanguageExceptionErrorInfoHead: ?*?*ILanguageExceptionErrorInfo2) callconv(.Inline) HRESULT { return @ptrCast(*const ILanguageExceptionErrorInfo2.VTable, self.vtable).GetPropagationContextHead(@ptrCast(*const ILanguageExceptionErrorInfo2, self), propagatedLanguageExceptionErrorInfoHead); } };} pub usingnamespace MethodMixin(@This()); }; // TODO: this type is limited to platform 'windows8.0' const IID_IActivationFactory_Value = @import("../zig.zig").Guid.initString("00000035-0000-0000-c000-000000000046"); pub const IID_IActivationFactory = &IID_IActivationFactory_Value; pub const IActivationFactory = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, ActivateInstance: fn( self: *const IActivationFactory, instance: ?*?*IInspectable, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IActivationFactory_ActivateInstance(self: *const T, instance: ?*?*IInspectable) callconv(.Inline) HRESULT { return @ptrCast(*const IActivationFactory.VTable, self.vtable).ActivateInstance(@ptrCast(*const IActivationFactory, self), instance); } };} pub usingnamespace MethodMixin(@This()); }; pub const RO_INIT_TYPE = enum(i32) { SINGLETHREADED = 0, MULTITHREADED = 1, }; pub const RO_INIT_SINGLETHREADED = RO_INIT_TYPE.SINGLETHREADED; pub const RO_INIT_MULTITHREADED = RO_INIT_TYPE.MULTITHREADED; const IID_IBufferByteAccess_Value = @import("../zig.zig").Guid.initString("905a0fef-bc53-11df-8c49-001e4fc686da"); pub const IID_IBufferByteAccess = &IID_IBufferByteAccess_Value; pub const IBufferByteAccess = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, Buffer: fn( self: *const IBufferByteAccess, value: ?*?*u8, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IBufferByteAccess_Buffer(self: *const T, value: ?*?*u8) callconv(.Inline) HRESULT { return @ptrCast(*const IBufferByteAccess.VTable, self.vtable).Buffer(@ptrCast(*const IBufferByteAccess, self), value); } };} pub usingnamespace MethodMixin(@This()); }; pub const RO_ERROR_REPORTING_FLAGS = enum(u32) { NONE = 0, SUPPRESSEXCEPTIONS = 1, FORCEEXCEPTIONS = 2, USESETERRORINFO = 4, SUPPRESSSETERRORINFO = 8, _, pub fn initFlags(o: struct { NONE: u1 = 0, SUPPRESSEXCEPTIONS: u1 = 0, FORCEEXCEPTIONS: u1 = 0, USESETERRORINFO: u1 = 0, SUPPRESSSETERRORINFO: u1 = 0, }) RO_ERROR_REPORTING_FLAGS { return @intToEnum(RO_ERROR_REPORTING_FLAGS, (if (o.NONE == 1) @enumToInt(RO_ERROR_REPORTING_FLAGS.NONE) else 0) | (if (o.SUPPRESSEXCEPTIONS == 1) @enumToInt(RO_ERROR_REPORTING_FLAGS.SUPPRESSEXCEPTIONS) else 0) | (if (o.FORCEEXCEPTIONS == 1) @enumToInt(RO_ERROR_REPORTING_FLAGS.FORCEEXCEPTIONS) else 0) | (if (o.USESETERRORINFO == 1) @enumToInt(RO_ERROR_REPORTING_FLAGS.USESETERRORINFO) else 0) | (if (o.SUPPRESSSETERRORINFO == 1) @enumToInt(RO_ERROR_REPORTING_FLAGS.SUPPRESSSETERRORINFO) else 0) ); } }; pub const RO_ERROR_REPORTING_NONE = RO_ERROR_REPORTING_FLAGS.NONE; pub const RO_ERROR_REPORTING_SUPPRESSEXCEPTIONS = RO_ERROR_REPORTING_FLAGS.SUPPRESSEXCEPTIONS; pub const RO_ERROR_REPORTING_FORCEEXCEPTIONS = RO_ERROR_REPORTING_FLAGS.FORCEEXCEPTIONS; pub const RO_ERROR_REPORTING_USESETERRORINFO = RO_ERROR_REPORTING_FLAGS.USESETERRORINFO; pub const RO_ERROR_REPORTING_SUPPRESSSETERRORINFO = RO_ERROR_REPORTING_FLAGS.SUPPRESSSETERRORINFO; pub const PINSPECT_MEMORY_CALLBACK = fn( context: ?*c_void, readAddress: usize, length: u32, buffer: [*:0]u8, ) callconv(@import("std").os.windows.WINAPI) HRESULT; pub const IRoSimpleMetaDataBuilder = extern struct { pub const VTable = extern struct { SetWinRtInterface: fn( self: *const IRoSimpleMetaDataBuilder, iid: Guid, ) callconv(@import("std").os.windows.WINAPI) HRESULT, SetDelegate: fn( self: *const IRoSimpleMetaDataBuilder, iid: Guid, ) callconv(@import("std").os.windows.WINAPI) HRESULT, SetInterfaceGroupSimpleDefault: fn( self: *const IRoSimpleMetaDataBuilder, name: ?[*:0]const u16, defaultInterfaceName: ?[*:0]const u16, defaultInterfaceIID: ?*const Guid, ) callconv(@import("std").os.windows.WINAPI) HRESULT, SetInterfaceGroupParameterizedDefault: fn( self: *const IRoSimpleMetaDataBuilder, name: ?[*:0]const u16, elementCount: u32, defaultInterfaceNameElements: [*]?PWSTR, ) callconv(@import("std").os.windows.WINAPI) HRESULT, SetRuntimeClassSimpleDefault: fn( self: *const IRoSimpleMetaDataBuilder, name: ?[*:0]const u16, defaultInterfaceName: ?[*:0]const u16, defaultInterfaceIID: ?*const Guid, ) callconv(@import("std").os.windows.WINAPI) HRESULT, SetRuntimeClassParameterizedDefault: fn( self: *const IRoSimpleMetaDataBuilder, name: ?[*:0]const u16, elementCount: u32, defaultInterfaceNameElements: [*]const ?[*:0]const u16, ) callconv(@import("std").os.windows.WINAPI) HRESULT, SetStruct: fn( self: *const IRoSimpleMetaDataBuilder, name: ?[*:0]const u16, numFields: u32, fieldTypeNames: [*]const ?[*:0]const u16, ) callconv(@import("std").os.windows.WINAPI) HRESULT, SetEnum: fn( self: *const IRoSimpleMetaDataBuilder, name: ?[*:0]const u16, baseType: ?[*:0]const u16, ) callconv(@import("std").os.windows.WINAPI) HRESULT, SetParameterizedInterface: fn( self: *const IRoSimpleMetaDataBuilder, piid: Guid, numArgs: u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, SetParameterizedDelegate: fn( self: *const IRoSimpleMetaDataBuilder, piid: Guid, numArgs: u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IRoSimpleMetaDataBuilder_SetWinRtInterface(self: *const T, iid: Guid) callconv(.Inline) HRESULT { return @ptrCast(*const IRoSimpleMetaDataBuilder.VTable, self.vtable).SetWinRtInterface(@ptrCast(*const IRoSimpleMetaDataBuilder, self), iid); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IRoSimpleMetaDataBuilder_SetDelegate(self: *const T, iid: Guid) callconv(.Inline) HRESULT { return @ptrCast(*const IRoSimpleMetaDataBuilder.VTable, self.vtable).SetDelegate(@ptrCast(*const IRoSimpleMetaDataBuilder, self), iid); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IRoSimpleMetaDataBuilder_SetInterfaceGroupSimpleDefault(self: *const T, name: ?[*:0]const u16, defaultInterfaceName: ?[*:0]const u16, defaultInterfaceIID: ?*const Guid) callconv(.Inline) HRESULT { return @ptrCast(*const IRoSimpleMetaDataBuilder.VTable, self.vtable).SetInterfaceGroupSimpleDefault(@ptrCast(*const IRoSimpleMetaDataBuilder, self), name, defaultInterfaceName, defaultInterfaceIID); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IRoSimpleMetaDataBuilder_SetInterfaceGroupParameterizedDefault(self: *const T, name: ?[*:0]const u16, elementCount: u32, defaultInterfaceNameElements: [*]?PWSTR) callconv(.Inline) HRESULT { return @ptrCast(*const IRoSimpleMetaDataBuilder.VTable, self.vtable).SetInterfaceGroupParameterizedDefault(@ptrCast(*const IRoSimpleMetaDataBuilder, self), name, elementCount, defaultInterfaceNameElements); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IRoSimpleMetaDataBuilder_SetRuntimeClassSimpleDefault(self: *const T, name: ?[*:0]const u16, defaultInterfaceName: ?[*:0]const u16, defaultInterfaceIID: ?*const Guid) callconv(.Inline) HRESULT { return @ptrCast(*const IRoSimpleMetaDataBuilder.VTable, self.vtable).SetRuntimeClassSimpleDefault(@ptrCast(*const IRoSimpleMetaDataBuilder, self), name, defaultInterfaceName, defaultInterfaceIID); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IRoSimpleMetaDataBuilder_SetRuntimeClassParameterizedDefault(self: *const T, name: ?[*:0]const u16, elementCount: u32, defaultInterfaceNameElements: [*]const ?[*:0]const u16) callconv(.Inline) HRESULT { return @ptrCast(*const IRoSimpleMetaDataBuilder.VTable, self.vtable).SetRuntimeClassParameterizedDefault(@ptrCast(*const IRoSimpleMetaDataBuilder, self), name, elementCount, defaultInterfaceNameElements); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IRoSimpleMetaDataBuilder_SetStruct(self: *const T, name: ?[*:0]const u16, numFields: u32, fieldTypeNames: [*]const ?[*:0]const u16) callconv(.Inline) HRESULT { return @ptrCast(*const IRoSimpleMetaDataBuilder.VTable, self.vtable).SetStruct(@ptrCast(*const IRoSimpleMetaDataBuilder, self), name, numFields, fieldTypeNames); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IRoSimpleMetaDataBuilder_SetEnum(self: *const T, name: ?[*:0]const u16, baseType: ?[*:0]const u16) callconv(.Inline) HRESULT { return @ptrCast(*const IRoSimpleMetaDataBuilder.VTable, self.vtable).SetEnum(@ptrCast(*const IRoSimpleMetaDataBuilder, self), name, baseType); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IRoSimpleMetaDataBuilder_SetParameterizedInterface(self: *const T, piid: Guid, numArgs: u32) callconv(.Inline) HRESULT { return @ptrCast(*const IRoSimpleMetaDataBuilder.VTable, self.vtable).SetParameterizedInterface(@ptrCast(*const IRoSimpleMetaDataBuilder, self), piid, numArgs); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IRoSimpleMetaDataBuilder_SetParameterizedDelegate(self: *const T, piid: Guid, numArgs: u32) callconv(.Inline) HRESULT { return @ptrCast(*const IRoSimpleMetaDataBuilder.VTable, self.vtable).SetParameterizedDelegate(@ptrCast(*const IRoSimpleMetaDataBuilder, self), piid, numArgs); } };} pub usingnamespace MethodMixin(@This()); }; pub const IRoMetaDataLocator = extern struct { pub const VTable = extern struct { Locate: fn( self: *const IRoMetaDataLocator, nameElement: ?[*:0]const u16, metaDataDestination: ?*IRoSimpleMetaDataBuilder, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IRoMetaDataLocator_Locate(self: *const T, nameElement: ?[*:0]const u16, metaDataDestination: ?*IRoSimpleMetaDataBuilder) callconv(.Inline) HRESULT { return @ptrCast(*const IRoMetaDataLocator.VTable, self.vtable).Locate(@ptrCast(*const IRoMetaDataLocator, self), nameElement, metaDataDestination); } };} pub usingnamespace MethodMixin(@This()); }; pub const BSOS_OPTIONS = enum(i32) { DEFAULT = 0, PREFERDESTINATIONSTREAM = 1, }; pub const BSOS_DEFAULT = BSOS_OPTIONS.DEFAULT; pub const BSOS_PREFERDESTINATIONSTREAM = BSOS_OPTIONS.PREFERDESTINATIONSTREAM; const IID_IMemoryBufferByteAccess_Value = @import("../zig.zig").Guid.initString("5b0d3235-4dba-4d44-865e-8f1d0e4fd04d"); pub const IID_IMemoryBufferByteAccess = &IID_IMemoryBufferByteAccess_Value; pub const IMemoryBufferByteAccess = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, GetBuffer: fn( self: *const IMemoryBufferByteAccess, value: ?*?*u8, capacity: ?*u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IMemoryBufferByteAccess_GetBuffer(self: *const T, value: ?*?*u8, capacity: ?*u32) callconv(.Inline) HRESULT { return @ptrCast(*const IMemoryBufferByteAccess.VTable, self.vtable).GetBuffer(@ptrCast(*const IMemoryBufferByteAccess, self), value, capacity); } };} pub usingnamespace MethodMixin(@This()); }; // TODO: this type is limited to platform 'windows8.0' const IID_IWeakReference_Value = @import("../zig.zig").Guid.initString("00000037-0000-0000-c000-000000000046"); pub const IID_IWeakReference = &IID_IWeakReference_Value; pub const IWeakReference = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, Resolve: fn( self: *const IWeakReference, riid: ?*const Guid, objectReference: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IWeakReference_Resolve(self: *const T, riid: ?*const Guid, objectReference: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IWeakReference.VTable, self.vtable).Resolve(@ptrCast(*const IWeakReference, self), riid, objectReference); } };} pub usingnamespace MethodMixin(@This()); }; // TODO: this type is limited to platform 'windows8.0' const IID_IWeakReferenceSource_Value = @import("../zig.zig").Guid.initString("00000038-0000-0000-c000-000000000046"); pub const IID_IWeakReferenceSource = &IID_IWeakReferenceSource_Value; pub const IWeakReferenceSource = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, GetWeakReference: fn( self: *const IWeakReferenceSource, weakReference: ?*?*IWeakReference, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IWeakReferenceSource_GetWeakReference(self: *const T, weakReference: ?*?*IWeakReference) callconv(.Inline) HRESULT { return @ptrCast(*const IWeakReferenceSource.VTable, self.vtable).GetWeakReference(@ptrCast(*const IWeakReferenceSource, self), weakReference); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IWindowsDevicesAllJoynBusAttachmentInterop_Value = @import("../zig.zig").Guid.initString("fd89c65b-b50e-4a19-9d0c-b42b783281cd"); pub const IID_IWindowsDevicesAllJoynBusAttachmentInterop = &IID_IWindowsDevicesAllJoynBusAttachmentInterop_Value; pub const IWindowsDevicesAllJoynBusAttachmentInterop = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, // TODO: this function has a "SpecialName", should Zig do anything with this? get_Win32Handle: fn( self: *const IWindowsDevicesAllJoynBusAttachmentInterop, value: ?*u64, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IWindowsDevicesAllJoynBusAttachmentInterop_get_Win32Handle(self: *const T, value: ?*u64) callconv(.Inline) HRESULT { return @ptrCast(*const IWindowsDevicesAllJoynBusAttachmentInterop.VTable, self.vtable).get_Win32Handle(@ptrCast(*const IWindowsDevicesAllJoynBusAttachmentInterop, self), value); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IWindowsDevicesAllJoynBusAttachmentFactoryInterop_Value = @import("../zig.zig").Guid.initString("4b8f7505-b239-4e7b-88af-f6682575d861"); pub const IID_IWindowsDevicesAllJoynBusAttachmentFactoryInterop = &IID_IWindowsDevicesAllJoynBusAttachmentFactoryInterop_Value; pub const IWindowsDevicesAllJoynBusAttachmentFactoryInterop = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, CreateFromWin32Handle: fn( self: *const IWindowsDevicesAllJoynBusAttachmentFactoryInterop, win32handle: u64, enableAboutData: u8, riid: ?*const Guid, ppv: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IWindowsDevicesAllJoynBusAttachmentFactoryInterop_CreateFromWin32Handle(self: *const T, win32handle: u64, enableAboutData: u8, riid: ?*const Guid, ppv: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IWindowsDevicesAllJoynBusAttachmentFactoryInterop.VTable, self.vtable).CreateFromWin32Handle(@ptrCast(*const IWindowsDevicesAllJoynBusAttachmentFactoryInterop, self), win32handle, enableAboutData, riid, ppv); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IWindowsDevicesAllJoynBusObjectInterop_Value = @import("../zig.zig").Guid.initString("d78aa3d5-5054-428f-99f2-ec3a5de3c3bc"); pub const IID_IWindowsDevicesAllJoynBusObjectInterop = &IID_IWindowsDevicesAllJoynBusObjectInterop_Value; pub const IWindowsDevicesAllJoynBusObjectInterop = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, AddPropertyGetHandler: fn( self: *const IWindowsDevicesAllJoynBusObjectInterop, context: ?*c_void, interfaceName: ?HSTRING, callback: isize, ) callconv(@import("std").os.windows.WINAPI) HRESULT, AddPropertySetHandler: fn( self: *const IWindowsDevicesAllJoynBusObjectInterop, context: ?*c_void, interfaceName: ?HSTRING, callback: isize, ) callconv(@import("std").os.windows.WINAPI) HRESULT, // TODO: this function has a "SpecialName", should Zig do anything with this? get_Win32Handle: fn( self: *const IWindowsDevicesAllJoynBusObjectInterop, value: ?*u64, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IWindowsDevicesAllJoynBusObjectInterop_AddPropertyGetHandler(self: *const T, context: ?*c_void, interfaceName: ?HSTRING, callback: isize) callconv(.Inline) HRESULT { return @ptrCast(*const IWindowsDevicesAllJoynBusObjectInterop.VTable, self.vtable).AddPropertyGetHandler(@ptrCast(*const IWindowsDevicesAllJoynBusObjectInterop, self), context, interfaceName, callback); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IWindowsDevicesAllJoynBusObjectInterop_AddPropertySetHandler(self: *const T, context: ?*c_void, interfaceName: ?HSTRING, callback: isize) callconv(.Inline) HRESULT { return @ptrCast(*const IWindowsDevicesAllJoynBusObjectInterop.VTable, self.vtable).AddPropertySetHandler(@ptrCast(*const IWindowsDevicesAllJoynBusObjectInterop, self), context, interfaceName, callback); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IWindowsDevicesAllJoynBusObjectInterop_get_Win32Handle(self: *const T, value: ?*u64) callconv(.Inline) HRESULT { return @ptrCast(*const IWindowsDevicesAllJoynBusObjectInterop.VTable, self.vtable).get_Win32Handle(@ptrCast(*const IWindowsDevicesAllJoynBusObjectInterop, self), value); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IWindowsDevicesAllJoynBusObjectFactoryInterop_Value = @import("../zig.zig").Guid.initString("6174e506-8b95-4e36-95c0-b88fed34938c"); pub const IID_IWindowsDevicesAllJoynBusObjectFactoryInterop = &IID_IWindowsDevicesAllJoynBusObjectFactoryInterop_Value; pub const IWindowsDevicesAllJoynBusObjectFactoryInterop = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, CreateFromWin32Handle: fn( self: *const IWindowsDevicesAllJoynBusObjectFactoryInterop, win32handle: u64, riid: ?*const Guid, ppv: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IWindowsDevicesAllJoynBusObjectFactoryInterop_CreateFromWin32Handle(self: *const T, win32handle: u64, riid: ?*const Guid, ppv: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const IWindowsDevicesAllJoynBusObjectFactoryInterop.VTable, self.vtable).CreateFromWin32Handle(@ptrCast(*const IWindowsDevicesAllJoynBusObjectFactoryInterop, self), win32handle, riid, ppv); } };} pub usingnamespace MethodMixin(@This()); }; const IID_ILearningModelOperatorProviderNative_Value = @import("../zig.zig").Guid.initString("1adaa23a-eb67-41f3-aad8-5d984e9bacd4"); pub const IID_ILearningModelOperatorProviderNative = &IID_ILearningModelOperatorProviderNative_Value; pub const ILearningModelOperatorProviderNative = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, GetRegistry: fn( self: *const ILearningModelOperatorProviderNative, ppOperatorRegistry: ?*?*IMLOperatorRegistry, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ILearningModelOperatorProviderNative_GetRegistry(self: *const T, ppOperatorRegistry: ?*?*IMLOperatorRegistry) callconv(.Inline) HRESULT { return @ptrCast(*const ILearningModelOperatorProviderNative.VTable, self.vtable).GetRegistry(@ptrCast(*const ILearningModelOperatorProviderNative, self), ppOperatorRegistry); } };} pub usingnamespace MethodMixin(@This()); }; const IID_ITensorNative_Value = @import("../zig.zig").Guid.initString("52f547ef-5b03-49b5-82d6-565f1ee0dd49"); pub const IID_ITensorNative = &IID_ITensorNative_Value; pub const ITensorNative = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, GetBuffer: fn( self: *const ITensorNative, value: [*]?*u8, capacity: ?*u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT, GetD3D12Resource: fn( self: *const ITensorNative, result: ?*?*ID3D12Resource, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ITensorNative_GetBuffer(self: *const T, value: [*]?*u8, capacity: ?*u32) callconv(.Inline) HRESULT { return @ptrCast(*const ITensorNative.VTable, self.vtable).GetBuffer(@ptrCast(*const ITensorNative, self), value, capacity); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ITensorNative_GetD3D12Resource(self: *const T, result: ?*?*ID3D12Resource) callconv(.Inline) HRESULT { return @ptrCast(*const ITensorNative.VTable, self.vtable).GetD3D12Resource(@ptrCast(*const ITensorNative, self), result); } };} pub usingnamespace MethodMixin(@This()); }; const IID_ITensorStaticsNative_Value = @import("../zig.zig").Guid.initString("39d055a4-66f6-4ebc-95d9-7a29ebe7690a"); pub const IID_ITensorStaticsNative = &IID_ITensorStaticsNative_Value; pub const ITensorStaticsNative = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, CreateFromD3D12Resource: fn( self: *const ITensorStaticsNative, value: ?*ID3D12Resource, shape: ?*i64, shapeCount: i32, result: ?*?*IUnknown, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ITensorStaticsNative_CreateFromD3D12Resource(self: *const T, value: ?*ID3D12Resource, shape: ?*i64, shapeCount: i32, result: ?*?*IUnknown) callconv(.Inline) HRESULT { return @ptrCast(*const ITensorStaticsNative.VTable, self.vtable).CreateFromD3D12Resource(@ptrCast(*const ITensorStaticsNative, self), value, shape, shapeCount, result); } };} pub usingnamespace MethodMixin(@This()); }; const IID_ILearningModelDeviceFactoryNative_Value = @import("../zig.zig").Guid.initString("1e9b31a1-662e-4ae0-af67-f63bb337e634"); pub const IID_ILearningModelDeviceFactoryNative = &IID_ILearningModelDeviceFactoryNative_Value; pub const ILearningModelDeviceFactoryNative = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, CreateFromD3D12CommandQueue: fn( self: *const ILearningModelDeviceFactoryNative, value: ?*ID3D12CommandQueue, result: ?*?*IUnknown, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ILearningModelDeviceFactoryNative_CreateFromD3D12CommandQueue(self: *const T, value: ?*ID3D12CommandQueue, result: ?*?*IUnknown) callconv(.Inline) HRESULT { return @ptrCast(*const ILearningModelDeviceFactoryNative.VTable, self.vtable).CreateFromD3D12CommandQueue(@ptrCast(*const ILearningModelDeviceFactoryNative, self), value, result); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IHolographicCameraInterop_Value = @import("../zig.zig").Guid.initString("7cc1f9c5-6d02-41fa-9500-e1809eb48eec"); pub const IID_IHolographicCameraInterop = &IID_IHolographicCameraInterop_Value; pub const IHolographicCameraInterop = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, CreateDirect3D12BackBufferResource: fn( self: *const IHolographicCameraInterop, pDevice: ?*ID3D12Device, pTexture2DDesc: ?*D3D12_RESOURCE_DESC, ppCreatedTexture2DResource: ?*?*ID3D12Resource, ) callconv(@import("std").os.windows.WINAPI) HRESULT, CreateDirect3D12HardwareProtectedBackBufferResource: fn( self: *const IHolographicCameraInterop, pDevice: ?*ID3D12Device, pTexture2DDesc: ?*D3D12_RESOURCE_DESC, pProtectedResourceSession: ?*ID3D12ProtectedResourceSession, ppCreatedTexture2DResource: ?*?*ID3D12Resource, ) callconv(@import("std").os.windows.WINAPI) HRESULT, AcquireDirect3D12BufferResource: fn( self: *const IHolographicCameraInterop, pResourceToAcquire: ?*ID3D12Resource, pCommandQueue: ?*ID3D12CommandQueue, ) callconv(@import("std").os.windows.WINAPI) HRESULT, AcquireDirect3D12BufferResourceWithTimeout: fn( self: *const IHolographicCameraInterop, pResourceToAcquire: ?*ID3D12Resource, pCommandQueue: ?*ID3D12CommandQueue, duration: u64, ) callconv(@import("std").os.windows.WINAPI) HRESULT, UnacquireDirect3D12BufferResource: fn( self: *const IHolographicCameraInterop, pResourceToUnacquire: ?*ID3D12Resource, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IHolographicCameraInterop_CreateDirect3D12BackBufferResource(self: *const T, pDevice: ?*ID3D12Device, pTexture2DDesc: ?*D3D12_RESOURCE_DESC, ppCreatedTexture2DResource: ?*?*ID3D12Resource) callconv(.Inline) HRESULT { return @ptrCast(*const IHolographicCameraInterop.VTable, self.vtable).CreateDirect3D12BackBufferResource(@ptrCast(*const IHolographicCameraInterop, self), pDevice, pTexture2DDesc, ppCreatedTexture2DResource); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IHolographicCameraInterop_CreateDirect3D12HardwareProtectedBackBufferResource(self: *const T, pDevice: ?*ID3D12Device, pTexture2DDesc: ?*D3D12_RESOURCE_DESC, pProtectedResourceSession: ?*ID3D12ProtectedResourceSession, ppCreatedTexture2DResource: ?*?*ID3D12Resource) callconv(.Inline) HRESULT { return @ptrCast(*const IHolographicCameraInterop.VTable, self.vtable).CreateDirect3D12HardwareProtectedBackBufferResource(@ptrCast(*const IHolographicCameraInterop, self), pDevice, pTexture2DDesc, pProtectedResourceSession, ppCreatedTexture2DResource); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IHolographicCameraInterop_AcquireDirect3D12BufferResource(self: *const T, pResourceToAcquire: ?*ID3D12Resource, pCommandQueue: ?*ID3D12CommandQueue) callconv(.Inline) HRESULT { return @ptrCast(*const IHolographicCameraInterop.VTable, self.vtable).AcquireDirect3D12BufferResource(@ptrCast(*const IHolographicCameraInterop, self), pResourceToAcquire, pCommandQueue); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IHolographicCameraInterop_AcquireDirect3D12BufferResourceWithTimeout(self: *const T, pResourceToAcquire: ?*ID3D12Resource, pCommandQueue: ?*ID3D12CommandQueue, duration: u64) callconv(.Inline) HRESULT { return @ptrCast(*const IHolographicCameraInterop.VTable, self.vtable).AcquireDirect3D12BufferResourceWithTimeout(@ptrCast(*const IHolographicCameraInterop, self), pResourceToAcquire, pCommandQueue, duration); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IHolographicCameraInterop_UnacquireDirect3D12BufferResource(self: *const T, pResourceToUnacquire: ?*ID3D12Resource) callconv(.Inline) HRESULT { return @ptrCast(*const IHolographicCameraInterop.VTable, self.vtable).UnacquireDirect3D12BufferResource(@ptrCast(*const IHolographicCameraInterop, self), pResourceToUnacquire); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IHolographicCameraRenderingParametersInterop_Value = @import("../zig.zig").Guid.initString("f75b68d6-d1fd-4707-aafd-fa6f4c0e3bf4"); pub const IID_IHolographicCameraRenderingParametersInterop = &IID_IHolographicCameraRenderingParametersInterop_Value; pub const IHolographicCameraRenderingParametersInterop = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, CommitDirect3D12Resource: fn( self: *const IHolographicCameraRenderingParametersInterop, pColorResourceToCommit: ?*ID3D12Resource, pColorResourceFence: ?*ID3D12Fence, colorResourceFenceSignalValue: u64, ) callconv(@import("std").os.windows.WINAPI) HRESULT, CommitDirect3D12ResourceWithDepthData: fn( self: *const IHolographicCameraRenderingParametersInterop, pColorResourceToCommit: ?*ID3D12Resource, pColorResourceFence: ?*ID3D12Fence, colorResourceFenceSignalValue: u64, pDepthResourceToCommit: ?*ID3D12Resource, pDepthResourceFence: ?*ID3D12Fence, depthResourceFenceSignalValue: u64, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IHolographicCameraRenderingParametersInterop_CommitDirect3D12Resource(self: *const T, pColorResourceToCommit: ?*ID3D12Resource, pColorResourceFence: ?*ID3D12Fence, colorResourceFenceSignalValue: u64) callconv(.Inline) HRESULT { return @ptrCast(*const IHolographicCameraRenderingParametersInterop.VTable, self.vtable).CommitDirect3D12Resource(@ptrCast(*const IHolographicCameraRenderingParametersInterop, self), pColorResourceToCommit, pColorResourceFence, colorResourceFenceSignalValue); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IHolographicCameraRenderingParametersInterop_CommitDirect3D12ResourceWithDepthData(self: *const T, pColorResourceToCommit: ?*ID3D12Resource, pColorResourceFence: ?*ID3D12Fence, colorResourceFenceSignalValue: u64, pDepthResourceToCommit: ?*ID3D12Resource, pDepthResourceFence: ?*ID3D12Fence, depthResourceFenceSignalValue: u64) callconv(.Inline) HRESULT { return @ptrCast(*const IHolographicCameraRenderingParametersInterop.VTable, self.vtable).CommitDirect3D12ResourceWithDepthData(@ptrCast(*const IHolographicCameraRenderingParametersInterop, self), pColorResourceToCommit, pColorResourceFence, colorResourceFenceSignalValue, pDepthResourceToCommit, pDepthResourceFence, depthResourceFenceSignalValue); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IHolographicQuadLayerInterop_Value = @import("../zig.zig").Guid.initString("cfa688f0-639e-4a47-83d7-6b7f5ebf7fed"); pub const IID_IHolographicQuadLayerInterop = &IID_IHolographicQuadLayerInterop_Value; pub const IHolographicQuadLayerInterop = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, CreateDirect3D12ContentBufferResource: fn( self: *const IHolographicQuadLayerInterop, pDevice: ?*ID3D12Device, pTexture2DDesc: ?*D3D12_RESOURCE_DESC, ppTexture2DResource: ?*?*ID3D12Resource, ) callconv(@import("std").os.windows.WINAPI) HRESULT, CreateDirect3D12HardwareProtectedContentBufferResource: fn( self: *const IHolographicQuadLayerInterop, pDevice: ?*ID3D12Device, pTexture2DDesc: ?*D3D12_RESOURCE_DESC, pProtectedResourceSession: ?*ID3D12ProtectedResourceSession, ppCreatedTexture2DResource: ?*?*ID3D12Resource, ) callconv(@import("std").os.windows.WINAPI) HRESULT, AcquireDirect3D12BufferResource: fn( self: *const IHolographicQuadLayerInterop, pResourceToAcquire: ?*ID3D12Resource, pCommandQueue: ?*ID3D12CommandQueue, ) callconv(@import("std").os.windows.WINAPI) HRESULT, AcquireDirect3D12BufferResourceWithTimeout: fn( self: *const IHolographicQuadLayerInterop, pResourceToAcquire: ?*ID3D12Resource, pCommandQueue: ?*ID3D12CommandQueue, duration: u64, ) callconv(@import("std").os.windows.WINAPI) HRESULT, UnacquireDirect3D12BufferResource: fn( self: *const IHolographicQuadLayerInterop, pResourceToUnacquire: ?*ID3D12Resource, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IHolographicQuadLayerInterop_CreateDirect3D12ContentBufferResource(self: *const T, pDevice: ?*ID3D12Device, pTexture2DDesc: ?*D3D12_RESOURCE_DESC, ppTexture2DResource: ?*?*ID3D12Resource) callconv(.Inline) HRESULT { return @ptrCast(*const IHolographicQuadLayerInterop.VTable, self.vtable).CreateDirect3D12ContentBufferResource(@ptrCast(*const IHolographicQuadLayerInterop, self), pDevice, pTexture2DDesc, ppTexture2DResource); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IHolographicQuadLayerInterop_CreateDirect3D12HardwareProtectedContentBufferResource(self: *const T, pDevice: ?*ID3D12Device, pTexture2DDesc: ?*D3D12_RESOURCE_DESC, pProtectedResourceSession: ?*ID3D12ProtectedResourceSession, ppCreatedTexture2DResource: ?*?*ID3D12Resource) callconv(.Inline) HRESULT { return @ptrCast(*const IHolographicQuadLayerInterop.VTable, self.vtable).CreateDirect3D12HardwareProtectedContentBufferResource(@ptrCast(*const IHolographicQuadLayerInterop, self), pDevice, pTexture2DDesc, pProtectedResourceSession, ppCreatedTexture2DResource); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IHolographicQuadLayerInterop_AcquireDirect3D12BufferResource(self: *const T, pResourceToAcquire: ?*ID3D12Resource, pCommandQueue: ?*ID3D12CommandQueue) callconv(.Inline) HRESULT { return @ptrCast(*const IHolographicQuadLayerInterop.VTable, self.vtable).AcquireDirect3D12BufferResource(@ptrCast(*const IHolographicQuadLayerInterop, self), pResourceToAcquire, pCommandQueue); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IHolographicQuadLayerInterop_AcquireDirect3D12BufferResourceWithTimeout(self: *const T, pResourceToAcquire: ?*ID3D12Resource, pCommandQueue: ?*ID3D12CommandQueue, duration: u64) callconv(.Inline) HRESULT { return @ptrCast(*const IHolographicQuadLayerInterop.VTable, self.vtable).AcquireDirect3D12BufferResourceWithTimeout(@ptrCast(*const IHolographicQuadLayerInterop, self), pResourceToAcquire, pCommandQueue, duration); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IHolographicQuadLayerInterop_UnacquireDirect3D12BufferResource(self: *const T, pResourceToUnacquire: ?*ID3D12Resource) callconv(.Inline) HRESULT { return @ptrCast(*const IHolographicQuadLayerInterop.VTable, self.vtable).UnacquireDirect3D12BufferResource(@ptrCast(*const IHolographicQuadLayerInterop, self), pResourceToUnacquire); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IHolographicQuadLayerUpdateParametersInterop_Value = @import("../zig.zig").Guid.initString("e5f549cd-c909-444f-8809-7cc18a9c8920"); pub const IID_IHolographicQuadLayerUpdateParametersInterop = &IID_IHolographicQuadLayerUpdateParametersInterop_Value; pub const IHolographicQuadLayerUpdateParametersInterop = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, CommitDirect3D12Resource: fn( self: *const IHolographicQuadLayerUpdateParametersInterop, pColorResourceToCommit: ?*ID3D12Resource, pColorResourceFence: ?*ID3D12Fence, colorResourceFenceSignalValue: u64, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IHolographicQuadLayerUpdateParametersInterop_CommitDirect3D12Resource(self: *const T, pColorResourceToCommit: ?*ID3D12Resource, pColorResourceFence: ?*ID3D12Fence, colorResourceFenceSignalValue: u64) callconv(.Inline) HRESULT { return @ptrCast(*const IHolographicQuadLayerUpdateParametersInterop.VTable, self.vtable).CommitDirect3D12Resource(@ptrCast(*const IHolographicQuadLayerUpdateParametersInterop, self), pColorResourceToCommit, pColorResourceFence, colorResourceFenceSignalValue); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IPrintWorkflowXpsReceiver_Value = @import("../zig.zig").Guid.initString("04097374-77b8-47f6-8167-aae29d4cf84b"); pub const IID_IPrintWorkflowXpsReceiver = &IID_IPrintWorkflowXpsReceiver_Value; pub const IPrintWorkflowXpsReceiver = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, SetDocumentSequencePrintTicket: fn( self: *const IPrintWorkflowXpsReceiver, documentSequencePrintTicket: ?*IStream, ) callconv(@import("std").os.windows.WINAPI) HRESULT, SetDocumentSequenceUri: fn( self: *const IPrintWorkflowXpsReceiver, documentSequenceUri: ?[*:0]const u16, ) callconv(@import("std").os.windows.WINAPI) HRESULT, AddDocumentData: fn( self: *const IPrintWorkflowXpsReceiver, documentId: u32, documentPrintTicket: ?*IStream, documentUri: ?[*:0]const u16, ) callconv(@import("std").os.windows.WINAPI) HRESULT, AddPage: fn( self: *const IPrintWorkflowXpsReceiver, documentId: u32, pageId: u32, pageReference: ?*IXpsOMPageReference, pageUri: ?[*:0]const u16, ) callconv(@import("std").os.windows.WINAPI) HRESULT, Close: fn( self: *const IPrintWorkflowXpsReceiver, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IPrintWorkflowXpsReceiver_SetDocumentSequencePrintTicket(self: *const T, documentSequencePrintTicket: ?*IStream) callconv(.Inline) HRESULT { return @ptrCast(*const IPrintWorkflowXpsReceiver.VTable, self.vtable).SetDocumentSequencePrintTicket(@ptrCast(*const IPrintWorkflowXpsReceiver, self), documentSequencePrintTicket); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IPrintWorkflowXpsReceiver_SetDocumentSequenceUri(self: *const T, documentSequenceUri: ?[*:0]const u16) callconv(.Inline) HRESULT { return @ptrCast(*const IPrintWorkflowXpsReceiver.VTable, self.vtable).SetDocumentSequenceUri(@ptrCast(*const IPrintWorkflowXpsReceiver, self), documentSequenceUri); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IPrintWorkflowXpsReceiver_AddDocumentData(self: *const T, documentId: u32, documentPrintTicket: ?*IStream, documentUri: ?[*:0]const u16) callconv(.Inline) HRESULT { return @ptrCast(*const IPrintWorkflowXpsReceiver.VTable, self.vtable).AddDocumentData(@ptrCast(*const IPrintWorkflowXpsReceiver, self), documentId, documentPrintTicket, documentUri); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IPrintWorkflowXpsReceiver_AddPage(self: *const T, documentId: u32, pageId: u32, pageReference: ?*IXpsOMPageReference, pageUri: ?[*:0]const u16) callconv(.Inline) HRESULT { return @ptrCast(*const IPrintWorkflowXpsReceiver.VTable, self.vtable).AddPage(@ptrCast(*const IPrintWorkflowXpsReceiver, self), documentId, pageId, pageReference, pageUri); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IPrintWorkflowXpsReceiver_Close(self: *const T) callconv(.Inline) HRESULT { return @ptrCast(*const IPrintWorkflowXpsReceiver.VTable, self.vtable).Close(@ptrCast(*const IPrintWorkflowXpsReceiver, self)); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IPrintWorkflowObjectModelSourceFileContentNative_Value = @import("../zig.zig").Guid.initString("68c9e477-993e-4052-8ac6-454eff58db9d"); pub const IID_IPrintWorkflowObjectModelSourceFileContentNative = &IID_IPrintWorkflowObjectModelSourceFileContentNative_Value; pub const IPrintWorkflowObjectModelSourceFileContentNative = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, StartXpsOMGeneration: fn( self: *const IPrintWorkflowObjectModelSourceFileContentNative, receiver: ?*IPrintWorkflowXpsReceiver, ) callconv(@import("std").os.windows.WINAPI) HRESULT, // TODO: this function has a "SpecialName", should Zig do anything with this? get_ObjectFactory: fn( self: *const IPrintWorkflowObjectModelSourceFileContentNative, value: ?*?*IXpsOMObjectFactory1, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IPrintWorkflowObjectModelSourceFileContentNative_StartXpsOMGeneration(self: *const T, receiver: ?*IPrintWorkflowXpsReceiver) callconv(.Inline) HRESULT { return @ptrCast(*const IPrintWorkflowObjectModelSourceFileContentNative.VTable, self.vtable).StartXpsOMGeneration(@ptrCast(*const IPrintWorkflowObjectModelSourceFileContentNative, self), receiver); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IPrintWorkflowObjectModelSourceFileContentNative_get_ObjectFactory(self: *const T, value: ?*?*IXpsOMObjectFactory1) callconv(.Inline) HRESULT { return @ptrCast(*const IPrintWorkflowObjectModelSourceFileContentNative.VTable, self.vtable).get_ObjectFactory(@ptrCast(*const IPrintWorkflowObjectModelSourceFileContentNative, self), value); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IPrintWorkflowXpsObjectModelTargetPackageNative_Value = @import("../zig.zig").Guid.initString("7d96bc74-9b54-4ca1-ad3a-979c3d44ddac"); pub const IID_IPrintWorkflowXpsObjectModelTargetPackageNative = &IID_IPrintWorkflowXpsObjectModelTargetPackageNative_Value; pub const IPrintWorkflowXpsObjectModelTargetPackageNative = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, // TODO: this function has a "SpecialName", should Zig do anything with this? get_DocumentPackageTarget: fn( self: *const IPrintWorkflowXpsObjectModelTargetPackageNative, value: ?*?*IXpsDocumentPackageTarget, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IPrintWorkflowXpsObjectModelTargetPackageNative_get_DocumentPackageTarget(self: *const T, value: ?*?*IXpsDocumentPackageTarget) callconv(.Inline) HRESULT { return @ptrCast(*const IPrintWorkflowXpsObjectModelTargetPackageNative.VTable, self.vtable).get_DocumentPackageTarget(@ptrCast(*const IPrintWorkflowXpsObjectModelTargetPackageNative, self), value); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IPrintWorkflowConfigurationNative_Value = @import("../zig.zig").Guid.initString("c056be0a-9ee2-450a-9823-964f0006f2bb"); pub const IID_IPrintWorkflowConfigurationNative = &IID_IPrintWorkflowConfigurationNative_Value; pub const IPrintWorkflowConfigurationNative = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, // TODO: this function has a "SpecialName", should Zig do anything with this? get_PrinterQueue: fn( self: *const IPrintWorkflowConfigurationNative, value: ?*?*IPrinterQueue, ) callconv(@import("std").os.windows.WINAPI) HRESULT, // TODO: this function has a "SpecialName", should Zig do anything with this? get_DriverProperties: fn( self: *const IPrintWorkflowConfigurationNative, value: ?*?*IPrinterPropertyBag, ) callconv(@import("std").os.windows.WINAPI) HRESULT, // TODO: this function has a "SpecialName", should Zig do anything with this? get_UserProperties: fn( self: *const IPrintWorkflowConfigurationNative, value: ?*?*IPrinterPropertyBag, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IPrintWorkflowConfigurationNative_get_PrinterQueue(self: *const T, value: ?*?*IPrinterQueue) callconv(.Inline) HRESULT { return @ptrCast(*const IPrintWorkflowConfigurationNative.VTable, self.vtable).get_PrinterQueue(@ptrCast(*const IPrintWorkflowConfigurationNative, self), value); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IPrintWorkflowConfigurationNative_get_DriverProperties(self: *const T, value: ?*?*IPrinterPropertyBag) callconv(.Inline) HRESULT { return @ptrCast(*const IPrintWorkflowConfigurationNative.VTable, self.vtable).get_DriverProperties(@ptrCast(*const IPrintWorkflowConfigurationNative, self), value); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IPrintWorkflowConfigurationNative_get_UserProperties(self: *const T, value: ?*?*IPrinterPropertyBag) callconv(.Inline) HRESULT { return @ptrCast(*const IPrintWorkflowConfigurationNative.VTable, self.vtable).get_UserProperties(@ptrCast(*const IPrintWorkflowConfigurationNative, self), value); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IDesktopWindowXamlSourceNative_Value = @import("../zig.zig").Guid.initString("3cbcf1bf-2f76-4e9c-96ab-e84b37972554"); pub const IID_IDesktopWindowXamlSourceNative = &IID_IDesktopWindowXamlSourceNative_Value; pub const IDesktopWindowXamlSourceNative = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, AttachToWindow: fn( self: *const IDesktopWindowXamlSourceNative, parentWnd: ?HWND, ) callconv(@import("std").os.windows.WINAPI) HRESULT, // TODO: this function has a "SpecialName", should Zig do anything with this? get_WindowHandle: fn( self: *const IDesktopWindowXamlSourceNative, hWnd: ?*?HWND, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IDesktopWindowXamlSourceNative_AttachToWindow(self: *const T, parentWnd: ?HWND) callconv(.Inline) HRESULT { return @ptrCast(*const IDesktopWindowXamlSourceNative.VTable, self.vtable).AttachToWindow(@ptrCast(*const IDesktopWindowXamlSourceNative, self), parentWnd); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IDesktopWindowXamlSourceNative_get_WindowHandle(self: *const T, hWnd: ?*?HWND) callconv(.Inline) HRESULT { return @ptrCast(*const IDesktopWindowXamlSourceNative.VTable, self.vtable).get_WindowHandle(@ptrCast(*const IDesktopWindowXamlSourceNative, self), hWnd); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IDesktopWindowXamlSourceNative2_Value = @import("../zig.zig").Guid.initString("e3dcd8c7-3057-4692-99c3-7b7720afda31"); pub const IID_IDesktopWindowXamlSourceNative2 = &IID_IDesktopWindowXamlSourceNative2_Value; pub const IDesktopWindowXamlSourceNative2 = extern struct { pub const VTable = extern struct { base: IDesktopWindowXamlSourceNative.VTable, PreTranslateMessage: fn( self: *const IDesktopWindowXamlSourceNative2, message: ?*const MSG, result: ?*BOOL, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IDesktopWindowXamlSourceNative.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IDesktopWindowXamlSourceNative2_PreTranslateMessage(self: *const T, message: ?*const MSG, result: ?*BOOL) callconv(.Inline) HRESULT { return @ptrCast(*const IDesktopWindowXamlSourceNative2.VTable, self.vtable).PreTranslateMessage(@ptrCast(*const IDesktopWindowXamlSourceNative2, self), message, result); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IReferenceTrackerTarget_Value = @import("../zig.zig").Guid.initString("64bd43f8-bfee-4ec4-b7eb-2935158dae21"); pub const IID_IReferenceTrackerTarget = &IID_IReferenceTrackerTarget_Value; pub const IReferenceTrackerTarget = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, AddRefFromReferenceTracker: fn( self: *const IReferenceTrackerTarget, ) callconv(@import("std").os.windows.WINAPI) u32, ReleaseFromReferenceTracker: fn( self: *const IReferenceTrackerTarget, ) callconv(@import("std").os.windows.WINAPI) u32, Peg: fn( self: *const IReferenceTrackerTarget, ) callconv(@import("std").os.windows.WINAPI) HRESULT, Unpeg: fn( self: *const IReferenceTrackerTarget, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IReferenceTrackerTarget_AddRefFromReferenceTracker(self: *const T) callconv(.Inline) u32 { return @ptrCast(*const IReferenceTrackerTarget.VTable, self.vtable).AddRefFromReferenceTracker(@ptrCast(*const IReferenceTrackerTarget, self)); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IReferenceTrackerTarget_ReleaseFromReferenceTracker(self: *const T) callconv(.Inline) u32 { return @ptrCast(*const IReferenceTrackerTarget.VTable, self.vtable).ReleaseFromReferenceTracker(@ptrCast(*const IReferenceTrackerTarget, self)); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IReferenceTrackerTarget_Peg(self: *const T) callconv(.Inline) HRESULT { return @ptrCast(*const IReferenceTrackerTarget.VTable, self.vtable).Peg(@ptrCast(*const IReferenceTrackerTarget, self)); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IReferenceTrackerTarget_Unpeg(self: *const T) callconv(.Inline) HRESULT { return @ptrCast(*const IReferenceTrackerTarget.VTable, self.vtable).Unpeg(@ptrCast(*const IReferenceTrackerTarget, self)); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IReferenceTracker_Value = @import("../zig.zig").Guid.initString("11d3b13a-180e-4789-a8be-7712882893e6"); pub const IID_IReferenceTracker = &IID_IReferenceTracker_Value; pub const IReferenceTracker = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, ConnectFromTrackerSource: fn( self: *const IReferenceTracker, ) callconv(@import("std").os.windows.WINAPI) HRESULT, DisconnectFromTrackerSource: fn( self: *const IReferenceTracker, ) callconv(@import("std").os.windows.WINAPI) HRESULT, FindTrackerTargets: fn( self: *const IReferenceTracker, callback: ?*IFindReferenceTargetsCallback, ) callconv(@import("std").os.windows.WINAPI) HRESULT, GetReferenceTrackerManager: fn( self: *const IReferenceTracker, value: ?*?*IReferenceTrackerManager, ) callconv(@import("std").os.windows.WINAPI) HRESULT, AddRefFromTrackerSource: fn( self: *const IReferenceTracker, ) callconv(@import("std").os.windows.WINAPI) HRESULT, ReleaseFromTrackerSource: fn( self: *const IReferenceTracker, ) callconv(@import("std").os.windows.WINAPI) HRESULT, PegFromTrackerSource: fn( self: *const IReferenceTracker, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IReferenceTracker_ConnectFromTrackerSource(self: *const T) callconv(.Inline) HRESULT { return @ptrCast(*const IReferenceTracker.VTable, self.vtable).ConnectFromTrackerSource(@ptrCast(*const IReferenceTracker, self)); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IReferenceTracker_DisconnectFromTrackerSource(self: *const T) callconv(.Inline) HRESULT { return @ptrCast(*const IReferenceTracker.VTable, self.vtable).DisconnectFromTrackerSource(@ptrCast(*const IReferenceTracker, self)); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IReferenceTracker_FindTrackerTargets(self: *const T, callback: ?*IFindReferenceTargetsCallback) callconv(.Inline) HRESULT { return @ptrCast(*const IReferenceTracker.VTable, self.vtable).FindTrackerTargets(@ptrCast(*const IReferenceTracker, self), callback); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IReferenceTracker_GetReferenceTrackerManager(self: *const T, value: ?*?*IReferenceTrackerManager) callconv(.Inline) HRESULT { return @ptrCast(*const IReferenceTracker.VTable, self.vtable).GetReferenceTrackerManager(@ptrCast(*const IReferenceTracker, self), value); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IReferenceTracker_AddRefFromTrackerSource(self: *const T) callconv(.Inline) HRESULT { return @ptrCast(*const IReferenceTracker.VTable, self.vtable).AddRefFromTrackerSource(@ptrCast(*const IReferenceTracker, self)); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IReferenceTracker_ReleaseFromTrackerSource(self: *const T) callconv(.Inline) HRESULT { return @ptrCast(*const IReferenceTracker.VTable, self.vtable).ReleaseFromTrackerSource(@ptrCast(*const IReferenceTracker, self)); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IReferenceTracker_PegFromTrackerSource(self: *const T) callconv(.Inline) HRESULT { return @ptrCast(*const IReferenceTracker.VTable, self.vtable).PegFromTrackerSource(@ptrCast(*const IReferenceTracker, self)); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IReferenceTrackerManager_Value = @import("../zig.zig").Guid.initString("3cf184b4-7ccb-4dda-8455-7e6ce99a3298"); pub const IID_IReferenceTrackerManager = &IID_IReferenceTrackerManager_Value; pub const IReferenceTrackerManager = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, ReferenceTrackingStarted: fn( self: *const IReferenceTrackerManager, ) callconv(@import("std").os.windows.WINAPI) HRESULT, FindTrackerTargetsCompleted: fn( self: *const IReferenceTrackerManager, findFailed: u8, ) callconv(@import("std").os.windows.WINAPI) HRESULT, ReferenceTrackingCompleted: fn( self: *const IReferenceTrackerManager, ) callconv(@import("std").os.windows.WINAPI) HRESULT, SetReferenceTrackerHost: fn( self: *const IReferenceTrackerManager, value: ?*IReferenceTrackerHost, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IReferenceTrackerManager_ReferenceTrackingStarted(self: *const T) callconv(.Inline) HRESULT { return @ptrCast(*const IReferenceTrackerManager.VTable, self.vtable).ReferenceTrackingStarted(@ptrCast(*const IReferenceTrackerManager, self)); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IReferenceTrackerManager_FindTrackerTargetsCompleted(self: *const T, findFailed: u8) callconv(.Inline) HRESULT { return @ptrCast(*const IReferenceTrackerManager.VTable, self.vtable).FindTrackerTargetsCompleted(@ptrCast(*const IReferenceTrackerManager, self), findFailed); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IReferenceTrackerManager_ReferenceTrackingCompleted(self: *const T) callconv(.Inline) HRESULT { return @ptrCast(*const IReferenceTrackerManager.VTable, self.vtable).ReferenceTrackingCompleted(@ptrCast(*const IReferenceTrackerManager, self)); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IReferenceTrackerManager_SetReferenceTrackerHost(self: *const T, value: ?*IReferenceTrackerHost) callconv(.Inline) HRESULT { return @ptrCast(*const IReferenceTrackerManager.VTable, self.vtable).SetReferenceTrackerHost(@ptrCast(*const IReferenceTrackerManager, self), value); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IFindReferenceTargetsCallback_Value = @import("../zig.zig").Guid.initString("04b3486c-4687-4229-8d14-505ab584dd88"); pub const IID_IFindReferenceTargetsCallback = &IID_IFindReferenceTargetsCallback_Value; pub const IFindReferenceTargetsCallback = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, FoundTrackerTarget: fn( self: *const IFindReferenceTargetsCallback, target: ?*IReferenceTrackerTarget, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IFindReferenceTargetsCallback_FoundTrackerTarget(self: *const T, target: ?*IReferenceTrackerTarget) callconv(.Inline) HRESULT { return @ptrCast(*const IFindReferenceTargetsCallback.VTable, self.vtable).FoundTrackerTarget(@ptrCast(*const IFindReferenceTargetsCallback, self), target); } };} pub usingnamespace MethodMixin(@This()); }; pub const XAML_REFERENCETRACKER_DISCONNECT = enum(i32) { DEFAULT = 0, SUSPEND = 1, }; pub const XAML_REFERENCETRACKER_DISCONNECT_DEFAULT = XAML_REFERENCETRACKER_DISCONNECT.DEFAULT; pub const XAML_REFERENCETRACKER_DISCONNECT_SUSPEND = XAML_REFERENCETRACKER_DISCONNECT.SUSPEND; const IID_IReferenceTrackerHost_Value = @import("../zig.zig").Guid.initString("29a71c6a-3c42-4416-a39d-e2825a07a773"); pub const IID_IReferenceTrackerHost = &IID_IReferenceTrackerHost_Value; pub const IReferenceTrackerHost = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, DisconnectUnusedReferenceSources: fn( self: *const IReferenceTrackerHost, options: XAML_REFERENCETRACKER_DISCONNECT, ) callconv(@import("std").os.windows.WINAPI) HRESULT, ReleaseDisconnectedReferenceSources: fn( self: *const IReferenceTrackerHost, ) callconv(@import("std").os.windows.WINAPI) HRESULT, NotifyEndOfReferenceTrackingOnThread: fn( self: *const IReferenceTrackerHost, ) callconv(@import("std").os.windows.WINAPI) HRESULT, GetTrackerTarget: fn( self: *const IReferenceTrackerHost, unknown: ?*IUnknown, newReference: ?*?*IReferenceTrackerTarget, ) callconv(@import("std").os.windows.WINAPI) HRESULT, AddMemoryPressure: fn( self: *const IReferenceTrackerHost, bytesAllocated: u64, ) callconv(@import("std").os.windows.WINAPI) HRESULT, RemoveMemoryPressure: fn( self: *const IReferenceTrackerHost, bytesAllocated: u64, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IReferenceTrackerHost_DisconnectUnusedReferenceSources(self: *const T, options: XAML_REFERENCETRACKER_DISCONNECT) callconv(.Inline) HRESULT { return @ptrCast(*const IReferenceTrackerHost.VTable, self.vtable).DisconnectUnusedReferenceSources(@ptrCast(*const IReferenceTrackerHost, self), options); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IReferenceTrackerHost_ReleaseDisconnectedReferenceSources(self: *const T) callconv(.Inline) HRESULT { return @ptrCast(*const IReferenceTrackerHost.VTable, self.vtable).ReleaseDisconnectedReferenceSources(@ptrCast(*const IReferenceTrackerHost, self)); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IReferenceTrackerHost_NotifyEndOfReferenceTrackingOnThread(self: *const T) callconv(.Inline) HRESULT { return @ptrCast(*const IReferenceTrackerHost.VTable, self.vtable).NotifyEndOfReferenceTrackingOnThread(@ptrCast(*const IReferenceTrackerHost, self)); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IReferenceTrackerHost_GetTrackerTarget(self: *const T, unknown: ?*IUnknown, newReference: ?*?*IReferenceTrackerTarget) callconv(.Inline) HRESULT { return @ptrCast(*const IReferenceTrackerHost.VTable, self.vtable).GetTrackerTarget(@ptrCast(*const IReferenceTrackerHost, self), unknown, newReference); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IReferenceTrackerHost_AddMemoryPressure(self: *const T, bytesAllocated: u64) callconv(.Inline) HRESULT { return @ptrCast(*const IReferenceTrackerHost.VTable, self.vtable).AddMemoryPressure(@ptrCast(*const IReferenceTrackerHost, self), bytesAllocated); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn IReferenceTrackerHost_RemoveMemoryPressure(self: *const T, bytesAllocated: u64) callconv(.Inline) HRESULT { return @ptrCast(*const IReferenceTrackerHost.VTable, self.vtable).RemoveMemoryPressure(@ptrCast(*const IReferenceTrackerHost, self), bytesAllocated); } };} pub usingnamespace MethodMixin(@This()); }; const IID_IReferenceTrackerExtension_Value = @import("../zig.zig").Guid.initString("4e897caa-59d5-4613-8f8c-f7ebd1f399b0"); pub const IID_IReferenceTrackerExtension = &IID_IReferenceTrackerExtension_Value; pub const IReferenceTrackerExtension = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); };} pub usingnamespace MethodMixin(@This()); }; pub const TrackerHandle__ = extern struct { unused: i32, }; const IID_ITrackerOwner_Value = @import("../zig.zig").Guid.initString("eb24c20b-9816-4ac7-8cff-36f67a118f4e"); pub const IID_ITrackerOwner = &IID_ITrackerOwner_Value; pub const ITrackerOwner = extern struct { pub const VTable = extern struct { base: IUnknown.VTable, CreateTrackerHandle: fn( self: *const ITrackerOwner, returnValue: ?*?*TrackerHandle__, ) callconv(@import("std").os.windows.WINAPI) HRESULT, DeleteTrackerHandle: fn( self: *const ITrackerOwner, handle: ?*TrackerHandle__, ) callconv(@import("std").os.windows.WINAPI) HRESULT, SetTrackerValue: fn( self: *const ITrackerOwner, handle: ?*TrackerHandle__, value: ?*IUnknown, ) callconv(@import("std").os.windows.WINAPI) HRESULT, TryGetSafeTrackerValue: fn( self: *const ITrackerOwner, handle: ?*TrackerHandle__, returnValue: ?*?*IUnknown, ) callconv(@import("std").os.windows.WINAPI) u8, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IUnknown.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ITrackerOwner_CreateTrackerHandle(self: *const T, returnValue: ?*?*TrackerHandle__) callconv(.Inline) HRESULT { return @ptrCast(*const ITrackerOwner.VTable, self.vtable).CreateTrackerHandle(@ptrCast(*const ITrackerOwner, self), returnValue); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ITrackerOwner_DeleteTrackerHandle(self: *const T, handle: ?*TrackerHandle__) callconv(.Inline) HRESULT { return @ptrCast(*const ITrackerOwner.VTable, self.vtable).DeleteTrackerHandle(@ptrCast(*const ITrackerOwner, self), handle); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ITrackerOwner_SetTrackerValue(self: *const T, handle: ?*TrackerHandle__, value: ?*IUnknown) callconv(.Inline) HRESULT { return @ptrCast(*const ITrackerOwner.VTable, self.vtable).SetTrackerValue(@ptrCast(*const ITrackerOwner, self), handle, value); } // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ITrackerOwner_TryGetSafeTrackerValue(self: *const T, handle: ?*TrackerHandle__, returnValue: ?*?*IUnknown) callconv(.Inline) u8 { return @ptrCast(*const ITrackerOwner.VTable, self.vtable).TryGetSafeTrackerValue(@ptrCast(*const ITrackerOwner, self), handle, returnValue); } };} pub usingnamespace MethodMixin(@This()); }; const IID_ISystemMediaTransportControlsInterop_Value = @import("../zig.zig").Guid.initString("ddb0472d-c911-4a1f-86d9-dc3d71a95f5a"); pub const IID_ISystemMediaTransportControlsInterop = &IID_ISystemMediaTransportControlsInterop_Value; pub const ISystemMediaTransportControlsInterop = extern struct { pub const VTable = extern struct { base: IInspectable.VTable, GetForWindow: fn( self: *const ISystemMediaTransportControlsInterop, appWindow: ?HWND, riid: ?*const Guid, mediaTransportControl: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT, }; vtable: *const VTable, pub fn MethodMixin(comptime T: type) type { return struct { pub usingnamespace IInspectable.MethodMixin(T); // NOTE: method is namespaced with interface name to avoid conflicts for now pub fn ISystemMediaTransportControlsInterop_GetForWindow(self: *const T, appWindow: ?HWND, riid: ?*const Guid, mediaTransportControl: ?*?*c_void) callconv(.Inline) HRESULT { return @ptrCast(*const ISystemMediaTransportControlsInterop.VTable, self.vtable).GetForWindow(@ptrCast(*const ISystemMediaTransportControlsInterop, self), appWindow, riid, mediaTransportControl); } };} pub usingnamespace MethodMixin(@This()); }; //-------------------------------------------------------------------------------- // Section: Functions (71) //-------------------------------------------------------------------------------- pub extern "OLE32" fn CoDecodeProxy( dwClientPid: u32, ui64ProxyAddress: u64, pServerInformation: ?*ServerInformation, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.1' pub extern "OLE32" fn RoGetAgileReference( options: AgileReferenceOptions, riid: ?*const Guid, pUnk: ?*IUnknown, ppAgileReference: ?*?*IAgileReference, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn HSTRING_UserSize( param0: ?*u32, param1: u32, param2: ?*?HSTRING, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn HSTRING_UserMarshal( param0: ?*u32, param1: ?*u8, param2: ?*?HSTRING, ) callconv(@import("std").os.windows.WINAPI) ?*u8; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn HSTRING_UserUnmarshal( param0: ?*u32, param1: [*:0]u8, param2: ?*?HSTRING, ) callconv(@import("std").os.windows.WINAPI) ?*u8; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn HSTRING_UserFree( param0: ?*u32, param1: ?*?HSTRING, ) callconv(@import("std").os.windows.WINAPI) void; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn HSTRING_UserSize64( param0: ?*u32, param1: u32, param2: ?*?HSTRING, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn HSTRING_UserMarshal64( param0: ?*u32, param1: ?*u8, param2: ?*?HSTRING, ) callconv(@import("std").os.windows.WINAPI) ?*u8; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn HSTRING_UserUnmarshal64( param0: ?*u32, param1: [*:0]u8, param2: ?*?HSTRING, ) callconv(@import("std").os.windows.WINAPI) ?*u8; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn HSTRING_UserFree64( param0: ?*u32, param1: ?*?HSTRING, ) callconv(@import("std").os.windows.WINAPI) void; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn WindowsCreateString( sourceString: ?[*:0]const u16, length: u32, string: ?*?HSTRING, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn WindowsCreateStringReference( sourceString: ?[*:0]const u16, length: u32, hstringHeader: ?*HSTRING_HEADER, string: ?*?HSTRING, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn WindowsDeleteString( string: ?HSTRING, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn WindowsDuplicateString( string: ?HSTRING, newString: ?*?HSTRING, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn WindowsGetStringLen( string: ?HSTRING, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn WindowsGetStringRawBuffer( string: ?HSTRING, length: ?*u32, ) callconv(@import("std").os.windows.WINAPI) ?PWSTR; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn WindowsIsStringEmpty( string: ?HSTRING, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn WindowsStringHasEmbeddedNull( string: ?HSTRING, hasEmbedNull: ?*BOOL, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn WindowsCompareStringOrdinal( string1: ?HSTRING, string2: ?HSTRING, result: ?*i32, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn WindowsSubstring( string: ?HSTRING, startIndex: u32, newString: ?*?HSTRING, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn WindowsSubstringWithSpecifiedLength( string: ?HSTRING, startIndex: u32, length: u32, newString: ?*?HSTRING, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn WindowsConcatString( string1: ?HSTRING, string2: ?HSTRING, newString: ?*?HSTRING, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn WindowsReplaceString( string: ?HSTRING, stringReplaced: ?HSTRING, stringReplaceWith: ?HSTRING, newString: ?*?HSTRING, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn WindowsTrimStringStart( string: ?HSTRING, trimString: ?HSTRING, newString: ?*?HSTRING, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn WindowsTrimStringEnd( string: ?HSTRING, trimString: ?HSTRING, newString: ?*?HSTRING, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn WindowsPreallocateStringBuffer( length: u32, charBuffer: ?*?*u16, bufferHandle: ?*?HSTRING_BUFFER, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn WindowsPromoteStringBuffer( bufferHandle: ?HSTRING_BUFFER, string: ?*?HSTRING, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn WindowsDeleteStringBuffer( bufferHandle: ?HSTRING_BUFFER, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-0" fn WindowsInspectString( targetHString: usize, machine: u16, callback: ?PINSPECT_HSTRING_CALLBACK, context: ?*c_void, length: ?*u32, targetStringAddress: ?*usize, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-string-l1-1-1" fn WindowsInspectString2( targetHString: u64, machine: u16, callback: ?PINSPECT_HSTRING_CALLBACK2, context: ?*c_void, length: ?*u32, targetStringAddress: ?*u64, ) callconv(@import("std").os.windows.WINAPI) HRESULT; pub extern "CoreMessaging" fn CreateDispatcherQueueController( options: DispatcherQueueOptions, dispatcherQueueController: ?**struct{comment: []const u8 = "MissingClrType DispatcherQueueController.Windows.System"}, ) callconv(@import("std").os.windows.WINAPI) HRESULT; pub extern "Windows.Data.Pdf" fn PdfCreateRenderer( pDevice: ?*IDXGIDevice, ppRenderer: ?*?*IPdfRendererNative, ) callconv(@import("std").os.windows.WINAPI) HRESULT; pub extern "d3d11" fn CreateDirect3D11DeviceFromDXGIDevice( dxgiDevice: ?*IDXGIDevice, graphicsDevice: ?*?*IInspectable, ) callconv(@import("std").os.windows.WINAPI) HRESULT; pub extern "d3d11" fn CreateDirect3D11SurfaceFromDXGISurface( dgxiSurface: ?*IDXGISurface, graphicsSurface: ?*?*IInspectable, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-l1-1-0" fn RoInitialize( initType: RO_INIT_TYPE, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-l1-1-0" fn RoUninitialize( ) callconv(@import("std").os.windows.WINAPI) void; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-l1-1-0" fn RoActivateInstance( activatableClassId: ?HSTRING, instance: ?*?*IInspectable, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-l1-1-0" fn RoRegisterActivationFactories( activatableClassIds: [*]?HSTRING, activationFactoryCallbacks: [*]isize, count: u32, cookie: ?*isize, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-l1-1-0" fn RoRevokeActivationFactories( cookie: isize, ) callconv(@import("std").os.windows.WINAPI) void; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-l1-1-0" fn RoGetActivationFactory( activatableClassId: ?HSTRING, iid: ?*const Guid, factory: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-l1-1-0" fn RoRegisterForApartmentShutdown( callbackObject: ?*IApartmentShutdown, apartmentIdentifier: ?*u64, regCookie: ?*APARTMENT_SHUTDOWN_REGISTRATION_COOKIE, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-l1-1-0" fn RoUnregisterForApartmentShutdown( regCookie: APARTMENT_SHUTDOWN_REGISTRATION_COOKIE, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-l1-1-0" fn RoGetApartmentIdentifier( apartmentIdentifier: ?*u64, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-robuffer-l1-1-0" fn RoGetBufferMarshaler( bufferMarshaler: ?*?*IMarshal, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-error-l1-1-0" fn RoGetErrorReportingFlags( pflags: ?*u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-error-l1-1-0" fn RoSetErrorReportingFlags( flags: u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-error-l1-1-0" fn RoResolveRestrictedErrorInfoReference( reference: ?[*:0]const u16, ppRestrictedErrorInfo: ?*?*IRestrictedErrorInfo, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-error-l1-1-0" fn SetRestrictedErrorInfo( pRestrictedErrorInfo: ?*IRestrictedErrorInfo, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-error-l1-1-0" fn GetRestrictedErrorInfo( ppRestrictedErrorInfo: ?*?*IRestrictedErrorInfo, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-error-l1-1-0" fn RoOriginateErrorW( @"error": HRESULT, cchMax: u32, message: ?*[512]u16, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-error-l1-1-0" fn RoOriginateError( @"error": HRESULT, message: ?HSTRING, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-error-l1-1-0" fn RoTransformErrorW( oldError: HRESULT, newError: HRESULT, cchMax: u32, message: ?*[512]u16, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-error-l1-1-0" fn RoTransformError( oldError: HRESULT, newError: HRESULT, message: ?HSTRING, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-error-l1-1-0" fn RoCaptureErrorContext( hr: HRESULT, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-error-l1-1-0" fn RoFailFastWithErrorContext( hrError: HRESULT, ) callconv(@import("std").os.windows.WINAPI) void; // TODO: this type is limited to platform 'windows8.1' pub extern "api-ms-win-core-winrt-error-l1-1-1" fn RoOriginateLanguageException( @"error": HRESULT, message: ?HSTRING, languageException: ?*IUnknown, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows8.1' pub extern "api-ms-win-core-winrt-error-l1-1-1" fn RoClearError( ) callconv(@import("std").os.windows.WINAPI) void; pub extern "api-ms-win-core-winrt-error-l1-1-1" fn RoReportUnhandledError( pRestrictedErrorInfo: ?*IRestrictedErrorInfo, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.1' pub extern "api-ms-win-core-winrt-error-l1-1-1" fn RoInspectThreadErrorInfo( targetTebAddress: usize, machine: u16, readMemoryCallback: ?PINSPECT_MEMORY_CALLBACK, context: ?*c_void, targetErrorInfoAddress: ?*usize, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.1' pub extern "api-ms-win-core-winrt-error-l1-1-1" fn RoInspectCapturedStackBackTrace( targetErrorInfoAddress: usize, machine: u16, readMemoryCallback: ?PINSPECT_MEMORY_CALLBACK, context: ?*c_void, frameCount: ?*u32, targetBackTraceAddress: ?*usize, ) callconv(@import("std").os.windows.WINAPI) HRESULT; pub extern "api-ms-win-core-winrt-error-l1-1-1" fn RoGetMatchingRestrictedErrorInfo( hrIn: HRESULT, ppRestrictedErrorInfo: ?*?*IRestrictedErrorInfo, ) callconv(@import("std").os.windows.WINAPI) HRESULT; pub extern "api-ms-win-core-winrt-error-l1-1-1" fn RoReportFailedDelegate( punkDelegate: ?*IUnknown, pRestrictedErrorInfo: ?*IRestrictedErrorInfo, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-error-l1-1-1" fn IsErrorPropagationEnabled( ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows8.0' pub extern "RoMetadata" fn MetaDataGetDispenser( rclsid: ?*const Guid, riid: ?*const Guid, ppv: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-roparameterizediid-l1-1-0" fn RoGetParameterizedTypeInstanceIID( nameElementCount: u32, nameElements: [*]?PWSTR, metaDataLocator: ?*IRoMetaDataLocator, iid: ?*Guid, pExtra: ?*ROPARAMIIDHANDLE, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-roparameterizediid-l1-1-0" fn RoFreeParameterizedTypeExtra( extra: ROPARAMIIDHANDLE, ) callconv(@import("std").os.windows.WINAPI) void; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-roparameterizediid-l1-1-0" fn RoParameterizedTypeExtraGetTypeSignature( extra: ROPARAMIIDHANDLE, ) callconv(@import("std").os.windows.WINAPI) ?PSTR; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-core-winrt-registration-l1-1-0" fn RoGetServerActivatableClasses( serverName: ?HSTRING, activatableClassIds: ?*?*?HSTRING, count: ?*u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-shcore-stream-winrt-l1-1-0" fn CreateRandomAccessStreamOnFile( filePath: ?[*:0]const u16, accessMode: u32, riid: ?*const Guid, ppv: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-shcore-stream-winrt-l1-1-0" fn CreateRandomAccessStreamOverStream( stream: ?*IStream, options: BSOS_OPTIONS, riid: ?*const Guid, ppv: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "api-ms-win-shcore-stream-winrt-l1-1-0" fn CreateStreamOverRandomAccessStream( randomAccessStream: ?*IUnknown, riid: ?*const Guid, ppv: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT; //-------------------------------------------------------------------------------- // Section: Unicode Aliases (0) //-------------------------------------------------------------------------------- const thismodule = @This(); pub usingnamespace switch (@import("../zig.zig").unicode_mode) { .ansi => struct { }, .wide => struct { }, .unspecified => if (@import("builtin").is_test) struct { } else struct { }, }; //-------------------------------------------------------------------------------- // Section: Imports (46) //-------------------------------------------------------------------------------- const Guid = @import("../zig.zig").Guid; const BOOL = @import("../foundation.zig").BOOL; const BOOLEAN = @import("../foundation.zig").BOOLEAN; const BSTR = @import("../foundation.zig").BSTR; const CHAR = @import("../system/system_services.zig").CHAR; const D2D_COLOR_F = @import("../graphics/direct2d.zig").D2D_COLOR_F; const D2D_RECT_F = @import("../graphics/direct2d.zig").D2D_RECT_F; const D3D12_RESOURCE_DESC = @import("../graphics/direct3d12.zig").D3D12_RESOURCE_DESC; const HANDLE = @import("../foundation.zig").HANDLE; const HMONITOR = @import("../graphics/gdi.zig").HMONITOR; const HRESULT = @import("../foundation.zig").HRESULT; const HWND = @import("../foundation.zig").HWND; const ID2D1DeviceContext = @import("../graphics/direct2d.zig").ID2D1DeviceContext; const ID2D1Factory = @import("../graphics/direct2d.zig").ID2D1Factory; const ID2D1Geometry = @import("../graphics/direct2d.zig").ID2D1Geometry; const ID3D12CommandQueue = @import("../graphics/direct3d12.zig").ID3D12CommandQueue; const ID3D12Device = @import("../graphics/direct3d12.zig").ID3D12Device; const ID3D12Fence = @import("../graphics/direct3d12.zig").ID3D12Fence; const ID3D12ProtectedResourceSession = @import("../graphics/direct3d12.zig").ID3D12ProtectedResourceSession; const ID3D12Resource = @import("../graphics/direct3d12.zig").ID3D12Resource; const IDXGIDevice = @import("../graphics/dxgi.zig").IDXGIDevice; const IDXGISurface = @import("../graphics/dxgi.zig").IDXGISurface; const IDXGISwapChain = @import("../graphics/dxgi.zig").IDXGISwapChain; const IMarshal = @import("../system/com.zig").IMarshal; const IMF2DBuffer2 = @import("../media/media_foundation.zig").IMF2DBuffer2; const IMFDXGIDeviceManager = @import("../media/media_foundation.zig").IMFDXGIDeviceManager; const IMFSample = @import("../media/media_foundation.zig").IMFSample; const IMLOperatorRegistry = @import("../ai/machine_learning/win_ml.zig").IMLOperatorRegistry; const INamedPropertyStore = @import("../system/properties_system.zig").INamedPropertyStore; const IPrinterPropertyBag = @import("../graphics/printing.zig").IPrinterPropertyBag; const IPrinterQueue = @import("../graphics/printing.zig").IPrinterQueue; const IStream = @import("../storage/structured_storage.zig").IStream; const IUnknown = @import("../system/com.zig").IUnknown; const IWICBitmap = @import("../graphics/imaging.zig").IWICBitmap; const IXpsDocumentPackageTarget = @import("../storage/xps.zig").IXpsDocumentPackageTarget; const IXpsOMObjectFactory1 = @import("../storage/xps.zig").IXpsOMObjectFactory1; const IXpsOMPageReference = @import("../storage/xps.zig").IXpsOMPageReference; const MFVideoArea = @import("../media/media_foundation.zig").MFVideoArea; const MSG = @import("../ui/windows_and_messaging.zig").MSG; const POINT = @import("../foundation.zig").POINT; const POINTER_INFO = @import("../ui/pointer_input.zig").POINTER_INFO; const PSTR = @import("../foundation.zig").PSTR; const PWSTR = @import("../foundation.zig").PWSTR; const RECT = @import("../foundation.zig").RECT; const SECURITY_ATTRIBUTES = @import("../security.zig").SECURITY_ATTRIBUTES; const SIZE = @import("../foundation.zig").SIZE; test { // The following '_ = <FuncPtrType>' lines are a workaround for https://github.com/ziglang/zig/issues/4476 if (@hasDecl(@This(), "PINSPECT_HSTRING_CALLBACK")) { _ = PINSPECT_HSTRING_CALLBACK; } if (@hasDecl(@This(), "PINSPECT_HSTRING_CALLBACK2")) { _ = PINSPECT_HSTRING_CALLBACK2; } if (@hasDecl(@This(), "PFN_PDF_CREATE_RENDERER")) { _ = PFN_PDF_CREATE_RENDERER; } if (@hasDecl(@This(), "PINSPECT_MEMORY_CALLBACK")) { _ = PINSPECT_MEMORY_CALLBACK; } @setEvalBranchQuota( @import("std").meta.declarations(@This()).len * 3 ); // reference all the pub declarations if (!@import("builtin").is_test) return; inline for (@import("std").meta.declarations(@This())) |decl| { if (decl.is_pub) { _ = decl; } } }
deps/zigwin32/win32/system/win_rt.zig
pub const ISSP_LEVEL = @as(u32, 32); pub const ISSP_MODE = @as(u32, 1); pub const SECPKG_FLAG_INTEGRITY = @as(u32, 1); pub const SECPKG_FLAG_PRIVACY = @as(u32, 2); pub const SECPKG_FLAG_TOKEN_ONLY = @as(u32, 4); pub const SECPKG_FLAG_DATAGRAM = @as(u32, 8); pub const SECPKG_FLAG_CONNECTION = @as(u32, 16); pub const SECPKG_FLAG_MULTI_REQUIRED = @as(u32, 32); pub const SECPKG_FLAG_CLIENT_ONLY = @as(u32, 64); pub const SECPKG_FLAG_EXTENDED_ERROR = @as(u32, 128); pub const SECPKG_FLAG_IMPERSONATION = @as(u32, 256); pub const SECPKG_FLAG_ACCEPT_WIN32_NAME = @as(u32, 512); pub const SECPKG_FLAG_STREAM = @as(u32, 1024); pub const SECPKG_FLAG_NEGOTIABLE = @as(u32, 2048); pub const SECPKG_FLAG_GSS_COMPATIBLE = @as(u32, 4096); pub const SECPKG_FLAG_LOGON = @as(u32, 8192); pub const SECPKG_FLAG_ASCII_BUFFERS = @as(u32, 16384); pub const SECPKG_FLAG_FRAGMENT = @as(u32, 32768); pub const SECPKG_FLAG_MUTUAL_AUTH = @as(u32, 65536); pub const SECPKG_FLAG_DELEGATION = @as(u32, 131072); pub const SECPKG_FLAG_READONLY_WITH_CHECKSUM = @as(u32, 262144); pub const SECPKG_FLAG_RESTRICTED_TOKENS = @as(u32, 524288); pub const SECPKG_FLAG_NEGO_EXTENDER = @as(u32, 1048576); pub const SECPKG_FLAG_NEGOTIABLE2 = @as(u32, 2097152); pub const SECPKG_FLAG_APPCONTAINER_PASSTHROUGH = @as(u32, 4194304); pub const SECPKG_FLAG_APPCONTAINER_CHECKS = @as(u32, 8388608); pub const SECPKG_FLAG_CREDENTIAL_ISOLATION_ENABLED = @as(u32, 16777216); pub const SECPKG_FLAG_APPLY_LOOPBACK = @as(u32, 33554432); pub const SECPKG_ID_NONE = @as(u32, 65535); pub const SECPKG_CALLFLAGS_APPCONTAINER = @as(u32, 1); pub const SECPKG_CALLFLAGS_APPCONTAINER_AUTHCAPABLE = @as(u32, 2); pub const SECPKG_CALLFLAGS_FORCE_SUPPLIED = @as(u32, 4); pub const SECPKG_CALLFLAGS_APPCONTAINER_UPNCAPABLE = @as(u32, 8); pub const SECBUFFER_VERSION = @as(u32, 0); pub const SECBUFFER_EMPTY = @as(u32, 0); pub const SECBUFFER_DATA = @as(u32, 1); pub const SECBUFFER_TOKEN = @as(u32, 2); pub const SECBUFFER_PKG_PARAMS = @as(u32, 3); pub const SECBUFFER_MISSING = @as(u32, 4); pub const SECBUFFER_EXTRA = @as(u32, 5); pub const SECBUFFER_STREAM_TRAILER = @as(u32, 6); pub const SECBUFFER_STREAM_HEADER = @as(u32, 7); pub const SECBUFFER_NEGOTIATION_INFO = @as(u32, 8); pub const SECBUFFER_PADDING = @as(u32, 9); pub const SECBUFFER_STREAM = @as(u32, 10); pub const SECBUFFER_MECHLIST = @as(u32, 11); pub const SECBUFFER_MECHLIST_SIGNATURE = @as(u32, 12); pub const SECBUFFER_TARGET = @as(u32, 13); pub const SECBUFFER_CHANNEL_BINDINGS = @as(u32, 14); pub const SECBUFFER_CHANGE_PASS_RESPONSE = @as(u32, 15); pub const SECBUFFER_TARGET_HOST = @as(u32, 16); pub const SECBUFFER_ALERT = @as(u32, 17); pub const SECBUFFER_APPLICATION_PROTOCOLS = @as(u32, 18); pub const SECBUFFER_SRTP_PROTECTION_PROFILES = @as(u32, 19); pub const SECBUFFER_SRTP_MASTER_KEY_IDENTIFIER = @as(u32, 20); pub const SECBUFFER_TOKEN_BINDING = @as(u32, 21); pub const SECBUFFER_PRESHARED_KEY = @as(u32, 22); pub const SECBUFFER_PRESHARED_KEY_IDENTITY = @as(u32, 23); pub const SECBUFFER_DTLS_MTU = @as(u32, 24); pub const SECBUFFER_SEND_GENERIC_TLS_EXTENSION = @as(u32, 25); pub const SECBUFFER_SUBSCRIBE_GENERIC_TLS_EXTENSION = @as(u32, 26); pub const SECBUFFER_FLAGS = @as(u32, 27); pub const SECBUFFER_TRAFFIC_SECRETS = @as(u32, 28); pub const SECBUFFER_ATTRMASK = @as(u32, 4026531840); pub const SECBUFFER_READONLY = @as(u32, 2147483648); pub const SECBUFFER_READONLY_WITH_CHECKSUM = @as(u32, 268435456); pub const SECBUFFER_RESERVED = @as(u32, 1610612736); pub const SZ_ALG_MAX_SIZE = @as(u32, 64); pub const SECURITY_NATIVE_DREP = @as(u32, 16); pub const SECURITY_NETWORK_DREP = @as(u32, 0); pub const SECPKG_CRED_BOTH = @as(u32, 3); pub const SECPKG_CRED_DEFAULT = @as(u32, 4); pub const SECPKG_CRED_RESERVED = @as(u32, 4026531840); pub const SECPKG_CRED_AUTOLOGON_RESTRICTED = @as(u32, 16); pub const SECPKG_CRED_PROCESS_POLICY_ONLY = @as(u32, 32); pub const ISC_REQ_DELEGATE = @as(u32, 1); pub const ISC_REQ_MUTUAL_AUTH = @as(u32, 2); pub const ISC_REQ_REPLAY_DETECT = @as(u32, 4); pub const ISC_REQ_SEQUENCE_DETECT = @as(u32, 8); pub const ISC_REQ_CONFIDENTIALITY = @as(u32, 16); pub const ISC_REQ_USE_SESSION_KEY = @as(u32, 32); pub const ISC_REQ_PROMPT_FOR_CREDS = @as(u32, 64); pub const ISC_REQ_USE_SUPPLIED_CREDS = @as(u32, 128); pub const ISC_REQ_ALLOCATE_MEMORY = @as(u32, 256); pub const ISC_REQ_USE_DCE_STYLE = @as(u32, 512); pub const ISC_REQ_DATAGRAM = @as(u32, 1024); pub const ISC_REQ_CONNECTION = @as(u32, 2048); pub const ISC_REQ_CALL_LEVEL = @as(u32, 4096); pub const ISC_REQ_FRAGMENT_SUPPLIED = @as(u32, 8192); pub const ISC_REQ_EXTENDED_ERROR = @as(u32, 16384); pub const ISC_REQ_STREAM = @as(u32, 32768); pub const ISC_REQ_INTEGRITY = @as(u32, 65536); pub const ISC_REQ_IDENTIFY = @as(u32, 131072); pub const ISC_REQ_NULL_SESSION = @as(u32, 262144); pub const ISC_REQ_MANUAL_CRED_VALIDATION = @as(u32, 524288); pub const ISC_REQ_RESERVED1 = @as(u32, 1048576); pub const ISC_REQ_FRAGMENT_TO_FIT = @as(u32, 2097152); pub const ISC_REQ_FORWARD_CREDENTIALS = @as(u32, 4194304); pub const ISC_REQ_NO_INTEGRITY = @as(u32, 8388608); pub const ISC_REQ_USE_HTTP_STYLE = @as(u32, 16777216); pub const ISC_REQ_UNVERIFIED_TARGET_NAME = @as(u32, 536870912); pub const ISC_REQ_CONFIDENTIALITY_ONLY = @as(u32, 1073741824); pub const ISC_REQ_MESSAGES = @as(u64, 4294967296); pub const ISC_RET_DELEGATE = @as(u32, 1); pub const ISC_RET_MUTUAL_AUTH = @as(u32, 2); pub const ISC_RET_REPLAY_DETECT = @as(u32, 4); pub const ISC_RET_SEQUENCE_DETECT = @as(u32, 8); pub const ISC_RET_CONFIDENTIALITY = @as(u32, 16); pub const ISC_RET_USE_SESSION_KEY = @as(u32, 32); pub const ISC_RET_USED_COLLECTED_CREDS = @as(u32, 64); pub const ISC_RET_USED_SUPPLIED_CREDS = @as(u32, 128); pub const ISC_RET_ALLOCATED_MEMORY = @as(u32, 256); pub const ISC_RET_USED_DCE_STYLE = @as(u32, 512); pub const ISC_RET_DATAGRAM = @as(u32, 1024); pub const ISC_RET_CONNECTION = @as(u32, 2048); pub const ISC_RET_INTERMEDIATE_RETURN = @as(u32, 4096); pub const ISC_RET_CALL_LEVEL = @as(u32, 8192); pub const ISC_RET_EXTENDED_ERROR = @as(u32, 16384); pub const ISC_RET_STREAM = @as(u32, 32768); pub const ISC_RET_INTEGRITY = @as(u32, 65536); pub const ISC_RET_IDENTIFY = @as(u32, 131072); pub const ISC_RET_NULL_SESSION = @as(u32, 262144); pub const ISC_RET_MANUAL_CRED_VALIDATION = @as(u32, 524288); pub const ISC_RET_RESERVED1 = @as(u32, 1048576); pub const ISC_RET_FRAGMENT_ONLY = @as(u32, 2097152); pub const ISC_RET_FORWARD_CREDENTIALS = @as(u32, 4194304); pub const ISC_RET_USED_HTTP_STYLE = @as(u32, 16777216); pub const ISC_RET_NO_ADDITIONAL_TOKEN = @as(u32, 33554432); pub const ISC_RET_REAUTHENTICATION = @as(u32, 134217728); pub const ISC_RET_CONFIDENTIALITY_ONLY = @as(u32, 1073741824); pub const ISC_RET_MESSAGES = @as(u64, 4294967296); pub const ASC_REQ_MUTUAL_AUTH = @as(u32, 2); pub const ASC_REQ_CONFIDENTIALITY = @as(u32, 16); pub const ASC_REQ_USE_SESSION_KEY = @as(u32, 32); pub const ASC_REQ_SESSION_TICKET = @as(u32, 64); pub const ASC_REQ_USE_DCE_STYLE = @as(u32, 512); pub const ASC_REQ_DATAGRAM = @as(u32, 1024); pub const ASC_REQ_CALL_LEVEL = @as(u32, 4096); pub const ASC_REQ_FRAGMENT_SUPPLIED = @as(u32, 8192); pub const ASC_REQ_INTEGRITY = @as(u32, 131072); pub const ASC_REQ_LICENSING = @as(u32, 262144); pub const ASC_REQ_IDENTIFY = @as(u32, 524288); pub const ASC_REQ_ALLOW_NULL_SESSION = @as(u32, 1048576); pub const ASC_REQ_ALLOW_NON_USER_LOGONS = @as(u32, 2097152); pub const ASC_REQ_ALLOW_CONTEXT_REPLAY = @as(u32, 4194304); pub const ASC_REQ_FRAGMENT_TO_FIT = @as(u32, 8388608); pub const ASC_REQ_NO_TOKEN = @as(u32, 16777216); pub const ASC_REQ_PROXY_BINDINGS = @as(u32, 67108864); pub const ASC_REQ_ALLOW_MISSING_BINDINGS = @as(u32, 268435456); pub const ASC_REQ_MESSAGES = @as(u64, 4294967296); pub const ASC_RET_DELEGATE = @as(u32, 1); pub const ASC_RET_MUTUAL_AUTH = @as(u32, 2); pub const ASC_RET_REPLAY_DETECT = @as(u32, 4); pub const ASC_RET_SEQUENCE_DETECT = @as(u32, 8); pub const ASC_RET_CONFIDENTIALITY = @as(u32, 16); pub const ASC_RET_USE_SESSION_KEY = @as(u32, 32); pub const ASC_RET_SESSION_TICKET = @as(u32, 64); pub const ASC_RET_ALLOCATED_MEMORY = @as(u32, 256); pub const ASC_RET_USED_DCE_STYLE = @as(u32, 512); pub const ASC_RET_DATAGRAM = @as(u32, 1024); pub const ASC_RET_CONNECTION = @as(u32, 2048); pub const ASC_RET_CALL_LEVEL = @as(u32, 8192); pub const ASC_RET_THIRD_LEG_FAILED = @as(u32, 16384); pub const ASC_RET_EXTENDED_ERROR = @as(u32, 32768); pub const ASC_RET_STREAM = @as(u32, 65536); pub const ASC_RET_INTEGRITY = @as(u32, 131072); pub const ASC_RET_LICENSING = @as(u32, 262144); pub const ASC_RET_IDENTIFY = @as(u32, 524288); pub const ASC_RET_NULL_SESSION = @as(u32, 1048576); pub const ASC_RET_ALLOW_NON_USER_LOGONS = @as(u32, 2097152); pub const ASC_RET_ALLOW_CONTEXT_REPLAY = @as(u32, 4194304); pub const ASC_RET_FRAGMENT_ONLY = @as(u32, 8388608); pub const ASC_RET_NO_TOKEN = @as(u32, 16777216); pub const ASC_RET_NO_ADDITIONAL_TOKEN = @as(u32, 33554432); pub const ASC_RET_MESSAGES = @as(u64, 4294967296); pub const SECPKG_CRED_ATTR_NAMES = @as(u32, 1); pub const SECPKG_CRED_ATTR_SSI_PROVIDER = @as(u32, 2); pub const SECPKG_CRED_ATTR_KDC_PROXY_SETTINGS = @as(u32, 3); pub const SECPKG_CRED_ATTR_CERT = @as(u32, 4); pub const SECPKG_CRED_ATTR_PAC_BYPASS = @as(u32, 5); pub const KDC_PROXY_SETTINGS_V1 = @as(u32, 1); pub const KDC_PROXY_SETTINGS_FLAGS_FORCEPROXY = @as(u32, 1); pub const SECPKG_ATTR_PROTO_INFO = @as(u32, 7); pub const SECPKG_ATTR_USER_FLAGS = @as(u32, 11); pub const SECPKG_ATTR_USE_VALIDATED = @as(u32, 15); pub const SECPKG_ATTR_CREDENTIAL_NAME = @as(u32, 16); pub const SECPKG_ATTR_TARGET = @as(u32, 19); pub const SECPKG_ATTR_AUTHENTICATION_ID = @as(u32, 20); pub const SECPKG_ATTR_LOGOFF_TIME = @as(u32, 21); pub const SECPKG_ATTR_NEGO_KEYS = @as(u32, 22); pub const SECPKG_ATTR_PROMPTING_NEEDED = @as(u32, 24); pub const SECPKG_ATTR_NEGO_PKG_INFO = @as(u32, 31); pub const SECPKG_ATTR_NEGO_STATUS = @as(u32, 32); pub const SECPKG_ATTR_CONTEXT_DELETED = @as(u32, 33); pub const SECPKG_ATTR_APPLICATION_PROTOCOL = @as(u32, 35); pub const SECPKG_ATTR_NEGOTIATED_TLS_EXTENSIONS = @as(u32, 36); pub const SECPKG_ATTR_IS_LOOPBACK = @as(u32, 37); pub const SECPKG_ATTR_NEGO_INFO_FLAG_NO_KERBEROS = @as(u32, 1); pub const SECPKG_ATTR_NEGO_INFO_FLAG_NO_NTLM = @as(u32, 2); pub const SECPKG_NEGOTIATION_COMPLETE = @as(u32, 0); pub const SECPKG_NEGOTIATION_OPTIMISTIC = @as(u32, 1); pub const SECPKG_NEGOTIATION_IN_PROGRESS = @as(u32, 2); pub const SECPKG_NEGOTIATION_DIRECT = @as(u32, 3); pub const SECPKG_NEGOTIATION_TRY_MULTICRED = @as(u32, 4); pub const MAX_PROTOCOL_ID_SIZE = @as(u32, 255); pub const SECQOP_WRAP_NO_ENCRYPT = @as(u32, 2147483649); pub const SECQOP_WRAP_OOB_DATA = @as(u32, 1073741824); pub const SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION = @as(u32, 1); pub const SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_2 = @as(u32, 2); pub const SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_3 = @as(u32, 3); pub const SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_4 = @as(u32, 4); pub const SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_5 = @as(u32, 5); pub const SASL_OPTION_SEND_SIZE = @as(u32, 1); pub const SASL_OPTION_RECV_SIZE = @as(u32, 2); pub const SASL_OPTION_AUTHZ_STRING = @as(u32, 3); pub const SASL_OPTION_AUTHZ_PROCESSING = @as(u32, 4); pub const SEC_WINNT_AUTH_IDENTITY_VERSION_2 = @as(u32, 513); pub const SEC_WINNT_AUTH_IDENTITY_VERSION = @as(u32, 512); pub const SEC_WINNT_AUTH_IDENTITY_FLAGS_PROCESS_ENCRYPTED = @as(u32, 16); pub const SEC_WINNT_AUTH_IDENTITY_FLAGS_SYSTEM_PROTECTED = @as(u32, 32); pub const SEC_WINNT_AUTH_IDENTITY_FLAGS_USER_PROTECTED = @as(u32, 64); pub const SEC_WINNT_AUTH_IDENTITY_FLAGS_SYSTEM_ENCRYPTED = @as(u32, 128); pub const SEC_WINNT_AUTH_IDENTITY_FLAGS_RESERVED = @as(u32, 65536); pub const SEC_WINNT_AUTH_IDENTITY_FLAGS_NULL_USER = @as(u32, 131072); pub const SEC_WINNT_AUTH_IDENTITY_FLAGS_NULL_DOMAIN = @as(u32, 262144); pub const SEC_WINNT_AUTH_IDENTITY_FLAGS_ID_PROVIDER = @as(u32, 524288); pub const SEC_WINNT_AUTH_IDENTITY_FLAGS_SSPIPFC_USE_MASK = @as(u32, 4278190080); pub const SEC_WINNT_AUTH_IDENTITY_FLAGS_SSPIPFC_CREDPROV_DO_NOT_SAVE = @as(u32, 2147483648); pub const SEC_WINNT_AUTH_IDENTITY_FLAGS_SSPIPFC_SAVE_CRED_CHECKED = @as(u32, 1073741824); pub const SEC_WINNT_AUTH_IDENTITY_FLAGS_SSPIPFC_NO_CHECKBOX = @as(u32, 536870912); pub const SEC_WINNT_AUTH_IDENTITY_FLAGS_SSPIPFC_CREDPROV_DO_NOT_LOAD = @as(u32, 268435456); pub const SSPIPFC_CREDPROV_DO_NOT_SAVE = @as(u32, 1); pub const SSPIPFC_NO_CHECKBOX = @as(u32, 2); pub const SSPIPFC_CREDPROV_DO_NOT_LOAD = @as(u32, 4); pub const SSPIPFC_USE_CREDUIBROKER = @as(u32, 8); pub const NGC_DATA_FLAG_KERB_CERTIFICATE_LOGON_FLAG_CHECK_DUPLICATES = @as(u32, 1); pub const NGC_DATA_FLAG_KERB_CERTIFICATE_LOGON_FLAG_USE_CERTIFICATE_INFO = @as(u32, 2); pub const NGC_DATA_FLAG_IS_SMARTCARD_DATA = @as(u32, 4); pub const SEC_WINNT_AUTH_IDENTITY_ENCRYPT_SAME_LOGON = @as(u32, 1); pub const SEC_WINNT_AUTH_IDENTITY_ENCRYPT_SAME_PROCESS = @as(u32, 2); pub const SEC_WINNT_AUTH_IDENTITY_ENCRYPT_FOR_SYSTEM = @as(u32, 4); pub const SEC_WINNT_AUTH_IDENTITY_MARSHALLED = @as(u32, 4); pub const SEC_WINNT_AUTH_IDENTITY_ONLY = @as(u32, 8); pub const SECPKG_OPTIONS_PERMANENT = @as(u32, 1); pub const LOOKUP_VIEW_LOCAL_INFORMATION = @as(u32, 1); pub const LOOKUP_TRANSLATE_NAMES = @as(u32, 2048); pub const SECPKG_ATTR_ISSUER_LIST = @as(u32, 80); pub const SECPKG_ATTR_REMOTE_CRED = @as(u32, 81); pub const SECPKG_ATTR_SUPPORTED_ALGS = @as(u32, 86); pub const SECPKG_ATTR_CIPHER_STRENGTHS = @as(u32, 87); pub const SECPKG_ATTR_SUPPORTED_PROTOCOLS = @as(u32, 88); pub const SECPKG_ATTR_MAPPED_CRED_ATTR = @as(u32, 92); pub const SECPKG_ATTR_REMOTE_CERTIFICATES = @as(u32, 95); pub const SECPKG_ATTR_CLIENT_CERT_POLICY = @as(u32, 96); pub const SECPKG_ATTR_CC_POLICY_RESULT = @as(u32, 97); pub const SECPKG_ATTR_USE_NCRYPT = @as(u32, 98); pub const SECPKG_ATTR_LOCAL_CERT_INFO = @as(u32, 99); pub const SECPKG_ATTR_CIPHER_INFO = @as(u32, 100); pub const SECPKG_ATTR_REMOTE_CERT_CHAIN = @as(u32, 103); pub const SECPKG_ATTR_UI_INFO = @as(u32, 104); pub const SECPKG_ATTR_KEYING_MATERIAL = @as(u32, 107); pub const SECPKG_ATTR_SRTP_PARAMETERS = @as(u32, 108); pub const SECPKG_ATTR_TOKEN_BINDING = @as(u32, 109); pub const SECPKG_ATTR_CONNECTION_INFO_EX = @as(u32, 110); pub const SECPKG_ATTR_KEYING_MATERIAL_TOKEN_BINDING = @as(u32, 111); pub const SECPKG_ATTR_KEYING_MATERIAL_INPROC = @as(u32, 112); pub const LSA_MODE_PASSWORD_PROTECTED = @as(i32, 1); pub const LSA_MODE_INDIVIDUAL_ACCOUNTS = @as(i32, 2); pub const LSA_MODE_MANDATORY_ACCESS = @as(i32, 4); pub const LSA_MODE_LOG_FULL = @as(i32, 8); pub const LSA_MAXIMUM_SID_COUNT = @as(i32, 256); pub const LSA_MAXIMUM_ENUMERATION_LENGTH = @as(u32, 32000); pub const LSA_CALL_LICENSE_SERVER = @as(u32, 2147483648); pub const SE_ADT_OBJECT_ONLY = @as(u32, 1); pub const SE_MAX_AUDIT_PARAMETERS = @as(u32, 32); pub const SE_MAX_GENERIC_AUDIT_PARAMETERS = @as(u32, 28); pub const SE_ADT_PARAMETERS_SELF_RELATIVE = @as(u32, 1); pub const SE_ADT_PARAMETERS_SEND_TO_LSA = @as(u32, 2); pub const SE_ADT_PARAMETER_EXTENSIBLE_AUDIT = @as(u32, 4); pub const SE_ADT_PARAMETER_GENERIC_AUDIT = @as(u32, 8); pub const SE_ADT_PARAMETER_WRITE_SYNCHRONOUS = @as(u32, 16); pub const SE_ADT_POLICY_AUDIT_EVENT_TYPE_EX_BEGIN = @as(u32, 100); pub const POLICY_AUDIT_EVENT_UNCHANGED = @as(i32, 0); pub const POLICY_AUDIT_EVENT_SUCCESS = @as(i32, 1); pub const POLICY_AUDIT_EVENT_FAILURE = @as(i32, 2); pub const POLICY_AUDIT_EVENT_NONE = @as(i32, 4); pub const POLICY_VIEW_LOCAL_INFORMATION = @as(i32, 1); pub const POLICY_VIEW_AUDIT_INFORMATION = @as(i32, 2); pub const POLICY_GET_PRIVATE_INFORMATION = @as(i32, 4); pub const POLICY_TRUST_ADMIN = @as(i32, 8); pub const POLICY_CREATE_ACCOUNT = @as(i32, 16); pub const POLICY_CREATE_SECRET = @as(i32, 32); pub const POLICY_CREATE_PRIVILEGE = @as(i32, 64); pub const POLICY_SET_DEFAULT_QUOTA_LIMITS = @as(i32, 128); pub const POLICY_SET_AUDIT_REQUIREMENTS = @as(i32, 256); pub const POLICY_AUDIT_LOG_ADMIN = @as(i32, 512); pub const POLICY_SERVER_ADMIN = @as(i32, 1024); pub const POLICY_LOOKUP_NAMES = @as(i32, 2048); pub const POLICY_NOTIFICATION = @as(i32, 4096); pub const LSA_LOOKUP_ISOLATED_AS_LOCAL = @as(u32, 2147483648); pub const LSA_LOOKUP_DISALLOW_CONNECTED_ACCOUNT_INTERNET_SID = @as(u32, 2147483648); pub const LSA_LOOKUP_PREFER_INTERNET_NAMES = @as(u32, 1073741824); pub const PER_USER_POLICY_UNCHANGED = @as(u32, 0); pub const PER_USER_AUDIT_SUCCESS_INCLUDE = @as(u32, 1); pub const PER_USER_AUDIT_SUCCESS_EXCLUDE = @as(u32, 2); pub const PER_USER_AUDIT_FAILURE_INCLUDE = @as(u32, 4); pub const PER_USER_AUDIT_FAILURE_EXCLUDE = @as(u32, 8); pub const PER_USER_AUDIT_NONE = @as(u32, 16); pub const POLICY_QOS_SCHANNEL_REQUIRED = @as(u32, 1); pub const POLICY_QOS_OUTBOUND_INTEGRITY = @as(u32, 2); pub const POLICY_QOS_OUTBOUND_CONFIDENTIALITY = @as(u32, 4); pub const POLICY_QOS_INBOUND_INTEGRITY = @as(u32, 8); pub const POLICY_QOS_INBOUND_CONFIDENTIALITY = @as(u32, 16); pub const POLICY_QOS_ALLOW_LOCAL_ROOT_CERT_STORE = @as(u32, 32); pub const POLICY_QOS_RAS_SERVER_ALLOWED = @as(u32, 64); pub const POLICY_QOS_DHCP_SERVER_ALLOWED = @as(u32, 128); pub const POLICY_KERBEROS_VALIDATE_CLIENT = @as(u32, 128); pub const ACCOUNT_VIEW = @as(i32, 1); pub const ACCOUNT_ADJUST_PRIVILEGES = @as(i32, 2); pub const ACCOUNT_ADJUST_QUOTAS = @as(i32, 4); pub const ACCOUNT_ADJUST_SYSTEM_ACCESS = @as(i32, 8); pub const TRUSTED_QUERY_DOMAIN_NAME = @as(i32, 1); pub const TRUSTED_QUERY_CONTROLLERS = @as(i32, 2); pub const TRUSTED_SET_CONTROLLERS = @as(i32, 4); pub const TRUSTED_QUERY_POSIX = @as(i32, 8); pub const TRUSTED_SET_POSIX = @as(i32, 16); pub const TRUSTED_SET_AUTH = @as(i32, 32); pub const TRUSTED_QUERY_AUTH = @as(i32, 64); pub const TRUST_ATTRIBUTE_TREE_PARENT = @as(u32, 4194304); pub const TRUST_ATTRIBUTE_TREE_ROOT = @as(u32, 8388608); pub const TRUST_ATTRIBUTES_VALID = @as(u32, 4278386687); pub const TRUST_ATTRIBUTE_QUARANTINED_DOMAIN = @as(u32, 4); pub const TRUST_ATTRIBUTE_TRUST_USES_RC4_ENCRYPTION = @as(u32, 128); pub const TRUST_ATTRIBUTE_TRUST_USES_AES_KEYS = @as(u32, 256); pub const TRUST_ATTRIBUTE_CROSS_ORGANIZATION_NO_TGT_DELEGATION = @as(u32, 512); pub const TRUST_ATTRIBUTE_PIM_TRUST = @as(u32, 1024); pub const TRUST_ATTRIBUTE_CROSS_ORGANIZATION_ENABLE_TGT_DELEGATION = @as(u32, 2048); pub const TRUST_ATTRIBUTES_USER = @as(u32, 4278190080); pub const LSA_FOREST_TRUST_RECORD_TYPE_UNRECOGNIZED = @as(u32, 2147483648); pub const LSA_FTRECORD_DISABLED_REASONS = @as(i32, 65535); pub const LSA_TLN_DISABLED_NEW = @as(i32, 1); pub const LSA_TLN_DISABLED_ADMIN = @as(i32, 2); pub const LSA_TLN_DISABLED_CONFLICT = @as(i32, 4); pub const LSA_SID_DISABLED_ADMIN = @as(i32, 1); pub const LSA_SID_DISABLED_CONFLICT = @as(i32, 2); pub const LSA_NB_DISABLED_ADMIN = @as(i32, 4); pub const LSA_NB_DISABLED_CONFLICT = @as(i32, 8); pub const MAX_RECORDS_IN_FOREST_TRUST_INFO = @as(u32, 4000); pub const SECRET_SET_VALUE = @as(i32, 1); pub const SECRET_QUERY_VALUE = @as(i32, 2); pub const LSA_GLOBAL_SECRET_PREFIX_LENGTH = @as(u32, 2); pub const LSA_LOCAL_SECRET_PREFIX_LENGTH = @as(u32, 2); pub const LSA_SECRET_MAXIMUM_COUNT = @as(i32, 4096); pub const LSA_SECRET_MAXIMUM_LENGTH = @as(i32, 512); pub const MAXIMUM_CAPES_PER_CAP = @as(u32, 127); pub const CENTRAL_ACCESS_POLICY_OWNER_RIGHTS_PRESENT_FLAG = @as(u32, 1); pub const CENTRAL_ACCESS_POLICY_STAGED_OWNER_RIGHTS_PRESENT_FLAG = @as(u32, 256); pub const CENTRAL_ACCESS_POLICY_STAGED_FLAG = @as(u32, 65536); pub const LSASETCAPS_RELOAD_FLAG = @as(u32, 1); pub const NEGOTIATE_MAX_PREFIX = @as(u32, 32); pub const NEGOTIATE_ALLOW_NTLM = @as(u32, 268435456); pub const NEGOTIATE_NEG_NTLM = @as(u32, 536870912); pub const MAX_USER_RECORDS = @as(u32, 1000); pub const Audit_System_SecurityStateChange = Guid.initString("0cce9210-69ae-11d9-bed3-505054503030"); pub const Audit_System_SecuritySubsystemExtension = Guid.initString("0cce9211-69ae-11d9-bed3-505054503030"); pub const Audit_System_Integrity = Guid.initString("0cce9212-69ae-11d9-bed3-505054503030"); pub const Audit_System_IPSecDriverEvents = Guid.initString("0cce9213-69ae-11d9-bed3-505054503030"); pub const Audit_System_Others = Guid.initString("0cce9214-69ae-11d9-bed3-505054503030"); pub const Audit_Logon_Logon = Guid.initString("0cce9215-69ae-11d9-bed3-505054503030"); pub const Audit_Logon_Logoff = Guid.initString("0cce9216-69ae-11d9-bed3-505054503030"); pub const Audit_Logon_AccountLockout = Guid.initString("0cce9217-69ae-11d9-bed3-505054503030"); pub const Audit_Logon_IPSecMainMode = Guid.initString("0cce9218-69ae-11d9-bed3-505054503030"); pub const Audit_Logon_IPSecQuickMode = Guid.initString("0cce9219-69ae-11d9-bed3-505054503030"); pub const Audit_Logon_IPSecUserMode = Guid.initString("0cce921a-69ae-11d9-bed3-505054503030"); pub const Audit_Logon_SpecialLogon = Guid.initString("0cce921b-69ae-11d9-bed3-505054503030"); pub const Audit_Logon_Others = Guid.initString("0cce921c-69ae-11d9-bed3-505054503030"); pub const Audit_ObjectAccess_FileSystem = Guid.initString("0cce921d-69ae-11d9-bed3-505054503030"); pub const Audit_ObjectAccess_Registry = Guid.initString("0cce921e-69ae-11d9-bed3-505054503030"); pub const Audit_ObjectAccess_Kernel = Guid.initString("0cce921f-69ae-11d9-bed3-505054503030"); pub const Audit_ObjectAccess_Sam = Guid.initString("0cce9220-69ae-11d9-bed3-505054503030"); pub const Audit_ObjectAccess_CertificationServices = Guid.initString("0cce9221-69ae-11d9-bed3-505054503030"); pub const Audit_ObjectAccess_ApplicationGenerated = Guid.initString("0cce9222-69ae-11d9-bed3-505054503030"); pub const Audit_ObjectAccess_Handle = Guid.initString("0cce9223-69ae-11d9-bed3-505054503030"); pub const Audit_ObjectAccess_Share = Guid.initString("0cce9224-69ae-11d9-bed3-505054503030"); pub const Audit_ObjectAccess_FirewallPacketDrops = Guid.initString("0cce9225-69ae-11d9-bed3-505054503030"); pub const Audit_ObjectAccess_FirewallConnection = Guid.initString("0cce9226-69ae-11d9-bed3-505054503030"); pub const Audit_ObjectAccess_Other = Guid.initString("0cce9227-69ae-11d9-bed3-505054503030"); pub const Audit_PrivilegeUse_Sensitive = Guid.initString("0cce9228-69ae-11d9-bed3-505054503030"); pub const Audit_PrivilegeUse_NonSensitive = Guid.initString("0cce9229-69ae-11d9-bed3-505054503030"); pub const Audit_PrivilegeUse_Others = Guid.initString("0cce922a-69ae-11d9-bed3-505054503030"); pub const Audit_DetailedTracking_ProcessCreation = Guid.initString("0cce922b-69ae-11d9-bed3-505054503030"); pub const Audit_DetailedTracking_ProcessTermination = Guid.initString("0cce922c-69ae-11d9-bed3-505054503030"); pub const Audit_DetailedTracking_DpapiActivity = Guid.initString("0cce922d-69ae-11d9-bed3-505054503030"); pub const Audit_DetailedTracking_RpcCall = Guid.initString("0cce922e-69ae-11d9-bed3-505054503030"); pub const Audit_PolicyChange_AuditPolicy = Guid.initString("0cce922f-69ae-11d9-bed3-505054503030"); pub const Audit_PolicyChange_AuthenticationPolicy = Guid.initString("0cce9230-69ae-11d9-bed3-505054503030"); pub const Audit_PolicyChange_AuthorizationPolicy = Guid.initString("0cce9231-69ae-11d9-bed3-505054503030"); pub const Audit_PolicyChange_MpsscvRulePolicy = Guid.initString("0cce9232-69ae-11d9-bed3-505054503030"); pub const Audit_PolicyChange_WfpIPSecPolicy = Guid.initString("0cce9233-69ae-11d9-bed3-505054503030"); pub const Audit_PolicyChange_Others = Guid.initString("0cce9234-69ae-11d9-bed3-505054503030"); pub const Audit_AccountManagement_UserAccount = Guid.initString("0cce9235-69ae-11d9-bed3-505054503030"); pub const Audit_AccountManagement_ComputerAccount = Guid.initString("0cce9236-69ae-11d9-bed3-505054503030"); pub const Audit_AccountManagement_SecurityGroup = Guid.initString("0cce9237-69ae-11d9-bed3-505054503030"); pub const Audit_AccountManagement_DistributionGroup = Guid.initString("0cce9238-69ae-11d9-bed3-505054503030"); pub const Audit_AccountManagement_ApplicationGroup = Guid.initString("0cce9239-69ae-11d9-bed3-505054503030"); pub const Audit_AccountManagement_Others = Guid.initString("0cce923a-69ae-11d9-bed3-505054503030"); pub const Audit_DSAccess_DSAccess = Guid.initString("0cce923b-69ae-11d9-bed3-505054503030"); pub const Audit_DsAccess_AdAuditChanges = Guid.initString("0cce923c-69ae-11d9-bed3-505054503030"); pub const Audit_Ds_Replication = Guid.initString("0cce923d-69ae-11d9-bed3-505054503030"); pub const Audit_Ds_DetailedReplication = Guid.initString("0cce923e-69ae-11d9-bed3-505054503030"); pub const Audit_AccountLogon_CredentialValidation = Guid.initString("0cce923f-69ae-11d9-bed3-505054503030"); pub const Audit_AccountLogon_Kerberos = Guid.initString("0cce9240-69ae-11d9-bed3-505054503030"); pub const Audit_AccountLogon_Others = Guid.initString("0cce9241-69ae-11d9-bed3-505054503030"); pub const Audit_AccountLogon_KerbCredentialValidation = Guid.initString("0cce9242-69ae-11d9-bed3-505054503030"); pub const Audit_Logon_NPS = Guid.initString("0cce9243-69ae-11d9-bed3-505054503030"); pub const Audit_ObjectAccess_DetailedFileShare = Guid.initString("0cce9244-69ae-11d9-bed3-505054503030"); pub const Audit_ObjectAccess_RemovableStorage = Guid.initString("0cce9245-69ae-11d9-bed3-505054503030"); pub const Audit_ObjectAccess_CbacStaging = Guid.initString("0cce9246-69ae-11d9-bed3-505054503030"); pub const Audit_Logon_Claims = Guid.initString("0cce9247-69ae-11d9-bed3-505054503030"); pub const Audit_DetailedTracking_PnpActivity = Guid.initString("0cce9248-69ae-11d9-bed3-505054503030"); pub const Audit_Logon_Groups = Guid.initString("0cce9249-69ae-11d9-bed3-505054503030"); pub const Audit_DetailedTracking_TokenRightAdjusted = Guid.initString("0cce924a-69ae-11d9-bed3-505054503030"); pub const Audit_System = Guid.initString("69979848-797a-11d9-bed3-505054503030"); pub const Audit_Logon = Guid.initString("69979849-797a-11d9-bed3-505054503030"); pub const Audit_ObjectAccess = Guid.initString("6997984a-797a-11d9-bed3-505054503030"); pub const Audit_PrivilegeUse = Guid.initString("6997984b-797a-11d9-bed3-505054503030"); pub const Audit_DetailedTracking = Guid.initString("6997984c-797a-11d9-bed3-505054503030"); pub const Audit_PolicyChange = Guid.initString("6997984d-797a-11d9-bed3-505054503030"); pub const Audit_AccountManagement = Guid.initString("6997984e-797a-11d9-bed3-505054503030"); pub const Audit_DirectoryServiceAccess = Guid.initString("6997984f-797a-11d9-bed3-505054503030"); pub const Audit_AccountLogon = Guid.initString("69979850-797a-11d9-bed3-505054503030"); pub const DOMAIN_NO_LM_OWF_CHANGE = @as(i32, 64); pub const MSV1_0_CHALLENGE_LENGTH = @as(u32, 8); pub const MSV1_0_USER_SESSION_KEY_LENGTH = @as(u32, 16); pub const MSV1_0_LANMAN_SESSION_KEY_LENGTH = @as(u32, 8); pub const MSV1_0_USE_CLIENT_CHALLENGE = @as(u32, 128); pub const MSV1_0_DISABLE_PERSONAL_FALLBACK = @as(u32, 4096); pub const MSV1_0_ALLOW_FORCE_GUEST = @as(u32, 8192); pub const MSV1_0_CLEARTEXT_PASSWORD_SUPPLIED = @as(u32, 16384); pub const MSV1_0_USE_DOMAIN_FOR_ROUTING_ONLY = @as(u32, 32768); pub const MSV1_0_SUBAUTHENTICATION_DLL_EX = @as(u32, 1048576); pub const MSV1_0_ALLOW_MSVCHAPV2 = @as(u32, 65536); pub const MSV1_0_S4U2SELF = @as(u32, 131072); pub const MSV1_0_CHECK_LOGONHOURS_FOR_S4U = @as(u32, 262144); pub const MSV1_0_INTERNET_DOMAIN = @as(u32, 524288); pub const MSV1_0_SUBAUTHENTICATION_DLL = @as(u32, 4278190080); pub const MSV1_0_SUBAUTHENTICATION_DLL_SHIFT = @as(u32, 24); pub const MSV1_0_MNS_LOGON = @as(u32, 16777216); pub const MSV1_0_SUBAUTHENTICATION_DLL_RAS = @as(u32, 2); pub const MSV1_0_SUBAUTHENTICATION_DLL_IIS = @as(u32, 132); pub const MSV1_0_S4U_LOGON_FLAG_CHECK_LOGONHOURS = @as(u32, 2); pub const LOGON_NTLMV2_ENABLED = @as(u32, 256); pub const LOGON_NT_V2 = @as(u32, 2048); pub const LOGON_LM_V2 = @as(u32, 4096); pub const LOGON_NTLM_V2 = @as(u32, 8192); pub const LOGON_OPTIMIZED = @as(u32, 16384); pub const LOGON_WINLOGON = @as(u32, 32768); pub const LOGON_PKINIT = @as(u32, 65536); pub const LOGON_NO_OPTIMIZED = @as(u32, 131072); pub const LOGON_NO_ELEVATION = @as(u32, 262144); pub const LOGON_MANAGED_SERVICE = @as(u32, 524288); pub const MSV1_0_SUBAUTHENTICATION_FLAGS = @as(u32, 4278190080); pub const LOGON_GRACE_LOGON = @as(u32, 16777216); pub const MSV1_0_OWF_PASSWORD_LENGTH = @as(u32, 16); pub const MSV1_0_SHA_PASSWORD_LENGTH = @as(u32, 20); pub const MSV1_0_CREDENTIAL_KEY_LENGTH = @as(u32, 20); pub const MSV1_0_CRED_REMOVED = @as(u32, 4); pub const MSV1_0_CRED_CREDKEY_PRESENT = @as(u32, 8); pub const MSV1_0_CRED_SHA_PRESENT = @as(u32, 16); pub const MSV1_0_CRED_VERSION_V2 = @as(u32, 2); pub const MSV1_0_CRED_VERSION_V3 = @as(u32, 4); pub const MSV1_0_CRED_VERSION_IUM = @as(u32, 4294901761); pub const MSV1_0_CRED_VERSION_REMOTE = @as(u32, 4294901762); pub const MSV1_0_CRED_VERSION_ARSO = @as(u32, 4294901763); pub const MSV1_0_CRED_VERSION_RESERVED_1 = @as(u32, 4294967294); pub const MSV1_0_CRED_VERSION_INVALID = @as(u32, 4294967295); pub const MSV1_0_NTLM3_RESPONSE_LENGTH = @as(u32, 16); pub const MSV1_0_NTLM3_OWF_LENGTH = @as(u32, 16); pub const MSV1_0_MAX_NTLM3_LIFE = @as(u32, 1800); pub const MSV1_0_MAX_AVL_SIZE = @as(u32, 64000); pub const MSV1_0_AV_FLAG_FORCE_GUEST = @as(u32, 1); pub const MSV1_0_AV_FLAG_MIC_HANDSHAKE_MESSAGES = @as(u32, 2); pub const MSV1_0_AV_FLAG_UNVERIFIED_TARGET = @as(u32, 4); pub const RTL_ENCRYPT_MEMORY_SIZE = @as(u32, 8); pub const RTL_ENCRYPT_OPTION_CROSS_PROCESS = @as(u32, 1); pub const RTL_ENCRYPT_OPTION_SAME_LOGON = @as(u32, 2); pub const RTL_ENCRYPT_OPTION_FOR_SYSTEM = @as(u32, 4); pub const KERBEROS_VERSION = @as(u32, 5); pub const KERBEROS_REVISION = @as(u32, 6); pub const KERB_ETYPE_AES128_CTS_HMAC_SHA1_96 = @as(u32, 17); pub const KERB_ETYPE_AES256_CTS_HMAC_SHA1_96 = @as(u32, 18); pub const KERB_ETYPE_RC4_PLAIN2 = @as(i32, -129); pub const KERB_ETYPE_RC4_LM = @as(i32, -130); pub const KERB_ETYPE_RC4_SHA = @as(i32, -131); pub const KERB_ETYPE_DES_PLAIN = @as(i32, -132); pub const KERB_ETYPE_RC4_HMAC_OLD = @as(i32, -133); pub const KERB_ETYPE_RC4_PLAIN_OLD = @as(i32, -134); pub const KERB_ETYPE_RC4_HMAC_OLD_EXP = @as(i32, -135); pub const KERB_ETYPE_RC4_PLAIN_OLD_EXP = @as(i32, -136); pub const KERB_ETYPE_RC4_PLAIN = @as(i32, -140); pub const KERB_ETYPE_RC4_PLAIN_EXP = @as(i32, -141); pub const KERB_ETYPE_AES128_CTS_HMAC_SHA1_96_PLAIN = @as(i32, -148); pub const KERB_ETYPE_AES256_CTS_HMAC_SHA1_96_PLAIN = @as(i32, -149); pub const KERB_ETYPE_DSA_SHA1_CMS = @as(u32, 9); pub const KERB_ETYPE_RSA_MD5_CMS = @as(u32, 10); pub const KERB_ETYPE_RSA_SHA1_CMS = @as(u32, 11); pub const KERB_ETYPE_RC2_CBC_ENV = @as(u32, 12); pub const KERB_ETYPE_RSA_ENV = @as(u32, 13); pub const KERB_ETYPE_RSA_ES_OEAP_ENV = @as(u32, 14); pub const KERB_ETYPE_DES_EDE3_CBC_ENV = @as(u32, 15); pub const KERB_ETYPE_DSA_SIGN = @as(u32, 8); pub const KERB_ETYPE_RSA_PRIV = @as(u32, 9); pub const KERB_ETYPE_RSA_PUB = @as(u32, 10); pub const KERB_ETYPE_RSA_PUB_MD5 = @as(u32, 11); pub const KERB_ETYPE_RSA_PUB_SHA1 = @as(u32, 12); pub const KERB_ETYPE_PKCS7_PUB = @as(u32, 13); pub const KERB_ETYPE_DES3_CBC_MD5 = @as(u32, 5); pub const KERB_ETYPE_DES3_CBC_SHA1 = @as(u32, 7); pub const KERB_ETYPE_DES3_CBC_SHA1_KD = @as(u32, 16); pub const KERB_ETYPE_DES_CBC_MD5_NT = @as(u32, 20); pub const KERB_ETYPE_RC4_HMAC_NT_EXP = @as(u32, 24); pub const KERB_CHECKSUM_NONE = @as(u32, 0); pub const KERB_CHECKSUM_CRC32 = @as(u32, 1); pub const KERB_CHECKSUM_MD4 = @as(u32, 2); pub const KERB_CHECKSUM_KRB_DES_MAC = @as(u32, 4); pub const KERB_CHECKSUM_KRB_DES_MAC_K = @as(u32, 5); pub const KERB_CHECKSUM_MD5 = @as(u32, 7); pub const KERB_CHECKSUM_MD5_DES = @as(u32, 8); pub const KERB_CHECKSUM_SHA1_NEW = @as(u32, 14); pub const KERB_CHECKSUM_HMAC_SHA1_96_AES128 = @as(u32, 15); pub const KERB_CHECKSUM_HMAC_SHA1_96_AES256 = @as(u32, 16); pub const KERB_CHECKSUM_LM = @as(i32, -130); pub const KERB_CHECKSUM_SHA1 = @as(i32, -131); pub const KERB_CHECKSUM_REAL_CRC32 = @as(i32, -132); pub const KERB_CHECKSUM_DES_MAC = @as(i32, -133); pub const KERB_CHECKSUM_DES_MAC_MD5 = @as(i32, -134); pub const KERB_CHECKSUM_MD25 = @as(i32, -135); pub const KERB_CHECKSUM_RC4_MD5 = @as(i32, -136); pub const KERB_CHECKSUM_MD5_HMAC = @as(i32, -137); pub const KERB_CHECKSUM_HMAC_MD5 = @as(i32, -138); pub const KERB_CHECKSUM_HMAC_SHA1_96_AES128_Ki = @as(i32, -150); pub const KERB_CHECKSUM_HMAC_SHA1_96_AES256_Ki = @as(i32, -151); pub const AUTH_REQ_ALLOW_FORWARDABLE = @as(u32, 1); pub const AUTH_REQ_ALLOW_PROXIABLE = @as(u32, 2); pub const AUTH_REQ_ALLOW_POSTDATE = @as(u32, 4); pub const AUTH_REQ_ALLOW_RENEWABLE = @as(u32, 8); pub const AUTH_REQ_ALLOW_NOADDRESS = @as(u32, 16); pub const AUTH_REQ_ALLOW_ENC_TKT_IN_SKEY = @as(u32, 32); pub const AUTH_REQ_ALLOW_VALIDATE = @as(u32, 64); pub const AUTH_REQ_VALIDATE_CLIENT = @as(u32, 128); pub const AUTH_REQ_OK_AS_DELEGATE = @as(u32, 256); pub const AUTH_REQ_PREAUTH_REQUIRED = @as(u32, 512); pub const AUTH_REQ_TRANSITIVE_TRUST = @as(u32, 1024); pub const AUTH_REQ_ALLOW_S4U_DELEGATE = @as(u32, 2048); pub const KERB_TICKET_FLAGS_name_canonicalize = @as(u32, 65536); pub const KERB_TICKET_FLAGS_cname_in_pa_data = @as(u32, 262144); pub const KERB_TICKET_FLAGS_enc_pa_rep = @as(u32, 65536); pub const KRB_NT_UNKNOWN = @as(u32, 0); pub const KRB_NT_PRINCIPAL = @as(u32, 1); pub const KRB_NT_PRINCIPAL_AND_ID = @as(i32, -131); pub const KRB_NT_SRV_INST = @as(u32, 2); pub const KRB_NT_SRV_INST_AND_ID = @as(i32, -132); pub const KRB_NT_SRV_HST = @as(u32, 3); pub const KRB_NT_SRV_XHST = @as(u32, 4); pub const KRB_NT_UID = @as(u32, 5); pub const KRB_NT_ENTERPRISE_PRINCIPAL = @as(u32, 10); pub const KRB_NT_WELLKNOWN = @as(u32, 11); pub const KRB_NT_ENT_PRINCIPAL_AND_ID = @as(i32, -130); pub const KRB_NT_MS_PRINCIPAL = @as(i32, -128); pub const KRB_NT_MS_PRINCIPAL_AND_ID = @as(i32, -129); pub const KRB_NT_MS_BRANCH_ID = @as(i32, -133); pub const KRB_NT_X500_PRINCIPAL = @as(u32, 6); pub const KERB_WRAP_NO_ENCRYPT = @as(u32, 2147483649); pub const KERB_CERTIFICATE_LOGON_FLAG_CHECK_DUPLICATES = @as(u32, 1); pub const KERB_CERTIFICATE_LOGON_FLAG_USE_CERTIFICATE_INFO = @as(u32, 2); pub const KERB_CERTIFICATE_S4U_LOGON_FLAG_CHECK_DUPLICATES = @as(u32, 1); pub const KERB_CERTIFICATE_S4U_LOGON_FLAG_CHECK_LOGONHOURS = @as(u32, 2); pub const KERB_CERTIFICATE_S4U_LOGON_FLAG_FAIL_IF_NT_AUTH_POLICY_REQUIRED = @as(u32, 4); pub const KERB_CERTIFICATE_S4U_LOGON_FLAG_IDENTIFY = @as(u32, 8); pub const KERB_LOGON_FLAG_ALLOW_EXPIRED_TICKET = @as(u32, 1); pub const KERB_LOGON_FLAG_REDIRECTED = @as(u32, 2); pub const KERB_S4U_LOGON_FLAG_CHECK_LOGONHOURS = @as(u32, 2); pub const KERB_S4U_LOGON_FLAG_IDENTIFY = @as(u32, 8); pub const KERB_USE_DEFAULT_TICKET_FLAGS = @as(u32, 0); pub const KERB_RETRIEVE_TICKET_DEFAULT = @as(u32, 0); pub const KERB_RETRIEVE_TICKET_DONT_USE_CACHE = @as(u32, 1); pub const KERB_RETRIEVE_TICKET_USE_CACHE_ONLY = @as(u32, 2); pub const KERB_RETRIEVE_TICKET_USE_CREDHANDLE = @as(u32, 4); pub const KERB_RETRIEVE_TICKET_AS_KERB_CRED = @as(u32, 8); pub const KERB_RETRIEVE_TICKET_WITH_SEC_CRED = @as(u32, 16); pub const KERB_RETRIEVE_TICKET_CACHE_TICKET = @as(u32, 32); pub const KERB_RETRIEVE_TICKET_MAX_LIFETIME = @as(u32, 64); pub const KERB_ETYPE_DEFAULT = @as(u32, 0); pub const KERB_PURGE_ALL_TICKETS = @as(u32, 1); pub const KERB_S4U2PROXY_CACHE_ENTRY_INFO_FLAG_NEGATIVE = @as(u32, 1); pub const KERB_S4U2PROXY_CRED_FLAG_NEGATIVE = @as(u32, 1); pub const DS_UNKNOWN_ADDRESS_TYPE = @as(u32, 0); pub const KERB_SETPASS_USE_LOGONID = @as(u32, 1); pub const KERB_SETPASS_USE_CREDHANDLE = @as(u32, 2); pub const KERB_DECRYPT_FLAG_DEFAULT_KEY = @as(u32, 1); pub const KERB_REFRESH_SCCRED_RELEASE = @as(u32, 0); pub const KERB_REFRESH_SCCRED_GETTGT = @as(u32, 1); pub const KERB_TRANSFER_CRED_WITH_TICKETS = @as(u32, 1); pub const KERB_TRANSFER_CRED_CLEANUP_CREDENTIALS = @as(u32, 2); pub const KERB_QUERY_DOMAIN_EXTENDED_POLICIES_RESPONSE_FLAG_DAC_DISABLED = @as(u32, 1); pub const AUDIT_SET_SYSTEM_POLICY = @as(u32, 1); pub const AUDIT_QUERY_SYSTEM_POLICY = @as(u32, 2); pub const AUDIT_SET_USER_POLICY = @as(u32, 4); pub const AUDIT_QUERY_USER_POLICY = @as(u32, 8); pub const AUDIT_ENUMERATE_USERS = @as(u32, 16); pub const AUDIT_SET_MISC_POLICY = @as(u32, 32); pub const AUDIT_QUERY_MISC_POLICY = @as(u32, 64); pub const SECPKG_CLIENT_PROCESS_TERMINATED = @as(u32, 1); pub const SECPKG_CLIENT_THREAD_TERMINATED = @as(u32, 2); pub const SECPKG_CALL_KERNEL_MODE = @as(u32, 1); pub const SECPKG_CALL_ANSI = @as(u32, 2); pub const SECPKG_CALL_URGENT = @as(u32, 4); pub const SECPKG_CALL_RECURSIVE = @as(u32, 8); pub const SECPKG_CALL_IN_PROC = @as(u32, 16); pub const SECPKG_CALL_CLEANUP = @as(u32, 32); pub const SECPKG_CALL_WOWCLIENT = @as(u32, 64); pub const SECPKG_CALL_THREAD_TERM = @as(u32, 128); pub const SECPKG_CALL_PROCESS_TERM = @as(u32, 256); pub const SECPKG_CALL_IS_TCB = @as(u32, 512); pub const SECPKG_CALL_NETWORK_ONLY = @as(u32, 1024); pub const SECPKG_CALL_WINLOGON = @as(u32, 2048); pub const SECPKG_CALL_ASYNC_UPDATE = @as(u32, 4096); pub const SECPKG_CALL_SYSTEM_PROC = @as(u32, 8192); pub const SECPKG_CALL_NEGO = @as(u32, 16384); pub const SECPKG_CALL_NEGO_EXTENDER = @as(u32, 32768); pub const SECPKG_CALL_BUFFER_MARSHAL = @as(u32, 65536); pub const SECPKG_CALL_UNLOCK = @as(u32, 131072); pub const SECPKG_CALL_CLOUDAP_CONNECT = @as(u32, 262144); pub const SECPKG_CALL_WOWX86 = @as(u32, 64); pub const SECPKG_CALL_WOWA32 = @as(u32, 262144); pub const SECPKG_CREDENTIAL_VERSION = @as(u32, 201); pub const SECPKG_CREDENTIAL_FLAGS_CALLER_HAS_TCB = @as(u32, 1); pub const SECPKG_CREDENTIAL_FLAGS_CREDMAN_CRED = @as(u32, 2); pub const SECPKG_SURROGATE_LOGON_VERSION_1 = @as(u32, 1); pub const SECBUFFER_UNMAPPED = @as(u32, 1073741824); pub const SECBUFFER_KERNEL_MAP = @as(u32, 536870912); pub const PRIMARY_CRED_CLEAR_PASSWORD = @as(u32, 1); pub const PRIMARY_CRED_OWF_PASSWORD = @as(u32, 2); pub const PRIMARY_CRED_UPDATE = @as(u32, 4); pub const PRIMARY_CRED_CACHED_LOGON = @as(u32, 8); pub const PRIMARY_CRED_LOGON_NO_TCB = @as(u32, 16); pub const PRIMARY_CRED_LOGON_LUA = @as(u32, 32); pub const PRIMARY_CRED_INTERACTIVE_SMARTCARD_LOGON = @as(u32, 64); pub const PRIMARY_CRED_REFRESH_NEEDED = @as(u32, 128); pub const PRIMARY_CRED_INTERNET_USER = @as(u32, 256); pub const PRIMARY_CRED_AUTH_ID = @as(u32, 512); pub const PRIMARY_CRED_DO_NOT_SPLIT = @as(u32, 1024); pub const PRIMARY_CRED_PROTECTED_USER = @as(u32, 2048); pub const PRIMARY_CRED_EX = @as(u32, 4096); pub const PRIMARY_CRED_TRANSFER = @as(u32, 8192); pub const PRIMARY_CRED_RESTRICTED_TS = @as(u32, 16384); pub const PRIMARY_CRED_PACKED_CREDS = @as(u32, 32768); pub const PRIMARY_CRED_ENTERPRISE_INTERNET_USER = @as(u32, 65536); pub const PRIMARY_CRED_ENCRYPTED_CREDGUARD_PASSWORD = @as(u32, 131072); pub const PRIMARY_CRED_CACHED_INTERACTIVE_LOGON = @as(u32, 262144); pub const PRIMARY_CRED_INTERACTIVE_NGC_LOGON = @as(u32, 524288); pub const PRIMARY_CRED_INTERACTIVE_FIDO_LOGON = @as(u32, 1048576); pub const PRIMARY_CRED_ARSO_LOGON = @as(u32, 2097152); pub const PRIMARY_CRED_LOGON_PACKAGE_SHIFT = @as(u32, 24); pub const PRIMARY_CRED_PACKAGE_MASK = @as(u32, 4278190080); pub const MAX_CRED_SIZE = @as(u32, 1024); pub const SECPKG_STATE_ENCRYPTION_PERMITTED = @as(u32, 1); pub const SECPKG_STATE_STRONG_ENCRYPTION_PERMITTED = @as(u32, 2); pub const SECPKG_STATE_DOMAIN_CONTROLLER = @as(u32, 4); pub const SECPKG_STATE_WORKSTATION = @as(u32, 8); pub const SECPKG_STATE_STANDALONE = @as(u32, 16); pub const SECPKG_STATE_CRED_ISOLATION_ENABLED = @as(u32, 32); pub const SECPKG_STATE_RESERVED_1 = @as(u32, 2147483648); pub const SECPKG_MAX_OID_LENGTH = @as(u32, 32); pub const SECPKG_ATTR_SASL_CONTEXT = @as(u32, 65536); pub const SECPKG_ATTR_THUNK_ALL = @as(u32, 65536); pub const UNDERSTANDS_LONG_NAMES = @as(u32, 1); pub const NO_LONG_NAMES = @as(u32, 2); pub const SECPKG_CALL_PACKAGE_TRANSFER_CRED_REQUEST_FLAG_OPTIMISTIC_LOGON = @as(u32, 1); pub const SECPKG_CALL_PACKAGE_TRANSFER_CRED_REQUEST_FLAG_CLEANUP_CREDENTIALS = @as(u32, 2); pub const SECPKG_CALL_PACKAGE_TRANSFER_CRED_REQUEST_FLAG_TO_SSO_SESSION = @as(u32, 4); pub const NOTIFIER_FLAG_NEW_THREAD = @as(u32, 1); pub const NOTIFIER_FLAG_ONE_SHOT = @as(u32, 2); pub const NOTIFIER_FLAG_SECONDS = @as(u32, 2147483648); pub const NOTIFIER_TYPE_INTERVAL = @as(u32, 1); pub const NOTIFIER_TYPE_HANDLE_WAIT = @as(u32, 2); pub const NOTIFIER_TYPE_STATE_CHANGE = @as(u32, 3); pub const NOTIFIER_TYPE_NOTIFY_EVENT = @as(u32, 4); pub const NOTIFIER_TYPE_IMMEDIATE = @as(u32, 16); pub const NOTIFY_CLASS_PACKAGE_CHANGE = @as(u32, 1); pub const NOTIFY_CLASS_ROLE_CHANGE = @as(u32, 2); pub const NOTIFY_CLASS_DOMAIN_CHANGE = @as(u32, 3); pub const NOTIFY_CLASS_REGISTRY_CHANGE = @as(u32, 4); pub const LSA_QUERY_CLIENT_PRELOGON_SESSION_ID = @as(u32, 1); pub const CREDP_FLAGS_IN_PROCESS = @as(u32, 1); pub const CREDP_FLAGS_USE_MIDL_HEAP = @as(u32, 2); pub const CREDP_FLAGS_DONT_CACHE_TI = @as(u32, 4); pub const CREDP_FLAGS_CLEAR_PASSWORD = @as(u32, 8); pub const CREDP_FLAGS_USER_ENCRYPTED_PASSWORD = @as(u32, 16); pub const CREDP_FLAGS_TRUSTED_CALLER = @as(u32, 32); pub const CREDP_FLAGS_VALIDATE_PROXY_TARGET = @as(u32, 64); pub const CRED_MARSHALED_TI_SIZE_SIZE = @as(u32, 12); pub const SECPKG_INTERFACE_VERSION = @as(u32, 65536); pub const SECPKG_INTERFACE_VERSION_2 = @as(u32, 131072); pub const SECPKG_INTERFACE_VERSION_3 = @as(u32, 262144); pub const SECPKG_INTERFACE_VERSION_4 = @as(u32, 524288); pub const SECPKG_INTERFACE_VERSION_5 = @as(u32, 1048576); pub const SECPKG_INTERFACE_VERSION_6 = @as(u32, 2097152); pub const SECPKG_INTERFACE_VERSION_7 = @as(u32, 4194304); pub const SECPKG_INTERFACE_VERSION_8 = @as(u32, 8388608); pub const SECPKG_INTERFACE_VERSION_9 = @as(u32, 16777216); pub const SECPKG_INTERFACE_VERSION_10 = @as(u32, 33554432); pub const UNISP_RPC_ID = @as(u32, 14); pub const RCRED_STATUS_NOCRED = @as(u32, 0); pub const RCRED_CRED_EXISTS = @as(u32, 1); pub const RCRED_STATUS_UNKNOWN_ISSUER = @as(u32, 2); pub const LCRED_STATUS_NOCRED = @as(u32, 0); pub const LCRED_CRED_EXISTS = @as(u32, 1); pub const LCRED_STATUS_UNKNOWN_ISSUER = @as(u32, 2); pub const SECPKGCONTEXT_CONNECTION_INFO_EX_V1 = @as(u32, 1); pub const SECPKGCONTEXT_CIPHERINFO_V1 = @as(u32, 1); pub const SSL_SESSION_RECONNECT = @as(u32, 1); pub const KERN_CONTEXT_CERT_INFO_V1 = @as(u32, 0); pub const ENABLE_TLS_CLIENT_EARLY_START = @as(u32, 1); pub const SCH_CRED_V1 = @as(u32, 1); pub const SCH_CRED_V2 = @as(u32, 2); pub const SCH_CRED_VERSION = @as(u32, 2); pub const SCH_CRED_V3 = @as(u32, 3); pub const SCHANNEL_CRED_VERSION = @as(u32, 4); pub const SCH_CREDENTIALS_VERSION = @as(u32, 5); pub const TLS_PARAMS_OPTIONAL = @as(u32, 1); pub const SCH_CRED_MAX_SUPPORTED_PARAMETERS = @as(u32, 16); pub const SCH_CRED_MAX_SUPPORTED_ALPN_IDS = @as(u32, 16); pub const SCH_CRED_MAX_SUPPORTED_CRYPTO_SETTINGS = @as(u32, 16); pub const SCH_CRED_MAX_SUPPORTED_CHAINING_MODES = @as(u32, 16); pub const SCH_MAX_EXT_SUBSCRIPTIONS = @as(u32, 2); pub const SCH_CRED_FORMAT_CERT_CONTEXT = @as(u32, 0); pub const SCH_CRED_FORMAT_CERT_HASH = @as(u32, 1); pub const SCH_CRED_FORMAT_CERT_HASH_STORE = @as(u32, 2); pub const SCH_CRED_MAX_STORE_NAME_SIZE = @as(u32, 128); pub const SCH_CRED_MAX_SUPPORTED_ALGS = @as(u32, 256); pub const SCH_CRED_MAX_SUPPORTED_CERTS = @as(u32, 100); pub const SCH_MACHINE_CERT_HASH = @as(u32, 1); pub const SCH_CRED_DISABLE_RECONNECTS = @as(u32, 128); pub const SCH_CRED_RESTRICTED_ROOTS = @as(u32, 8192); pub const SCH_CRED_REVOCATION_CHECK_CACHE_ONLY = @as(u32, 16384); pub const SCH_CRED_CACHE_ONLY_URL_RETRIEVAL = @as(u32, 32768); pub const SCH_CRED_MEMORY_STORE_CERT = @as(u32, 65536); pub const SCH_CRED_SNI_CREDENTIAL = @as(u32, 524288); pub const SCH_CRED_SNI_ENABLE_OCSP = @as(u32, 1048576); pub const SCH_USE_DTLS_ONLY = @as(u32, 16777216); pub const SCH_ALLOW_NULL_ENCRYPTION = @as(u32, 33554432); pub const SCHANNEL_RENEGOTIATE = @as(u32, 0); pub const SCHANNEL_SHUTDOWN = @as(u32, 1); pub const SCHANNEL_ALERT = @as(u32, 2); pub const SCHANNEL_SESSION = @as(u32, 3); pub const TLS1_ALERT_CLOSE_NOTIFY = @as(u32, 0); pub const TLS1_ALERT_UNEXPECTED_MESSAGE = @as(u32, 10); pub const TLS1_ALERT_BAD_RECORD_MAC = @as(u32, 20); pub const TLS1_ALERT_DECRYPTION_FAILED = @as(u32, 21); pub const TLS1_ALERT_RECORD_OVERFLOW = @as(u32, 22); pub const TLS1_ALERT_DECOMPRESSION_FAIL = @as(u32, 30); pub const TLS1_ALERT_HANDSHAKE_FAILURE = @as(u32, 40); pub const TLS1_ALERT_BAD_CERTIFICATE = @as(u32, 42); pub const TLS1_ALERT_UNSUPPORTED_CERT = @as(u32, 43); pub const TLS1_ALERT_CERTIFICATE_REVOKED = @as(u32, 44); pub const TLS1_ALERT_CERTIFICATE_EXPIRED = @as(u32, 45); pub const TLS1_ALERT_CERTIFICATE_UNKNOWN = @as(u32, 46); pub const TLS1_ALERT_ILLEGAL_PARAMETER = @as(u32, 47); pub const TLS1_ALERT_UNKNOWN_CA = @as(u32, 48); pub const TLS1_ALERT_ACCESS_DENIED = @as(u32, 49); pub const TLS1_ALERT_DECODE_ERROR = @as(u32, 50); pub const TLS1_ALERT_DECRYPT_ERROR = @as(u32, 51); pub const TLS1_ALERT_EXPORT_RESTRICTION = @as(u32, 60); pub const TLS1_ALERT_PROTOCOL_VERSION = @as(u32, 70); pub const TLS1_ALERT_INSUFFIENT_SECURITY = @as(u32, 71); pub const TLS1_ALERT_INTERNAL_ERROR = @as(u32, 80); pub const TLS1_ALERT_USER_CANCELED = @as(u32, 90); pub const TLS1_ALERT_NO_RENEGOTIATION = @as(u32, 100); pub const TLS1_ALERT_UNSUPPORTED_EXT = @as(u32, 110); pub const TLS1_ALERT_UNKNOWN_PSK_IDENTITY = @as(u32, 115); pub const TLS1_ALERT_NO_APP_PROTOCOL = @as(u32, 120); pub const SP_PROT_PCT1_SERVER = @as(u32, 1); pub const SP_PROT_PCT1_CLIENT = @as(u32, 2); pub const SP_PROT_SSL2_SERVER = @as(u32, 4); pub const SP_PROT_SSL2_CLIENT = @as(u32, 8); pub const SP_PROT_SSL3_SERVER = @as(u32, 16); pub const SP_PROT_SSL3_CLIENT = @as(u32, 32); pub const SP_PROT_TLS1_SERVER = @as(u32, 64); pub const SP_PROT_TLS1_CLIENT = @as(u32, 128); pub const SP_PROT_UNI_SERVER = @as(u32, 1073741824); pub const SP_PROT_UNI_CLIENT = @as(u32, 2147483648); pub const SP_PROT_ALL = @as(u32, 4294967295); pub const SP_PROT_NONE = @as(u32, 0); pub const SP_PROT_TLS1_1_SERVER = @as(u32, 256); pub const SP_PROT_TLS1_1_CLIENT = @as(u32, 512); pub const SP_PROT_TLS1_2_SERVER = @as(u32, 1024); pub const SP_PROT_TLS1_2_CLIENT = @as(u32, 2048); pub const SP_PROT_TLS1_3_SERVER = @as(u32, 4096); pub const SP_PROT_TLS1_3_CLIENT = @as(u32, 8192); pub const SP_PROT_DTLS_SERVER = @as(u32, 65536); pub const SP_PROT_DTLS_CLIENT = @as(u32, 131072); pub const SP_PROT_DTLS1_2_SERVER = @as(u32, 262144); pub const SP_PROT_DTLS1_2_CLIENT = @as(u32, 524288); pub const SCHANNEL_SECRET_TYPE_CAPI = @as(u32, 1); pub const SCHANNEL_SECRET_PRIVKEY = @as(u32, 2); pub const SCH_CRED_X509_CERTCHAIN = @as(u32, 1); pub const SCH_CRED_X509_CAPI = @as(u32, 2); pub const SCH_CRED_CERT_CONTEXT = @as(u32, 3); pub const SL_SYSTEM_STATE_REBOOT_POLICY_FOUND = @as(u32, 1); pub const SL_SYSTEM_STATE_TAMPERED = @as(u32, 2); pub const SL_REARM_REBOOT_REQUIRED = @as(u32, 1); pub const SPP_MIGRATION_GATHER_MIGRATABLE_APPS = @as(u32, 1); pub const SPP_MIGRATION_GATHER_ACTIVATED_WINDOWS_STATE = @as(u32, 2); pub const SPP_MIGRATION_GATHER_ALL = @as(u32, 4294967295); pub const USER_ACCOUNT_DISABLED = @as(u32, 1); pub const USER_HOME_DIRECTORY_REQUIRED = @as(u32, 2); pub const USER_PASSWORD_NOT_REQUIRED = @as(u32, 4); pub const USER_TEMP_DUPLICATE_ACCOUNT = @as(u32, 8); pub const USER_NORMAL_ACCOUNT = @as(u32, 16); pub const USER_MNS_LOGON_ACCOUNT = @as(u32, 32); pub const USER_INTERDOMAIN_TRUST_ACCOUNT = @as(u32, 64); pub const USER_WORKSTATION_TRUST_ACCOUNT = @as(u32, 128); pub const USER_SERVER_TRUST_ACCOUNT = @as(u32, 256); pub const USER_DONT_EXPIRE_PASSWORD = @as(u32, 512); pub const USER_ACCOUNT_AUTO_LOCKED = @as(u32, 1024); pub const USER_ENCRYPTED_TEXT_PASSWORD_ALLOWED = @as(u32, 2048); pub const USER_SMARTCARD_REQUIRED = @as(u32, 4096); pub const USER_TRUSTED_FOR_DELEGATION = @as(u32, 8192); pub const USER_NOT_DELEGATED = @as(u32, 16384); pub const USER_USE_DES_KEY_ONLY = @as(u32, 32768); pub const USER_DONT_REQUIRE_PREAUTH = @as(u32, 65536); pub const USER_PASSWORD_EXPIRED = @as(u32, 131072); pub const USER_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION = @as(u32, 262144); pub const USER_NO_AUTH_DATA_REQUIRED = @as(u32, 524288); pub const USER_PARTIAL_SECRETS_ACCOUNT = @as(u32, 1048576); pub const USER_USE_AES_KEYS = @as(u32, 2097152); pub const SAM_DAYS_PER_WEEK = @as(u32, 7); pub const USER_ALL_PARAMETERS = @as(u32, 2097152); pub const CLEAR_BLOCK_LENGTH = @as(u32, 8); pub const CYPHER_BLOCK_LENGTH = @as(u32, 8); pub const MSV1_0_VALIDATION_LOGOFF_TIME = @as(u32, 1); pub const MSV1_0_VALIDATION_KICKOFF_TIME = @as(u32, 2); pub const MSV1_0_VALIDATION_LOGON_SERVER = @as(u32, 4); pub const MSV1_0_VALIDATION_LOGON_DOMAIN = @as(u32, 8); pub const MSV1_0_VALIDATION_SESSION_KEY = @as(u32, 16); pub const MSV1_0_VALIDATION_USER_FLAGS = @as(u32, 32); pub const MSV1_0_VALIDATION_USER_ID = @as(u32, 64); pub const MSV1_0_SUBAUTH_ACCOUNT_DISABLED = @as(u32, 1); pub const MSV1_0_SUBAUTH_PASSWORD = @as(u32, 2); pub const MSV1_0_SUBAUTH_WORKSTATIONS = @as(u32, 4); pub const MSV1_0_SUBAUTH_LOGON_HOURS = @as(u32, 8); pub const MSV1_0_SUBAUTH_ACCOUNT_EXPIRY = @as(u32, 16); pub const MSV1_0_SUBAUTH_PASSWORD_EXPIRY = @as(u32, 32); pub const MSV1_0_SUBAUTH_ACCOUNT_TYPE = @as(u32, 64); pub const MSV1_0_SUBAUTH_LOCKOUT = @as(u32, 128); //-------------------------------------------------------------------------------- // Section: Types (597) //-------------------------------------------------------------------------------- pub const SECPKG_ATTR = enum(u32) { C_ACCESS_TOKEN = <PASSWORD>, C_FULL_ACCESS_TOKEN = <PASSWORD>, CERT_TRUST_STATUS = 2147483780, CREDS = 2147483776, CREDS_2 = 2147483782, NEGOTIATION_PACKAGE = 2147483777, PACKAGE_INFO = 10, SERVER_AUTH_FLAGS = 2147483779, SIZES = 0, SUBJECT_SECURITY_ATTRIBUTES = 124, APP_DATA = 94, EAP_PRF_INFO = 101, EARLY_START = 105, DTLS_MTU = 34, KEYING_MATERIAL_INFO = 106, ACCESS_TOKEN = 18, AUTHORITY = 6, CLIENT_SPECIFIED_TARGET = 27, CONNECTION_INFO = 90, DCE_INFO = 3, ENDPOINT_BINDINGS = 26, EAP_KEY_BLOCK = 91, FLAGS = 14, ISSUER_LIST_EX = 89, KEY_INFO = 5, LAST_CLIENT_TOKEN_STATUS = 30, LIFESPAN = 2, LOCAL_CERT_CONTEXT = 84, LOCAL_CRED = 82, NAMES = 1, NATIVE_NAMES = 13, NEGOTIATION_INFO = 12, PASSWORD_EXPIRY = 8, REMOTE_CERT_CONTEXT = 83, ROOT_STORE = 85, SESSION_KEY = 9, SESSION_INFO = 93, STREAM_SIZES = 4, SUPPORTED_SIGNATURES = 102, TARGET_INFORMATION = 17, UNIQUE_BINDINGS = 25, }; pub const SECPKG_ATTR_C_ACCESS_TOKEN = SECPKG_ATTR.C_ACCESS_TOKEN; pub const SECPKG_ATTR_C_FULL_ACCESS_TOKEN = SECPKG_ATTR.C_FULL_ACCESS_TOKEN; pub const SECPKG_ATTR_CERT_TRUST_STATUS = SECPKG_ATTR.CERT_TRUST_STATUS; pub const SECPKG_ATTR_CREDS = SECPKG_ATTR.CREDS; pub const SECPKG_ATTR_CREDS_2 = SECPKG_ATTR.CREDS_2; pub const SECPKG_ATTR_NEGOTIATION_PACKAGE = SECPKG_ATTR.NEGOTIATION_PACKAGE; pub const SECPKG_ATTR_PACKAGE_INFO = SECPKG_ATTR.PACKAGE_INFO; pub const SECPKG_ATTR_SERVER_AUTH_FLAGS = SECPKG_ATTR.SERVER_AUTH_FLAGS; pub const SECPKG_ATTR_SIZES = SECPKG_ATTR.SIZES; pub const SECPKG_ATTR_SUBJECT_SECURITY_ATTRIBUTES = SECPKG_ATTR.SUBJECT_SECURITY_ATTRIBUTES; pub const SECPKG_ATTR_APP_DATA = SECPKG_ATTR.APP_DATA; pub const SECPKG_ATTR_EAP_PRF_INFO = SECPKG_ATTR.EAP_PRF_INFO; pub const SECPKG_ATTR_EARLY_START = SECPKG_ATTR.EARLY_START; pub const SECPKG_ATTR_DTLS_MTU = SECPKG_ATTR.DTLS_MTU; pub const SECPKG_ATTR_KEYING_MATERIAL_INFO = SECPKG_ATTR.KEYING_MATERIAL_INFO; pub const SECPKG_ATTR_ACCESS_TOKEN = SECPKG_ATTR.ACCESS_TOKEN; pub const SECPKG_ATTR_AUTHORITY = SECPKG_ATTR.AUTHORITY; pub const SECPKG_ATTR_CLIENT_SPECIFIED_TARGET = SECPKG_ATTR.CLIENT_SPECIFIED_TARGET; pub const SECPKG_ATTR_CONNECTION_INFO = SECPKG_ATTR.CONNECTION_INFO; pub const SECPKG_ATTR_DCE_INFO = SECPKG_ATTR.DCE_INFO; pub const SECPKG_ATTR_ENDPOINT_BINDINGS = SECPKG_ATTR.ENDPOINT_BINDINGS; pub const SECPKG_ATTR_EAP_KEY_BLOCK = SECPKG_ATTR.EAP_KEY_BLOCK; pub const SECPKG_ATTR_FLAGS = SECPKG_ATTR.FLAGS; pub const SECPKG_ATTR_ISSUER_LIST_EX = SECPKG_ATTR.ISSUER_LIST_EX; pub const SECPKG_ATTR_KEY_INFO = SECPKG_ATTR.KEY_INFO; pub const SECPKG_ATTR_LAST_CLIENT_TOKEN_STATUS = SECPKG_ATTR.LAST_CLIENT_TOKEN_STATUS; pub const SECPKG_ATTR_LIFESPAN = SECPKG_ATTR.LIFESPAN; pub const SECPKG_ATTR_LOCAL_CERT_CONTEXT = SECPKG_ATTR.LOCAL_CERT_CONTEXT; pub const SECPKG_ATTR_LOCAL_CRED = SECPKG_ATTR.LOCAL_CRED; pub const SECPKG_ATTR_NAMES = SECPKG_ATTR.NAMES; pub const SECPKG_ATTR_NATIVE_NAMES = SECPKG_ATTR.NATIVE_NAMES; pub const SECPKG_ATTR_NEGOTIATION_INFO = SECPKG_ATTR.NEGOTIATION_INFO; pub const SECPKG_ATTR_PASSWORD_EXPIRY = SECPKG_ATTR.PASSWORD_EXPIRY; pub const SECPKG_ATTR_REMOTE_CERT_CONTEXT = SECPKG_ATTR.REMOTE_CERT_CONTEXT; pub const SECPKG_ATTR_ROOT_STORE = SECPKG_ATTR.ROOT_STORE; pub const SECPKG_ATTR_SESSION_KEY = SECPKG_ATTR.SESSION_KEY; pub const SECPKG_ATTR_SESSION_INFO = SECPKG_ATTR.SESSION_INFO; pub const SECPKG_ATTR_STREAM_SIZES = SECPKG_ATTR.STREAM_SIZES; pub const SECPKG_ATTR_SUPPORTED_SIGNATURES = SECPKG_ATTR.SUPPORTED_SIGNATURES; pub const SECPKG_ATTR_TARGET_INFORMATION = SECPKG_ATTR.TARGET_INFORMATION; pub const SECPKG_ATTR_UNIQUE_BINDINGS = SECPKG_ATTR.UNIQUE_BINDINGS; pub const MSV1_0 = enum(u32) { PASSTHRU = 1, GUEST_LOGON = 2, }; pub const MSV1_0_PASSTHRU = MSV1_0.PASSTHRU; pub const MSV1_0_GUEST_LOGON = MSV1_0.GUEST_LOGON; pub const SECPKG_CRED = enum(u32) { INBOUND = 1, OUTBOUND = 2, }; pub const SECPKG_CRED_INBOUND = SECPKG_CRED.INBOUND; pub const SECPKG_CRED_OUTBOUND = SECPKG_CRED.OUTBOUND; pub const MSV_SUB_AUTHENTICATION_FILTER = enum(u32) { GUEST = 1, NOENCRYPTION = 2, CACHED_ACCOUNT = 4, USED_LM_PASSWORD = 8, EXTRA_SIDS = 32, SUBAUTH_SESSION_KEY = 64, SERVER_TRUST_ACCOUNT = 128, PROFILE_PATH_RETURNED = 1024, RESOURCE_GROUPS = 512, }; pub const LOGON_GUEST = MSV_SUB_AUTHENTICATION_FILTER.GUEST; pub const LOGON_NOENCRYPTION = MSV_SUB_AUTHENTICATION_FILTER.NOENCRYPTION; pub const LOGON_CACHED_ACCOUNT = MSV_SUB_AUTHENTICATION_FILTER.CACHED_ACCOUNT; pub const LOGON_USED_LM_PASSWORD = MSV_SUB_AUTHENTICATION_FILTER.USED_LM_PASSWORD; pub const LOGON_EXTRA_SIDS = MSV_SUB_AUTHENTICATION_FILTER.EXTRA_SIDS; pub const LOGON_SUBAUTH_SESSION_KEY = MSV_SUB_AUTHENTICATION_FILTER.SUBAUTH_SESSION_KEY; pub const LOGON_SERVER_TRUST_ACCOUNT = MSV_SUB_AUTHENTICATION_FILTER.SERVER_TRUST_ACCOUNT; pub const LOGON_PROFILE_PATH_RETURNED = MSV_SUB_AUTHENTICATION_FILTER.PROFILE_PATH_RETURNED; pub const LOGON_RESOURCE_GROUPS = MSV_SUB_AUTHENTICATION_FILTER.RESOURCE_GROUPS; pub const EXPORT_SECURITY_CONTEXT_FLAGS = enum(u32) { RESET_NEW = 1, DELETE_OLD = 2, TO_KERNEL = 4, _, pub fn initFlags(o: struct { RESET_NEW: u1 = 0, DELETE_OLD: u1 = 0, TO_KERNEL: u1 = 0, }) EXPORT_SECURITY_CONTEXT_FLAGS { return @intToEnum(EXPORT_SECURITY_CONTEXT_FLAGS, (if (o.RESET_NEW == 1) @enumToInt(EXPORT_SECURITY_CONTEXT_FLAGS.RESET_NEW) else 0) | (if (o.DELETE_OLD == 1) @enumToInt(EXPORT_SECURITY_CONTEXT_FLAGS.DELETE_OLD) else 0) | (if (o.TO_KERNEL == 1) @enumToInt(EXPORT_SECURITY_CONTEXT_FLAGS.TO_KERNEL) else 0) ); } }; pub const SECPKG_CONTEXT_EXPORT_RESET_NEW = EXPORT_SECURITY_CONTEXT_FLAGS.RESET_NEW; pub const SECPKG_CONTEXT_EXPORT_DELETE_OLD = EXPORT_SECURITY_CONTEXT_FLAGS.DELETE_OLD; pub const SECPKG_CONTEXT_EXPORT_TO_KERNEL = EXPORT_SECURITY_CONTEXT_FLAGS.TO_KERNEL; pub const ACCEPT_SECURITY_CONTEXT_CONTEXT_REQ = enum(u32) { ALLOCATE_MEMORY = 256, CONNECTION = 2048, DELEGATE = 1, EXTENDED_ERROR = 32768, REPLAY_DETECT = 4, SEQUENCE_DETECT = 8, STREAM = 65536, _, pub fn initFlags(o: struct { ALLOCATE_MEMORY: u1 = 0, CONNECTION: u1 = 0, DELEGATE: u1 = 0, EXTENDED_ERROR: u1 = 0, REPLAY_DETECT: u1 = 0, SEQUENCE_DETECT: u1 = 0, STREAM: u1 = 0, }) ACCEPT_SECURITY_CONTEXT_CONTEXT_REQ { return @intToEnum(ACCEPT_SECURITY_CONTEXT_CONTEXT_REQ, (if (o.ALLOCATE_MEMORY == 1) @enumToInt(ACCEPT_SECURITY_CONTEXT_CONTEXT_REQ.ALLOCATE_MEMORY) else 0) | (if (o.CONNECTION == 1) @enumToInt(ACCEPT_SECURITY_CONTEXT_CONTEXT_REQ.CONNECTION) else 0) | (if (o.DELEGATE == 1) @enumToInt(ACCEPT_SECURITY_CONTEXT_CONTEXT_REQ.DELEGATE) else 0) | (if (o.EXTENDED_ERROR == 1) @enumToInt(ACCEPT_SECURITY_CONTEXT_CONTEXT_REQ.EXTENDED_ERROR) else 0) | (if (o.REPLAY_DETECT == 1) @enumToInt(ACCEPT_SECURITY_CONTEXT_CONTEXT_REQ.REPLAY_DETECT) else 0) | (if (o.SEQUENCE_DETECT == 1) @enumToInt(ACCEPT_SECURITY_CONTEXT_CONTEXT_REQ.SEQUENCE_DETECT) else 0) | (if (o.STREAM == 1) @enumToInt(ACCEPT_SECURITY_CONTEXT_CONTEXT_REQ.STREAM) else 0) ); } }; pub const ASC_REQ_ALLOCATE_MEMORY = ACCEPT_SECURITY_CONTEXT_CONTEXT_REQ.ALLOCATE_MEMORY; pub const ASC_REQ_CONNECTION = ACCEPT_SECURITY_CONTEXT_CONTEXT_REQ.CONNECTION; pub const ASC_REQ_DELEGATE = ACCEPT_SECURITY_CONTEXT_CONTEXT_REQ.DELEGATE; pub const ASC_REQ_EXTENDED_ERROR = ACCEPT_SECURITY_CONTEXT_CONTEXT_REQ.EXTENDED_ERROR; pub const ASC_REQ_REPLAY_DETECT = ACCEPT_SECURITY_CONTEXT_CONTEXT_REQ.REPLAY_DETECT; pub const ASC_REQ_SEQUENCE_DETECT = ACCEPT_SECURITY_CONTEXT_CONTEXT_REQ.SEQUENCE_DETECT; pub const ASC_REQ_STREAM = ACCEPT_SECURITY_CONTEXT_CONTEXT_REQ.STREAM; pub const KERB_TICKET_FLAGS = enum(u32) { forwardable = 1073741824, forwarded = 536870912, hw_authent = 1048576, initial = 4194304, invalid = 16777216, may_postdate = 67108864, ok_as_delegate = 262144, postdated = 33554432, pre_authent = 2097152, proxiable = 268435456, proxy = 134217728, renewable = 8388608, reserved = 2147483648, reserved1 = 1, _, pub fn initFlags(o: struct { forwardable: u1 = 0, forwarded: u1 = 0, hw_authent: u1 = 0, initial: u1 = 0, invalid: u1 = 0, may_postdate: u1 = 0, ok_as_delegate: u1 = 0, postdated: u1 = 0, pre_authent: u1 = 0, proxiable: u1 = 0, proxy: u1 = 0, renewable: u1 = 0, reserved: u1 = 0, reserved1: u1 = 0, }) KERB_TICKET_FLAGS { return @intToEnum(KERB_TICKET_FLAGS, (if (o.forwardable == 1) @enumToInt(KERB_TICKET_FLAGS.forwardable) else 0) | (if (o.forwarded == 1) @enumToInt(KERB_TICKET_FLAGS.forwarded) else 0) | (if (o.hw_authent == 1) @enumToInt(KERB_TICKET_FLAGS.hw_authent) else 0) | (if (o.initial == 1) @enumToInt(KERB_TICKET_FLAGS.initial) else 0) | (if (o.invalid == 1) @enumToInt(KERB_TICKET_FLAGS.invalid) else 0) | (if (o.may_postdate == 1) @enumToInt(KERB_TICKET_FLAGS.may_postdate) else 0) | (if (o.ok_as_delegate == 1) @enumToInt(KERB_TICKET_FLAGS.ok_as_delegate) else 0) | (if (o.postdated == 1) @enumToInt(KERB_TICKET_FLAGS.postdated) else 0) | (if (o.pre_authent == 1) @enumToInt(KERB_TICKET_FLAGS.pre_authent) else 0) | (if (o.proxiable == 1) @enumToInt(KERB_TICKET_FLAGS.proxiable) else 0) | (if (o.proxy == 1) @enumToInt(KERB_TICKET_FLAGS.proxy) else 0) | (if (o.renewable == 1) @enumToInt(KERB_TICKET_FLAGS.renewable) else 0) | (if (o.reserved == 1) @enumToInt(KERB_TICKET_FLAGS.reserved) else 0) | (if (o.reserved1 == 1) @enumToInt(KERB_TICKET_FLAGS.reserved1) else 0) ); } }; pub const KERB_TICKET_FLAGS_forwardable = KERB_TICKET_FLAGS.forwardable; pub const KERB_TICKET_FLAGS_forwarded = KERB_TICKET_FLAGS.forwarded; pub const KERB_TICKET_FLAGS_hw_authent = KERB_TICKET_FLAGS.hw_authent; pub const KERB_TICKET_FLAGS_initial = KERB_TICKET_FLAGS.initial; pub const KERB_TICKET_FLAGS_invalid = KERB_TICKET_FLAGS.invalid; pub const KERB_TICKET_FLAGS_may_postdate = KERB_TICKET_FLAGS.may_postdate; pub const KERB_TICKET_FLAGS_ok_as_delegate = KERB_TICKET_FLAGS.ok_as_delegate; pub const KERB_TICKET_FLAGS_postdated = KERB_TICKET_FLAGS.postdated; pub const KERB_TICKET_FLAGS_pre_authent = KERB_TICKET_FLAGS.pre_authent; pub const KERB_TICKET_FLAGS_proxiable = KERB_TICKET_FLAGS.proxiable; pub const KERB_TICKET_FLAGS_proxy = KERB_TICKET_FLAGS.proxy; pub const KERB_TICKET_FLAGS_renewable = KERB_TICKET_FLAGS.renewable; pub const KERB_TICKET_FLAGS_reserved = KERB_TICKET_FLAGS.reserved; pub const KERB_TICKET_FLAGS_reserved1 = KERB_TICKET_FLAGS.reserved1; pub const KERB_ADDRESS_TYPE = enum(u32) { INET_ADDRESS = 1, NETBIOS_ADDRESS = 2, }; pub const DS_INET_ADDRESS = KERB_ADDRESS_TYPE.INET_ADDRESS; pub const DS_NETBIOS_ADDRESS = KERB_ADDRESS_TYPE.NETBIOS_ADDRESS; pub const SCHANNEL_CRED_FLAGS = enum(u32) { CRED_AUTO_CRED_VALIDATION = 32, CRED_CACHE_ONLY_URL_RETRIEVAL_ON_CREATE = 131072, DISABLE_RECONNECTS = 128, CRED_IGNORE_NO_REVOCATION_CHECK = 2048, CRED_IGNORE_REVOCATION_OFFLINE = 4096, CRED_MANUAL_CRED_VALIDATION = 8, CRED_NO_DEFAULT_CREDS = 16, CRED_NO_SERVERNAME_CHECK = 4, CRED_NO_SYSTEM_MAPPER = 2, CRED_REVOCATION_CHECK_CHAIN = 512, CRED_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT = 1024, CRED_REVOCATION_CHECK_END_CERT = 256, CRED_USE_DEFAULT_CREDS = 64, SEND_AUX_RECORD = 2097152, SEND_ROOT_CERT = 262144, USE_STRONG_CRYPTO = 4194304, USE_PRESHAREDKEY_ONLY = 8388608, _, pub fn initFlags(o: struct { CRED_AUTO_CRED_VALIDATION: u1 = 0, CRED_CACHE_ONLY_URL_RETRIEVAL_ON_CREATE: u1 = 0, DISABLE_RECONNECTS: u1 = 0, CRED_IGNORE_NO_REVOCATION_CHECK: u1 = 0, CRED_IGNORE_REVOCATION_OFFLINE: u1 = 0, CRED_MANUAL_CRED_VALIDATION: u1 = 0, CRED_NO_DEFAULT_CREDS: u1 = 0, CRED_NO_SERVERNAME_CHECK: u1 = 0, CRED_NO_SYSTEM_MAPPER: u1 = 0, CRED_REVOCATION_CHECK_CHAIN: u1 = 0, CRED_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT: u1 = 0, CRED_REVOCATION_CHECK_END_CERT: u1 = 0, CRED_USE_DEFAULT_CREDS: u1 = 0, SEND_AUX_RECORD: u1 = 0, SEND_ROOT_CERT: u1 = 0, USE_STRONG_CRYPTO: u1 = 0, USE_PRESHAREDKEY_ONLY: u1 = 0, }) SCHANNEL_CRED_FLAGS { return @intToEnum(SCHANNEL_CRED_FLAGS, (if (o.CRED_AUTO_CRED_VALIDATION == 1) @enumToInt(SCHANNEL_CRED_FLAGS.CRED_AUTO_CRED_VALIDATION) else 0) | (if (o.CRED_CACHE_ONLY_URL_RETRIEVAL_ON_CREATE == 1) @enumToInt(SCHANNEL_CRED_FLAGS.CRED_CACHE_ONLY_URL_RETRIEVAL_ON_CREATE) else 0) | (if (o.DISABLE_RECONNECTS == 1) @enumToInt(SCHANNEL_CRED_FLAGS.DISABLE_RECONNECTS) else 0) | (if (o.CRED_IGNORE_NO_REVOCATION_CHECK == 1) @enumToInt(SCHANNEL_CRED_FLAGS.CRED_IGNORE_NO_REVOCATION_CHECK) else 0) | (if (o.CRED_IGNORE_REVOCATION_OFFLINE == 1) @enumToInt(SCHANNEL_CRED_FLAGS.CRED_IGNORE_REVOCATION_OFFLINE) else 0) | (if (o.CRED_MANUAL_CRED_VALIDATION == 1) @enumToInt(SCHANNEL_CRED_FLAGS.CRED_MANUAL_CRED_VALIDATION) else 0) | (if (o.CRED_NO_DEFAULT_CREDS == 1) @enumToInt(SCHANNEL_CRED_FLAGS.CRED_NO_DEFAULT_CREDS) else 0) | (if (o.CRED_NO_SERVERNAME_CHECK == 1) @enumToInt(SCHANNEL_CRED_FLAGS.CRED_NO_SERVERNAME_CHECK) else 0) | (if (o.CRED_NO_SYSTEM_MAPPER == 1) @enumToInt(SCHANNEL_CRED_FLAGS.CRED_NO_SYSTEM_MAPPER) else 0) | (if (o.CRED_REVOCATION_CHECK_CHAIN == 1) @enumToInt(SCHANNEL_CRED_FLAGS.CRED_REVOCATION_CHECK_CHAIN) else 0) | (if (o.CRED_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT == 1) @enumToInt(SCHANNEL_CRED_FLAGS.CRED_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT) else 0) | (if (o.CRED_REVOCATION_CHECK_END_CERT == 1) @enumToInt(SCHANNEL_CRED_FLAGS.CRED_REVOCATION_CHECK_END_CERT) else 0) | (if (o.CRED_USE_DEFAULT_CREDS == 1) @enumToInt(SCHANNEL_CRED_FLAGS.CRED_USE_DEFAULT_CREDS) else 0) | (if (o.SEND_AUX_RECORD == 1) @enumToInt(SCHANNEL_CRED_FLAGS.SEND_AUX_RECORD) else 0) | (if (o.SEND_ROOT_CERT == 1) @enumToInt(SCHANNEL_CRED_FLAGS.SEND_ROOT_CERT) else 0) | (if (o.USE_STRONG_CRYPTO == 1) @enumToInt(SCHANNEL_CRED_FLAGS.USE_STRONG_CRYPTO) else 0) | (if (o.USE_PRESHAREDKEY_ONLY == 1) @enumToInt(SCHANNEL_CRED_FLAGS.USE_PRESHAREDKEY_ONLY) else 0) ); } }; pub const SCH_CRED_AUTO_CRED_VALIDATION = SCHANNEL_CRED_FLAGS.CRED_AUTO_CRED_VALIDATION; pub const SCH_CRED_CACHE_ONLY_URL_RETRIEVAL_ON_CREATE = SCHANNEL_CRED_FLAGS.CRED_CACHE_ONLY_URL_RETRIEVAL_ON_CREATE; pub const SCH_DISABLE_RECONNECTS = SCHANNEL_CRED_FLAGS.DISABLE_RECONNECTS; pub const SCH_CRED_IGNORE_NO_REVOCATION_CHECK = SCHANNEL_CRED_FLAGS.CRED_IGNORE_NO_REVOCATION_CHECK; pub const SCH_CRED_IGNORE_REVOCATION_OFFLINE = SCHANNEL_CRED_FLAGS.CRED_IGNORE_REVOCATION_OFFLINE; pub const SCH_CRED_MANUAL_CRED_VALIDATION = SCHANNEL_CRED_FLAGS.CRED_MANUAL_CRED_VALIDATION; pub const SCH_CRED_NO_DEFAULT_CREDS = SCHANNEL_CRED_FLAGS.CRED_NO_DEFAULT_CREDS; pub const SCH_CRED_NO_SERVERNAME_CHECK = SCHANNEL_CRED_FLAGS.CRED_NO_SERVERNAME_CHECK; pub const SCH_CRED_NO_SYSTEM_MAPPER = SCHANNEL_CRED_FLAGS.CRED_NO_SYSTEM_MAPPER; pub const SCH_CRED_REVOCATION_CHECK_CHAIN = SCHANNEL_CRED_FLAGS.CRED_REVOCATION_CHECK_CHAIN; pub const SCH_CRED_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT = SCHANNEL_CRED_FLAGS.CRED_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT; pub const SCH_CRED_REVOCATION_CHECK_END_CERT = SCHANNEL_CRED_FLAGS.CRED_REVOCATION_CHECK_END_CERT; pub const SCH_CRED_USE_DEFAULT_CREDS = SCHANNEL_CRED_FLAGS.CRED_USE_DEFAULT_CREDS; pub const SCH_SEND_AUX_RECORD = SCHANNEL_CRED_FLAGS.SEND_AUX_RECORD; pub const SCH_SEND_ROOT_CERT = SCHANNEL_CRED_FLAGS.SEND_ROOT_CERT; pub const SCH_USE_STRONG_CRYPTO = SCHANNEL_CRED_FLAGS.USE_STRONG_CRYPTO; pub const SCH_USE_PRESHAREDKEY_ONLY = SCHANNEL_CRED_FLAGS.USE_PRESHAREDKEY_ONLY; pub const DOMAIN_PASSWORD_PROPERTIES = enum(u32) { PASSWORD_COMPLEX = 1, PASSWORD_NO_ANON_CHANGE = 2, PASSWORD_NO_CLEAR_CHANGE = 4, LOCKOUT_ADMINS = 8, PASSWORD_STORE_CLEARTEXT = 16, REFUSE_PASSWORD_CHANGE = 32, _, pub fn initFlags(o: struct { PASSWORD_COMPLEX: u1 = 0, PASSWORD_NO_ANON_CHANGE: u1 = 0, PASSWORD_NO_CLEAR_CHANGE: u1 = 0, LOCKOUT_ADMINS: u1 = 0, PASSWORD_STORE_CLEARTEXT: u1 = 0, REFUSE_PASSWORD_CHANGE: u1 = 0, }) DOMAIN_PASSWORD_PROPERTIES { return @intToEnum(DOMAIN_PASSWORD_PROPERTIES, (if (o.PASSWORD_COMPLEX == 1) @enumToInt(DOMAIN_PASSWORD_PROPERTIES.PASSWORD_COMPLEX) else 0) | (if (o.PASSWORD_NO_ANON_CHANGE == 1) @enumToInt(DOMAIN_PASSWORD_PROPERTIES.PASSWORD_NO_ANON_CHANGE) else 0) | (if (o.PASSWORD_NO_CLEAR_CHANGE == 1) @enumToInt(DOMAIN_PASSWORD_PROPERTIES.PASSWORD_NO_CLEAR_CHANGE) else 0) | (if (o.LOCKOUT_ADMINS == 1) @enumToInt(DOMAIN_PASSWORD_PROPERTIES.LOCKOUT_ADMINS) else 0) | (if (o.PASSWORD_STORE_CLEARTEXT == 1) @enumToInt(DOMAIN_PASSWORD_PROPERTIES.PASSWORD_STORE_CLEARTEXT) else 0) | (if (o.REFUSE_PASSWORD_CHANGE == 1) @enumToInt(DOMAIN_PASSWORD_PROPERTIES.REFUSE_PASSWORD_CHANGE) else 0) ); } }; pub const DOMAIN_PASSWORD_COMPLEX = DOMAIN_PASSWORD_PROPERTIES.PASSWORD_COMPLEX; pub const DOMAIN_PASSWORD_NO_ANON_CHANGE = DOMAIN_PASSWORD_PROPERTIES.PASSWORD_NO_ANON_CHANGE; pub const DOMAIN_PASSWORD_NO_CLEAR_CHANGE = DOMAIN_PASSWORD_PROPERTIES.PASSWORD_NO_CLEAR_CHANGE; pub const DOMAIN_LOCKOUT_ADMINS = DOMAIN_PASSWORD_PROPERTIES.LOCKOUT_ADMINS; pub const DOMAIN_PASSWORD_STORE_CLEARTEXT = DOMAIN_PASSWORD_PROPERTIES.PASSWORD_STORE_CLEARTEXT; pub const DOMAIN_REFUSE_PASSWORD_CHANGE = DOMAIN_PASSWORD_PROPERTIES.REFUSE_PASSWORD_CHANGE; pub const SCHANNEL_ALERT_TOKEN_ALERT_TYPE = enum(u32) { WARNING = 1, FATAL = 2, }; pub const TLS1_ALERT_WARNING = SCHANNEL_ALERT_TOKEN_ALERT_TYPE.WARNING; pub const TLS1_ALERT_FATAL = SCHANNEL_ALERT_TOKEN_ALERT_TYPE.FATAL; pub const TRUSTED_DOMAIN_TRUST_TYPE = enum(u32) { DOWNLEVEL = 1, UPLEVEL = 2, MIT = 3, DCE = 4, }; pub const TRUST_TYPE_DOWNLEVEL = TRUSTED_DOMAIN_TRUST_TYPE.DOWNLEVEL; pub const TRUST_TYPE_UPLEVEL = TRUSTED_DOMAIN_TRUST_TYPE.UPLEVEL; pub const TRUST_TYPE_MIT = TRUSTED_DOMAIN_TRUST_TYPE.MIT; pub const TRUST_TYPE_DCE = TRUSTED_DOMAIN_TRUST_TYPE.DCE; pub const MSV_SUBAUTH_LOGON_PARAMETER_CONTROL = enum(u32) { CLEARTEXT_PASSWORD_ALLOWED = 2, UPDATE_LOGON_STATISTICS = 4, RETURN_USER_PARAMETERS = 8, DONT_TRY_GUEST_ACCOUNT = 16, ALLOW_SERVER_TRUST_ACCOUNT = 32, RETURN_PASSWORD_EXPIRY = 64, ALLOW_WORKSTATION_TRUST_ACCOUNT = 2048, TRY_GUEST_ACCOUNT_ONLY = 256, RETURN_PROFILE_PATH = 512, TRY_SPECIFIED_DOMAIN_ONLY = 1024, _, pub fn initFlags(o: struct { CLEARTEXT_PASSWORD_ALLOWED: u1 = 0, UPDATE_LOGON_STATISTICS: u1 = 0, RETURN_USER_PARAMETERS: u1 = 0, DONT_TRY_GUEST_ACCOUNT: u1 = 0, ALLOW_SERVER_TRUST_ACCOUNT: u1 = 0, RETURN_PASSWORD_EXPIRY: u1 = 0, ALLOW_WORKSTATION_TRUST_ACCOUNT: u1 = 0, TRY_GUEST_ACCOUNT_ONLY: u1 = 0, RETURN_PROFILE_PATH: u1 = 0, TRY_SPECIFIED_DOMAIN_ONLY: u1 = 0, }) MSV_SUBAUTH_LOGON_PARAMETER_CONTROL { return @intToEnum(MSV_SUBAUTH_LOGON_PARAMETER_CONTROL, (if (o.CLEARTEXT_PASSWORD_ALLOWED == 1) @enumToInt(MSV_SUBAUTH_LOGON_PARAMETER_CONTROL.CLEARTEXT_PASSWORD_ALLOWED) else 0) | (if (o.UPDATE_LOGON_STATISTICS == 1) @enumToInt(MSV_SUBAUTH_LOGON_PARAMETER_CONTROL.UPDATE_LOGON_STATISTICS) else 0) | (if (o.RETURN_USER_PARAMETERS == 1) @enumToInt(MSV_SUBAUTH_LOGON_PARAMETER_CONTROL.RETURN_USER_PARAMETERS) else 0) | (if (o.DONT_TRY_GUEST_ACCOUNT == 1) @enumToInt(MSV_SUBAUTH_LOGON_PARAMETER_CONTROL.DONT_TRY_GUEST_ACCOUNT) else 0) | (if (o.ALLOW_SERVER_TRUST_ACCOUNT == 1) @enumToInt(MSV_SUBAUTH_LOGON_PARAMETER_CONTROL.ALLOW_SERVER_TRUST_ACCOUNT) else 0) | (if (o.RETURN_PASSWORD_EXPIRY == 1) @enumToInt(MSV_SUBAUTH_LOGON_PARAMETER_CONTROL.RETURN_PASSWORD_EXPIRY) else 0) | (if (o.ALLOW_WORKSTATION_TRUST_ACCOUNT == 1) @enumToInt(MSV_SUBAUTH_LOGON_PARAMETER_CONTROL.ALLOW_WORKSTATION_TRUST_ACCOUNT) else 0) | (if (o.TRY_GUEST_ACCOUNT_ONLY == 1) @enumToInt(MSV_SUBAUTH_LOGON_PARAMETER_CONTROL.TRY_GUEST_ACCOUNT_ONLY) else 0) | (if (o.RETURN_PROFILE_PATH == 1) @enumToInt(MSV_SUBAUTH_LOGON_PARAMETER_CONTROL.RETURN_PROFILE_PATH) else 0) | (if (o.TRY_SPECIFIED_DOMAIN_ONLY == 1) @enumToInt(MSV_SUBAUTH_LOGON_PARAMETER_CONTROL.TRY_SPECIFIED_DOMAIN_ONLY) else 0) ); } }; pub const MSV1_0_CLEARTEXT_PASSWORD_ALLOWED = MSV_SUBAUTH_LOGON_PARAMETER_CONTROL.CLEARTEXT_PASSWORD_ALLOWED; pub const MSV1_0_UPDATE_LOGON_STATISTICS = MSV_SUBAUTH_LOGON_PARAMETER_CONTROL.UPDATE_LOGON_STATISTICS; pub const MSV1_0_RETURN_USER_PARAMETERS = MSV_SUBAUTH_LOGON_PARAMETER_CONTROL.RETURN_USER_PARAMETERS; pub const MSV1_0_DONT_TRY_GUEST_ACCOUNT = MSV_SUBAUTH_LOGON_PARAMETER_CONTROL.DONT_TRY_GUEST_ACCOUNT; pub const MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT = MSV_SUBAUTH_LOGON_PARAMETER_CONTROL.ALLOW_SERVER_TRUST_ACCOUNT; pub const MSV1_0_RETURN_PASSWORD_EXPIRY = MSV_SUBAUTH_LOGON_PARAMETER_CONTROL.RETURN_PASSWORD_EXPIRY; pub const MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT = MSV_SUBAUTH_LOGON_PARAMETER_CONTROL.ALLOW_WORKSTATION_TRUST_ACCOUNT; pub const MSV1_0_TRY_GUEST_ACCOUNT_ONLY = MSV_SUBAUTH_LOGON_PARAMETER_CONTROL.TRY_GUEST_ACCOUNT_ONLY; pub const MSV1_0_RETURN_PROFILE_PATH = MSV_SUBAUTH_LOGON_PARAMETER_CONTROL.RETURN_PROFILE_PATH; pub const MSV1_0_TRY_SPECIFIED_DOMAIN_ONLY = MSV_SUBAUTH_LOGON_PARAMETER_CONTROL.TRY_SPECIFIED_DOMAIN_ONLY; pub const KERB_REQUEST_FLAGS = enum(u32) { ADD_CREDENTIAL = 1, REPLACE_CREDENTIAL = 2, REMOVE_CREDENTIAL = 4, }; pub const KERB_REQUEST_ADD_CREDENTIAL = KERB_REQUEST_FLAGS.ADD_CREDENTIAL; pub const KERB_REQUEST_REPLACE_CREDENTIAL = KERB_REQUEST_FLAGS.REPLACE_CREDENTIAL; pub const KERB_REQUEST_REMOVE_CREDENTIAL = KERB_REQUEST_FLAGS.REMOVE_CREDENTIAL; pub const TRUSTED_DOMAIN_TRUST_DIRECTION = enum(u32) { DISABLED = 0, INBOUND = 1, OUTBOUND = 2, BIDIRECTIONAL = 3, }; pub const TRUST_DIRECTION_DISABLED = TRUSTED_DOMAIN_TRUST_DIRECTION.DISABLED; pub const TRUST_DIRECTION_INBOUND = TRUSTED_DOMAIN_TRUST_DIRECTION.INBOUND; pub const TRUST_DIRECTION_OUTBOUND = TRUSTED_DOMAIN_TRUST_DIRECTION.OUTBOUND; pub const TRUST_DIRECTION_BIDIRECTIONAL = TRUSTED_DOMAIN_TRUST_DIRECTION.BIDIRECTIONAL; pub const MSV_SUPPLEMENTAL_CREDENTIAL_FLAGS = enum(u32) { LM_PRESENT = 1, NT_PRESENT = 2, VERSION = 0, _, pub fn initFlags(o: struct { LM_PRESENT: u1 = 0, NT_PRESENT: u1 = 0, VERSION: u1 = 0, }) MSV_SUPPLEMENTAL_CREDENTIAL_FLAGS { return @intToEnum(MSV_SUPPLEMENTAL_CREDENTIAL_FLAGS, (if (o.LM_PRESENT == 1) @enumToInt(MSV_SUPPLEMENTAL_CREDENTIAL_FLAGS.LM_PRESENT) else 0) | (if (o.NT_PRESENT == 1) @enumToInt(MSV_SUPPLEMENTAL_CREDENTIAL_FLAGS.NT_PRESENT) else 0) | (if (o.VERSION == 1) @enumToInt(MSV_SUPPLEMENTAL_CREDENTIAL_FLAGS.VERSION) else 0) ); } }; pub const MSV1_0_CRED_LM_PRESENT = MSV_SUPPLEMENTAL_CREDENTIAL_FLAGS.LM_PRESENT; pub const MSV1_0_CRED_NT_PRESENT = MSV_SUPPLEMENTAL_CREDENTIAL_FLAGS.NT_PRESENT; pub const MSV1_0_CRED_VERSION = MSV_SUPPLEMENTAL_CREDENTIAL_FLAGS.VERSION; pub const SECURITY_PACKAGE_OPTIONS_TYPE = enum(u32) { UNKNOWN = 0, LSA = 1, SSPI = 2, }; pub const SECPKG_OPTIONS_TYPE_UNKNOWN = SECURITY_PACKAGE_OPTIONS_TYPE.UNKNOWN; pub const SECPKG_OPTIONS_TYPE_LSA = SECURITY_PACKAGE_OPTIONS_TYPE.LSA; pub const SECPKG_OPTIONS_TYPE_SSPI = SECURITY_PACKAGE_OPTIONS_TYPE.SSPI; pub const SCHANNEL_SESSION_TOKEN_FLAGS = enum(u32) { ENABLE_RECONNECTS = 1, DISABLE_RECONNECTS = 2, }; pub const SSL_SESSION_ENABLE_RECONNECTS = SCHANNEL_SESSION_TOKEN_FLAGS.ENABLE_RECONNECTS; pub const SSL_SESSION_DISABLE_RECONNECTS = SCHANNEL_SESSION_TOKEN_FLAGS.DISABLE_RECONNECTS; pub const KERB_CRYPTO_KEY_TYPE = enum(i32) { DES_CBC_CRC = 1, DES_CBC_MD4 = 2, DES_CBC_MD5 = 3, NULL = 0, RC4_HMAC_NT = 23, RC4_MD4 = -128, }; pub const KERB_ETYPE_DES_CBC_CRC = KERB_CRYPTO_KEY_TYPE.DES_CBC_CRC; pub const KERB_ETYPE_DES_CBC_MD4 = KERB_CRYPTO_KEY_TYPE.DES_CBC_MD4; pub const KERB_ETYPE_DES_CBC_MD5 = KERB_CRYPTO_KEY_TYPE.DES_CBC_MD5; pub const KERB_ETYPE_NULL = KERB_CRYPTO_KEY_TYPE.NULL; pub const KERB_ETYPE_RC4_HMAC_NT = KERB_CRYPTO_KEY_TYPE.RC4_HMAC_NT; pub const KERB_ETYPE_RC4_MD4 = KERB_CRYPTO_KEY_TYPE.RC4_MD4; pub const LSA_AUTH_INFORMATION_AUTH_TYPE = enum(u32) { NONE = 0, NT4OWF = 1, CLEAR = 2, VERSION = 3, }; pub const TRUST_AUTH_TYPE_NONE = LSA_AUTH_INFORMATION_AUTH_TYPE.NONE; pub const TRUST_AUTH_TYPE_NT4OWF = LSA_AUTH_INFORMATION_AUTH_TYPE.NT4OWF; pub const TRUST_AUTH_TYPE_CLEAR = LSA_AUTH_INFORMATION_AUTH_TYPE.CLEAR; pub const TRUST_AUTH_TYPE_VERSION = LSA_AUTH_INFORMATION_AUTH_TYPE.VERSION; pub const SECPKG_PACKAGE_CHANGE_TYPE = enum(u32) { LOAD = 0, UNLOAD = 1, SELECT = 2, }; pub const SECPKG_PACKAGE_CHANGE_LOAD = SECPKG_PACKAGE_CHANGE_TYPE.LOAD; pub const SECPKG_PACKAGE_CHANGE_UNLOAD = SECPKG_PACKAGE_CHANGE_TYPE.UNLOAD; pub const SECPKG_PACKAGE_CHANGE_SELECT = SECPKG_PACKAGE_CHANGE_TYPE.SELECT; pub const TRUSTED_DOMAIN_TRUST_ATTRIBUTES = enum(u32) { NON_TRANSITIVE = 1, UPLEVEL_ONLY = 2, FILTER_SIDS = 4, FOREST_TRANSITIVE = 8, CROSS_ORGANIZATION = 16, TREAT_AS_EXTERNAL = 64, WITHIN_FOREST = 32, }; pub const TRUST_ATTRIBUTE_NON_TRANSITIVE = TRUSTED_DOMAIN_TRUST_ATTRIBUTES.NON_TRANSITIVE; pub const TRUST_ATTRIBUTE_UPLEVEL_ONLY = TRUSTED_DOMAIN_TRUST_ATTRIBUTES.UPLEVEL_ONLY; pub const TRUST_ATTRIBUTE_FILTER_SIDS = TRUSTED_DOMAIN_TRUST_ATTRIBUTES.FILTER_SIDS; pub const TRUST_ATTRIBUTE_FOREST_TRANSITIVE = TRUSTED_DOMAIN_TRUST_ATTRIBUTES.FOREST_TRANSITIVE; pub const TRUST_ATTRIBUTE_CROSS_ORGANIZATION = TRUSTED_DOMAIN_TRUST_ATTRIBUTES.CROSS_ORGANIZATION; pub const TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL = TRUSTED_DOMAIN_TRUST_ATTRIBUTES.TREAT_AS_EXTERNAL; pub const TRUST_ATTRIBUTE_WITHIN_FOREST = TRUSTED_DOMAIN_TRUST_ATTRIBUTES.WITHIN_FOREST; pub const _HMAPPER = extern struct { placeholder: usize, // TODO: why is this type empty? }; // TODO: this type has a FreeFunc 'LsaDeregisterLogonProcess', what can Zig do with this information? pub const LsaHandle = isize; pub const LSA_TRUST_INFORMATION = extern struct { Name: UNICODE_STRING, Sid: ?PSID, }; pub const LSA_REFERENCED_DOMAIN_LIST = extern struct { Entries: u32, Domains: ?*LSA_TRUST_INFORMATION, }; pub const LSA_TRANSLATED_SID2 = extern struct { Use: SID_NAME_USE, Sid: ?PSID, DomainIndex: i32, Flags: u32, }; pub const LSA_TRANSLATED_NAME = extern struct { Use: SID_NAME_USE, Name: UNICODE_STRING, DomainIndex: i32, }; pub const POLICY_ACCOUNT_DOMAIN_INFO = extern struct { DomainName: UNICODE_STRING, DomainSid: ?PSID, }; pub const POLICY_DNS_DOMAIN_INFO = extern struct { Name: UNICODE_STRING, DnsDomainName: UNICODE_STRING, DnsForestName: UNICODE_STRING, DomainGuid: Guid, Sid: ?PSID, }; pub const LSA_LOOKUP_DOMAIN_INFO_CLASS = enum(i32) { AccountDomainInformation = 5, DnsDomainInformation = 12, }; pub const AccountDomainInformation = LSA_LOOKUP_DOMAIN_INFO_CLASS.AccountDomainInformation; pub const DnsDomainInformation = LSA_LOOKUP_DOMAIN_INFO_CLASS.DnsDomainInformation; pub const SECURITY_LOGON_TYPE = enum(i32) { UndefinedLogonType = 0, Interactive = 2, Network = 3, Batch = 4, Service = 5, Proxy = 6, Unlock = 7, NetworkCleartext = 8, NewCredentials = 9, RemoteInteractive = 10, CachedInteractive = 11, CachedRemoteInteractive = 12, CachedUnlock = 13, }; // NOTE: not creating aliases because this enum is 'Scoped' pub const SE_ADT_PARAMETER_TYPE = enum(i32) { None = 0, String = 1, FileSpec = 2, Ulong = 3, Sid = 4, LogonId = 5, NoLogonId = 6, AccessMask = 7, Privs = 8, ObjectTypes = 9, HexUlong = 10, Ptr = 11, Time = 12, Guid = 13, Luid = 14, HexInt64 = 15, StringList = 16, SidList = 17, Duration = 18, UserAccountControl = 19, NoUac = 20, Message = 21, DateTime = 22, SockAddr = 23, SD = 24, LogonHours = 25, LogonIdNoSid = 26, UlongNoConv = 27, SockAddrNoPort = 28, AccessReason = 29, StagingReason = 30, ResourceAttribute = 31, Claims = 32, LogonIdAsSid = 33, MultiSzString = 34, LogonIdEx = 35, }; pub const SeAdtParmTypeNone = SE_ADT_PARAMETER_TYPE.None; pub const SeAdtParmTypeString = SE_ADT_PARAMETER_TYPE.String; pub const SeAdtParmTypeFileSpec = SE_ADT_PARAMETER_TYPE.FileSpec; pub const SeAdtParmTypeUlong = SE_ADT_PARAMETER_TYPE.Ulong; pub const SeAdtParmTypeSid = SE_ADT_PARAMETER_TYPE.Sid; pub const SeAdtParmTypeLogonId = SE_ADT_PARAMETER_TYPE.LogonId; pub const SeAdtParmTypeNoLogonId = SE_ADT_PARAMETER_TYPE.NoLogonId; pub const SeAdtParmTypeAccessMask = SE_ADT_PARAMETER_TYPE.AccessMask; pub const SeAdtParmTypePrivs = SE_ADT_PARAMETER_TYPE.Privs; pub const SeAdtParmTypeObjectTypes = SE_ADT_PARAMETER_TYPE.ObjectTypes; pub const SeAdtParmTypeHexUlong = SE_ADT_PARAMETER_TYPE.HexUlong; pub const SeAdtParmTypePtr = SE_ADT_PARAMETER_TYPE.Ptr; pub const SeAdtParmTypeTime = SE_ADT_PARAMETER_TYPE.Time; pub const SeAdtParmTypeGuid = SE_ADT_PARAMETER_TYPE.Guid; pub const SeAdtParmTypeLuid = SE_ADT_PARAMETER_TYPE.Luid; pub const SeAdtParmTypeHexInt64 = SE_ADT_PARAMETER_TYPE.HexInt64; pub const SeAdtParmTypeStringList = SE_ADT_PARAMETER_TYPE.StringList; pub const SeAdtParmTypeSidList = SE_ADT_PARAMETER_TYPE.SidList; pub const SeAdtParmTypeDuration = SE_ADT_PARAMETER_TYPE.Duration; pub const SeAdtParmTypeUserAccountControl = SE_ADT_PARAMETER_TYPE.UserAccountControl; pub const SeAdtParmTypeNoUac = SE_ADT_PARAMETER_TYPE.NoUac; pub const SeAdtParmTypeMessage = SE_ADT_PARAMETER_TYPE.Message; pub const SeAdtParmTypeDateTime = SE_ADT_PARAMETER_TYPE.DateTime; pub const SeAdtParmTypeSockAddr = SE_ADT_PARAMETER_TYPE.SockAddr; pub const SeAdtParmTypeSD = SE_ADT_PARAMETER_TYPE.SD; pub const SeAdtParmTypeLogonHours = SE_ADT_PARAMETER_TYPE.LogonHours; pub const SeAdtParmTypeLogonIdNoSid = SE_ADT_PARAMETER_TYPE.LogonIdNoSid; pub const SeAdtParmTypeUlongNoConv = SE_ADT_PARAMETER_TYPE.UlongNoConv; pub const SeAdtParmTypeSockAddrNoPort = SE_ADT_PARAMETER_TYPE.SockAddrNoPort; pub const SeAdtParmTypeAccessReason = SE_ADT_PARAMETER_TYPE.AccessReason; pub const SeAdtParmTypeStagingReason = SE_ADT_PARAMETER_TYPE.StagingReason; pub const SeAdtParmTypeResourceAttribute = SE_ADT_PARAMETER_TYPE.ResourceAttribute; pub const SeAdtParmTypeClaims = SE_ADT_PARAMETER_TYPE.Claims; pub const SeAdtParmTypeLogonIdAsSid = SE_ADT_PARAMETER_TYPE.LogonIdAsSid; pub const SeAdtParmTypeMultiSzString = SE_ADT_PARAMETER_TYPE.MultiSzString; pub const SeAdtParmTypeLogonIdEx = SE_ADT_PARAMETER_TYPE.LogonIdEx; pub const SE_ADT_OBJECT_TYPE = extern struct { ObjectType: Guid, Flags: u16, Level: u16, AccessMask: u32, }; pub const SE_ADT_PARAMETER_ARRAY_ENTRY = extern struct { Type: SE_ADT_PARAMETER_TYPE, Length: u32, Data: [2]usize, Address: ?*c_void, }; pub const SE_ADT_ACCESS_REASON = extern struct { AccessMask: u32, AccessReasons: [32]u32, ObjectTypeIndex: u32, AccessGranted: u32, SecurityDescriptor: ?*SECURITY_DESCRIPTOR, }; pub const SE_ADT_CLAIMS = extern struct { Length: u32, Claims: ?*c_void, }; pub const SE_ADT_PARAMETER_ARRAY = extern struct { CategoryId: u32, AuditId: u32, ParameterCount: u32, Length: u32, FlatSubCategoryId: u16, Type: u16, Flags: u32, Parameters: [32]SE_ADT_PARAMETER_ARRAY_ENTRY, }; pub const SE_ADT_PARAMETER_ARRAY_EX = extern struct { CategoryId: u32, AuditId: u32, Version: u32, ParameterCount: u32, Length: u32, FlatSubCategoryId: u16, Type: u16, Flags: u32, Parameters: [32]SE_ADT_PARAMETER_ARRAY_ENTRY, }; pub const POLICY_AUDIT_EVENT_TYPE = enum(i32) { System = 0, Logon = 1, ObjectAccess = 2, PrivilegeUse = 3, DetailedTracking = 4, PolicyChange = 5, AccountManagement = 6, DirectoryServiceAccess = 7, AccountLogon = 8, }; pub const AuditCategorySystem = POLICY_AUDIT_EVENT_TYPE.System; pub const AuditCategoryLogon = POLICY_AUDIT_EVENT_TYPE.Logon; pub const AuditCategoryObjectAccess = POLICY_AUDIT_EVENT_TYPE.ObjectAccess; pub const AuditCategoryPrivilegeUse = POLICY_AUDIT_EVENT_TYPE.PrivilegeUse; pub const AuditCategoryDetailedTracking = POLICY_AUDIT_EVENT_TYPE.DetailedTracking; pub const AuditCategoryPolicyChange = POLICY_AUDIT_EVENT_TYPE.PolicyChange; pub const AuditCategoryAccountManagement = POLICY_AUDIT_EVENT_TYPE.AccountManagement; pub const AuditCategoryDirectoryServiceAccess = POLICY_AUDIT_EVENT_TYPE.DirectoryServiceAccess; pub const AuditCategoryAccountLogon = POLICY_AUDIT_EVENT_TYPE.AccountLogon; pub const LSA_TRANSLATED_SID = extern struct { Use: SID_NAME_USE, RelativeId: u32, DomainIndex: i32, }; pub const POLICY_LSA_SERVER_ROLE = enum(i32) { Backup = 2, Primary = 3, }; pub const PolicyServerRoleBackup = POLICY_LSA_SERVER_ROLE.Backup; pub const PolicyServerRolePrimary = POLICY_LSA_SERVER_ROLE.Primary; pub const POLICY_INFORMATION_CLASS = enum(i32) { AuditLogInformation = 1, AuditEventsInformation = 2, PrimaryDomainInformation = 3, PdAccountInformation = 4, AccountDomainInformation = 5, LsaServerRoleInformation = 6, ReplicaSourceInformation = 7, DefaultQuotaInformation = 8, ModificationInformation = 9, AuditFullSetInformation = 10, AuditFullQueryInformation = 11, DnsDomainInformation = 12, DnsDomainInformationInt = 13, LocalAccountDomainInformation = 14, MachineAccountInformation = 15, LastEntry = 16, }; pub const PolicyAuditLogInformation = POLICY_INFORMATION_CLASS.AuditLogInformation; pub const PolicyAuditEventsInformation = POLICY_INFORMATION_CLASS.AuditEventsInformation; pub const PolicyPrimaryDomainInformation = POLICY_INFORMATION_CLASS.PrimaryDomainInformation; pub const PolicyPdAccountInformation = POLICY_INFORMATION_CLASS.PdAccountInformation; pub const PolicyAccountDomainInformation = POLICY_INFORMATION_CLASS.AccountDomainInformation; pub const PolicyLsaServerRoleInformation = POLICY_INFORMATION_CLASS.LsaServerRoleInformation; pub const PolicyReplicaSourceInformation = POLICY_INFORMATION_CLASS.ReplicaSourceInformation; pub const PolicyDefaultQuotaInformation = POLICY_INFORMATION_CLASS.DefaultQuotaInformation; pub const PolicyModificationInformation = POLICY_INFORMATION_CLASS.ModificationInformation; pub const PolicyAuditFullSetInformation = POLICY_INFORMATION_CLASS.AuditFullSetInformation; pub const PolicyAuditFullQueryInformation = POLICY_INFORMATION_CLASS.AuditFullQueryInformation; pub const PolicyDnsDomainInformation = POLICY_INFORMATION_CLASS.DnsDomainInformation; pub const PolicyDnsDomainInformationInt = POLICY_INFORMATION_CLASS.DnsDomainInformationInt; pub const PolicyLocalAccountDomainInformation = POLICY_INFORMATION_CLASS.LocalAccountDomainInformation; pub const PolicyMachineAccountInformation = POLICY_INFORMATION_CLASS.MachineAccountInformation; pub const PolicyLastEntry = POLICY_INFORMATION_CLASS.LastEntry; pub const POLICY_AUDIT_LOG_INFO = extern struct { AuditLogPercentFull: u32, MaximumLogSize: u32, AuditRetentionPeriod: LARGE_INTEGER, AuditLogFullShutdownInProgress: BOOLEAN, TimeToShutdown: LARGE_INTEGER, NextAuditRecordId: u32, }; pub const POLICY_AUDIT_EVENTS_INFO = extern struct { AuditingMode: BOOLEAN, EventAuditingOptions: ?*u32, MaximumAuditEventCount: u32, }; pub const POLICY_AUDIT_SUBCATEGORIES_INFO = extern struct { MaximumSubCategoryCount: u32, EventAuditingOptions: ?*u32, }; pub const POLICY_AUDIT_CATEGORIES_INFO = extern struct { MaximumCategoryCount: u32, SubCategoriesInfo: ?*POLICY_AUDIT_SUBCATEGORIES_INFO, }; pub const POLICY_PRIMARY_DOMAIN_INFO = extern struct { Name: UNICODE_STRING, Sid: ?PSID, }; pub const POLICY_PD_ACCOUNT_INFO = extern struct { Name: UNICODE_STRING, }; pub const POLICY_LSA_SERVER_ROLE_INFO = extern struct { LsaServerRole: POLICY_LSA_SERVER_ROLE, }; pub const POLICY_REPLICA_SOURCE_INFO = extern struct { ReplicaSource: UNICODE_STRING, ReplicaAccountName: UNICODE_STRING, }; pub const POLICY_DEFAULT_QUOTA_INFO = extern struct { QuotaLimits: QUOTA_LIMITS, }; pub const POLICY_MODIFICATION_INFO = extern struct { ModifiedId: LARGE_INTEGER, DatabaseCreationTime: LARGE_INTEGER, }; pub const POLICY_AUDIT_FULL_SET_INFO = extern struct { ShutDownOnFull: BOOLEAN, }; pub const POLICY_AUDIT_FULL_QUERY_INFO = extern struct { ShutDownOnFull: BOOLEAN, LogIsFull: BOOLEAN, }; pub const POLICY_DOMAIN_INFORMATION_CLASS = enum(i32) { EfsInformation = 2, KerberosTicketInformation = 3, }; pub const PolicyDomainEfsInformation = POLICY_DOMAIN_INFORMATION_CLASS.EfsInformation; pub const PolicyDomainKerberosTicketInformation = POLICY_DOMAIN_INFORMATION_CLASS.KerberosTicketInformation; pub const POLICY_DOMAIN_EFS_INFO = extern struct { InfoLength: u32, EfsBlob: ?*u8, }; pub const POLICY_DOMAIN_KERBEROS_TICKET_INFO = extern struct { AuthenticationOptions: u32, MaxServiceTicketAge: LARGE_INTEGER, MaxTicketAge: LARGE_INTEGER, MaxRenewAge: LARGE_INTEGER, MaxClockSkew: LARGE_INTEGER, Reserved: LARGE_INTEGER, }; pub const POLICY_MACHINE_ACCT_INFO = extern struct { Rid: u32, Sid: ?PSID, }; pub const POLICY_NOTIFICATION_INFORMATION_CLASS = enum(i32) { AuditEventsInformation = 1, AccountDomainInformation = 2, ServerRoleInformation = 3, DnsDomainInformation = 4, DomainEfsInformation = 5, DomainKerberosTicketInformation = 6, MachineAccountPasswordInformation = 7, GlobalSaclInformation = 8, Max = 9, }; pub const PolicyNotifyAuditEventsInformation = POLICY_NOTIFICATION_INFORMATION_CLASS.AuditEventsInformation; pub const PolicyNotifyAccountDomainInformation = POLICY_NOTIFICATION_INFORMATION_CLASS.AccountDomainInformation; pub const PolicyNotifyServerRoleInformation = POLICY_NOTIFICATION_INFORMATION_CLASS.ServerRoleInformation; pub const PolicyNotifyDnsDomainInformation = POLICY_NOTIFICATION_INFORMATION_CLASS.DnsDomainInformation; pub const PolicyNotifyDomainEfsInformation = POLICY_NOTIFICATION_INFORMATION_CLASS.DomainEfsInformation; pub const PolicyNotifyDomainKerberosTicketInformation = POLICY_NOTIFICATION_INFORMATION_CLASS.DomainKerberosTicketInformation; pub const PolicyNotifyMachineAccountPasswordInformation = POLICY_NOTIFICATION_INFORMATION_CLASS.MachineAccountPasswordInformation; pub const PolicyNotifyGlobalSaclInformation = POLICY_NOTIFICATION_INFORMATION_CLASS.GlobalSaclInformation; pub const PolicyNotifyMax = POLICY_NOTIFICATION_INFORMATION_CLASS.Max; pub const TRUSTED_INFORMATION_CLASS = enum(i32) { DomainNameInformation = 1, ControllersInformation = 2, PosixOffsetInformation = 3, PasswordInformation = 4, DomainInformationBasic = 5, DomainInformationEx = 6, DomainAuthInformation = 7, DomainFullInformation = 8, DomainAuthInformationInternal = 9, DomainFullInformationInternal = 10, DomainInformationEx2Internal = 11, DomainFullInformation2Internal = 12, DomainSupportedEncryptionTypes = 13, }; pub const TrustedDomainNameInformation = TRUSTED_INFORMATION_CLASS.DomainNameInformation; pub const TrustedControllersInformation = TRUSTED_INFORMATION_CLASS.ControllersInformation; pub const TrustedPosixOffsetInformation = TRUSTED_INFORMATION_CLASS.PosixOffsetInformation; pub const TrustedPasswordInformation = TRUSTED_INFORMATION_CLASS.PasswordInformation; pub const TrustedDomainInformationBasic = TRUSTED_INFORMATION_CLASS.DomainInformationBasic; pub const TrustedDomainInformationEx = TRUSTED_INFORMATION_CLASS.DomainInformationEx; pub const TrustedDomainAuthInformation = TRUSTED_INFORMATION_CLASS.DomainAuthInformation; pub const TrustedDomainFullInformation = TRUSTED_INFORMATION_CLASS.DomainFullInformation; pub const TrustedDomainAuthInformationInternal = TRUSTED_INFORMATION_CLASS.DomainAuthInformationInternal; pub const TrustedDomainFullInformationInternal = TRUSTED_INFORMATION_CLASS.DomainFullInformationInternal; pub const TrustedDomainInformationEx2Internal = TRUSTED_INFORMATION_CLASS.DomainInformationEx2Internal; pub const TrustedDomainFullInformation2Internal = TRUSTED_INFORMATION_CLASS.DomainFullInformation2Internal; pub const TrustedDomainSupportedEncryptionTypes = TRUSTED_INFORMATION_CLASS.DomainSupportedEncryptionTypes; pub const TRUSTED_DOMAIN_NAME_INFO = extern struct { Name: UNICODE_STRING, }; pub const TRUSTED_CONTROLLERS_INFO = extern struct { Entries: u32, Names: ?*UNICODE_STRING, }; pub const TRUSTED_POSIX_OFFSET_INFO = extern struct { Offset: u32, }; pub const TRUSTED_PASSWORD_INFO = extern struct { Password: UNICODE_STRING, OldPassword: UNICODE_STRING, }; pub const TRUSTED_DOMAIN_INFORMATION_EX = extern struct { Name: UNICODE_STRING, FlatName: UNICODE_STRING, Sid: ?PSID, TrustDirection: TRUSTED_DOMAIN_TRUST_DIRECTION, TrustType: TRUSTED_DOMAIN_TRUST_TYPE, TrustAttributes: TRUSTED_DOMAIN_TRUST_ATTRIBUTES, }; pub const TRUSTED_DOMAIN_INFORMATION_EX2 = extern struct { Name: UNICODE_STRING, FlatName: UNICODE_STRING, Sid: ?PSID, TrustDirection: u32, TrustType: u32, TrustAttributes: u32, ForestTrustLength: u32, ForestTrustInfo: ?*u8, }; pub const LSA_AUTH_INFORMATION = extern struct { LastUpdateTime: LARGE_INTEGER, AuthType: LSA_AUTH_INFORMATION_AUTH_TYPE, AuthInfoLength: u32, AuthInfo: ?*u8, }; pub const TRUSTED_DOMAIN_AUTH_INFORMATION = extern struct { IncomingAuthInfos: u32, IncomingAuthenticationInformation: ?*LSA_AUTH_INFORMATION, IncomingPreviousAuthenticationInformation: ?*LSA_AUTH_INFORMATION, OutgoingAuthInfos: u32, OutgoingAuthenticationInformation: ?*LSA_AUTH_INFORMATION, OutgoingPreviousAuthenticationInformation: ?*LSA_AUTH_INFORMATION, }; pub const TRUSTED_DOMAIN_FULL_INFORMATION = extern struct { Information: TRUSTED_DOMAIN_INFORMATION_EX, PosixOffset: TRUSTED_POSIX_OFFSET_INFO, AuthInformation: TRUSTED_DOMAIN_AUTH_INFORMATION, }; pub const TRUSTED_DOMAIN_FULL_INFORMATION2 = extern struct { Information: TRUSTED_DOMAIN_INFORMATION_EX2, PosixOffset: TRUSTED_POSIX_OFFSET_INFO, AuthInformation: TRUSTED_DOMAIN_AUTH_INFORMATION, }; pub const TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES = extern struct { SupportedEncryptionTypes: u32, }; pub const LSA_FOREST_TRUST_RECORD_TYPE = enum(i32) { TopLevelName = 0, TopLevelNameEx = 1, DomainInfo = 2, // RecordTypeLast = 2, this enum value conflicts with DomainInfo }; pub const ForestTrustTopLevelName = LSA_FOREST_TRUST_RECORD_TYPE.TopLevelName; pub const ForestTrustTopLevelNameEx = LSA_FOREST_TRUST_RECORD_TYPE.TopLevelNameEx; pub const ForestTrustDomainInfo = LSA_FOREST_TRUST_RECORD_TYPE.DomainInfo; pub const ForestTrustRecordTypeLast = LSA_FOREST_TRUST_RECORD_TYPE.DomainInfo; pub const LSA_FOREST_TRUST_DOMAIN_INFO = extern struct { Sid: ?PSID, DnsName: UNICODE_STRING, NetbiosName: UNICODE_STRING, }; pub const LSA_FOREST_TRUST_BINARY_DATA = extern struct { Length: u32, Buffer: ?*u8, }; pub const LSA_FOREST_TRUST_RECORD = extern struct { Flags: u32, ForestTrustType: LSA_FOREST_TRUST_RECORD_TYPE, Time: LARGE_INTEGER, ForestTrustData: extern union { TopLevelName: UNICODE_STRING, DomainInfo: LSA_FOREST_TRUST_DOMAIN_INFO, Data: LSA_FOREST_TRUST_BINARY_DATA, }, }; pub const LSA_FOREST_TRUST_INFORMATION = extern struct { RecordCount: u32, Entries: ?*?*LSA_FOREST_TRUST_RECORD, }; pub const LSA_FOREST_TRUST_COLLISION_RECORD_TYPE = enum(i32) { Tdo = 0, Xref = 1, Other = 2, }; pub const CollisionTdo = LSA_FOREST_TRUST_COLLISION_RECORD_TYPE.Tdo; pub const CollisionXref = LSA_FOREST_TRUST_COLLISION_RECORD_TYPE.Xref; pub const CollisionOther = LSA_FOREST_TRUST_COLLISION_RECORD_TYPE.Other; pub const LSA_FOREST_TRUST_COLLISION_RECORD = extern struct { Index: u32, Type: LSA_FOREST_TRUST_COLLISION_RECORD_TYPE, Flags: u32, Name: UNICODE_STRING, }; pub const LSA_FOREST_TRUST_COLLISION_INFORMATION = extern struct { RecordCount: u32, Entries: ?*?*LSA_FOREST_TRUST_COLLISION_RECORD, }; pub const LSA_ENUMERATION_INFORMATION = extern struct { Sid: ?PSID, }; pub const LSA_LAST_INTER_LOGON_INFO = extern struct { LastSuccessfulLogon: LARGE_INTEGER, LastFailedLogon: LARGE_INTEGER, FailedAttemptCountSinceLastSuccessfulLogon: u32, }; pub const SECURITY_LOGON_SESSION_DATA = extern struct { Size: u32, LogonId: LUID, UserName: UNICODE_STRING, LogonDomain: UNICODE_STRING, AuthenticationPackage: UNICODE_STRING, LogonType: u32, Session: u32, Sid: ?PSID, LogonTime: LARGE_INTEGER, LogonServer: UNICODE_STRING, DnsDomainName: UNICODE_STRING, Upn: UNICODE_STRING, UserFlags: u32, LastLogonInfo: LSA_LAST_INTER_LOGON_INFO, LogonScript: UNICODE_STRING, ProfilePath: UNICODE_STRING, HomeDirectory: UNICODE_STRING, HomeDirectoryDrive: UNICODE_STRING, LogoffTime: LARGE_INTEGER, KickOffTime: LARGE_INTEGER, PasswordLastSet: LARGE_INTEGER, PasswordCanChange: LARGE_INTEGER, PasswordMustChange: LARGE_INTEGER, }; pub const CENTRAL_ACCESS_POLICY_ENTRY = extern struct { Name: UNICODE_STRING, Description: UNICODE_STRING, ChangeId: UNICODE_STRING, LengthAppliesTo: u32, AppliesTo: ?*u8, LengthSD: u32, SD: ?*SECURITY_DESCRIPTOR, LengthStagedSD: u32, StagedSD: ?*SECURITY_DESCRIPTOR, Flags: u32, }; pub const CENTRAL_ACCESS_POLICY = extern struct { CAPID: ?PSID, Name: UNICODE_STRING, Description: UNICODE_STRING, ChangeId: UNICODE_STRING, Flags: u32, CAPECount: u32, CAPEs: ?*?*CENTRAL_ACCESS_POLICY_ENTRY, }; pub const NEGOTIATE_MESSAGES = enum(i32) { EnumPackagePrefixes = 0, GetCallerName = 1, TransferCredentials = 2, MsgReserved1 = 3, CallPackageMax = 4, }; pub const NegEnumPackagePrefixes = NEGOTIATE_MESSAGES.EnumPackagePrefixes; pub const NegGetCallerName = NEGOTIATE_MESSAGES.GetCallerName; pub const NegTransferCredentials = NEGOTIATE_MESSAGES.TransferCredentials; pub const NegMsgReserved1 = NEGOTIATE_MESSAGES.MsgReserved1; pub const NegCallPackageMax = NEGOTIATE_MESSAGES.CallPackageMax; pub const NEGOTIATE_PACKAGE_PREFIX = extern struct { PackageId: usize, PackageDataA: ?*c_void, PackageDataW: ?*c_void, PrefixLen: usize, Prefix: [32]u8, }; pub const NEGOTIATE_PACKAGE_PREFIXES = extern struct { MessageType: u32, PrefixCount: u32, Offset: u32, Pad: u32, }; pub const NEGOTIATE_CALLER_NAME_REQUEST = extern struct { MessageType: u32, LogonId: LUID, }; pub const NEGOTIATE_CALLER_NAME_RESPONSE = extern struct { MessageType: u32, CallerName: ?PWSTR, }; pub const DOMAIN_PASSWORD_INFORMATION = extern struct { MinPasswordLength: u16, PasswordHistoryLength: u16, PasswordProperties: DOMAIN_PASSWORD_PROPERTIES, MaxPasswordAge: LARGE_INTEGER, MinPasswordAge: LARGE_INTEGER, }; pub const PSAM_PASSWORD_NOTIFICATION_ROUTINE = fn( UserName: ?*UNICODE_STRING, RelativeId: u32, NewPassword: ?*UNICODE_STRING, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PSAM_INIT_NOTIFICATION_ROUTINE = fn( ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; pub const PSAM_PASSWORD_FILTER_ROUTINE = fn( AccountName: ?*UNICODE_STRING, FullName: ?*UNICODE_STRING, Password: ?*UNICODE_STRING, SetOperation: BOOLEAN, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; pub const MSV1_0_LOGON_SUBMIT_TYPE = enum(i32) { InteractiveLogon = 2, Lm20Logon = 3, NetworkLogon = 4, SubAuthLogon = 5, WorkstationUnlockLogon = 7, S4ULogon = 12, VirtualLogon = 82, NoElevationLogon = 83, LuidLogon = 84, }; pub const MsV1_0InteractiveLogon = MSV1_0_LOGON_SUBMIT_TYPE.InteractiveLogon; pub const MsV1_0Lm20Logon = MSV1_0_LOGON_SUBMIT_TYPE.Lm20Logon; pub const MsV1_0NetworkLogon = MSV1_0_LOGON_SUBMIT_TYPE.NetworkLogon; pub const MsV1_0SubAuthLogon = MSV1_0_LOGON_SUBMIT_TYPE.SubAuthLogon; pub const MsV1_0WorkstationUnlockLogon = MSV1_0_LOGON_SUBMIT_TYPE.WorkstationUnlockLogon; pub const MsV1_0S4ULogon = MSV1_0_LOGON_SUBMIT_TYPE.S4ULogon; pub const MsV1_0VirtualLogon = MSV1_0_LOGON_SUBMIT_TYPE.VirtualLogon; pub const MsV1_0NoElevationLogon = MSV1_0_LOGON_SUBMIT_TYPE.NoElevationLogon; pub const MsV1_0LuidLogon = MSV1_0_LOGON_SUBMIT_TYPE.LuidLogon; pub const MSV1_0_PROFILE_BUFFER_TYPE = enum(i32) { InteractiveProfile = 2, Lm20LogonProfile = 3, SmartCardProfile = 4, }; pub const MsV1_0InteractiveProfile = MSV1_0_PROFILE_BUFFER_TYPE.InteractiveProfile; pub const MsV1_0Lm20LogonProfile = MSV1_0_PROFILE_BUFFER_TYPE.Lm20LogonProfile; pub const MsV1_0SmartCardProfile = MSV1_0_PROFILE_BUFFER_TYPE.SmartCardProfile; pub const MSV1_0_INTERACTIVE_LOGON = extern struct { MessageType: MSV1_0_LOGON_SUBMIT_TYPE, LogonDomainName: UNICODE_STRING, UserName: UNICODE_STRING, Password: UNICODE_STRING, }; pub const MSV1_0_INTERACTIVE_PROFILE = extern struct { MessageType: MSV1_0_PROFILE_BUFFER_TYPE, LogonCount: u16, BadPasswordCount: u16, LogonTime: LARGE_INTEGER, LogoffTime: LARGE_INTEGER, KickOffTime: LARGE_INTEGER, PasswordLastSet: LARGE_INTEGER, PasswordCanChange: LARGE_INTEGER, PasswordMustChange: LARGE_INTEGER, LogonScript: UNICODE_STRING, HomeDirectory: UNICODE_STRING, FullName: UNICODE_STRING, ProfilePath: UNICODE_STRING, HomeDirectoryDrive: UNICODE_STRING, LogonServer: UNICODE_STRING, UserFlags: u32, }; pub const MSV1_0_LM20_LOGON = extern struct { MessageType: MSV1_0_LOGON_SUBMIT_TYPE, LogonDomainName: UNICODE_STRING, UserName: UNICODE_STRING, Workstation: UNICODE_STRING, ChallengeToClient: [8]u8, CaseSensitiveChallengeResponse: STRING, CaseInsensitiveChallengeResponse: STRING, ParameterControl: u32, }; pub const MSV1_0_SUBAUTH_LOGON = extern struct { MessageType: MSV1_0_LOGON_SUBMIT_TYPE, LogonDomainName: UNICODE_STRING, UserName: UNICODE_STRING, Workstation: UNICODE_STRING, ChallengeToClient: [8]u8, AuthenticationInfo1: STRING, AuthenticationInfo2: STRING, ParameterControl: MSV_SUBAUTH_LOGON_PARAMETER_CONTROL, SubAuthPackageId: u32, }; pub const MSV1_0_S4U_LOGON = extern struct { MessageType: MSV1_0_LOGON_SUBMIT_TYPE, Flags: u32, UserPrincipalName: UNICODE_STRING, DomainName: UNICODE_STRING, }; pub const MSV1_0_LM20_LOGON_PROFILE = extern struct { MessageType: MSV1_0_PROFILE_BUFFER_TYPE, KickOffTime: LARGE_INTEGER, LogoffTime: LARGE_INTEGER, UserFlags: MSV_SUB_AUTHENTICATION_FILTER, UserSessionKey: [16]u8, LogonDomainName: UNICODE_STRING, LanmanSessionKey: [8]u8, LogonServer: UNICODE_STRING, UserParameters: UNICODE_STRING, }; pub const MSV1_0_CREDENTIAL_KEY_TYPE = enum(i32) { InvalidCredKey = 0, DeprecatedIUMCredKey = 1, DomainUserCredKey = 2, LocalUserCredKey = 3, ExternallySuppliedCredKey = 4, }; pub const InvalidCredKey = MSV1_0_CREDENTIAL_KEY_TYPE.InvalidCredKey; pub const DeprecatedIUMCredKey = MSV1_0_CREDENTIAL_KEY_TYPE.DeprecatedIUMCredKey; pub const DomainUserCredKey = MSV1_0_CREDENTIAL_KEY_TYPE.DomainUserCredKey; pub const LocalUserCredKey = MSV1_0_CREDENTIAL_KEY_TYPE.LocalUserCredKey; pub const ExternallySuppliedCredKey = MSV1_0_CREDENTIAL_KEY_TYPE.ExternallySuppliedCredKey; pub const MSV1_0_CREDENTIAL_KEY = extern struct { Data: [20]u8, }; pub const MSV1_0_SUPPLEMENTAL_CREDENTIAL = extern struct { Version: u32, Flags: MSV_SUPPLEMENTAL_CREDENTIAL_FLAGS, LmPassword: [16]u8, NtPassword: [16]u8, }; pub const MSV1_0_SUPPLEMENTAL_CREDENTIAL_V2 = extern struct { Version: u32, Flags: u32, NtPassword: [16]u8, CredentialKey: MSV1_0_CREDENTIAL_KEY, }; pub const MSV1_0_SUPPLEMENTAL_CREDENTIAL_V3 = extern struct { Version: u32, Flags: u32, CredentialKeyType: MSV1_0_CREDENTIAL_KEY_TYPE, NtPassword: [16]u8, CredentialKey: MSV1_0_CREDENTIAL_KEY, ShaPassword: [20]u8, }; pub const MSV1_0_IUM_SUPPLEMENTAL_CREDENTIAL = extern struct { Version: u32, EncryptedCredsSize: u32, EncryptedCreds: [1]u8, }; pub const MSV1_0_REMOTE_SUPPLEMENTAL_CREDENTIAL = packed struct { Version: u32, Flags: u32, CredentialKey: MSV1_0_CREDENTIAL_KEY, CredentialKeyType: MSV1_0_CREDENTIAL_KEY_TYPE, EncryptedCredsSize: u32, EncryptedCreds: [1]u8, }; pub const MSV1_0_NTLM3_RESPONSE = extern struct { Response: [16]u8, RespType: u8, HiRespType: u8, Flags: u16, MsgWord: u32, TimeStamp: u64, ChallengeFromClient: [8]u8, AvPairsOff: u32, Buffer: [1]u8, }; pub const MSV1_0_AVID = enum(i32) { EOL = 0, NbComputerName = 1, NbDomainName = 2, DnsComputerName = 3, DnsDomainName = 4, DnsTreeName = 5, Flags = 6, Timestamp = 7, Restrictions = 8, TargetName = 9, ChannelBindings = 10, }; pub const MsvAvEOL = MSV1_0_AVID.EOL; pub const MsvAvNbComputerName = MSV1_0_AVID.NbComputerName; pub const MsvAvNbDomainName = MSV1_0_AVID.NbDomainName; pub const MsvAvDnsComputerName = MSV1_0_AVID.DnsComputerName; pub const MsvAvDnsDomainName = MSV1_0_AVID.DnsDomainName; pub const MsvAvDnsTreeName = MSV1_0_AVID.DnsTreeName; pub const MsvAvFlags = MSV1_0_AVID.Flags; pub const MsvAvTimestamp = MSV1_0_AVID.Timestamp; pub const MsvAvRestrictions = MSV1_0_AVID.Restrictions; pub const MsvAvTargetName = MSV1_0_AVID.TargetName; pub const MsvAvChannelBindings = MSV1_0_AVID.ChannelBindings; pub const MSV1_0_AV_PAIR = extern struct { AvId: u16, AvLen: u16, }; pub const MSV1_0_PROTOCOL_MESSAGE_TYPE = enum(i32) { Lm20ChallengeRequest = 0, Lm20GetChallengeResponse = 1, EnumerateUsers = 2, GetUserInfo = 3, ReLogonUsers = 4, ChangePassword = 5, ChangeCachedPassword = 6, GenericPassthrough = 7, CacheLogon = 8, SubAuth = 9, DeriveCredential = 10, CacheLookup = 11, SetProcessOption = 12, ConfigLocalAliases = 13, ClearCachedCredentials = 14, LookupToken = 15, ValidateAuth = 16, CacheLookupEx = 17, GetCredentialKey = 18, SetThreadOption = 19, DecryptDpapiMasterKey = 20, GetStrongCredentialKey = 21, TransferCred = 22, ProvisionTbal = 23, DeleteTbalSecrets = 24, }; pub const MsV1_0Lm20ChallengeRequest = MSV1_0_PROTOCOL_MESSAGE_TYPE.Lm20ChallengeRequest; pub const MsV1_0Lm20GetChallengeResponse = MSV1_0_PROTOCOL_MESSAGE_TYPE.Lm20GetChallengeResponse; pub const MsV1_0EnumerateUsers = MSV1_0_PROTOCOL_MESSAGE_TYPE.EnumerateUsers; pub const MsV1_0GetUserInfo = MSV1_0_PROTOCOL_MESSAGE_TYPE.GetUserInfo; pub const MsV1_0ReLogonUsers = MSV1_0_PROTOCOL_MESSAGE_TYPE.ReLogonUsers; pub const MsV1_0ChangePassword = MSV1_0_PROTOCOL_MESSAGE_TYPE.ChangePassword; pub const MsV1_0ChangeCachedPassword = MSV1_0_PROTOCOL_MESSAGE_TYPE.ChangeCachedPassword; pub const MsV1_0GenericPassthrough = MSV1_0_PROTOCOL_MESSAGE_TYPE.GenericPassthrough; pub const MsV1_0CacheLogon = MSV1_0_PROTOCOL_MESSAGE_TYPE.CacheLogon; pub const MsV1_0SubAuth = MSV1_0_PROTOCOL_MESSAGE_TYPE.SubAuth; pub const MsV1_0DeriveCredential = MSV1_0_PROTOCOL_MESSAGE_TYPE.DeriveCredential; pub const MsV1_0CacheLookup = MSV1_0_PROTOCOL_MESSAGE_TYPE.CacheLookup; pub const MsV1_0SetProcessOption = MSV1_0_PROTOCOL_MESSAGE_TYPE.SetProcessOption; pub const MsV1_0ConfigLocalAliases = MSV1_0_PROTOCOL_MESSAGE_TYPE.ConfigLocalAliases; pub const MsV1_0ClearCachedCredentials = MSV1_0_PROTOCOL_MESSAGE_TYPE.ClearCachedCredentials; pub const MsV1_0LookupToken = MSV1_0_PROTOCOL_MESSAGE_TYPE.LookupToken; pub const MsV1_0ValidateAuth = MSV1_0_PROTOCOL_MESSAGE_TYPE.ValidateAuth; pub const MsV1_0CacheLookupEx = MSV1_0_PROTOCOL_MESSAGE_TYPE.CacheLookupEx; pub const MsV1_0GetCredentialKey = MSV1_0_PROTOCOL_MESSAGE_TYPE.GetCredentialKey; pub const MsV1_0SetThreadOption = MSV1_0_PROTOCOL_MESSAGE_TYPE.SetThreadOption; pub const MsV1_0DecryptDpapiMasterKey = MSV1_0_PROTOCOL_MESSAGE_TYPE.DecryptDpapiMasterKey; pub const MsV1_0GetStrongCredentialKey = MSV1_0_PROTOCOL_MESSAGE_TYPE.GetStrongCredentialKey; pub const MsV1_0TransferCred = MSV1_0_PROTOCOL_MESSAGE_TYPE.TransferCred; pub const MsV1_0ProvisionTbal = MSV1_0_PROTOCOL_MESSAGE_TYPE.ProvisionTbal; pub const MsV1_0DeleteTbalSecrets = MSV1_0_PROTOCOL_MESSAGE_TYPE.DeleteTbalSecrets; pub const MSV1_0_CHANGEPASSWORD_REQUEST = extern struct { MessageType: MSV1_0_PROTOCOL_MESSAGE_TYPE, DomainName: UNICODE_STRING, AccountName: UNICODE_STRING, OldPassword: UNICODE_STRING, NewPassword: UNICODE_STRING, Impersonating: BOOLEAN, }; pub const MSV1_0_CHANGEPASSWORD_RESPONSE = extern struct { MessageType: MSV1_0_PROTOCOL_MESSAGE_TYPE, PasswordInfoValid: BOOLEAN, DomainPasswordInfo: DOMAIN_PASSWORD_INFORMATION, }; pub const MSV1_0_PASSTHROUGH_REQUEST = extern struct { MessageType: MSV1_0_PROTOCOL_MESSAGE_TYPE, DomainName: UNICODE_STRING, PackageName: UNICODE_STRING, DataLength: u32, LogonData: ?*u8, Pad: u32, }; pub const MSV1_0_PASSTHROUGH_RESPONSE = extern struct { MessageType: MSV1_0_PROTOCOL_MESSAGE_TYPE, Pad: u32, DataLength: u32, ValidationData: ?*u8, }; pub const MSV1_0_SUBAUTH_REQUEST = extern struct { MessageType: MSV1_0_PROTOCOL_MESSAGE_TYPE, SubAuthPackageId: u32, SubAuthInfoLength: u32, SubAuthSubmitBuffer: ?*u8, }; pub const MSV1_0_SUBAUTH_RESPONSE = extern struct { MessageType: MSV1_0_PROTOCOL_MESSAGE_TYPE, SubAuthInfoLength: u32, SubAuthReturnBuffer: ?*u8, }; pub const KERB_LOGON_SUBMIT_TYPE = enum(i32) { InteractiveLogon = 2, SmartCardLogon = 6, WorkstationUnlockLogon = 7, SmartCardUnlockLogon = 8, ProxyLogon = 9, TicketLogon = 10, TicketUnlockLogon = 11, S4ULogon = 12, CertificateLogon = 13, CertificateS4ULogon = 14, CertificateUnlockLogon = 15, NoElevationLogon = 83, LuidLogon = 84, }; pub const KerbInteractiveLogon = KERB_LOGON_SUBMIT_TYPE.InteractiveLogon; pub const KerbSmartCardLogon = KERB_LOGON_SUBMIT_TYPE.SmartCardLogon; pub const KerbWorkstationUnlockLogon = KERB_LOGON_SUBMIT_TYPE.WorkstationUnlockLogon; pub const KerbSmartCardUnlockLogon = KERB_LOGON_SUBMIT_TYPE.SmartCardUnlockLogon; pub const KerbProxyLogon = KERB_LOGON_SUBMIT_TYPE.ProxyLogon; pub const KerbTicketLogon = KERB_LOGON_SUBMIT_TYPE.TicketLogon; pub const KerbTicketUnlockLogon = KERB_LOGON_SUBMIT_TYPE.TicketUnlockLogon; pub const KerbS4ULogon = KERB_LOGON_SUBMIT_TYPE.S4ULogon; pub const KerbCertificateLogon = KERB_LOGON_SUBMIT_TYPE.CertificateLogon; pub const KerbCertificateS4ULogon = KERB_LOGON_SUBMIT_TYPE.CertificateS4ULogon; pub const KerbCertificateUnlockLogon = KERB_LOGON_SUBMIT_TYPE.CertificateUnlockLogon; pub const KerbNoElevationLogon = KERB_LOGON_SUBMIT_TYPE.NoElevationLogon; pub const KerbLuidLogon = KERB_LOGON_SUBMIT_TYPE.LuidLogon; pub const KERB_INTERACTIVE_LOGON = extern struct { MessageType: KERB_LOGON_SUBMIT_TYPE, LogonDomainName: UNICODE_STRING, UserName: UNICODE_STRING, Password: UNICODE_STRING, }; pub const KERB_INTERACTIVE_UNLOCK_LOGON = extern struct { Logon: KERB_INTERACTIVE_LOGON, LogonId: LUID, }; pub const KERB_SMART_CARD_LOGON = extern struct { MessageType: KERB_LOGON_SUBMIT_TYPE, Pin: UNICODE_STRING, CspDataLength: u32, CspData: ?*u8, }; pub const KERB_SMART_CARD_UNLOCK_LOGON = extern struct { Logon: KERB_SMART_CARD_LOGON, LogonId: LUID, }; pub const KERB_CERTIFICATE_LOGON = extern struct { MessageType: KERB_LOGON_SUBMIT_TYPE, DomainName: UNICODE_STRING, UserName: UNICODE_STRING, Pin: UNICODE_STRING, Flags: u32, CspDataLength: u32, CspData: ?*u8, }; pub const KERB_CERTIFICATE_UNLOCK_LOGON = extern struct { Logon: KERB_CERTIFICATE_LOGON, LogonId: LUID, }; pub const KERB_CERTIFICATE_S4U_LOGON = extern struct { MessageType: KERB_LOGON_SUBMIT_TYPE, Flags: u32, UserPrincipalName: UNICODE_STRING, DomainName: UNICODE_STRING, CertificateLength: u32, Certificate: ?*u8, }; pub const KERB_TICKET_LOGON = extern struct { MessageType: KERB_LOGON_SUBMIT_TYPE, Flags: u32, ServiceTicketLength: u32, TicketGrantingTicketLength: u32, ServiceTicket: ?*u8, TicketGrantingTicket: ?*u8, }; pub const KERB_TICKET_UNLOCK_LOGON = extern struct { Logon: KERB_TICKET_LOGON, LogonId: LUID, }; pub const KERB_S4U_LOGON = extern struct { MessageType: KERB_LOGON_SUBMIT_TYPE, Flags: u32, ClientUpn: UNICODE_STRING, ClientRealm: UNICODE_STRING, }; pub const KERB_PROFILE_BUFFER_TYPE = enum(i32) { InteractiveProfile = 2, SmartCardProfile = 4, TicketProfile = 6, }; pub const KerbInteractiveProfile = KERB_PROFILE_BUFFER_TYPE.InteractiveProfile; pub const KerbSmartCardProfile = KERB_PROFILE_BUFFER_TYPE.SmartCardProfile; pub const KerbTicketProfile = KERB_PROFILE_BUFFER_TYPE.TicketProfile; pub const KERB_INTERACTIVE_PROFILE = extern struct { MessageType: KERB_PROFILE_BUFFER_TYPE, LogonCount: u16, BadPasswordCount: u16, LogonTime: LARGE_INTEGER, LogoffTime: LARGE_INTEGER, KickOffTime: LARGE_INTEGER, PasswordLastSet: LARGE_INTEGER, PasswordCanChange: LARGE_INTEGER, PasswordMustChange: LARGE_INTEGER, LogonScript: UNICODE_STRING, HomeDirectory: UNICODE_STRING, FullName: UNICODE_STRING, ProfilePath: UNICODE_STRING, HomeDirectoryDrive: UNICODE_STRING, LogonServer: UNICODE_STRING, UserFlags: u32, }; pub const KERB_SMART_CARD_PROFILE = extern struct { Profile: KERB_INTERACTIVE_PROFILE, CertificateSize: u32, CertificateData: ?*u8, }; pub const KERB_CRYPTO_KEY = extern struct { KeyType: KERB_CRYPTO_KEY_TYPE, Length: u32, Value: ?*u8, }; pub const KERB_CRYPTO_KEY32 = extern struct { KeyType: i32, Length: u32, Offset: u32, }; pub const KERB_TICKET_PROFILE = extern struct { Profile: KERB_INTERACTIVE_PROFILE, SessionKey: KERB_CRYPTO_KEY, }; pub const KERB_PROTOCOL_MESSAGE_TYPE = enum(i32) { DebugRequestMessage = 0, QueryTicketCacheMessage = 1, ChangeMachinePasswordMessage = 2, VerifyPacMessage = 3, RetrieveTicketMessage = 4, UpdateAddressesMessage = 5, PurgeTicketCacheMessage = 6, ChangePasswordMessage = 7, RetrieveEncodedTicketMessage = 8, DecryptDataMessage = 9, AddBindingCacheEntryMessage = 10, SetPasswordMessage = 11, SetPasswordExMessage = 12, VerifyCredentialsMessage = 13, QueryTicketCacheExMessage = 14, PurgeTicketCacheExMessage = 15, RefreshSmartcardCredentialsMessage = 16, AddExtraCredentialsMessage = 17, QuerySupplementalCredentialsMessage = 18, TransferCredentialsMessage = 19, QueryTicketCacheEx2Message = 20, SubmitTicketMessage = 21, AddExtraCredentialsExMessage = 22, QueryKdcProxyCacheMessage = 23, PurgeKdcProxyCacheMessage = 24, QueryTicketCacheEx3Message = 25, CleanupMachinePkinitCredsMessage = 26, AddBindingCacheEntryExMessage = 27, QueryBindingCacheMessage = 28, PurgeBindingCacheMessage = 29, PinKdcMessage = 30, UnpinAllKdcsMessage = 31, QueryDomainExtendedPoliciesMessage = 32, QueryS4U2ProxyCacheMessage = 33, RetrieveKeyTabMessage = 34, }; pub const KerbDebugRequestMessage = KERB_PROTOCOL_MESSAGE_TYPE.DebugRequestMessage; pub const KerbQueryTicketCacheMessage = KERB_PROTOCOL_MESSAGE_TYPE.QueryTicketCacheMessage; pub const KerbChangeMachinePasswordMessage = KERB_PROTOCOL_MESSAGE_TYPE.ChangeMachinePasswordMessage; pub const KerbVerifyPacMessage = KERB_PROTOCOL_MESSAGE_TYPE.VerifyPacMessage; pub const KerbRetrieveTicketMessage = KERB_PROTOCOL_MESSAGE_TYPE.RetrieveTicketMessage; pub const KerbUpdateAddressesMessage = KERB_PROTOCOL_MESSAGE_TYPE.UpdateAddressesMessage; pub const KerbPurgeTicketCacheMessage = KERB_PROTOCOL_MESSAGE_TYPE.PurgeTicketCacheMessage; pub const KerbChangePasswordMessage = KERB_PROTOCOL_MESSAGE_TYPE.ChangePasswordMessage; pub const KerbRetrieveEncodedTicketMessage = KERB_PROTOCOL_MESSAGE_TYPE.RetrieveEncodedTicketMessage; pub const KerbDecryptDataMessage = KERB_PROTOCOL_MESSAGE_TYPE.DecryptDataMessage; pub const KerbAddBindingCacheEntryMessage = KERB_PROTOCOL_MESSAGE_TYPE.AddBindingCacheEntryMessage; pub const KerbSetPasswordMessage = KERB_PROTOCOL_MESSAGE_TYPE.SetPasswordMessage; pub const KerbSetPasswordExMessage = KERB_PROTOCOL_MESSAGE_TYPE.SetPasswordExMessage; pub const KerbVerifyCredentialsMessage = KERB_PROTOCOL_MESSAGE_TYPE.VerifyCredentialsMessage; pub const KerbQueryTicketCacheExMessage = KERB_PROTOCOL_MESSAGE_TYPE.QueryTicketCacheExMessage; pub const KerbPurgeTicketCacheExMessage = KERB_PROTOCOL_MESSAGE_TYPE.PurgeTicketCacheExMessage; pub const KerbRefreshSmartcardCredentialsMessage = KERB_PROTOCOL_MESSAGE_TYPE.RefreshSmartcardCredentialsMessage; pub const KerbAddExtraCredentialsMessage = KERB_PROTOCOL_MESSAGE_TYPE.AddExtraCredentialsMessage; pub const KerbQuerySupplementalCredentialsMessage = KERB_PROTOCOL_MESSAGE_TYPE.QuerySupplementalCredentialsMessage; pub const KerbTransferCredentialsMessage = KERB_PROTOCOL_MESSAGE_TYPE.TransferCredentialsMessage; pub const KerbQueryTicketCacheEx2Message = KERB_PROTOCOL_MESSAGE_TYPE.QueryTicketCacheEx2Message; pub const KerbSubmitTicketMessage = KERB_PROTOCOL_MESSAGE_TYPE.SubmitTicketMessage; pub const KerbAddExtraCredentialsExMessage = KERB_PROTOCOL_MESSAGE_TYPE.AddExtraCredentialsExMessage; pub const KerbQueryKdcProxyCacheMessage = KERB_PROTOCOL_MESSAGE_TYPE.QueryKdcProxyCacheMessage; pub const KerbPurgeKdcProxyCacheMessage = KERB_PROTOCOL_MESSAGE_TYPE.PurgeKdcProxyCacheMessage; pub const KerbQueryTicketCacheEx3Message = KERB_PROTOCOL_MESSAGE_TYPE.QueryTicketCacheEx3Message; pub const KerbCleanupMachinePkinitCredsMessage = KERB_PROTOCOL_MESSAGE_TYPE.CleanupMachinePkinitCredsMessage; pub const KerbAddBindingCacheEntryExMessage = KERB_PROTOCOL_MESSAGE_TYPE.AddBindingCacheEntryExMessage; pub const KerbQueryBindingCacheMessage = KERB_PROTOCOL_MESSAGE_TYPE.QueryBindingCacheMessage; pub const KerbPurgeBindingCacheMessage = KERB_PROTOCOL_MESSAGE_TYPE.PurgeBindingCacheMessage; pub const KerbPinKdcMessage = KERB_PROTOCOL_MESSAGE_TYPE.PinKdcMessage; pub const KerbUnpinAllKdcsMessage = KERB_PROTOCOL_MESSAGE_TYPE.UnpinAllKdcsMessage; pub const KerbQueryDomainExtendedPoliciesMessage = KERB_PROTOCOL_MESSAGE_TYPE.QueryDomainExtendedPoliciesMessage; pub const KerbQueryS4U2ProxyCacheMessage = KERB_PROTOCOL_MESSAGE_TYPE.QueryS4U2ProxyCacheMessage; pub const KerbRetrieveKeyTabMessage = KERB_PROTOCOL_MESSAGE_TYPE.RetrieveKeyTabMessage; pub const KERB_QUERY_TKT_CACHE_REQUEST = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, LogonId: LUID, }; pub const KERB_TICKET_CACHE_INFO = extern struct { ServerName: UNICODE_STRING, RealmName: UNICODE_STRING, StartTime: LARGE_INTEGER, EndTime: LARGE_INTEGER, RenewTime: LARGE_INTEGER, EncryptionType: i32, TicketFlags: KERB_TICKET_FLAGS, }; pub const KERB_TICKET_CACHE_INFO_EX = extern struct { ClientName: UNICODE_STRING, ClientRealm: UNICODE_STRING, ServerName: UNICODE_STRING, ServerRealm: UNICODE_STRING, StartTime: LARGE_INTEGER, EndTime: LARGE_INTEGER, RenewTime: LARGE_INTEGER, EncryptionType: i32, TicketFlags: u32, }; pub const KERB_TICKET_CACHE_INFO_EX2 = extern struct { ClientName: UNICODE_STRING, ClientRealm: UNICODE_STRING, ServerName: UNICODE_STRING, ServerRealm: UNICODE_STRING, StartTime: LARGE_INTEGER, EndTime: LARGE_INTEGER, RenewTime: LARGE_INTEGER, EncryptionType: i32, TicketFlags: u32, SessionKeyType: u32, BranchId: u32, }; pub const KERB_TICKET_CACHE_INFO_EX3 = extern struct { ClientName: UNICODE_STRING, ClientRealm: UNICODE_STRING, ServerName: UNICODE_STRING, ServerRealm: UNICODE_STRING, StartTime: LARGE_INTEGER, EndTime: LARGE_INTEGER, RenewTime: LARGE_INTEGER, EncryptionType: i32, TicketFlags: u32, SessionKeyType: u32, BranchId: u32, CacheFlags: u32, KdcCalled: UNICODE_STRING, }; pub const KERB_QUERY_TKT_CACHE_RESPONSE = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, CountOfTickets: u32, Tickets: [1]KERB_TICKET_CACHE_INFO, }; pub const KERB_QUERY_TKT_CACHE_EX_RESPONSE = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, CountOfTickets: u32, Tickets: [1]KERB_TICKET_CACHE_INFO_EX, }; pub const KERB_QUERY_TKT_CACHE_EX2_RESPONSE = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, CountOfTickets: u32, Tickets: [1]KERB_TICKET_CACHE_INFO_EX2, }; pub const KERB_QUERY_TKT_CACHE_EX3_RESPONSE = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, CountOfTickets: u32, Tickets: [1]KERB_TICKET_CACHE_INFO_EX3, }; pub const KERB_AUTH_DATA = extern struct { Type: u32, Length: u32, Data: ?*u8, }; pub const KERB_NET_ADDRESS = extern struct { Family: u32, Length: u32, Address: ?[*]u8, }; pub const KERB_NET_ADDRESSES = extern struct { Number: u32, Addresses: [1]KERB_NET_ADDRESS, }; pub const KERB_EXTERNAL_NAME = extern struct { NameType: i16, NameCount: u16, Names: [1]UNICODE_STRING, }; pub const KERB_EXTERNAL_TICKET = extern struct { ServiceName: ?*KERB_EXTERNAL_NAME, TargetName: ?*KERB_EXTERNAL_NAME, ClientName: ?*KERB_EXTERNAL_NAME, DomainName: UNICODE_STRING, TargetDomainName: UNICODE_STRING, AltTargetDomainName: UNICODE_STRING, SessionKey: KERB_CRYPTO_KEY, TicketFlags: KERB_TICKET_FLAGS, Flags: u32, KeyExpirationTime: LARGE_INTEGER, StartTime: LARGE_INTEGER, EndTime: LARGE_INTEGER, RenewUntil: LARGE_INTEGER, TimeSkew: LARGE_INTEGER, EncodedTicketSize: u32, EncodedTicket: ?*u8, }; pub const KERB_RETRIEVE_TKT_REQUEST = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, LogonId: LUID, TargetName: UNICODE_STRING, TicketFlags: u32, CacheOptions: u32, EncryptionType: KERB_CRYPTO_KEY_TYPE, CredentialsHandle: SecHandle, }; pub const KERB_RETRIEVE_TKT_RESPONSE = extern struct { Ticket: KERB_EXTERNAL_TICKET, }; pub const KERB_PURGE_TKT_CACHE_REQUEST = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, LogonId: LUID, ServerName: UNICODE_STRING, RealmName: UNICODE_STRING, }; pub const KERB_PURGE_TKT_CACHE_EX_REQUEST = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, LogonId: LUID, Flags: u32, TicketTemplate: KERB_TICKET_CACHE_INFO_EX, }; pub const KERB_SUBMIT_TKT_REQUEST = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, LogonId: LUID, Flags: u32, Key: KERB_CRYPTO_KEY32, KerbCredSize: u32, KerbCredOffset: u32, }; pub const KERB_QUERY_KDC_PROXY_CACHE_REQUEST = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, Flags: u32, LogonId: LUID, }; pub const KDC_PROXY_CACHE_ENTRY_DATA = extern struct { SinceLastUsed: u64, DomainName: UNICODE_STRING, ProxyServerName: UNICODE_STRING, ProxyServerVdir: UNICODE_STRING, ProxyServerPort: u16, LogonId: LUID, CredUserName: UNICODE_STRING, CredDomainName: UNICODE_STRING, GlobalCache: BOOLEAN, }; pub const KERB_QUERY_KDC_PROXY_CACHE_RESPONSE = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, CountOfEntries: u32, Entries: ?*KDC_PROXY_CACHE_ENTRY_DATA, }; pub const KERB_PURGE_KDC_PROXY_CACHE_REQUEST = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, Flags: u32, LogonId: LUID, }; pub const KERB_PURGE_KDC_PROXY_CACHE_RESPONSE = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, CountOfPurged: u32, }; pub const KERB_S4U2PROXY_CACHE_ENTRY_INFO = extern struct { ServerName: UNICODE_STRING, Flags: u32, LastStatus: NTSTATUS, Expiry: LARGE_INTEGER, }; pub const KERB_S4U2PROXY_CRED = extern struct { UserName: UNICODE_STRING, DomainName: UNICODE_STRING, Flags: u32, LastStatus: NTSTATUS, Expiry: LARGE_INTEGER, CountOfEntries: u32, Entries: ?*KERB_S4U2PROXY_CACHE_ENTRY_INFO, }; pub const KERB_QUERY_S4U2PROXY_CACHE_REQUEST = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, Flags: u32, LogonId: LUID, }; pub const KERB_QUERY_S4U2PROXY_CACHE_RESPONSE = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, CountOfCreds: u32, Creds: ?*KERB_S4U2PROXY_CRED, }; pub const KERB_RETRIEVE_KEY_TAB_REQUEST = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, Flags: u32, UserName: UNICODE_STRING, DomainName: UNICODE_STRING, Password: UNICODE_STRING, }; pub const KERB_RETRIEVE_KEY_TAB_RESPONSE = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, KeyTabLength: u32, KeyTab: ?*u8, }; pub const KERB_CHANGEPASSWORD_REQUEST = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, DomainName: UNICODE_STRING, AccountName: UNICODE_STRING, OldPassword: UNICODE_STRING, NewPassword: UNICODE_STRING, Impersonating: BOOLEAN, }; pub const KERB_SETPASSWORD_REQUEST = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, LogonId: LUID, CredentialsHandle: SecHandle, Flags: u32, DomainName: UNICODE_STRING, AccountName: UNICODE_STRING, Password: UNICODE_STRING, }; pub const KERB_SETPASSWORD_EX_REQUEST = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, LogonId: LUID, CredentialsHandle: SecHandle, Flags: u32, AccountRealm: UNICODE_STRING, AccountName: UNICODE_STRING, Password: UNICODE_STRING, ClientRealm: UNICODE_STRING, ClientName: UNICODE_STRING, Impersonating: BOOLEAN, KdcAddress: UNICODE_STRING, KdcAddressType: u32, }; pub const KERB_DECRYPT_REQUEST = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, LogonId: LUID, Flags: u32, CryptoType: i32, KeyUsage: i32, Key: KERB_CRYPTO_KEY, EncryptedDataSize: u32, InitialVectorSize: u32, InitialVector: ?*u8, EncryptedData: ?*u8, }; pub const KERB_DECRYPT_RESPONSE = extern struct { DecryptedData: [1]u8, }; pub const KERB_ADD_BINDING_CACHE_ENTRY_REQUEST = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, RealmName: UNICODE_STRING, KdcAddress: UNICODE_STRING, AddressType: KERB_ADDRESS_TYPE, }; pub const KERB_REFRESH_SCCRED_REQUEST = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, CredentialBlob: UNICODE_STRING, LogonId: LUID, Flags: u32, }; pub const KERB_ADD_CREDENTIALS_REQUEST = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, UserName: UNICODE_STRING, DomainName: UNICODE_STRING, Password: <PASSWORD>_<PASSWORD>, LogonId: LUID, Flags: KERB_REQUEST_FLAGS, }; pub const KERB_ADD_CREDENTIALS_REQUEST_EX = extern struct { Credentials: KERB_ADD_CREDENTIALS_REQUEST, PrincipalNameCount: u32, PrincipalNames: [1]UNICODE_STRING, }; pub const KERB_TRANSFER_CRED_REQUEST = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, OriginLogonId: LUID, DestinationLogonId: LUID, Flags: u32, }; pub const KERB_CLEANUP_MACHINE_PKINIT_CREDS_REQUEST = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, LogonId: LUID, }; pub const KERB_BINDING_CACHE_ENTRY_DATA = extern struct { DiscoveryTime: u64, RealmName: UNICODE_STRING, KdcAddress: UNICODE_STRING, AddressType: KERB_ADDRESS_TYPE, Flags: u32, DcFlags: u32, CacheFlags: u32, KdcName: UNICODE_STRING, }; pub const KERB_QUERY_BINDING_CACHE_RESPONSE = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, CountOfEntries: u32, Entries: ?*KERB_BINDING_CACHE_ENTRY_DATA, }; pub const KERB_ADD_BINDING_CACHE_ENTRY_EX_REQUEST = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, RealmName: UNICODE_STRING, KdcAddress: UNICODE_STRING, AddressType: KERB_ADDRESS_TYPE, DcFlags: u32, }; pub const KERB_QUERY_BINDING_CACHE_REQUEST = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, }; pub const KERB_PURGE_BINDING_CACHE_REQUEST = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, }; pub const KERB_QUERY_DOMAIN_EXTENDED_POLICIES_REQUEST = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, Flags: u32, DomainName: UNICODE_STRING, }; pub const KERB_QUERY_DOMAIN_EXTENDED_POLICIES_RESPONSE = extern struct { MessageType: KERB_PROTOCOL_MESSAGE_TYPE, Flags: u32, ExtendedPolicies: u32, DsFlags: u32, }; pub const KERB_CERTIFICATE_INFO_TYPE = enum(i32) { o = 1, }; pub const CertHashInfo = KERB_CERTIFICATE_INFO_TYPE.o; pub const KERB_CERTIFICATE_HASHINFO = extern struct { StoreNameLength: u16, HashLength: u16, }; pub const KERB_CERTIFICATE_INFO = extern struct { CertInfoSize: u32, InfoType: u32, }; pub const POLICY_AUDIT_SID_ARRAY = extern struct { UsersCount: u32, UserSidArray: ?*?PSID, }; pub const AUDIT_POLICY_INFORMATION = extern struct { AuditSubCategoryGuid: Guid, AuditingInformation: u32, AuditCategoryGuid: Guid, }; pub const PKU2U_CERT_BLOB = extern struct { CertOffset: u32, CertLength: u16, }; pub const PKU2U_CREDUI_CONTEXT = extern struct { Version: u64, cbHeaderLength: u16, cbStructureLength: u32, CertArrayCount: u16, CertArrayOffset: u32, }; pub const PKU2U_LOGON_SUBMIT_TYPE = enum(i32) { n = 14, }; pub const Pku2uCertificateS4ULogon = PKU2U_LOGON_SUBMIT_TYPE.n; pub const PKU2U_CERTIFICATE_S4U_LOGON = extern struct { MessageType: PKU2U_LOGON_SUBMIT_TYPE, Flags: u32, UserPrincipalName: UNICODE_STRING, DomainName: UNICODE_STRING, CertificateLength: u32, Certificate: ?*u8, }; pub const SecPkgInfoW = extern struct { fCapabilities: u32, wVersion: u16, wRPCID: u16, cbMaxToken: u32, Name: ?*u16, Comment: ?*u16, }; pub const SecPkgInfoA = extern struct { fCapabilities: u32, wVersion: u16, wRPCID: u16, cbMaxToken: u32, Name: ?*i8, Comment: ?*i8, }; pub const SecBuffer = extern struct { cbBuffer: u32, BufferType: u32, pvBuffer: ?*c_void, }; pub const SecBufferDesc = extern struct { ulVersion: u32, cBuffers: u32, pBuffers: ?*SecBuffer, }; pub const SEC_NEGOTIATION_INFO = extern struct { Size: u32, NameLength: u32, Name: ?*u16, Reserved: ?*c_void, }; pub const SEC_CHANNEL_BINDINGS = extern struct { dwInitiatorAddrType: u32, cbInitiatorLength: u32, dwInitiatorOffset: u32, dwAcceptorAddrType: u32, cbAcceptorLength: u32, dwAcceptorOffset: u32, cbApplicationDataLength: u32, dwApplicationDataOffset: u32, }; pub const SEC_APPLICATION_PROTOCOL_NEGOTIATION_EXT = enum(i32) { None = 0, NPN = 1, ALPN = 2, }; pub const SecApplicationProtocolNegotiationExt_None = SEC_APPLICATION_PROTOCOL_NEGOTIATION_EXT.None; pub const SecApplicationProtocolNegotiationExt_NPN = SEC_APPLICATION_PROTOCOL_NEGOTIATION_EXT.NPN; pub const SecApplicationProtocolNegotiationExt_ALPN = SEC_APPLICATION_PROTOCOL_NEGOTIATION_EXT.ALPN; pub const SEC_APPLICATION_PROTOCOL_LIST = extern struct { ProtoNegoExt: SEC_APPLICATION_PROTOCOL_NEGOTIATION_EXT, ProtocolListSize: u16, ProtocolList: [1]u8, }; pub const SEC_APPLICATION_PROTOCOLS = extern struct { ProtocolListsSize: u32, ProtocolLists: [1]SEC_APPLICATION_PROTOCOL_LIST, }; pub const SEC_SRTP_PROTECTION_PROFILES = extern struct { ProfilesSize: u16, ProfilesList: [1]u16, }; pub const SEC_SRTP_MASTER_KEY_IDENTIFIER = extern struct { MasterKeyIdentifierSize: u8, MasterKeyIdentifier: [1]u8, }; pub const SEC_TOKEN_BINDING = extern struct { MajorVersion: u8, MinorVersion: u8, KeyParametersSize: u16, KeyParameters: [1]u8, }; pub const SEC_PRESHAREDKEY = extern struct { KeySize: u16, Key: [1]u8, }; pub const SEC_PRESHAREDKEY_IDENTITY = extern struct { KeyIdentitySize: u16, KeyIdentity: [1]u8, }; pub const SEC_DTLS_MTU = extern struct { PathMTU: u16, }; pub const SEC_FLAGS = extern struct { Flags: u64, }; pub const SEC_TRAFFIC_SECRET_TYPE = enum(i32) { None = 0, Client = 1, Server = 2, }; pub const SecTrafficSecret_None = SEC_TRAFFIC_SECRET_TYPE.None; pub const SecTrafficSecret_Client = SEC_TRAFFIC_SECRET_TYPE.Client; pub const SecTrafficSecret_Server = SEC_TRAFFIC_SECRET_TYPE.Server; pub const SEC_TRAFFIC_SECRETS = extern struct { SymmetricAlgId: [64]u16, ChainingMode: [64]u16, HashAlgId: [64]u16, KeySize: u16, IvSize: u16, MsgSequenceStart: u16, MsgSequenceEnd: u16, TrafficSecretType: SEC_TRAFFIC_SECRET_TYPE, TrafficSecretSize: u16, TrafficSecret: [1]u8, }; pub const SecPkgCredentials_NamesW = extern struct { sUserName: ?*u16, }; pub const SecPkgCredentials_NamesA = extern struct { sUserName: ?*i8, }; pub const SecPkgCredentials_SSIProviderW = extern struct { sProviderName: ?*u16, ProviderInfoLength: u32, ProviderInfo: ?PSTR, }; pub const SecPkgCredentials_SSIProviderA = extern struct { sProviderName: ?*i8, ProviderInfoLength: u32, ProviderInfo: ?PSTR, }; pub const SecPkgCredentials_KdcProxySettingsW = extern struct { Version: u32, Flags: u32, ProxyServerOffset: u16, ProxyServerLength: u16, ClientTlsCredOffset: u16, ClientTlsCredLength: u16, }; pub const SecPkgCredentials_Cert = extern struct { EncodedCertSize: u32, EncodedCert: ?*u8, }; pub const SecPkgContext_SubjectAttributes = extern struct { AttributeInfo: ?*c_void, }; pub const SECPKG_CRED_CLASS = enum(i32) { None = 0, Ephemeral = 10, PersistedGeneric = 20, PersistedSpecific = 30, Explicit = 40, }; pub const SecPkgCredClass_None = SECPKG_CRED_CLASS.None; pub const SecPkgCredClass_Ephemeral = SECPKG_CRED_CLASS.Ephemeral; pub const SecPkgCredClass_PersistedGeneric = SECPKG_CRED_CLASS.PersistedGeneric; pub const SecPkgCredClass_PersistedSpecific = SECPKG_CRED_CLASS.PersistedSpecific; pub const SecPkgCredClass_Explicit = SECPKG_CRED_CLASS.Explicit; pub const SecPkgContext_CredInfo = extern struct { CredClass: SECPKG_CRED_CLASS, IsPromptingNeeded: u32, }; pub const SecPkgContext_NegoPackageInfo = extern struct { PackageMask: u32, }; pub const SecPkgContext_NegoStatus = extern struct { LastStatus: u32, }; pub const SecPkgContext_Sizes = extern struct { cbMaxToken: u32, cbMaxSignature: u32, cbBlockSize: u32, cbSecurityTrailer: u32, }; pub const SecPkgContext_StreamSizes = extern struct { cbHeader: u32, cbTrailer: u32, cbMaximumMessage: u32, cBuffers: u32, cbBlockSize: u32, }; pub const SecPkgContext_NamesW = extern struct { sUserName: ?*u16, }; pub const SECPKG_ATTR_LCT_STATUS = enum(i32) { Yes = 0, No = 1, Maybe = 2, }; pub const SecPkgAttrLastClientTokenYes = SECPKG_ATTR_LCT_STATUS.Yes; pub const SecPkgAttrLastClientTokenNo = SECPKG_ATTR_LCT_STATUS.No; pub const SecPkgAttrLastClientTokenMaybe = SECPKG_ATTR_LCT_STATUS.Maybe; pub const SecPkgContext_LastClientTokenStatus = extern struct { LastClientTokenStatus: SECPKG_ATTR_LCT_STATUS, }; pub const SecPkgContext_NamesA = extern struct { sUserName: ?*i8, }; pub const SecPkgContext_Lifespan = extern struct { tsStart: LARGE_INTEGER, tsExpiry: LARGE_INTEGER, }; pub const SecPkgContext_DceInfo = extern struct { AuthzSvc: u32, pPac: ?*c_void, }; pub const SecPkgContext_KeyInfoA = extern struct { sSignatureAlgorithmName: ?*i8, sEncryptAlgorithmName: ?*i8, KeySize: u32, SignatureAlgorithm: u32, EncryptAlgorithm: u32, }; pub const SecPkgContext_KeyInfoW = extern struct { sSignatureAlgorithmName: ?*u16, sEncryptAlgorithmName: ?*u16, KeySize: u32, SignatureAlgorithm: u32, EncryptAlgorithm: u32, }; pub const SecPkgContext_AuthorityA = extern struct { sAuthorityName: ?*i8, }; pub const SecPkgContext_AuthorityW = extern struct { sAuthorityName: ?*u16, }; pub const SecPkgContext_ProtoInfoA = extern struct { sProtocolName: ?*i8, majorVersion: u32, minorVersion: u32, }; pub const SecPkgContext_ProtoInfoW = extern struct { sProtocolName: ?*u16, majorVersion: u32, minorVersion: u32, }; pub const SecPkgContext_PasswordExpiry = extern struct { tsPasswordExpires: LARGE_INTEGER, }; pub const SecPkgContext_LogoffTime = extern struct { tsLogoffTime: LARGE_INTEGER, }; pub const SecPkgContext_SessionKey = extern struct { SessionKeyLength: u32, SessionKey: ?*u8, }; pub const SecPkgContext_NegoKeys = extern struct { KeyType: u32, KeyLength: u16, KeyValue: ?*u8, VerifyKeyType: u32, VerifyKeyLength: u16, VerifyKeyValue: ?*u8, }; pub const SecPkgContext_PackageInfoW = extern struct { PackageInfo: ?*SecPkgInfoW, }; pub const SecPkgContext_PackageInfoA = extern struct { PackageInfo: ?*SecPkgInfoA, }; pub const SecPkgContext_UserFlags = extern struct { UserFlags: u32, }; pub const SecPkgContext_Flags = extern struct { Flags: u32, }; pub const SecPkgContext_NegotiationInfoA = extern struct { PackageInfo: ?*SecPkgInfoA, NegotiationState: u32, }; pub const SecPkgContext_NegotiationInfoW = extern struct { PackageInfo: ?*SecPkgInfoW, NegotiationState: u32, }; pub const SecPkgContext_NativeNamesW = extern struct { sClientName: ?*u16, sServerName: ?*u16, }; pub const SecPkgContext_NativeNamesA = extern struct { sClientName: ?*i8, sServerName: ?*i8, }; pub const SecPkgContext_CredentialNameW = extern struct { CredentialType: u32, sCredentialName: ?*u16, }; pub const SecPkgContext_CredentialNameA = extern struct { CredentialType: u32, sCredentialName: ?*i8, }; pub const SecPkgContext_AccessToken = extern struct { AccessToken: ?*c_void, }; pub const SecPkgContext_TargetInformation = extern struct { MarshalledTargetInfoLength: u32, MarshalledTargetInfo: ?*u8, }; pub const SecPkgContext_AuthzID = extern struct { AuthzIDLength: u32, AuthzID: ?PSTR, }; pub const SecPkgContext_Target = extern struct { TargetLength: u32, Target: ?PSTR, }; pub const SecPkgContext_ClientSpecifiedTarget = extern struct { sTargetName: ?*u16, }; pub const SecPkgContext_Bindings = extern struct { BindingsLength: u32, Bindings: ?*SEC_CHANNEL_BINDINGS, }; pub const SEC_APPLICATION_PROTOCOL_NEGOTIATION_STATUS = enum(i32) { None = 0, Success = 1, SelectedClientOnly = 2, }; pub const SecApplicationProtocolNegotiationStatus_None = SEC_APPLICATION_PROTOCOL_NEGOTIATION_STATUS.None; pub const SecApplicationProtocolNegotiationStatus_Success = SEC_APPLICATION_PROTOCOL_NEGOTIATION_STATUS.Success; pub const SecApplicationProtocolNegotiationStatus_SelectedClientOnly = SEC_APPLICATION_PROTOCOL_NEGOTIATION_STATUS.SelectedClientOnly; pub const SecPkgContext_ApplicationProtocol = extern struct { ProtoNegoStatus: SEC_APPLICATION_PROTOCOL_NEGOTIATION_STATUS, ProtoNegoExt: SEC_APPLICATION_PROTOCOL_NEGOTIATION_EXT, ProtocolIdSize: u8, ProtocolId: [255]u8, }; pub const SecPkgContext_NegotiatedTlsExtensions = extern struct { ExtensionsCount: u32, Extensions: ?*u16, }; pub const SECPKG_APP_MODE_INFO = extern struct { UserFunction: u32, Argument1: usize, Argument2: usize, UserData: SecBuffer, ReturnToLsa: BOOLEAN, }; pub const SEC_GET_KEY_FN = fn( Arg: ?*c_void, Principal: ?*c_void, KeyVer: u32, Key: ?*?*c_void, Status: ?*i32, ) callconv(@import("std").os.windows.WINAPI) void; pub const ACQUIRE_CREDENTIALS_HANDLE_FN_W = fn( param0: ?*u16, param1: ?*u16, param2: u32, param3: ?*c_void, param4: ?*c_void, param5: ?SEC_GET_KEY_FN, param6: ?*c_void, param7: ?*SecHandle, param8: ?*LARGE_INTEGER, ) callconv(@import("std").os.windows.WINAPI) i32; pub const ACQUIRE_CREDENTIALS_HANDLE_FN_A = fn( param0: ?*i8, param1: ?*i8, param2: u32, param3: ?*c_void, param4: ?*c_void, param5: ?SEC_GET_KEY_FN, param6: ?*c_void, param7: ?*SecHandle, param8: ?*LARGE_INTEGER, ) callconv(@import("std").os.windows.WINAPI) i32; pub const FREE_CREDENTIALS_HANDLE_FN = fn( param0: ?*SecHandle, ) callconv(@import("std").os.windows.WINAPI) i32; pub const ADD_CREDENTIALS_FN_W = fn( param0: ?*SecHandle, param1: ?*u16, param2: ?*u16, param3: u32, param4: ?*c_void, param5: ?SEC_GET_KEY_FN, param6: ?*c_void, param7: ?*LARGE_INTEGER, ) callconv(@import("std").os.windows.WINAPI) i32; pub const ADD_CREDENTIALS_FN_A = fn( param0: ?*SecHandle, param1: ?*i8, param2: ?*i8, param3: u32, param4: ?*c_void, param5: ?SEC_GET_KEY_FN, param6: ?*c_void, param7: ?*LARGE_INTEGER, ) callconv(@import("std").os.windows.WINAPI) i32; pub const CHANGE_PASSWORD_FN_W = fn( param0: ?*u16, param1: ?*u16, param2: ?*u16, param3: ?*u16, param4: ?*u16, param5: BOOLEAN, param6: u32, param7: ?*SecBufferDesc, ) callconv(@import("std").os.windows.WINAPI) i32; pub const CHANGE_PASSWORD_FN_A = fn( param0: ?*i8, param1: ?*i8, param2: ?*i8, param3: ?*i8, param4: ?*i8, param5: BOOLEAN, param6: u32, param7: ?*SecBufferDesc, ) callconv(@import("std").os.windows.WINAPI) i32; pub const INITIALIZE_SECURITY_CONTEXT_FN_W = fn( param0: ?*SecHandle, param1: ?*SecHandle, param2: ?*u16, param3: u32, param4: u32, param5: u32, param6: ?*SecBufferDesc, param7: u32, param8: ?*SecHandle, param9: ?*SecBufferDesc, param10: ?*u32, param11: ?*LARGE_INTEGER, ) callconv(@import("std").os.windows.WINAPI) i32; pub const INITIALIZE_SECURITY_CONTEXT_FN_A = fn( param0: ?*SecHandle, param1: ?*SecHandle, param2: ?*i8, param3: u32, param4: u32, param5: u32, param6: ?*SecBufferDesc, param7: u32, param8: ?*SecHandle, param9: ?*SecBufferDesc, param10: ?*u32, param11: ?*LARGE_INTEGER, ) callconv(@import("std").os.windows.WINAPI) i32; pub const ACCEPT_SECURITY_CONTEXT_FN = fn( param0: ?*SecHandle, param1: ?*SecHandle, param2: ?*SecBufferDesc, param3: u32, param4: u32, param5: ?*SecHandle, param6: ?*SecBufferDesc, param7: ?*u32, param8: ?*LARGE_INTEGER, ) callconv(@import("std").os.windows.WINAPI) i32; pub const COMPLETE_AUTH_TOKEN_FN = fn( param0: ?*SecHandle, param1: ?*SecBufferDesc, ) callconv(@import("std").os.windows.WINAPI) i32; pub const IMPERSONATE_SECURITY_CONTEXT_FN = fn( param0: ?*SecHandle, ) callconv(@import("std").os.windows.WINAPI) i32; pub const REVERT_SECURITY_CONTEXT_FN = fn( param0: ?*SecHandle, ) callconv(@import("std").os.windows.WINAPI) i32; pub const QUERY_SECURITY_CONTEXT_TOKEN_FN = fn( param0: ?*SecHandle, param1: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) i32; pub const DELETE_SECURITY_CONTEXT_FN = fn( param0: ?*SecHandle, ) callconv(@import("std").os.windows.WINAPI) i32; pub const APPLY_CONTROL_TOKEN_FN = fn( param0: ?*SecHandle, param1: ?*SecBufferDesc, ) callconv(@import("std").os.windows.WINAPI) i32; pub const QUERY_CONTEXT_ATTRIBUTES_FN_W = fn( param0: ?*SecHandle, param1: u32, param2: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) i32; pub const QUERY_CONTEXT_ATTRIBUTES_EX_FN_W = fn( param0: ?*SecHandle, param1: u32, param2: ?*c_void, param3: u32, ) callconv(@import("std").os.windows.WINAPI) i32; pub const QUERY_CONTEXT_ATTRIBUTES_FN_A = fn( param0: ?*SecHandle, param1: u32, param2: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) i32; pub const QUERY_CONTEXT_ATTRIBUTES_EX_FN_A = fn( param0: ?*SecHandle, param1: u32, param2: ?*c_void, param3: u32, ) callconv(@import("std").os.windows.WINAPI) i32; pub const SET_CONTEXT_ATTRIBUTES_FN_W = fn( param0: ?*SecHandle, param1: u32, param2: ?*c_void, param3: u32, ) callconv(@import("std").os.windows.WINAPI) i32; pub const SET_CONTEXT_ATTRIBUTES_FN_A = fn( param0: ?*SecHandle, param1: u32, param2: ?*c_void, param3: u32, ) callconv(@import("std").os.windows.WINAPI) i32; pub const QUERY_CREDENTIALS_ATTRIBUTES_FN_W = fn( param0: ?*SecHandle, param1: u32, param2: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) i32; pub const QUERY_CREDENTIALS_ATTRIBUTES_EX_FN_W = fn( param0: ?*SecHandle, param1: u32, param2: ?*c_void, param3: u32, ) callconv(@import("std").os.windows.WINAPI) i32; pub const QUERY_CREDENTIALS_ATTRIBUTES_FN_A = fn( param0: ?*SecHandle, param1: u32, param2: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) i32; pub const QUERY_CREDENTIALS_ATTRIBUTES_EX_FN_A = fn( param0: ?*SecHandle, param1: u32, param2: ?*c_void, param3: u32, ) callconv(@import("std").os.windows.WINAPI) i32; pub const SET_CREDENTIALS_ATTRIBUTES_FN_W = fn( param0: ?*SecHandle, param1: u32, param2: ?*c_void, param3: u32, ) callconv(@import("std").os.windows.WINAPI) i32; pub const SET_CREDENTIALS_ATTRIBUTES_FN_A = fn( param0: ?*SecHandle, param1: u32, param2: ?*c_void, param3: u32, ) callconv(@import("std").os.windows.WINAPI) i32; pub const FREE_CONTEXT_BUFFER_FN = fn( param0: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) i32; pub const MAKE_SIGNATURE_FN = fn( param0: ?*SecHandle, param1: u32, param2: ?*SecBufferDesc, param3: u32, ) callconv(@import("std").os.windows.WINAPI) i32; pub const VERIFY_SIGNATURE_FN = fn( param0: ?*SecHandle, param1: ?*SecBufferDesc, param2: u32, param3: ?*u32, ) callconv(@import("std").os.windows.WINAPI) i32; pub const ENCRYPT_MESSAGE_FN = fn( param0: ?*SecHandle, param1: u32, param2: ?*SecBufferDesc, param3: u32, ) callconv(@import("std").os.windows.WINAPI) i32; pub const DECRYPT_MESSAGE_FN = fn( param0: ?*SecHandle, param1: ?*SecBufferDesc, param2: u32, param3: ?*u32, ) callconv(@import("std").os.windows.WINAPI) i32; pub const ENUMERATE_SECURITY_PACKAGES_FN_W = fn( param0: ?*u32, param1: ?*?*SecPkgInfoW, ) callconv(@import("std").os.windows.WINAPI) i32; pub const ENUMERATE_SECURITY_PACKAGES_FN_A = fn( param0: ?*u32, param1: ?*?*SecPkgInfoA, ) callconv(@import("std").os.windows.WINAPI) i32; pub const QUERY_SECURITY_PACKAGE_INFO_FN_W = fn( param0: ?*u16, param1: ?*?*SecPkgInfoW, ) callconv(@import("std").os.windows.WINAPI) i32; pub const QUERY_SECURITY_PACKAGE_INFO_FN_A = fn( param0: ?*i8, param1: ?*?*SecPkgInfoA, ) callconv(@import("std").os.windows.WINAPI) i32; pub const SecDelegationType = enum(i32) { Full = 0, Service = 1, Tree = 2, Directory = 3, Object = 4, }; pub const SecFull = SecDelegationType.Full; pub const SecService = SecDelegationType.Service; pub const SecTree = SecDelegationType.Tree; pub const SecDirectory = SecDelegationType.Directory; pub const SecObject = SecDelegationType.Object; pub const EXPORT_SECURITY_CONTEXT_FN = fn( param0: ?*SecHandle, param1: u32, param2: ?*SecBuffer, param3: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) i32; pub const IMPORT_SECURITY_CONTEXT_FN_W = fn( param0: ?*u16, param1: ?*SecBuffer, param2: ?*c_void, param3: ?*SecHandle, ) callconv(@import("std").os.windows.WINAPI) i32; pub const IMPORT_SECURITY_CONTEXT_FN_A = fn( param0: ?*i8, param1: ?*SecBuffer, param2: ?*c_void, param3: ?*SecHandle, ) callconv(@import("std").os.windows.WINAPI) i32; pub const SecurityFunctionTableW = extern struct { dwVersion: u32, EnumerateSecurityPackagesW: ?ENUMERATE_SECURITY_PACKAGES_FN_W, QueryCredentialsAttributesW: ?QUERY_CREDENTIALS_ATTRIBUTES_FN_W, AcquireCredentialsHandleW: ?ACQUIRE_CREDENTIALS_HANDLE_FN_W, FreeCredentialsHandle: ?FREE_CREDENTIALS_HANDLE_FN, Reserved2: ?*c_void, InitializeSecurityContextW: ?INITIALIZE_SECURITY_CONTEXT_FN_W, AcceptSecurityContext: ?ACCEPT_SECURITY_CONTEXT_FN, CompleteAuthToken: ?COMPLETE_AUTH_TOKEN_FN, DeleteSecurityContext: ?DELETE_SECURITY_CONTEXT_FN, ApplyControlToken: ?APPLY_CONTROL_TOKEN_FN, QueryContextAttributesW: ?QUERY_CONTEXT_ATTRIBUTES_FN_W, ImpersonateSecurityContext: ?IMPERSONATE_SECURITY_CONTEXT_FN, RevertSecurityContext: ?REVERT_SECURITY_CONTEXT_FN, MakeSignature: ?MAKE_SIGNATURE_FN, VerifySignature: ?VERIFY_SIGNATURE_FN, FreeContextBuffer: ?FREE_CONTEXT_BUFFER_FN, QuerySecurityPackageInfoW: ?QUERY_SECURITY_PACKAGE_INFO_FN_W, Reserved3: ?*c_void, Reserved4: ?*c_void, ExportSecurityContext: ?EXPORT_SECURITY_CONTEXT_FN, ImportSecurityContextW: ?IMPORT_SECURITY_CONTEXT_FN_W, AddCredentialsW: ?ADD_CREDENTIALS_FN_W, Reserved8: ?*c_void, QuerySecurityContextToken: ?QUERY_SECURITY_CONTEXT_TOKEN_FN, EncryptMessage: ?ENCRYPT_MESSAGE_FN, DecryptMessage: ?DECRYPT_MESSAGE_FN, SetContextAttributesW: ?SET_CONTEXT_ATTRIBUTES_FN_W, SetCredentialsAttributesW: ?SET_CREDENTIALS_ATTRIBUTES_FN_W, ChangeAccountPasswordW: ?CHANGE_PASSWORD_FN_W, QueryContextAttributesExW: ?QUERY_CONTEXT_ATTRIBUTES_EX_FN_W, QueryCredentialsAttributesExW: ?QUERY_CREDENTIALS_ATTRIBUTES_EX_FN_W, }; pub const SecurityFunctionTableA = extern struct { dwVersion: u32, EnumerateSecurityPackagesA: ?ENUMERATE_SECURITY_PACKAGES_FN_A, QueryCredentialsAttributesA: ?QUERY_CREDENTIALS_ATTRIBUTES_FN_A, AcquireCredentialsHandleA: ?ACQUIRE_CREDENTIALS_HANDLE_FN_A, FreeCredentialsHandle: ?FREE_CREDENTIALS_HANDLE_FN, Reserved2: ?*c_void, InitializeSecurityContextA: ?INITIALIZE_SECURITY_CONTEXT_FN_A, AcceptSecurityContext: ?ACCEPT_SECURITY_CONTEXT_FN, CompleteAuthToken: ?COMPLETE_AUTH_TOKEN_FN, DeleteSecurityContext: ?DELETE_SECURITY_CONTEXT_FN, ApplyControlToken: ?APPLY_CONTROL_TOKEN_FN, QueryContextAttributesA: ?QUERY_CONTEXT_ATTRIBUTES_FN_A, ImpersonateSecurityContext: ?IMPERSONATE_SECURITY_CONTEXT_FN, RevertSecurityContext: ?REVERT_SECURITY_CONTEXT_FN, MakeSignature: ?MAKE_SIGNATURE_FN, VerifySignature: ?VERIFY_SIGNATURE_FN, FreeContextBuffer: ?FREE_CONTEXT_BUFFER_FN, QuerySecurityPackageInfoA: ?QUERY_SECURITY_PACKAGE_INFO_FN_A, Reserved3: ?*c_void, Reserved4: ?*c_void, ExportSecurityContext: ?EXPORT_SECURITY_CONTEXT_FN, ImportSecurityContextA: ?IMPORT_SECURITY_CONTEXT_FN_A, AddCredentialsA: ?ADD_CREDENTIALS_FN_A, Reserved8: ?*c_void, QuerySecurityContextToken: ?QUERY_SECURITY_CONTEXT_TOKEN_FN, EncryptMessage: ?ENCRYPT_MESSAGE_FN, DecryptMessage: ?DECRYPT_MESSAGE_FN, SetContextAttributesA: ?SET_CONTEXT_ATTRIBUTES_FN_A, SetCredentialsAttributesA: ?SET_CREDENTIALS_ATTRIBUTES_FN_A, ChangeAccountPasswordA: ?CHANGE_PASSWORD_FN_A, QueryContextAttributesExA: ?QUERY_CONTEXT_ATTRIBUTES_EX_FN_A, QueryCredentialsAttributesExA: ?QUERY_CREDENTIALS_ATTRIBUTES_EX_FN_A, }; pub const INIT_SECURITY_INTERFACE_A = fn( ) callconv(@import("std").os.windows.WINAPI) ?*SecurityFunctionTableA; pub const INIT_SECURITY_INTERFACE_W = fn( ) callconv(@import("std").os.windows.WINAPI) ?*SecurityFunctionTableW; pub const SASL_AUTHZID_STATE = enum(i32) { Forbidden = 0, Processed = 1, }; pub const Sasl_AuthZIDForbidden = SASL_AUTHZID_STATE.Forbidden; pub const Sasl_AuthZIDProcessed = SASL_AUTHZID_STATE.Processed; pub const SEC_WINNT_AUTH_IDENTITY_EX2 = extern struct { Version: u32, cbHeaderLength: u16, cbStructureLength: u32, UserOffset: u32, UserLength: u16, DomainOffset: u32, DomainLength: u16, PackedCredentialsOffset: u32, PackedCredentialsLength: u16, Flags: u32, PackageListOffset: u32, PackageListLength: u16, }; pub const SEC_WINNT_AUTH_IDENTITY_EXW = extern struct { Version: u32, Length: u32, User: ?*u16, UserLength: u32, Domain: ?*u16, DomainLength: u32, Password: ?*u16, PasswordLength: u32, Flags: u32, PackageList: ?*u16, PackageListLength: u32, }; pub const SEC_WINNT_AUTH_IDENTITY_EXA = extern struct { Version: u32, Length: u32, User: ?*u8, UserLength: u32, Domain: ?*u8, DomainLength: u32, Password: <PASSWORD>, PasswordLength: u32, Flags: u32, PackageList: ?*u8, PackageListLength: u32, }; pub const SEC_WINNT_AUTH_IDENTITY_INFO = extern union { AuthIdExw: SEC_WINNT_AUTH_IDENTITY_EXW, AuthIdExa: SEC_WINNT_AUTH_IDENTITY_EXA, AuthId_a: SEC_WINNT_AUTH_IDENTITY_A, AuthId_w: SEC_WINNT_AUTH_IDENTITY_W, AuthIdEx2: SEC_WINNT_AUTH_IDENTITY_EX2, }; pub const SECURITY_PACKAGE_OPTIONS = extern struct { Size: u32, Type: SECURITY_PACKAGE_OPTIONS_TYPE, Flags: u32, SignatureSize: u32, Signature: ?*c_void, }; pub const LSA_TOKEN_INFORMATION_TYPE = enum(i32) { Null = 0, V1 = 1, V2 = 2, V3 = 3, }; pub const LsaTokenInformationNull = LSA_TOKEN_INFORMATION_TYPE.Null; pub const LsaTokenInformationV1 = LSA_TOKEN_INFORMATION_TYPE.V1; pub const LsaTokenInformationV2 = LSA_TOKEN_INFORMATION_TYPE.V2; pub const LsaTokenInformationV3 = LSA_TOKEN_INFORMATION_TYPE.V3; pub const LSA_TOKEN_INFORMATION_NULL = extern struct { ExpirationTime: LARGE_INTEGER, Groups: ?*TOKEN_GROUPS, }; pub const LSA_TOKEN_INFORMATION_V1 = extern struct { ExpirationTime: LARGE_INTEGER, User: TOKEN_USER, Groups: ?*TOKEN_GROUPS, PrimaryGroup: TOKEN_PRIMARY_GROUP, Privileges: ?*TOKEN_PRIVILEGES, Owner: TOKEN_OWNER, DefaultDacl: TOKEN_DEFAULT_DACL, }; pub const LSA_TOKEN_INFORMATION_V3 = extern struct { ExpirationTime: LARGE_INTEGER, User: TOKEN_USER, Groups: ?*TOKEN_GROUPS, PrimaryGroup: TOKEN_PRIMARY_GROUP, Privileges: ?*TOKEN_PRIVILEGES, Owner: TOKEN_OWNER, DefaultDacl: TOKEN_DEFAULT_DACL, UserClaims: TOKEN_USER_CLAIMS, DeviceClaims: TOKEN_DEVICE_CLAIMS, DeviceGroups: ?*TOKEN_GROUPS, }; pub const PLSA_CREATE_LOGON_SESSION = fn( LogonId: ?*LUID, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_DELETE_LOGON_SESSION = fn( LogonId: ?*LUID, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_ADD_CREDENTIAL = fn( LogonId: ?*LUID, AuthenticationPackage: u32, PrimaryKeyValue: ?*STRING, Credentials: ?*STRING, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_GET_CREDENTIALS = fn( LogonId: ?*LUID, AuthenticationPackage: u32, QueryContext: ?*u32, RetrieveAllCredentials: BOOLEAN, PrimaryKeyValue: ?*STRING, PrimaryKeyLength: ?*u32, Credentials: ?*STRING, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_DELETE_CREDENTIAL = fn( LogonId: ?*LUID, AuthenticationPackage: u32, PrimaryKeyValue: ?*STRING, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_ALLOCATE_LSA_HEAP = fn( Length: u32, ) callconv(@import("std").os.windows.WINAPI) ?*c_void; pub const PLSA_FREE_LSA_HEAP = fn( Base: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) void; pub const PLSA_ALLOCATE_PRIVATE_HEAP = fn( Length: usize, ) callconv(@import("std").os.windows.WINAPI) ?*c_void; pub const PLSA_FREE_PRIVATE_HEAP = fn( Base: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) void; pub const PLSA_ALLOCATE_CLIENT_BUFFER = fn( ClientRequest: ?*?*c_void, LengthRequired: u32, ClientBaseAddress: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_FREE_CLIENT_BUFFER = fn( ClientRequest: ?*?*c_void, ClientBaseAddress: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_COPY_TO_CLIENT_BUFFER = fn( ClientRequest: ?*?*c_void, Length: u32, // TODO: what to do with BytesParamIndex 1? ClientBaseAddress: ?*c_void, // TODO: what to do with BytesParamIndex 1? BufferToCopy: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_COPY_FROM_CLIENT_BUFFER = fn( ClientRequest: ?*?*c_void, Length: u32, // TODO: what to do with BytesParamIndex 1? BufferToCopy: ?*c_void, // TODO: what to do with BytesParamIndex 1? ClientBaseAddress: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const LSA_DISPATCH_TABLE = extern struct { CreateLogonSession: ?PLSA_CREATE_LOGON_SESSION, DeleteLogonSession: ?PLSA_DELETE_LOGON_SESSION, AddCredential: ?PLSA_ADD_CREDENTIAL, GetCredentials: ?PLSA_GET_CREDENTIALS, DeleteCredential: ?PLSA_DELETE_CREDENTIAL, AllocateLsaHeap: ?PLSA_ALLOCATE_LSA_HEAP, FreeLsaHeap: ?PLSA_FREE_LSA_HEAP, AllocateClientBuffer: ?PLSA_ALLOCATE_CLIENT_BUFFER, FreeClientBuffer: ?PLSA_FREE_CLIENT_BUFFER, CopyToClientBuffer: ?PLSA_COPY_TO_CLIENT_BUFFER, CopyFromClientBuffer: ?PLSA_COPY_FROM_CLIENT_BUFFER, }; pub const PLSA_AP_INITIALIZE_PACKAGE = fn( AuthenticationPackageId: u32, LsaDispatchTable: ?*LSA_DISPATCH_TABLE, Database: ?*STRING, Confidentiality: ?*STRING, AuthenticationPackageName: ?*?*STRING, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_AP_LOGON_USER = fn( ClientRequest: ?*?*c_void, LogonType: SECURITY_LOGON_TYPE, // TODO: what to do with BytesParamIndex 4? AuthenticationInformation: ?*c_void, ClientAuthenticationBase: ?*c_void, AuthenticationInformationLength: u32, ProfileBuffer: ?*?*c_void, ProfileBufferLength: ?*u32, LogonId: ?*LUID, SubStatus: ?*i32, TokenInformationType: ?*LSA_TOKEN_INFORMATION_TYPE, TokenInformation: ?*?*c_void, AccountName: ?*?*UNICODE_STRING, AuthenticatingAuthority: ?*?*UNICODE_STRING, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_AP_LOGON_USER_EX = fn( ClientRequest: ?*?*c_void, LogonType: SECURITY_LOGON_TYPE, // TODO: what to do with BytesParamIndex 4? AuthenticationInformation: ?*c_void, ClientAuthenticationBase: ?*c_void, AuthenticationInformationLength: u32, ProfileBuffer: ?*?*c_void, ProfileBufferLength: ?*u32, LogonId: ?*LUID, SubStatus: ?*i32, TokenInformationType: ?*LSA_TOKEN_INFORMATION_TYPE, TokenInformation: ?*?*c_void, AccountName: ?*?*UNICODE_STRING, AuthenticatingAuthority: ?*?*UNICODE_STRING, MachineName: ?*?*UNICODE_STRING, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_AP_CALL_PACKAGE = fn( ClientRequest: ?*?*c_void, // TODO: what to do with BytesParamIndex 3? ProtocolSubmitBuffer: ?*c_void, ClientBufferBase: ?*c_void, SubmitBufferLength: u32, ProtocolReturnBuffer: ?*?*c_void, ReturnBufferLength: ?*u32, ProtocolStatus: ?*i32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_AP_CALL_PACKAGE_PASSTHROUGH = fn( ClientRequest: ?*?*c_void, // TODO: what to do with BytesParamIndex 3? ProtocolSubmitBuffer: ?*c_void, ClientBufferBase: ?*c_void, SubmitBufferLength: u32, ProtocolReturnBuffer: ?*?*c_void, ReturnBufferLength: ?*u32, ProtocolStatus: ?*i32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_AP_LOGON_TERMINATED = fn( LogonId: ?*LUID, ) callconv(@import("std").os.windows.WINAPI) void; pub const PSAM_CREDENTIAL_UPDATE_NOTIFY_ROUTINE = fn( ClearPassword: ?*UNICODE_STRING, // TODO: what to do with BytesParamIndex 2? OldCredentials: ?*c_void, OldCredentialSize: u32, UserAccountControl: u32, UPN: ?*UNICODE_STRING, UserName: ?*UNICODE_STRING, NetbiosDomainName: ?*UNICODE_STRING, DnsDomainName: ?*UNICODE_STRING, NewCredentials: ?*?*c_void, NewCredentialSize: ?*u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PSAM_CREDENTIAL_UPDATE_REGISTER_ROUTINE = fn( CredentialName: ?*UNICODE_STRING, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; pub const PSAM_CREDENTIAL_UPDATE_FREE_ROUTINE = fn( p: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) void; pub const SAM_REGISTER_MAPPING_ELEMENT = extern struct { Original: ?PSTR, Mapped: ?PSTR, Continuable: BOOLEAN, }; pub const SAM_REGISTER_MAPPING_LIST = extern struct { Count: u32, Elements: ?*SAM_REGISTER_MAPPING_ELEMENT, }; pub const SAM_REGISTER_MAPPING_TABLE = extern struct { Count: u32, Lists: ?*SAM_REGISTER_MAPPING_LIST, }; pub const PSAM_CREDENTIAL_UPDATE_REGISTER_MAPPED_ENTRYPOINTS_ROUTINE = fn( Table: ?*SAM_REGISTER_MAPPING_TABLE, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SECPKG_CLIENT_INFO = extern struct { LogonId: LUID, ProcessID: u32, ThreadID: u32, HasTcbPrivilege: BOOLEAN, Impersonating: BOOLEAN, Restricted: BOOLEAN, ClientFlags: u8, ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL, ClientToken: ?HANDLE, }; pub const SECPKG_CALL_INFO = extern struct { ProcessId: u32, ThreadId: u32, Attributes: u32, CallCount: u32, MechOid: ?*c_void, }; pub const SECPKG_SUPPLEMENTAL_CRED = extern struct { PackageName: UNICODE_STRING, CredentialSize: u32, Credentials: ?*u8, }; pub const SECPKG_BYTE_VECTOR = extern struct { ByteArrayOffset: u32, ByteArrayLength: u16, }; pub const SECPKG_SHORT_VECTOR = extern struct { ShortArrayOffset: u32, ShortArrayCount: u16, }; pub const SECPKG_SUPPLIED_CREDENTIAL = extern struct { cbHeaderLength: u16, cbStructureLength: u16, UserName: SECPKG_SHORT_VECTOR, DomainName: SECPKG_SHORT_VECTOR, PackedCredentials: SECPKG_BYTE_VECTOR, CredFlags: u32, }; pub const SECPKG_CREDENTIAL = extern struct { Version: u64, cbHeaderLength: u16, cbStructureLength: u32, ClientProcess: u32, ClientThread: u32, LogonId: LUID, ClientToken: ?HANDLE, SessionId: u32, ModifiedId: LUID, fCredentials: u32, Flags: u32, PrincipalName: SECPKG_BYTE_VECTOR, PackageList: SECPKG_BYTE_VECTOR, MarshaledSuppliedCreds: SECPKG_BYTE_VECTOR, }; pub const SECPKG_SUPPLEMENTAL_CRED_ARRAY = extern struct { CredentialCount: u32, Credentials: [1]SECPKG_SUPPLEMENTAL_CRED, }; pub const SECPKG_SURROGATE_LOGON_ENTRY = extern struct { Type: Guid, Data: ?*c_void, }; pub const SECPKG_SURROGATE_LOGON = extern struct { Version: u32, SurrogateLogonID: LUID, EntryCount: u32, Entries: ?*SECPKG_SURROGATE_LOGON_ENTRY, }; pub const PLSA_CALLBACK_FUNCTION = fn( Argument1: usize, Argument2: usize, InputBuffer: ?*SecBuffer, OutputBuffer: ?*SecBuffer, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SECPKG_PRIMARY_CRED = extern struct { LogonId: LUID, DownlevelName: UNICODE_STRING, DomainName: UNICODE_STRING, Password: UNICODE_STRING, OldPassword: UNICODE_STRING, UserSid: ?PSID, Flags: u32, DnsDomainName: UNICODE_STRING, Upn: UNICODE_STRING, LogonServer: UNICODE_STRING, Spare1: UNICODE_STRING, Spare2: UNICODE_STRING, Spare3: UNICODE_STRING, Spare4: UNICODE_STRING, }; pub const SECPKG_PRIMARY_CRED_EX = extern struct { LogonId: LUID, DownlevelName: UNICODE_STRING, DomainName: UNICODE_STRING, Password: <PASSWORD>_<PASSWORD>, OldPassword: UNICODE_STRING, UserSid: ?PSID, Flags: u32, DnsDomainName: UNICODE_STRING, Upn: UNICODE_STRING, LogonServer: UNICODE_STRING, Spare1: UNICODE_STRING, Spare2: UNICODE_STRING, Spare3: UNICODE_STRING, Spare4: UNICODE_STRING, PackageId: usize, PrevLogonId: LUID, }; pub const SECPKG_PARAMETERS = extern struct { Version: u32, MachineState: u32, SetupMode: u32, DomainSid: ?PSID, DomainName: UNICODE_STRING, DnsDomainName: UNICODE_STRING, DomainGuid: Guid, }; pub const SECPKG_EXTENDED_INFORMATION_CLASS = enum(i32) { GssInfo = 1, ContextThunks = 2, MutualAuthLevel = 3, WowClientDll = 4, ExtraOids = 5, MaxInfo = 6, Nego2Info = 7, }; pub const SecpkgGssInfo = SECPKG_EXTENDED_INFORMATION_CLASS.GssInfo; pub const SecpkgContextThunks = SECPKG_EXTENDED_INFORMATION_CLASS.ContextThunks; pub const SecpkgMutualAuthLevel = SECPKG_EXTENDED_INFORMATION_CLASS.MutualAuthLevel; pub const SecpkgWowClientDll = SECPKG_EXTENDED_INFORMATION_CLASS.WowClientDll; pub const SecpkgExtraOids = SECPKG_EXTENDED_INFORMATION_CLASS.ExtraOids; pub const SecpkgMaxInfo = SECPKG_EXTENDED_INFORMATION_CLASS.MaxInfo; pub const SecpkgNego2Info = SECPKG_EXTENDED_INFORMATION_CLASS.Nego2Info; pub const SECPKG_GSS_INFO = extern struct { EncodedIdLength: u32, EncodedId: [4]u8, }; pub const SECPKG_CONTEXT_THUNKS = extern struct { InfoLevelCount: u32, Levels: [1]u32, }; pub const SECPKG_MUTUAL_AUTH_LEVEL = extern struct { MutualAuthLevel: u32, }; pub const SECPKG_WOW_CLIENT_DLL = extern struct { WowClientDllPath: UNICODE_STRING, }; pub const SECPKG_SERIALIZED_OID = extern struct { OidLength: u32, OidAttributes: u32, OidValue: [32]u8, }; pub const SECPKG_EXTRA_OIDS = extern struct { OidCount: u32, Oids: [1]SECPKG_SERIALIZED_OID, }; pub const SECPKG_NEGO2_INFO = extern struct { AuthScheme: [16]u8, PackageFlags: u32, }; pub const SECPKG_EXTENDED_INFORMATION = extern struct { Class: SECPKG_EXTENDED_INFORMATION_CLASS, Info: extern union { GssInfo: SECPKG_GSS_INFO, ContextThunks: SECPKG_CONTEXT_THUNKS, MutualAuthLevel: SECPKG_MUTUAL_AUTH_LEVEL, WowClientDll: SECPKG_WOW_CLIENT_DLL, ExtraOids: SECPKG_EXTRA_OIDS, Nego2Info: SECPKG_NEGO2_INFO, }, }; pub const SECPKG_TARGETINFO = extern struct { DomainSid: ?PSID, ComputerName: ?[*:0]const u16, }; pub const SecPkgContext_SaslContext = extern struct { SaslContext: ?*c_void, }; pub const SECURITY_USER_DATA = extern struct { UserName: UNICODE_STRING, LogonDomainName: UNICODE_STRING, LogonServer: UNICODE_STRING, pSid: ?PSID, }; pub const SECPKG_CALL_PACKAGE_MESSAGE_TYPE = enum(i32) { MinMessage = 1024, // PinDcMessage = 1024, this enum value conflicts with MinMessage UnpinAllDcsMessage = 1025, TransferCredMessage = 1026, // MaxMessage = 1026, this enum value conflicts with TransferCredMessage }; pub const SecPkgCallPackageMinMessage = SECPKG_CALL_PACKAGE_MESSAGE_TYPE.MinMessage; pub const SecPkgCallPackagePinDcMessage = SECPKG_CALL_PACKAGE_MESSAGE_TYPE.MinMessage; pub const SecPkgCallPackageUnpinAllDcsMessage = SECPKG_CALL_PACKAGE_MESSAGE_TYPE.UnpinAllDcsMessage; pub const SecPkgCallPackageTransferCredMessage = SECPKG_CALL_PACKAGE_MESSAGE_TYPE.TransferCredMessage; pub const SecPkgCallPackageMaxMessage = SECPKG_CALL_PACKAGE_MESSAGE_TYPE.TransferCredMessage; pub const SECPKG_CALL_PACKAGE_PIN_DC_REQUEST = extern struct { MessageType: u32, Flags: u32, DomainName: UNICODE_STRING, DcName: UNICODE_STRING, DcFlags: u32, }; pub const SECPKG_CALL_PACKAGE_UNPIN_ALL_DCS_REQUEST = extern struct { MessageType: u32, Flags: u32, }; pub const SECPKG_CALL_PACKAGE_TRANSFER_CRED_REQUEST = extern struct { MessageType: u32, OriginLogonId: LUID, DestinationLogonId: LUID, Flags: u32, }; pub const PLSA_REDIRECTED_LOGON_INIT = fn( RedirectedLogonHandle: ?HANDLE, PackageName: ?*const UNICODE_STRING, SessionId: u32, LogonId: ?*const LUID, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_REDIRECTED_LOGON_CALLBACK = fn( RedirectedLogonHandle: ?HANDLE, Buffer: ?*c_void, BufferLength: u32, ReturnBuffer: ?*?*c_void, ReturnBufferLength: ?*u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_REDIRECTED_LOGON_CLEANUP_CALLBACK = fn( RedirectedLogonHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) void; pub const PLSA_REDIRECTED_LOGON_GET_LOGON_CREDS = fn( RedirectedLogonHandle: ?HANDLE, LogonBuffer: ?*?*u8, LogonBufferLength: ?*u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_REDIRECTED_LOGON_GET_SUPP_CREDS = fn( RedirectedLogonHandle: ?HANDLE, SupplementalCredentials: ?*?*SECPKG_SUPPLEMENTAL_CRED_ARRAY, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SECPKG_REDIRECTED_LOGON_BUFFER = extern struct { RedirectedLogonGuid: Guid, RedirectedLogonHandle: ?HANDLE, Init: ?PLSA_REDIRECTED_LOGON_INIT, Callback: ?PLSA_REDIRECTED_LOGON_CALLBACK, CleanupCallback: ?PLSA_REDIRECTED_LOGON_CLEANUP_CALLBACK, GetLogonCreds: ?PLSA_REDIRECTED_LOGON_GET_LOGON_CREDS, GetSupplementalCreds: ?PLSA_REDIRECTED_LOGON_GET_SUPP_CREDS, }; pub const SECPKG_POST_LOGON_USER_INFO = extern struct { Flags: u32, LogonId: LUID, LinkedLogonId: LUID, }; pub const PLSA_IMPERSONATE_CLIENT = fn( ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_UNLOAD_PACKAGE = fn( ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_DUPLICATE_HANDLE = fn( SourceHandle: ?HANDLE, DestionationHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_SAVE_SUPPLEMENTAL_CREDENTIALS = fn( LogonId: ?*LUID, SupplementalCredSize: u32, // TODO: what to do with BytesParamIndex 1? SupplementalCreds: ?*c_void, Synchronous: BOOLEAN, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_CREATE_THREAD = fn( SecurityAttributes: ?*SECURITY_ATTRIBUTES, StackSize: u32, StartFunction: ?LPTHREAD_START_ROUTINE, ThreadParameter: ?*c_void, CreationFlags: u32, ThreadId: ?*u32, ) callconv(@import("std").os.windows.WINAPI) ?HANDLE; pub const PLSA_GET_CLIENT_INFO = fn( ClientInfo: ?*SECPKG_CLIENT_INFO, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_REGISTER_NOTIFICATION = fn( StartFunction: ?LPTHREAD_START_ROUTINE, Parameter: ?*c_void, NotificationType: u32, NotificationClass: u32, NotificationFlags: u32, IntervalMinutes: u32, WaitEvent: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) ?HANDLE; pub const PLSA_CANCEL_NOTIFICATION = fn( NotifyHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_MAP_BUFFER = fn( InputBuffer: ?*SecBuffer, OutputBuffer: ?*SecBuffer, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_CREATE_TOKEN = fn( LogonId: ?*LUID, TokenSource: ?*TOKEN_SOURCE, LogonType: SECURITY_LOGON_TYPE, ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL, TokenInformationType: LSA_TOKEN_INFORMATION_TYPE, TokenInformation: ?*c_void, TokenGroups: ?*TOKEN_GROUPS, AccountName: ?*UNICODE_STRING, AuthorityName: ?*UNICODE_STRING, Workstation: ?*UNICODE_STRING, ProfilePath: ?*UNICODE_STRING, Token: ?*?HANDLE, SubStatus: ?*i32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SECPKG_SESSIONINFO_TYPE = enum(i32) { d = 0, }; pub const SecSessionPrimaryCred = SECPKG_SESSIONINFO_TYPE.d; pub const PLSA_CREATE_TOKEN_EX = fn( LogonId: ?*LUID, TokenSource: ?*TOKEN_SOURCE, LogonType: SECURITY_LOGON_TYPE, ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL, TokenInformationType: LSA_TOKEN_INFORMATION_TYPE, TokenInformation: ?*c_void, TokenGroups: ?*TOKEN_GROUPS, Workstation: ?*UNICODE_STRING, ProfilePath: ?*UNICODE_STRING, SessionInformation: ?*c_void, SessionInformationType: SECPKG_SESSIONINFO_TYPE, Token: ?*?HANDLE, SubStatus: ?*i32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_AUDIT_LOGON = fn( Status: NTSTATUS, SubStatus: NTSTATUS, AccountName: ?*UNICODE_STRING, AuthenticatingAuthority: ?*UNICODE_STRING, WorkstationName: ?*UNICODE_STRING, UserSid: ?PSID, LogonType: SECURITY_LOGON_TYPE, TokenSource: ?*TOKEN_SOURCE, LogonId: ?*LUID, ) callconv(@import("std").os.windows.WINAPI) void; pub const PLSA_CALL_PACKAGE = fn( AuthenticationPackage: ?*UNICODE_STRING, // TODO: what to do with BytesParamIndex 2? ProtocolSubmitBuffer: ?*c_void, SubmitBufferLength: u32, ProtocolReturnBuffer: ?*?*c_void, ReturnBufferLength: ?*u32, ProtocolStatus: ?*i32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_CALL_PACKAGEEX = fn( AuthenticationPackage: ?*UNICODE_STRING, ClientBufferBase: ?*c_void, // TODO: what to do with BytesParamIndex 3? ProtocolSubmitBuffer: ?*c_void, SubmitBufferLength: u32, ProtocolReturnBuffer: ?*?*c_void, ReturnBufferLength: ?*u32, ProtocolStatus: ?*i32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_CALL_PACKAGE_PASSTHROUGH = fn( AuthenticationPackage: ?*UNICODE_STRING, ClientBufferBase: ?*c_void, // TODO: what to do with BytesParamIndex 3? ProtocolSubmitBuffer: ?*c_void, SubmitBufferLength: u32, ProtocolReturnBuffer: ?*?*c_void, ReturnBufferLength: ?*u32, ProtocolStatus: ?*i32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_GET_CALL_INFO = fn( Info: ?*SECPKG_CALL_INFO, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; pub const PLSA_CREATE_SHARED_MEMORY = fn( MaxSize: u32, InitialSize: u32, ) callconv(@import("std").os.windows.WINAPI) ?*c_void; pub const PLSA_ALLOCATE_SHARED_MEMORY = fn( SharedMem: ?*c_void, Size: u32, ) callconv(@import("std").os.windows.WINAPI) ?*c_void; pub const PLSA_FREE_SHARED_MEMORY = fn( SharedMem: ?*c_void, Memory: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) void; pub const PLSA_DELETE_SHARED_MEMORY = fn( SharedMem: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; pub const PLSA_GET_APP_MODE_INFO = fn( UserFunction: ?*u32, Argument1: ?*usize, Argument2: ?*usize, UserData: ?*SecBuffer, ReturnToLsa: ?*BOOLEAN, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_SET_APP_MODE_INFO = fn( UserFunction: u32, Argument1: usize, Argument2: usize, UserData: ?*SecBuffer, ReturnToLsa: BOOLEAN, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SECPKG_NAME_TYPE = enum(i32) { SamCompatible = 0, AlternateId = 1, Flat = 2, DN = 3, SPN = 4, }; pub const SecNameSamCompatible = SECPKG_NAME_TYPE.SamCompatible; pub const SecNameAlternateId = SECPKG_NAME_TYPE.AlternateId; pub const SecNameFlat = SECPKG_NAME_TYPE.Flat; pub const SecNameDN = SECPKG_NAME_TYPE.DN; pub const SecNameSPN = SECPKG_NAME_TYPE.SPN; pub const PLSA_OPEN_SAM_USER = fn( Name: ?*UNICODE_STRING, NameType: SECPKG_NAME_TYPE, Prefix: ?*UNICODE_STRING, AllowGuest: BOOLEAN, Reserved: u32, UserHandle: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_GET_USER_CREDENTIALS = fn( UserHandle: ?*c_void, PrimaryCreds: ?*?*c_void, PrimaryCredsSize: ?*u32, SupplementalCreds: ?*?*c_void, SupplementalCredsSize: ?*u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_GET_USER_AUTH_DATA = fn( UserHandle: ?*c_void, UserAuthData: ?*?*u8, UserAuthDataSize: ?*u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_CLOSE_SAM_USER = fn( UserHandle: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_GET_AUTH_DATA_FOR_USER = fn( Name: ?*UNICODE_STRING, NameType: SECPKG_NAME_TYPE, Prefix: ?*UNICODE_STRING, UserAuthData: ?*?*u8, UserAuthDataSize: ?*u32, UserFlatName: ?*UNICODE_STRING, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_CONVERT_AUTH_DATA_TO_TOKEN = fn( UserAuthData: ?*c_void, UserAuthDataSize: u32, ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL, TokenSource: ?*TOKEN_SOURCE, LogonType: SECURITY_LOGON_TYPE, AuthorityName: ?*UNICODE_STRING, Token: ?*?HANDLE, LogonId: ?*LUID, AccountName: ?*UNICODE_STRING, SubStatus: ?*i32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_CRACK_SINGLE_NAME = fn( FormatOffered: u32, PerformAtGC: BOOLEAN, NameInput: ?*UNICODE_STRING, Prefix: ?*UNICODE_STRING, RequestedFormat: u32, CrackedName: ?*UNICODE_STRING, DnsDomainName: ?*UNICODE_STRING, SubStatus: ?*u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_AUDIT_ACCOUNT_LOGON = fn( AuditId: u32, Success: BOOLEAN, Source: ?*UNICODE_STRING, ClientName: ?*UNICODE_STRING, MappedName: ?*UNICODE_STRING, Status: NTSTATUS, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_CLIENT_CALLBACK = fn( Callback: ?[*]u8, Argument1: usize, Argument2: usize, Input: ?*SecBuffer, Output: ?*SecBuffer, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_REGISTER_CALLBACK = fn( CallbackId: u32, Callback: ?PLSA_CALLBACK_FUNCTION, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_GET_EXTENDED_CALL_FLAGS = fn( Flags: ?*u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SECPKG_EVENT_PACKAGE_CHANGE = extern struct { ChangeType: SECPKG_PACKAGE_CHANGE_TYPE, PackageId: usize, PackageName: UNICODE_STRING, }; pub const SECPKG_EVENT_ROLE_CHANGE = extern struct { PreviousRole: u32, NewRole: u32, }; pub const SECPKG_EVENT_NOTIFY = extern struct { EventClass: u32, Reserved: u32, EventDataSize: u32, EventData: ?*c_void, PackageParameter: ?*c_void, }; pub const PLSA_UPDATE_PRIMARY_CREDENTIALS = fn( PrimaryCredentials: ?*SECPKG_PRIMARY_CRED, Credentials: ?*SECPKG_SUPPLEMENTAL_CRED_ARRAY, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_PROTECT_MEMORY = fn( // TODO: what to do with BytesParamIndex 1? Buffer: ?*c_void, BufferSize: u32, ) callconv(@import("std").os.windows.WINAPI) void; pub const PLSA_OPEN_TOKEN_BY_LOGON_ID = fn( LogonId: ?*LUID, RetTokenHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_EXPAND_AUTH_DATA_FOR_DOMAIN = fn( // TODO: what to do with BytesParamIndex 1? UserAuthData: ?*u8, UserAuthDataSize: u32, Reserved: ?*c_void, ExpandedAuthData: ?*?*u8, ExpandedAuthDataSize: ?*u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const CRED_FETCH = enum(i32) { Default = 0, DPAPI = 1, Forced = 2, }; pub const CredFetchDefault = CRED_FETCH.Default; pub const CredFetchDPAPI = CRED_FETCH.DPAPI; pub const CredFetchForced = CRED_FETCH.Forced; pub const PLSA_GET_SERVICE_ACCOUNT_PASSWORD = fn( AccountName: ?*UNICODE_STRING, DomainName: ?*UNICODE_STRING, CredFetch: CRED_FETCH, FileTimeExpiry: ?*FILETIME, CurrentPassword: ?*UNICODE_STRING, PreviousPassword: ?*UNICODE_STRING, FileTimeCurrPwdValidForOutbound: ?*FILETIME, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_AUDIT_LOGON_EX = fn( Status: NTSTATUS, SubStatus: NTSTATUS, AccountName: ?*UNICODE_STRING, AuthenticatingAuthority: ?*UNICODE_STRING, WorkstationName: ?*UNICODE_STRING, UserSid: ?PSID, LogonType: SECURITY_LOGON_TYPE, ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL, TokenSource: ?*TOKEN_SOURCE, LogonId: ?*LUID, ) callconv(@import("std").os.windows.WINAPI) void; pub const PLSA_CHECK_PROTECTED_USER_BY_TOKEN = fn( UserToken: ?HANDLE, ProtectedUser: ?*BOOLEAN, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_QUERY_CLIENT_REQUEST = fn( ClientRequest: ?*?*c_void, QueryType: u32, ReplyBuffer: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const ENCRYPTED_CREDENTIALW = extern struct { Cred: CREDENTIALW, ClearCredentialBlobSize: u32, }; pub const CredReadFn = fn( LogonId: ?*LUID, CredFlags: u32, TargetName: ?PWSTR, Type: u32, Flags: u32, Credential: ?*?*ENCRYPTED_CREDENTIALW, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const CredReadDomainCredentialsFn = fn( LogonId: ?*LUID, CredFlags: u32, TargetInfo: ?*CREDENTIAL_TARGET_INFORMATIONW, Flags: u32, Count: ?*u32, Credential: ?*?*?*ENCRYPTED_CREDENTIALW, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const CredFreeCredentialsFn = fn( Count: u32, Credentials: ?[*]?*ENCRYPTED_CREDENTIALW, ) callconv(@import("std").os.windows.WINAPI) void; pub const CredWriteFn = fn( LogonId: ?*LUID, CredFlags: u32, Credential: ?*ENCRYPTED_CREDENTIALW, Flags: u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const CrediUnmarshalandDecodeStringFn = fn( MarshaledString: ?PWSTR, Blob: ?*?*u8, BlobSize: ?*u32, IsFailureFatal: ?*u8, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SEC_WINNT_AUTH_IDENTITY32 = extern struct { User: u32, UserLength: u32, Domain: u32, DomainLength: u32, Password: <PASSWORD>, PasswordLength: u32, Flags: u32, }; pub const SEC_WINNT_AUTH_IDENTITY_EX32 = extern struct { Version: u32, Length: u32, User: u32, UserLength: u32, Domain: u32, DomainLength: u32, Password: <PASSWORD>, PasswordLength: u32, Flags: u32, PackageList: u32, PackageListLength: u32, }; pub const LSA_SECPKG_FUNCTION_TABLE = extern struct { CreateLogonSession: ?PLSA_CREATE_LOGON_SESSION, DeleteLogonSession: ?PLSA_DELETE_LOGON_SESSION, AddCredential: ?PLSA_ADD_CREDENTIAL, GetCredentials: ?PLSA_GET_CREDENTIALS, DeleteCredential: ?PLSA_DELETE_CREDENTIAL, AllocateLsaHeap: ?PLSA_ALLOCATE_LSA_HEAP, FreeLsaHeap: ?PLSA_FREE_LSA_HEAP, AllocateClientBuffer: ?PLSA_ALLOCATE_CLIENT_BUFFER, FreeClientBuffer: ?PLSA_FREE_CLIENT_BUFFER, CopyToClientBuffer: ?PLSA_COPY_TO_CLIENT_BUFFER, CopyFromClientBuffer: ?PLSA_COPY_FROM_CLIENT_BUFFER, ImpersonateClient: ?PLSA_IMPERSONATE_CLIENT, UnloadPackage: ?PLSA_UNLOAD_PACKAGE, DuplicateHandle: ?PLSA_DUPLICATE_HANDLE, SaveSupplementalCredentials: ?PLSA_SAVE_SUPPLEMENTAL_CREDENTIALS, CreateThread: ?PLSA_CREATE_THREAD, GetClientInfo: ?PLSA_GET_CLIENT_INFO, RegisterNotification: ?PLSA_REGISTER_NOTIFICATION, CancelNotification: ?PLSA_CANCEL_NOTIFICATION, MapBuffer: ?PLSA_MAP_BUFFER, CreateToken: ?PLSA_CREATE_TOKEN, AuditLogon: ?PLSA_AUDIT_LOGON, CallPackage: ?PLSA_CALL_PACKAGE, FreeReturnBuffer: ?PLSA_FREE_LSA_HEAP, GetCallInfo: ?PLSA_GET_CALL_INFO, CallPackageEx: ?PLSA_CALL_PACKAGEEX, CreateSharedMemory: ?PLSA_CREATE_SHARED_MEMORY, AllocateSharedMemory: ?PLSA_ALLOCATE_SHARED_MEMORY, FreeSharedMemory: ?PLSA_FREE_SHARED_MEMORY, DeleteSharedMemory: ?PLSA_DELETE_SHARED_MEMORY, OpenSamUser: ?PLSA_OPEN_SAM_USER, GetUserCredentials: ?PLSA_GET_USER_CREDENTIALS, GetUserAuthData: ?PLSA_GET_USER_AUTH_DATA, CloseSamUser: ?PLSA_CLOSE_SAM_USER, ConvertAuthDataToToken: ?PLSA_CONVERT_AUTH_DATA_TO_TOKEN, ClientCallback: ?PLSA_CLIENT_CALLBACK, UpdateCredentials: ?PLSA_UPDATE_PRIMARY_CREDENTIALS, GetAuthDataForUser: ?PLSA_GET_AUTH_DATA_FOR_USER, CrackSingleName: ?PLSA_CRACK_SINGLE_NAME, AuditAccountLogon: ?PLSA_AUDIT_ACCOUNT_LOGON, CallPackagePassthrough: ?PLSA_CALL_PACKAGE_PASSTHROUGH, CrediRead: ?CredReadFn, CrediReadDomainCredentials: ?CredReadDomainCredentialsFn, CrediFreeCredentials: ?CredFreeCredentialsFn, LsaProtectMemory: ?PLSA_PROTECT_MEMORY, LsaUnprotectMemory: ?PLSA_PROTECT_MEMORY, OpenTokenByLogonId: ?PLSA_OPEN_TOKEN_BY_LOGON_ID, ExpandAuthDataForDomain: ?PLSA_EXPAND_AUTH_DATA_FOR_DOMAIN, AllocatePrivateHeap: ?PLSA_ALLOCATE_PRIVATE_HEAP, FreePrivateHeap: ?PLSA_FREE_PRIVATE_HEAP, CreateTokenEx: ?PLSA_CREATE_TOKEN_EX, CrediWrite: ?CredWriteFn, CrediUnmarshalandDecodeString: ?CrediUnmarshalandDecodeStringFn, DummyFunction6: ?PLSA_PROTECT_MEMORY, GetExtendedCallFlags: ?PLSA_GET_EXTENDED_CALL_FLAGS, DuplicateTokenHandle: ?PLSA_DUPLICATE_HANDLE, GetServiceAccountPassword: ?PLSA_GET_SERVICE_ACCOUNT_PASSWORD, DummyFunction7: ?PLSA_PROTECT_MEMORY, AuditLogonEx: ?PLSA_AUDIT_LOGON_EX, CheckProtectedUserByToken: ?PLSA_CHECK_PROTECTED_USER_BY_TOKEN, QueryClientRequest: ?PLSA_QUERY_CLIENT_REQUEST, GetAppModeInfo: ?PLSA_GET_APP_MODE_INFO, SetAppModeInfo: ?PLSA_SET_APP_MODE_INFO, }; pub const PLSA_LOCATE_PKG_BY_ID = fn( PackgeId: u32, ) callconv(@import("std").os.windows.WINAPI) ?*c_void; pub const SECPKG_DLL_FUNCTIONS = extern struct { AllocateHeap: ?PLSA_ALLOCATE_LSA_HEAP, FreeHeap: ?PLSA_FREE_LSA_HEAP, RegisterCallback: ?PLSA_REGISTER_CALLBACK, LocatePackageById: ?PLSA_LOCATE_PKG_BY_ID, }; pub const SpInitializeFn = fn( PackageId: usize, Parameters: ?*SECPKG_PARAMETERS, FunctionTable: ?*LSA_SECPKG_FUNCTION_TABLE, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpShutdownFn = fn( ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpGetInfoFn = fn( PackageInfo: ?*SecPkgInfoA, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpGetExtendedInformationFn = fn( Class: SECPKG_EXTENDED_INFORMATION_CLASS, ppInformation: ?*?*SECPKG_EXTENDED_INFORMATION, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpSetExtendedInformationFn = fn( Class: SECPKG_EXTENDED_INFORMATION_CLASS, Info: ?*SECPKG_EXTENDED_INFORMATION, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_AP_LOGON_USER_EX2 = fn( ClientRequest: ?*?*c_void, LogonType: SECURITY_LOGON_TYPE, // TODO: what to do with BytesParamIndex 4? ProtocolSubmitBuffer: ?*c_void, ClientBufferBase: ?*c_void, SubmitBufferSize: u32, ProfileBuffer: ?*?*c_void, ProfileBufferSize: ?*u32, LogonId: ?*LUID, SubStatus: ?*i32, TokenInformationType: ?*LSA_TOKEN_INFORMATION_TYPE, TokenInformation: ?*?*c_void, AccountName: ?*?*UNICODE_STRING, AuthenticatingAuthority: ?*?*UNICODE_STRING, MachineName: ?*?*UNICODE_STRING, PrimaryCredentials: ?*SECPKG_PRIMARY_CRED, SupplementalCredentials: ?*?*SECPKG_SUPPLEMENTAL_CRED_ARRAY, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_AP_LOGON_USER_EX3 = fn( ClientRequest: ?*?*c_void, LogonType: SECURITY_LOGON_TYPE, // TODO: what to do with BytesParamIndex 4? ProtocolSubmitBuffer: ?*c_void, ClientBufferBase: ?*c_void, SubmitBufferSize: u32, SurrogateLogon: ?*SECPKG_SURROGATE_LOGON, ProfileBuffer: ?*?*c_void, ProfileBufferSize: ?*u32, LogonId: ?*LUID, SubStatus: ?*i32, TokenInformationType: ?*LSA_TOKEN_INFORMATION_TYPE, TokenInformation: ?*?*c_void, AccountName: ?*?*UNICODE_STRING, AuthenticatingAuthority: ?*?*UNICODE_STRING, MachineName: ?*?*UNICODE_STRING, PrimaryCredentials: ?*SECPKG_PRIMARY_CRED, SupplementalCredentials: ?*?*SECPKG_SUPPLEMENTAL_CRED_ARRAY, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_AP_PRE_LOGON_USER_SURROGATE = fn( ClientRequest: ?*?*c_void, LogonType: SECURITY_LOGON_TYPE, // TODO: what to do with BytesParamIndex 4? ProtocolSubmitBuffer: ?*c_void, ClientBufferBase: ?*c_void, SubmitBufferSize: u32, SurrogateLogon: ?*SECPKG_SURROGATE_LOGON, SubStatus: ?*i32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PLSA_AP_POST_LOGON_USER_SURROGATE = fn( ClientRequest: ?*?*c_void, LogonType: SECURITY_LOGON_TYPE, // TODO: what to do with BytesParamIndex 4? ProtocolSubmitBuffer: ?*c_void, ClientBufferBase: ?*c_void, SubmitBufferSize: u32, SurrogateLogon: ?*SECPKG_SURROGATE_LOGON, // TODO: what to do with BytesParamIndex 7? ProfileBuffer: ?*c_void, ProfileBufferSize: u32, LogonId: ?*LUID, Status: NTSTATUS, SubStatus: NTSTATUS, TokenInformationType: LSA_TOKEN_INFORMATION_TYPE, TokenInformation: ?*c_void, AccountName: ?*UNICODE_STRING, AuthenticatingAuthority: ?*UNICODE_STRING, MachineName: ?*UNICODE_STRING, PrimaryCredentials: ?*SECPKG_PRIMARY_CRED, SupplementalCredentials: ?*SECPKG_SUPPLEMENTAL_CRED_ARRAY, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpAcceptCredentialsFn = fn( LogonType: SECURITY_LOGON_TYPE, AccountName: ?*UNICODE_STRING, PrimaryCredentials: ?*SECPKG_PRIMARY_CRED, SupplementalCredentials: ?*SECPKG_SUPPLEMENTAL_CRED, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpAcquireCredentialsHandleFn = fn( PrincipalName: ?*UNICODE_STRING, CredentialUseFlags: u32, LogonId: ?*LUID, AuthorizationData: ?*c_void, GetKeyFunciton: ?*c_void, GetKeyArgument: ?*c_void, CredentialHandle: ?*usize, ExpirationTime: ?*LARGE_INTEGER, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpFreeCredentialsHandleFn = fn( CredentialHandle: usize, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpQueryCredentialsAttributesFn = fn( CredentialHandle: usize, CredentialAttribute: u32, Buffer: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpSetCredentialsAttributesFn = fn( CredentialHandle: usize, CredentialAttribute: u32, // TODO: what to do with BytesParamIndex 3? Buffer: ?*c_void, BufferSize: u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpAddCredentialsFn = fn( CredentialHandle: usize, PrincipalName: ?*UNICODE_STRING, Package: ?*UNICODE_STRING, CredentialUseFlags: u32, AuthorizationData: ?*c_void, GetKeyFunciton: ?*c_void, GetKeyArgument: ?*c_void, ExpirationTime: ?*LARGE_INTEGER, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpSaveCredentialsFn = fn( CredentialHandle: usize, Credentials: ?*SecBuffer, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpGetCredentialsFn = fn( CredentialHandle: usize, Credentials: ?*SecBuffer, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpDeleteCredentialsFn = fn( CredentialHandle: usize, Key: ?*SecBuffer, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpInitLsaModeContextFn = fn( CredentialHandle: usize, ContextHandle: usize, TargetName: ?*UNICODE_STRING, ContextRequirements: u32, TargetDataRep: u32, InputBuffers: ?*SecBufferDesc, NewContextHandle: ?*usize, OutputBuffers: ?*SecBufferDesc, ContextAttributes: ?*u32, ExpirationTime: ?*LARGE_INTEGER, MappedContext: ?*BOOLEAN, ContextData: ?*SecBuffer, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpDeleteContextFn = fn( ContextHandle: usize, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpApplyControlTokenFn = fn( ContextHandle: usize, ControlToken: ?*SecBufferDesc, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpAcceptLsaModeContextFn = fn( CredentialHandle: usize, ContextHandle: usize, InputBuffer: ?*SecBufferDesc, ContextRequirements: u32, TargetDataRep: u32, NewContextHandle: ?*usize, OutputBuffer: ?*SecBufferDesc, ContextAttributes: ?*u32, ExpirationTime: ?*LARGE_INTEGER, MappedContext: ?*BOOLEAN, ContextData: ?*SecBuffer, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpGetUserInfoFn = fn( LogonId: ?*LUID, Flags: u32, UserData: ?*?*SECURITY_USER_DATA, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpQueryContextAttributesFn = fn( ContextHandle: usize, ContextAttribute: u32, Buffer: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpSetContextAttributesFn = fn( ContextHandle: usize, ContextAttribute: u32, // TODO: what to do with BytesParamIndex 3? Buffer: ?*c_void, BufferSize: u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpChangeAccountPasswordFn = fn( pDomainName: ?*UNICODE_STRING, pAccountName: ?*UNICODE_STRING, pOldPassword: ?*UNICODE_STRING, pNewPassword: ?*UNICODE_STRING, Impersonating: BOOLEAN, pOutput: ?*SecBufferDesc, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpQueryMetaDataFn = fn( CredentialHandle: usize, TargetName: ?*UNICODE_STRING, ContextRequirements: u32, MetaDataLength: ?*u32, MetaData: ?*?*u8, ContextHandle: ?*usize, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpExchangeMetaDataFn = fn( CredentialHandle: usize, TargetName: ?*UNICODE_STRING, ContextRequirements: u32, MetaDataLength: u32, // TODO: what to do with BytesParamIndex 3? MetaData: ?*u8, ContextHandle: ?*usize, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpGetCredUIContextFn = fn( ContextHandle: usize, CredType: ?*Guid, FlatCredUIContextLength: ?*u32, FlatCredUIContext: ?*?*u8, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpUpdateCredentialsFn = fn( ContextHandle: usize, CredType: ?*Guid, FlatCredUIContextLength: u32, // TODO: what to do with BytesParamIndex 2? FlatCredUIContext: ?*u8, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpValidateTargetInfoFn = fn( ClientRequest: ?*?*c_void, // TODO: what to do with BytesParamIndex 3? ProtocolSubmitBuffer: ?*c_void, ClientBufferBase: ?*c_void, SubmitBufferLength: u32, TargetInfo: ?*SECPKG_TARGETINFO, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const LSA_AP_POST_LOGON_USER = fn( PostLogonUserInfo: ?*SECPKG_POST_LOGON_USER_INFO, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpGetRemoteCredGuardLogonBufferFn = fn( CredHandle: usize, ContextHandle: usize, TargetName: ?*const UNICODE_STRING, RedirectedLogonHandle: ?*?HANDLE, Callback: ?*?PLSA_REDIRECTED_LOGON_CALLBACK, CleanupCallback: ?*?PLSA_REDIRECTED_LOGON_CLEANUP_CALLBACK, LogonBufferSize: ?*u32, LogonBuffer: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpGetRemoteCredGuardSupplementalCredsFn = fn( CredHandle: usize, TargetName: ?*const UNICODE_STRING, RedirectedLogonHandle: ?*?HANDLE, Callback: ?*?PLSA_REDIRECTED_LOGON_CALLBACK, CleanupCallback: ?*?PLSA_REDIRECTED_LOGON_CLEANUP_CALLBACK, SupplementalCredsSize: ?*u32, SupplementalCreds: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpGetTbalSupplementalCredsFn = fn( LogonId: LUID, SupplementalCredsSize: ?*u32, SupplementalCreds: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SECPKG_FUNCTION_TABLE = extern struct { InitializePackage: ?PLSA_AP_INITIALIZE_PACKAGE, LogonUserA: ?PLSA_AP_LOGON_USER, CallPackage: ?PLSA_AP_CALL_PACKAGE, LogonTerminated: ?PLSA_AP_LOGON_TERMINATED, CallPackageUntrusted: ?PLSA_AP_CALL_PACKAGE, CallPackagePassthrough: ?PLSA_AP_CALL_PACKAGE_PASSTHROUGH, LogonUserExA: ?PLSA_AP_LOGON_USER_EX, LogonUserEx2: ?PLSA_AP_LOGON_USER_EX2, Initialize: ?SpInitializeFn, Shutdown: ?SpShutdownFn, GetInfo: ?SpGetInfoFn, AcceptCredentials: ?SpAcceptCredentialsFn, AcquireCredentialsHandleA: ?SpAcquireCredentialsHandleFn, QueryCredentialsAttributesA: ?SpQueryCredentialsAttributesFn, FreeCredentialsHandle: ?SpFreeCredentialsHandleFn, SaveCredentials: ?SpSaveCredentialsFn, GetCredentials: ?SpGetCredentialsFn, DeleteCredentials: ?SpDeleteCredentialsFn, InitLsaModeContext: ?SpInitLsaModeContextFn, AcceptLsaModeContext: ?SpAcceptLsaModeContextFn, DeleteContext: ?SpDeleteContextFn, ApplyControlToken: ?SpApplyControlTokenFn, GetUserInfo: ?SpGetUserInfoFn, GetExtendedInformation: ?SpGetExtendedInformationFn, QueryContextAttributesA: ?SpQueryContextAttributesFn, AddCredentialsA: ?SpAddCredentialsFn, SetExtendedInformation: ?SpSetExtendedInformationFn, SetContextAttributesA: ?SpSetContextAttributesFn, SetCredentialsAttributesA: ?SpSetCredentialsAttributesFn, ChangeAccountPasswordA: ?SpChangeAccountPasswordFn, QueryMetaData: ?SpQueryMetaDataFn, ExchangeMetaData: ?SpExchangeMetaDataFn, GetCredUIContext: ?SpGetCredUIContextFn, UpdateCredentials: ?SpUpdateCredentialsFn, ValidateTargetInfo: ?SpValidateTargetInfoFn, PostLogonUser: ?LSA_AP_POST_LOGON_USER, GetRemoteCredGuardLogonBuffer: ?SpGetRemoteCredGuardLogonBufferFn, GetRemoteCredGuardSupplementalCreds: ?SpGetRemoteCredGuardSupplementalCredsFn, GetTbalSupplementalCreds: ?SpGetTbalSupplementalCredsFn, LogonUserEx3: ?PLSA_AP_LOGON_USER_EX3, PreLogonUserSurrogate: ?PLSA_AP_PRE_LOGON_USER_SURROGATE, PostLogonUserSurrogate: ?PLSA_AP_POST_LOGON_USER_SURROGATE, }; pub const SpInstanceInitFn = fn( Version: u32, FunctionTable: ?*SECPKG_DLL_FUNCTIONS, UserFunctions: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpInitUserModeContextFn = fn( ContextHandle: usize, PackedContext: ?*SecBuffer, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpMakeSignatureFn = fn( ContextHandle: usize, QualityOfProtection: u32, MessageBuffers: ?*SecBufferDesc, MessageSequenceNumber: u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpVerifySignatureFn = fn( ContextHandle: usize, MessageBuffers: ?*SecBufferDesc, MessageSequenceNumber: u32, QualityOfProtection: ?*u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpSealMessageFn = fn( ContextHandle: usize, QualityOfProtection: u32, MessageBuffers: ?*SecBufferDesc, MessageSequenceNumber: u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpUnsealMessageFn = fn( ContextHandle: usize, MessageBuffers: ?*SecBufferDesc, MessageSequenceNumber: u32, QualityOfProtection: ?*u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpGetContextTokenFn = fn( ContextHandle: usize, ImpersonationToken: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpExportSecurityContextFn = fn( phContext: usize, fFlags: u32, pPackedContext: ?*SecBuffer, pToken: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpImportSecurityContextFn = fn( pPackedContext: ?*SecBuffer, Token: ?HANDLE, phContext: ?*usize, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpCompleteAuthTokenFn = fn( ContextHandle: usize, InputBuffer: ?*SecBufferDesc, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpFormatCredentialsFn = fn( Credentials: ?*SecBuffer, FormattedCredentials: ?*SecBuffer, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpMarshallSupplementalCredsFn = fn( CredentialSize: u32, // TODO: what to do with BytesParamIndex 0? Credentials: ?*u8, MarshalledCredSize: ?*u32, MarshalledCreds: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SECPKG_USER_FUNCTION_TABLE = extern struct { InstanceInit: ?SpInstanceInitFn, InitUserModeContext: ?SpInitUserModeContextFn, MakeSignature: ?SpMakeSignatureFn, VerifySignature: ?SpVerifySignatureFn, SealMessage: ?SpSealMessageFn, UnsealMessage: ?SpUnsealMessageFn, GetContextToken: ?SpGetContextTokenFn, QueryContextAttributesA: ?SpQueryContextAttributesFn, CompleteAuthToken: ?SpCompleteAuthTokenFn, DeleteUserModeContext: ?SpDeleteContextFn, FormatCredentials: ?SpFormatCredentialsFn, MarshallSupplementalCreds: ?SpMarshallSupplementalCredsFn, ExportContext: ?SpExportSecurityContextFn, ImportContext: ?SpImportSecurityContextFn, }; pub const SpLsaModeInitializeFn = fn( LsaVersion: u32, PackageVersion: ?*u32, ppTables: ?*?*SECPKG_FUNCTION_TABLE, pcTables: ?*u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SpUserModeInitializeFn = fn( LsaVersion: u32, PackageVersion: ?*u32, ppTables: ?*?*SECPKG_USER_FUNCTION_TABLE, pcTables: ?*u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const KSEC_CONTEXT_TYPE = enum(i32) { Paged = 0, NonPaged = 1, }; pub const KSecPaged = KSEC_CONTEXT_TYPE.Paged; pub const KSecNonPaged = KSEC_CONTEXT_TYPE.NonPaged; pub const KSEC_LIST_ENTRY = extern struct { List: LIST_ENTRY, RefCount: i32, Signature: u32, OwningList: ?*c_void, Reserved: ?*c_void, }; pub const PKSEC_CREATE_CONTEXT_LIST = fn( Type: KSEC_CONTEXT_TYPE, ) callconv(@import("std").os.windows.WINAPI) ?*c_void; pub const PKSEC_INSERT_LIST_ENTRY = fn( List: ?*c_void, Entry: ?*KSEC_LIST_ENTRY, ) callconv(@import("std").os.windows.WINAPI) void; pub const PKSEC_REFERENCE_LIST_ENTRY = fn( Entry: ?*KSEC_LIST_ENTRY, Signature: u32, RemoveNoRef: BOOLEAN, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PKSEC_DEREFERENCE_LIST_ENTRY = fn( Entry: ?*KSEC_LIST_ENTRY, Delete: ?*u8, ) callconv(@import("std").os.windows.WINAPI) void; pub const PKSEC_SERIALIZE_WINNT_AUTH_DATA = fn( pvAuthData: ?*c_void, Size: ?*u32, SerializedData: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PKSEC_SERIALIZE_SCHANNEL_AUTH_DATA = fn( pvAuthData: ?*c_void, Size: ?*u32, SerializedData: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const PKSEC_LOCATE_PKG_BY_ID = fn( PackageId: u32, ) callconv(@import("std").os.windows.WINAPI) ?*c_void; pub const SECPKG_KERNEL_FUNCTIONS = extern struct { AllocateHeap: ?PLSA_ALLOCATE_LSA_HEAP, FreeHeap: ?PLSA_FREE_LSA_HEAP, CreateContextList: ?PKSEC_CREATE_CONTEXT_LIST, InsertListEntry: ?PKSEC_INSERT_LIST_ENTRY, ReferenceListEntry: ?PKSEC_REFERENCE_LIST_ENTRY, DereferenceListEntry: ?PKSEC_DEREFERENCE_LIST_ENTRY, SerializeWinntAuthData: ?PKSEC_SERIALIZE_WINNT_AUTH_DATA, SerializeSchannelAuthData: ?PKSEC_SERIALIZE_SCHANNEL_AUTH_DATA, LocatePackageById: ?PKSEC_LOCATE_PKG_BY_ID, }; pub const KspInitPackageFn = fn( FunctionTable: ?*SECPKG_KERNEL_FUNCTIONS, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const KspDeleteContextFn = fn( ContextId: usize, LsaContextId: ?*usize, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const KspInitContextFn = fn( ContextId: usize, ContextData: ?*SecBuffer, NewContextId: ?*usize, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const KspMakeSignatureFn = fn( ContextId: usize, fQOP: u32, Message: ?*SecBufferDesc, MessageSeqNo: u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const KspVerifySignatureFn = fn( ContextId: usize, Message: ?*SecBufferDesc, MessageSeqNo: u32, pfQOP: ?*u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const KspSealMessageFn = fn( ContextId: usize, fQOP: u32, Message: ?*SecBufferDesc, MessageSeqNo: u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const KspUnsealMessageFn = fn( ContextId: usize, Message: ?*SecBufferDesc, MessageSeqNo: u32, pfQOP: ?*u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const KspGetTokenFn = fn( ContextId: usize, ImpersonationToken: ?*?HANDLE, RawToken: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const KspQueryAttributesFn = fn( ContextId: usize, Attribute: u32, Buffer: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const KspCompleteTokenFn = fn( ContextId: usize, Token: ?*SecBufferDesc, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const KspMapHandleFn = fn( ContextId: usize, LsaContextId: ?*usize, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const KspSetPagingModeFn = fn( PagingMode: BOOLEAN, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const KspSerializeAuthDataFn = fn( pvAuthData: ?*c_void, Size: ?*u32, SerializedData: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub const SECPKG_KERNEL_FUNCTION_TABLE = extern struct { Initialize: ?KspInitPackageFn, DeleteContext: ?KspDeleteContextFn, InitContext: ?KspInitContextFn, MapHandle: ?KspMapHandleFn, Sign: ?KspMakeSignatureFn, Verify: ?KspVerifySignatureFn, Seal: ?KspSealMessageFn, Unseal: ?KspUnsealMessageFn, GetToken: ?KspGetTokenFn, QueryAttributes: ?KspQueryAttributesFn, CompleteToken: ?KspCompleteTokenFn, ExportContext: ?SpExportSecurityContextFn, ImportContext: ?SpImportSecurityContextFn, SetPackagePagingMode: ?KspSetPagingModeFn, SerializeAuthData: ?KspSerializeAuthDataFn, }; pub const SecPkgCred_SupportedAlgs = extern struct { cSupportedAlgs: u32, palgSupportedAlgs: ?*u32, }; pub const SecPkgCred_CipherStrengths = extern struct { dwMinimumCipherStrength: u32, dwMaximumCipherStrength: u32, }; pub const SecPkgCred_SupportedProtocols = extern struct { grbitProtocol: u32, }; pub const SecPkgCred_ClientCertPolicy = extern struct { dwFlags: u32, guidPolicyId: Guid, dwCertFlags: u32, dwUrlRetrievalTimeout: u32, fCheckRevocationFreshnessTime: BOOL, dwRevocationFreshnessTime: u32, fOmitUsageCheck: BOOL, pwszSslCtlStoreName: ?PWSTR, pwszSslCtlIdentifier: ?PWSTR, }; pub const eTlsSignatureAlgorithm = enum(i32) { Anonymous = 0, Rsa = 1, Dsa = 2, Ecdsa = 3, }; pub const TlsSignatureAlgorithm_Anonymous = eTlsSignatureAlgorithm.Anonymous; pub const TlsSignatureAlgorithm_Rsa = eTlsSignatureAlgorithm.Rsa; pub const TlsSignatureAlgorithm_Dsa = eTlsSignatureAlgorithm.Dsa; pub const TlsSignatureAlgorithm_Ecdsa = eTlsSignatureAlgorithm.Ecdsa; pub const eTlsHashAlgorithm = enum(i32) { None = 0, Md5 = 1, Sha1 = 2, Sha224 = 3, Sha256 = 4, Sha384 = 5, Sha512 = 6, }; pub const TlsHashAlgorithm_None = eTlsHashAlgorithm.None; pub const TlsHashAlgorithm_Md5 = eTlsHashAlgorithm.Md5; pub const TlsHashAlgorithm_Sha1 = eTlsHashAlgorithm.Sha1; pub const TlsHashAlgorithm_Sha224 = eTlsHashAlgorithm.Sha224; pub const TlsHashAlgorithm_Sha256 = eTlsHashAlgorithm.Sha256; pub const TlsHashAlgorithm_Sha384 = eTlsHashAlgorithm.Sha384; pub const TlsHashAlgorithm_Sha512 = eTlsHashAlgorithm.Sha512; pub const SecPkgContext_RemoteCredentialInfo = extern struct { cbCertificateChain: u32, pbCertificateChain: ?*u8, cCertificates: u32, fFlags: u32, dwBits: u32, }; pub const SecPkgContext_LocalCredentialInfo = extern struct { cbCertificateChain: u32, pbCertificateChain: ?*u8, cCertificates: u32, fFlags: u32, dwBits: u32, }; pub const SecPkgContext_ClientCertPolicyResult = extern struct { dwPolicyResult: HRESULT, guidPolicyId: Guid, }; pub const SecPkgContext_IssuerListInfoEx = extern struct { aIssuers: ?*CRYPTOAPI_BLOB, cIssuers: u32, }; pub const SecPkgContext_ConnectionInfo = extern struct { dwProtocol: u32, aiCipher: u32, dwCipherStrength: u32, aiHash: u32, dwHashStrength: u32, aiExch: u32, dwExchStrength: u32, }; pub const SecPkgContext_ConnectionInfoEx = extern struct { dwVersion: u32, dwProtocol: u32, szCipher: [64]u16, dwCipherStrength: u32, szHash: [64]u16, dwHashStrength: u32, szExchange: [64]u16, dwExchStrength: u32, }; pub const SecPkgContext_CipherInfo = extern struct { dwVersion: u32, dwProtocol: u32, dwCipherSuite: u32, dwBaseCipherSuite: u32, szCipherSuite: [64]u16, szCipher: [64]u16, dwCipherLen: u32, dwCipherBlockLen: u32, szHash: [64]u16, dwHashLen: u32, szExchange: [64]u16, dwMinExchangeLen: u32, dwMaxExchangeLen: u32, szCertificate: [64]u16, dwKeyType: u32, }; pub const SecPkgContext_EapKeyBlock = extern struct { rgbKeys: [128]u8, rgbIVs: [64]u8, }; pub const SecPkgContext_MappedCredAttr = extern struct { dwAttribute: u32, pvBuffer: ?*c_void, }; pub const SecPkgContext_SessionInfo = extern struct { dwFlags: u32, cbSessionId: u32, rgbSessionId: [32]u8, }; pub const SecPkgContext_SessionAppData = extern struct { dwFlags: u32, cbAppData: u32, pbAppData: ?*u8, }; pub const SecPkgContext_EapPrfInfo = extern struct { dwVersion: u32, cbPrfData: u32, pbPrfData: ?*u8, }; pub const SecPkgContext_SupportedSignatures = extern struct { cSignatureAndHashAlgorithms: u16, pSignatureAndHashAlgorithms: ?*u16, }; pub const SecPkgContext_Certificates = extern struct { cCertificates: u32, cbCertificateChain: u32, pbCertificateChain: ?*u8, }; pub const SecPkgContext_CertInfo = extern struct { dwVersion: u32, cbSubjectName: u32, pwszSubjectName: ?PWSTR, cbIssuerName: u32, pwszIssuerName: ?PWSTR, dwKeySize: u32, }; pub const SecPkgContext_UiInfo = extern struct { hParentWindow: ?HWND, }; pub const SecPkgContext_EarlyStart = extern struct { dwEarlyStartFlags: u32, }; pub const SecPkgContext_KeyingMaterialInfo = extern struct { cbLabel: u16, pszLabel: ?PSTR, cbContextValue: u16, pbContextValue: ?*u8, cbKeyingMaterial: u32, }; pub const SecPkgContext_KeyingMaterial = extern struct { cbKeyingMaterial: u32, pbKeyingMaterial: ?*u8, }; pub const SecPkgContext_KeyingMaterial_Inproc = extern struct { cbLabel: u16, pszLabel: ?PSTR, cbContextValue: u16, pbContextValue: ?*u8, cbKeyingMaterial: u32, pbKeyingMaterial: ?*u8, }; pub const SecPkgContext_SrtpParameters = extern struct { ProtectionProfile: u16, MasterKeyIdentifierSize: u8, MasterKeyIdentifier: ?*u8, }; pub const SecPkgContext_TokenBinding = extern struct { MajorVersion: u8, MinorVersion: u8, KeyParametersSize: u16, KeyParameters: ?*u8, }; pub const SCHANNEL_CRED = extern struct { dwVersion: u32, cCreds: u32, paCred: ?*?*CERT_CONTEXT, hRootStore: ?*c_void, cMappers: u32, aphMappers: ?*?*_HMAPPER, cSupportedAlgs: u32, palgSupportedAlgs: ?*u32, grbitEnabledProtocols: u32, dwMinimumCipherStrength: u32, dwMaximumCipherStrength: u32, dwSessionLifespan: u32, dwFlags: SCHANNEL_CRED_FLAGS, dwCredFormat: u32, }; pub const SEND_GENERIC_TLS_EXTENSION = extern struct { ExtensionType: u16, HandshakeType: u16, Flags: u32, BufferSize: u16, Buffer: [1]u8, }; pub const TLS_EXTENSION_SUBSCRIPTION = extern struct { ExtensionType: u16, HandshakeType: u16, }; pub const SUBSCRIBE_GENERIC_TLS_EXTENSION = extern struct { Flags: u32, SubscriptionsCount: u32, Subscriptions: [1]TLS_EXTENSION_SUBSCRIPTION, }; pub const SCHANNEL_CERT_HASH = extern struct { dwLength: u32, dwFlags: u32, hProv: usize, ShaHash: [20]u8, }; pub const SCHANNEL_CERT_HASH_STORE = extern struct { dwLength: u32, dwFlags: u32, hProv: usize, ShaHash: [20]u8, pwszStoreName: [128]u16, }; pub const SCHANNEL_ALERT_TOKEN = extern struct { dwTokenType: u32, dwAlertType: SCHANNEL_ALERT_TOKEN_ALERT_TYPE, dwAlertNumber: u32, }; pub const SCHANNEL_SESSION_TOKEN = extern struct { dwTokenType: u32, dwFlags: SCHANNEL_SESSION_TOKEN_FLAGS, }; pub const SCHANNEL_CLIENT_SIGNATURE = extern struct { cbLength: u32, aiHash: u32, cbHash: u32, HashValue: [36]u8, CertThumbprint: [20]u8, }; pub const SSL_EMPTY_CACHE_FN_A = fn( pszTargetName: ?PSTR, dwFlags: u32, ) callconv(@import("std").os.windows.WINAPI) BOOL; pub const SSL_EMPTY_CACHE_FN_W = fn( pszTargetName: ?PWSTR, dwFlags: u32, ) callconv(@import("std").os.windows.WINAPI) BOOL; pub const SSL_CREDENTIAL_CERTIFICATE = extern struct { cbPrivateKey: u32, pPrivateKey: ?*u8, cbCertificate: u32, pCertificate: ?*u8, pszPassword: ?PSTR, }; pub const SCH_CRED = extern struct { dwVersion: u32, cCreds: u32, paSecret: ?*?*c_void, paPublic: ?*?*c_void, cMappers: u32, aphMappers: ?*?*_HMAPPER, }; pub const SCH_CRED_SECRET_CAPI = extern struct { dwType: u32, hProv: usize, }; pub const SCH_CRED_SECRET_PRIVKEY = extern struct { dwType: u32, pPrivateKey: ?*u8, cbPrivateKey: u32, pszPassword: ?PSTR, }; pub const SCH_CRED_PUBLIC_CERTCHAIN = extern struct { dwType: u32, cbCertChain: u32, pCertChain: ?*u8, }; pub const PctPublicKey = extern struct { Type: u32, cbKey: u32, pKey: [1]u8, }; pub const X509Certificate = extern struct { Version: u32, SerialNumber: [4]u32, SignatureAlgorithm: u32, ValidFrom: FILETIME, ValidUntil: FILETIME, pszIssuer: ?PSTR, pszSubject: ?PSTR, pPublicKey: ?*PctPublicKey, }; pub const SSL_CRACK_CERTIFICATE_FN = fn( pbCertificate: ?*u8, cbCertificate: u32, VerifySignature: BOOL, ppCertificate: ?*?*X509Certificate, ) callconv(@import("std").os.windows.WINAPI) BOOL; pub const SSL_FREE_CERTIFICATE_FN = fn( pCertificate: ?*X509Certificate, ) callconv(@import("std").os.windows.WINAPI) void; pub const SslGetServerIdentityFn = fn( // TODO: what to do with BytesParamIndex 1? ClientHello: ?*u8, ClientHelloSize: u32, ServerIdentity: ?*?*u8, ServerIdentitySize: ?*u32, Flags: u32, ) callconv(@import("std").os.windows.WINAPI) i32; pub const SCH_EXTENSION_DATA = extern struct { ExtensionType: u16, pExtData: ?*const u8, cbExtData: u32, }; pub const SchGetExtensionsOptions = enum(u32) { EXTENSIONS_OPTIONS_NONE = 0, NO_RECORD_HEADER = 1, _, pub fn initFlags(o: struct { EXTENSIONS_OPTIONS_NONE: u1 = 0, NO_RECORD_HEADER: u1 = 0, }) SchGetExtensionsOptions { return @intToEnum(SchGetExtensionsOptions, (if (o.EXTENSIONS_OPTIONS_NONE == 1) @enumToInt(SchGetExtensionsOptions.EXTENSIONS_OPTIONS_NONE) else 0) | (if (o.NO_RECORD_HEADER == 1) @enumToInt(SchGetExtensionsOptions.NO_RECORD_HEADER) else 0) ); } }; pub const SCH_EXTENSIONS_OPTIONS_NONE = SchGetExtensionsOptions.EXTENSIONS_OPTIONS_NONE; pub const SCH_NO_RECORD_HEADER = SchGetExtensionsOptions.NO_RECORD_HEADER; pub const SslGetExtensionsFn = fn( clientHello: [*:0]const u8, clientHelloByteSize: u32, genericExtensions: [*]SCH_EXTENSION_DATA, genericExtensionsCount: u8, bytesToRead: ?*u32, flags: SchGetExtensionsOptions, ) callconv(@import("std").os.windows.WINAPI) i32; pub const LOGON_HOURS = extern struct { UnitsPerWeek: u16, LogonHours: ?*u8, }; pub const SR_SECURITY_DESCRIPTOR = extern struct { Length: u32, SecurityDescriptor: ?*u8, }; pub const USER_ALL_INFORMATION = extern struct { // WARNING: unable to add field alignment because it's causing a compiler bug LastLogon: LARGE_INTEGER, LastLogoff: LARGE_INTEGER, PasswordLastSet: LARGE_INTEGER, AccountExpires: LARGE_INTEGER, PasswordCanChange: LARGE_INTEGER, PasswordMustChange: LARGE_INTEGER, UserName: UNICODE_STRING, FullName: UNICODE_STRING, HomeDirectory: UNICODE_STRING, HomeDirectoryDrive: UNICODE_STRING, ScriptPath: UNICODE_STRING, ProfilePath: UNICODE_STRING, AdminComment: UNICODE_STRING, WorkStations: UNICODE_STRING, UserComment: UNICODE_STRING, Parameters: UNICODE_STRING, LmPassword: UNICODE_STRING, NtPassword: UNICODE_STRING, PrivateData: UNICODE_STRING, SecurityDescriptor: SR_SECURITY_DESCRIPTOR, UserId: u32, PrimaryGroupId: u32, UserAccountControl: u32, WhichFields: u32, LogonHours: LOGON_HOURS, BadPasswordCount: u16, LogonCount: u16, CountryCode: u16, CodePage: u16, LmPasswordPresent: BOOLEAN, NtPasswordPresent: BOOLEAN, PasswordExpired: BOOLEAN, PrivateDataSensitive: BOOLEAN, }; pub const CLEAR_BLOCK = extern struct { data: [8]CHAR, }; pub const USER_SESSION_KEY = extern struct { data: [2]CYPHER_BLOCK, }; pub const NETLOGON_LOGON_INFO_CLASS = enum(i32) { InteractiveInformation = 1, NetworkInformation = 2, ServiceInformation = 3, GenericInformation = 4, InteractiveTransitiveInformation = 5, NetworkTransitiveInformation = 6, ServiceTransitiveInformation = 7, }; pub const NetlogonInteractiveInformation = NETLOGON_LOGON_INFO_CLASS.InteractiveInformation; pub const NetlogonNetworkInformation = NETLOGON_LOGON_INFO_CLASS.NetworkInformation; pub const NetlogonServiceInformation = NETLOGON_LOGON_INFO_CLASS.ServiceInformation; pub const NetlogonGenericInformation = NETLOGON_LOGON_INFO_CLASS.GenericInformation; pub const NetlogonInteractiveTransitiveInformation = NETLOGON_LOGON_INFO_CLASS.InteractiveTransitiveInformation; pub const NetlogonNetworkTransitiveInformation = NETLOGON_LOGON_INFO_CLASS.NetworkTransitiveInformation; pub const NetlogonServiceTransitiveInformation = NETLOGON_LOGON_INFO_CLASS.ServiceTransitiveInformation; pub const NETLOGON_LOGON_IDENTITY_INFO = extern struct { LogonDomainName: UNICODE_STRING, ParameterControl: u32, LogonId: LARGE_INTEGER, UserName: UNICODE_STRING, Workstation: UNICODE_STRING, }; pub const NETLOGON_INTERACTIVE_INFO = extern struct { Identity: NETLOGON_LOGON_IDENTITY_INFO, LmOwfPassword: <PASSWORD>, NtOwfPassword: <PASSWORD>, }; pub const NETLOGON_SERVICE_INFO = extern struct { Identity: NETLOGON_LOGON_IDENTITY_INFO, LmOwfPassword: <PASSWORD>, NtOwfPassword: <PASSWORD>, }; pub const NETLOGON_NETWORK_INFO = extern struct { Identity: NETLOGON_LOGON_IDENTITY_INFO, LmChallenge: CLEAR_BLOCK, NtChallengeResponse: STRING, LmChallengeResponse: STRING, }; pub const NETLOGON_GENERIC_INFO = extern struct { Identity: NETLOGON_LOGON_IDENTITY_INFO, PackageName: UNICODE_STRING, DataLength: u32, LogonData: ?*u8, }; pub const MSV1_0_VALIDATION_INFO = extern struct { LogoffTime: LARGE_INTEGER, KickoffTime: LARGE_INTEGER, LogonServer: UNICODE_STRING, LogonDomainName: UNICODE_STRING, SessionKey: USER_SESSION_KEY, Authoritative: BOOLEAN, UserFlags: u32, WhichFields: u32, UserId: u32, }; pub const TOKENBINDING_TYPE = enum(i32) { PROVIDED = 0, REFERRED = 1, }; pub const TOKENBINDING_TYPE_PROVIDED = TOKENBINDING_TYPE.PROVIDED; pub const TOKENBINDING_TYPE_REFERRED = TOKENBINDING_TYPE.REFERRED; pub const TOKENBINDING_EXTENSION_FORMAT = enum(i32) { D = 0, }; pub const TOKENBINDING_EXTENSION_FORMAT_UNDEFINED = TOKENBINDING_EXTENSION_FORMAT.D; pub const TOKENBINDING_KEY_PARAMETERS_TYPE = enum(i32) { RSA2048_PKCS = 0, RSA2048_PSS = 1, ECDSAP256 = 2, ANYEXISTING = 255, }; pub const TOKENBINDING_KEY_PARAMETERS_TYPE_RSA2048_PKCS = TOKENBINDING_KEY_PARAMETERS_TYPE.RSA2048_PKCS; pub const TOKENBINDING_KEY_PARAMETERS_TYPE_RSA2048_PSS = TOKENBINDING_KEY_PARAMETERS_TYPE.RSA2048_PSS; pub const TOKENBINDING_KEY_PARAMETERS_TYPE_ECDSAP256 = TOKENBINDING_KEY_PARAMETERS_TYPE.ECDSAP256; pub const TOKENBINDING_KEY_PARAMETERS_TYPE_ANYEXISTING = TOKENBINDING_KEY_PARAMETERS_TYPE.ANYEXISTING; pub const TOKENBINDING_IDENTIFIER = extern struct { keyType: u8, }; pub const TOKENBINDING_RESULT_DATA = extern struct { bindingType: TOKENBINDING_TYPE, identifierSize: u32, identifierData: ?*TOKENBINDING_IDENTIFIER, extensionFormat: TOKENBINDING_EXTENSION_FORMAT, extensionSize: u32, extensionData: ?*c_void, }; pub const TOKENBINDING_RESULT_LIST = extern struct { resultCount: u32, resultData: ?*TOKENBINDING_RESULT_DATA, }; pub const TOKENBINDING_KEY_TYPES = extern struct { keyCount: u32, keyType: ?*TOKENBINDING_KEY_PARAMETERS_TYPE, }; pub const EXTENDED_NAME_FORMAT = enum(i32) { Unknown = 0, FullyQualifiedDN = 1, SamCompatible = 2, Display = 3, UniqueId = 6, Canonical = 7, UserPrincipal = 8, CanonicalEx = 9, ServicePrincipal = 10, DnsDomain = 12, GivenName = 13, Surname = 14, }; pub const NameUnknown = EXTENDED_NAME_FORMAT.Unknown; pub const NameFullyQualifiedDN = EXTENDED_NAME_FORMAT.FullyQualifiedDN; pub const NameSamCompatible = EXTENDED_NAME_FORMAT.SamCompatible; pub const NameDisplay = EXTENDED_NAME_FORMAT.Display; pub const NameUniqueId = EXTENDED_NAME_FORMAT.UniqueId; pub const NameCanonical = EXTENDED_NAME_FORMAT.Canonical; pub const NameUserPrincipal = EXTENDED_NAME_FORMAT.UserPrincipal; pub const NameCanonicalEx = EXTENDED_NAME_FORMAT.CanonicalEx; pub const NameServicePrincipal = EXTENDED_NAME_FORMAT.ServicePrincipal; pub const NameDnsDomain = EXTENDED_NAME_FORMAT.DnsDomain; pub const NameGivenName = EXTENDED_NAME_FORMAT.GivenName; pub const NameSurname = EXTENDED_NAME_FORMAT.Surname; pub const SLDATATYPE = enum(u32) { NONE = 0, SZ = 1, DWORD = 4, BINARY = 3, MULTI_SZ = 7, SUM = 100, }; pub const SL_DATA_NONE = SLDATATYPE.NONE; pub const SL_DATA_SZ = SLDATATYPE.SZ; pub const SL_DATA_DWORD = SLDATATYPE.DWORD; pub const SL_DATA_BINARY = SLDATATYPE.BINARY; pub const SL_DATA_MULTI_SZ = SLDATATYPE.MULTI_SZ; pub const SL_DATA_SUM = SLDATATYPE.SUM; pub const SLIDTYPE = enum(i32) { APPLICATION = 0, PRODUCT_SKU = 1, LICENSE_FILE = 2, LICENSE = 3, PKEY = 4, ALL_LICENSES = 5, ALL_LICENSE_FILES = 6, STORE_TOKEN = 7, LAST = 8, }; pub const SL_ID_APPLICATION = SLIDTYPE.APPLICATION; pub const SL_ID_PRODUCT_SKU = SLIDTYPE.PRODUCT_SKU; pub const SL_ID_LICENSE_FILE = SLIDTYPE.LICENSE_FILE; pub const SL_ID_LICENSE = SLIDTYPE.LICENSE; pub const SL_ID_PKEY = SLIDTYPE.PKEY; pub const SL_ID_ALL_LICENSES = SLIDTYPE.ALL_LICENSES; pub const SL_ID_ALL_LICENSE_FILES = SLIDTYPE.ALL_LICENSE_FILES; pub const SL_ID_STORE_TOKEN = SLIDTYPE.STORE_TOKEN; pub const SL_ID_LAST = SLIDTYPE.LAST; pub const SLLICENSINGSTATUS = enum(i32) { UNLICENSED = 0, LICENSED = 1, IN_GRACE_PERIOD = 2, NOTIFICATION = 3, LAST = 4, }; pub const SL_LICENSING_STATUS_UNLICENSED = SLLICENSINGSTATUS.UNLICENSED; pub const SL_LICENSING_STATUS_LICENSED = SLLICENSINGSTATUS.LICENSED; pub const SL_LICENSING_STATUS_IN_GRACE_PERIOD = SLLICENSINGSTATUS.IN_GRACE_PERIOD; pub const SL_LICENSING_STATUS_NOTIFICATION = SLLICENSINGSTATUS.NOTIFICATION; pub const SL_LICENSING_STATUS_LAST = SLLICENSINGSTATUS.LAST; pub const SL_LICENSING_STATUS = extern struct { SkuId: Guid, eStatus: SLLICENSINGSTATUS, dwGraceTime: u32, dwTotalGraceDays: u32, hrReason: HRESULT, qwValidityExpiration: u64, }; pub const SL_ACTIVATION_TYPE = enum(i32) { DEFAULT = 0, ACTIVE_DIRECTORY = 1, }; pub const SL_ACTIVATION_TYPE_DEFAULT = SL_ACTIVATION_TYPE.DEFAULT; pub const SL_ACTIVATION_TYPE_ACTIVE_DIRECTORY = SL_ACTIVATION_TYPE.ACTIVE_DIRECTORY; pub const SL_ACTIVATION_INFO_HEADER = extern struct { cbSize: u32, type: SL_ACTIVATION_TYPE, }; pub const SL_AD_ACTIVATION_INFO = extern struct { header: SL_ACTIVATION_INFO_HEADER, pwszProductKey: ?[*:0]const u16, pwszActivationObjectName: ?[*:0]const u16, }; pub const SLREFERRALTYPE = enum(i32) { SKUID = 0, APPID = 1, OVERRIDE_SKUID = 2, OVERRIDE_APPID = 3, BEST_MATCH = 4, }; pub const SL_REFERRALTYPE_SKUID = SLREFERRALTYPE.SKUID; pub const SL_REFERRALTYPE_APPID = SLREFERRALTYPE.APPID; pub const SL_REFERRALTYPE_OVERRIDE_SKUID = SLREFERRALTYPE.OVERRIDE_SKUID; pub const SL_REFERRALTYPE_OVERRIDE_APPID = SLREFERRALTYPE.OVERRIDE_APPID; pub const SL_REFERRALTYPE_BEST_MATCH = SLREFERRALTYPE.BEST_MATCH; pub const SL_GENUINE_STATE = enum(i32) { IS_GENUINE = 0, INVALID_LICENSE = 1, TAMPERED = 2, OFFLINE = 3, LAST = 4, }; pub const SL_GEN_STATE_IS_GENUINE = SL_GENUINE_STATE.IS_GENUINE; pub const SL_GEN_STATE_INVALID_LICENSE = SL_GENUINE_STATE.INVALID_LICENSE; pub const SL_GEN_STATE_TAMPERED = SL_GENUINE_STATE.TAMPERED; pub const SL_GEN_STATE_OFFLINE = SL_GENUINE_STATE.OFFLINE; pub const SL_GEN_STATE_LAST = SL_GENUINE_STATE.LAST; pub const SL_NONGENUINE_UI_OPTIONS = extern struct { cbSize: u32, pComponentId: ?*const Guid, hResultUI: HRESULT, }; pub const SL_SYSTEM_POLICY_INFORMATION = extern struct { Reserved1: [2]?*c_void, Reserved2: [3]u32, }; //-------------------------------------------------------------------------------- // Section: Functions (211) //-------------------------------------------------------------------------------- // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn LsaRegisterLogonProcess( LogonProcessName: ?*STRING, LsaHandle: ?*LsaHandle, SecurityMode: ?*u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn LsaLogonUser( LsaHandle: ?HANDLE, OriginName: ?*STRING, LogonType: SECURITY_LOGON_TYPE, AuthenticationPackage: u32, // TODO: what to do with BytesParamIndex 5? AuthenticationInformation: ?*c_void, AuthenticationInformationLength: u32, LocalGroups: ?*TOKEN_GROUPS, SourceContext: ?*TOKEN_SOURCE, ProfileBuffer: ?*?*c_void, ProfileBufferLength: ?*u32, LogonId: ?*LUID, Token: ?*?HANDLE, Quotas: ?*QUOTA_LIMITS, SubStatus: ?*i32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn LsaLookupAuthenticationPackage( LsaHandle: ?HANDLE, PackageName: ?*STRING, AuthenticationPackage: ?*u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn LsaFreeReturnBuffer( Buffer: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn LsaCallAuthenticationPackage( LsaHandle: ?HANDLE, AuthenticationPackage: u32, // TODO: what to do with BytesParamIndex 3? ProtocolSubmitBuffer: ?*c_void, SubmitBufferLength: u32, ProtocolReturnBuffer: ?*?*c_void, ReturnBufferLength: ?*u32, ProtocolStatus: ?*i32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn LsaDeregisterLogonProcess( LsaHandle: LsaHandle, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn LsaConnectUntrusted( LsaHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaFreeMemory( Buffer: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaClose( ObjectHandle: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn LsaEnumerateLogonSessions( LogonSessionCount: ?*u32, LogonSessionList: ?*?*LUID, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn LsaGetLogonSessionData( LogonId: ?*LUID, ppLogonSessionData: ?*?*SECURITY_LOGON_SESSION_DATA, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaOpenPolicy( SystemName: ?*UNICODE_STRING, ObjectAttributes: ?*OBJECT_ATTRIBUTES, DesiredAccess: u32, PolicyHandle: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub extern "ADVAPI32" fn LsaSetCAPs( CAPDNs: ?[*]UNICODE_STRING, CAPDNCount: u32, Flags: u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows8.0' pub extern "ADVAPI32" fn LsaGetAppliedCAPIDs( SystemName: ?*UNICODE_STRING, CAPIDs: ?*?*?PSID, CAPIDCount: ?*u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows8.0' pub extern "ADVAPI32" fn LsaQueryCAPs( CAPIDs: ?[*]?PSID, CAPIDCount: u32, CAPs: ?*?*CENTRAL_ACCESS_POLICY, CAPCount: ?*u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaQueryInformationPolicy( PolicyHandle: ?*c_void, InformationClass: POLICY_INFORMATION_CLASS, Buffer: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaSetInformationPolicy( PolicyHandle: ?*c_void, InformationClass: POLICY_INFORMATION_CLASS, Buffer: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaQueryDomainInformationPolicy( PolicyHandle: ?*c_void, InformationClass: POLICY_DOMAIN_INFORMATION_CLASS, Buffer: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaSetDomainInformationPolicy( PolicyHandle: ?*c_void, InformationClass: POLICY_DOMAIN_INFORMATION_CLASS, Buffer: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn LsaRegisterPolicyChangeNotification( InformationClass: POLICY_NOTIFICATION_INFORMATION_CLASS, NotificationEventHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn LsaUnregisterPolicyChangeNotification( InformationClass: POLICY_NOTIFICATION_INFORMATION_CLASS, NotificationEventHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaEnumerateTrustedDomains( PolicyHandle: ?*c_void, EnumerationContext: ?*u32, Buffer: ?*?*c_void, PreferedMaximumLength: u32, CountReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaLookupNames( PolicyHandle: ?*c_void, Count: u32, Names: ?*UNICODE_STRING, ReferencedDomains: ?*?*LSA_REFERENCED_DOMAIN_LIST, Sids: ?*?*LSA_TRANSLATED_SID, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaLookupNames2( PolicyHandle: ?*c_void, Flags: u32, Count: u32, Names: ?*UNICODE_STRING, ReferencedDomains: ?*?*LSA_REFERENCED_DOMAIN_LIST, Sids: ?*?*LSA_TRANSLATED_SID2, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaLookupSids( PolicyHandle: ?*c_void, Count: u32, Sids: ?*?PSID, ReferencedDomains: ?*?*LSA_REFERENCED_DOMAIN_LIST, Names: ?*?*LSA_TRANSLATED_NAME, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows8.0' pub extern "ADVAPI32" fn LsaLookupSids2( PolicyHandle: ?*c_void, LookupOptions: u32, Count: u32, Sids: ?*?PSID, ReferencedDomains: ?*?*LSA_REFERENCED_DOMAIN_LIST, Names: ?*?*LSA_TRANSLATED_NAME, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaEnumerateAccountsWithUserRight( PolicyHandle: ?*c_void, UserRight: ?*UNICODE_STRING, Buffer: ?*?*c_void, CountReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaEnumerateAccountRights( PolicyHandle: ?*c_void, AccountSid: ?PSID, UserRights: ?*?*UNICODE_STRING, CountOfRights: ?*u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaAddAccountRights( PolicyHandle: ?*c_void, AccountSid: ?PSID, UserRights: [*]UNICODE_STRING, CountOfRights: u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaRemoveAccountRights( PolicyHandle: ?*c_void, AccountSid: ?PSID, AllRights: BOOLEAN, UserRights: ?[*]UNICODE_STRING, CountOfRights: u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaOpenTrustedDomainByName( PolicyHandle: ?*c_void, TrustedDomainName: ?*UNICODE_STRING, DesiredAccess: u32, TrustedDomainHandle: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaQueryTrustedDomainInfo( PolicyHandle: ?*c_void, TrustedDomainSid: ?PSID, InformationClass: TRUSTED_INFORMATION_CLASS, Buffer: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaSetTrustedDomainInformation( PolicyHandle: ?*c_void, TrustedDomainSid: ?PSID, InformationClass: TRUSTED_INFORMATION_CLASS, Buffer: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaDeleteTrustedDomain( PolicyHandle: ?*c_void, TrustedDomainSid: ?PSID, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaQueryTrustedDomainInfoByName( PolicyHandle: ?*c_void, TrustedDomainName: ?*UNICODE_STRING, InformationClass: TRUSTED_INFORMATION_CLASS, Buffer: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaSetTrustedDomainInfoByName( PolicyHandle: ?*c_void, TrustedDomainName: ?*UNICODE_STRING, InformationClass: TRUSTED_INFORMATION_CLASS, Buffer: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaEnumerateTrustedDomainsEx( PolicyHandle: ?*c_void, EnumerationContext: ?*u32, Buffer: ?*?*c_void, PreferedMaximumLength: u32, CountReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaCreateTrustedDomainEx( PolicyHandle: ?*c_void, TrustedDomainInformation: ?*TRUSTED_DOMAIN_INFORMATION_EX, AuthenticationInformation: ?*TRUSTED_DOMAIN_AUTH_INFORMATION, DesiredAccess: u32, TrustedDomainHandle: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windowsServer2003' pub extern "ADVAPI32" fn LsaQueryForestTrustInformation( PolicyHandle: ?*c_void, TrustedDomainName: ?*UNICODE_STRING, ForestTrustInfo: ?*?*LSA_FOREST_TRUST_INFORMATION, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windowsServer2003' pub extern "ADVAPI32" fn LsaSetForestTrustInformation( PolicyHandle: ?*c_void, TrustedDomainName: ?*UNICODE_STRING, ForestTrustInfo: ?*LSA_FOREST_TRUST_INFORMATION, CheckOnly: BOOLEAN, CollisionInfo: ?*?*LSA_FOREST_TRUST_COLLISION_INFORMATION, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaStorePrivateData( PolicyHandle: ?*c_void, KeyName: ?*UNICODE_STRING, PrivateData: ?*UNICODE_STRING, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaRetrievePrivateData( PolicyHandle: ?*c_void, KeyName: ?*UNICODE_STRING, PrivateData: ?*?*UNICODE_STRING, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "ADVAPI32" fn LsaNtStatusToWinError( Status: NTSTATUS, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "ADVAPI32" fn SystemFunction036( // TODO: what to do with BytesParamIndex 1? RandomBuffer: ?*c_void, RandomBufferLength: u32, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; pub extern "ADVAPI32" fn SystemFunction040( // TODO: what to do with BytesParamIndex 1? Memory: ?*c_void, MemorySize: u32, OptionFlags: u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub extern "ADVAPI32" fn SystemFunction041( // TODO: what to do with BytesParamIndex 1? Memory: ?*c_void, MemorySize: u32, OptionFlags: u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "ADVAPI32" fn AuditSetSystemPolicy( pAuditPolicy: [*]AUDIT_POLICY_INFORMATION, dwPolicyCount: u32, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "ADVAPI32" fn AuditSetPerUserPolicy( pSid: ?PSID, pAuditPolicy: [*]AUDIT_POLICY_INFORMATION, dwPolicyCount: u32, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "ADVAPI32" fn AuditQuerySystemPolicy( pSubCategoryGuids: [*]const Guid, dwPolicyCount: u32, ppAuditPolicy: ?*?*AUDIT_POLICY_INFORMATION, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "ADVAPI32" fn AuditQueryPerUserPolicy( pSid: ?PSID, pSubCategoryGuids: [*]const Guid, dwPolicyCount: u32, ppAuditPolicy: ?*?*AUDIT_POLICY_INFORMATION, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "ADVAPI32" fn AuditEnumeratePerUserPolicy( ppAuditSidArray: ?*?*POLICY_AUDIT_SID_ARRAY, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "ADVAPI32" fn AuditComputeEffectivePolicyBySid( pSid: ?PSID, pSubCategoryGuids: [*]const Guid, dwPolicyCount: u32, ppAuditPolicy: ?*?*AUDIT_POLICY_INFORMATION, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "ADVAPI32" fn AuditComputeEffectivePolicyByToken( hTokenHandle: ?HANDLE, pSubCategoryGuids: [*]const Guid, dwPolicyCount: u32, ppAuditPolicy: ?*?*AUDIT_POLICY_INFORMATION, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "ADVAPI32" fn AuditEnumerateCategories( ppAuditCategoriesArray: ?*?*Guid, pdwCountReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "ADVAPI32" fn AuditEnumerateSubCategories( pAuditCategoryGuid: ?*const Guid, bRetrieveAllSubCategories: BOOLEAN, ppAuditSubCategoriesArray: ?*?*Guid, pdwCountReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "ADVAPI32" fn AuditLookupCategoryNameW( pAuditCategoryGuid: ?*const Guid, ppszCategoryName: ?*?PWSTR, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "ADVAPI32" fn AuditLookupCategoryNameA( pAuditCategoryGuid: ?*const Guid, ppszCategoryName: ?*?PSTR, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "ADVAPI32" fn AuditLookupSubCategoryNameW( pAuditSubCategoryGuid: ?*const Guid, ppszSubCategoryName: ?*?PWSTR, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "ADVAPI32" fn AuditLookupSubCategoryNameA( pAuditSubCategoryGuid: ?*const Guid, ppszSubCategoryName: ?*?PSTR, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "ADVAPI32" fn AuditLookupCategoryIdFromCategoryGuid( pAuditCategoryGuid: ?*const Guid, pAuditCategoryId: ?*POLICY_AUDIT_EVENT_TYPE, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "ADVAPI32" fn AuditLookupCategoryGuidFromCategoryId( AuditCategoryId: POLICY_AUDIT_EVENT_TYPE, pAuditCategoryGuid: ?*Guid, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "ADVAPI32" fn AuditSetSecurity( SecurityInformation: u32, pSecurityDescriptor: ?*SECURITY_DESCRIPTOR, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "ADVAPI32" fn AuditQuerySecurity( SecurityInformation: u32, ppSecurityDescriptor: ?*?*SECURITY_DESCRIPTOR, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows6.1' pub extern "ADVAPI32" fn AuditSetGlobalSaclW( ObjectTypeName: ?[*:0]const u16, Acl: ?*ACL, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows6.1' pub extern "ADVAPI32" fn AuditSetGlobalSaclA( ObjectTypeName: ?[*:0]const u8, Acl: ?*ACL, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows6.1' pub extern "ADVAPI32" fn AuditQueryGlobalSaclW( ObjectTypeName: ?[*:0]const u16, Acl: ?*?*ACL, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows6.1' pub extern "ADVAPI32" fn AuditQueryGlobalSaclA( ObjectTypeName: ?[*:0]const u8, Acl: ?*?*ACL, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "ADVAPI32" fn AuditFree( Buffer: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) void; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "SECUR32" fn AcquireCredentialsHandleW( pszPrincipal: ?PWSTR, pszPackage: ?PWSTR, fCredentialUse: SECPKG_CRED, pvLogonId: ?*c_void, pAuthData: ?*c_void, pGetKeyFn: ?SEC_GET_KEY_FN, pvGetKeyArgument: ?*c_void, phCredential: ?*SecHandle, ptsExpiry: ?*LARGE_INTEGER, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "SECUR32" fn AcquireCredentialsHandleA( pszPrincipal: ?PSTR, pszPackage: ?PSTR, fCredentialUse: SECPKG_CRED, pvLogonId: ?*c_void, pAuthData: ?*c_void, pGetKeyFn: ?SEC_GET_KEY_FN, pvGetKeyArgument: ?*c_void, phCredential: ?*SecHandle, ptsExpiry: ?*LARGE_INTEGER, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn FreeCredentialsHandle( phCredential: ?*SecHandle, ) callconv(@import("std").os.windows.WINAPI) i32; pub extern "SECUR32" fn AddCredentialsW( hCredentials: ?*SecHandle, pszPrincipal: ?PWSTR, pszPackage: ?PWSTR, fCredentialUse: u32, pAuthData: ?*c_void, pGetKeyFn: ?SEC_GET_KEY_FN, pvGetKeyArgument: ?*c_void, ptsExpiry: ?*LARGE_INTEGER, ) callconv(@import("std").os.windows.WINAPI) i32; pub extern "SECUR32" fn AddCredentialsA( hCredentials: ?*SecHandle, pszPrincipal: ?PSTR, pszPackage: ?PSTR, fCredentialUse: u32, pAuthData: ?*c_void, pGetKeyFn: ?SEC_GET_KEY_FN, pvGetKeyArgument: ?*c_void, ptsExpiry: ?*LARGE_INTEGER, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "SECUR32" fn ChangeAccountPasswordW( pszPackageName: ?*u16, pszDomainName: ?*u16, pszAccountName: ?*u16, pszOldPassword: ?*u16, pszNewPassword: ?*u16, bImpersonating: BOOLEAN, dwReserved: u32, pOutput: ?*SecBufferDesc, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "SECUR32" fn ChangeAccountPasswordA( pszPackageName: ?*i8, pszDomainName: ?*i8, pszAccountName: ?*i8, pszOldPassword: ?*i8, pszNewPassword: ?*i8, bImpersonating: BOOLEAN, dwReserved: u32, pOutput: ?*SecBufferDesc, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn InitializeSecurityContextW( phCredential: ?*SecHandle, phContext: ?*SecHandle, pszTargetName: ?*u16, fContextReq: u32, Reserved1: u32, TargetDataRep: u32, pInput: ?*SecBufferDesc, Reserved2: u32, phNewContext: ?*SecHandle, pOutput: ?*SecBufferDesc, pfContextAttr: ?*u32, ptsExpiry: ?*LARGE_INTEGER, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn InitializeSecurityContextA( phCredential: ?*SecHandle, phContext: ?*SecHandle, pszTargetName: ?*i8, fContextReq: u32, Reserved1: u32, TargetDataRep: u32, pInput: ?*SecBufferDesc, Reserved2: u32, phNewContext: ?*SecHandle, pOutput: ?*SecBufferDesc, pfContextAttr: ?*u32, ptsExpiry: ?*LARGE_INTEGER, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "SECUR32" fn AcceptSecurityContext( phCredential: ?*SecHandle, phContext: ?*SecHandle, pInput: ?*SecBufferDesc, fContextReq: ACCEPT_SECURITY_CONTEXT_CONTEXT_REQ, TargetDataRep: u32, phNewContext: ?*SecHandle, pOutput: ?*SecBufferDesc, pfContextAttr: ?*u32, ptsExpiry: ?*LARGE_INTEGER, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn CompleteAuthToken( phContext: ?*SecHandle, pToken: ?*SecBufferDesc, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn ImpersonateSecurityContext( phContext: ?*SecHandle, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn RevertSecurityContext( phContext: ?*SecHandle, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn QuerySecurityContextToken( phContext: ?*SecHandle, Token: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn DeleteSecurityContext( phContext: ?*SecHandle, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn ApplyControlToken( phContext: ?*SecHandle, pInput: ?*SecBufferDesc, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "SECUR32" fn QueryContextAttributesW( phContext: ?*SecHandle, ulAttribute: SECPKG_ATTR, pBuffer: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SspiCli" fn QueryContextAttributesExW( phContext: ?*SecHandle, ulAttribute: SECPKG_ATTR, // TODO: what to do with BytesParamIndex 3? pBuffer: ?*c_void, cbBuffer: u32, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "SECUR32" fn QueryContextAttributesA( phContext: ?*SecHandle, ulAttribute: SECPKG_ATTR, pBuffer: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SspiCli" fn QueryContextAttributesExA( phContext: ?*SecHandle, ulAttribute: SECPKG_ATTR, // TODO: what to do with BytesParamIndex 3? pBuffer: ?*c_void, cbBuffer: u32, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn SetContextAttributesW( phContext: ?*SecHandle, ulAttribute: SECPKG_ATTR, // TODO: what to do with BytesParamIndex 3? pBuffer: ?*c_void, cbBuffer: u32, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn SetContextAttributesA( phContext: ?*SecHandle, ulAttribute: SECPKG_ATTR, // TODO: what to do with BytesParamIndex 3? pBuffer: ?*c_void, cbBuffer: u32, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn QueryCredentialsAttributesW( phCredential: ?*SecHandle, ulAttribute: u32, pBuffer: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) i32; pub extern "SspiCli" fn QueryCredentialsAttributesExW( phCredential: ?*SecHandle, ulAttribute: u32, // TODO: what to do with BytesParamIndex 3? pBuffer: ?*c_void, cbBuffer: u32, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn QueryCredentialsAttributesA( phCredential: ?*SecHandle, ulAttribute: u32, pBuffer: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) i32; pub extern "SspiCli" fn QueryCredentialsAttributesExA( phCredential: ?*SecHandle, ulAttribute: u32, // TODO: what to do with BytesParamIndex 3? pBuffer: ?*c_void, cbBuffer: u32, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn SetCredentialsAttributesW( phCredential: ?*SecHandle, ulAttribute: u32, // TODO: what to do with BytesParamIndex 3? pBuffer: ?*c_void, cbBuffer: u32, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn SetCredentialsAttributesA( phCredential: ?*SecHandle, ulAttribute: u32, // TODO: what to do with BytesParamIndex 3? pBuffer: ?*c_void, cbBuffer: u32, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn FreeContextBuffer( pvContextBuffer: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn MakeSignature( phContext: ?*SecHandle, fQOP: u32, pMessage: ?*SecBufferDesc, MessageSeqNo: u32, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn VerifySignature( phContext: ?*SecHandle, pMessage: ?*SecBufferDesc, MessageSeqNo: u32, pfQOP: ?*u32, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn EncryptMessage( phContext: ?*SecHandle, fQOP: u32, pMessage: ?*SecBufferDesc, MessageSeqNo: u32, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn DecryptMessage( phContext: ?*SecHandle, pMessage: ?*SecBufferDesc, MessageSeqNo: u32, pfQOP: ?*u32, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn EnumerateSecurityPackagesW( pcPackages: ?*u32, ppPackageInfo: ?*?*SecPkgInfoW, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn EnumerateSecurityPackagesA( pcPackages: ?*u32, ppPackageInfo: ?*?*SecPkgInfoA, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn QuerySecurityPackageInfoW( pszPackageName: ?PWSTR, ppPackageInfo: ?*?*SecPkgInfoW, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn QuerySecurityPackageInfoA( pszPackageName: ?PSTR, ppPackageInfo: ?*?*SecPkgInfoA, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn ExportSecurityContext( phContext: ?*SecHandle, fFlags: EXPORT_SECURITY_CONTEXT_FLAGS, pPackedContext: ?*SecBuffer, pToken: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn ImportSecurityContextW( pszPackage: ?PWSTR, pPackedContext: ?*SecBuffer, Token: ?*c_void, phContext: ?*SecHandle, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn ImportSecurityContextA( pszPackage: ?PSTR, pPackedContext: ?*SecBuffer, Token: ?*c_void, phContext: ?*SecHandle, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn InitSecurityInterfaceA( ) callconv(@import("std").os.windows.WINAPI) ?*SecurityFunctionTableA; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SECUR32" fn InitSecurityInterfaceW( ) callconv(@import("std").os.windows.WINAPI) ?*SecurityFunctionTableW; // TODO: this type is limited to platform 'windowsServer2003' pub extern "SECUR32" fn SaslEnumerateProfilesA( ProfileList: ?*?PSTR, ProfileCount: ?*u32, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windowsServer2003' pub extern "SECUR32" fn SaslEnumerateProfilesW( ProfileList: ?*?PWSTR, ProfileCount: ?*u32, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windowsServer2003' pub extern "SECUR32" fn SaslGetProfilePackageA( ProfileName: ?PSTR, PackageInfo: ?*?*SecPkgInfoA, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windowsServer2003' pub extern "SECUR32" fn SaslGetProfilePackageW( ProfileName: ?PWSTR, PackageInfo: ?*?*SecPkgInfoW, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windowsServer2003' pub extern "SECUR32" fn SaslIdentifyPackageA( pInput: ?*SecBufferDesc, PackageInfo: ?*?*SecPkgInfoA, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windowsServer2003' pub extern "SECUR32" fn SaslIdentifyPackageW( pInput: ?*SecBufferDesc, PackageInfo: ?*?*SecPkgInfoW, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windowsServer2003' pub extern "SECUR32" fn SaslInitializeSecurityContextW( phCredential: ?*SecHandle, phContext: ?*SecHandle, pszTargetName: ?PWSTR, fContextReq: u32, Reserved1: u32, TargetDataRep: u32, pInput: ?*SecBufferDesc, Reserved2: u32, phNewContext: ?*SecHandle, pOutput: ?*SecBufferDesc, pfContextAttr: ?*u32, ptsExpiry: ?*LARGE_INTEGER, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windowsServer2003' pub extern "SECUR32" fn SaslInitializeSecurityContextA( phCredential: ?*SecHandle, phContext: ?*SecHandle, pszTargetName: ?PSTR, fContextReq: u32, Reserved1: u32, TargetDataRep: u32, pInput: ?*SecBufferDesc, Reserved2: u32, phNewContext: ?*SecHandle, pOutput: ?*SecBufferDesc, pfContextAttr: ?*u32, ptsExpiry: ?*LARGE_INTEGER, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windowsServer2003' pub extern "SECUR32" fn SaslAcceptSecurityContext( phCredential: ?*SecHandle, phContext: ?*SecHandle, pInput: ?*SecBufferDesc, fContextReq: u32, TargetDataRep: u32, phNewContext: ?*SecHandle, pOutput: ?*SecBufferDesc, pfContextAttr: ?*u32, ptsExpiry: ?*LARGE_INTEGER, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windowsServer2003' pub extern "SECUR32" fn SaslSetContextOption( ContextHandle: ?*SecHandle, Option: u32, Value: ?*c_void, Size: u32, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windowsServer2003' pub extern "SECUR32" fn SaslGetContextOption( ContextHandle: ?*SecHandle, Option: u32, Value: ?*c_void, Size: u32, Needed: ?*u32, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows6.1' pub extern "credui" fn SspiPromptForCredentialsW( pszTargetName: ?[*:0]const u16, pUiInfo: ?*c_void, dwAuthError: u32, pszPackage: ?[*:0]const u16, pInputAuthIdentity: ?*c_void, ppAuthIdentity: ?*?*c_void, pfSave: ?*i32, dwFlags: u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "credui" fn SspiPromptForCredentialsA( pszTargetName: ?[*:0]const u8, pUiInfo: ?*c_void, dwAuthError: u32, pszPackage: ?[*:0]const u8, pInputAuthIdentity: ?*c_void, ppAuthIdentity: ?*?*c_void, pfSave: ?*i32, dwFlags: u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "SECUR32" fn SspiPrepareForCredRead( AuthIdentity: ?*c_void, pszTargetName: ?[*:0]const u16, pCredmanCredentialType: ?*u32, ppszCredmanTargetName: ?*?PWSTR, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows6.1' pub extern "SECUR32" fn SspiPrepareForCredWrite( AuthIdentity: ?*c_void, pszTargetName: ?[*:0]const u16, pCredmanCredentialType: ?*u32, ppszCredmanTargetName: ?*?PWSTR, ppszCredmanUserName: ?*?PWSTR, ppCredentialBlob: ?*?*u8, pCredentialBlobSize: ?*u32, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows6.1' pub extern "SECUR32" fn SspiEncryptAuthIdentity( AuthData: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows8.0' pub extern "SspiCli" fn SspiEncryptAuthIdentityEx( Options: u32, AuthData: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows6.1' pub extern "SECUR32" fn SspiDecryptAuthIdentity( EncryptedAuthData: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows8.0' pub extern "SspiCli" fn SspiDecryptAuthIdentityEx( Options: u32, EncryptedAuthData: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows6.1' pub extern "SECUR32" fn SspiIsAuthIdentityEncrypted( EncryptedAuthData: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows6.1' pub extern "SECUR32" fn SspiEncodeAuthIdentityAsStrings( pAuthIdentity: ?*c_void, ppszUserName: ?*?PWSTR, ppszDomainName: ?*?PWSTR, ppszPackedCredentialsString: ?*?PWSTR, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows6.1' pub extern "SECUR32" fn SspiValidateAuthIdentity( AuthData: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows6.1' pub extern "SECUR32" fn SspiCopyAuthIdentity( AuthData: ?*c_void, AuthDataCopy: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows6.1' pub extern "SECUR32" fn SspiFreeAuthIdentity( AuthData: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) void; // TODO: this type is limited to platform 'windows6.1' pub extern "SECUR32" fn SspiZeroAuthIdentity( AuthData: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) void; // TODO: this type is limited to platform 'windows6.1' pub extern "SECUR32" fn SspiLocalFree( DataBuffer: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) void; // TODO: this type is limited to platform 'windows6.1' pub extern "SECUR32" fn SspiEncodeStringsAsAuthIdentity( pszUserName: ?[*:0]const u16, pszDomainName: ?[*:0]const u16, pszPackedCredentialsString: ?[*:0]const u16, ppAuthIdentity: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows6.1' pub extern "SECUR32" fn SspiCompareAuthIdentities( AuthIdentity1: ?*c_void, AuthIdentity2: ?*c_void, SameSuppliedUser: ?*BOOLEAN, SameSuppliedIdentity: ?*BOOLEAN, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows6.1' pub extern "SECUR32" fn SspiMarshalAuthIdentity( AuthIdentity: ?*c_void, AuthIdentityLength: ?*u32, AuthIdentityByteArray: ?*?*i8, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows6.1' pub extern "SECUR32" fn SspiUnmarshalAuthIdentity( AuthIdentityLength: u32, // TODO: what to do with BytesParamIndex 0? AuthIdentityByteArray: ?PSTR, ppAuthIdentity: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows6.1' pub extern "credui" fn SspiIsPromptingNeeded( ErrorOrNtStatus: u32, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows6.1' pub extern "SECUR32" fn SspiGetTargetHostName( pszTargetName: ?[*:0]const u16, pszHostName: ?*?PWSTR, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows6.1' pub extern "SECUR32" fn SspiExcludePackage( AuthIdentity: ?*c_void, pszPackageName: ?[*:0]const u16, ppNewAuthIdentity: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows6.1' pub extern "SECUR32" fn AddSecurityPackageA( pszPackageName: ?PSTR, pOptions: ?*SECURITY_PACKAGE_OPTIONS, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows6.1' pub extern "SECUR32" fn AddSecurityPackageW( pszPackageName: ?PWSTR, pOptions: ?*SECURITY_PACKAGE_OPTIONS, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows6.1' pub extern "SECUR32" fn DeleteSecurityPackageA( pszPackageName: ?PSTR, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows6.1' pub extern "SECUR32" fn DeleteSecurityPackageW( pszPackageName: ?PWSTR, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "SECUR32" fn CredMarshalTargetInfo( InTargetInfo: ?*CREDENTIAL_TARGET_INFORMATIONW, Buffer: ?*?*u16, BufferSize: ?*u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; pub extern "SECUR32" fn CredUnmarshalTargetInfo( // TODO: what to do with BytesParamIndex 1? Buffer: ?*u16, BufferSize: u32, RetTargetInfo: ?*?*CREDENTIAL_TARGET_INFORMATIONW, RetActualSize: ?*u32, ) callconv(@import("std").os.windows.WINAPI) NTSTATUS; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SCHANNEL" fn SslEmptyCacheA( pszTargetName: ?PSTR, dwFlags: u32, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SCHANNEL" fn SslEmptyCacheW( pszTargetName: ?PWSTR, dwFlags: u32, ) callconv(@import("std").os.windows.WINAPI) BOOL; pub extern "SCHANNEL" fn SslGenerateRandomBits( pRandomData: ?*u8, cRandomData: i32, ) callconv(@import("std").os.windows.WINAPI) void; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SCHANNEL" fn SslCrackCertificate( pbCertificate: ?*u8, cbCertificate: u32, dwFlags: u32, ppCertificate: ?*?*X509Certificate, ) callconv(@import("std").os.windows.WINAPI) BOOL; // TODO: this type is limited to platform 'windows5.1.2600' pub extern "SCHANNEL" fn SslFreeCertificate( pCertificate: ?*X509Certificate, ) callconv(@import("std").os.windows.WINAPI) void; pub extern "SCHANNEL" fn SslGetMaximumKeySize( Reserved: u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "SCHANNEL" fn SslGetServerIdentity( // TODO: what to do with BytesParamIndex 1? ClientHello: ?*u8, ClientHelloSize: u32, ServerIdentity: ?*?*u8, ServerIdentitySize: ?*u32, Flags: u32, ) callconv(@import("std").os.windows.WINAPI) i32; pub extern "SCHANNEL" fn SslGetExtensions( clientHello: [*:0]const u8, clientHelloByteSize: u32, genericExtensions: [*]SCH_EXTENSION_DATA, genericExtensionsCount: u8, bytesToRead: ?*u32, flags: SchGetExtensionsOptions, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows10.0.10240' pub extern "TOKENBINDING" fn TokenBindingGenerateBinding( keyType: TOKENBINDING_KEY_PARAMETERS_TYPE, targetURL: ?[*:0]const u16, bindingType: TOKENBINDING_TYPE, // TODO: what to do with BytesParamIndex 4? tlsEKM: ?*const c_void, tlsEKMSize: u32, extensionFormat: TOKENBINDING_EXTENSION_FORMAT, extensionData: ?*const c_void, tokenBinding: ?*?*c_void, tokenBindingSize: ?*u32, resultData: ?*?*TOKENBINDING_RESULT_DATA, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows10.0.10240' pub extern "TOKENBINDING" fn TokenBindingGenerateMessage( tokenBindings: [*]const ?*const c_void, tokenBindingsSize: [*]const u32, tokenBindingsCount: u32, tokenBindingMessage: ?*?*c_void, tokenBindingMessageSize: ?*u32, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows10.0.10240' pub extern "TOKENBINDING" fn TokenBindingVerifyMessage( // TODO: what to do with BytesParamIndex 1? tokenBindingMessage: ?*const c_void, tokenBindingMessageSize: u32, keyType: TOKENBINDING_KEY_PARAMETERS_TYPE, // TODO: what to do with BytesParamIndex 4? tlsEKM: ?*const c_void, tlsEKMSize: u32, resultList: ?*?*TOKENBINDING_RESULT_LIST, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows10.0.10240' pub extern "TOKENBINDING" fn TokenBindingGetKeyTypesClient( keyTypes: ?*?*TOKENBINDING_KEY_TYPES, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows10.0.10240' pub extern "TOKENBINDING" fn TokenBindingGetKeyTypesServer( keyTypes: ?*?*TOKENBINDING_KEY_TYPES, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows10.0.10240' pub extern "TOKENBINDING" fn TokenBindingDeleteBinding( targetURL: ?[*:0]const u16, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows10.0.10240' pub extern "TOKENBINDING" fn TokenBindingDeleteAllBindings( ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows10.0.10240' pub extern "TOKENBINDING" fn TokenBindingGenerateID( keyType: TOKENBINDING_KEY_PARAMETERS_TYPE, // TODO: what to do with BytesParamIndex 2? publicKey: ?*const c_void, publicKeySize: u32, resultData: ?*?*TOKENBINDING_RESULT_DATA, ) callconv(@import("std").os.windows.WINAPI) i32; pub extern "TOKENBINDING" fn TokenBindingGenerateIDForUri( keyType: TOKENBINDING_KEY_PARAMETERS_TYPE, targetUri: ?[*:0]const u16, resultData: ?*?*TOKENBINDING_RESULT_DATA, ) callconv(@import("std").os.windows.WINAPI) i32; pub extern "TOKENBINDING" fn TokenBindingGetHighestSupportedVersion( majorVersion: ?*u8, minorVersion: ?*u8, ) callconv(@import("std").os.windows.WINAPI) i32; // TODO: this type is limited to platform 'windows5.0' pub extern "SECUR32" fn GetUserNameExA( NameFormat: EXTENDED_NAME_FORMAT, lpNameBuffer: ?[*:0]u8, nSize: ?*u32, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows5.0' pub extern "SECUR32" fn GetUserNameExW( NameFormat: EXTENDED_NAME_FORMAT, lpNameBuffer: ?[*:0]u16, nSize: ?*u32, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows5.0' pub extern "SECUR32" fn GetComputerObjectNameA( NameFormat: EXTENDED_NAME_FORMAT, lpNameBuffer: ?[*:0]u8, nSize: ?*u32, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows5.0' pub extern "SECUR32" fn GetComputerObjectNameW( NameFormat: EXTENDED_NAME_FORMAT, lpNameBuffer: ?[*:0]u16, nSize: ?*u32, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows5.0' pub extern "SECUR32" fn TranslateNameA( lpAccountName: ?[*:0]const u8, AccountNameFormat: EXTENDED_NAME_FORMAT, DesiredNameFormat: EXTENDED_NAME_FORMAT, lpTranslatedName: ?[*:0]u8, nSize: ?*u32, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows5.0' pub extern "SECUR32" fn TranslateNameW( lpAccountName: ?[*:0]const u16, AccountNameFormat: EXTENDED_NAME_FORMAT, DesiredNameFormat: EXTENDED_NAME_FORMAT, lpTranslatedName: ?[*:0]u16, nSize: ?*u32, ) callconv(@import("std").os.windows.WINAPI) BOOLEAN; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLOpen( phSLC: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLClose( hSLC: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLInstallProofOfPurchase( hSLC: ?*c_void, pwszPKeyAlgorithm: ?[*:0]const u16, pwszPKeyString: ?[*:0]const u16, cbPKeySpecificData: u32, // TODO: what to do with BytesParamIndex 3? pbPKeySpecificData: ?*u8, pPkeyId: ?*Guid, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLUninstallProofOfPurchase( hSLC: ?*c_void, pPKeyId: ?*const Guid, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLInstallLicense( hSLC: ?*c_void, cbLicenseBlob: u32, // TODO: what to do with BytesParamIndex 1? pbLicenseBlob: ?*const u8, pLicenseFileId: ?*Guid, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLUninstallLicense( hSLC: ?*c_void, pLicenseFileId: ?*const Guid, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLConsumeRight( hSLC: ?*c_void, pAppId: ?*const Guid, pProductSkuId: ?*const Guid, pwszRightName: ?[*:0]const u16, pvReserved: ?*c_void, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLGetProductSkuInformation( hSLC: ?*c_void, pProductSkuId: ?*const Guid, pwszValueName: ?[*:0]const u16, peDataType: ?*SLDATATYPE, pcbValue: ?*u32, ppbValue: ?*?*u8, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLGetPKeyInformation( hSLC: ?*c_void, pPKeyId: ?*const Guid, pwszValueName: ?[*:0]const u16, peDataType: ?*SLDATATYPE, pcbValue: ?*u32, ppbValue: ?*?*u8, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLGetLicenseInformation( hSLC: ?*c_void, pSLLicenseId: ?*const Guid, pwszValueName: ?[*:0]const u16, peDataType: ?*SLDATATYPE, pcbValue: ?*u32, ppbValue: ?*?*u8, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLGetLicensingStatusInformation( hSLC: ?*c_void, pAppID: ?*const Guid, pProductSkuId: ?*const Guid, pwszRightName: ?[*:0]const u16, pnStatusCount: ?*u32, ppLicensingStatus: ?*?*SL_LICENSING_STATUS, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLGetPolicyInformation( hSLC: ?*c_void, pwszValueName: ?[*:0]const u16, peDataType: ?*SLDATATYPE, pcbValue: ?*u32, ppbValue: ?*?*u8, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLGetPolicyInformationDWORD( hSLC: ?*c_void, pwszValueName: ?[*:0]const u16, pdwValue: ?*u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLGetServiceInformation( hSLC: ?*c_void, pwszValueName: ?[*:0]const u16, peDataType: ?*SLDATATYPE, pcbValue: ?*u32, ppbValue: ?*?*u8, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLGetApplicationInformation( hSLC: ?*c_void, pApplicationId: ?*const Guid, pwszValueName: ?[*:0]const u16, peDataType: ?*SLDATATYPE, pcbValue: ?*u32, ppbValue: ?*?*u8, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "slcext" fn SLActivateProduct( hSLC: ?*c_void, pProductSkuId: ?*const Guid, cbAppSpecificData: u32, pvAppSpecificData: ?*const c_void, pActivationInfo: ?*const SL_ACTIVATION_INFO_HEADER, pwszProxyServer: ?[*:0]const u16, wProxyPort: u16, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "slcext" fn SLGetServerStatus( pwszServerURL: ?[*:0]const u16, pwszAcquisitionType: ?[*:0]const u16, pwszProxyServer: ?[*:0]const u16, wProxyPort: u16, phrStatus: ?*HRESULT, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLGenerateOfflineInstallationId( hSLC: ?*c_void, pProductSkuId: ?*const Guid, ppwszInstallationId: ?*?PWSTR, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLGenerateOfflineInstallationIdEx( hSLC: ?*c_void, pProductSkuId: ?*const Guid, pActivationInfo: ?*const SL_ACTIVATION_INFO_HEADER, ppwszInstallationId: ?*?PWSTR, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLDepositOfflineConfirmationId( hSLC: ?*c_void, pProductSkuId: ?*const Guid, pwszInstallationId: ?[*:0]const u16, pwszConfirmationId: ?[*:0]const u16, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLDepositOfflineConfirmationIdEx( hSLC: ?*c_void, pProductSkuId: ?*const Guid, pActivationInfo: ?*const SL_ACTIVATION_INFO_HEADER, pwszInstallationId: ?[*:0]const u16, pwszConfirmationId: ?[*:0]const u16, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLGetPKeyId( hSLC: ?*c_void, pwszPKeyAlgorithm: ?[*:0]const u16, pwszPKeyString: ?[*:0]const u16, cbPKeySpecificData: u32, // TODO: what to do with BytesParamIndex 3? pbPKeySpecificData: ?*const u8, pPKeyId: ?*Guid, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLGetInstalledProductKeyIds( hSLC: ?*c_void, pProductSkuId: ?*const Guid, pnProductKeyIds: ?*u32, ppProductKeyIds: ?*?*Guid, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLSetCurrentProductKey( hSLC: ?*c_void, pProductSkuId: ?*const Guid, pProductKeyId: ?*const Guid, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLGetSLIDList( hSLC: ?*c_void, eQueryIdType: SLIDTYPE, pQueryId: ?*const Guid, eReturnIdType: SLIDTYPE, pnReturnIds: ?*u32, ppReturnIds: ?*?*Guid, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLGetLicenseFileId( hSLC: ?*c_void, cbLicenseBlob: u32, // TODO: what to do with BytesParamIndex 1? pbLicenseBlob: ?*const u8, pLicenseFileId: ?*Guid, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLGetLicense( hSLC: ?*c_void, pLicenseFileId: ?*const Guid, pcbLicenseFile: ?*u32, ppbLicenseFile: ?*?*u8, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLFireEvent( hSLC: ?*c_void, pwszEventId: ?[*:0]const u16, pApplicationId: ?*const Guid, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLRegisterEvent( hSLC: ?*c_void, pwszEventId: ?[*:0]const u16, pApplicationId: ?*const Guid, hEvent: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "SLC" fn SLUnregisterEvent( hSLC: ?*c_void, pwszEventId: ?[*:0]const u16, pApplicationId: ?*const Guid, hEvent: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "SLC" fn SLGetWindowsInformation( pwszValueName: ?[*:0]const u16, peDataType: ?*SLDATATYPE, pcbValue: ?*u32, ppbValue: ?*?*u8, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "SLC" fn SLGetWindowsInformationDWORD( pwszValueName: ?[*:0]const u16, pdwValue: ?*u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "SLWGA" fn SLIsGenuineLocal( pAppId: ?*const Guid, pGenuineState: ?*SL_GENUINE_STATE, pUIOptions: ?*SL_NONGENUINE_UI_OPTIONS, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "slcext" fn SLAcquireGenuineTicket( ppTicketBlob: ?*?*c_void, pcbTicketBlob: ?*u32, pwszTemplateId: ?[*:0]const u16, pwszServerUrl: ?[*:0]const u16, pwszClientToken: ?[*:0]const u16, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "SLC" fn SLSetGenuineInformation( pQueryId: ?*const Guid, pwszValueName: ?[*:0]const u16, eDataType: SLDATATYPE, cbValue: u32, // TODO: what to do with BytesParamIndex 3? pbValue: ?*const u8, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows8.0' pub extern "slcext" fn SLGetReferralInformation( hSLC: ?*c_void, eReferralType: SLREFERRALTYPE, pSkuOrAppId: ?*const Guid, pwszValueName: ?[*:0]const u16, ppwszValue: ?*?PWSTR, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "SLC" fn SLGetGenuineInformation( pQueryId: ?*const Guid, pwszValueName: ?[*:0]const u16, peDataType: ?*SLDATATYPE, pcbValue: ?*u32, ppbValue: ?*?*u8, ) callconv(@import("std").os.windows.WINAPI) HRESULT; // TODO: this type is limited to platform 'windows10.0.10240' pub extern "api-ms-win-core-slapi-l1-1-0" fn SLQueryLicenseValueFromApp( valueName: ?[*:0]const u16, valueType: ?*u32, // TODO: what to do with BytesParamIndex 3? dataBuffer: ?*c_void, dataSize: u32, resultDataSize: ?*u32, ) callconv(@import("std").os.windows.WINAPI) HRESULT; //-------------------------------------------------------------------------------- // Section: Unicode Aliases (57) //-------------------------------------------------------------------------------- const thismodule = @This(); pub usingnamespace switch (@import("../../../zig.zig").unicode_mode) { .ansi => struct { pub const SecPkgInfo = thismodule.SecPkgInfoA; pub const SecPkgCredentials_Names = thismodule.SecPkgCredentials_NamesA; pub const SecPkgCredentials_SSIProvider = thismodule.SecPkgCredentials_SSIProviderA; pub const SecPkgContext_Names = thismodule.SecPkgContext_NamesA; pub const SecPkgContext_KeyInfo = thismodule.SecPkgContext_KeyInfoA; pub const SecPkgContext_Authority = thismodule.SecPkgContext_AuthorityA; pub const SecPkgContext_ProtoInfo = thismodule.SecPkgContext_ProtoInfoA; pub const SecPkgContext_PackageInfo = thismodule.SecPkgContext_PackageInfoA; pub const SecPkgContext_NegotiationInfo = thismodule.SecPkgContext_NegotiationInfoA; pub const SecPkgContext_NativeNames = thismodule.SecPkgContext_NativeNamesA; pub const SecPkgContext_CredentialName = thismodule.SecPkgContext_CredentialNameA; pub const ACQUIRE_CREDENTIALS_HANDLE_FN_ = thismodule.ACQUIRE_CREDENTIALS_HANDLE_FN_A; pub const ADD_CREDENTIALS_FN_ = thismodule.ADD_CREDENTIALS_FN_A; pub const CHANGE_PASSWORD_FN_ = thismodule.CHANGE_PASSWORD_FN_A; pub const INITIALIZE_SECURITY_CONTEXT_FN_ = thismodule.INITIALIZE_SECURITY_CONTEXT_FN_A; pub const QUERY_CONTEXT_ATTRIBUTES_FN_ = thismodule.QUERY_CONTEXT_ATTRIBUTES_FN_A; pub const QUERY_CONTEXT_ATTRIBUTES_EX_FN_ = thismodule.QUERY_CONTEXT_ATTRIBUTES_EX_FN_A; pub const SET_CONTEXT_ATTRIBUTES_FN_ = thismodule.SET_CONTEXT_ATTRIBUTES_FN_A; pub const QUERY_CREDENTIALS_ATTRIBUTES_FN_ = thismodule.QUERY_CREDENTIALS_ATTRIBUTES_FN_A; pub const QUERY_CREDENTIALS_ATTRIBUTES_EX_FN_ = thismodule.QUERY_CREDENTIALS_ATTRIBUTES_EX_FN_A; pub const SET_CREDENTIALS_ATTRIBUTES_FN_ = thismodule.SET_CREDENTIALS_ATTRIBUTES_FN_A; pub const ENUMERATE_SECURITY_PACKAGES_FN_ = thismodule.ENUMERATE_SECURITY_PACKAGES_FN_A; pub const QUERY_SECURITY_PACKAGE_INFO_FN_ = thismodule.QUERY_SECURITY_PACKAGE_INFO_FN_A; pub const IMPORT_SECURITY_CONTEXT_FN_ = thismodule.IMPORT_SECURITY_CONTEXT_FN_A; pub const SecurityFunctionTable = thismodule.SecurityFunctionTableA; pub const INIT_SECURITY_INTERFACE_ = thismodule.INIT_SECURITY_INTERFACE_A; pub const SEC_WINNT_AUTH_IDENTITY_EX = thismodule.SEC_WINNT_AUTH_IDENTITY_EXA; pub const SSL_EMPTY_CACHE_FN_ = thismodule.SSL_EMPTY_CACHE_FN_A; pub const AuditLookupCategoryName = thismodule.AuditLookupCategoryNameA; pub const AuditLookupSubCategoryName = thismodule.AuditLookupSubCategoryNameA; pub const AuditSetGlobalSacl = thismodule.AuditSetGlobalSaclA; pub const AuditQueryGlobalSacl = thismodule.AuditQueryGlobalSaclA; pub const AcquireCredentialsHandle = thismodule.AcquireCredentialsHandleA; pub const AddCredentials = thismodule.AddCredentialsA; pub const ChangeAccountPassword = thismodule.ChangeAccountPasswordA; pub const InitializeSecurityContext = thismodule.InitializeSecurityContextA; pub const QueryContextAttributes = thismodule.QueryContextAttributesA; pub const QueryContextAttributesEx = thismodule.QueryContextAttributesExA; pub const SetContextAttributes = thismodule.SetContextAttributesA; pub const QueryCredentialsAttributes = thismodule.QueryCredentialsAttributesA; pub const QueryCredentialsAttributesEx = thismodule.QueryCredentialsAttributesExA; pub const SetCredentialsAttributes = thismodule.SetCredentialsAttributesA; pub const EnumerateSecurityPackages = thismodule.EnumerateSecurityPackagesA; pub const QuerySecurityPackageInfo = thismodule.QuerySecurityPackageInfoA; pub const ImportSecurityContext = thismodule.ImportSecurityContextA; pub const InitSecurityInterface = thismodule.InitSecurityInterfaceA; pub const SaslEnumerateProfiles = thismodule.SaslEnumerateProfilesA; pub const SaslGetProfilePackage = thismodule.SaslGetProfilePackageA; pub const SaslIdentifyPackage = thismodule.SaslIdentifyPackageA; pub const SaslInitializeSecurityContext = thismodule.SaslInitializeSecurityContextA; pub const SspiPromptForCredentials = thismodule.SspiPromptForCredentialsA; pub const AddSecurityPackage = thismodule.AddSecurityPackageA; pub const DeleteSecurityPackage = thismodule.DeleteSecurityPackageA; pub const SslEmptyCache = thismodule.SslEmptyCacheA; pub const GetUserNameEx = thismodule.GetUserNameExA; pub const GetComputerObjectName = thismodule.GetComputerObjectNameA; pub const TranslateName = thismodule.TranslateNameA; }, .wide => struct { pub const SecPkgInfo = thismodule.SecPkgInfoW; pub const SecPkgCredentials_Names = thismodule.SecPkgCredentials_NamesW; pub const SecPkgCredentials_SSIProvider = thismodule.SecPkgCredentials_SSIProviderW; pub const SecPkgContext_Names = thismodule.SecPkgContext_NamesW; pub const SecPkgContext_KeyInfo = thismodule.SecPkgContext_KeyInfoW; pub const SecPkgContext_Authority = thismodule.SecPkgContext_AuthorityW; pub const SecPkgContext_ProtoInfo = thismodule.SecPkgContext_ProtoInfoW; pub const SecPkgContext_PackageInfo = thismodule.SecPkgContext_PackageInfoW; pub const SecPkgContext_NegotiationInfo = thismodule.SecPkgContext_NegotiationInfoW; pub const SecPkgContext_NativeNames = thismodule.SecPkgContext_NativeNamesW; pub const SecPkgContext_CredentialName = thismodule.SecPkgContext_CredentialNameW; pub const ACQUIRE_CREDENTIALS_HANDLE_FN_ = thismodule.ACQUIRE_CREDENTIALS_HANDLE_FN_W; pub const ADD_CREDENTIALS_FN_ = thismodule.ADD_CREDENTIALS_FN_W; pub const CHANGE_PASSWORD_FN_ = thismodule.CHANGE_PASSWORD_FN_W; pub const INITIALIZE_SECURITY_CONTEXT_FN_ = thismodule.INITIALIZE_SECURITY_CONTEXT_FN_W; pub const QUERY_CONTEXT_ATTRIBUTES_FN_ = thismodule.QUERY_CONTEXT_ATTRIBUTES_FN_W; pub const QUERY_CONTEXT_ATTRIBUTES_EX_FN_ = thismodule.QUERY_CONTEXT_ATTRIBUTES_EX_FN_W; pub const SET_CONTEXT_ATTRIBUTES_FN_ = thismodule.SET_CONTEXT_ATTRIBUTES_FN_W; pub const QUERY_CREDENTIALS_ATTRIBUTES_FN_ = thismodule.QUERY_CREDENTIALS_ATTRIBUTES_FN_W; pub const QUERY_CREDENTIALS_ATTRIBUTES_EX_FN_ = thismodule.QUERY_CREDENTIALS_ATTRIBUTES_EX_FN_W; pub const SET_CREDENTIALS_ATTRIBUTES_FN_ = thismodule.SET_CREDENTIALS_ATTRIBUTES_FN_W; pub const ENUMERATE_SECURITY_PACKAGES_FN_ = thismodule.ENUMERATE_SECURITY_PACKAGES_FN_W; pub const QUERY_SECURITY_PACKAGE_INFO_FN_ = thismodule.QUERY_SECURITY_PACKAGE_INFO_FN_W; pub const IMPORT_SECURITY_CONTEXT_FN_ = thismodule.IMPORT_SECURITY_CONTEXT_FN_W; pub const SecurityFunctionTable = thismodule.SecurityFunctionTableW; pub const INIT_SECURITY_INTERFACE_ = thismodule.INIT_SECURITY_INTERFACE_W; pub const SEC_WINNT_AUTH_IDENTITY_EX = thismodule.SEC_WINNT_AUTH_IDENTITY_EXW; pub const SSL_EMPTY_CACHE_FN_ = thismodule.SSL_EMPTY_CACHE_FN_W; pub const AuditLookupCategoryName = thismodule.AuditLookupCategoryNameW; pub const AuditLookupSubCategoryName = thismodule.AuditLookupSubCategoryNameW; pub const AuditSetGlobalSacl = thismodule.AuditSetGlobalSaclW; pub const AuditQueryGlobalSacl = thismodule.AuditQueryGlobalSaclW; pub const AcquireCredentialsHandle = thismodule.AcquireCredentialsHandleW; pub const AddCredentials = thismodule.AddCredentialsW; pub const ChangeAccountPassword = thismodule.ChangeAccountPasswordW; pub const InitializeSecurityContext = thismodule.InitializeSecurityContextW; pub const QueryContextAttributes = thismodule.QueryContextAttributesW; pub const QueryContextAttributesEx = thismodule.QueryContextAttributesExW; pub const SetContextAttributes = thismodule.SetContextAttributesW; pub const QueryCredentialsAttributes = thismodule.QueryCredentialsAttributesW; pub const QueryCredentialsAttributesEx = thismodule.QueryCredentialsAttributesExW; pub const SetCredentialsAttributes = thismodule.SetCredentialsAttributesW; pub const EnumerateSecurityPackages = thismodule.EnumerateSecurityPackagesW; pub const QuerySecurityPackageInfo = thismodule.QuerySecurityPackageInfoW; pub const ImportSecurityContext = thismodule.ImportSecurityContextW; pub const InitSecurityInterface = thismodule.InitSecurityInterfaceW; pub const SaslEnumerateProfiles = thismodule.SaslEnumerateProfilesW; pub const SaslGetProfilePackage = thismodule.SaslGetProfilePackageW; pub const SaslIdentifyPackage = thismodule.SaslIdentifyPackageW; pub const SaslInitializeSecurityContext = thismodule.SaslInitializeSecurityContextW; pub const SspiPromptForCredentials = thismodule.SspiPromptForCredentialsW; pub const AddSecurityPackage = thismodule.AddSecurityPackageW; pub const DeleteSecurityPackage = thismodule.DeleteSecurityPackageW; pub const SslEmptyCache = thismodule.SslEmptyCacheW; pub const GetUserNameEx = thismodule.GetUserNameExW; pub const GetComputerObjectName = thismodule.GetComputerObjectNameW; pub const TranslateName = thismodule.TranslateNameW; }, .unspecified => if (@import("builtin").is_test) struct { pub const SecPkgInfo = *opaque{}; pub const SecPkgCredentials_Names = *opaque{}; pub const SecPkgCredentials_SSIProvider = *opaque{}; pub const SecPkgContext_Names = *opaque{}; pub const SecPkgContext_KeyInfo = *opaque{}; pub const SecPkgContext_Authority = *opaque{}; pub const SecPkgContext_ProtoInfo = *opaque{}; pub const SecPkgContext_PackageInfo = *opaque{}; pub const SecPkgContext_NegotiationInfo = *opaque{}; pub const SecPkgContext_NativeNames = *opaque{}; pub const SecPkgContext_CredentialName = *opaque{}; pub const ACQUIRE_CREDENTIALS_HANDLE_FN_ = *opaque{}; pub const ADD_CREDENTIALS_FN_ = *opaque{}; pub const CHANGE_PASSWORD_FN_ = *opaque{}; pub const INITIALIZE_SECURITY_CONTEXT_FN_ = *opaque{}; pub const QUERY_CONTEXT_ATTRIBUTES_FN_ = *opaque{}; pub const QUERY_CONTEXT_ATTRIBUTES_EX_FN_ = *opaque{}; pub const SET_CONTEXT_ATTRIBUTES_FN_ = *opaque{}; pub const QUERY_CREDENTIALS_ATTRIBUTES_FN_ = *opaque{}; pub const QUERY_CREDENTIALS_ATTRIBUTES_EX_FN_ = *opaque{}; pub const SET_CREDENTIALS_ATTRIBUTES_FN_ = *opaque{}; pub const ENUMERATE_SECURITY_PACKAGES_FN_ = *opaque{}; pub const QUERY_SECURITY_PACKAGE_INFO_FN_ = *opaque{}; pub const IMPORT_SECURITY_CONTEXT_FN_ = *opaque{}; pub const SecurityFunctionTable = *opaque{}; pub const INIT_SECURITY_INTERFACE_ = *opaque{}; pub const SEC_WINNT_AUTH_IDENTITY_EX = *opaque{}; pub const SSL_EMPTY_CACHE_FN_ = *opaque{}; pub const AuditLookupCategoryName = *opaque{}; pub const AuditLookupSubCategoryName = *opaque{}; pub const AuditSetGlobalSacl = *opaque{}; pub const AuditQueryGlobalSacl = *opaque{}; pub const AcquireCredentialsHandle = *opaque{}; pub const AddCredentials = *opaque{}; pub const ChangeAccountPassword = *opaque{}; pub const InitializeSecurityContext = *opaque{}; pub const QueryContextAttributes = *opaque{}; pub const QueryContextAttributesEx = *opaque{}; pub const SetContextAttributes = *opaque{}; pub const QueryCredentialsAttributes = *opaque{}; pub const QueryCredentialsAttributesEx = *opaque{}; pub const SetCredentialsAttributes = *opaque{}; pub const EnumerateSecurityPackages = *opaque{}; pub const QuerySecurityPackageInfo = *opaque{}; pub const ImportSecurityContext = *opaque{}; pub const InitSecurityInterface = *opaque{}; pub const SaslEnumerateProfiles = *opaque{}; pub const SaslGetProfilePackage = *opaque{}; pub const SaslIdentifyPackage = *opaque{}; pub const SaslInitializeSecurityContext = *opaque{}; pub const SspiPromptForCredentials = *opaque{}; pub const AddSecurityPackage = *opaque{}; pub const DeleteSecurityPackage = *opaque{}; pub const SslEmptyCache = *opaque{}; pub const GetUserNameEx = *opaque{}; pub const GetComputerObjectName = *opaque{}; pub const TranslateName = *opaque{}; } else struct { pub const SecPkgInfo = @compileError("'SecPkgInfo' requires that UNICODE be set to true or false in the root module"); pub const SecPkgCredentials_Names = @compileError("'SecPkgCredentials_Names' requires that UNICODE be set to true or false in the root module"); pub const SecPkgCredentials_SSIProvider = @compileError("'SecPkgCredentials_SSIProvider' requires that UNICODE be set to true or false in the root module"); pub const SecPkgContext_Names = @compileError("'SecPkgContext_Names' requires that UNICODE be set to true or false in the root module"); pub const SecPkgContext_KeyInfo = @compileError("'SecPkgContext_KeyInfo' requires that UNICODE be set to true or false in the root module"); pub const SecPkgContext_Authority = @compileError("'SecPkgContext_Authority' requires that UNICODE be set to true or false in the root module"); pub const SecPkgContext_ProtoInfo = @compileError("'SecPkgContext_ProtoInfo' requires that UNICODE be set to true or false in the root module"); pub const SecPkgContext_PackageInfo = @compileError("'SecPkgContext_PackageInfo' requires that UNICODE be set to true or false in the root module"); pub const SecPkgContext_NegotiationInfo = @compileError("'SecPkgContext_NegotiationInfo' requires that UNICODE be set to true or false in the root module"); pub const SecPkgContext_NativeNames = @compileError("'SecPkgContext_NativeNames' requires that UNICODE be set to true or false in the root module"); pub const SecPkgContext_CredentialName = @compileError("'SecPkgContext_CredentialName' requires that UNICODE be set to true or false in the root module"); pub const ACQUIRE_CREDENTIALS_HANDLE_FN_ = @compileError("'ACQUIRE_CREDENTIALS_HANDLE_FN_' requires that UNICODE be set to true or false in the root module"); pub const ADD_CREDENTIALS_FN_ = @compileError("'ADD_CREDENTIALS_FN_' requires that UNICODE be set to true or false in the root module"); pub const CHANGE_PASSWORD_FN_ = @compileError("'CHANGE_PASSWORD_FN_' requires that UNICODE be set to true or false in the root module"); pub const INITIALIZE_SECURITY_CONTEXT_FN_ = @compileError("'INITIALIZE_SECURITY_CONTEXT_FN_' requires that UNICODE be set to true or false in the root module"); pub const QUERY_CONTEXT_ATTRIBUTES_FN_ = @compileError("'QUERY_CONTEXT_ATTRIBUTES_FN_' requires that UNICODE be set to true or false in the root module"); pub const QUERY_CONTEXT_ATTRIBUTES_EX_FN_ = @compileError("'QUERY_CONTEXT_ATTRIBUTES_EX_FN_' requires that UNICODE be set to true or false in the root module"); pub const SET_CONTEXT_ATTRIBUTES_FN_ = @compileError("'SET_CONTEXT_ATTRIBUTES_FN_' requires that UNICODE be set to true or false in the root module"); pub const QUERY_CREDENTIALS_ATTRIBUTES_FN_ = @compileError("'QUERY_CREDENTIALS_ATTRIBUTES_FN_' requires that UNICODE be set to true or false in the root module"); pub const QUERY_CREDENTIALS_ATTRIBUTES_EX_FN_ = @compileError("'QUERY_CREDENTIALS_ATTRIBUTES_EX_FN_' requires that UNICODE be set to true or false in the root module"); pub const SET_CREDENTIALS_ATTRIBUTES_FN_ = @compileError("'SET_CREDENTIALS_ATTRIBUTES_FN_' requires that UNICODE be set to true or false in the root module"); pub const ENUMERATE_SECURITY_PACKAGES_FN_ = @compileError("'ENUMERATE_SECURITY_PACKAGES_FN_' requires that UNICODE be set to true or false in the root module"); pub const QUERY_SECURITY_PACKAGE_INFO_FN_ = @compileError("'QUERY_SECURITY_PACKAGE_INFO_FN_' requires that UNICODE be set to true or false in the root module"); pub const IMPORT_SECURITY_CONTEXT_FN_ = @compileError("'IMPORT_SECURITY_CONTEXT_FN_' requires that UNICODE be set to true or false in the root module"); pub const SecurityFunctionTable = @compileError("'SecurityFunctionTable' requires that UNICODE be set to true or false in the root module"); pub const INIT_SECURITY_INTERFACE_ = @compileError("'INIT_SECURITY_INTERFACE_' requires that UNICODE be set to true or false in the root module"); pub const SEC_WINNT_AUTH_IDENTITY_EX = @compileError("'SEC_WINNT_AUTH_IDENTITY_EX' requires that UNICODE be set to true or false in the root module"); pub const SSL_EMPTY_CACHE_FN_ = @compileError("'SSL_EMPTY_CACHE_FN_' requires that UNICODE be set to true or false in the root module"); pub const AuditLookupCategoryName = @compileError("'AuditLookupCategoryName' requires that UNICODE be set to true or false in the root module"); pub const AuditLookupSubCategoryName = @compileError("'AuditLookupSubCategoryName' requires that UNICODE be set to true or false in the root module"); pub const AuditSetGlobalSacl = @compileError("'AuditSetGlobalSacl' requires that UNICODE be set to true or false in the root module"); pub const AuditQueryGlobalSacl = @compileError("'AuditQueryGlobalSacl' requires that UNICODE be set to true or false in the root module"); pub const AcquireCredentialsHandle = @compileError("'AcquireCredentialsHandle' requires that UNICODE be set to true or false in the root module"); pub const AddCredentials = @compileError("'AddCredentials' requires that UNICODE be set to true or false in the root module"); pub const ChangeAccountPassword = @compileError("'ChangeAccountPassword' requires that UNICODE be set to true or false in the root module"); pub const InitializeSecurityContext = @compileError("'InitializeSecurityContext' requires that UNICODE be set to true or false in the root module"); pub const QueryContextAttributes = @compileError("'QueryContextAttributes' requires that UNICODE be set to true or false in the root module"); pub const QueryContextAttributesEx = @compileError("'QueryContextAttributesEx' requires that UNICODE be set to true or false in the root module"); pub const SetContextAttributes = @compileError("'SetContextAttributes' requires that UNICODE be set to true or false in the root module"); pub const QueryCredentialsAttributes = @compileError("'QueryCredentialsAttributes' requires that UNICODE be set to true or false in the root module"); pub const QueryCredentialsAttributesEx = @compileError("'QueryCredentialsAttributesEx' requires that UNICODE be set to true or false in the root module"); pub const SetCredentialsAttributes = @compileError("'SetCredentialsAttributes' requires that UNICODE be set to true or false in the root module"); pub const EnumerateSecurityPackages = @compileError("'EnumerateSecurityPackages' requires that UNICODE be set to true or false in the root module"); pub const QuerySecurityPackageInfo = @compileError("'QuerySecurityPackageInfo' requires that UNICODE be set to true or false in the root module"); pub const ImportSecurityContext = @compileError("'ImportSecurityContext' requires that UNICODE be set to true or false in the root module"); pub const InitSecurityInterface = @compileError("'InitSecurityInterface' requires that UNICODE be set to true or false in the root module"); pub const SaslEnumerateProfiles = @compileError("'SaslEnumerateProfiles' requires that UNICODE be set to true or false in the root module"); pub const SaslGetProfilePackage = @compileError("'SaslGetProfilePackage' requires that UNICODE be set to true or false in the root module"); pub const SaslIdentifyPackage = @compileError("'SaslIdentifyPackage' requires that UNICODE be set to true or false in the root module"); pub const SaslInitializeSecurityContext = @compileError("'SaslInitializeSecurityContext' requires that UNICODE be set to true or false in the root module"); pub const SspiPromptForCredentials = @compileError("'SspiPromptForCredentials' requires that UNICODE be set to true or false in the root module"); pub const AddSecurityPackage = @compileError("'AddSecurityPackage' requires that UNICODE be set to true or false in the root module"); pub const DeleteSecurityPackage = @compileError("'DeleteSecurityPackage' requires that UNICODE be set to true or false in the root module"); pub const SslEmptyCache = @compileError("'SslEmptyCache' requires that UNICODE be set to true or false in the root module"); pub const GetUserNameEx = @compileError("'GetUserNameEx' requires that UNICODE be set to true or false in the root module"); pub const GetComputerObjectName = @compileError("'GetComputerObjectName' requires that UNICODE be set to true or false in the root module"); pub const TranslateName = @compileError("'TranslateName' requires that UNICODE be set to true or false in the root module"); }, }; //-------------------------------------------------------------------------------- // Section: Imports (43) //-------------------------------------------------------------------------------- const Guid = @import("../../../zig.zig").Guid; const ACL = @import("../../../security.zig").ACL; const BOOL = @import("../../../foundation.zig").BOOL; const BOOLEAN = @import("../../../foundation.zig").BOOLEAN; const CERT_CONTEXT = @import("../../../security/cryptography/core.zig").CERT_CONTEXT; const CHAR = @import("../../../system/system_services.zig").CHAR; const CREDENTIAL_TARGET_INFORMATIONW = @import("../../../security/credentials.zig").CREDENTIAL_TARGET_INFORMATIONW; const CREDENTIALW = @import("../../../security/credentials.zig").CREDENTIALW; const CRYPTOAPI_BLOB = @import("../../../security/cryptography/core.zig").CRYPTOAPI_BLOB; const CYPHER_BLOCK = @import("../../../system/password_management.zig").CYPHER_BLOCK; const FILETIME = @import("../../../foundation.zig").FILETIME; const HANDLE = @import("../../../foundation.zig").HANDLE; const HRESULT = @import("../../../foundation.zig").HRESULT; const HWND = @import("../../../foundation.zig").HWND; const LARGE_INTEGER = @import("../../../system/system_services.zig").LARGE_INTEGER; const LIST_ENTRY = @import("../../../system/kernel.zig").LIST_ENTRY; const LM_OWF_PASSWORD = @import("../../../system/password_management.zig").LM_OWF_PASSWORD; const LPTHREAD_START_ROUTINE = @import("../../../system/system_services.zig").LPTHREAD_START_ROUTINE; const LUID = @import("../../../system/system_services.zig").LUID; const NTSTATUS = @import("../../../foundation.zig").NTSTATUS; const OBJECT_ATTRIBUTES = @import("../../../system/windows_programming.zig").OBJECT_ATTRIBUTES; const PSID = @import("../../../foundation.zig").PSID; const PSTR = @import("../../../foundation.zig").PSTR; const PWSTR = @import("../../../foundation.zig").PWSTR; const QUOTA_LIMITS = @import("../../../security.zig").QUOTA_LIMITS; const SEC_WINNT_AUTH_IDENTITY_A = @import("../../../system/rpc.zig").SEC_WINNT_AUTH_IDENTITY_A; const SEC_WINNT_AUTH_IDENTITY_W = @import("../../../system/rpc.zig").SEC_WINNT_AUTH_IDENTITY_W; const SecHandle = @import("../../../security/credentials.zig").SecHandle; const SECURITY_ATTRIBUTES = @import("../../../security.zig").SECURITY_ATTRIBUTES; const SECURITY_DESCRIPTOR = @import("../../../security.zig").SECURITY_DESCRIPTOR; const SECURITY_IMPERSONATION_LEVEL = @import("../../../security.zig").SECURITY_IMPERSONATION_LEVEL; const SID_NAME_USE = @import("../../../security.zig").SID_NAME_USE; const STRING = @import("../../../system/kernel.zig").STRING; const TOKEN_DEFAULT_DACL = @import("../../../security.zig").TOKEN_DEFAULT_DACL; const TOKEN_DEVICE_CLAIMS = @import("../../../security.zig").TOKEN_DEVICE_CLAIMS; const TOKEN_GROUPS = @import("../../../security.zig").TOKEN_GROUPS; const TOKEN_OWNER = @import("../../../security.zig").TOKEN_OWNER; const TOKEN_PRIMARY_GROUP = @import("../../../security.zig").TOKEN_PRIMARY_GROUP; const TOKEN_PRIVILEGES = @import("../../../security.zig").TOKEN_PRIVILEGES; const TOKEN_SOURCE = @import("../../../security.zig").TOKEN_SOURCE; const TOKEN_USER = @import("../../../security.zig").TOKEN_USER; const TOKEN_USER_CLAIMS = @import("../../../security.zig").TOKEN_USER_CLAIMS; const UNICODE_STRING = @import("../../../system/kernel.zig").UNICODE_STRING; test { // The following '_ = <FuncPtrType>' lines are a workaround for https://github.com/ziglang/zig/issues/4476 if (@hasDecl(@This(), "PSAM_PASSWORD_NOTIFICATION_ROUTINE")) { _ = PSAM_PASSWORD_NOTIFICATION_ROUTINE; } if (@hasDecl(@This(), "PSAM_INIT_NOTIFICATION_ROUTINE")) { _ = PSAM_INIT_NOTIFICATION_ROUTINE; } if (@hasDecl(@This(), "PSAM_PASSWORD_FILTER_ROUTINE")) { _ = PSAM_PASSWORD_FILTER_ROUTINE; } if (@hasDecl(@This(), "SEC_GET_KEY_FN")) { _ = SEC_GET_KEY_FN; } if (@hasDecl(@This(), "ACQUIRE_CREDENTIALS_HANDLE_FN_W")) { _ = ACQUIRE_CREDENTIALS_HANDLE_FN_W; } if (@hasDecl(@This(), "ACQUIRE_CREDENTIALS_HANDLE_FN_A")) { _ = ACQUIRE_CREDENTIALS_HANDLE_FN_A; } if (@hasDecl(@This(), "FREE_CREDENTIALS_HANDLE_FN")) { _ = FREE_CREDENTIALS_HANDLE_FN; } if (@hasDecl(@This(), "ADD_CREDENTIALS_FN_W")) { _ = ADD_CREDENTIALS_FN_W; } if (@hasDecl(@This(), "ADD_CREDENTIALS_FN_A")) { _ = ADD_CREDENTIALS_FN_A; } if (@hasDecl(@This(), "CHANGE_PASSWORD_FN_W")) { _ = CHANGE_PASSWORD_FN_W; } if (@hasDecl(@This(), "CHANGE_PASSWORD_FN_A")) { _ = CHANGE_PASSWORD_FN_A; } if (@hasDecl(@This(), "INITIALIZE_SECURITY_CONTEXT_FN_W")) { _ = INITIALIZE_SECURITY_CONTEXT_FN_W; } if (@hasDecl(@This(), "INITIALIZE_SECURITY_CONTEXT_FN_A")) { _ = INITIALIZE_SECURITY_CONTEXT_FN_A; } if (@hasDecl(@This(), "ACCEPT_SECURITY_CONTEXT_FN")) { _ = ACCEPT_SECURITY_CONTEXT_FN; } if (@hasDecl(@This(), "COMPLETE_AUTH_TOKEN_FN")) { _ = COMPLETE_AUTH_TOKEN_FN; } if (@hasDecl(@This(), "IMPERSONATE_SECURITY_CONTEXT_FN")) { _ = IMPERSONATE_SECURITY_CONTEXT_FN; } if (@hasDecl(@This(), "REVERT_SECURITY_CONTEXT_FN")) { _ = REVERT_SECURITY_CONTEXT_FN; } if (@hasDecl(@This(), "QUERY_SECURITY_CONTEXT_TOKEN_FN")) { _ = QUERY_SECURITY_CONTEXT_TOKEN_FN; } if (@hasDecl(@This(), "DELETE_SECURITY_CONTEXT_FN")) { _ = DELETE_SECURITY_CONTEXT_FN; } if (@hasDecl(@This(), "APPLY_CONTROL_TOKEN_FN")) { _ = APPLY_CONTROL_TOKEN_FN; } if (@hasDecl(@This(), "QUERY_CONTEXT_ATTRIBUTES_FN_W")) { _ = QUERY_CONTEXT_ATTRIBUTES_FN_W; } if (@hasDecl(@This(), "QUERY_CONTEXT_ATTRIBUTES_EX_FN_W")) { _ = QUERY_CONTEXT_ATTRIBUTES_EX_FN_W; } if (@hasDecl(@This(), "QUERY_CONTEXT_ATTRIBUTES_FN_A")) { _ = QUERY_CONTEXT_ATTRIBUTES_FN_A; } if (@hasDecl(@This(), "QUERY_CONTEXT_ATTRIBUTES_EX_FN_A")) { _ = QUERY_CONTEXT_ATTRIBUTES_EX_FN_A; } if (@hasDecl(@This(), "SET_CONTEXT_ATTRIBUTES_FN_W")) { _ = SET_CONTEXT_ATTRIBUTES_FN_W; } if (@hasDecl(@This(), "SET_CONTEXT_ATTRIBUTES_FN_A")) { _ = SET_CONTEXT_ATTRIBUTES_FN_A; } if (@hasDecl(@This(), "QUERY_CREDENTIALS_ATTRIBUTES_FN_W")) { _ = QUERY_CREDENTIALS_ATTRIBUTES_FN_W; } if (@hasDecl(@This(), "QUERY_CREDENTIALS_ATTRIBUTES_EX_FN_W")) { _ = QUERY_CREDENTIALS_ATTRIBUTES_EX_FN_W; } if (@hasDecl(@This(), "QUERY_CREDENTIALS_ATTRIBUTES_FN_A")) { _ = QUERY_CREDENTIALS_ATTRIBUTES_FN_A; } if (@hasDecl(@This(), "QUERY_CREDENTIALS_ATTRIBUTES_EX_FN_A")) { _ = QUERY_CREDENTIALS_ATTRIBUTES_EX_FN_A; } if (@hasDecl(@This(), "SET_CREDENTIALS_ATTRIBUTES_FN_W")) { _ = SET_CREDENTIALS_ATTRIBUTES_FN_W; } if (@hasDecl(@This(), "SET_CREDENTIALS_ATTRIBUTES_FN_A")) { _ = SET_CREDENTIALS_ATTRIBUTES_FN_A; } if (@hasDecl(@This(), "FREE_CONTEXT_BUFFER_FN")) { _ = FREE_CONTEXT_BUFFER_FN; } if (@hasDecl(@This(), "MAKE_SIGNATURE_FN")) { _ = MAKE_SIGNATURE_FN; } if (@hasDecl(@This(), "VERIFY_SIGNATURE_FN")) { _ = VERIFY_SIGNATURE_FN; } if (@hasDecl(@This(), "ENCRYPT_MESSAGE_FN")) { _ = ENCRYPT_MESSAGE_FN; } if (@hasDecl(@This(), "DECRYPT_MESSAGE_FN")) { _ = DECRYPT_MESSAGE_FN; } if (@hasDecl(@This(), "ENUMERATE_SECURITY_PACKAGES_FN_W")) { _ = ENUMERATE_SECURITY_PACKAGES_FN_W; } if (@hasDecl(@This(), "ENUMERATE_SECURITY_PACKAGES_FN_A")) { _ = ENUMERATE_SECURITY_PACKAGES_FN_A; } if (@hasDecl(@This(), "QUERY_SECURITY_PACKAGE_INFO_FN_W")) { _ = QUERY_SECURITY_PACKAGE_INFO_FN_W; } if (@hasDecl(@This(), "QUERY_SECURITY_PACKAGE_INFO_FN_A")) { _ = QUERY_SECURITY_PACKAGE_INFO_FN_A; } if (@hasDecl(@This(), "EXPORT_SECURITY_CONTEXT_FN")) { _ = EXPORT_SECURITY_CONTEXT_FN; } if (@hasDecl(@This(), "IMPORT_SECURITY_CONTEXT_FN_W")) { _ = IMPORT_SECURITY_CONTEXT_FN_W; } if (@hasDecl(@This(), "IMPORT_SECURITY_CONTEXT_FN_A")) { _ = IMPORT_SECURITY_CONTEXT_FN_A; } if (@hasDecl(@This(), "INIT_SECURITY_INTERFACE_A")) { _ = INIT_SECURITY_INTERFACE_A; } if (@hasDecl(@This(), "INIT_SECURITY_INTERFACE_W")) { _ = INIT_SECURITY_INTERFACE_W; } if (@hasDecl(@This(), "PLSA_CREATE_LOGON_SESSION")) { _ = PLSA_CREATE_LOGON_SESSION; } if (@hasDecl(@This(), "PLSA_DELETE_LOGON_SESSION")) { _ = PLSA_DELETE_LOGON_SESSION; } if (@hasDecl(@This(), "PLSA_ADD_CREDENTIAL")) { _ = PLSA_ADD_CREDENTIAL; } if (@hasDecl(@This(), "PLSA_GET_CREDENTIALS")) { _ = PLSA_GET_CREDENTIALS; } if (@hasDecl(@This(), "PLSA_DELETE_CREDENTIAL")) { _ = PLSA_DELETE_CREDENTIAL; } if (@hasDecl(@This(), "PLSA_ALLOCATE_LSA_HEAP")) { _ = PLSA_ALLOCATE_LSA_HEAP; } if (@hasDecl(@This(), "PLSA_FREE_LSA_HEAP")) { _ = PLSA_FREE_LSA_HEAP; } if (@hasDecl(@This(), "PLSA_ALLOCATE_PRIVATE_HEAP")) { _ = PLSA_ALLOCATE_PRIVATE_HEAP; } if (@hasDecl(@This(), "PLSA_FREE_PRIVATE_HEAP")) { _ = PLSA_FREE_PRIVATE_HEAP; } if (@hasDecl(@This(), "PLSA_ALLOCATE_CLIENT_BUFFER")) { _ = PLSA_ALLOCATE_CLIENT_BUFFER; } if (@hasDecl(@This(), "PLSA_FREE_CLIENT_BUFFER")) { _ = PLSA_FREE_CLIENT_BUFFER; } if (@hasDecl(@This(), "PLSA_COPY_TO_CLIENT_BUFFER")) { _ = PLSA_COPY_TO_CLIENT_BUFFER; } if (@hasDecl(@This(), "PLSA_COPY_FROM_CLIENT_BUFFER")) { _ = PLSA_COPY_FROM_CLIENT_BUFFER; } if (@hasDecl(@This(), "PLSA_AP_INITIALIZE_PACKAGE")) { _ = PLSA_AP_INITIALIZE_PACKAGE; } if (@hasDecl(@This(), "PLSA_AP_LOGON_USER")) { _ = PLSA_AP_LOGON_USER; } if (@hasDecl(@This(), "PLSA_AP_LOGON_USER_EX")) { _ = PLSA_AP_LOGON_USER_EX; } if (@hasDecl(@This(), "PLSA_AP_CALL_PACKAGE")) { _ = PLSA_AP_CALL_PACKAGE; } if (@hasDecl(@This(), "PLSA_AP_CALL_PACKAGE_PASSTHROUGH")) { _ = PLSA_AP_CALL_PACKAGE_PASSTHROUGH; } if (@hasDecl(@This(), "PLSA_AP_LOGON_TERMINATED")) { _ = PLSA_AP_LOGON_TERMINATED; } if (@hasDecl(@This(), "PSAM_CREDENTIAL_UPDATE_NOTIFY_ROUTINE")) { _ = PSAM_CREDENTIAL_UPDATE_NOTIFY_ROUTINE; } if (@hasDecl(@This(), "PSAM_CREDENTIAL_UPDATE_REGISTER_ROUTINE")) { _ = PSAM_CREDENTIAL_UPDATE_REGISTER_ROUTINE; } if (@hasDecl(@This(), "PSAM_CREDENTIAL_UPDATE_FREE_ROUTINE")) { _ = PSAM_CREDENTIAL_UPDATE_FREE_ROUTINE; } if (@hasDecl(@This(), "PSAM_CREDENTIAL_UPDATE_REGISTER_MAPPED_ENTRYPOINTS_ROUTINE")) { _ = PSAM_CREDENTIAL_UPDATE_REGISTER_MAPPED_ENTRYPOINTS_ROUTINE; } if (@hasDecl(@This(), "PLSA_CALLBACK_FUNCTION")) { _ = PLSA_CALLBACK_FUNCTION; } if (@hasDecl(@This(), "PLSA_REDIRECTED_LOGON_INIT")) { _ = PLSA_REDIRECTED_LOGON_INIT; } if (@hasDecl(@This(), "PLSA_REDIRECTED_LOGON_CALLBACK")) { _ = PLSA_REDIRECTED_LOGON_CALLBACK; } if (@hasDecl(@This(), "PLSA_REDIRECTED_LOGON_CLEANUP_CALLBACK")) { _ = PLSA_REDIRECTED_LOGON_CLEANUP_CALLBACK; } if (@hasDecl(@This(), "PLSA_REDIRECTED_LOGON_GET_LOGON_CREDS")) { _ = PLSA_REDIRECTED_LOGON_GET_LOGON_CREDS; } if (@hasDecl(@This(), "PLSA_REDIRECTED_LOGON_GET_SUPP_CREDS")) { _ = PLSA_REDIRECTED_LOGON_GET_SUPP_CREDS; } if (@hasDecl(@This(), "PLSA_IMPERSONATE_CLIENT")) { _ = PLSA_IMPERSONATE_CLIENT; } if (@hasDecl(@This(), "PLSA_UNLOAD_PACKAGE")) { _ = PLSA_UNLOAD_PACKAGE; } if (@hasDecl(@This(), "PLSA_DUPLICATE_HANDLE")) { _ = PLSA_DUPLICATE_HANDLE; } if (@hasDecl(@This(), "PLSA_SAVE_SUPPLEMENTAL_CREDENTIALS")) { _ = PLSA_SAVE_SUPPLEMENTAL_CREDENTIALS; } if (@hasDecl(@This(), "PLSA_CREATE_THREAD")) { _ = PLSA_CREATE_THREAD; } if (@hasDecl(@This(), "PLSA_GET_CLIENT_INFO")) { _ = PLSA_GET_CLIENT_INFO; } if (@hasDecl(@This(), "PLSA_REGISTER_NOTIFICATION")) { _ = PLSA_REGISTER_NOTIFICATION; } if (@hasDecl(@This(), "PLSA_CANCEL_NOTIFICATION")) { _ = PLSA_CANCEL_NOTIFICATION; } if (@hasDecl(@This(), "PLSA_MAP_BUFFER")) { _ = PLSA_MAP_BUFFER; } if (@hasDecl(@This(), "PLSA_CREATE_TOKEN")) { _ = PLSA_CREATE_TOKEN; } if (@hasDecl(@This(), "PLSA_CREATE_TOKEN_EX")) { _ = PLSA_CREATE_TOKEN_EX; } if (@hasDecl(@This(), "PLSA_AUDIT_LOGON")) { _ = PLSA_AUDIT_LOGON; } if (@hasDecl(@This(), "PLSA_CALL_PACKAGE")) { _ = PLSA_CALL_PACKAGE; } if (@hasDecl(@This(), "PLSA_CALL_PACKAGEEX")) { _ = PLSA_CALL_PACKAGEEX; } if (@hasDecl(@This(), "PLSA_CALL_PACKAGE_PASSTHROUGH")) { _ = PLSA_CALL_PACKAGE_PASSTHROUGH; } if (@hasDecl(@This(), "PLSA_GET_CALL_INFO")) { _ = PLSA_GET_CALL_INFO; } if (@hasDecl(@This(), "PLSA_CREATE_SHARED_MEMORY")) { _ = PLSA_CREATE_SHARED_MEMORY; } if (@hasDecl(@This(), "PLSA_ALLOCATE_SHARED_MEMORY")) { _ = PLSA_ALLOCATE_SHARED_MEMORY; } if (@hasDecl(@This(), "PLSA_FREE_SHARED_MEMORY")) { _ = PLSA_FREE_SHARED_MEMORY; } if (@hasDecl(@This(), "PLSA_DELETE_SHARED_MEMORY")) { _ = PLSA_DELETE_SHARED_MEMORY; } if (@hasDecl(@This(), "PLSA_GET_APP_MODE_INFO")) { _ = PLSA_GET_APP_MODE_INFO; } if (@hasDecl(@This(), "PLSA_SET_APP_MODE_INFO")) { _ = PLSA_SET_APP_MODE_INFO; } if (@hasDecl(@This(), "PLSA_OPEN_SAM_USER")) { _ = PLSA_OPEN_SAM_USER; } if (@hasDecl(@This(), "PLSA_GET_USER_CREDENTIALS")) { _ = PLSA_GET_USER_CREDENTIALS; } if (@hasDecl(@This(), "PLSA_GET_USER_AUTH_DATA")) { _ = PLSA_GET_USER_AUTH_DATA; } if (@hasDecl(@This(), "PLSA_CLOSE_SAM_USER")) { _ = PLSA_CLOSE_SAM_USER; } if (@hasDecl(@This(), "PLSA_GET_AUTH_DATA_FOR_USER")) { _ = PLSA_GET_AUTH_DATA_FOR_USER; } if (@hasDecl(@This(), "PLSA_CONVERT_AUTH_DATA_TO_TOKEN")) { _ = PLSA_CONVERT_AUTH_DATA_TO_TOKEN; } if (@hasDecl(@This(), "PLSA_CRACK_SINGLE_NAME")) { _ = PLSA_CRACK_SINGLE_NAME; } if (@hasDecl(@This(), "PLSA_AUDIT_ACCOUNT_LOGON")) { _ = PLSA_AUDIT_ACCOUNT_LOGON; } if (@hasDecl(@This(), "PLSA_CLIENT_CALLBACK")) { _ = PLSA_CLIENT_CALLBACK; } if (@hasDecl(@This(), "PLSA_REGISTER_CALLBACK")) { _ = PLSA_REGISTER_CALLBACK; } if (@hasDecl(@This(), "PLSA_GET_EXTENDED_CALL_FLAGS")) { _ = PLSA_GET_EXTENDED_CALL_FLAGS; } if (@hasDecl(@This(), "PLSA_UPDATE_PRIMARY_CREDENTIALS")) { _ = PLSA_UPDATE_PRIMARY_CREDENTIALS; } if (@hasDecl(@This(), "PLSA_PROTECT_MEMORY")) { _ = PLSA_PROTECT_MEMORY; } if (@hasDecl(@This(), "PLSA_OPEN_TOKEN_BY_LOGON_ID")) { _ = PLSA_OPEN_TOKEN_BY_LOGON_ID; } if (@hasDecl(@This(), "PLSA_EXPAND_AUTH_DATA_FOR_DOMAIN")) { _ = PLSA_EXPAND_AUTH_DATA_FOR_DOMAIN; } if (@hasDecl(@This(), "PLSA_GET_SERVICE_ACCOUNT_PASSWORD")) { _ = PLSA_GET_SERVICE_ACCOUNT_PASSWORD; } if (@hasDecl(@This(), "PLSA_AUDIT_LOGON_EX")) { _ = PLSA_AUDIT_LOGON_EX; } if (@hasDecl(@This(), "PLSA_CHECK_PROTECTED_USER_BY_TOKEN")) { _ = PLSA_CHECK_PROTECTED_USER_BY_TOKEN; } if (@hasDecl(@This(), "PLSA_QUERY_CLIENT_REQUEST")) { _ = PLSA_QUERY_CLIENT_REQUEST; } if (@hasDecl(@This(), "CredReadFn")) { _ = CredReadFn; } if (@hasDecl(@This(), "CredReadDomainCredentialsFn")) { _ = CredReadDomainCredentialsFn; } if (@hasDecl(@This(), "CredFreeCredentialsFn")) { _ = CredFreeCredentialsFn; } if (@hasDecl(@This(), "CredWriteFn")) { _ = CredWriteFn; } if (@hasDecl(@This(), "CrediUnmarshalandDecodeStringFn")) { _ = CrediUnmarshalandDecodeStringFn; } if (@hasDecl(@This(), "PLSA_LOCATE_PKG_BY_ID")) { _ = PLSA_LOCATE_PKG_BY_ID; } if (@hasDecl(@This(), "SpInitializeFn")) { _ = SpInitializeFn; } if (@hasDecl(@This(), "SpShutdownFn")) { _ = SpShutdownFn; } if (@hasDecl(@This(), "SpGetInfoFn")) { _ = SpGetInfoFn; } if (@hasDecl(@This(), "SpGetExtendedInformationFn")) { _ = SpGetExtendedInformationFn; } if (@hasDecl(@This(), "SpSetExtendedInformationFn")) { _ = SpSetExtendedInformationFn; } if (@hasDecl(@This(), "PLSA_AP_LOGON_USER_EX2")) { _ = PLSA_AP_LOGON_USER_EX2; } if (@hasDecl(@This(), "PLSA_AP_LOGON_USER_EX3")) { _ = PLSA_AP_LOGON_USER_EX3; } if (@hasDecl(@This(), "PLSA_AP_PRE_LOGON_USER_SURROGATE")) { _ = PLSA_AP_PRE_LOGON_USER_SURROGATE; } if (@hasDecl(@This(), "PLSA_AP_POST_LOGON_USER_SURROGATE")) { _ = PLSA_AP_POST_LOGON_USER_SURROGATE; } if (@hasDecl(@This(), "SpAcceptCredentialsFn")) { _ = SpAcceptCredentialsFn; } if (@hasDecl(@This(), "SpAcquireCredentialsHandleFn")) { _ = SpAcquireCredentialsHandleFn; } if (@hasDecl(@This(), "SpFreeCredentialsHandleFn")) { _ = SpFreeCredentialsHandleFn; } if (@hasDecl(@This(), "SpQueryCredentialsAttributesFn")) { _ = SpQueryCredentialsAttributesFn; } if (@hasDecl(@This(), "SpSetCredentialsAttributesFn")) { _ = SpSetCredentialsAttributesFn; } if (@hasDecl(@This(), "SpAddCredentialsFn")) { _ = SpAddCredentialsFn; } if (@hasDecl(@This(), "SpSaveCredentialsFn")) { _ = SpSaveCredentialsFn; } if (@hasDecl(@This(), "SpGetCredentialsFn")) { _ = SpGetCredentialsFn; } if (@hasDecl(@This(), "SpDeleteCredentialsFn")) { _ = SpDeleteCredentialsFn; } if (@hasDecl(@This(), "SpInitLsaModeContextFn")) { _ = SpInitLsaModeContextFn; } if (@hasDecl(@This(), "SpDeleteContextFn")) { _ = SpDeleteContextFn; } if (@hasDecl(@This(), "SpApplyControlTokenFn")) { _ = SpApplyControlTokenFn; } if (@hasDecl(@This(), "SpAcceptLsaModeContextFn")) { _ = SpAcceptLsaModeContextFn; } if (@hasDecl(@This(), "SpGetUserInfoFn")) { _ = SpGetUserInfoFn; } if (@hasDecl(@This(), "SpQueryContextAttributesFn")) { _ = SpQueryContextAttributesFn; } if (@hasDecl(@This(), "SpSetContextAttributesFn")) { _ = SpSetContextAttributesFn; } if (@hasDecl(@This(), "SpChangeAccountPasswordFn")) { _ = SpChangeAccountPasswordFn; } if (@hasDecl(@This(), "SpQueryMetaDataFn")) { _ = SpQueryMetaDataFn; } if (@hasDecl(@This(), "SpExchangeMetaDataFn")) { _ = SpExchangeMetaDataFn; } if (@hasDecl(@This(), "SpGetCredUIContextFn")) { _ = SpGetCredUIContextFn; } if (@hasDecl(@This(), "SpUpdateCredentialsFn")) { _ = SpUpdateCredentialsFn; } if (@hasDecl(@This(), "SpValidateTargetInfoFn")) { _ = SpValidateTargetInfoFn; } if (@hasDecl(@This(), "LSA_AP_POST_LOGON_USER")) { _ = LSA_AP_POST_LOGON_USER; } if (@hasDecl(@This(), "SpGetRemoteCredGuardLogonBufferFn")) { _ = SpGetRemoteCredGuardLogonBufferFn; } if (@hasDecl(@This(), "SpGetRemoteCredGuardSupplementalCredsFn")) { _ = SpGetRemoteCredGuardSupplementalCredsFn; } if (@hasDecl(@This(), "SpGetTbalSupplementalCredsFn")) { _ = SpGetTbalSupplementalCredsFn; } if (@hasDecl(@This(), "SpInstanceInitFn")) { _ = SpInstanceInitFn; } if (@hasDecl(@This(), "SpInitUserModeContextFn")) { _ = SpInitUserModeContextFn; } if (@hasDecl(@This(), "SpMakeSignatureFn")) { _ = SpMakeSignatureFn; } if (@hasDecl(@This(), "SpVerifySignatureFn")) { _ = SpVerifySignatureFn; } if (@hasDecl(@This(), "SpSealMessageFn")) { _ = SpSealMessageFn; } if (@hasDecl(@This(), "SpUnsealMessageFn")) { _ = SpUnsealMessageFn; } if (@hasDecl(@This(), "SpGetContextTokenFn")) { _ = SpGetContextTokenFn; } if (@hasDecl(@This(), "SpExportSecurityContextFn")) { _ = SpExportSecurityContextFn; } if (@hasDecl(@This(), "SpImportSecurityContextFn")) { _ = SpImportSecurityContextFn; } if (@hasDecl(@This(), "SpCompleteAuthTokenFn")) { _ = SpCompleteAuthTokenFn; } if (@hasDecl(@This(), "SpFormatCredentialsFn")) { _ = SpFormatCredentialsFn; } if (@hasDecl(@This(), "SpMarshallSupplementalCredsFn")) { _ = SpMarshallSupplementalCredsFn; } if (@hasDecl(@This(), "SpLsaModeInitializeFn")) { _ = SpLsaModeInitializeFn; } if (@hasDecl(@This(), "SpUserModeInitializeFn")) { _ = SpUserModeInitializeFn; } if (@hasDecl(@This(), "PKSEC_CREATE_CONTEXT_LIST")) { _ = PKSEC_CREATE_CONTEXT_LIST; } if (@hasDecl(@This(), "PKSEC_INSERT_LIST_ENTRY")) { _ = PKSEC_INSERT_LIST_ENTRY; } if (@hasDecl(@This(), "PKSEC_REFERENCE_LIST_ENTRY")) { _ = PKSEC_REFERENCE_LIST_ENTRY; } if (@hasDecl(@This(), "PKSEC_DEREFERENCE_LIST_ENTRY")) { _ = PKSEC_DEREFERENCE_LIST_ENTRY; } if (@hasDecl(@This(), "PKSEC_SERIALIZE_WINNT_AUTH_DATA")) { _ = PKSEC_SERIALIZE_WINNT_AUTH_DATA; } if (@hasDecl(@This(), "PKSEC_SERIALIZE_SCHANNEL_AUTH_DATA")) { _ = PKSEC_SERIALIZE_SCHANNEL_AUTH_DATA; } if (@hasDecl(@This(), "PKSEC_LOCATE_PKG_BY_ID")) { _ = PKSEC_LOCATE_PKG_BY_ID; } if (@hasDecl(@This(), "KspInitPackageFn")) { _ = KspInitPackageFn; } if (@hasDecl(@This(), "KspDeleteContextFn")) { _ = KspDeleteContextFn; } if (@hasDecl(@This(), "KspInitContextFn")) { _ = KspInitContextFn; } if (@hasDecl(@This(), "KspMakeSignatureFn")) { _ = KspMakeSignatureFn; } if (@hasDecl(@This(), "KspVerifySignatureFn")) { _ = KspVerifySignatureFn; } if (@hasDecl(@This(), "KspSealMessageFn")) { _ = KspSealMessageFn; } if (@hasDecl(@This(), "KspUnsealMessageFn")) { _ = KspUnsealMessageFn; } if (@hasDecl(@This(), "KspGetTokenFn")) { _ = KspGetTokenFn; } if (@hasDecl(@This(), "KspQueryAttributesFn")) { _ = KspQueryAttributesFn; } if (@hasDecl(@This(), "KspCompleteTokenFn")) { _ = KspCompleteTokenFn; } if (@hasDecl(@This(), "KspMapHandleFn")) { _ = KspMapHandleFn; } if (@hasDecl(@This(), "KspSetPagingModeFn")) { _ = KspSetPagingModeFn; } if (@hasDecl(@This(), "KspSerializeAuthDataFn")) { _ = KspSerializeAuthDataFn; } if (@hasDecl(@This(), "SSL_EMPTY_CACHE_FN_A")) { _ = SSL_EMPTY_CACHE_FN_A; } if (@hasDecl(@This(), "SSL_EMPTY_CACHE_FN_W")) { _ = SSL_EMPTY_CACHE_FN_W; } if (@hasDecl(@This(), "SSL_CRACK_CERTIFICATE_FN")) { _ = SSL_CRACK_CERTIFICATE_FN; } if (@hasDecl(@This(), "SSL_FREE_CERTIFICATE_FN")) { _ = SSL_FREE_CERTIFICATE_FN; } if (@hasDecl(@This(), "SslGetServerIdentityFn")) { _ = SslGetServerIdentityFn; } if (@hasDecl(@This(), "SslGetExtensionsFn")) { _ = SslGetExtensionsFn; } @setEvalBranchQuota( @import("std").meta.declarations(@This()).len * 3 ); // reference all the pub declarations if (!@import("builtin").is_test) return; inline for (@import("std").meta.declarations(@This())) |decl| { if (decl.is_pub) { _ = decl; } } }
deps/zigwin32/win32/security/authentication/identity/core.zig
const std = @import("std"); const stdx = @import("stdx"); const t = stdx.testing; const math = stdx.math; const Mat4 = math.Mat4; const Vec2 = math.Vec2; const Vec3 = math.Vec3; const Vec4 = math.Vec4; // TODO: Add transform just for 2D coords. pub const Transform = struct { mat: Mat4, const Self = @This(); pub fn initIdentity() Self { return .{ .mat = identity(), }; } pub fn initRowMajor(mat: Mat4) Self { return .{ .mat = mat, }; } pub fn getAppliedTransform(self: Transform, transform: Transform) Self { return .{ .mat = math.mul4x4_4x4(transform.mat, self.mat), }; } pub fn applyTransform(self: *Self, transform: Transform) void { self.mat = math.mul4x4_4x4(transform.mat, self.mat); } pub fn invert(self: *Self) bool { var res: Mat4 = undefined; if (!math.invert4x4(self.mat, &res)) { return false; } self.mat = res; return true; } pub fn scale(self: *Self, x: f32, y: f32) void { self.mat = math.mul4x4_4x4(getScaling(x, y), self.mat); } pub fn scale3D(self: *Self, x: f32, y: f32, z: f32) void { self.mat = math.mul4x4_4x4(getScaling3D(x, y, z), self.mat); } pub fn translate(self: *Self, x: f32, y: f32) void { self.mat = math.mul4x4_4x4(getTranslation(x, y), self.mat); } pub fn translate3D(self: *Self, x: f32, y: f32, z: f32) void { self.mat = math.mul4x4_4x4(getTranslation3D(x, y, z), self.mat); } pub fn translateVec3D(self: *Self, vec: Vec3) void { self.mat = math.mul4x4_4x4(getTranslation3D(vec.x, vec.y, vec.z), self.mat); } pub fn rotate3D(self: *Self, xvec: Vec3, yvec: Vec3, zvec: Vec3) void { self.mat = math.mul4x4_4x4(getRotation3D(xvec, yvec, zvec), self.mat); } pub fn rotateX(self: *Self, rad: f32) void { self.mat = math.mul4x4_4x4(getRotationX(rad), self.mat); } pub fn rotateY(self: *Self, rad: f32) void { self.mat = math.mul4x4_4x4(getRotationY(rad), self.mat); } pub fn rotateZ(self: *Self, rad: f32) void { self.mat = math.mul4x4_4x4(getRotationZ(rad), self.mat); } pub fn reset(self: *Self) void { self.mat = identity(); } pub fn interpolatePt(self: Self, vec: Vec2) Vec2 { const res = math.mul4x4_4x1(self.mat, [4]f32{vec.x, vec.y, 0, 1 }); return Vec2.init(res[0], res[1]); } pub fn interpolate4(self: Self, x: f32, y: f32, z: f32, w: f32) Vec4 { const res = math.mul4x4_4x1(self.mat, [4]f32{x, y, z, w }); return Vec4{ .x = res[0], .y = res[1], .z = res[2], .w = res[3] }; } pub fn interpolateVec3(self: Self, vec: Vec3) Vec3 { const res = math.mul4x4_4x1(self.mat, [4]f32{vec.x, vec.y, vec.z, 1 }); return Vec3{ .x = res[0], .y = res[1], .z = res[2] }; } pub fn interpolateVec4(self: Self, vec: Vec4) Vec4 { const res = math.mul4x4_4x1(self.mat, .{ vec.x, vec.y, vec.z, vec.w }); return .{ .x = res[0], .y = res[1], .z = res[2], .w = res[3] }; } }; pub fn identity() Mat4 { return .{ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, }; } fn getTranslation(x: f32, y: f32) Mat4 { return .{ 1, 0, 0, x, 0, 1, 0, y, 0, 0, 1, 0, 0, 0, 0, 1, }; } fn getTranslation3D(x: f32, y: f32, z: f32) Mat4 { return .{ 1, 0, 0, x, 0, 1, 0, y, 0, 0, 1, z, 0, 0, 0, 1, }; } fn getRotation3D(xvec: Vec3, yvec: Vec3, zvec: Vec3) Mat4 { return .{ xvec.x, xvec.y, xvec.z, 0, yvec.x, yvec.y, yvec.z, 0, zvec.x, zvec.y, zvec.z, 0, 0, 0, 0, 1, }; } fn getRotationX(rad: f32) Mat4 { const c = @cos(rad); const s = @sin(rad); return .{ 1, 0, 0, 0, 0, c, s, 0, 0, -s, c, 0, 0, 0, 0, 1, }; } fn getRotationY(rad: f32) Mat4 { const c = @cos(rad); const s = @sin(rad); return .{ c, 0, -s, 0, 0, 1, 0, 0, s, 0, c, 0, 0, 0, 0, 1, }; } fn getRotationZ(rad: f32) Mat4 { const c = @cos(rad); const s = @sin(rad); return .{ c, -s, 0, 0, s, c, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, }; } fn getScaling(x: f32, y: f32) Mat4 { return .{ x, 0, 0, 0, 0, y, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, }; } fn getScaling3D(x: f32, y: f32, z: f32) Mat4 { return .{ x, 0, 0, 0, 0, y, 0, 0, 0, 0, z, 0, 0, 0, 0, 1, }; } test "Interpolate" { var transform = Transform.initIdentity(); transform.translate(10, 10); try t.eq(transform.interpolateVec4(Vec4.init(0, 0, 0, 1)), Vec4.init(10, 10, 0, 1)); try t.eq(transform.interpolateVec4(Vec4.init(10, 10, 0, 1)), Vec4.init(20, 20, 0, 1)); }
graphics/src/transform.zig
const std = @import("std"); const TestContext = @import("../../src/test.zig").TestContext; const build_options = @import("build_options"); // These tests should work with all platforms, but we're using linux_x64 for // now for consistency. Will be expanded eventually. const linux_x64 = std.zig.CrossTarget{ .cpu_arch = .x86_64, .os_tag = .linux, }; pub fn addCases(ctx: *TestContext) !void { { var case = ctx.exeUsingLlvmBackend("simple addition and subtraction", linux_x64); case.addCompareOutput( \\fn add(a: i32, b: i32) i32 { \\ return a + b; \\} \\ \\pub export fn main() c_int { \\ var a: i32 = -5; \\ const x = add(a, 7); \\ var y = add(2, 0); \\ y -= x; \\ return y; \\} , ""); } { var case = ctx.exeUsingLlvmBackend("shift right + left", linux_x64); case.addCompareOutput( \\pub export fn main() c_int { \\ var i: u32 = 16; \\ assert(i >> 1, 8); \\ return 0; \\} \\fn assert(a: u32, b: u32) void { \\ if (a != b) unreachable; \\} , ""); case.addCompareOutput( \\pub export fn main() c_int { \\ var i: u32 = 16; \\ assert(i << 1, 32); \\ return 0; \\} \\fn assert(a: u32, b: u32) void { \\ if (a != b) unreachable; \\} , ""); } { var case = ctx.exeUsingLlvmBackend("llvm hello world", linux_x64); case.addCompareOutput( \\extern fn puts(s: [*:0]const u8) c_int; \\ \\pub export fn main() c_int { \\ _ = puts("hello world!"); \\ return 0; \\} , "hello world!" ++ std.cstr.line_sep); } { var case = ctx.exeUsingLlvmBackend("simple if statement", linux_x64); case.addCompareOutput( \\fn add(a: i32, b: i32) i32 { \\ return a + b; \\} \\ \\fn assert(ok: bool) void { \\ if (!ok) unreachable; \\} \\ \\pub export fn main() c_int { \\ assert(add(1,2) == 3); \\ return 0; \\} , ""); } { var case = ctx.exeUsingLlvmBackend("blocks", linux_x64); case.addCompareOutput( \\fn assert(ok: bool) void { \\ if (!ok) unreachable; \\} \\ \\fn foo(ok: bool) i32 { \\ const val: i32 = blk: { \\ var x: i32 = 1; \\ if (!ok) break :blk x + 9; \\ break :blk x + 19; \\ }; \\ return val + 10; \\} \\ \\pub export fn main() c_int { \\ assert(foo(false) == 20); \\ assert(foo(true) == 30); \\ return 0; \\} , ""); } { var case = ctx.exeUsingLlvmBackend("nested blocks", linux_x64); case.addCompareOutput( \\fn assert(ok: bool) void { \\ if (!ok) unreachable; \\} \\ \\fn foo(ok: bool) i32 { \\ var val: i32 = blk: { \\ const val2: i32 = another: { \\ if (!ok) break :blk 10; \\ break :another 10; \\ }; \\ break :blk val2 + 10; \\ }; \\ return val; \\} \\ \\pub export fn main() c_int { \\ assert(foo(false) == 10); \\ assert(foo(true) == 20); \\ return 0; \\} , ""); } { var case = ctx.exeUsingLlvmBackend("while loops", linux_x64); case.addCompareOutput( \\fn assert(ok: bool) void { \\ if (!ok) unreachable; \\} \\ \\pub export fn main() c_int { \\ var sum: u32 = 0; \\ var i: u32 = 0; \\ while (i < 5) : (i += 1) { \\ sum += i; \\ } \\ assert(sum == 10); \\ assert(i == 5); \\ return 0; \\} , ""); } { var case = ctx.exeUsingLlvmBackend("optionals", linux_x64); case.addCompareOutput( \\fn assert(ok: bool) void { \\ if (!ok) unreachable; \\} \\ \\pub export fn main() c_int { \\ var opt_val: ?i32 = 10; \\ var null_val: ?i32 = null; \\ \\ var val1: i32 = opt_val.?; \\ const val1_1: i32 = opt_val.?; \\ var ptr_val1 = &(opt_val.?); \\ const ptr_val1_1 = &(opt_val.?); \\ \\ var val2: i32 = null_val orelse 20; \\ const val2_2: i32 = null_val orelse 20; \\ \\ var value: i32 = 20; \\ var ptr_val2 = &(null_val orelse value); \\ \\ const val3 = opt_val orelse 30; \\ var val3_var = opt_val orelse 30; \\ \\ assert(val1 == 10); \\ assert(val1_1 == 10); \\ assert(ptr_val1.* == 10); \\ assert(ptr_val1_1.* == 10); \\ \\ assert(val2 == 20); \\ assert(val2_2 == 20); \\ assert(ptr_val2.* == 20); \\ \\ assert(val3 == 10); \\ assert(val3_var == 10); \\ \\ (null_val orelse val2) = 1234; \\ assert(val2 == 1234); \\ \\ (opt_val orelse val2) = 5678; \\ assert(opt_val.? == 5678); \\ \\ return 0; \\} , ""); } { var case = ctx.exeUsingLlvmBackend("for loop", linux_x64); case.addCompareOutput( \\fn assert(ok: bool) void { \\ if (!ok) unreachable; \\} \\ \\pub export fn main() c_int { \\ var x: u32 = 0; \\ for ("hello") |_| { \\ x += 1; \\ } \\ assert("hello".len == x); \\ return 0; \\} , ""); } { var case = ctx.exeUsingLlvmBackend("@rem", linux_x64); case.addCompareOutput( \\fn assert(ok: bool) void { \\ if (!ok) unreachable; \\} \\fn rem(lhs: i32, rhs: i32, expected: i32) bool { \\ return @rem(lhs, rhs) == expected; \\} \\pub export fn main() c_int { \\ assert(rem(-5, 3, -2)); \\ assert(rem(5, 3, 2)); \\ return 0; \\} , ""); } { var case = ctx.exeUsingLlvmBackend("invalid address space coercion", linux_x64); case.addError( \\fn entry(a: *addrspace(.gs) i32) *i32 { \\ return a; \\} \\pub export fn main() void { _ = entry; } , &[_][]const u8{ ":2:12: error: expected *i32, found *addrspace(.gs) i32", }); } { var case = ctx.exeUsingLlvmBackend("pointer keeps address space", linux_x64); case.compiles( \\fn entry(a: *addrspace(.gs) i32) *addrspace(.gs) i32 { \\ return a; \\} \\pub export fn main() void { _ = entry; } ); } { var case = ctx.exeUsingLlvmBackend("pointer to explicit generic address space coerces to implicit pointer", linux_x64); case.compiles( \\fn entry(a: *addrspace(.generic) i32) *i32 { \\ return a; \\} \\pub export fn main() void { _ = entry; } ); } { var case = ctx.exeUsingLlvmBackend("pointers with different address spaces", linux_x64); case.addError( \\fn entry(a: *addrspace(.gs) i32) *addrspace(.fs) i32 { \\ return a; \\} \\pub export fn main() void { _ = entry; } , &[_][]const u8{ ":2:12: error: expected *addrspace(.fs) i32, found *addrspace(.gs) i32", }); } { var case = ctx.exeUsingLlvmBackend("pointers with different address spaces", linux_x64); case.addError( \\fn entry(a: ?*addrspace(.gs) i32) *i32 { \\ return a.?; \\} \\pub export fn main() void { _ = entry; } , &[_][]const u8{ ":2:13: error: expected *i32, found *addrspace(.gs) i32", }); } { var case = ctx.exeUsingLlvmBackend("invalid pointer keeps address space when taking address of dereference", linux_x64); case.addError( \\fn entry(a: *addrspace(.gs) i32) *i32 { \\ return &a.*; \\} \\pub export fn main() void { _ = entry; } , &[_][]const u8{ ":2:12: error: expected *i32, found *addrspace(.gs) i32", }); } { var case = ctx.exeUsingLlvmBackend("pointer keeps address space when taking address of dereference", linux_x64); case.compiles( \\fn entry(a: *addrspace(.gs) i32) *addrspace(.gs) i32 { \\ return &a.*; \\} \\pub export fn main() void { _ = entry; } ); } { var case = ctx.exeUsingLlvmBackend("address spaces pointer access chaining: array pointer", linux_x64); case.compiles( \\fn entry(a: *addrspace(.gs) [1]i32) *addrspace(.gs) i32 { \\ return &a[0]; \\} \\pub export fn main() void { _ = entry; } ); } { var case = ctx.exeUsingLlvmBackend("address spaces pointer access chaining: pointer to optional array", linux_x64); case.compiles( \\fn entry(a: *addrspace(.gs) ?[1]i32) *addrspace(.gs) i32 { \\ return &a.*.?[0]; \\} \\pub export fn main() void { _ = entry; } ); } { var case = ctx.exeUsingLlvmBackend("address spaces pointer access chaining: struct pointer", linux_x64); case.compiles( \\const A = struct{ a: i32 }; \\fn entry(a: *addrspace(.gs) A) *addrspace(.gs) i32 { \\ return &a.a; \\} \\pub export fn main() void { _ = entry; } ); } { var case = ctx.exeUsingLlvmBackend("address spaces pointer access chaining: complex", linux_x64); case.compiles( \\const A = struct{ a: ?[1]i32 }; \\fn entry(a: *addrspace(.gs) [1]A) *addrspace(.gs) i32 { \\ return &a[0].a.?[0]; \\} \\pub export fn main() void { _ = entry; } ); } { var case = ctx.exeUsingLlvmBackend("dereferencing through multiple pointers with address spaces", linux_x64); case.compiles( \\fn entry(a: *addrspace(.fs) *addrspace(.gs) *i32) *i32 { \\ return a.*.*; \\} \\pub export fn main() void { _ = entry; } ); } { var case = ctx.exeUsingLlvmBackend("f segment address space reading and writing", linux_x64); case.addCompareOutput( \\fn assert(ok: bool) void { \\ if (!ok) unreachable; \\} \\ \\fn setFs(value: c_ulong) void { \\ asm volatile ( \\ \\syscall \\ : \\ : [number] "{rax}" (158), \\ [code] "{rdi}" (0x1002), \\ [val] "{rsi}" (value), \\ : "rcx", "r11", "memory" \\ ); \\} \\ \\fn getFs() c_ulong { \\ var result: c_ulong = undefined; \\ asm volatile ( \\ \\syscall \\ : \\ : [number] "{rax}" (158), \\ [code] "{rdi}" (0x1003), \\ [ptr] "{rsi}" (@ptrToInt(&result)), \\ : "rcx", "r11", "memory" \\ ); \\ return result; \\} \\ \\var test_value: u64 = 12345; \\ \\pub export fn main() c_int { \\ const orig_fs = getFs(); \\ \\ setFs(@ptrToInt(&test_value)); \\ assert(getFs() == @ptrToInt(&test_value)); \\ \\ var test_ptr = @intToPtr(*allowzero addrspace(.fs) u64, 0); \\ assert(test_ptr.* == 12345); \\ test_ptr.* = 98765; \\ assert(test_value == 98765); \\ \\ setFs(orig_fs); \\ return 0; \\} , ""); } }
test/stage2/llvm.zig
const std = @import("std"); usingnamespace @import("common.zig"); const response_parser = @import("../main.zig").parser.response; pub const ResponseParser = response_parser.ResponseParser; pub const PayloadEvent = response_parser.PayloadEvent; pub const StatusEvent = response_parser.StatusEvent; pub const Event = response_parser.Event; const ascii = std.ascii; const mem = std.mem; const assert = std.debug.assert; pub fn create(buffer: []u8, reader: anytype, writer: anytype) BaseClient(@TypeOf(reader), @TypeOf(writer)) { // Any buffer smaller than 16 cannot read the most simple status line (1xx A HTTP/1.1\r\n) assert(buffer.len >= 16); return BaseClient(@TypeOf(reader), @TypeOf(writer)).init(buffer, reader, writer); } pub fn BaseClient(comptime Reader: type, comptime Writer: type) type { const ParserType = ResponseParser(Reader); return struct { const Self = @This(); encoding: TransferEncoding = .unknown, head_finished: bool = false, read_buffer: []u8, parser: ParserType, writer: Writer, payload_size: usize = 0, payload_index: usize = 0, // Whether a reader is currently using the read_buffer. if true, parser.next should NOT be called since the // reader expects all of the data. self_contained: bool = false, pub fn init(buffer: []u8, input: Reader, output: Writer) Self { return .{ .read_buffer = buffer, .parser = ParserType.init(buffer, input), .writer = output, }; } pub fn reset(self: *Self) void { self.encoding = .unknown; self.head_finished = false; self.parser.reset(); self.payload_size = 0; self.payload_index = 0; self.self_contained = false; } pub fn writeStatusLine(self: *Self, method: []const u8, path: []const u8) Writer.Error!void { assert(!self.head_finished); try self.writer.writeAll(method); try self.writer.writeAll(" "); try self.writer.writeAll(path); try self.writer.writeAll(" HTTP/1.1\r\n"); } // This makes interacting with URI parsers like Vexu/zuri much nicer, because you don't need to reconstruct the path. pub fn writeStatusLineParts(self: *Self, method: []const u8, path: []const u8, query: ?[]const u8, fragment: ?[]const u8) Writer.Error!void { assert(!self.head_finished); try self.writer.writeAll(method); try self.writer.writeAll(" "); try self.writer.writeAll(path); if (query) |qs| { try self.writer.writeAll("?"); try self.writer.writeAll(qs); } if (fragment) |frag| { try self.writer.writeAll("#"); try self.writer.writeAll(frag); } try self.writer.writeAll(" HTTP/1.1\r\n"); } pub fn writeHeaderValue(self: *Self, name: []const u8, value: []const u8) Writer.Error!void { assert(!self.head_finished); // This should also guarantee that the value is actually chunked if (ascii.eqlIgnoreCase(name, "transfer-encoding")) { self.encoding = .chunked; } else if (ascii.eqlIgnoreCase(name, "content-length")) { self.encoding = .content_length; } try self.writer.writeAll(name); try self.writer.writeAll(": "); try self.writer.writeAll(value); try self.writer.writeAll("\r\n"); } pub fn writeHeaderFormat(self: *Self, name: []const u8, comptime format: []const u8, args: anytype) Writer.Error!void { assert(!self.head_finished); // This should also guarantee that the value is actually chunked if (ascii.eqlIgnoreCase(name, "transfer-encoding")) { self.encoding = .chunked; } else if (ascii.eqlIgnoreCase(name, "content-length")) { self.encoding = .content_length; } try self.writer.writeAll(name); try self.writer.writeAll(": "); try self.writer.print(format, args); try self.writer.writeAll("\r\n"); } pub fn writeHeader(self: *Self, header: Header) callconv(.Inline) Writer.Error!void { assert(!self.head_finished); try self.writeHeaderValue(header.name, header.value); } pub fn writeHeaders(self: *Self, headers: HeadersSlice) callconv(.Inline) Writer.Error!void { assert(!self.head_finished); for (headers) |header| { try self.writeHeader(header); } } pub fn finishHeaders(self: *Self) callconv(.Inline) Writer.Error!void { if (!self.head_finished) try self.writer.writeAll("\r\n"); self.head_finished = true; } pub fn writePayload(self: *Self, data: ?[]const u8) Writer.Error!void { switch (self.encoding) { .unknown, .content_length => { if (data) |payload| { try self.writer.writeAll(payload); } }, .chunked => { if (data) |payload| { try std.fmt.formatInt(payload.len, 16, false, .{}, self.writer); try self.writer.writeAll("\r\n"); try self.writer.writeAll(payload); try self.writer.writeAll("\r\n"); } else { try self.writer.writeAll("0\r\n"); } }, } } pub const NextError = ParserType.NextError; pub fn next(self: *Self) callconv(.Inline) NextError!?Event { assert(!self.self_contained); return self.parser.next(); } pub fn readNextHeader(self: *Self, buffer: []u8) callconv(.Inline) NextError!?Header { if (self.parser.state != .header) return null; assert(!self.self_contained); if (try self.parser.next()) |event| { switch (event) { .head_done, .end => return null, .header => |header| return header, .status, .payload, .skip, => unreachable, } } } pub const Chunk = PayloadEvent; pub fn readNextChunk(self: *Self, buffer: []u8) callconv(.Inline) NextError!?Chunk { if (self.parser.state != .body) return null; assert(!self.self_contained); if (try self.parser.next()) |event| { switch (event) { .payload => |chunk| return chunk, .skip, .end => return null, .status, .header, .head_done, => unreachable, } } } pub fn readNextChunkBuffer(self: *Self, buffer: []u8) NextError!usize { if (self.parser.state != .body) return 0; self.self_contained = true; if (self.payload_index >= self.payload_size) { if (try self.parser.next()) |event| { switch (event) { .payload => |chunk| { self.payload_index = 0; self.payload_size = chunk.data.len; }, .skip, .end => { self.self_contained = false; self.payload_index = 0; self.payload_size = 0; return 0; }, .status, .header, .head_done, => unreachable, } } else { self.self_contained = false; self.payload_index = 0; self.payload_size = 0; return 0; } } const start = self.payload_index; const size = std.math.min(buffer.len, self.payload_size - start); const end = start + size; mem.copy(u8, buffer[0..size], self.read_buffer[start..end]); self.payload_index = end; return size; } pub const PayloadReader = std.io.Reader(*Self, NextError, readNextChunkBuffer); pub fn reader(self: *Self) PayloadReader { assert(self.parser.state == .body); return .{ .context = self }; } }; } const testing = std.testing; const io = std.io; fn testNextField(parser: anytype, expected: ?Event) !void { const actual = try parser.next(); testing.expect(@import("../parser/common.zig").reworkedMetaEql(actual, expected)); } test "decodes a simple response" { var read_buffer: [32]u8 = undefined; var output = std.ArrayList(u8).init(testing.allocator); defer output.deinit(); var response = "HTTP/1.1 404 Not Found\r\nHost: localhost\r\nContent-Length: 4\r\n\r\ngood"; var expected = "GET / HTTP/1.1\r\nHeader1: value1\r\nHeader2: value2\r\nHeader3: value3\r\nHeader4: value4\r\n\r\npayload"; var reader = io.fixedBufferStream(response).reader(); var writer = output.writer(); var client = create(&read_buffer, reader, writer); const headers = [_]Header{ Header{ .name = "Header3", .value = "value3" }, Header{ .name = "Header4", .value = "value4" }, }; try client.writeStatusLine("GET", "/"); try client.writeHeaderValue("Header1", "value1"); try client.writeHeader(.{ .name = "Header2", .value = "value2" }); try client.writeHeaders(std.mem.span(&headers)); try client.finishHeaders(); try client.writePayload("payload"); testing.expectEqualStrings(output.items, expected); try testNextField(&client, .{ .status = .{ .version = .{ .major = 1, .minor = 1, }, .code = 404, .reason = "Not Found", }, }); try testNextField(&client, .{ .header = .{ .name = "Host", .value = "localhost", }, }); try testNextField(&client, .{ .header = .{ .name = "Content-Length", .value = "4", }, }); try testNextField(&client, Event.head_done); var payload_reader = client.reader(); var slice = try payload_reader.readAllAlloc(testing.allocator, 16); defer testing.allocator.free(slice); testing.expectEqualStrings(slice, "good"); } comptime { std.testing.refAllDecls(@This()); }
src/base/client.zig
const std = @import("std"); const utils = @import("utils.zig"); const testing = std.testing; const debug = std.debug.print; const any = utils.any; pub const TokenType = enum { invalid, eof, eos, value, keyword_node, keyword_edge, keyword_group, keyword_layer, identifier, single_line_comment, brace_start, brace_end, colon, equal, string, include, }; pub const Token = struct { typ: TokenType, start: u64, end: u64, slice: []const u8, // Requires source buf to be available }; pub const Tokenizer = struct { const State = enum { start, string, include, identifier_or_keyword, single_line_comment, f_slash, }; buf: []const u8, pos: u64 = 0, pub fn init(buffer: []const u8) Tokenizer { return Tokenizer{ .buf = buffer, }; } pub fn nextToken(self: *Tokenizer) Token { var result = Token{ .typ = .eof, .start = self.pos, .end = undefined, .slice = undefined, }; var state: State = .start; while (self.pos < self.buf.len) : (self.pos += 1) { const c = self.buf[self.pos]; switch (state) { .start => { result.start = self.pos; switch (c) { '/' => { state = .f_slash; }, '"' => { state = .string; result.start = self.pos + 1; }, '{' => { result.typ = .brace_start; self.pos += 1; result.end = self.pos; break; }, '}' => { result.typ = .brace_end; self.pos += 1; result.end = self.pos; break; }, ':' => { result.typ = .colon; self.pos += 1; result.end = self.pos; break; }, '=' => { result.typ = .equal; self.pos += 1; result.end = self.pos; break; }, ';' => { result.typ = .eos; self.pos += 1; result.end = self.pos; break; }, // Whitespace of any kind are separators ' ', '\t', '\n', '\r' => { result.start = self.pos + 1; }, '@' => { state = .include; result.typ = .include; }, else => { // Any character not specifically intended for something else is a valid identifier-character result.typ = .identifier; // will be overridden if it turns out to be a keyword state = .identifier_or_keyword; }, } }, .string => { switch (c) { '"' => { // Ignore escaped "'s if (self.buf[self.pos - 1] == '\\') continue; result.end = self.pos; result.typ = .string; self.pos += 1; break; }, else => {}, } }, .identifier_or_keyword => { switch (c) { // Anything that's not whitespace, special reserver character or eos is a valid identifier '\n', '\t', ' ', '\r', ';', '{', '}', '(', ')', ':', '=' => { result.end = self.pos; result.typ = keywordOrIdentifier(self.buf[result.start..result.end]); break; }, else => {}, } }, .f_slash => { switch (c) { '/' => state = .single_line_comment, else => { // Currently unknown token TODO: Error? break; }, } }, .single_line_comment => { // Spin until end of line switch (c) { '\n', '\r' => { state = .start; }, else => {}, } }, .include => { // Spin until end of line / buffer switch (c) { '\n', '\r' => { result.end = self.pos; self.pos += 1; break; }, else => {}, } }, } } else { // end of "file" result.end = self.pos; if (state == .identifier_or_keyword) { result.typ = keywordOrIdentifier(self.buf[result.start..result.end]); } } result.slice = self.buf[result.start..result.end]; return result; } }; const keyword_map = .{ .{ "node", TokenType.keyword_node }, .{ "edge", TokenType.keyword_edge }, .{ "group", TokenType.keyword_group }, .{ "layer", TokenType.keyword_layer }, }; /// Evaluates a string against a known set of supported keywords fn keywordOrIdentifier(value: []const u8) TokenType { inline for (keyword_map) |kv| { if (std.mem.eql(u8, value, kv[0])) { return kv[1]; } } return TokenType.identifier; } test "keywordOrIdentifier" { try testing.expectEqual(TokenType.keyword_edge, keywordOrIdentifier("edge")); try testing.expectEqual(TokenType.identifier, keywordOrIdentifier("edgeish")); } /// For tests fn expectTokens(buf: []const u8, expected_tokens: []const TokenType) !void { var tokenizer = Tokenizer.init(buf); for (expected_tokens) |expected_token, i| { const found_token = tokenizer.nextToken(); testing.expectEqual(expected_token, found_token.typ) catch |e| { debug("Expected token[{d}] {s}, got {s}:\n\n", .{ i, expected_token, found_token.typ }); debug(" ({d}-{d}): '{s}'\n", .{ found_token.start, found_token.end, buf[found_token.start..found_token.end] }); return e; }; } } test "tokenizer tokenizes empty string" { try expectTokens("", &[_]TokenType{.eof}); } test "tokenizer tokenizes string-tokens" { try expectTokens( \\"string here" , &[_]TokenType{ .string, .eof }); } test "tokenizer tokenizes identifier" { try expectTokens( \\unquoted_word_without_white-space , &[_]TokenType{ .identifier, .eof }); } test "tokenizer tokenizes keyword" { try expectTokens( \\node edge group layer , &[_]TokenType{ .keyword_node, .keyword_edge, .keyword_group, .keyword_layer, .eof }); } test "tokenizer tokenizes import-statements" { var buf = "@somefile.daya"; try expectTokens(buf, &[_]TokenType{.include}); } test "tokenize exploration" { var buf = \\node Module { \\ label="My module"; \\} \\ \\// Comment here \\edge relates_to { \\ label="relates to"; \\ color=#ffffff; \\} \\ \\edge owns; \\ \\ModuleA: Module; \\ModuleB: Module; \\ \\ModuleA relates_to ModuleB; \\ModuleB owns ModuleA { \\ label="overridden label here"; \\} \\ ; try expectTokens(buf, &[_]TokenType{ // node Module {...} .keyword_node, .identifier, .brace_start, .identifier, .equal, .string, .eos, .brace_end, // edge relates_to {...} .keyword_edge, .identifier, .brace_start, .identifier, .equal, .string, .eos, .identifier, .equal, .identifier, .eos, .brace_end, // edge owns; .keyword_edge, .identifier, .eos, // Instantations .identifier, .colon, .identifier, .eos, .identifier, .colon, .identifier, .eos, // Relationships // ModuleA relates_to ModuleB .identifier, .identifier, .identifier, .eos, // ModuleB owns ModuleA .identifier, .identifier, .identifier, .brace_start, .identifier, .equal, .string, .eos, .brace_end, .eof, }); } pub fn dump(buf: []const u8) void { var tokenizer = Tokenizer.init(buf); var i: usize = 0; while (true) : (i += 1) { var token = tokenizer.nextToken(); var start = utils.idxToLineCol(buf[0..], token.start); debug("token[{d:>2}] ({d:>2}:{d:<2}): {s:<16} -> {s}\n", .{ i, start.line, start.col, @tagName(token.typ), token.slice }); if (token.typ == .eof) break; } }
libdaya/src/tokenizer.zig
// This file is generated from the Khronos Vulkan XML API registry const std = @import("std"); const builtin = @import("builtin"); const root = @import("root"); pub const vulkan_call_conv: std.builtin.CallingConvention = if (builtin.os.tag == .windows and builtin.cpu.arch == .i386) .Stdcall else if (builtin.abi == .android and (builtin.cpu.arch.isARM() or builtin.cpu.arch.isThumb()) and std.Target.arm.featureSetHas(builtin.cpu.features, .has_v7) and builtin.cpu.arch.ptrBitWidth() == 32) // On Android 32-bit ARM targets, Vulkan functions use the "hardfloat" // calling convention, i.e. float parameters are passed in registers. This // is true even if the rest of the application passes floats on the stack, // as it does by default when compiling for the armeabi-v7a NDK ABI. .AAPCSVFP else .C; pub fn FlagsMixin(comptime FlagsType: type, comptime Int: type) type { return struct { pub const IntType = Int; pub fn toInt(self: FlagsType) IntType { return @bitCast(IntType, self); } pub fn fromInt(flags: IntType) FlagsType { return @bitCast(FlagsType, flags); } pub fn merge(lhs: FlagsType, rhs: FlagsType) FlagsType { return fromInt(toInt(lhs) | toInt(rhs)); } pub fn intersect(lhs: FlagsType, rhs: FlagsType) FlagsType { return fromInt(toInt(lhs) & toInt(rhs)); } pub fn subtract(lhs: FlagsType, rhs: FlagsType) FlagsType { return fromInt(toInt(lhs) & toInt(rhs.complement())); } pub fn contains(lhs: FlagsType, rhs: FlagsType) bool { return toInt(intersect(lhs, rhs)) == toInt(rhs); } }; } pub fn makeApiVersion(variant: u3, major: u7, minor: u10, patch: u12) u32 { return (@as(u32, variant) << 29) | (@as(u32, major) << 22) | (@as(u32, minor) << 12) | patch; } pub fn apiVersionVariant(version: u32) u3 { return @truncate(u3, version >> 29); } pub fn apiVersionMajor(version: u32) u7 { return @truncate(u7, version >> 22); } pub fn apiVersionMinor(version: u32) u10 { return @truncate(u10, version >> 12); } pub fn apiVersionPatch(version: u32) u12 { return @truncate(u12, version); } pub const MAX_PHYSICAL_DEVICE_NAME_SIZE = 256; pub const UUID_SIZE = 16; pub const LUID_SIZE = 8; pub const LUID_SIZE_KHR = LUID_SIZE; pub const MAX_EXTENSION_NAME_SIZE = 256; pub const MAX_DESCRIPTION_SIZE = 256; pub const MAX_MEMORY_TYPES = 32; pub const MAX_MEMORY_HEAPS = 16; pub const LOD_CLAMP_NONE = @as(f32, 1000.0); pub const REMAINING_MIP_LEVELS = ~@as(u32, 0); pub const REMAINING_ARRAY_LAYERS = ~@as(u32, 0); pub const WHOLE_SIZE = ~@as(u64, 0); pub const ATTACHMENT_UNUSED = ~@as(u32, 0); pub const TRUE = 1; pub const FALSE = 0; pub const QUEUE_FAMILY_IGNORED = ~@as(u32, 0); pub const QUEUE_FAMILY_EXTERNAL = ~@as(u32, 1); pub const QUEUE_FAMILY_EXTERNAL_KHR = QUEUE_FAMILY_EXTERNAL; pub const QUEUE_FAMILY_FOREIGN_EXT = ~@as(u32, 2); pub const SUBPASS_EXTERNAL = ~@as(u32, 0); pub const MAX_DEVICE_GROUP_SIZE = 32; pub const MAX_DEVICE_GROUP_SIZE_KHR = MAX_DEVICE_GROUP_SIZE; pub const MAX_DRIVER_NAME_SIZE = 256; pub const MAX_DRIVER_NAME_SIZE_KHR = MAX_DRIVER_NAME_SIZE; pub const MAX_DRIVER_INFO_SIZE = 256; pub const MAX_DRIVER_INFO_SIZE_KHR = MAX_DRIVER_INFO_SIZE; pub const SHADER_UNUSED_KHR = ~@as(u32, 0); pub const SHADER_UNUSED_NV = SHADER_UNUSED_KHR; pub const API_VERSION_1_0 = makeApiVersion(0, 1, 0, 0); pub const API_VERSION_1_1 = makeApiVersion(0, 1, 1, 0); pub const API_VERSION_1_2 = makeApiVersion(0, 1, 2, 0); pub const HEADER_VERSION = 177; pub const HEADER_VERSION_COMPLETE = makeApiVersion(0, 1, 2, HEADER_VERSION); pub const Display = if (@hasDecl(root, "Display")) root.Display else opaque {}; pub const VisualID = if (@hasDecl(root, "VisualID")) root.VisualID else c_uint; pub const Window = if (@hasDecl(root, "Window")) root.Window else c_ulong; pub const RROutput = if (@hasDecl(root, "RROutput")) root.RROutput else c_ulong; pub const wl_display = if (@hasDecl(root, "wl_display")) root.wl_display else opaque {}; pub const wl_surface = if (@hasDecl(root, "wl_surface")) root.wl_surface else opaque {}; pub const HINSTANCE = if (@hasDecl(root, "HINSTANCE")) root.HINSTANCE else std.os.HINSTANCE; pub const HWND = if (@hasDecl(root, "HWND")) root.HWND else *opaque {}; pub const HMONITOR = if (@hasDecl(root, "HMONITOR")) root.HMONITOR else *opaque {}; pub const HANDLE = if (@hasDecl(root, "HANDLE")) root.HANDLE else std.os.HANDLE; pub const SECURITY_ATTRIBUTES = if (@hasDecl(root, "SECURITY_ATTRIBUTES")) root.SECURITY_ATTRIBUTES else std.os.SECURITY_ATTRIBUTES; pub const DWORD = if (@hasDecl(root, "DWORD")) root.DWORD else std.os.DWORD; pub const LPCWSTR = if (@hasDecl(root, "LPCWSTR")) root.LPCWSTR else std.os.LPCWSTR; pub const xcb_connection_t = if (@hasDecl(root, "xcb_connection_t")) root.xcb_connection_t else opaque {}; pub const xcb_visualid_t = if (@hasDecl(root, "xcb_visualid_t")) root.xcb_visualid_t else u32; pub const xcb_window_t = if (@hasDecl(root, "xcb_window_t")) root.xcb_window_t else u32; pub const IDirectFB = if (@hasDecl(root, "IDirectFB")) root.IDirectFB else @compileError("Missing type definition of 'IDirectFB'"); pub const IDirectFBSurface = if (@hasDecl(root, "IDirectFBSurface")) root.IDirectFBSurface else @compileError("Missing type definition of 'IDirectFBSurface'"); pub const zx_handle_t = if (@hasDecl(root, "zx_handle_t")) root.zx_handle_t else u32; pub const GgpStreamDescriptor = if (@hasDecl(root, "GgpStreamDescriptor")) root.GgpStreamDescriptor else @compileError("Missing type definition of 'GgpStreamDescriptor'"); pub const GgpFrameToken = if (@hasDecl(root, "GgpFrameToken")) root.GgpFrameToken else @compileError("Missing type definition of 'GgpFrameToken'"); pub const _screen_context = if (@hasDecl(root, "_screen_context")) root._screen_context else opaque {}; pub const _screen_window = if (@hasDecl(root, "_screen_window")) root._screen_window else opaque {}; pub const ANativeWindow = opaque {}; pub const AHardwareBuffer = opaque {}; pub const CAMetalLayer = opaque {}; pub const SampleMask = u32; pub const Bool32 = u32; pub const Flags = u32; pub const Flags64 = u64; pub const DeviceSize = u64; pub const DeviceAddress = u64; pub const QueryPoolCreateFlags = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(QueryPoolCreateFlags, Flags); }; pub const PipelineLayoutCreateFlags = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(PipelineLayoutCreateFlags, Flags); }; pub const PipelineDepthStencilStateCreateFlags = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(PipelineDepthStencilStateCreateFlags, Flags); }; pub const PipelineDynamicStateCreateFlags = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(PipelineDynamicStateCreateFlags, Flags); }; pub const PipelineColorBlendStateCreateFlags = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(PipelineColorBlendStateCreateFlags, Flags); }; pub const PipelineMultisampleStateCreateFlags = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(PipelineMultisampleStateCreateFlags, Flags); }; pub const PipelineRasterizationStateCreateFlags = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(PipelineRasterizationStateCreateFlags, Flags); }; pub const PipelineViewportStateCreateFlags = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(PipelineViewportStateCreateFlags, Flags); }; pub const PipelineTessellationStateCreateFlags = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(PipelineTessellationStateCreateFlags, Flags); }; pub const PipelineInputAssemblyStateCreateFlags = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(PipelineInputAssemblyStateCreateFlags, Flags); }; pub const PipelineVertexInputStateCreateFlags = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(PipelineVertexInputStateCreateFlags, Flags); }; pub const BufferViewCreateFlags = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(BufferViewCreateFlags, Flags); }; pub const InstanceCreateFlags = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(InstanceCreateFlags, Flags); }; pub const DeviceCreateFlags = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(DeviceCreateFlags, Flags); }; pub const SemaphoreCreateFlags = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(SemaphoreCreateFlags, Flags); }; pub const MemoryMapFlags = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(MemoryMapFlags, Flags); }; pub const DescriptorPoolResetFlags = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(DescriptorPoolResetFlags, Flags); }; pub const GeometryFlagsNV = GeometryFlagsKHR; pub const GeometryInstanceFlagsNV = GeometryInstanceFlagsKHR; pub const BuildAccelerationStructureFlagsNV = BuildAccelerationStructureFlagsKHR; pub const DescriptorUpdateTemplateCreateFlags = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(DescriptorUpdateTemplateCreateFlags, Flags); }; pub const DescriptorUpdateTemplateCreateFlagsKHR = DescriptorUpdateTemplateCreateFlags; pub const SemaphoreWaitFlagsKHR = SemaphoreWaitFlags; pub const DisplayModeCreateFlagsKHR = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(DisplayModeCreateFlagsKHR, Flags); }; pub const DisplaySurfaceCreateFlagsKHR = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(DisplaySurfaceCreateFlagsKHR, Flags); }; pub const AndroidSurfaceCreateFlagsKHR = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(AndroidSurfaceCreateFlagsKHR, Flags); }; pub const ViSurfaceCreateFlagsNN = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(ViSurfaceCreateFlagsNN, Flags); }; pub const WaylandSurfaceCreateFlagsKHR = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(WaylandSurfaceCreateFlagsKHR, Flags); }; pub const Win32SurfaceCreateFlagsKHR = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(Win32SurfaceCreateFlagsKHR, Flags); }; pub const XlibSurfaceCreateFlagsKHR = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(XlibSurfaceCreateFlagsKHR, Flags); }; pub const XcbSurfaceCreateFlagsKHR = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(XcbSurfaceCreateFlagsKHR, Flags); }; pub const DirectFBSurfaceCreateFlagsEXT = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(DirectFBSurfaceCreateFlagsEXT, Flags); }; pub const IOSSurfaceCreateFlagsMVK = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(IOSSurfaceCreateFlagsMVK, Flags); }; pub const MacOSSurfaceCreateFlagsMVK = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(MacOSSurfaceCreateFlagsMVK, Flags); }; pub const MetalSurfaceCreateFlagsEXT = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(MetalSurfaceCreateFlagsEXT, Flags); }; pub const ImagePipeSurfaceCreateFlagsFUCHSIA = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(ImagePipeSurfaceCreateFlagsFUCHSIA, Flags); }; pub const StreamDescriptorSurfaceCreateFlagsGGP = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(StreamDescriptorSurfaceCreateFlagsGGP, Flags); }; pub const HeadlessSurfaceCreateFlagsEXT = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(HeadlessSurfaceCreateFlagsEXT, Flags); }; pub const ScreenSurfaceCreateFlagsQNX = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(ScreenSurfaceCreateFlagsQNX, Flags); }; pub const PeerMemoryFeatureFlagsKHR = PeerMemoryFeatureFlags; pub const MemoryAllocateFlagsKHR = MemoryAllocateFlags; pub const CommandPoolTrimFlags = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(CommandPoolTrimFlags, Flags); }; pub const CommandPoolTrimFlagsKHR = CommandPoolTrimFlags; pub const ExternalMemoryHandleTypeFlagsKHR = ExternalMemoryHandleTypeFlags; pub const ExternalMemoryFeatureFlagsKHR = ExternalMemoryFeatureFlags; pub const ExternalSemaphoreHandleTypeFlagsKHR = ExternalSemaphoreHandleTypeFlags; pub const ExternalSemaphoreFeatureFlagsKHR = ExternalSemaphoreFeatureFlags; pub const SemaphoreImportFlagsKHR = SemaphoreImportFlags; pub const ExternalFenceHandleTypeFlagsKHR = ExternalFenceHandleTypeFlags; pub const ExternalFenceFeatureFlagsKHR = ExternalFenceFeatureFlags; pub const FenceImportFlagsKHR = FenceImportFlags; pub const PipelineViewportSwizzleStateCreateFlagsNV = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(PipelineViewportSwizzleStateCreateFlagsNV, Flags); }; pub const PipelineDiscardRectangleStateCreateFlagsEXT = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(PipelineDiscardRectangleStateCreateFlagsEXT, Flags); }; pub const PipelineCoverageToColorStateCreateFlagsNV = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(PipelineCoverageToColorStateCreateFlagsNV, Flags); }; pub const PipelineCoverageModulationStateCreateFlagsNV = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(PipelineCoverageModulationStateCreateFlagsNV, Flags); }; pub const PipelineCoverageReductionStateCreateFlagsNV = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(PipelineCoverageReductionStateCreateFlagsNV, Flags); }; pub const ValidationCacheCreateFlagsEXT = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(ValidationCacheCreateFlagsEXT, Flags); }; pub const DebugUtilsMessengerCreateFlagsEXT = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(DebugUtilsMessengerCreateFlagsEXT, Flags); }; pub const DebugUtilsMessengerCallbackDataFlagsEXT = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(DebugUtilsMessengerCallbackDataFlagsEXT, Flags); }; pub const DeviceMemoryReportFlagsEXT = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(DeviceMemoryReportFlagsEXT, Flags); }; pub const PipelineRasterizationConservativeStateCreateFlagsEXT = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(PipelineRasterizationConservativeStateCreateFlagsEXT, Flags); }; pub const DescriptorBindingFlagsEXT = DescriptorBindingFlags; pub const ResolveModeFlagsKHR = ResolveModeFlags; pub const PipelineRasterizationStateStreamCreateFlagsEXT = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(PipelineRasterizationStateStreamCreateFlagsEXT, Flags); }; pub const PipelineRasterizationDepthClipStateCreateFlagsEXT = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(PipelineRasterizationDepthClipStateCreateFlagsEXT, Flags); }; pub const VideoBeginCodingFlagsKHR = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(VideoBeginCodingFlagsKHR, Flags); }; pub const VideoEndCodingFlagsKHR = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(VideoEndCodingFlagsKHR, Flags); }; pub const VideoDecodeH264CreateFlagsEXT = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(VideoDecodeH264CreateFlagsEXT, Flags); }; pub const VideoDecodeH265CreateFlagsEXT = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(VideoDecodeH265CreateFlagsEXT, Flags); }; pub const Instance = enum(usize) { null_handle = 0, _ }; pub const PhysicalDevice = enum(usize) { null_handle = 0, _ }; pub const Device = enum(usize) { null_handle = 0, _ }; pub const Queue = enum(usize) { null_handle = 0, _ }; pub const CommandBuffer = enum(usize) { null_handle = 0, _ }; pub const DeviceMemory = enum(u64) { null_handle = 0, _ }; pub const CommandPool = enum(u64) { null_handle = 0, _ }; pub const Buffer = enum(u64) { null_handle = 0, _ }; pub const BufferView = enum(u64) { null_handle = 0, _ }; pub const Image = enum(u64) { null_handle = 0, _ }; pub const ImageView = enum(u64) { null_handle = 0, _ }; pub const ShaderModule = enum(u64) { null_handle = 0, _ }; pub const Pipeline = enum(u64) { null_handle = 0, _ }; pub const PipelineLayout = enum(u64) { null_handle = 0, _ }; pub const Sampler = enum(u64) { null_handle = 0, _ }; pub const DescriptorSet = enum(u64) { null_handle = 0, _ }; pub const DescriptorSetLayout = enum(u64) { null_handle = 0, _ }; pub const DescriptorPool = enum(u64) { null_handle = 0, _ }; pub const Fence = enum(u64) { null_handle = 0, _ }; pub const Semaphore = enum(u64) { null_handle = 0, _ }; pub const Event = enum(u64) { null_handle = 0, _ }; pub const QueryPool = enum(u64) { null_handle = 0, _ }; pub const Framebuffer = enum(u64) { null_handle = 0, _ }; pub const RenderPass = enum(u64) { null_handle = 0, _ }; pub const PipelineCache = enum(u64) { null_handle = 0, _ }; pub const IndirectCommandsLayoutNV = enum(u64) { null_handle = 0, _ }; pub const DescriptorUpdateTemplate = enum(u64) { null_handle = 0, _ }; pub const DescriptorUpdateTemplateKHR = DescriptorUpdateTemplate; pub const SamplerYcbcrConversion = enum(u64) { null_handle = 0, _ }; pub const SamplerYcbcrConversionKHR = SamplerYcbcrConversion; pub const ValidationCacheEXT = enum(u64) { null_handle = 0, _ }; pub const AccelerationStructureKHR = enum(u64) { null_handle = 0, _ }; pub const AccelerationStructureNV = enum(u64) { null_handle = 0, _ }; pub const PerformanceConfigurationINTEL = enum(u64) { null_handle = 0, _ }; pub const DeferredOperationKHR = enum(u64) { null_handle = 0, _ }; pub const PrivateDataSlotEXT = enum(u64) { null_handle = 0, _ }; pub const DisplayKHR = enum(u64) { null_handle = 0, _ }; pub const DisplayModeKHR = enum(u64) { null_handle = 0, _ }; pub const SurfaceKHR = enum(u64) { null_handle = 0, _ }; pub const SwapchainKHR = enum(u64) { null_handle = 0, _ }; pub const DebugReportCallbackEXT = enum(u64) { null_handle = 0, _ }; pub const DebugUtilsMessengerEXT = enum(u64) { null_handle = 0, _ }; pub const VideoSessionKHR = enum(u64) { null_handle = 0, _ }; pub const VideoSessionParametersKHR = enum(u64) { null_handle = 0, _ }; pub const DescriptorUpdateTemplateTypeKHR = DescriptorUpdateTemplateType; pub const PointClippingBehaviorKHR = PointClippingBehavior; pub const SemaphoreTypeKHR = SemaphoreType; pub const CopyAccelerationStructureModeNV = CopyAccelerationStructureModeKHR; pub const AccelerationStructureTypeNV = AccelerationStructureTypeKHR; pub const GeometryTypeNV = GeometryTypeKHR; pub const RayTracingShaderGroupTypeNV = RayTracingShaderGroupTypeKHR; pub const TessellationDomainOriginKHR = TessellationDomainOrigin; pub const SamplerYcbcrModelConversionKHR = SamplerYcbcrModelConversion; pub const SamplerYcbcrRangeKHR = SamplerYcbcrRange; pub const ChromaLocationKHR = ChromaLocation; pub const SamplerReductionModeEXT = SamplerReductionMode; pub const ShaderFloatControlsIndependenceKHR = ShaderFloatControlsIndependence; pub const DriverIdKHR = DriverId; pub const PfnInternalAllocationNotification = ?fn ( p_user_data: *anyopaque, size: usize, allocation_type: InternalAllocationType, allocation_scope: SystemAllocationScope, ) callconv(vulkan_call_conv) void; pub const PfnInternalFreeNotification = ?fn ( p_user_data: *anyopaque, size: usize, allocation_type: InternalAllocationType, allocation_scope: SystemAllocationScope, ) callconv(vulkan_call_conv) void; pub const PfnReallocationFunction = ?fn ( p_user_data: *anyopaque, p_original: *anyopaque, size: usize, alignment: usize, allocation_scope: SystemAllocationScope, ) callconv(vulkan_call_conv) *anyopaque; pub const PfnAllocationFunction = ?fn ( p_user_data: *anyopaque, size: usize, alignment: usize, allocation_scope: SystemAllocationScope, ) callconv(vulkan_call_conv) *anyopaque; pub const PfnFreeFunction = ?fn ( p_user_data: *anyopaque, p_memory: *anyopaque, ) callconv(vulkan_call_conv) void; pub const PfnVoidFunction = ?fn () callconv(vulkan_call_conv) void; pub const PfnDebugReportCallbackEXT = ?fn ( flags: DebugReportFlagsEXT.IntType, object_type: DebugReportObjectTypeEXT, object: u64, location: usize, message_code: i32, p_layer_prefix: *const u8, p_message: *const u8, p_user_data: *anyopaque, ) callconv(vulkan_call_conv) Bool32; pub const PfnDebugUtilsMessengerCallbackEXT = ?fn ( message_severity: DebugUtilsMessageSeverityFlagsEXT.IntType, message_types: DebugUtilsMessageTypeFlagsEXT.IntType, p_callback_data: *const DebugUtilsMessengerCallbackDataEXT, p_user_data: *anyopaque, ) callconv(vulkan_call_conv) Bool32; pub const PfnDeviceMemoryReportCallbackEXT = ?fn ( p_callback_data: *const DeviceMemoryReportCallbackDataEXT, p_user_data: *anyopaque, ) callconv(vulkan_call_conv) void; pub const BaseOutStructure = extern struct { s_type: StructureType, p_next: ?*BaseOutStructure = null, }; pub const BaseInStructure = extern struct { s_type: StructureType, p_next: ?*const BaseInStructure = null, }; pub const Offset2D = extern struct { x: i32, y: i32, }; pub const Offset3D = extern struct { x: i32, y: i32, z: i32, }; pub const Extent2D = extern struct { width: u32, height: u32, }; pub const Extent3D = extern struct { width: u32, height: u32, depth: u32, }; pub const Viewport = extern struct { x: f32, y: f32, width: f32, height: f32, min_depth: f32, max_depth: f32, }; pub const Rect2D = extern struct { offset: Offset2D, extent: Extent2D, }; pub const ClearRect = extern struct { rect: Rect2D, base_array_layer: u32, layer_count: u32, }; pub const ComponentMapping = extern struct { r: ComponentSwizzle, g: ComponentSwizzle, b: ComponentSwizzle, a: ComponentSwizzle, }; pub const PhysicalDeviceProperties = extern struct { api_version: u32, driver_version: u32, vendor_id: u32, device_id: u32, device_type: PhysicalDeviceType, device_name: [MAX_PHYSICAL_DEVICE_NAME_SIZE]u8, pipeline_cache_uuid: [UUID_SIZE]u8, limits: PhysicalDeviceLimits, sparse_properties: PhysicalDeviceSparseProperties, }; pub const ExtensionProperties = extern struct { extension_name: [MAX_EXTENSION_NAME_SIZE]u8, spec_version: u32, }; pub const LayerProperties = extern struct { layer_name: [MAX_EXTENSION_NAME_SIZE]u8, spec_version: u32, implementation_version: u32, description: [MAX_DESCRIPTION_SIZE]u8, }; pub const ApplicationInfo = extern struct { s_type: StructureType = .application_info, p_next: ?*const anyopaque = null, p_application_name: ?[*:0]const u8, application_version: u32, p_engine_name: ?[*:0]const u8, engine_version: u32, api_version: u32, }; pub const AllocationCallbacks = extern struct { p_user_data: ?*anyopaque, pfn_allocation: PfnAllocationFunction, pfn_reallocation: PfnReallocationFunction, pfn_free: PfnFreeFunction, pfn_internal_allocation: PfnInternalAllocationNotification, pfn_internal_free: PfnInternalFreeNotification, }; pub const DeviceQueueCreateInfo = extern struct { s_type: StructureType = .device_queue_create_info, p_next: ?*const anyopaque = null, flags: DeviceQueueCreateFlags, queue_family_index: u32, queue_count: u32, p_queue_priorities: [*]const f32, }; pub const DeviceCreateInfo = extern struct { s_type: StructureType = .device_create_info, p_next: ?*const anyopaque = null, flags: DeviceCreateFlags, queue_create_info_count: u32, p_queue_create_infos: [*]const DeviceQueueCreateInfo, enabled_layer_count: u32, pp_enabled_layer_names: [*]const [*:0]const u8, enabled_extension_count: u32, pp_enabled_extension_names: [*]const [*:0]const u8, p_enabled_features: ?*const PhysicalDeviceFeatures, }; pub const InstanceCreateInfo = extern struct { s_type: StructureType = .instance_create_info, p_next: ?*const anyopaque = null, flags: InstanceCreateFlags, p_application_info: ?*const ApplicationInfo, enabled_layer_count: u32, pp_enabled_layer_names: [*]const [*:0]const u8, enabled_extension_count: u32, pp_enabled_extension_names: [*]const [*:0]const u8, }; pub const QueueFamilyProperties = extern struct { queue_flags: QueueFlags, queue_count: u32, timestamp_valid_bits: u32, min_image_transfer_granularity: Extent3D, }; pub const PhysicalDeviceMemoryProperties = extern struct { memory_type_count: u32, memory_types: [MAX_MEMORY_TYPES]MemoryType, memory_heap_count: u32, memory_heaps: [MAX_MEMORY_HEAPS]MemoryHeap, }; pub const MemoryAllocateInfo = extern struct { s_type: StructureType = .memory_allocate_info, p_next: ?*const anyopaque = null, allocation_size: DeviceSize, memory_type_index: u32, }; pub const MemoryRequirements = extern struct { size: DeviceSize, alignment: DeviceSize, memory_type_bits: u32, }; pub const SparseImageFormatProperties = extern struct { aspect_mask: ImageAspectFlags, image_granularity: Extent3D, flags: SparseImageFormatFlags, }; pub const SparseImageMemoryRequirements = extern struct { format_properties: SparseImageFormatProperties, image_mip_tail_first_lod: u32, image_mip_tail_size: DeviceSize, image_mip_tail_offset: DeviceSize, image_mip_tail_stride: DeviceSize, }; pub const MemoryType = extern struct { property_flags: MemoryPropertyFlags, heap_index: u32, }; pub const MemoryHeap = extern struct { size: DeviceSize, flags: MemoryHeapFlags, }; pub const MappedMemoryRange = extern struct { s_type: StructureType = .mapped_memory_range, p_next: ?*const anyopaque = null, memory: DeviceMemory, offset: DeviceSize, size: DeviceSize, }; pub const FormatProperties = extern struct { linear_tiling_features: FormatFeatureFlags, optimal_tiling_features: FormatFeatureFlags, buffer_features: FormatFeatureFlags, }; pub const ImageFormatProperties = extern struct { max_extent: Extent3D, max_mip_levels: u32, max_array_layers: u32, sample_counts: SampleCountFlags, max_resource_size: DeviceSize, }; pub const DescriptorBufferInfo = extern struct { buffer: Buffer, offset: DeviceSize, range: DeviceSize, }; pub const DescriptorImageInfo = extern struct { sampler: Sampler, image_view: ImageView, image_layout: ImageLayout, }; pub const WriteDescriptorSet = extern struct { s_type: StructureType = .write_descriptor_set, p_next: ?*const anyopaque = null, dst_set: DescriptorSet, dst_binding: u32, dst_array_element: u32, descriptor_count: u32, descriptor_type: DescriptorType, p_image_info: [*]const DescriptorImageInfo, p_buffer_info: [*]const DescriptorBufferInfo, p_texel_buffer_view: [*]const BufferView, }; pub const CopyDescriptorSet = extern struct { s_type: StructureType = .copy_descriptor_set, p_next: ?*const anyopaque = null, src_set: DescriptorSet, src_binding: u32, src_array_element: u32, dst_set: DescriptorSet, dst_binding: u32, dst_array_element: u32, descriptor_count: u32, }; pub const BufferCreateInfo = extern struct { s_type: StructureType = .buffer_create_info, p_next: ?*const anyopaque = null, flags: BufferCreateFlags, size: DeviceSize, usage: BufferUsageFlags, sharing_mode: SharingMode, queue_family_index_count: u32, p_queue_family_indices: [*]const u32, }; pub const BufferViewCreateInfo = extern struct { s_type: StructureType = .buffer_view_create_info, p_next: ?*const anyopaque = null, flags: BufferViewCreateFlags, buffer: Buffer, format: Format, offset: DeviceSize, range: DeviceSize, }; pub const ImageSubresource = extern struct { aspect_mask: ImageAspectFlags, mip_level: u32, array_layer: u32, }; pub const ImageSubresourceLayers = extern struct { aspect_mask: ImageAspectFlags, mip_level: u32, base_array_layer: u32, layer_count: u32, }; pub const ImageSubresourceRange = extern struct { aspect_mask: ImageAspectFlags, base_mip_level: u32, level_count: u32, base_array_layer: u32, layer_count: u32, }; pub const MemoryBarrier = extern struct { s_type: StructureType = .memory_barrier, p_next: ?*const anyopaque = null, src_access_mask: AccessFlags, dst_access_mask: AccessFlags, }; pub const BufferMemoryBarrier = extern struct { s_type: StructureType = .buffer_memory_barrier, p_next: ?*const anyopaque = null, src_access_mask: AccessFlags, dst_access_mask: AccessFlags, src_queue_family_index: u32, dst_queue_family_index: u32, buffer: Buffer, offset: DeviceSize, size: DeviceSize, }; pub const ImageMemoryBarrier = extern struct { s_type: StructureType = .image_memory_barrier, p_next: ?*const anyopaque = null, src_access_mask: AccessFlags, dst_access_mask: AccessFlags, old_layout: ImageLayout, new_layout: ImageLayout, src_queue_family_index: u32, dst_queue_family_index: u32, image: Image, subresource_range: ImageSubresourceRange, }; pub const ImageCreateInfo = extern struct { s_type: StructureType = .image_create_info, p_next: ?*const anyopaque = null, flags: ImageCreateFlags, image_type: ImageType, format: Format, extent: Extent3D, mip_levels: u32, array_layers: u32, samples: SampleCountFlags, tiling: ImageTiling, usage: ImageUsageFlags, sharing_mode: SharingMode, queue_family_index_count: u32, p_queue_family_indices: [*]const u32, initial_layout: ImageLayout, }; pub const SubresourceLayout = extern struct { offset: DeviceSize, size: DeviceSize, row_pitch: DeviceSize, array_pitch: DeviceSize, depth_pitch: DeviceSize, }; pub const ImageViewCreateInfo = extern struct { s_type: StructureType = .image_view_create_info, p_next: ?*const anyopaque = null, flags: ImageViewCreateFlags, image: Image, view_type: ImageViewType, format: Format, components: ComponentMapping, subresource_range: ImageSubresourceRange, }; pub const BufferCopy = extern struct { src_offset: DeviceSize, dst_offset: DeviceSize, size: DeviceSize, }; pub const SparseMemoryBind = extern struct { resource_offset: DeviceSize, size: DeviceSize, memory: DeviceMemory, memory_offset: DeviceSize, flags: SparseMemoryBindFlags, }; pub const SparseImageMemoryBind = extern struct { subresource: ImageSubresource, offset: Offset3D, extent: Extent3D, memory: DeviceMemory, memory_offset: DeviceSize, flags: SparseMemoryBindFlags, }; pub const SparseBufferMemoryBindInfo = extern struct { buffer: Buffer, bind_count: u32, p_binds: [*]const SparseMemoryBind, }; pub const SparseImageOpaqueMemoryBindInfo = extern struct { image: Image, bind_count: u32, p_binds: [*]const SparseMemoryBind, }; pub const SparseImageMemoryBindInfo = extern struct { image: Image, bind_count: u32, p_binds: [*]const SparseImageMemoryBind, }; pub const BindSparseInfo = extern struct { s_type: StructureType = .bind_sparse_info, p_next: ?*const anyopaque = null, wait_semaphore_count: u32, p_wait_semaphores: [*]const Semaphore, buffer_bind_count: u32, p_buffer_binds: [*]const SparseBufferMemoryBindInfo, image_opaque_bind_count: u32, p_image_opaque_binds: [*]const SparseImageOpaqueMemoryBindInfo, image_bind_count: u32, p_image_binds: [*]const SparseImageMemoryBindInfo, signal_semaphore_count: u32, p_signal_semaphores: [*]const Semaphore, }; pub const ImageCopy = extern struct { src_subresource: ImageSubresourceLayers, src_offset: Offset3D, dst_subresource: ImageSubresourceLayers, dst_offset: Offset3D, extent: Extent3D, }; pub const ImageBlit = extern struct { src_subresource: ImageSubresourceLayers, src_offsets: [2]Offset3D, dst_subresource: ImageSubresourceLayers, dst_offsets: [2]Offset3D, }; pub const BufferImageCopy = extern struct { buffer_offset: DeviceSize, buffer_row_length: u32, buffer_image_height: u32, image_subresource: ImageSubresourceLayers, image_offset: Offset3D, image_extent: Extent3D, }; pub const ImageResolve = extern struct { src_subresource: ImageSubresourceLayers, src_offset: Offset3D, dst_subresource: ImageSubresourceLayers, dst_offset: Offset3D, extent: Extent3D, }; pub const ShaderModuleCreateInfo = extern struct { s_type: StructureType = .shader_module_create_info, p_next: ?*const anyopaque = null, flags: ShaderModuleCreateFlags, code_size: usize, p_code: [*]const u32, }; pub const DescriptorSetLayoutBinding = extern struct { binding: u32, descriptor_type: DescriptorType, descriptor_count: u32, stage_flags: ShaderStageFlags, p_immutable_samplers: ?[*]const Sampler, }; pub const DescriptorSetLayoutCreateInfo = extern struct { s_type: StructureType = .descriptor_set_layout_create_info, p_next: ?*const anyopaque = null, flags: DescriptorSetLayoutCreateFlags, binding_count: u32, p_bindings: [*]const DescriptorSetLayoutBinding, }; pub const DescriptorPoolSize = extern struct { type: DescriptorType, descriptor_count: u32, }; pub const DescriptorPoolCreateInfo = extern struct { s_type: StructureType = .descriptor_pool_create_info, p_next: ?*const anyopaque = null, flags: DescriptorPoolCreateFlags, max_sets: u32, pool_size_count: u32, p_pool_sizes: [*]const DescriptorPoolSize, }; pub const DescriptorSetAllocateInfo = extern struct { s_type: StructureType = .descriptor_set_allocate_info, p_next: ?*const anyopaque = null, descriptor_pool: DescriptorPool, descriptor_set_count: u32, p_set_layouts: [*]const DescriptorSetLayout, }; pub const SpecializationMapEntry = extern struct { constant_id: u32, offset: u32, size: usize, }; pub const SpecializationInfo = extern struct { map_entry_count: u32, p_map_entries: [*]const SpecializationMapEntry, data_size: usize, p_data: *const anyopaque, }; pub const PipelineShaderStageCreateInfo = extern struct { s_type: StructureType = .pipeline_shader_stage_create_info, p_next: ?*const anyopaque = null, flags: PipelineShaderStageCreateFlags, stage: ShaderStageFlags, module: ShaderModule, p_name: [*:0]const u8, p_specialization_info: ?*const SpecializationInfo, }; pub const ComputePipelineCreateInfo = extern struct { s_type: StructureType = .compute_pipeline_create_info, p_next: ?*const anyopaque = null, flags: PipelineCreateFlags, stage: PipelineShaderStageCreateInfo, layout: PipelineLayout, base_pipeline_handle: Pipeline, base_pipeline_index: i32, }; pub const VertexInputBindingDescription = extern struct { binding: u32, stride: u32, input_rate: VertexInputRate, }; pub const VertexInputAttributeDescription = extern struct { location: u32, binding: u32, format: Format, offset: u32, }; pub const PipelineVertexInputStateCreateInfo = extern struct { s_type: StructureType = .pipeline_vertex_input_state_create_info, p_next: ?*const anyopaque = null, flags: PipelineVertexInputStateCreateFlags, vertex_binding_description_count: u32, p_vertex_binding_descriptions: [*]const VertexInputBindingDescription, vertex_attribute_description_count: u32, p_vertex_attribute_descriptions: [*]const VertexInputAttributeDescription, }; pub const PipelineInputAssemblyStateCreateInfo = extern struct { s_type: StructureType = .pipeline_input_assembly_state_create_info, p_next: ?*const anyopaque = null, flags: PipelineInputAssemblyStateCreateFlags, topology: PrimitiveTopology, primitive_restart_enable: Bool32, }; pub const PipelineTessellationStateCreateInfo = extern struct { s_type: StructureType = .pipeline_tessellation_state_create_info, p_next: ?*const anyopaque = null, flags: PipelineTessellationStateCreateFlags, patch_control_points: u32, }; pub const PipelineViewportStateCreateInfo = extern struct { s_type: StructureType = .pipeline_viewport_state_create_info, p_next: ?*const anyopaque = null, flags: PipelineViewportStateCreateFlags, viewport_count: u32, p_viewports: ?[*]const Viewport, scissor_count: u32, p_scissors: ?[*]const Rect2D, }; pub const PipelineRasterizationStateCreateInfo = extern struct { s_type: StructureType = .pipeline_rasterization_state_create_info, p_next: ?*const anyopaque = null, flags: PipelineRasterizationStateCreateFlags, depth_clamp_enable: Bool32, rasterizer_discard_enable: Bool32, polygon_mode: PolygonMode, cull_mode: CullModeFlags, front_face: FrontFace, depth_bias_enable: Bool32, depth_bias_constant_factor: f32, depth_bias_clamp: f32, depth_bias_slope_factor: f32, line_width: f32, }; pub const PipelineMultisampleStateCreateInfo = extern struct { s_type: StructureType = .pipeline_multisample_state_create_info, p_next: ?*const anyopaque = null, flags: PipelineMultisampleStateCreateFlags, rasterization_samples: SampleCountFlags, sample_shading_enable: Bool32, min_sample_shading: f32, p_sample_mask: ?[*]const SampleMask, alpha_to_coverage_enable: Bool32, alpha_to_one_enable: Bool32, }; pub const PipelineColorBlendAttachmentState = extern struct { blend_enable: Bool32, src_color_blend_factor: BlendFactor, dst_color_blend_factor: BlendFactor, color_blend_op: BlendOp, src_alpha_blend_factor: BlendFactor, dst_alpha_blend_factor: BlendFactor, alpha_blend_op: BlendOp, color_write_mask: ColorComponentFlags, }; pub const PipelineColorBlendStateCreateInfo = extern struct { s_type: StructureType = .pipeline_color_blend_state_create_info, p_next: ?*const anyopaque = null, flags: PipelineColorBlendStateCreateFlags, logic_op_enable: Bool32, logic_op: LogicOp, attachment_count: u32, p_attachments: [*]const PipelineColorBlendAttachmentState, blend_constants: [4]f32, }; pub const PipelineDynamicStateCreateInfo = extern struct { s_type: StructureType = .pipeline_dynamic_state_create_info, p_next: ?*const anyopaque = null, flags: PipelineDynamicStateCreateFlags, dynamic_state_count: u32, p_dynamic_states: [*]const DynamicState, }; pub const StencilOpState = extern struct { fail_op: StencilOp, pass_op: StencilOp, depth_fail_op: StencilOp, compare_op: CompareOp, compare_mask: u32, write_mask: u32, reference: u32, }; pub const PipelineDepthStencilStateCreateInfo = extern struct { s_type: StructureType = .pipeline_depth_stencil_state_create_info, p_next: ?*const anyopaque = null, flags: PipelineDepthStencilStateCreateFlags, depth_test_enable: Bool32, depth_write_enable: Bool32, depth_compare_op: CompareOp, depth_bounds_test_enable: Bool32, stencil_test_enable: Bool32, front: StencilOpState, back: StencilOpState, min_depth_bounds: f32, max_depth_bounds: f32, }; pub const GraphicsPipelineCreateInfo = extern struct { s_type: StructureType = .graphics_pipeline_create_info, p_next: ?*const anyopaque = null, flags: PipelineCreateFlags, stage_count: u32, p_stages: [*]const PipelineShaderStageCreateInfo, p_vertex_input_state: ?*const PipelineVertexInputStateCreateInfo, p_input_assembly_state: ?*const PipelineInputAssemblyStateCreateInfo, p_tessellation_state: ?*const PipelineTessellationStateCreateInfo, p_viewport_state: ?*const PipelineViewportStateCreateInfo, p_rasterization_state: *const PipelineRasterizationStateCreateInfo, p_multisample_state: ?*const PipelineMultisampleStateCreateInfo, p_depth_stencil_state: ?*const PipelineDepthStencilStateCreateInfo, p_color_blend_state: ?*const PipelineColorBlendStateCreateInfo, p_dynamic_state: ?*const PipelineDynamicStateCreateInfo, layout: PipelineLayout, render_pass: RenderPass, subpass: u32, base_pipeline_handle: Pipeline, base_pipeline_index: i32, }; pub const PipelineCacheCreateInfo = extern struct { s_type: StructureType = .pipeline_cache_create_info, p_next: ?*const anyopaque = null, flags: PipelineCacheCreateFlags, initial_data_size: usize, p_initial_data: *const anyopaque, }; pub const PushConstantRange = extern struct { stage_flags: ShaderStageFlags, offset: u32, size: u32, }; pub const PipelineLayoutCreateInfo = extern struct { s_type: StructureType = .pipeline_layout_create_info, p_next: ?*const anyopaque = null, flags: PipelineLayoutCreateFlags, set_layout_count: u32, p_set_layouts: [*]const DescriptorSetLayout, push_constant_range_count: u32, p_push_constant_ranges: [*]const PushConstantRange, }; pub const SamplerCreateInfo = extern struct { s_type: StructureType = .sampler_create_info, p_next: ?*const anyopaque = null, flags: SamplerCreateFlags, mag_filter: Filter, min_filter: Filter, mipmap_mode: SamplerMipmapMode, address_mode_u: SamplerAddressMode, address_mode_v: SamplerAddressMode, address_mode_w: SamplerAddressMode, mip_lod_bias: f32, anisotropy_enable: Bool32, max_anisotropy: f32, compare_enable: Bool32, compare_op: CompareOp, min_lod: f32, max_lod: f32, border_color: BorderColor, unnormalized_coordinates: Bool32, }; pub const CommandPoolCreateInfo = extern struct { s_type: StructureType = .command_pool_create_info, p_next: ?*const anyopaque = null, flags: CommandPoolCreateFlags, queue_family_index: u32, }; pub const CommandBufferAllocateInfo = extern struct { s_type: StructureType = .command_buffer_allocate_info, p_next: ?*const anyopaque = null, command_pool: CommandPool, level: CommandBufferLevel, command_buffer_count: u32, }; pub const CommandBufferInheritanceInfo = extern struct { s_type: StructureType = .command_buffer_inheritance_info, p_next: ?*const anyopaque = null, render_pass: RenderPass, subpass: u32, framebuffer: Framebuffer, occlusion_query_enable: Bool32, query_flags: QueryControlFlags, pipeline_statistics: QueryPipelineStatisticFlags, }; pub const CommandBufferBeginInfo = extern struct { s_type: StructureType = .command_buffer_begin_info, p_next: ?*const anyopaque = null, flags: CommandBufferUsageFlags, p_inheritance_info: ?*const CommandBufferInheritanceInfo, }; pub const RenderPassBeginInfo = extern struct { s_type: StructureType = .render_pass_begin_info, p_next: ?*const anyopaque = null, render_pass: RenderPass, framebuffer: Framebuffer, render_area: Rect2D, clear_value_count: u32, p_clear_values: [*]const ClearValue, }; pub const ClearColorValue = extern union { float_32: [4]f32, int_32: [4]i32, uint_32: [4]u32, }; pub const ClearDepthStencilValue = extern struct { depth: f32, stencil: u32, }; pub const ClearValue = extern union { color: ClearColorValue, depth_stencil: ClearDepthStencilValue, }; pub const ClearAttachment = extern struct { aspect_mask: ImageAspectFlags, color_attachment: u32, clear_value: ClearValue, }; pub const AttachmentDescription = extern struct { flags: AttachmentDescriptionFlags, format: Format, samples: SampleCountFlags, load_op: AttachmentLoadOp, store_op: AttachmentStoreOp, stencil_load_op: AttachmentLoadOp, stencil_store_op: AttachmentStoreOp, initial_layout: ImageLayout, final_layout: ImageLayout, }; pub const AttachmentReference = extern struct { attachment: u32, layout: ImageLayout, }; pub const SubpassDescription = extern struct { flags: SubpassDescriptionFlags, pipeline_bind_point: PipelineBindPoint, input_attachment_count: u32, p_input_attachments: [*]const AttachmentReference, color_attachment_count: u32, p_color_attachments: [*]const AttachmentReference, p_resolve_attachments: ?[*]const AttachmentReference, p_depth_stencil_attachment: ?*const AttachmentReference, preserve_attachment_count: u32, p_preserve_attachments: [*]const u32, }; pub const SubpassDependency = extern struct { src_subpass: u32, dst_subpass: u32, src_stage_mask: PipelineStageFlags, dst_stage_mask: PipelineStageFlags, src_access_mask: AccessFlags, dst_access_mask: AccessFlags, dependency_flags: DependencyFlags, }; pub const RenderPassCreateInfo = extern struct { s_type: StructureType = .render_pass_create_info, p_next: ?*const anyopaque = null, flags: RenderPassCreateFlags, attachment_count: u32, p_attachments: [*]const AttachmentDescription, subpass_count: u32, p_subpasses: [*]const SubpassDescription, dependency_count: u32, p_dependencies: [*]const SubpassDependency, }; pub const EventCreateInfo = extern struct { s_type: StructureType = .event_create_info, p_next: ?*const anyopaque = null, flags: EventCreateFlags, }; pub const FenceCreateInfo = extern struct { s_type: StructureType = .fence_create_info, p_next: ?*const anyopaque = null, flags: FenceCreateFlags, }; pub const PhysicalDeviceFeatures = extern struct { robust_buffer_access: Bool32, full_draw_index_uint_32: Bool32, image_cube_array: Bool32, independent_blend: Bool32, geometry_shader: Bool32, tessellation_shader: Bool32, sample_rate_shading: Bool32, dual_src_blend: Bool32, logic_op: Bool32, multi_draw_indirect: Bool32, draw_indirect_first_instance: Bool32, depth_clamp: Bool32, depth_bias_clamp: Bool32, fill_mode_non_solid: Bool32, depth_bounds: Bool32, wide_lines: Bool32, large_points: Bool32, alpha_to_one: Bool32, multi_viewport: Bool32, sampler_anisotropy: Bool32, texture_compression_etc2: Bool32, texture_compression_astc_ldr: Bool32, texture_compression_bc: Bool32, occlusion_query_precise: Bool32, pipeline_statistics_query: Bool32, vertex_pipeline_stores_and_atomics: Bool32, fragment_stores_and_atomics: Bool32, shader_tessellation_and_geometry_point_size: Bool32, shader_image_gather_extended: Bool32, shader_storage_image_extended_formats: Bool32, shader_storage_image_multisample: Bool32, shader_storage_image_read_without_format: Bool32, shader_storage_image_write_without_format: Bool32, shader_uniform_buffer_array_dynamic_indexing: Bool32, shader_sampled_image_array_dynamic_indexing: Bool32, shader_storage_buffer_array_dynamic_indexing: Bool32, shader_storage_image_array_dynamic_indexing: Bool32, shader_clip_distance: Bool32, shader_cull_distance: Bool32, shader_float_64: Bool32, shader_int_64: Bool32, shader_int_16: Bool32, shader_resource_residency: Bool32, shader_resource_min_lod: Bool32, sparse_binding: Bool32, sparse_residency_buffer: Bool32, sparse_residency_image_2d: Bool32, sparse_residency_image_3d: Bool32, sparse_residency_2_samples: Bool32, sparse_residency_4_samples: Bool32, sparse_residency_8_samples: Bool32, sparse_residency_16_samples: Bool32, sparse_residency_aliased: Bool32, variable_multisample_rate: Bool32, inherited_queries: Bool32, }; pub const PhysicalDeviceSparseProperties = extern struct { residency_standard_2d_block_shape: Bool32, residency_standard_2d_multisample_block_shape: Bool32, residency_standard_3d_block_shape: Bool32, residency_aligned_mip_size: Bool32, residency_non_resident_strict: Bool32, }; pub const PhysicalDeviceLimits = extern struct { max_image_dimension_1d: u32, max_image_dimension_2d: u32, max_image_dimension_3d: u32, max_image_dimension_cube: u32, max_image_array_layers: u32, max_texel_buffer_elements: u32, max_uniform_buffer_range: u32, max_storage_buffer_range: u32, max_push_constants_size: u32, max_memory_allocation_count: u32, max_sampler_allocation_count: u32, buffer_image_granularity: DeviceSize, sparse_address_space_size: DeviceSize, max_bound_descriptor_sets: u32, max_per_stage_descriptor_samplers: u32, max_per_stage_descriptor_uniform_buffers: u32, max_per_stage_descriptor_storage_buffers: u32, max_per_stage_descriptor_sampled_images: u32, max_per_stage_descriptor_storage_images: u32, max_per_stage_descriptor_input_attachments: u32, max_per_stage_resources: u32, max_descriptor_set_samplers: u32, max_descriptor_set_uniform_buffers: u32, max_descriptor_set_uniform_buffers_dynamic: u32, max_descriptor_set_storage_buffers: u32, max_descriptor_set_storage_buffers_dynamic: u32, max_descriptor_set_sampled_images: u32, max_descriptor_set_storage_images: u32, max_descriptor_set_input_attachments: u32, max_vertex_input_attributes: u32, max_vertex_input_bindings: u32, max_vertex_input_attribute_offset: u32, max_vertex_input_binding_stride: u32, max_vertex_output_components: u32, max_tessellation_generation_level: u32, max_tessellation_patch_size: u32, max_tessellation_control_per_vertex_input_components: u32, max_tessellation_control_per_vertex_output_components: u32, max_tessellation_control_per_patch_output_components: u32, max_tessellation_control_total_output_components: u32, max_tessellation_evaluation_input_components: u32, max_tessellation_evaluation_output_components: u32, max_geometry_shader_invocations: u32, max_geometry_input_components: u32, max_geometry_output_components: u32, max_geometry_output_vertices: u32, max_geometry_total_output_components: u32, max_fragment_input_components: u32, max_fragment_output_attachments: u32, max_fragment_dual_src_attachments: u32, max_fragment_combined_output_resources: u32, max_compute_shared_memory_size: u32, max_compute_work_group_count: [3]u32, max_compute_work_group_invocations: u32, max_compute_work_group_size: [3]u32, sub_pixel_precision_bits: u32, sub_texel_precision_bits: u32, mipmap_precision_bits: u32, max_draw_indexed_index_value: u32, max_draw_indirect_count: u32, max_sampler_lod_bias: f32, max_sampler_anisotropy: f32, max_viewports: u32, max_viewport_dimensions: [2]u32, viewport_bounds_range: [2]f32, viewport_sub_pixel_bits: u32, min_memory_map_alignment: usize, min_texel_buffer_offset_alignment: DeviceSize, min_uniform_buffer_offset_alignment: DeviceSize, min_storage_buffer_offset_alignment: DeviceSize, min_texel_offset: i32, max_texel_offset: u32, min_texel_gather_offset: i32, max_texel_gather_offset: u32, min_interpolation_offset: f32, max_interpolation_offset: f32, sub_pixel_interpolation_offset_bits: u32, max_framebuffer_width: u32, max_framebuffer_height: u32, max_framebuffer_layers: u32, framebuffer_color_sample_counts: SampleCountFlags, framebuffer_depth_sample_counts: SampleCountFlags, framebuffer_stencil_sample_counts: SampleCountFlags, framebuffer_no_attachments_sample_counts: SampleCountFlags, max_color_attachments: u32, sampled_image_color_sample_counts: SampleCountFlags, sampled_image_integer_sample_counts: SampleCountFlags, sampled_image_depth_sample_counts: SampleCountFlags, sampled_image_stencil_sample_counts: SampleCountFlags, storage_image_sample_counts: SampleCountFlags, max_sample_mask_words: u32, timestamp_compute_and_graphics: Bool32, timestamp_period: f32, max_clip_distances: u32, max_cull_distances: u32, max_combined_clip_and_cull_distances: u32, discrete_queue_priorities: u32, point_size_range: [2]f32, line_width_range: [2]f32, point_size_granularity: f32, line_width_granularity: f32, strict_lines: Bool32, standard_sample_locations: Bool32, optimal_buffer_copy_offset_alignment: DeviceSize, optimal_buffer_copy_row_pitch_alignment: DeviceSize, non_coherent_atom_size: DeviceSize, }; pub const SemaphoreCreateInfo = extern struct { s_type: StructureType = .semaphore_create_info, p_next: ?*const anyopaque = null, flags: SemaphoreCreateFlags, }; pub const QueryPoolCreateInfo = extern struct { s_type: StructureType = .query_pool_create_info, p_next: ?*const anyopaque = null, flags: QueryPoolCreateFlags, query_type: QueryType, query_count: u32, pipeline_statistics: QueryPipelineStatisticFlags, }; pub const FramebufferCreateInfo = extern struct { s_type: StructureType = .framebuffer_create_info, p_next: ?*const anyopaque = null, flags: FramebufferCreateFlags, render_pass: RenderPass, attachment_count: u32, p_attachments: [*]const ImageView, width: u32, height: u32, layers: u32, }; pub const DrawIndirectCommand = extern struct { vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32, }; pub const DrawIndexedIndirectCommand = extern struct { index_count: u32, instance_count: u32, first_index: u32, vertex_offset: i32, first_instance: u32, }; pub const DispatchIndirectCommand = extern struct { x: u32, y: u32, z: u32, }; pub const SubmitInfo = extern struct { s_type: StructureType = .submit_info, p_next: ?*const anyopaque = null, wait_semaphore_count: u32, p_wait_semaphores: [*]const Semaphore, p_wait_dst_stage_mask: [*]const PipelineStageFlags, command_buffer_count: u32, p_command_buffers: [*]const CommandBuffer, signal_semaphore_count: u32, p_signal_semaphores: [*]const Semaphore, }; pub const DisplayPropertiesKHR = extern struct { display: DisplayKHR, display_name: [*:0]const u8, physical_dimensions: Extent2D, physical_resolution: Extent2D, supported_transforms: SurfaceTransformFlagsKHR, plane_reorder_possible: Bool32, persistent_content: Bool32, }; pub const DisplayPlanePropertiesKHR = extern struct { current_display: DisplayKHR, current_stack_index: u32, }; pub const DisplayModeParametersKHR = extern struct { visible_region: Extent2D, refresh_rate: u32, }; pub const DisplayModePropertiesKHR = extern struct { display_mode: DisplayModeKHR, parameters: DisplayModeParametersKHR, }; pub const DisplayModeCreateInfoKHR = extern struct { s_type: StructureType = .display_mode_create_info_khr, p_next: ?*const anyopaque = null, flags: DisplayModeCreateFlagsKHR, parameters: DisplayModeParametersKHR, }; pub const DisplayPlaneCapabilitiesKHR = extern struct { supported_alpha: DisplayPlaneAlphaFlagsKHR, min_src_position: Offset2D, max_src_position: Offset2D, min_src_extent: Extent2D, max_src_extent: Extent2D, min_dst_position: Offset2D, max_dst_position: Offset2D, min_dst_extent: Extent2D, max_dst_extent: Extent2D, }; pub const DisplaySurfaceCreateInfoKHR = extern struct { s_type: StructureType = .display_surface_create_info_khr, p_next: ?*const anyopaque = null, flags: DisplaySurfaceCreateFlagsKHR, display_mode: DisplayModeKHR, plane_index: u32, plane_stack_index: u32, transform: SurfaceTransformFlagsKHR, global_alpha: f32, alpha_mode: DisplayPlaneAlphaFlagsKHR, image_extent: Extent2D, }; pub const DisplayPresentInfoKHR = extern struct { s_type: StructureType = .display_present_info_khr, p_next: ?*const anyopaque = null, src_rect: Rect2D, dst_rect: Rect2D, persistent: Bool32, }; pub const SurfaceCapabilitiesKHR = extern struct { min_image_count: u32, max_image_count: u32, current_extent: Extent2D, min_image_extent: Extent2D, max_image_extent: Extent2D, max_image_array_layers: u32, supported_transforms: SurfaceTransformFlagsKHR, current_transform: SurfaceTransformFlagsKHR, supported_composite_alpha: CompositeAlphaFlagsKHR, supported_usage_flags: ImageUsageFlags, }; pub const AndroidSurfaceCreateInfoKHR = extern struct { s_type: StructureType = .android_surface_create_info_khr, p_next: ?*const anyopaque = null, flags: AndroidSurfaceCreateFlagsKHR, window: *ANativeWindow, }; pub const ViSurfaceCreateInfoNN = extern struct { s_type: StructureType = .vi_surface_create_info_nn, p_next: ?*const anyopaque = null, flags: ViSurfaceCreateFlagsNN, window: *anyopaque, }; pub const WaylandSurfaceCreateInfoKHR = extern struct { s_type: StructureType = .wayland_surface_create_info_khr, p_next: ?*const anyopaque = null, flags: WaylandSurfaceCreateFlagsKHR, display: *wl_display, surface: *wl_surface, }; pub const Win32SurfaceCreateInfoKHR = extern struct { s_type: StructureType = .win32_surface_create_info_khr, p_next: ?*const anyopaque = null, flags: Win32SurfaceCreateFlagsKHR, hinstance: HINSTANCE, hwnd: HWND, }; pub const XlibSurfaceCreateInfoKHR = extern struct { s_type: StructureType = .xlib_surface_create_info_khr, p_next: ?*const anyopaque = null, flags: XlibSurfaceCreateFlagsKHR, dpy: *Display, window: Window, }; pub const XcbSurfaceCreateInfoKHR = extern struct { s_type: StructureType = .xcb_surface_create_info_khr, p_next: ?*const anyopaque = null, flags: XcbSurfaceCreateFlagsKHR, connection: *xcb_connection_t, window: xcb_window_t, }; pub const DirectFBSurfaceCreateInfoEXT = extern struct { s_type: StructureType = .directfb_surface_create_info_ext, p_next: ?*const anyopaque = null, flags: DirectFBSurfaceCreateFlagsEXT, dfb: *IDirectFB, surface: *IDirectFBSurface, }; pub const ImagePipeSurfaceCreateInfoFUCHSIA = extern struct { s_type: StructureType = .imagepipe_surface_create_info_fuchsia, p_next: ?*const anyopaque = null, flags: ImagePipeSurfaceCreateFlagsFUCHSIA, image_pipe_handle: zx_handle_t, }; pub const StreamDescriptorSurfaceCreateInfoGGP = extern struct { s_type: StructureType = .stream_descriptor_surface_create_info_ggp, p_next: ?*const anyopaque = null, flags: StreamDescriptorSurfaceCreateFlagsGGP, stream_descriptor: GgpStreamDescriptor, }; pub const ScreenSurfaceCreateInfoQNX = extern struct { s_type: StructureType = .screen_surface_create_info_qnx, p_next: ?*const anyopaque = null, flags: ScreenSurfaceCreateFlagsQNX, context: *_screen_context, window: *_screen_window, }; pub const SurfaceFormatKHR = extern struct { format: Format, color_space: ColorSpaceKHR, }; pub const SwapchainCreateInfoKHR = extern struct { s_type: StructureType = .swapchain_create_info_khr, p_next: ?*const anyopaque = null, flags: SwapchainCreateFlagsKHR, surface: SurfaceKHR, min_image_count: u32, image_format: Format, image_color_space: ColorSpaceKHR, image_extent: Extent2D, image_array_layers: u32, image_usage: ImageUsageFlags, image_sharing_mode: SharingMode, queue_family_index_count: u32, p_queue_family_indices: [*]const u32, pre_transform: SurfaceTransformFlagsKHR, composite_alpha: CompositeAlphaFlagsKHR, present_mode: PresentModeKHR, clipped: Bool32, old_swapchain: SwapchainKHR, }; pub const PresentInfoKHR = extern struct { s_type: StructureType = .present_info_khr, p_next: ?*const anyopaque = null, wait_semaphore_count: u32, p_wait_semaphores: [*]const Semaphore, swapchain_count: u32, p_swapchains: [*]const SwapchainKHR, p_image_indices: [*]const u32, p_results: ?[*]Result, }; pub const DebugReportCallbackCreateInfoEXT = extern struct { s_type: StructureType = .debug_report_callback_create_info_ext, p_next: ?*const anyopaque = null, flags: DebugReportFlagsEXT, pfn_callback: PfnDebugReportCallbackEXT, p_user_data: ?*anyopaque, }; pub const ValidationFlagsEXT = extern struct { s_type: StructureType = .validation_flags_ext, p_next: ?*const anyopaque = null, disabled_validation_check_count: u32, p_disabled_validation_checks: [*]const ValidationCheckEXT, }; pub const ValidationFeaturesEXT = extern struct { s_type: StructureType = .validation_features_ext, p_next: ?*const anyopaque = null, enabled_validation_feature_count: u32, p_enabled_validation_features: [*]const ValidationFeatureEnableEXT, disabled_validation_feature_count: u32, p_disabled_validation_features: [*]const ValidationFeatureDisableEXT, }; pub const PipelineRasterizationStateRasterizationOrderAMD = extern struct { s_type: StructureType = .pipeline_rasterization_state_rasterization_order_amd, p_next: ?*const anyopaque = null, rasterization_order: RasterizationOrderAMD, }; pub const DebugMarkerObjectNameInfoEXT = extern struct { s_type: StructureType = .debug_marker_object_name_info_ext, p_next: ?*const anyopaque = null, object_type: DebugReportObjectTypeEXT, object: u64, p_object_name: [*:0]const u8, }; pub const DebugMarkerObjectTagInfoEXT = extern struct { s_type: StructureType = .debug_marker_object_tag_info_ext, p_next: ?*const anyopaque = null, object_type: DebugReportObjectTypeEXT, object: u64, tag_name: u64, tag_size: usize, p_tag: *const anyopaque, }; pub const DebugMarkerMarkerInfoEXT = extern struct { s_type: StructureType = .debug_marker_marker_info_ext, p_next: ?*const anyopaque = null, p_marker_name: [*:0]const u8, color: [4]f32, }; pub const DedicatedAllocationImageCreateInfoNV = extern struct { s_type: StructureType = .dedicated_allocation_image_create_info_nv, p_next: ?*const anyopaque = null, dedicated_allocation: Bool32, }; pub const DedicatedAllocationBufferCreateInfoNV = extern struct { s_type: StructureType = .dedicated_allocation_buffer_create_info_nv, p_next: ?*const anyopaque = null, dedicated_allocation: Bool32, }; pub const DedicatedAllocationMemoryAllocateInfoNV = extern struct { s_type: StructureType = .dedicated_allocation_memory_allocate_info_nv, p_next: ?*const anyopaque = null, image: Image, buffer: Buffer, }; pub const ExternalImageFormatPropertiesNV = extern struct { image_format_properties: ImageFormatProperties, external_memory_features: ExternalMemoryFeatureFlagsNV, export_from_imported_handle_types: ExternalMemoryHandleTypeFlagsNV, compatible_handle_types: ExternalMemoryHandleTypeFlagsNV, }; pub const ExternalMemoryImageCreateInfoNV = extern struct { s_type: StructureType = .external_memory_image_create_info_nv, p_next: ?*const anyopaque = null, handle_types: ExternalMemoryHandleTypeFlagsNV, }; pub const ExportMemoryAllocateInfoNV = extern struct { s_type: StructureType = .export_memory_allocate_info_nv, p_next: ?*const anyopaque = null, handle_types: ExternalMemoryHandleTypeFlagsNV, }; pub const ImportMemoryWin32HandleInfoNV = extern struct { s_type: StructureType = .import_memory_win32_handle_info_nv, p_next: ?*const anyopaque = null, handle_type: ExternalMemoryHandleTypeFlagsNV, handle: HANDLE, }; pub const ExportMemoryWin32HandleInfoNV = extern struct { s_type: StructureType = .export_memory_win32_handle_info_nv, p_next: ?*const anyopaque = null, p_attributes: ?*const SECURITY_ATTRIBUTES, dw_access: DWORD, }; pub const Win32KeyedMutexAcquireReleaseInfoNV = extern struct { s_type: StructureType = .win32_keyed_mutex_acquire_release_info_nv, p_next: ?*const anyopaque = null, acquire_count: u32, p_acquire_syncs: [*]const DeviceMemory, p_acquire_keys: [*]const u64, p_acquire_timeout_milliseconds: [*]const u32, release_count: u32, p_release_syncs: [*]const DeviceMemory, p_release_keys: [*]const u64, }; pub const PhysicalDeviceDeviceGeneratedCommandsFeaturesNV = extern struct { s_type: StructureType = .physical_device_device_generated_commands_features_nv, p_next: ?*anyopaque = null, device_generated_commands: Bool32, }; pub const DevicePrivateDataCreateInfoEXT = extern struct { s_type: StructureType = .device_private_data_create_info_ext, p_next: ?*const anyopaque = null, private_data_slot_request_count: u32, }; pub const PrivateDataSlotCreateInfoEXT = extern struct { s_type: StructureType = .private_data_slot_create_info_ext, p_next: ?*const anyopaque = null, flags: PrivateDataSlotCreateFlagsEXT, }; pub const PhysicalDevicePrivateDataFeaturesEXT = extern struct { s_type: StructureType = .physical_device_private_data_features_ext, p_next: ?*anyopaque = null, private_data: Bool32, }; pub const PhysicalDeviceDeviceGeneratedCommandsPropertiesNV = extern struct { s_type: StructureType = .physical_device_device_generated_commands_properties_nv, p_next: ?*anyopaque = null, max_graphics_shader_group_count: u32, max_indirect_sequence_count: u32, max_indirect_commands_token_count: u32, max_indirect_commands_stream_count: u32, max_indirect_commands_token_offset: u32, max_indirect_commands_stream_stride: u32, min_sequences_count_buffer_offset_alignment: u32, min_sequences_index_buffer_offset_alignment: u32, min_indirect_commands_buffer_offset_alignment: u32, }; pub const GraphicsShaderGroupCreateInfoNV = extern struct { s_type: StructureType = .graphics_shader_group_create_info_nv, p_next: ?*const anyopaque = null, stage_count: u32, p_stages: [*]const PipelineShaderStageCreateInfo, p_vertex_input_state: ?*const PipelineVertexInputStateCreateInfo, p_tessellation_state: ?*const PipelineTessellationStateCreateInfo, }; pub const GraphicsPipelineShaderGroupsCreateInfoNV = extern struct { s_type: StructureType = .graphics_pipeline_shader_groups_create_info_nv, p_next: ?*const anyopaque = null, group_count: u32, p_groups: [*]const GraphicsShaderGroupCreateInfoNV, pipeline_count: u32, p_pipelines: [*]const Pipeline, }; pub const BindShaderGroupIndirectCommandNV = extern struct { group_index: u32, }; pub const BindIndexBufferIndirectCommandNV = extern struct { buffer_address: DeviceAddress, size: u32, index_type: IndexType, }; pub const BindVertexBufferIndirectCommandNV = extern struct { buffer_address: DeviceAddress, size: u32, stride: u32, }; pub const SetStateFlagsIndirectCommandNV = extern struct { data: u32, }; pub const IndirectCommandsStreamNV = extern struct { buffer: Buffer, offset: DeviceSize, }; pub const IndirectCommandsLayoutTokenNV = extern struct { s_type: StructureType = .indirect_commands_layout_token_nv, p_next: ?*const anyopaque = null, token_type: IndirectCommandsTokenTypeNV, stream: u32, offset: u32, vertex_binding_unit: u32, vertex_dynamic_stride: Bool32, pushconstant_pipeline_layout: PipelineLayout, pushconstant_shader_stage_flags: ShaderStageFlags, pushconstant_offset: u32, pushconstant_size: u32, indirect_state_flags: IndirectStateFlagsNV, index_type_count: u32, p_index_types: [*]const IndexType, p_index_type_values: [*]const u32, }; pub const IndirectCommandsLayoutCreateInfoNV = extern struct { s_type: StructureType = .indirect_commands_layout_create_info_nv, p_next: ?*const anyopaque = null, flags: IndirectCommandsLayoutUsageFlagsNV, pipeline_bind_point: PipelineBindPoint, token_count: u32, p_tokens: [*]const IndirectCommandsLayoutTokenNV, stream_count: u32, p_stream_strides: [*]const u32, }; pub const GeneratedCommandsInfoNV = extern struct { s_type: StructureType = .generated_commands_info_nv, p_next: ?*const anyopaque = null, pipeline_bind_point: PipelineBindPoint, pipeline: Pipeline, indirect_commands_layout: IndirectCommandsLayoutNV, stream_count: u32, p_streams: [*]const IndirectCommandsStreamNV, sequences_count: u32, preprocess_buffer: Buffer, preprocess_offset: DeviceSize, preprocess_size: DeviceSize, sequences_count_buffer: Buffer, sequences_count_offset: DeviceSize, sequences_index_buffer: Buffer, sequences_index_offset: DeviceSize, }; pub const GeneratedCommandsMemoryRequirementsInfoNV = extern struct { s_type: StructureType = .generated_commands_memory_requirements_info_nv, p_next: ?*const anyopaque = null, pipeline_bind_point: PipelineBindPoint, pipeline: Pipeline, indirect_commands_layout: IndirectCommandsLayoutNV, max_sequences_count: u32, }; pub const PhysicalDeviceFeatures2 = extern struct { s_type: StructureType = .physical_device_features_2, p_next: ?*anyopaque = null, features: PhysicalDeviceFeatures, }; pub const PhysicalDeviceFeatures2KHR = PhysicalDeviceFeatures2; pub const PhysicalDeviceProperties2 = extern struct { s_type: StructureType = .physical_device_properties_2, p_next: ?*anyopaque = null, properties: PhysicalDeviceProperties, }; pub const PhysicalDeviceProperties2KHR = PhysicalDeviceProperties2; pub const FormatProperties2 = extern struct { s_type: StructureType = .format_properties_2, p_next: ?*anyopaque = null, format_properties: FormatProperties, }; pub const FormatProperties2KHR = FormatProperties2; pub const ImageFormatProperties2 = extern struct { s_type: StructureType = .image_format_properties_2, p_next: ?*anyopaque = null, image_format_properties: ImageFormatProperties, }; pub const ImageFormatProperties2KHR = ImageFormatProperties2; pub const PhysicalDeviceImageFormatInfo2 = extern struct { s_type: StructureType = .physical_device_image_format_info_2, p_next: ?*const anyopaque = null, format: Format, type: ImageType, tiling: ImageTiling, usage: ImageUsageFlags, flags: ImageCreateFlags, }; pub const PhysicalDeviceImageFormatInfo2KHR = PhysicalDeviceImageFormatInfo2; pub const QueueFamilyProperties2 = extern struct { s_type: StructureType = .queue_family_properties_2, p_next: ?*anyopaque = null, queue_family_properties: QueueFamilyProperties, }; pub const QueueFamilyProperties2KHR = QueueFamilyProperties2; pub const PhysicalDeviceMemoryProperties2 = extern struct { s_type: StructureType = .physical_device_memory_properties_2, p_next: ?*anyopaque = null, memory_properties: PhysicalDeviceMemoryProperties, }; pub const PhysicalDeviceMemoryProperties2KHR = PhysicalDeviceMemoryProperties2; pub const SparseImageFormatProperties2 = extern struct { s_type: StructureType = .sparse_image_format_properties_2, p_next: ?*anyopaque = null, properties: SparseImageFormatProperties, }; pub const SparseImageFormatProperties2KHR = SparseImageFormatProperties2; pub const PhysicalDeviceSparseImageFormatInfo2 = extern struct { s_type: StructureType = .physical_device_sparse_image_format_info_2, p_next: ?*const anyopaque = null, format: Format, type: ImageType, samples: SampleCountFlags, usage: ImageUsageFlags, tiling: ImageTiling, }; pub const PhysicalDeviceSparseImageFormatInfo2KHR = PhysicalDeviceSparseImageFormatInfo2; pub const PhysicalDevicePushDescriptorPropertiesKHR = extern struct { s_type: StructureType = .physical_device_push_descriptor_properties_khr, p_next: ?*anyopaque = null, max_push_descriptors: u32, }; pub const ConformanceVersion = extern struct { major: u8, minor: u8, subminor: u8, patch: u8, }; pub const ConformanceVersionKHR = ConformanceVersion; pub const PhysicalDeviceDriverProperties = extern struct { s_type: StructureType = .physical_device_driver_properties, p_next: ?*anyopaque = null, driver_id: DriverId, driver_name: [MAX_DRIVER_NAME_SIZE]u8, driver_info: [MAX_DRIVER_INFO_SIZE]u8, conformance_version: ConformanceVersion, }; pub const PhysicalDeviceDriverPropertiesKHR = PhysicalDeviceDriverProperties; pub const PresentRegionsKHR = extern struct { s_type: StructureType = .present_regions_khr, p_next: ?*const anyopaque = null, swapchain_count: u32, p_regions: ?[*]const PresentRegionKHR, }; pub const PresentRegionKHR = extern struct { rectangle_count: u32, p_rectangles: ?[*]const RectLayerKHR, }; pub const RectLayerKHR = extern struct { offset: Offset2D, extent: Extent2D, layer: u32, }; pub const PhysicalDeviceVariablePointersFeatures = extern struct { s_type: StructureType = .physical_device_variable_pointers_features, p_next: ?*anyopaque = null, variable_pointers_storage_buffer: Bool32, variable_pointers: Bool32, }; pub const PhysicalDeviceVariablePointersFeaturesKHR = PhysicalDeviceVariablePointersFeatures; pub const PhysicalDeviceVariablePointerFeaturesKHR = PhysicalDeviceVariablePointersFeatures; pub const PhysicalDeviceVariablePointerFeatures = PhysicalDeviceVariablePointersFeatures; pub const ExternalMemoryProperties = extern struct { external_memory_features: ExternalMemoryFeatureFlags, export_from_imported_handle_types: ExternalMemoryHandleTypeFlags, compatible_handle_types: ExternalMemoryHandleTypeFlags, }; pub const ExternalMemoryPropertiesKHR = ExternalMemoryProperties; pub const PhysicalDeviceExternalImageFormatInfo = extern struct { s_type: StructureType = .physical_device_external_image_format_info, p_next: ?*const anyopaque = null, handle_type: ExternalMemoryHandleTypeFlags, }; pub const PhysicalDeviceExternalImageFormatInfoKHR = PhysicalDeviceExternalImageFormatInfo; pub const ExternalImageFormatProperties = extern struct { s_type: StructureType = .external_image_format_properties, p_next: ?*anyopaque = null, external_memory_properties: ExternalMemoryProperties, }; pub const ExternalImageFormatPropertiesKHR = ExternalImageFormatProperties; pub const PhysicalDeviceExternalBufferInfo = extern struct { s_type: StructureType = .physical_device_external_buffer_info, p_next: ?*const anyopaque = null, flags: BufferCreateFlags, usage: BufferUsageFlags, handle_type: ExternalMemoryHandleTypeFlags, }; pub const PhysicalDeviceExternalBufferInfoKHR = PhysicalDeviceExternalBufferInfo; pub const ExternalBufferProperties = extern struct { s_type: StructureType = .external_buffer_properties, p_next: ?*anyopaque = null, external_memory_properties: ExternalMemoryProperties, }; pub const ExternalBufferPropertiesKHR = ExternalBufferProperties; pub const PhysicalDeviceIDProperties = extern struct { s_type: StructureType = .physical_device_id_properties, p_next: ?*anyopaque = null, device_uuid: [UUID_SIZE]u8, driver_uuid: [UUID_SIZE]u8, device_luid: [LUID_SIZE]u8, device_node_mask: u32, device_luid_valid: Bool32, }; pub const PhysicalDeviceIDPropertiesKHR = PhysicalDeviceIDProperties; pub const ExternalMemoryImageCreateInfo = extern struct { s_type: StructureType = .external_memory_image_create_info, p_next: ?*const anyopaque = null, handle_types: ExternalMemoryHandleTypeFlags, }; pub const ExternalMemoryImageCreateInfoKHR = ExternalMemoryImageCreateInfo; pub const ExternalMemoryBufferCreateInfo = extern struct { s_type: StructureType = .external_memory_buffer_create_info, p_next: ?*const anyopaque = null, handle_types: ExternalMemoryHandleTypeFlags, }; pub const ExternalMemoryBufferCreateInfoKHR = ExternalMemoryBufferCreateInfo; pub const ExportMemoryAllocateInfo = extern struct { s_type: StructureType = .export_memory_allocate_info, p_next: ?*const anyopaque = null, handle_types: ExternalMemoryHandleTypeFlags, }; pub const ExportMemoryAllocateInfoKHR = ExportMemoryAllocateInfo; pub const ImportMemoryWin32HandleInfoKHR = extern struct { s_type: StructureType = .import_memory_win32_handle_info_khr, p_next: ?*const anyopaque = null, handle_type: ExternalMemoryHandleTypeFlags, handle: HANDLE, name: LPCWSTR, }; pub const ExportMemoryWin32HandleInfoKHR = extern struct { s_type: StructureType = .export_memory_win32_handle_info_khr, p_next: ?*const anyopaque = null, p_attributes: ?*const SECURITY_ATTRIBUTES, dw_access: DWORD, name: LPCWSTR, }; pub const ImportMemoryZirconHandleInfoFUCHSIA = extern struct { s_type: StructureType = .import_memory_zircon_handle_info_fuchsia, p_next: *const anyopaque = null, handle_type: ExternalMemoryHandleTypeFlags, handle: zx_handle_t, }; pub const MemoryZirconHandlePropertiesFUCHSIA = extern struct { s_type: StructureType = .memory_zircon_handle_properties_fuchsia, p_next: *anyopaque = null, memory_type_bits: u32, }; pub const MemoryGetZirconHandleInfoFUCHSIA = extern struct { s_type: StructureType = .memory_get_zircon_handle_info_fuchsia, p_next: *const anyopaque = null, memory: DeviceMemory, handle_type: ExternalMemoryHandleTypeFlags, }; pub const MemoryWin32HandlePropertiesKHR = extern struct { s_type: StructureType = .memory_win32_handle_properties_khr, p_next: ?*anyopaque = null, memory_type_bits: u32, }; pub const MemoryGetWin32HandleInfoKHR = extern struct { s_type: StructureType = .memory_get_win32_handle_info_khr, p_next: ?*const anyopaque = null, memory: DeviceMemory, handle_type: ExternalMemoryHandleTypeFlags, }; pub const ImportMemoryFdInfoKHR = extern struct { s_type: StructureType = .import_memory_fd_info_khr, p_next: ?*const anyopaque = null, handle_type: ExternalMemoryHandleTypeFlags, fd: c_int, }; pub const MemoryFdPropertiesKHR = extern struct { s_type: StructureType = .memory_fd_properties_khr, p_next: ?*anyopaque = null, memory_type_bits: u32, }; pub const MemoryGetFdInfoKHR = extern struct { s_type: StructureType = .memory_get_fd_info_khr, p_next: ?*const anyopaque = null, memory: DeviceMemory, handle_type: ExternalMemoryHandleTypeFlags, }; pub const Win32KeyedMutexAcquireReleaseInfoKHR = extern struct { s_type: StructureType = .win32_keyed_mutex_acquire_release_info_khr, p_next: ?*const anyopaque = null, acquire_count: u32, p_acquire_syncs: [*]const DeviceMemory, p_acquire_keys: [*]const u64, p_acquire_timeouts: [*]const u32, release_count: u32, p_release_syncs: [*]const DeviceMemory, p_release_keys: [*]const u64, }; pub const PhysicalDeviceExternalSemaphoreInfo = extern struct { s_type: StructureType = .physical_device_external_semaphore_info, p_next: ?*const anyopaque = null, handle_type: ExternalSemaphoreHandleTypeFlags, }; pub const PhysicalDeviceExternalSemaphoreInfoKHR = PhysicalDeviceExternalSemaphoreInfo; pub const ExternalSemaphoreProperties = extern struct { s_type: StructureType = .external_semaphore_properties, p_next: ?*anyopaque = null, export_from_imported_handle_types: ExternalSemaphoreHandleTypeFlags, compatible_handle_types: ExternalSemaphoreHandleTypeFlags, external_semaphore_features: ExternalSemaphoreFeatureFlags, }; pub const ExternalSemaphorePropertiesKHR = ExternalSemaphoreProperties; pub const ExportSemaphoreCreateInfo = extern struct { s_type: StructureType = .export_semaphore_create_info, p_next: ?*const anyopaque = null, handle_types: ExternalSemaphoreHandleTypeFlags, }; pub const ExportSemaphoreCreateInfoKHR = ExportSemaphoreCreateInfo; pub const ImportSemaphoreWin32HandleInfoKHR = extern struct { s_type: StructureType = .import_semaphore_win32_handle_info_khr, p_next: ?*const anyopaque = null, semaphore: Semaphore, flags: SemaphoreImportFlags, handle_type: ExternalSemaphoreHandleTypeFlags, handle: HANDLE, name: LPCWSTR, }; pub const ExportSemaphoreWin32HandleInfoKHR = extern struct { s_type: StructureType = .export_semaphore_win32_handle_info_khr, p_next: ?*const anyopaque = null, p_attributes: ?*const SECURITY_ATTRIBUTES, dw_access: DWORD, name: LPCWSTR, }; pub const D3D12FenceSubmitInfoKHR = extern struct { s_type: StructureType = .d3d12_fence_submit_info_khr, p_next: ?*const anyopaque = null, wait_semaphore_values_count: u32, p_wait_semaphore_values: ?[*]const u64, signal_semaphore_values_count: u32, p_signal_semaphore_values: ?[*]const u64, }; pub const SemaphoreGetWin32HandleInfoKHR = extern struct { s_type: StructureType = .semaphore_get_win32_handle_info_khr, p_next: ?*const anyopaque = null, semaphore: Semaphore, handle_type: ExternalSemaphoreHandleTypeFlags, }; pub const ImportSemaphoreFdInfoKHR = extern struct { s_type: StructureType = .import_semaphore_fd_info_khr, p_next: ?*const anyopaque = null, semaphore: Semaphore, flags: SemaphoreImportFlags, handle_type: ExternalSemaphoreHandleTypeFlags, fd: c_int, }; pub const SemaphoreGetFdInfoKHR = extern struct { s_type: StructureType = .semaphore_get_fd_info_khr, p_next: ?*const anyopaque = null, semaphore: Semaphore, handle_type: ExternalSemaphoreHandleTypeFlags, }; pub const ImportSemaphoreZirconHandleInfoFUCHSIA = extern struct { s_type: StructureType = .import_semaphore_zircon_handle_info_fuchsia, p_next: ?*const anyopaque = null, semaphore: Semaphore, flags: SemaphoreImportFlags, handle_type: ExternalSemaphoreHandleTypeFlags, zircon_handle: zx_handle_t, }; pub const SemaphoreGetZirconHandleInfoFUCHSIA = extern struct { s_type: StructureType = .semaphore_get_zircon_handle_info_fuchsia, p_next: ?*const anyopaque = null, semaphore: Semaphore, handle_type: ExternalSemaphoreHandleTypeFlags, }; pub const PhysicalDeviceExternalFenceInfo = extern struct { s_type: StructureType = .physical_device_external_fence_info, p_next: ?*const anyopaque = null, handle_type: ExternalFenceHandleTypeFlags, }; pub const PhysicalDeviceExternalFenceInfoKHR = PhysicalDeviceExternalFenceInfo; pub const ExternalFenceProperties = extern struct { s_type: StructureType = .external_fence_properties, p_next: ?*anyopaque = null, export_from_imported_handle_types: ExternalFenceHandleTypeFlags, compatible_handle_types: ExternalFenceHandleTypeFlags, external_fence_features: ExternalFenceFeatureFlags, }; pub const ExternalFencePropertiesKHR = ExternalFenceProperties; pub const ExportFenceCreateInfo = extern struct { s_type: StructureType = .export_fence_create_info, p_next: ?*const anyopaque = null, handle_types: ExternalFenceHandleTypeFlags, }; pub const ExportFenceCreateInfoKHR = ExportFenceCreateInfo; pub const ImportFenceWin32HandleInfoKHR = extern struct { s_type: StructureType = .import_fence_win32_handle_info_khr, p_next: ?*const anyopaque = null, fence: Fence, flags: FenceImportFlags, handle_type: ExternalFenceHandleTypeFlags, handle: HANDLE, name: LPCWSTR, }; pub const ExportFenceWin32HandleInfoKHR = extern struct { s_type: StructureType = .export_fence_win32_handle_info_khr, p_next: ?*const anyopaque = null, p_attributes: ?*const SECURITY_ATTRIBUTES, dw_access: DWORD, name: LPCWSTR, }; pub const FenceGetWin32HandleInfoKHR = extern struct { s_type: StructureType = .fence_get_win32_handle_info_khr, p_next: ?*const anyopaque = null, fence: Fence, handle_type: ExternalFenceHandleTypeFlags, }; pub const ImportFenceFdInfoKHR = extern struct { s_type: StructureType = .import_fence_fd_info_khr, p_next: ?*const anyopaque = null, fence: Fence, flags: FenceImportFlags, handle_type: ExternalFenceHandleTypeFlags, fd: c_int, }; pub const FenceGetFdInfoKHR = extern struct { s_type: StructureType = .fence_get_fd_info_khr, p_next: ?*const anyopaque = null, fence: Fence, handle_type: ExternalFenceHandleTypeFlags, }; pub const PhysicalDeviceMultiviewFeatures = extern struct { s_type: StructureType = .physical_device_multiview_features, p_next: ?*anyopaque = null, multiview: Bool32, multiview_geometry_shader: Bool32, multiview_tessellation_shader: Bool32, }; pub const PhysicalDeviceMultiviewFeaturesKHR = PhysicalDeviceMultiviewFeatures; pub const PhysicalDeviceMultiviewProperties = extern struct { s_type: StructureType = .physical_device_multiview_properties, p_next: ?*anyopaque = null, max_multiview_view_count: u32, max_multiview_instance_index: u32, }; pub const PhysicalDeviceMultiviewPropertiesKHR = PhysicalDeviceMultiviewProperties; pub const RenderPassMultiviewCreateInfo = extern struct { s_type: StructureType = .render_pass_multiview_create_info, p_next: ?*const anyopaque = null, subpass_count: u32, p_view_masks: [*]const u32, dependency_count: u32, p_view_offsets: [*]const i32, correlation_mask_count: u32, p_correlation_masks: [*]const u32, }; pub const RenderPassMultiviewCreateInfoKHR = RenderPassMultiviewCreateInfo; pub const SurfaceCapabilities2EXT = extern struct { s_type: StructureType = .surface_capabilities_2_ext, p_next: ?*anyopaque = null, min_image_count: u32, max_image_count: u32, current_extent: Extent2D, min_image_extent: Extent2D, max_image_extent: Extent2D, max_image_array_layers: u32, supported_transforms: SurfaceTransformFlagsKHR, current_transform: SurfaceTransformFlagsKHR, supported_composite_alpha: CompositeAlphaFlagsKHR, supported_usage_flags: ImageUsageFlags, supported_surface_counters: SurfaceCounterFlagsEXT, }; pub const DisplayPowerInfoEXT = extern struct { s_type: StructureType = .display_power_info_ext, p_next: ?*const anyopaque = null, power_state: DisplayPowerStateEXT, }; pub const DeviceEventInfoEXT = extern struct { s_type: StructureType = .device_event_info_ext, p_next: ?*const anyopaque = null, device_event: DeviceEventTypeEXT, }; pub const DisplayEventInfoEXT = extern struct { s_type: StructureType = .display_event_info_ext, p_next: ?*const anyopaque = null, display_event: DisplayEventTypeEXT, }; pub const SwapchainCounterCreateInfoEXT = extern struct { s_type: StructureType = .swapchain_counter_create_info_ext, p_next: ?*const anyopaque = null, surface_counters: SurfaceCounterFlagsEXT, }; pub const PhysicalDeviceGroupProperties = extern struct { s_type: StructureType = .physical_device_group_properties, p_next: ?*anyopaque = null, physical_device_count: u32, physical_devices: [MAX_DEVICE_GROUP_SIZE]PhysicalDevice, subset_allocation: Bool32, }; pub const PhysicalDeviceGroupPropertiesKHR = PhysicalDeviceGroupProperties; pub const MemoryAllocateFlagsInfo = extern struct { s_type: StructureType = .memory_allocate_flags_info, p_next: ?*const anyopaque = null, flags: MemoryAllocateFlags, device_mask: u32, }; pub const MemoryAllocateFlagsInfoKHR = MemoryAllocateFlagsInfo; pub const BindBufferMemoryInfo = extern struct { s_type: StructureType = .bind_buffer_memory_info, p_next: ?*const anyopaque = null, buffer: Buffer, memory: DeviceMemory, memory_offset: DeviceSize, }; pub const BindBufferMemoryInfoKHR = BindBufferMemoryInfo; pub const BindBufferMemoryDeviceGroupInfo = extern struct { s_type: StructureType = .bind_buffer_memory_device_group_info, p_next: ?*const anyopaque = null, device_index_count: u32, p_device_indices: [*]const u32, }; pub const BindBufferMemoryDeviceGroupInfoKHR = BindBufferMemoryDeviceGroupInfo; pub const BindImageMemoryInfo = extern struct { s_type: StructureType = .bind_image_memory_info, p_next: ?*const anyopaque = null, image: Image, memory: DeviceMemory, memory_offset: DeviceSize, }; pub const BindImageMemoryInfoKHR = BindImageMemoryInfo; pub const BindImageMemoryDeviceGroupInfo = extern struct { s_type: StructureType = .bind_image_memory_device_group_info, p_next: ?*const anyopaque = null, device_index_count: u32, p_device_indices: [*]const u32, split_instance_bind_region_count: u32, p_split_instance_bind_regions: [*]const Rect2D, }; pub const BindImageMemoryDeviceGroupInfoKHR = BindImageMemoryDeviceGroupInfo; pub const DeviceGroupRenderPassBeginInfo = extern struct { s_type: StructureType = .device_group_render_pass_begin_info, p_next: ?*const anyopaque = null, device_mask: u32, device_render_area_count: u32, p_device_render_areas: [*]const Rect2D, }; pub const DeviceGroupRenderPassBeginInfoKHR = DeviceGroupRenderPassBeginInfo; pub const DeviceGroupCommandBufferBeginInfo = extern struct { s_type: StructureType = .device_group_command_buffer_begin_info, p_next: ?*const anyopaque = null, device_mask: u32, }; pub const DeviceGroupCommandBufferBeginInfoKHR = DeviceGroupCommandBufferBeginInfo; pub const DeviceGroupSubmitInfo = extern struct { s_type: StructureType = .device_group_submit_info, p_next: ?*const anyopaque = null, wait_semaphore_count: u32, p_wait_semaphore_device_indices: [*]const u32, command_buffer_count: u32, p_command_buffer_device_masks: [*]const u32, signal_semaphore_count: u32, p_signal_semaphore_device_indices: [*]const u32, }; pub const DeviceGroupSubmitInfoKHR = DeviceGroupSubmitInfo; pub const DeviceGroupBindSparseInfo = extern struct { s_type: StructureType = .device_group_bind_sparse_info, p_next: ?*const anyopaque = null, resource_device_index: u32, memory_device_index: u32, }; pub const DeviceGroupBindSparseInfoKHR = DeviceGroupBindSparseInfo; pub const DeviceGroupPresentCapabilitiesKHR = extern struct { s_type: StructureType = .device_group_present_capabilities_khr, p_next: ?*const anyopaque = null, present_mask: [MAX_DEVICE_GROUP_SIZE]u32, modes: DeviceGroupPresentModeFlagsKHR, }; pub const ImageSwapchainCreateInfoKHR = extern struct { s_type: StructureType = .image_swapchain_create_info_khr, p_next: ?*const anyopaque = null, swapchain: SwapchainKHR, }; pub const BindImageMemorySwapchainInfoKHR = extern struct { s_type: StructureType = .bind_image_memory_swapchain_info_khr, p_next: ?*const anyopaque = null, swapchain: SwapchainKHR, image_index: u32, }; pub const AcquireNextImageInfoKHR = extern struct { s_type: StructureType = .acquire_next_image_info_khr, p_next: ?*const anyopaque = null, swapchain: SwapchainKHR, timeout: u64, semaphore: Semaphore, fence: Fence, device_mask: u32, }; pub const DeviceGroupPresentInfoKHR = extern struct { s_type: StructureType = .device_group_present_info_khr, p_next: ?*const anyopaque = null, swapchain_count: u32, p_device_masks: [*]const u32, mode: DeviceGroupPresentModeFlagsKHR, }; pub const DeviceGroupDeviceCreateInfo = extern struct { s_type: StructureType = .device_group_device_create_info, p_next: ?*const anyopaque = null, physical_device_count: u32, p_physical_devices: [*]const PhysicalDevice, }; pub const DeviceGroupDeviceCreateInfoKHR = DeviceGroupDeviceCreateInfo; pub const DeviceGroupSwapchainCreateInfoKHR = extern struct { s_type: StructureType = .device_group_swapchain_create_info_khr, p_next: ?*const anyopaque = null, modes: DeviceGroupPresentModeFlagsKHR, }; pub const DescriptorUpdateTemplateEntry = extern struct { dst_binding: u32, dst_array_element: u32, descriptor_count: u32, descriptor_type: DescriptorType, offset: usize, stride: usize, }; pub const DescriptorUpdateTemplateEntryKHR = DescriptorUpdateTemplateEntry; pub const DescriptorUpdateTemplateCreateInfo = extern struct { s_type: StructureType = .descriptor_update_template_create_info, p_next: ?*const anyopaque = null, flags: DescriptorUpdateTemplateCreateFlags, descriptor_update_entry_count: u32, p_descriptor_update_entries: [*]const DescriptorUpdateTemplateEntry, template_type: DescriptorUpdateTemplateType, descriptor_set_layout: DescriptorSetLayout, pipeline_bind_point: PipelineBindPoint, pipeline_layout: PipelineLayout, set: u32, }; pub const DescriptorUpdateTemplateCreateInfoKHR = DescriptorUpdateTemplateCreateInfo; pub const XYColorEXT = extern struct { x: f32, y: f32, }; pub const HdrMetadataEXT = extern struct { s_type: StructureType = .hdr_metadata_ext, p_next: ?*const anyopaque = null, display_primary_red: XYColorEXT, display_primary_green: XYColorEXT, display_primary_blue: XYColorEXT, white_point: XYColorEXT, max_luminance: f32, min_luminance: f32, max_content_light_level: f32, max_frame_average_light_level: f32, }; pub const DisplayNativeHdrSurfaceCapabilitiesAMD = extern struct { s_type: StructureType = .display_native_hdr_surface_capabilities_amd, p_next: ?*anyopaque = null, local_dimming_support: Bool32, }; pub const SwapchainDisplayNativeHdrCreateInfoAMD = extern struct { s_type: StructureType = .swapchain_display_native_hdr_create_info_amd, p_next: ?*const anyopaque = null, local_dimming_enable: Bool32, }; pub const RefreshCycleDurationGOOGLE = extern struct { refresh_duration: u64, }; pub const PastPresentationTimingGOOGLE = extern struct { present_id: u32, desired_present_time: u64, actual_present_time: u64, earliest_present_time: u64, present_margin: u64, }; pub const PresentTimesInfoGOOGLE = extern struct { s_type: StructureType = .present_times_info_google, p_next: ?*const anyopaque = null, swapchain_count: u32, p_times: ?[*]const PresentTimeGOOGLE, }; pub const PresentTimeGOOGLE = extern struct { present_id: u32, desired_present_time: u64, }; pub const IOSSurfaceCreateInfoMVK = extern struct { s_type: StructureType = .ios_surface_create_info_mvk, p_next: ?*const anyopaque = null, flags: IOSSurfaceCreateFlagsMVK, p_view: *const anyopaque, }; pub const MacOSSurfaceCreateInfoMVK = extern struct { s_type: StructureType = .macos_surface_create_info_mvk, p_next: ?*const anyopaque = null, flags: MacOSSurfaceCreateFlagsMVK, p_view: *const anyopaque, }; pub const MetalSurfaceCreateInfoEXT = extern struct { s_type: StructureType = .metal_surface_create_info_ext, p_next: ?*const anyopaque = null, flags: MetalSurfaceCreateFlagsEXT, p_layer: *const CAMetalLayer, }; pub const ViewportWScalingNV = extern struct { xcoeff: f32, ycoeff: f32, }; pub const PipelineViewportWScalingStateCreateInfoNV = extern struct { s_type: StructureType = .pipeline_viewport_w_scaling_state_create_info_nv, p_next: ?*const anyopaque = null, viewport_w_scaling_enable: Bool32, viewport_count: u32, p_viewport_w_scalings: ?[*]const ViewportWScalingNV, }; pub const ViewportSwizzleNV = extern struct { x: ViewportCoordinateSwizzleNV, y: ViewportCoordinateSwizzleNV, z: ViewportCoordinateSwizzleNV, w: ViewportCoordinateSwizzleNV, }; pub const PipelineViewportSwizzleStateCreateInfoNV = extern struct { s_type: StructureType = .pipeline_viewport_swizzle_state_create_info_nv, p_next: ?*const anyopaque = null, flags: PipelineViewportSwizzleStateCreateFlagsNV, viewport_count: u32, p_viewport_swizzles: [*]const ViewportSwizzleNV, }; pub const PhysicalDeviceDiscardRectanglePropertiesEXT = extern struct { s_type: StructureType = .physical_device_discard_rectangle_properties_ext, p_next: ?*anyopaque = null, max_discard_rectangles: u32, }; pub const PipelineDiscardRectangleStateCreateInfoEXT = extern struct { s_type: StructureType = .pipeline_discard_rectangle_state_create_info_ext, p_next: ?*const anyopaque = null, flags: PipelineDiscardRectangleStateCreateFlagsEXT, discard_rectangle_mode: DiscardRectangleModeEXT, discard_rectangle_count: u32, p_discard_rectangles: [*]const Rect2D, }; pub const PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX = extern struct { s_type: StructureType = .physical_device_multiview_per_view_attributes_properties_nvx, p_next: ?*anyopaque = null, per_view_position_all_components: Bool32, }; pub const InputAttachmentAspectReference = extern struct { subpass: u32, input_attachment_index: u32, aspect_mask: ImageAspectFlags, }; pub const InputAttachmentAspectReferenceKHR = InputAttachmentAspectReference; pub const RenderPassInputAttachmentAspectCreateInfo = extern struct { s_type: StructureType = .render_pass_input_attachment_aspect_create_info, p_next: ?*const anyopaque = null, aspect_reference_count: u32, p_aspect_references: [*]const InputAttachmentAspectReference, }; pub const RenderPassInputAttachmentAspectCreateInfoKHR = RenderPassInputAttachmentAspectCreateInfo; pub const PhysicalDeviceSurfaceInfo2KHR = extern struct { s_type: StructureType = .physical_device_surface_info_2_khr, p_next: ?*const anyopaque = null, surface: SurfaceKHR, }; pub const SurfaceCapabilities2KHR = extern struct { s_type: StructureType = .surface_capabilities_2_khr, p_next: ?*anyopaque = null, surface_capabilities: SurfaceCapabilitiesKHR, }; pub const SurfaceFormat2KHR = extern struct { s_type: StructureType = .surface_format_2_khr, p_next: ?*anyopaque = null, surface_format: SurfaceFormatKHR, }; pub const DisplayProperties2KHR = extern struct { s_type: StructureType = .display_properties_2_khr, p_next: ?*anyopaque = null, display_properties: DisplayPropertiesKHR, }; pub const DisplayPlaneProperties2KHR = extern struct { s_type: StructureType = .display_plane_properties_2_khr, p_next: ?*anyopaque = null, display_plane_properties: DisplayPlanePropertiesKHR, }; pub const DisplayModeProperties2KHR = extern struct { s_type: StructureType = .display_mode_properties_2_khr, p_next: ?*anyopaque = null, display_mode_properties: DisplayModePropertiesKHR, }; pub const DisplayPlaneInfo2KHR = extern struct { s_type: StructureType = .display_plane_info_2_khr, p_next: ?*const anyopaque = null, mode: DisplayModeKHR, plane_index: u32, }; pub const DisplayPlaneCapabilities2KHR = extern struct { s_type: StructureType = .display_plane_capabilities_2_khr, p_next: ?*anyopaque = null, capabilities: DisplayPlaneCapabilitiesKHR, }; pub const SharedPresentSurfaceCapabilitiesKHR = extern struct { s_type: StructureType = .shared_present_surface_capabilities_khr, p_next: ?*anyopaque = null, shared_present_supported_usage_flags: ImageUsageFlags, }; pub const PhysicalDevice16BitStorageFeatures = extern struct { s_type: StructureType = .physical_device_16bit_storage_features, p_next: ?*anyopaque = null, storage_buffer_16_bit_access: Bool32, uniform_and_storage_buffer_16_bit_access: Bool32, storage_push_constant_16: Bool32, storage_input_output_16: Bool32, }; pub const PhysicalDevice16BitStorageFeaturesKHR = PhysicalDevice16BitStorageFeatures; pub const PhysicalDeviceSubgroupProperties = extern struct { s_type: StructureType = .physical_device_subgroup_properties, p_next: ?*anyopaque = null, subgroup_size: u32, supported_stages: ShaderStageFlags, supported_operations: SubgroupFeatureFlags, quad_operations_in_all_stages: Bool32, }; pub const PhysicalDeviceShaderSubgroupExtendedTypesFeatures = extern struct { s_type: StructureType = .physical_device_shader_subgroup_extended_types_features, p_next: ?*anyopaque = null, shader_subgroup_extended_types: Bool32, }; pub const PhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR = PhysicalDeviceShaderSubgroupExtendedTypesFeatures; pub const BufferMemoryRequirementsInfo2 = extern struct { s_type: StructureType = .buffer_memory_requirements_info_2, p_next: ?*const anyopaque = null, buffer: Buffer, }; pub const BufferMemoryRequirementsInfo2KHR = BufferMemoryRequirementsInfo2; pub const ImageMemoryRequirementsInfo2 = extern struct { s_type: StructureType = .image_memory_requirements_info_2, p_next: ?*const anyopaque = null, image: Image, }; pub const ImageMemoryRequirementsInfo2KHR = ImageMemoryRequirementsInfo2; pub const ImageSparseMemoryRequirementsInfo2 = extern struct { s_type: StructureType = .image_sparse_memory_requirements_info_2, p_next: ?*const anyopaque = null, image: Image, }; pub const ImageSparseMemoryRequirementsInfo2KHR = ImageSparseMemoryRequirementsInfo2; pub const MemoryRequirements2 = extern struct { s_type: StructureType = .memory_requirements_2, p_next: ?*anyopaque = null, memory_requirements: MemoryRequirements, }; pub const MemoryRequirements2KHR = MemoryRequirements2; pub const SparseImageMemoryRequirements2 = extern struct { s_type: StructureType = .sparse_image_memory_requirements_2, p_next: ?*anyopaque = null, memory_requirements: SparseImageMemoryRequirements, }; pub const SparseImageMemoryRequirements2KHR = SparseImageMemoryRequirements2; pub const PhysicalDevicePointClippingProperties = extern struct { s_type: StructureType = .physical_device_point_clipping_properties, p_next: ?*anyopaque = null, point_clipping_behavior: PointClippingBehavior, }; pub const PhysicalDevicePointClippingPropertiesKHR = PhysicalDevicePointClippingProperties; pub const MemoryDedicatedRequirements = extern struct { s_type: StructureType = .memory_dedicated_requirements, p_next: ?*anyopaque = null, prefers_dedicated_allocation: Bool32, requires_dedicated_allocation: Bool32, }; pub const MemoryDedicatedRequirementsKHR = MemoryDedicatedRequirements; pub const MemoryDedicatedAllocateInfo = extern struct { s_type: StructureType = .memory_dedicated_allocate_info, p_next: ?*const anyopaque = null, image: Image, buffer: Buffer, }; pub const MemoryDedicatedAllocateInfoKHR = MemoryDedicatedAllocateInfo; pub const ImageViewUsageCreateInfo = extern struct { s_type: StructureType = .image_view_usage_create_info, p_next: ?*const anyopaque = null, usage: ImageUsageFlags, }; pub const ImageViewUsageCreateInfoKHR = ImageViewUsageCreateInfo; pub const PipelineTessellationDomainOriginStateCreateInfo = extern struct { s_type: StructureType = .pipeline_tessellation_domain_origin_state_create_info, p_next: ?*const anyopaque = null, domain_origin: TessellationDomainOrigin, }; pub const PipelineTessellationDomainOriginStateCreateInfoKHR = PipelineTessellationDomainOriginStateCreateInfo; pub const SamplerYcbcrConversionInfo = extern struct { s_type: StructureType = .sampler_ycbcr_conversion_info, p_next: ?*const anyopaque = null, conversion: SamplerYcbcrConversion, }; pub const SamplerYcbcrConversionInfoKHR = SamplerYcbcrConversionInfo; pub const SamplerYcbcrConversionCreateInfo = extern struct { s_type: StructureType = .sampler_ycbcr_conversion_create_info, p_next: ?*const anyopaque = null, format: Format, ycbcr_model: SamplerYcbcrModelConversion, ycbcr_range: SamplerYcbcrRange, components: ComponentMapping, x_chroma_offset: ChromaLocation, y_chroma_offset: ChromaLocation, chroma_filter: Filter, force_explicit_reconstruction: Bool32, }; pub const SamplerYcbcrConversionCreateInfoKHR = SamplerYcbcrConversionCreateInfo; pub const BindImagePlaneMemoryInfo = extern struct { s_type: StructureType = .bind_image_plane_memory_info, p_next: ?*const anyopaque = null, plane_aspect: ImageAspectFlags, }; pub const BindImagePlaneMemoryInfoKHR = BindImagePlaneMemoryInfo; pub const ImagePlaneMemoryRequirementsInfo = extern struct { s_type: StructureType = .image_plane_memory_requirements_info, p_next: ?*const anyopaque = null, plane_aspect: ImageAspectFlags, }; pub const ImagePlaneMemoryRequirementsInfoKHR = ImagePlaneMemoryRequirementsInfo; pub const PhysicalDeviceSamplerYcbcrConversionFeatures = extern struct { s_type: StructureType = .physical_device_sampler_ycbcr_conversion_features, p_next: ?*anyopaque = null, sampler_ycbcr_conversion: Bool32, }; pub const PhysicalDeviceSamplerYcbcrConversionFeaturesKHR = PhysicalDeviceSamplerYcbcrConversionFeatures; pub const SamplerYcbcrConversionImageFormatProperties = extern struct { s_type: StructureType = .sampler_ycbcr_conversion_image_format_properties, p_next: ?*anyopaque = null, combined_image_sampler_descriptor_count: u32, }; pub const SamplerYcbcrConversionImageFormatPropertiesKHR = SamplerYcbcrConversionImageFormatProperties; pub const TextureLODGatherFormatPropertiesAMD = extern struct { s_type: StructureType = .texture_lod_gather_format_properties_amd, p_next: ?*anyopaque = null, supports_texture_gather_lod_bias_amd: Bool32, }; pub const ConditionalRenderingBeginInfoEXT = extern struct { s_type: StructureType = .conditional_rendering_begin_info_ext, p_next: ?*const anyopaque = null, buffer: Buffer, offset: DeviceSize, flags: ConditionalRenderingFlagsEXT, }; pub const ProtectedSubmitInfo = extern struct { s_type: StructureType = .protected_submit_info, p_next: ?*const anyopaque = null, protected_submit: Bool32, }; pub const PhysicalDeviceProtectedMemoryFeatures = extern struct { s_type: StructureType = .physical_device_protected_memory_features, p_next: ?*anyopaque = null, protected_memory: Bool32, }; pub const PhysicalDeviceProtectedMemoryProperties = extern struct { s_type: StructureType = .physical_device_protected_memory_properties, p_next: ?*anyopaque = null, protected_no_fault: Bool32, }; pub const DeviceQueueInfo2 = extern struct { s_type: StructureType = .device_queue_info_2, p_next: ?*const anyopaque = null, flags: DeviceQueueCreateFlags, queue_family_index: u32, queue_index: u32, }; pub const PipelineCoverageToColorStateCreateInfoNV = extern struct { s_type: StructureType = .pipeline_coverage_to_color_state_create_info_nv, p_next: ?*const anyopaque = null, flags: PipelineCoverageToColorStateCreateFlagsNV, coverage_to_color_enable: Bool32, coverage_to_color_location: u32, }; pub const PhysicalDeviceSamplerFilterMinmaxProperties = extern struct { s_type: StructureType = .physical_device_sampler_filter_minmax_properties, p_next: ?*anyopaque = null, filter_minmax_single_component_formats: Bool32, filter_minmax_image_component_mapping: Bool32, }; pub const PhysicalDeviceSamplerFilterMinmaxPropertiesEXT = PhysicalDeviceSamplerFilterMinmaxProperties; pub const SampleLocationEXT = extern struct { x: f32, y: f32, }; pub const SampleLocationsInfoEXT = extern struct { s_type: StructureType = .sample_locations_info_ext, p_next: ?*const anyopaque = null, sample_locations_per_pixel: SampleCountFlags, sample_location_grid_size: Extent2D, sample_locations_count: u32, p_sample_locations: [*]const SampleLocationEXT, }; pub const AttachmentSampleLocationsEXT = extern struct { attachment_index: u32, sample_locations_info: SampleLocationsInfoEXT, }; pub const SubpassSampleLocationsEXT = extern struct { subpass_index: u32, sample_locations_info: SampleLocationsInfoEXT, }; pub const RenderPassSampleLocationsBeginInfoEXT = extern struct { s_type: StructureType = .render_pass_sample_locations_begin_info_ext, p_next: ?*const anyopaque = null, attachment_initial_sample_locations_count: u32, p_attachment_initial_sample_locations: [*]const AttachmentSampleLocationsEXT, post_subpass_sample_locations_count: u32, p_post_subpass_sample_locations: [*]const SubpassSampleLocationsEXT, }; pub const PipelineSampleLocationsStateCreateInfoEXT = extern struct { s_type: StructureType = .pipeline_sample_locations_state_create_info_ext, p_next: ?*const anyopaque = null, sample_locations_enable: Bool32, sample_locations_info: SampleLocationsInfoEXT, }; pub const PhysicalDeviceSampleLocationsPropertiesEXT = extern struct { s_type: StructureType = .physical_device_sample_locations_properties_ext, p_next: ?*anyopaque = null, sample_location_sample_counts: SampleCountFlags, max_sample_location_grid_size: Extent2D, sample_location_coordinate_range: [2]f32, sample_location_sub_pixel_bits: u32, variable_sample_locations: Bool32, }; pub const MultisamplePropertiesEXT = extern struct { s_type: StructureType = .multisample_properties_ext, p_next: ?*anyopaque = null, max_sample_location_grid_size: Extent2D, }; pub const SamplerReductionModeCreateInfo = extern struct { s_type: StructureType = .sampler_reduction_mode_create_info, p_next: ?*const anyopaque = null, reduction_mode: SamplerReductionMode, }; pub const SamplerReductionModeCreateInfoEXT = SamplerReductionModeCreateInfo; pub const PhysicalDeviceBlendOperationAdvancedFeaturesEXT = extern struct { s_type: StructureType = .physical_device_blend_operation_advanced_features_ext, p_next: ?*anyopaque = null, advanced_blend_coherent_operations: Bool32, }; pub const PhysicalDeviceBlendOperationAdvancedPropertiesEXT = extern struct { s_type: StructureType = .physical_device_blend_operation_advanced_properties_ext, p_next: ?*anyopaque = null, advanced_blend_max_color_attachments: u32, advanced_blend_independent_blend: Bool32, advanced_blend_non_premultiplied_src_color: Bool32, advanced_blend_non_premultiplied_dst_color: Bool32, advanced_blend_correlated_overlap: Bool32, advanced_blend_all_operations: Bool32, }; pub const PipelineColorBlendAdvancedStateCreateInfoEXT = extern struct { s_type: StructureType = .pipeline_color_blend_advanced_state_create_info_ext, p_next: ?*const anyopaque = null, src_premultiplied: Bool32, dst_premultiplied: Bool32, blend_overlap: BlendOverlapEXT, }; pub const PhysicalDeviceInlineUniformBlockFeaturesEXT = extern struct { s_type: StructureType = .physical_device_inline_uniform_block_features_ext, p_next: ?*anyopaque = null, inline_uniform_block: Bool32, descriptor_binding_inline_uniform_block_update_after_bind: Bool32, }; pub const PhysicalDeviceInlineUniformBlockPropertiesEXT = extern struct { s_type: StructureType = .physical_device_inline_uniform_block_properties_ext, p_next: ?*anyopaque = null, max_inline_uniform_block_size: u32, max_per_stage_descriptor_inline_uniform_blocks: u32, max_per_stage_descriptor_update_after_bind_inline_uniform_blocks: u32, max_descriptor_set_inline_uniform_blocks: u32, max_descriptor_set_update_after_bind_inline_uniform_blocks: u32, }; pub const WriteDescriptorSetInlineUniformBlockEXT = extern struct { s_type: StructureType = .write_descriptor_set_inline_uniform_block_ext, p_next: ?*const anyopaque = null, data_size: u32, p_data: *const anyopaque, }; pub const DescriptorPoolInlineUniformBlockCreateInfoEXT = extern struct { s_type: StructureType = .descriptor_pool_inline_uniform_block_create_info_ext, p_next: ?*const anyopaque = null, max_inline_uniform_block_bindings: u32, }; pub const PipelineCoverageModulationStateCreateInfoNV = extern struct { s_type: StructureType = .pipeline_coverage_modulation_state_create_info_nv, p_next: ?*const anyopaque = null, flags: PipelineCoverageModulationStateCreateFlagsNV, coverage_modulation_mode: CoverageModulationModeNV, coverage_modulation_table_enable: Bool32, coverage_modulation_table_count: u32, p_coverage_modulation_table: ?[*]const f32, }; pub const ImageFormatListCreateInfo = extern struct { s_type: StructureType = .image_format_list_create_info, p_next: ?*const anyopaque = null, view_format_count: u32, p_view_formats: [*]const Format, }; pub const ImageFormatListCreateInfoKHR = ImageFormatListCreateInfo; pub const ValidationCacheCreateInfoEXT = extern struct { s_type: StructureType = .validation_cache_create_info_ext, p_next: ?*const anyopaque = null, flags: ValidationCacheCreateFlagsEXT, initial_data_size: usize, p_initial_data: *const anyopaque, }; pub const ShaderModuleValidationCacheCreateInfoEXT = extern struct { s_type: StructureType = .shader_module_validation_cache_create_info_ext, p_next: ?*const anyopaque = null, validation_cache: ValidationCacheEXT, }; pub const PhysicalDeviceMaintenance3Properties = extern struct { s_type: StructureType = .physical_device_maintenance_3_properties, p_next: ?*anyopaque = null, max_per_set_descriptors: u32, max_memory_allocation_size: DeviceSize, }; pub const PhysicalDeviceMaintenance3PropertiesKHR = PhysicalDeviceMaintenance3Properties; pub const DescriptorSetLayoutSupport = extern struct { s_type: StructureType = .descriptor_set_layout_support, p_next: ?*anyopaque = null, supported: Bool32, }; pub const DescriptorSetLayoutSupportKHR = DescriptorSetLayoutSupport; pub const PhysicalDeviceShaderDrawParametersFeatures = extern struct { s_type: StructureType = .physical_device_shader_draw_parameters_features, p_next: ?*anyopaque = null, shader_draw_parameters: Bool32, }; pub const PhysicalDeviceShaderDrawParameterFeatures = PhysicalDeviceShaderDrawParametersFeatures; pub const PhysicalDeviceShaderFloat16Int8Features = extern struct { s_type: StructureType = .physical_device_shader_float16_int8_features, p_next: ?*anyopaque = null, shader_float_16: Bool32, shader_int_8: Bool32, }; pub const PhysicalDeviceShaderFloat16Int8FeaturesKHR = PhysicalDeviceShaderFloat16Int8Features; pub const PhysicalDeviceFloat16Int8FeaturesKHR = PhysicalDeviceShaderFloat16Int8Features; pub const PhysicalDeviceFloatControlsProperties = extern struct { s_type: StructureType = .physical_device_float_controls_properties, p_next: ?*anyopaque = null, denorm_behavior_independence: ShaderFloatControlsIndependence, rounding_mode_independence: ShaderFloatControlsIndependence, shader_signed_zero_inf_nan_preserve_float_16: Bool32, shader_signed_zero_inf_nan_preserve_float_32: Bool32, shader_signed_zero_inf_nan_preserve_float_64: Bool32, shader_denorm_preserve_float_16: Bool32, shader_denorm_preserve_float_32: Bool32, shader_denorm_preserve_float_64: Bool32, shader_denorm_flush_to_zero_float_16: Bool32, shader_denorm_flush_to_zero_float_32: Bool32, shader_denorm_flush_to_zero_float_64: Bool32, shader_rounding_mode_rte_float_16: Bool32, shader_rounding_mode_rte_float_32: Bool32, shader_rounding_mode_rte_float_64: Bool32, shader_rounding_mode_rtz_float_16: Bool32, shader_rounding_mode_rtz_float_32: Bool32, shader_rounding_mode_rtz_float_64: Bool32, }; pub const PhysicalDeviceFloatControlsPropertiesKHR = PhysicalDeviceFloatControlsProperties; pub const PhysicalDeviceHostQueryResetFeatures = extern struct { s_type: StructureType = .physical_device_host_query_reset_features, p_next: ?*anyopaque = null, host_query_reset: Bool32, }; pub const PhysicalDeviceHostQueryResetFeaturesEXT = PhysicalDeviceHostQueryResetFeatures; pub const NativeBufferUsage2ANDROID = extern struct { consumer: u64, producer: u64, }; pub const NativeBufferANDROID = extern struct { s_type: StructureType = .native_buffer_android, p_next: ?*const anyopaque = null, handle: *const anyopaque, stride: c_int, format: c_int, usage: c_int, usage_2: NativeBufferUsage2ANDROID, }; pub const SwapchainImageCreateInfoANDROID = extern struct { s_type: StructureType = .swapchain_image_create_info_android, p_next: ?*const anyopaque = null, usage: SwapchainImageUsageFlagsANDROID, }; pub const PhysicalDevicePresentationPropertiesANDROID = extern struct { s_type: StructureType = .physical_device_presentation_properties_android, p_next: ?*const anyopaque = null, shared_image: Bool32, }; pub const ShaderResourceUsageAMD = extern struct { num_used_vgprs: u32, num_used_sgprs: u32, lds_size_per_local_work_group: u32, lds_usage_size_in_bytes: usize, scratch_mem_usage_in_bytes: usize, }; pub const ShaderStatisticsInfoAMD = extern struct { shader_stage_mask: ShaderStageFlags, resource_usage: ShaderResourceUsageAMD, num_physical_vgprs: u32, num_physical_sgprs: u32, num_available_vgprs: u32, num_available_sgprs: u32, compute_work_group_size: [3]u32, }; pub const DeviceQueueGlobalPriorityCreateInfoEXT = extern struct { s_type: StructureType = .device_queue_global_priority_create_info_ext, p_next: ?*const anyopaque = null, global_priority: QueueGlobalPriorityEXT, }; pub const DebugUtilsObjectNameInfoEXT = extern struct { s_type: StructureType = .debug_utils_object_name_info_ext, p_next: ?*const anyopaque = null, object_type: ObjectType, object_handle: u64, p_object_name: ?[*:0]const u8, }; pub const DebugUtilsObjectTagInfoEXT = extern struct { s_type: StructureType = .debug_utils_object_tag_info_ext, p_next: ?*const anyopaque = null, object_type: ObjectType, object_handle: u64, tag_name: u64, tag_size: usize, p_tag: *const anyopaque, }; pub const DebugUtilsLabelEXT = extern struct { s_type: StructureType = .debug_utils_label_ext, p_next: ?*const anyopaque = null, p_label_name: [*:0]const u8, color: [4]f32, }; pub const DebugUtilsMessengerCreateInfoEXT = extern struct { s_type: StructureType = .debug_utils_messenger_create_info_ext, p_next: ?*const anyopaque = null, flags: DebugUtilsMessengerCreateFlagsEXT, message_severity: DebugUtilsMessageSeverityFlagsEXT, message_type: DebugUtilsMessageTypeFlagsEXT, pfn_user_callback: PfnDebugUtilsMessengerCallbackEXT, p_user_data: ?*anyopaque, }; pub const DebugUtilsMessengerCallbackDataEXT = extern struct { s_type: StructureType = .debug_utils_messenger_callback_data_ext, p_next: ?*const anyopaque = null, flags: DebugUtilsMessengerCallbackDataFlagsEXT, p_message_id_name: ?[*:0]const u8, message_id_number: i32, p_message: [*:0]const u8, queue_label_count: u32, p_queue_labels: [*]const DebugUtilsLabelEXT, cmd_buf_label_count: u32, p_cmd_buf_labels: [*]const DebugUtilsLabelEXT, object_count: u32, p_objects: [*]const DebugUtilsObjectNameInfoEXT, }; pub const PhysicalDeviceDeviceMemoryReportFeaturesEXT = extern struct { s_type: StructureType = .physical_device_device_memory_report_features_ext, p_next: ?*anyopaque = null, device_memory_report: Bool32, }; pub const DeviceDeviceMemoryReportCreateInfoEXT = extern struct { s_type: StructureType = .device_device_memory_report_create_info_ext, p_next: ?*const anyopaque = null, flags: DeviceMemoryReportFlagsEXT, pfn_user_callback: PfnDeviceMemoryReportCallbackEXT, p_user_data: *anyopaque, }; pub const DeviceMemoryReportCallbackDataEXT = extern struct { s_type: StructureType = .device_memory_report_callback_data_ext, p_next: ?*const anyopaque = null, flags: DeviceMemoryReportFlagsEXT, type: DeviceMemoryReportEventTypeEXT, memory_object_id: u64, size: DeviceSize, object_type: ObjectType, object_handle: u64, heap_index: u32, }; pub const ImportMemoryHostPointerInfoEXT = extern struct { s_type: StructureType = .import_memory_host_pointer_info_ext, p_next: ?*const anyopaque = null, handle_type: ExternalMemoryHandleTypeFlags, p_host_pointer: *anyopaque, }; pub const MemoryHostPointerPropertiesEXT = extern struct { s_type: StructureType = .memory_host_pointer_properties_ext, p_next: ?*anyopaque = null, memory_type_bits: u32, }; pub const PhysicalDeviceExternalMemoryHostPropertiesEXT = extern struct { s_type: StructureType = .physical_device_external_memory_host_properties_ext, p_next: ?*anyopaque = null, min_imported_host_pointer_alignment: DeviceSize, }; pub const PhysicalDeviceConservativeRasterizationPropertiesEXT = extern struct { s_type: StructureType = .physical_device_conservative_rasterization_properties_ext, p_next: ?*anyopaque = null, primitive_overestimation_size: f32, max_extra_primitive_overestimation_size: f32, extra_primitive_overestimation_size_granularity: f32, primitive_underestimation: Bool32, conservative_point_and_line_rasterization: Bool32, degenerate_triangles_rasterized: Bool32, degenerate_lines_rasterized: Bool32, fully_covered_fragment_shader_input_variable: Bool32, conservative_rasterization_post_depth_coverage: Bool32, }; pub const CalibratedTimestampInfoEXT = extern struct { s_type: StructureType = .calibrated_timestamp_info_ext, p_next: ?*const anyopaque = null, time_domain: TimeDomainEXT, }; pub const PhysicalDeviceShaderCorePropertiesAMD = extern struct { s_type: StructureType = .physical_device_shader_core_properties_amd, p_next: ?*anyopaque = null, shader_engine_count: u32, shader_arrays_per_engine_count: u32, compute_units_per_shader_array: u32, simd_per_compute_unit: u32, wavefronts_per_simd: u32, wavefront_size: u32, sgprs_per_simd: u32, min_sgpr_allocation: u32, max_sgpr_allocation: u32, sgpr_allocation_granularity: u32, vgprs_per_simd: u32, min_vgpr_allocation: u32, max_vgpr_allocation: u32, vgpr_allocation_granularity: u32, }; pub const PhysicalDeviceShaderCoreProperties2AMD = extern struct { s_type: StructureType = .physical_device_shader_core_properties_2_amd, p_next: ?*anyopaque = null, shader_core_features: ShaderCorePropertiesFlagsAMD, active_compute_unit_count: u32, }; pub const PipelineRasterizationConservativeStateCreateInfoEXT = extern struct { s_type: StructureType = .pipeline_rasterization_conservative_state_create_info_ext, p_next: ?*const anyopaque = null, flags: PipelineRasterizationConservativeStateCreateFlagsEXT, conservative_rasterization_mode: ConservativeRasterizationModeEXT, extra_primitive_overestimation_size: f32, }; pub const PhysicalDeviceDescriptorIndexingFeatures = extern struct { s_type: StructureType = .physical_device_descriptor_indexing_features, p_next: ?*anyopaque = null, shader_input_attachment_array_dynamic_indexing: Bool32, shader_uniform_texel_buffer_array_dynamic_indexing: Bool32, shader_storage_texel_buffer_array_dynamic_indexing: Bool32, shader_uniform_buffer_array_non_uniform_indexing: Bool32, shader_sampled_image_array_non_uniform_indexing: Bool32, shader_storage_buffer_array_non_uniform_indexing: Bool32, shader_storage_image_array_non_uniform_indexing: Bool32, shader_input_attachment_array_non_uniform_indexing: Bool32, shader_uniform_texel_buffer_array_non_uniform_indexing: Bool32, shader_storage_texel_buffer_array_non_uniform_indexing: Bool32, descriptor_binding_uniform_buffer_update_after_bind: Bool32, descriptor_binding_sampled_image_update_after_bind: Bool32, descriptor_binding_storage_image_update_after_bind: Bool32, descriptor_binding_storage_buffer_update_after_bind: Bool32, descriptor_binding_uniform_texel_buffer_update_after_bind: Bool32, descriptor_binding_storage_texel_buffer_update_after_bind: Bool32, descriptor_binding_update_unused_while_pending: Bool32, descriptor_binding_partially_bound: Bool32, descriptor_binding_variable_descriptor_count: Bool32, runtime_descriptor_array: Bool32, }; pub const PhysicalDeviceDescriptorIndexingFeaturesEXT = PhysicalDeviceDescriptorIndexingFeatures; pub const PhysicalDeviceDescriptorIndexingProperties = extern struct { s_type: StructureType = .physical_device_descriptor_indexing_properties, p_next: ?*anyopaque = null, max_update_after_bind_descriptors_in_all_pools: u32, shader_uniform_buffer_array_non_uniform_indexing_native: Bool32, shader_sampled_image_array_non_uniform_indexing_native: Bool32, shader_storage_buffer_array_non_uniform_indexing_native: Bool32, shader_storage_image_array_non_uniform_indexing_native: Bool32, shader_input_attachment_array_non_uniform_indexing_native: Bool32, robust_buffer_access_update_after_bind: Bool32, quad_divergent_implicit_lod: Bool32, max_per_stage_descriptor_update_after_bind_samplers: u32, max_per_stage_descriptor_update_after_bind_uniform_buffers: u32, max_per_stage_descriptor_update_after_bind_storage_buffers: u32, max_per_stage_descriptor_update_after_bind_sampled_images: u32, max_per_stage_descriptor_update_after_bind_storage_images: u32, max_per_stage_descriptor_update_after_bind_input_attachments: u32, max_per_stage_update_after_bind_resources: u32, max_descriptor_set_update_after_bind_samplers: u32, max_descriptor_set_update_after_bind_uniform_buffers: u32, max_descriptor_set_update_after_bind_uniform_buffers_dynamic: u32, max_descriptor_set_update_after_bind_storage_buffers: u32, max_descriptor_set_update_after_bind_storage_buffers_dynamic: u32, max_descriptor_set_update_after_bind_sampled_images: u32, max_descriptor_set_update_after_bind_storage_images: u32, max_descriptor_set_update_after_bind_input_attachments: u32, }; pub const PhysicalDeviceDescriptorIndexingPropertiesEXT = PhysicalDeviceDescriptorIndexingProperties; pub const DescriptorSetLayoutBindingFlagsCreateInfo = extern struct { s_type: StructureType = .descriptor_set_layout_binding_flags_create_info, p_next: ?*const anyopaque = null, binding_count: u32, p_binding_flags: [*]const DescriptorBindingFlags, }; pub const DescriptorSetLayoutBindingFlagsCreateInfoEXT = DescriptorSetLayoutBindingFlagsCreateInfo; pub const DescriptorSetVariableDescriptorCountAllocateInfo = extern struct { s_type: StructureType = .descriptor_set_variable_descriptor_count_allocate_info, p_next: ?*const anyopaque = null, descriptor_set_count: u32, p_descriptor_counts: [*]const u32, }; pub const DescriptorSetVariableDescriptorCountAllocateInfoEXT = DescriptorSetVariableDescriptorCountAllocateInfo; pub const DescriptorSetVariableDescriptorCountLayoutSupport = extern struct { s_type: StructureType = .descriptor_set_variable_descriptor_count_layout_support, p_next: ?*anyopaque = null, max_variable_descriptor_count: u32, }; pub const DescriptorSetVariableDescriptorCountLayoutSupportEXT = DescriptorSetVariableDescriptorCountLayoutSupport; pub const AttachmentDescription2 = extern struct { s_type: StructureType = .attachment_description_2, p_next: ?*const anyopaque = null, flags: AttachmentDescriptionFlags, format: Format, samples: SampleCountFlags, load_op: AttachmentLoadOp, store_op: AttachmentStoreOp, stencil_load_op: AttachmentLoadOp, stencil_store_op: AttachmentStoreOp, initial_layout: ImageLayout, final_layout: ImageLayout, }; pub const AttachmentDescription2KHR = AttachmentDescription2; pub const AttachmentReference2 = extern struct { s_type: StructureType = .attachment_reference_2, p_next: ?*const anyopaque = null, attachment: u32, layout: ImageLayout, aspect_mask: ImageAspectFlags, }; pub const AttachmentReference2KHR = AttachmentReference2; pub const SubpassDescription2 = extern struct { s_type: StructureType = .subpass_description_2, p_next: ?*const anyopaque = null, flags: SubpassDescriptionFlags, pipeline_bind_point: PipelineBindPoint, view_mask: u32, input_attachment_count: u32, p_input_attachments: [*]const AttachmentReference2, color_attachment_count: u32, p_color_attachments: [*]const AttachmentReference2, p_resolve_attachments: ?[*]const AttachmentReference2, p_depth_stencil_attachment: ?*const AttachmentReference2, preserve_attachment_count: u32, p_preserve_attachments: [*]const u32, }; pub const SubpassDescription2KHR = SubpassDescription2; pub const SubpassDependency2 = extern struct { s_type: StructureType = .subpass_dependency_2, p_next: ?*const anyopaque = null, src_subpass: u32, dst_subpass: u32, src_stage_mask: PipelineStageFlags, dst_stage_mask: PipelineStageFlags, src_access_mask: AccessFlags, dst_access_mask: AccessFlags, dependency_flags: DependencyFlags, view_offset: i32, }; pub const SubpassDependency2KHR = SubpassDependency2; pub const RenderPassCreateInfo2 = extern struct { s_type: StructureType = .render_pass_create_info_2, p_next: ?*const anyopaque = null, flags: RenderPassCreateFlags, attachment_count: u32, p_attachments: [*]const AttachmentDescription2, subpass_count: u32, p_subpasses: [*]const SubpassDescription2, dependency_count: u32, p_dependencies: [*]const SubpassDependency2, correlated_view_mask_count: u32, p_correlated_view_masks: [*]const u32, }; pub const RenderPassCreateInfo2KHR = RenderPassCreateInfo2; pub const SubpassBeginInfo = extern struct { s_type: StructureType = .subpass_begin_info, p_next: ?*const anyopaque = null, contents: SubpassContents, }; pub const SubpassBeginInfoKHR = SubpassBeginInfo; pub const SubpassEndInfo = extern struct { s_type: StructureType = .subpass_end_info, p_next: ?*const anyopaque = null, }; pub const SubpassEndInfoKHR = SubpassEndInfo; pub const PhysicalDeviceTimelineSemaphoreFeatures = extern struct { s_type: StructureType = .physical_device_timeline_semaphore_features, p_next: ?*anyopaque = null, timeline_semaphore: Bool32, }; pub const PhysicalDeviceTimelineSemaphoreFeaturesKHR = PhysicalDeviceTimelineSemaphoreFeatures; pub const PhysicalDeviceTimelineSemaphoreProperties = extern struct { s_type: StructureType = .physical_device_timeline_semaphore_properties, p_next: ?*anyopaque = null, max_timeline_semaphore_value_difference: u64, }; pub const PhysicalDeviceTimelineSemaphorePropertiesKHR = PhysicalDeviceTimelineSemaphoreProperties; pub const SemaphoreTypeCreateInfo = extern struct { s_type: StructureType = .semaphore_type_create_info, p_next: ?*const anyopaque = null, semaphore_type: SemaphoreType, initial_value: u64, }; pub const SemaphoreTypeCreateInfoKHR = SemaphoreTypeCreateInfo; pub const TimelineSemaphoreSubmitInfo = extern struct { s_type: StructureType = .timeline_semaphore_submit_info, p_next: ?*const anyopaque = null, wait_semaphore_value_count: u32, p_wait_semaphore_values: ?[*]const u64, signal_semaphore_value_count: u32, p_signal_semaphore_values: ?[*]const u64, }; pub const TimelineSemaphoreSubmitInfoKHR = TimelineSemaphoreSubmitInfo; pub const SemaphoreWaitInfo = extern struct { s_type: StructureType = .semaphore_wait_info, p_next: ?*const anyopaque = null, flags: SemaphoreWaitFlags, semaphore_count: u32, p_semaphores: [*]const Semaphore, p_values: [*]const u64, }; pub const SemaphoreWaitInfoKHR = SemaphoreWaitInfo; pub const SemaphoreSignalInfo = extern struct { s_type: StructureType = .semaphore_signal_info, p_next: ?*const anyopaque = null, semaphore: Semaphore, value: u64, }; pub const SemaphoreSignalInfoKHR = SemaphoreSignalInfo; pub const VertexInputBindingDivisorDescriptionEXT = extern struct { binding: u32, divisor: u32, }; pub const PipelineVertexInputDivisorStateCreateInfoEXT = extern struct { s_type: StructureType = .pipeline_vertex_input_divisor_state_create_info_ext, p_next: ?*const anyopaque = null, vertex_binding_divisor_count: u32, p_vertex_binding_divisors: [*]const VertexInputBindingDivisorDescriptionEXT, }; pub const PhysicalDeviceVertexAttributeDivisorPropertiesEXT = extern struct { s_type: StructureType = .physical_device_vertex_attribute_divisor_properties_ext, p_next: ?*anyopaque = null, max_vertex_attrib_divisor: u32, }; pub const PhysicalDevicePCIBusInfoPropertiesEXT = extern struct { s_type: StructureType = .physical_device_pci_bus_info_properties_ext, p_next: ?*anyopaque = null, pci_domain: u32, pci_bus: u32, pci_device: u32, pci_function: u32, }; pub const ImportAndroidHardwareBufferInfoANDROID = extern struct { s_type: StructureType = .import_android_hardware_buffer_info_android, p_next: ?*const anyopaque = null, buffer: *AHardwareBuffer, }; pub const AndroidHardwareBufferUsageANDROID = extern struct { s_type: StructureType = .android_hardware_buffer_usage_android, p_next: ?*anyopaque = null, android_hardware_buffer_usage: u64, }; pub const AndroidHardwareBufferPropertiesANDROID = extern struct { s_type: StructureType = .android_hardware_buffer_properties_android, p_next: ?*anyopaque = null, allocation_size: DeviceSize, memory_type_bits: u32, }; pub const MemoryGetAndroidHardwareBufferInfoANDROID = extern struct { s_type: StructureType = .memory_get_android_hardware_buffer_info_android, p_next: ?*const anyopaque = null, memory: DeviceMemory, }; pub const AndroidHardwareBufferFormatPropertiesANDROID = extern struct { s_type: StructureType = .android_hardware_buffer_format_properties_android, p_next: ?*anyopaque = null, format: Format, external_format: u64, format_features: FormatFeatureFlags, sampler_ycbcr_conversion_components: ComponentMapping, suggested_ycbcr_model: SamplerYcbcrModelConversion, suggested_ycbcr_range: SamplerYcbcrRange, suggested_x_chroma_offset: ChromaLocation, suggested_y_chroma_offset: ChromaLocation, }; pub const CommandBufferInheritanceConditionalRenderingInfoEXT = extern struct { s_type: StructureType = .command_buffer_inheritance_conditional_rendering_info_ext, p_next: ?*const anyopaque = null, conditional_rendering_enable: Bool32, }; pub const ExternalFormatANDROID = extern struct { s_type: StructureType = .external_format_android, p_next: ?*anyopaque = null, external_format: u64, }; pub const PhysicalDevice8BitStorageFeatures = extern struct { s_type: StructureType = .physical_device_8bit_storage_features, p_next: ?*anyopaque = null, storage_buffer_8_bit_access: Bool32, uniform_and_storage_buffer_8_bit_access: Bool32, storage_push_constant_8: Bool32, }; pub const PhysicalDevice8BitStorageFeaturesKHR = PhysicalDevice8BitStorageFeatures; pub const PhysicalDeviceConditionalRenderingFeaturesEXT = extern struct { s_type: StructureType = .physical_device_conditional_rendering_features_ext, p_next: ?*anyopaque = null, conditional_rendering: Bool32, inherited_conditional_rendering: Bool32, }; pub const PhysicalDeviceVulkanMemoryModelFeatures = extern struct { s_type: StructureType = .physical_device_vulkan_memory_model_features, p_next: ?*anyopaque = null, vulkan_memory_model: Bool32, vulkan_memory_model_device_scope: Bool32, vulkan_memory_model_availability_visibility_chains: Bool32, }; pub const PhysicalDeviceVulkanMemoryModelFeaturesKHR = PhysicalDeviceVulkanMemoryModelFeatures; pub const PhysicalDeviceShaderAtomicInt64Features = extern struct { s_type: StructureType = .physical_device_shader_atomic_int64_features, p_next: ?*anyopaque = null, shader_buffer_int_64_atomics: Bool32, shader_shared_int_64_atomics: Bool32, }; pub const PhysicalDeviceShaderAtomicInt64FeaturesKHR = PhysicalDeviceShaderAtomicInt64Features; pub const PhysicalDeviceShaderAtomicFloatFeaturesEXT = extern struct { s_type: StructureType = .physical_device_shader_atomic_float_features_ext, p_next: ?*anyopaque = null, shader_buffer_float_32_atomics: Bool32, shader_buffer_float_32_atomic_add: Bool32, shader_buffer_float_64_atomics: Bool32, shader_buffer_float_64_atomic_add: Bool32, shader_shared_float_32_atomics: Bool32, shader_shared_float_32_atomic_add: Bool32, shader_shared_float_64_atomics: Bool32, shader_shared_float_64_atomic_add: Bool32, shader_image_float_32_atomics: Bool32, shader_image_float_32_atomic_add: Bool32, sparse_image_float_32_atomics: Bool32, sparse_image_float_32_atomic_add: Bool32, }; pub const PhysicalDeviceVertexAttributeDivisorFeaturesEXT = extern struct { s_type: StructureType = .physical_device_vertex_attribute_divisor_features_ext, p_next: ?*anyopaque = null, vertex_attribute_instance_rate_divisor: Bool32, vertex_attribute_instance_rate_zero_divisor: Bool32, }; pub const QueueFamilyCheckpointPropertiesNV = extern struct { s_type: StructureType = .queue_family_checkpoint_properties_nv, p_next: ?*anyopaque = null, checkpoint_execution_stage_mask: PipelineStageFlags, }; pub const CheckpointDataNV = extern struct { s_type: StructureType = .checkpoint_data_nv, p_next: ?*anyopaque = null, stage: PipelineStageFlags, p_checkpoint_marker: *anyopaque, }; pub const PhysicalDeviceDepthStencilResolveProperties = extern struct { s_type: StructureType = .physical_device_depth_stencil_resolve_properties, p_next: ?*anyopaque = null, supported_depth_resolve_modes: ResolveModeFlags, supported_stencil_resolve_modes: ResolveModeFlags, independent_resolve_none: Bool32, independent_resolve: Bool32, }; pub const PhysicalDeviceDepthStencilResolvePropertiesKHR = PhysicalDeviceDepthStencilResolveProperties; pub const SubpassDescriptionDepthStencilResolve = extern struct { s_type: StructureType = .subpass_description_depth_stencil_resolve, p_next: ?*const anyopaque = null, depth_resolve_mode: ResolveModeFlags, stencil_resolve_mode: ResolveModeFlags, p_depth_stencil_resolve_attachment: ?*const AttachmentReference2, }; pub const SubpassDescriptionDepthStencilResolveKHR = SubpassDescriptionDepthStencilResolve; pub const ImageViewASTCDecodeModeEXT = extern struct { s_type: StructureType = .image_view_astc_decode_mode_ext, p_next: ?*const anyopaque = null, decode_mode: Format, }; pub const PhysicalDeviceASTCDecodeFeaturesEXT = extern struct { s_type: StructureType = .physical_device_astc_decode_features_ext, p_next: ?*anyopaque = null, decode_mode_shared_exponent: Bool32, }; pub const PhysicalDeviceTransformFeedbackFeaturesEXT = extern struct { s_type: StructureType = .physical_device_transform_feedback_features_ext, p_next: ?*anyopaque = null, transform_feedback: Bool32, geometry_streams: Bool32, }; pub const PhysicalDeviceTransformFeedbackPropertiesEXT = extern struct { s_type: StructureType = .physical_device_transform_feedback_properties_ext, p_next: ?*anyopaque = null, max_transform_feedback_streams: u32, max_transform_feedback_buffers: u32, max_transform_feedback_buffer_size: DeviceSize, max_transform_feedback_stream_data_size: u32, max_transform_feedback_buffer_data_size: u32, max_transform_feedback_buffer_data_stride: u32, transform_feedback_queries: Bool32, transform_feedback_streams_lines_triangles: Bool32, transform_feedback_rasterization_stream_select: Bool32, transform_feedback_draw: Bool32, }; pub const PipelineRasterizationStateStreamCreateInfoEXT = extern struct { s_type: StructureType = .pipeline_rasterization_state_stream_create_info_ext, p_next: ?*const anyopaque = null, flags: PipelineRasterizationStateStreamCreateFlagsEXT, rasterization_stream: u32, }; pub const PhysicalDeviceRepresentativeFragmentTestFeaturesNV = extern struct { s_type: StructureType = .physical_device_representative_fragment_test_features_nv, p_next: ?*anyopaque = null, representative_fragment_test: Bool32, }; pub const PipelineRepresentativeFragmentTestStateCreateInfoNV = extern struct { s_type: StructureType = .pipeline_representative_fragment_test_state_create_info_nv, p_next: ?*const anyopaque = null, representative_fragment_test_enable: Bool32, }; pub const PhysicalDeviceExclusiveScissorFeaturesNV = extern struct { s_type: StructureType = .physical_device_exclusive_scissor_features_nv, p_next: ?*anyopaque = null, exclusive_scissor: Bool32, }; pub const PipelineViewportExclusiveScissorStateCreateInfoNV = extern struct { s_type: StructureType = .pipeline_viewport_exclusive_scissor_state_create_info_nv, p_next: ?*const anyopaque = null, exclusive_scissor_count: u32, p_exclusive_scissors: [*]const Rect2D, }; pub const PhysicalDeviceCornerSampledImageFeaturesNV = extern struct { s_type: StructureType = .physical_device_corner_sampled_image_features_nv, p_next: ?*anyopaque = null, corner_sampled_image: Bool32, }; pub const PhysicalDeviceComputeShaderDerivativesFeaturesNV = extern struct { s_type: StructureType = .physical_device_compute_shader_derivatives_features_nv, p_next: ?*anyopaque = null, compute_derivative_group_quads: Bool32, compute_derivative_group_linear: Bool32, }; pub const PhysicalDeviceFragmentShaderBarycentricFeaturesNV = extern struct { s_type: StructureType = .physical_device_fragment_shader_barycentric_features_nv, p_next: ?*anyopaque = null, fragment_shader_barycentric: Bool32, }; pub const PhysicalDeviceShaderImageFootprintFeaturesNV = extern struct { s_type: StructureType = .physical_device_shader_image_footprint_features_nv, p_next: ?*anyopaque = null, image_footprint: Bool32, }; pub const PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV = extern struct { s_type: StructureType = .physical_device_dedicated_allocation_image_aliasing_features_nv, p_next: ?*anyopaque = null, dedicated_allocation_image_aliasing: Bool32, }; pub const ShadingRatePaletteNV = extern struct { shading_rate_palette_entry_count: u32, p_shading_rate_palette_entries: [*]const ShadingRatePaletteEntryNV, }; pub const PipelineViewportShadingRateImageStateCreateInfoNV = extern struct { s_type: StructureType = .pipeline_viewport_shading_rate_image_state_create_info_nv, p_next: ?*const anyopaque = null, shading_rate_image_enable: Bool32, viewport_count: u32, p_shading_rate_palettes: [*]const ShadingRatePaletteNV, }; pub const PhysicalDeviceShadingRateImageFeaturesNV = extern struct { s_type: StructureType = .physical_device_shading_rate_image_features_nv, p_next: ?*anyopaque = null, shading_rate_image: Bool32, shading_rate_coarse_sample_order: Bool32, }; pub const PhysicalDeviceShadingRateImagePropertiesNV = extern struct { s_type: StructureType = .physical_device_shading_rate_image_properties_nv, p_next: ?*anyopaque = null, shading_rate_texel_size: Extent2D, shading_rate_palette_size: u32, shading_rate_max_coarse_samples: u32, }; pub const CoarseSampleLocationNV = extern struct { pixel_x: u32, pixel_y: u32, sample: u32, }; pub const CoarseSampleOrderCustomNV = extern struct { shading_rate: ShadingRatePaletteEntryNV, sample_count: u32, sample_location_count: u32, p_sample_locations: [*]const CoarseSampleLocationNV, }; pub const PipelineViewportCoarseSampleOrderStateCreateInfoNV = extern struct { s_type: StructureType = .pipeline_viewport_coarse_sample_order_state_create_info_nv, p_next: ?*const anyopaque = null, sample_order_type: CoarseSampleOrderTypeNV, custom_sample_order_count: u32, p_custom_sample_orders: [*]const CoarseSampleOrderCustomNV, }; pub const PhysicalDeviceMeshShaderFeaturesNV = extern struct { s_type: StructureType = .physical_device_mesh_shader_features_nv, p_next: ?*anyopaque = null, task_shader: Bool32, mesh_shader: Bool32, }; pub const PhysicalDeviceMeshShaderPropertiesNV = extern struct { s_type: StructureType = .physical_device_mesh_shader_properties_nv, p_next: ?*anyopaque = null, max_draw_mesh_tasks_count: u32, max_task_work_group_invocations: u32, max_task_work_group_size: [3]u32, max_task_total_memory_size: u32, max_task_output_count: u32, max_mesh_work_group_invocations: u32, max_mesh_work_group_size: [3]u32, max_mesh_total_memory_size: u32, max_mesh_output_vertices: u32, max_mesh_output_primitives: u32, max_mesh_multiview_view_count: u32, mesh_output_per_vertex_granularity: u32, mesh_output_per_primitive_granularity: u32, }; pub const DrawMeshTasksIndirectCommandNV = extern struct { task_count: u32, first_task: u32, }; pub const RayTracingShaderGroupCreateInfoNV = extern struct { s_type: StructureType = .ray_tracing_shader_group_create_info_nv, p_next: ?*const anyopaque = null, type: RayTracingShaderGroupTypeKHR, general_shader: u32, closest_hit_shader: u32, any_hit_shader: u32, intersection_shader: u32, }; pub const RayTracingShaderGroupCreateInfoKHR = extern struct { s_type: StructureType = .ray_tracing_shader_group_create_info_khr, p_next: ?*const anyopaque = null, type: RayTracingShaderGroupTypeKHR, general_shader: u32, closest_hit_shader: u32, any_hit_shader: u32, intersection_shader: u32, p_shader_group_capture_replay_handle: ?*const anyopaque, }; pub const RayTracingPipelineCreateInfoNV = extern struct { s_type: StructureType = .ray_tracing_pipeline_create_info_nv, p_next: ?*const anyopaque = null, flags: PipelineCreateFlags, stage_count: u32, p_stages: [*]const PipelineShaderStageCreateInfo, group_count: u32, p_groups: [*]const RayTracingShaderGroupCreateInfoNV, max_recursion_depth: u32, layout: PipelineLayout, base_pipeline_handle: Pipeline, base_pipeline_index: i32, }; pub const RayTracingPipelineCreateInfoKHR = extern struct { s_type: StructureType = .ray_tracing_pipeline_create_info_khr, p_next: ?*const anyopaque = null, flags: PipelineCreateFlags, stage_count: u32, p_stages: [*]const PipelineShaderStageCreateInfo, group_count: u32, p_groups: [*]const RayTracingShaderGroupCreateInfoKHR, max_pipeline_ray_recursion_depth: u32, p_library_info: ?*const PipelineLibraryCreateInfoKHR, p_library_interface: ?*const RayTracingPipelineInterfaceCreateInfoKHR, p_dynamic_state: ?*const PipelineDynamicStateCreateInfo, layout: PipelineLayout, base_pipeline_handle: Pipeline, base_pipeline_index: i32, }; pub const GeometryTrianglesNV = extern struct { s_type: StructureType = .geometry_triangles_nv, p_next: ?*const anyopaque = null, vertex_data: Buffer, vertex_offset: DeviceSize, vertex_count: u32, vertex_stride: DeviceSize, vertex_format: Format, index_data: Buffer, index_offset: DeviceSize, index_count: u32, index_type: IndexType, transform_data: Buffer, transform_offset: DeviceSize, }; pub const GeometryAABBNV = extern struct { s_type: StructureType = .geometry_aabb_nv, p_next: ?*const anyopaque = null, aabb_data: Buffer, num_aab_bs: u32, stride: u32, offset: DeviceSize, }; pub const GeometryDataNV = extern struct { triangles: GeometryTrianglesNV, aabbs: GeometryAABBNV, }; pub const GeometryNV = extern struct { s_type: StructureType = .geometry_nv, p_next: ?*const anyopaque = null, geometry_type: GeometryTypeKHR, geometry: GeometryDataNV, flags: GeometryFlagsKHR, }; pub const AccelerationStructureInfoNV = extern struct { s_type: StructureType = .acceleration_structure_info_nv, p_next: ?*const anyopaque = null, type: AccelerationStructureTypeNV, flags: BuildAccelerationStructureFlagsNV, instance_count: u32, geometry_count: u32, p_geometries: [*]const GeometryNV, }; pub const AccelerationStructureCreateInfoNV = extern struct { s_type: StructureType = .acceleration_structure_create_info_nv, p_next: ?*const anyopaque = null, compacted_size: DeviceSize, info: AccelerationStructureInfoNV, }; pub const BindAccelerationStructureMemoryInfoNV = extern struct { s_type: StructureType = .bind_acceleration_structure_memory_info_nv, p_next: ?*const anyopaque = null, acceleration_structure: AccelerationStructureNV, memory: DeviceMemory, memory_offset: DeviceSize, device_index_count: u32, p_device_indices: [*]const u32, }; pub const WriteDescriptorSetAccelerationStructureKHR = extern struct { s_type: StructureType = .write_descriptor_set_acceleration_structure_khr, p_next: ?*const anyopaque = null, acceleration_structure_count: u32, p_acceleration_structures: [*]const AccelerationStructureKHR, }; pub const WriteDescriptorSetAccelerationStructureNV = extern struct { s_type: StructureType = .write_descriptor_set_acceleration_structure_nv, p_next: ?*const anyopaque = null, acceleration_structure_count: u32, p_acceleration_structures: [*]const AccelerationStructureNV, }; pub const AccelerationStructureMemoryRequirementsInfoNV = extern struct { s_type: StructureType = .acceleration_structure_memory_requirements_info_nv, p_next: ?*const anyopaque = null, type: AccelerationStructureMemoryRequirementsTypeNV, acceleration_structure: AccelerationStructureNV, }; pub const PhysicalDeviceAccelerationStructureFeaturesKHR = extern struct { s_type: StructureType = .physical_device_acceleration_structure_features_khr, p_next: ?*anyopaque = null, acceleration_structure: Bool32, acceleration_structure_capture_replay: Bool32, acceleration_structure_indirect_build: Bool32, acceleration_structure_host_commands: Bool32, descriptor_binding_acceleration_structure_update_after_bind: Bool32, }; pub const PhysicalDeviceRayTracingPipelineFeaturesKHR = extern struct { s_type: StructureType = .physical_device_ray_tracing_pipeline_features_khr, p_next: ?*anyopaque = null, ray_tracing_pipeline: Bool32, ray_tracing_pipeline_shader_group_handle_capture_replay: Bool32, ray_tracing_pipeline_shader_group_handle_capture_replay_mixed: Bool32, ray_tracing_pipeline_trace_rays_indirect: Bool32, ray_traversal_primitive_culling: Bool32, }; pub const PhysicalDeviceRayQueryFeaturesKHR = extern struct { s_type: StructureType = .physical_device_ray_query_features_khr, p_next: ?*anyopaque = null, ray_query: Bool32, }; pub const PhysicalDeviceAccelerationStructurePropertiesKHR = extern struct { s_type: StructureType = .physical_device_acceleration_structure_properties_khr, p_next: ?*anyopaque = null, max_geometry_count: u64, max_instance_count: u64, max_primitive_count: u64, max_per_stage_descriptor_acceleration_structures: u32, max_per_stage_descriptor_update_after_bind_acceleration_structures: u32, max_descriptor_set_acceleration_structures: u32, max_descriptor_set_update_after_bind_acceleration_structures: u32, min_acceleration_structure_scratch_offset_alignment: u32, }; pub const PhysicalDeviceRayTracingPipelinePropertiesKHR = extern struct { s_type: StructureType = .physical_device_ray_tracing_pipeline_properties_khr, p_next: ?*anyopaque = null, shader_group_handle_size: u32, max_ray_recursion_depth: u32, max_shader_group_stride: u32, shader_group_base_alignment: u32, shader_group_handle_capture_replay_size: u32, max_ray_dispatch_invocation_count: u32, shader_group_handle_alignment: u32, max_ray_hit_attribute_size: u32, }; pub const PhysicalDeviceRayTracingPropertiesNV = extern struct { s_type: StructureType = .physical_device_ray_tracing_properties_nv, p_next: ?*anyopaque = null, shader_group_handle_size: u32, max_recursion_depth: u32, max_shader_group_stride: u32, shader_group_base_alignment: u32, max_geometry_count: u64, max_instance_count: u64, max_triangle_count: u64, max_descriptor_set_acceleration_structures: u32, }; pub const StridedDeviceAddressRegionKHR = extern struct { device_address: DeviceAddress, stride: DeviceSize, size: DeviceSize, }; pub const TraceRaysIndirectCommandKHR = extern struct { width: u32, height: u32, depth: u32, }; pub const DrmFormatModifierPropertiesListEXT = extern struct { s_type: StructureType = .drm_format_modifier_properties_list_ext, p_next: ?*anyopaque = null, drm_format_modifier_count: u32, p_drm_format_modifier_properties: ?[*]DrmFormatModifierPropertiesEXT, }; pub const DrmFormatModifierPropertiesEXT = extern struct { drm_format_modifier: u64, drm_format_modifier_plane_count: u32, drm_format_modifier_tiling_features: FormatFeatureFlags, }; pub const PhysicalDeviceImageDrmFormatModifierInfoEXT = extern struct { s_type: StructureType = .physical_device_image_drm_format_modifier_info_ext, p_next: ?*const anyopaque = null, drm_format_modifier: u64, sharing_mode: SharingMode, queue_family_index_count: u32, p_queue_family_indices: [*]const u32, }; pub const ImageDrmFormatModifierListCreateInfoEXT = extern struct { s_type: StructureType = .image_drm_format_modifier_list_create_info_ext, p_next: ?*const anyopaque = null, drm_format_modifier_count: u32, p_drm_format_modifiers: [*]const u64, }; pub const ImageDrmFormatModifierExplicitCreateInfoEXT = extern struct { s_type: StructureType = .image_drm_format_modifier_explicit_create_info_ext, p_next: ?*const anyopaque = null, drm_format_modifier: u64, drm_format_modifier_plane_count: u32, p_plane_layouts: [*]const SubresourceLayout, }; pub const ImageDrmFormatModifierPropertiesEXT = extern struct { s_type: StructureType = .image_drm_format_modifier_properties_ext, p_next: ?*anyopaque = null, drm_format_modifier: u64, }; pub const ImageStencilUsageCreateInfo = extern struct { s_type: StructureType = .image_stencil_usage_create_info, p_next: ?*const anyopaque = null, stencil_usage: ImageUsageFlags, }; pub const ImageStencilUsageCreateInfoEXT = ImageStencilUsageCreateInfo; pub const DeviceMemoryOverallocationCreateInfoAMD = extern struct { s_type: StructureType = .device_memory_overallocation_create_info_amd, p_next: ?*const anyopaque = null, overallocation_behavior: MemoryOverallocationBehaviorAMD, }; pub const PhysicalDeviceFragmentDensityMapFeaturesEXT = extern struct { s_type: StructureType = .physical_device_fragment_density_map_features_ext, p_next: ?*anyopaque = null, fragment_density_map: Bool32, fragment_density_map_dynamic: Bool32, fragment_density_map_non_subsampled_images: Bool32, }; pub const PhysicalDeviceFragmentDensityMap2FeaturesEXT = extern struct { s_type: StructureType = .physical_device_fragment_density_map_2_features_ext, p_next: ?*anyopaque = null, fragment_density_map_deferred: Bool32, }; pub const PhysicalDeviceFragmentDensityMapPropertiesEXT = extern struct { s_type: StructureType = .physical_device_fragment_density_map_properties_ext, p_next: ?*anyopaque = null, min_fragment_density_texel_size: Extent2D, max_fragment_density_texel_size: Extent2D, fragment_density_invocations: Bool32, }; pub const PhysicalDeviceFragmentDensityMap2PropertiesEXT = extern struct { s_type: StructureType = .physical_device_fragment_density_map_2_properties_ext, p_next: ?*anyopaque = null, subsampled_loads: Bool32, subsampled_coarse_reconstruction_early_access: Bool32, max_subsampled_array_layers: u32, max_descriptor_set_subsampled_samplers: u32, }; pub const RenderPassFragmentDensityMapCreateInfoEXT = extern struct { s_type: StructureType = .render_pass_fragment_density_map_create_info_ext, p_next: ?*const anyopaque = null, fragment_density_map_attachment: AttachmentReference, }; pub const PhysicalDeviceScalarBlockLayoutFeatures = extern struct { s_type: StructureType = .physical_device_scalar_block_layout_features, p_next: ?*anyopaque = null, scalar_block_layout: Bool32, }; pub const PhysicalDeviceScalarBlockLayoutFeaturesEXT = PhysicalDeviceScalarBlockLayoutFeatures; pub const SurfaceProtectedCapabilitiesKHR = extern struct { s_type: StructureType = .surface_protected_capabilities_khr, p_next: ?*const anyopaque = null, supports_protected: Bool32, }; pub const PhysicalDeviceUniformBufferStandardLayoutFeatures = extern struct { s_type: StructureType = .physical_device_uniform_buffer_standard_layout_features, p_next: ?*anyopaque = null, uniform_buffer_standard_layout: Bool32, }; pub const PhysicalDeviceUniformBufferStandardLayoutFeaturesKHR = PhysicalDeviceUniformBufferStandardLayoutFeatures; pub const PhysicalDeviceDepthClipEnableFeaturesEXT = extern struct { s_type: StructureType = .physical_device_depth_clip_enable_features_ext, p_next: ?*anyopaque = null, depth_clip_enable: Bool32, }; pub const PipelineRasterizationDepthClipStateCreateInfoEXT = extern struct { s_type: StructureType = .pipeline_rasterization_depth_clip_state_create_info_ext, p_next: ?*const anyopaque = null, flags: PipelineRasterizationDepthClipStateCreateFlagsEXT, depth_clip_enable: Bool32, }; pub const PhysicalDeviceMemoryBudgetPropertiesEXT = extern struct { s_type: StructureType = .physical_device_memory_budget_properties_ext, p_next: ?*anyopaque = null, heap_budget: [MAX_MEMORY_HEAPS]DeviceSize, heap_usage: [MAX_MEMORY_HEAPS]DeviceSize, }; pub const PhysicalDeviceMemoryPriorityFeaturesEXT = extern struct { s_type: StructureType = .physical_device_memory_priority_features_ext, p_next: ?*anyopaque = null, memory_priority: Bool32, }; pub const MemoryPriorityAllocateInfoEXT = extern struct { s_type: StructureType = .memory_priority_allocate_info_ext, p_next: ?*const anyopaque = null, priority: f32, }; pub const PhysicalDeviceBufferDeviceAddressFeatures = extern struct { s_type: StructureType = .physical_device_buffer_device_address_features, p_next: ?*anyopaque = null, buffer_device_address: Bool32, buffer_device_address_capture_replay: Bool32, buffer_device_address_multi_device: Bool32, }; pub const PhysicalDeviceBufferDeviceAddressFeaturesKHR = PhysicalDeviceBufferDeviceAddressFeatures; pub const PhysicalDeviceBufferDeviceAddressFeaturesEXT = extern struct { s_type: StructureType = .physical_device_buffer_device_address_features_ext, p_next: ?*anyopaque = null, buffer_device_address: Bool32, buffer_device_address_capture_replay: Bool32, buffer_device_address_multi_device: Bool32, }; pub const PhysicalDeviceBufferAddressFeaturesEXT = PhysicalDeviceBufferDeviceAddressFeaturesEXT; pub const BufferDeviceAddressInfo = extern struct { s_type: StructureType = .buffer_device_address_info, p_next: ?*const anyopaque = null, buffer: Buffer, }; pub const BufferDeviceAddressInfoKHR = BufferDeviceAddressInfo; pub const BufferDeviceAddressInfoEXT = BufferDeviceAddressInfo; pub const BufferOpaqueCaptureAddressCreateInfo = extern struct { s_type: StructureType = .buffer_opaque_capture_address_create_info, p_next: ?*const anyopaque = null, opaque_capture_address: u64, }; pub const BufferOpaqueCaptureAddressCreateInfoKHR = BufferOpaqueCaptureAddressCreateInfo; pub const BufferDeviceAddressCreateInfoEXT = extern struct { s_type: StructureType = .buffer_device_address_create_info_ext, p_next: ?*const anyopaque = null, device_address: DeviceAddress, }; pub const PhysicalDeviceImageViewImageFormatInfoEXT = extern struct { s_type: StructureType = .physical_device_image_view_image_format_info_ext, p_next: ?*anyopaque = null, image_view_type: ImageViewType, }; pub const FilterCubicImageViewImageFormatPropertiesEXT = extern struct { s_type: StructureType = .filter_cubic_image_view_image_format_properties_ext, p_next: ?*anyopaque = null, filter_cubic: Bool32, filter_cubic_minmax: Bool32, }; pub const PhysicalDeviceImagelessFramebufferFeatures = extern struct { s_type: StructureType = .physical_device_imageless_framebuffer_features, p_next: ?*anyopaque = null, imageless_framebuffer: Bool32, }; pub const PhysicalDeviceImagelessFramebufferFeaturesKHR = PhysicalDeviceImagelessFramebufferFeatures; pub const FramebufferAttachmentsCreateInfo = extern struct { s_type: StructureType = .framebuffer_attachments_create_info, p_next: ?*const anyopaque = null, attachment_image_info_count: u32, p_attachment_image_infos: [*]const FramebufferAttachmentImageInfo, }; pub const FramebufferAttachmentsCreateInfoKHR = FramebufferAttachmentsCreateInfo; pub const FramebufferAttachmentImageInfo = extern struct { s_type: StructureType = .framebuffer_attachment_image_info, p_next: ?*const anyopaque = null, flags: ImageCreateFlags, usage: ImageUsageFlags, width: u32, height: u32, layer_count: u32, view_format_count: u32, p_view_formats: [*]const Format, }; pub const FramebufferAttachmentImageInfoKHR = FramebufferAttachmentImageInfo; pub const RenderPassAttachmentBeginInfo = extern struct { s_type: StructureType = .render_pass_attachment_begin_info, p_next: ?*const anyopaque = null, attachment_count: u32, p_attachments: [*]const ImageView, }; pub const RenderPassAttachmentBeginInfoKHR = RenderPassAttachmentBeginInfo; pub const PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT = extern struct { s_type: StructureType = .physical_device_texture_compression_astc_hdr_features_ext, p_next: ?*anyopaque = null, texture_compression_astc_hdr: Bool32, }; pub const PhysicalDeviceCooperativeMatrixFeaturesNV = extern struct { s_type: StructureType = .physical_device_cooperative_matrix_features_nv, p_next: ?*anyopaque = null, cooperative_matrix: Bool32, cooperative_matrix_robust_buffer_access: Bool32, }; pub const PhysicalDeviceCooperativeMatrixPropertiesNV = extern struct { s_type: StructureType = .physical_device_cooperative_matrix_properties_nv, p_next: ?*anyopaque = null, cooperative_matrix_supported_stages: ShaderStageFlags, }; pub const CooperativeMatrixPropertiesNV = extern struct { s_type: StructureType = .cooperative_matrix_properties_nv, p_next: ?*anyopaque = null, m_size: u32, n_size: u32, k_size: u32, a_type: ComponentTypeNV, b_type: ComponentTypeNV, c_type: ComponentTypeNV, d_type: ComponentTypeNV, scope: ScopeNV, }; pub const PhysicalDeviceYcbcrImageArraysFeaturesEXT = extern struct { s_type: StructureType = .physical_device_ycbcr_image_arrays_features_ext, p_next: ?*anyopaque = null, ycbcr_image_arrays: Bool32, }; pub const ImageViewHandleInfoNVX = extern struct { s_type: StructureType = .image_view_handle_info_nvx, p_next: ?*const anyopaque = null, image_view: ImageView, descriptor_type: DescriptorType, sampler: Sampler, }; pub const ImageViewAddressPropertiesNVX = extern struct { s_type: StructureType = .image_view_address_properties_nvx, p_next: ?*anyopaque = null, device_address: DeviceAddress, size: DeviceSize, }; pub const PresentFrameTokenGGP = extern struct { s_type: StructureType = .present_frame_token_ggp, p_next: ?*const anyopaque = null, frame_token: GgpFrameToken, }; pub const PipelineCreationFeedbackEXT = extern struct { flags: PipelineCreationFeedbackFlagsEXT, duration: u64, }; pub const PipelineCreationFeedbackCreateInfoEXT = extern struct { s_type: StructureType = .pipeline_creation_feedback_create_info_ext, p_next: ?*const anyopaque = null, p_pipeline_creation_feedback: *PipelineCreationFeedbackEXT, pipeline_stage_creation_feedback_count: u32, p_pipeline_stage_creation_feedbacks: [*]PipelineCreationFeedbackEXT, }; pub const SurfaceFullScreenExclusiveInfoEXT = extern struct { s_type: StructureType = .surface_full_screen_exclusive_info_ext, p_next: ?*anyopaque = null, full_screen_exclusive: FullScreenExclusiveEXT, }; pub const SurfaceFullScreenExclusiveWin32InfoEXT = extern struct { s_type: StructureType = .surface_full_screen_exclusive_win32_info_ext, p_next: ?*const anyopaque = null, hmonitor: HMONITOR, }; pub const SurfaceCapabilitiesFullScreenExclusiveEXT = extern struct { s_type: StructureType = .surface_capabilities_full_screen_exclusive_ext, p_next: ?*anyopaque = null, full_screen_exclusive_supported: Bool32, }; pub const PhysicalDevicePerformanceQueryFeaturesKHR = extern struct { s_type: StructureType = .physical_device_performance_query_features_khr, p_next: ?*anyopaque = null, performance_counter_query_pools: Bool32, performance_counter_multiple_query_pools: Bool32, }; pub const PhysicalDevicePerformanceQueryPropertiesKHR = extern struct { s_type: StructureType = .physical_device_performance_query_properties_khr, p_next: ?*anyopaque = null, allow_command_buffer_query_copies: Bool32, }; pub const PerformanceCounterKHR = extern struct { s_type: StructureType = .performance_counter_khr, p_next: ?*const anyopaque = null, unit: PerformanceCounterUnitKHR, scope: PerformanceCounterScopeKHR, storage: PerformanceCounterStorageKHR, uuid: [UUID_SIZE]u8, }; pub const PerformanceCounterDescriptionKHR = extern struct { s_type: StructureType = .performance_counter_description_khr, p_next: ?*const anyopaque = null, flags: PerformanceCounterDescriptionFlagsKHR, name: [MAX_DESCRIPTION_SIZE]u8, category: [MAX_DESCRIPTION_SIZE]u8, description: [MAX_DESCRIPTION_SIZE]u8, }; pub const QueryPoolPerformanceCreateInfoKHR = extern struct { s_type: StructureType = .query_pool_performance_create_info_khr, p_next: ?*const anyopaque = null, queue_family_index: u32, counter_index_count: u32, p_counter_indices: [*]const u32, }; pub const PerformanceCounterResultKHR = extern union { int_32: i32, int_64: i64, uint_32: u32, uint_64: u64, float_32: f32, float_64: f64, }; pub const AcquireProfilingLockInfoKHR = extern struct { s_type: StructureType = .acquire_profiling_lock_info_khr, p_next: ?*const anyopaque = null, flags: AcquireProfilingLockFlagsKHR, timeout: u64, }; pub const PerformanceQuerySubmitInfoKHR = extern struct { s_type: StructureType = .performance_query_submit_info_khr, p_next: ?*const anyopaque = null, counter_pass_index: u32, }; pub const HeadlessSurfaceCreateInfoEXT = extern struct { s_type: StructureType = .headless_surface_create_info_ext, p_next: ?*const anyopaque = null, flags: HeadlessSurfaceCreateFlagsEXT, }; pub const PhysicalDeviceCoverageReductionModeFeaturesNV = extern struct { s_type: StructureType = .physical_device_coverage_reduction_mode_features_nv, p_next: ?*anyopaque = null, coverage_reduction_mode: Bool32, }; pub const PipelineCoverageReductionStateCreateInfoNV = extern struct { s_type: StructureType = .pipeline_coverage_reduction_state_create_info_nv, p_next: ?*const anyopaque = null, flags: PipelineCoverageReductionStateCreateFlagsNV, coverage_reduction_mode: CoverageReductionModeNV, }; pub const FramebufferMixedSamplesCombinationNV = extern struct { s_type: StructureType = .framebuffer_mixed_samples_combination_nv, p_next: ?*anyopaque = null, coverage_reduction_mode: CoverageReductionModeNV, rasterization_samples: SampleCountFlags, depth_stencil_samples: SampleCountFlags, color_samples: SampleCountFlags, }; pub const PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL = extern struct { s_type: StructureType = .physical_device_shader_integer_functions_2_features_intel, p_next: ?*anyopaque = null, shader_integer_functions_2: Bool32, }; pub const PerformanceValueDataINTEL = extern union { value_32: u32, value_64: u64, value_float: f32, value_bool: Bool32, value_string: [*:0]const u8, }; pub const PerformanceValueINTEL = extern struct { type: PerformanceValueTypeINTEL, data: PerformanceValueDataINTEL, }; pub const InitializePerformanceApiInfoINTEL = extern struct { s_type: StructureType = .initialize_performance_api_info_intel, p_next: ?*const anyopaque = null, p_user_data: ?*anyopaque, }; pub const QueryPoolPerformanceQueryCreateInfoINTEL = extern struct { s_type: StructureType = .query_pool_performance_query_create_info_intel, p_next: ?*const anyopaque = null, performance_counters_sampling: QueryPoolSamplingModeINTEL, }; pub const QueryPoolCreateInfoINTEL = QueryPoolPerformanceQueryCreateInfoINTEL; pub const PerformanceMarkerInfoINTEL = extern struct { s_type: StructureType = .performance_marker_info_intel, p_next: ?*const anyopaque = null, marker: u64, }; pub const PerformanceStreamMarkerInfoINTEL = extern struct { s_type: StructureType = .performance_stream_marker_info_intel, p_next: ?*const anyopaque = null, marker: u32, }; pub const PerformanceOverrideInfoINTEL = extern struct { s_type: StructureType = .performance_override_info_intel, p_next: ?*const anyopaque = null, type: PerformanceOverrideTypeINTEL, enable: Bool32, parameter: u64, }; pub const PerformanceConfigurationAcquireInfoINTEL = extern struct { s_type: StructureType = .performance_configuration_acquire_info_intel, p_next: ?*const anyopaque = null, type: PerformanceConfigurationTypeINTEL, }; pub const PhysicalDeviceShaderClockFeaturesKHR = extern struct { s_type: StructureType = .physical_device_shader_clock_features_khr, p_next: ?*anyopaque = null, shader_subgroup_clock: Bool32, shader_device_clock: Bool32, }; pub const PhysicalDeviceIndexTypeUint8FeaturesEXT = extern struct { s_type: StructureType = .physical_device_index_type_uint8_features_ext, p_next: ?*anyopaque = null, index_type_uint_8: Bool32, }; pub const PhysicalDeviceShaderSMBuiltinsPropertiesNV = extern struct { s_type: StructureType = .physical_device_shader_sm_builtins_properties_nv, p_next: ?*anyopaque = null, shader_sm_count: u32, shader_warps_per_sm: u32, }; pub const PhysicalDeviceShaderSMBuiltinsFeaturesNV = extern struct { s_type: StructureType = .physical_device_shader_sm_builtins_features_nv, p_next: ?*anyopaque = null, shader_sm_builtins: Bool32, }; pub const PhysicalDeviceFragmentShaderInterlockFeaturesEXT = extern struct { s_type: StructureType = .physical_device_fragment_shader_interlock_features_ext, p_next: ?*anyopaque = null, fragment_shader_sample_interlock: Bool32, fragment_shader_pixel_interlock: Bool32, fragment_shader_shading_rate_interlock: Bool32, }; pub const PhysicalDeviceSeparateDepthStencilLayoutsFeatures = extern struct { s_type: StructureType = .physical_device_separate_depth_stencil_layouts_features, p_next: ?*anyopaque = null, separate_depth_stencil_layouts: Bool32, }; pub const PhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR = PhysicalDeviceSeparateDepthStencilLayoutsFeatures; pub const AttachmentReferenceStencilLayout = extern struct { s_type: StructureType = .attachment_reference_stencil_layout, p_next: ?*anyopaque = null, stencil_layout: ImageLayout, }; pub const AttachmentReferenceStencilLayoutKHR = AttachmentReferenceStencilLayout; pub const AttachmentDescriptionStencilLayout = extern struct { s_type: StructureType = .attachment_description_stencil_layout, p_next: ?*anyopaque = null, stencil_initial_layout: ImageLayout, stencil_final_layout: ImageLayout, }; pub const AttachmentDescriptionStencilLayoutKHR = AttachmentDescriptionStencilLayout; pub const PhysicalDevicePipelineExecutablePropertiesFeaturesKHR = extern struct { s_type: StructureType = .physical_device_pipeline_executable_properties_features_khr, p_next: ?*anyopaque = null, pipeline_executable_info: Bool32, }; pub const PipelineInfoKHR = extern struct { s_type: StructureType = .pipeline_info_khr, p_next: ?*const anyopaque = null, pipeline: Pipeline, }; pub const PipelineExecutablePropertiesKHR = extern struct { s_type: StructureType = .pipeline_executable_properties_khr, p_next: ?*anyopaque = null, stages: ShaderStageFlags, name: [MAX_DESCRIPTION_SIZE]u8, description: [MAX_DESCRIPTION_SIZE]u8, subgroup_size: u32, }; pub const PipelineExecutableInfoKHR = extern struct { s_type: StructureType = .pipeline_executable_info_khr, p_next: ?*const anyopaque = null, pipeline: Pipeline, executable_index: u32, }; pub const PipelineExecutableStatisticValueKHR = extern union { b_32: Bool32, i_64: i64, u_64: u64, f_64: f64, }; pub const PipelineExecutableStatisticKHR = extern struct { s_type: StructureType = .pipeline_executable_statistic_khr, p_next: ?*anyopaque = null, name: [MAX_DESCRIPTION_SIZE]u8, description: [MAX_DESCRIPTION_SIZE]u8, format: PipelineExecutableStatisticFormatKHR, value: PipelineExecutableStatisticValueKHR, }; pub const PipelineExecutableInternalRepresentationKHR = extern struct { s_type: StructureType = .pipeline_executable_internal_representation_khr, p_next: ?*anyopaque = null, name: [MAX_DESCRIPTION_SIZE]u8, description: [MAX_DESCRIPTION_SIZE]u8, is_text: Bool32, data_size: usize, p_data: ?*anyopaque, }; pub const PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT = extern struct { s_type: StructureType = .physical_device_shader_demote_to_helper_invocation_features_ext, p_next: ?*anyopaque = null, shader_demote_to_helper_invocation: Bool32, }; pub const PhysicalDeviceTexelBufferAlignmentFeaturesEXT = extern struct { s_type: StructureType = .physical_device_texel_buffer_alignment_features_ext, p_next: ?*anyopaque = null, texel_buffer_alignment: Bool32, }; pub const PhysicalDeviceTexelBufferAlignmentPropertiesEXT = extern struct { s_type: StructureType = .physical_device_texel_buffer_alignment_properties_ext, p_next: ?*anyopaque = null, storage_texel_buffer_offset_alignment_bytes: DeviceSize, storage_texel_buffer_offset_single_texel_alignment: Bool32, uniform_texel_buffer_offset_alignment_bytes: DeviceSize, uniform_texel_buffer_offset_single_texel_alignment: Bool32, }; pub const PhysicalDeviceSubgroupSizeControlFeaturesEXT = extern struct { s_type: StructureType = .physical_device_subgroup_size_control_features_ext, p_next: ?*anyopaque = null, subgroup_size_control: Bool32, compute_full_subgroups: Bool32, }; pub const PhysicalDeviceSubgroupSizeControlPropertiesEXT = extern struct { s_type: StructureType = .physical_device_subgroup_size_control_properties_ext, p_next: ?*anyopaque = null, min_subgroup_size: u32, max_subgroup_size: u32, max_compute_workgroup_subgroups: u32, required_subgroup_size_stages: ShaderStageFlags, }; pub const PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT = extern struct { s_type: StructureType = .pipeline_shader_stage_required_subgroup_size_create_info_ext, p_next: ?*anyopaque = null, required_subgroup_size: u32, }; pub const MemoryOpaqueCaptureAddressAllocateInfo = extern struct { s_type: StructureType = .memory_opaque_capture_address_allocate_info, p_next: ?*const anyopaque = null, opaque_capture_address: u64, }; pub const MemoryOpaqueCaptureAddressAllocateInfoKHR = MemoryOpaqueCaptureAddressAllocateInfo; pub const DeviceMemoryOpaqueCaptureAddressInfo = extern struct { s_type: StructureType = .device_memory_opaque_capture_address_info, p_next: ?*const anyopaque = null, memory: DeviceMemory, }; pub const DeviceMemoryOpaqueCaptureAddressInfoKHR = DeviceMemoryOpaqueCaptureAddressInfo; pub const PhysicalDeviceLineRasterizationFeaturesEXT = extern struct { s_type: StructureType = .physical_device_line_rasterization_features_ext, p_next: ?*anyopaque = null, rectangular_lines: Bool32, bresenham_lines: Bool32, smooth_lines: Bool32, stippled_rectangular_lines: Bool32, stippled_bresenham_lines: Bool32, stippled_smooth_lines: Bool32, }; pub const PhysicalDeviceLineRasterizationPropertiesEXT = extern struct { s_type: StructureType = .physical_device_line_rasterization_properties_ext, p_next: ?*anyopaque = null, line_sub_pixel_precision_bits: u32, }; pub const PipelineRasterizationLineStateCreateInfoEXT = extern struct { s_type: StructureType = .pipeline_rasterization_line_state_create_info_ext, p_next: ?*const anyopaque = null, line_rasterization_mode: LineRasterizationModeEXT, stippled_line_enable: Bool32, line_stipple_factor: u32, line_stipple_pattern: u16, }; pub const PhysicalDevicePipelineCreationCacheControlFeaturesEXT = extern struct { s_type: StructureType = .physical_device_pipeline_creation_cache_control_features_ext, p_next: ?*anyopaque = null, pipeline_creation_cache_control: Bool32, }; pub const PhysicalDeviceVulkan11Features = extern struct { s_type: StructureType = .physical_device_vulkan_1_1_features, p_next: ?*anyopaque = null, storage_buffer_16_bit_access: Bool32, uniform_and_storage_buffer_16_bit_access: Bool32, storage_push_constant_16: Bool32, storage_input_output_16: Bool32, multiview: Bool32, multiview_geometry_shader: Bool32, multiview_tessellation_shader: Bool32, variable_pointers_storage_buffer: Bool32, variable_pointers: Bool32, protected_memory: Bool32, sampler_ycbcr_conversion: Bool32, shader_draw_parameters: Bool32, }; pub const PhysicalDeviceVulkan11Properties = extern struct { s_type: StructureType = .physical_device_vulkan_1_1_properties, p_next: ?*anyopaque = null, device_uuid: [UUID_SIZE]u8, driver_uuid: [UUID_SIZE]u8, device_luid: [LUID_SIZE]u8, device_node_mask: u32, device_luid_valid: Bool32, subgroup_size: u32, subgroup_supported_stages: ShaderStageFlags, subgroup_supported_operations: SubgroupFeatureFlags, subgroup_quad_operations_in_all_stages: Bool32, point_clipping_behavior: PointClippingBehavior, max_multiview_view_count: u32, max_multiview_instance_index: u32, protected_no_fault: Bool32, max_per_set_descriptors: u32, max_memory_allocation_size: DeviceSize, }; pub const PhysicalDeviceVulkan12Features = extern struct { s_type: StructureType = .physical_device_vulkan_1_2_features, p_next: ?*anyopaque = null, sampler_mirror_clamp_to_edge: Bool32, draw_indirect_count: Bool32, storage_buffer_8_bit_access: Bool32, uniform_and_storage_buffer_8_bit_access: Bool32, storage_push_constant_8: Bool32, shader_buffer_int_64_atomics: Bool32, shader_shared_int_64_atomics: Bool32, shader_float_16: Bool32, shader_int_8: Bool32, descriptor_indexing: Bool32, shader_input_attachment_array_dynamic_indexing: Bool32, shader_uniform_texel_buffer_array_dynamic_indexing: Bool32, shader_storage_texel_buffer_array_dynamic_indexing: Bool32, shader_uniform_buffer_array_non_uniform_indexing: Bool32, shader_sampled_image_array_non_uniform_indexing: Bool32, shader_storage_buffer_array_non_uniform_indexing: Bool32, shader_storage_image_array_non_uniform_indexing: Bool32, shader_input_attachment_array_non_uniform_indexing: Bool32, shader_uniform_texel_buffer_array_non_uniform_indexing: Bool32, shader_storage_texel_buffer_array_non_uniform_indexing: Bool32, descriptor_binding_uniform_buffer_update_after_bind: Bool32, descriptor_binding_sampled_image_update_after_bind: Bool32, descriptor_binding_storage_image_update_after_bind: Bool32, descriptor_binding_storage_buffer_update_after_bind: Bool32, descriptor_binding_uniform_texel_buffer_update_after_bind: Bool32, descriptor_binding_storage_texel_buffer_update_after_bind: Bool32, descriptor_binding_update_unused_while_pending: Bool32, descriptor_binding_partially_bound: Bool32, descriptor_binding_variable_descriptor_count: Bool32, runtime_descriptor_array: Bool32, sampler_filter_minmax: Bool32, scalar_block_layout: Bool32, imageless_framebuffer: Bool32, uniform_buffer_standard_layout: Bool32, shader_subgroup_extended_types: Bool32, separate_depth_stencil_layouts: Bool32, host_query_reset: Bool32, timeline_semaphore: Bool32, buffer_device_address: Bool32, buffer_device_address_capture_replay: Bool32, buffer_device_address_multi_device: Bool32, vulkan_memory_model: Bool32, vulkan_memory_model_device_scope: Bool32, vulkan_memory_model_availability_visibility_chains: Bool32, shader_output_viewport_index: Bool32, shader_output_layer: Bool32, subgroup_broadcast_dynamic_id: Bool32, }; pub const PhysicalDeviceVulkan12Properties = extern struct { s_type: StructureType = .physical_device_vulkan_1_2_properties, p_next: ?*anyopaque = null, driver_id: DriverId, driver_name: [MAX_DRIVER_NAME_SIZE]u8, driver_info: [MAX_DRIVER_INFO_SIZE]u8, conformance_version: ConformanceVersion, denorm_behavior_independence: ShaderFloatControlsIndependence, rounding_mode_independence: ShaderFloatControlsIndependence, shader_signed_zero_inf_nan_preserve_float_16: Bool32, shader_signed_zero_inf_nan_preserve_float_32: Bool32, shader_signed_zero_inf_nan_preserve_float_64: Bool32, shader_denorm_preserve_float_16: Bool32, shader_denorm_preserve_float_32: Bool32, shader_denorm_preserve_float_64: Bool32, shader_denorm_flush_to_zero_float_16: Bool32, shader_denorm_flush_to_zero_float_32: Bool32, shader_denorm_flush_to_zero_float_64: Bool32, shader_rounding_mode_rte_float_16: Bool32, shader_rounding_mode_rte_float_32: Bool32, shader_rounding_mode_rte_float_64: Bool32, shader_rounding_mode_rtz_float_16: Bool32, shader_rounding_mode_rtz_float_32: Bool32, shader_rounding_mode_rtz_float_64: Bool32, max_update_after_bind_descriptors_in_all_pools: u32, shader_uniform_buffer_array_non_uniform_indexing_native: Bool32, shader_sampled_image_array_non_uniform_indexing_native: Bool32, shader_storage_buffer_array_non_uniform_indexing_native: Bool32, shader_storage_image_array_non_uniform_indexing_native: Bool32, shader_input_attachment_array_non_uniform_indexing_native: Bool32, robust_buffer_access_update_after_bind: Bool32, quad_divergent_implicit_lod: Bool32, max_per_stage_descriptor_update_after_bind_samplers: u32, max_per_stage_descriptor_update_after_bind_uniform_buffers: u32, max_per_stage_descriptor_update_after_bind_storage_buffers: u32, max_per_stage_descriptor_update_after_bind_sampled_images: u32, max_per_stage_descriptor_update_after_bind_storage_images: u32, max_per_stage_descriptor_update_after_bind_input_attachments: u32, max_per_stage_update_after_bind_resources: u32, max_descriptor_set_update_after_bind_samplers: u32, max_descriptor_set_update_after_bind_uniform_buffers: u32, max_descriptor_set_update_after_bind_uniform_buffers_dynamic: u32, max_descriptor_set_update_after_bind_storage_buffers: u32, max_descriptor_set_update_after_bind_storage_buffers_dynamic: u32, max_descriptor_set_update_after_bind_sampled_images: u32, max_descriptor_set_update_after_bind_storage_images: u32, max_descriptor_set_update_after_bind_input_attachments: u32, supported_depth_resolve_modes: ResolveModeFlags, supported_stencil_resolve_modes: ResolveModeFlags, independent_resolve_none: Bool32, independent_resolve: Bool32, filter_minmax_single_component_formats: Bool32, filter_minmax_image_component_mapping: Bool32, max_timeline_semaphore_value_difference: u64, framebuffer_integer_color_sample_counts: SampleCountFlags, }; pub const PipelineCompilerControlCreateInfoAMD = extern struct { s_type: StructureType = .pipeline_compiler_control_create_info_amd, p_next: ?*const anyopaque = null, compiler_control_flags: PipelineCompilerControlFlagsAMD, }; pub const PhysicalDeviceCoherentMemoryFeaturesAMD = extern struct { s_type: StructureType = .physical_device_coherent_memory_features_amd, p_next: ?*anyopaque = null, device_coherent_memory: Bool32, }; pub const PhysicalDeviceToolPropertiesEXT = extern struct { s_type: StructureType = .physical_device_tool_properties_ext, p_next: ?*anyopaque = null, name: [MAX_EXTENSION_NAME_SIZE]u8, version: [MAX_EXTENSION_NAME_SIZE]u8, purposes: ToolPurposeFlagsEXT, description: [MAX_DESCRIPTION_SIZE]u8, layer: [MAX_EXTENSION_NAME_SIZE]u8, }; pub const SamplerCustomBorderColorCreateInfoEXT = extern struct { s_type: StructureType = .sampler_custom_border_color_create_info_ext, p_next: ?*const anyopaque = null, custom_border_color: ClearColorValue, format: Format, }; pub const PhysicalDeviceCustomBorderColorPropertiesEXT = extern struct { s_type: StructureType = .physical_device_custom_border_color_properties_ext, p_next: ?*anyopaque = null, max_custom_border_color_samplers: u32, }; pub const PhysicalDeviceCustomBorderColorFeaturesEXT = extern struct { s_type: StructureType = .physical_device_custom_border_color_features_ext, p_next: ?*anyopaque = null, custom_border_colors: Bool32, custom_border_color_without_format: Bool32, }; pub const DeviceOrHostAddressKHR = extern union { device_address: DeviceAddress, host_address: *anyopaque, }; pub const DeviceOrHostAddressConstKHR = extern union { device_address: DeviceAddress, host_address: *const anyopaque, }; pub const AccelerationStructureGeometryTrianglesDataKHR = extern struct { s_type: StructureType = .acceleration_structure_geometry_triangles_data_khr, p_next: ?*const anyopaque = null, vertex_format: Format, vertex_data: DeviceOrHostAddressConstKHR, vertex_stride: DeviceSize, max_vertex: u32, index_type: IndexType, index_data: DeviceOrHostAddressConstKHR, transform_data: DeviceOrHostAddressConstKHR, }; pub const AccelerationStructureGeometryAabbsDataKHR = extern struct { s_type: StructureType = .acceleration_structure_geometry_aabbs_data_khr, p_next: ?*const anyopaque = null, data: DeviceOrHostAddressConstKHR, stride: DeviceSize, }; pub const AccelerationStructureGeometryInstancesDataKHR = extern struct { s_type: StructureType = .acceleration_structure_geometry_instances_data_khr, p_next: ?*const anyopaque = null, array_of_pointers: Bool32, data: DeviceOrHostAddressConstKHR, }; pub const AccelerationStructureGeometryDataKHR = extern union { triangles: AccelerationStructureGeometryTrianglesDataKHR, aabbs: AccelerationStructureGeometryAabbsDataKHR, instances: AccelerationStructureGeometryInstancesDataKHR, }; pub const AccelerationStructureGeometryKHR = extern struct { s_type: StructureType = .acceleration_structure_geometry_khr, p_next: ?*const anyopaque = null, geometry_type: GeometryTypeKHR, geometry: AccelerationStructureGeometryDataKHR, flags: GeometryFlagsKHR, }; pub const AccelerationStructureBuildGeometryInfoKHR = extern struct { s_type: StructureType = .acceleration_structure_build_geometry_info_khr, p_next: ?*const anyopaque = null, type: AccelerationStructureTypeKHR, flags: BuildAccelerationStructureFlagsKHR, mode: BuildAccelerationStructureModeKHR, src_acceleration_structure: AccelerationStructureKHR, dst_acceleration_structure: AccelerationStructureKHR, geometry_count: u32, p_geometries: ?[*]const AccelerationStructureGeometryKHR, pp_geometries: ?[*]const [*]const AccelerationStructureGeometryKHR, scratch_data: DeviceOrHostAddressKHR, }; pub const AccelerationStructureBuildRangeInfoKHR = extern struct { primitive_count: u32, primitive_offset: u32, first_vertex: u32, transform_offset: u32, }; pub const AccelerationStructureCreateInfoKHR = extern struct { s_type: StructureType = .acceleration_structure_create_info_khr, p_next: ?*const anyopaque = null, create_flags: AccelerationStructureCreateFlagsKHR, buffer: Buffer, offset: DeviceSize, size: DeviceSize, type: AccelerationStructureTypeKHR, device_address: DeviceAddress, }; pub const AabbPositionsKHR = extern struct { min_x: f32, min_y: f32, min_z: f32, max_x: f32, max_y: f32, max_z: f32, }; pub const AabbPositionsNV = AabbPositionsKHR; pub const TransformMatrixKHR = extern struct { matrix: [3][4]f32, }; pub const TransformMatrixNV = TransformMatrixKHR; pub const AccelerationStructureInstanceKHR = packed struct { transform: TransformMatrixKHR, instance_custom_index: u24, mask: u8, instance_shader_binding_table_record_offset: u24, flags: u8, // GeometryInstanceFlagsKHR acceleration_structure_reference: u64, }; pub const AccelerationStructureInstanceNV = AccelerationStructureInstanceKHR; pub const AccelerationStructureDeviceAddressInfoKHR = extern struct { s_type: StructureType = .acceleration_structure_device_address_info_khr, p_next: ?*const anyopaque = null, acceleration_structure: AccelerationStructureKHR, }; pub const AccelerationStructureVersionInfoKHR = extern struct { s_type: StructureType = .acceleration_structure_version_info_khr, p_next: ?*const anyopaque = null, p_version_data: [*]const u8, }; pub const CopyAccelerationStructureInfoKHR = extern struct { s_type: StructureType = .copy_acceleration_structure_info_khr, p_next: ?*const anyopaque = null, src: AccelerationStructureKHR, dst: AccelerationStructureKHR, mode: CopyAccelerationStructureModeKHR, }; pub const CopyAccelerationStructureToMemoryInfoKHR = extern struct { s_type: StructureType = .copy_acceleration_structure_to_memory_info_khr, p_next: ?*const anyopaque = null, src: AccelerationStructureKHR, dst: DeviceOrHostAddressKHR, mode: CopyAccelerationStructureModeKHR, }; pub const CopyMemoryToAccelerationStructureInfoKHR = extern struct { s_type: StructureType = .copy_memory_to_acceleration_structure_info_khr, p_next: ?*const anyopaque = null, src: DeviceOrHostAddressConstKHR, dst: AccelerationStructureKHR, mode: CopyAccelerationStructureModeKHR, }; pub const RayTracingPipelineInterfaceCreateInfoKHR = extern struct { s_type: StructureType = .ray_tracing_pipeline_interface_create_info_khr, p_next: ?*const anyopaque = null, max_pipeline_ray_payload_size: u32, max_pipeline_ray_hit_attribute_size: u32, }; pub const PipelineLibraryCreateInfoKHR = extern struct { s_type: StructureType = .pipeline_library_create_info_khr, p_next: ?*const anyopaque = null, library_count: u32, p_libraries: [*]const Pipeline, }; pub const PhysicalDeviceExtendedDynamicStateFeaturesEXT = extern struct { s_type: StructureType = .physical_device_extended_dynamic_state_features_ext, p_next: ?*anyopaque = null, extended_dynamic_state: Bool32, }; pub const PhysicalDeviceExtendedDynamicState2FeaturesEXT = extern struct { s_type: StructureType = .physical_device_extended_dynamic_state_2_features_ext, p_next: ?*anyopaque = null, extended_dynamic_state_2: Bool32, extended_dynamic_state_2_logic_op: Bool32, extended_dynamic_state_2_patch_control_points: Bool32, }; pub const RenderPassTransformBeginInfoQCOM = extern struct { s_type: StructureType = .render_pass_transform_begin_info_qcom, p_next: ?*anyopaque = null, transform: SurfaceTransformFlagsKHR, }; pub const CopyCommandTransformInfoQCOM = extern struct { s_type: StructureType = .copy_command_transform_info_qcom, p_next: ?*const anyopaque = null, transform: SurfaceTransformFlagsKHR, }; pub const CommandBufferInheritanceRenderPassTransformInfoQCOM = extern struct { s_type: StructureType = .command_buffer_inheritance_render_pass_transform_info_qcom, p_next: ?*anyopaque = null, transform: SurfaceTransformFlagsKHR, render_area: Rect2D, }; pub const PhysicalDeviceDiagnosticsConfigFeaturesNV = extern struct { s_type: StructureType = .physical_device_diagnostics_config_features_nv, p_next: ?*anyopaque = null, diagnostics_config: Bool32, }; pub const DeviceDiagnosticsConfigCreateInfoNV = extern struct { s_type: StructureType = .device_diagnostics_config_create_info_nv, p_next: ?*const anyopaque = null, flags: DeviceDiagnosticsConfigFlagsNV, }; pub const PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR = extern struct { s_type: StructureType = .physical_device_zero_initialize_workgroup_memory_features_khr, p_next: *anyopaque = null, shader_zero_initialize_workgroup_memory: Bool32, }; pub const PhysicalDeviceRobustness2FeaturesEXT = extern struct { s_type: StructureType = .physical_device_robustness_2_features_ext, p_next: ?*anyopaque = null, robust_buffer_access_2: Bool32, robust_image_access_2: Bool32, null_descriptor: Bool32, }; pub const PhysicalDeviceRobustness2PropertiesEXT = extern struct { s_type: StructureType = .physical_device_robustness_2_properties_ext, p_next: ?*anyopaque = null, robust_storage_buffer_access_size_alignment: DeviceSize, robust_uniform_buffer_access_size_alignment: DeviceSize, }; pub const PhysicalDeviceImageRobustnessFeaturesEXT = extern struct { s_type: StructureType = .physical_device_image_robustness_features_ext, p_next: ?*anyopaque = null, robust_image_access: Bool32, }; pub const PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR = extern struct { s_type: StructureType = .physical_device_workgroup_memory_explicit_layout_features_khr, p_next: *anyopaque = null, workgroup_memory_explicit_layout: Bool32, workgroup_memory_explicit_layout_scalar_block_layout: Bool32, workgroup_memory_explicit_layout_8_bit_access: Bool32, workgroup_memory_explicit_layout_16_bit_access: Bool32, }; pub const PhysicalDevicePortabilitySubsetFeaturesKHR = extern struct { s_type: StructureType = .physical_device_portability_subset_features_khr, p_next: ?*anyopaque = null, constant_alpha_color_blend_factors: Bool32, events: Bool32, image_view_format_reinterpretation: Bool32, image_view_format_swizzle: Bool32, image_view_2d_on_3d_image: Bool32, multisample_array_image: Bool32, mutable_comparison_samplers: Bool32, point_polygons: Bool32, sampler_mip_lod_bias: Bool32, separate_stencil_mask_ref: Bool32, shader_sample_rate_interpolation_functions: Bool32, tessellation_isolines: Bool32, tessellation_point_mode: Bool32, triangle_fans: Bool32, vertex_attribute_access_beyond_stride: Bool32, }; pub const PhysicalDevicePortabilitySubsetPropertiesKHR = extern struct { s_type: StructureType = .physical_device_portability_subset_properties_khr, p_next: ?*anyopaque = null, min_vertex_input_binding_stride_alignment: u32, }; pub const PhysicalDevice4444FormatsFeaturesEXT = extern struct { s_type: StructureType = .physical_device_4444_formats_features_ext, p_next: ?*anyopaque = null, format_a4r4g4b4: Bool32, format_a4b4g4r4: Bool32, }; pub const BufferCopy2KHR = extern struct { s_type: StructureType = .buffer_copy_2_khr, p_next: ?*const anyopaque = null, src_offset: DeviceSize, dst_offset: DeviceSize, size: DeviceSize, }; pub const ImageCopy2KHR = extern struct { s_type: StructureType = .image_copy_2_khr, p_next: ?*const anyopaque = null, src_subresource: ImageSubresourceLayers, src_offset: Offset3D, dst_subresource: ImageSubresourceLayers, dst_offset: Offset3D, extent: Extent3D, }; pub const ImageBlit2KHR = extern struct { s_type: StructureType = .image_blit_2_khr, p_next: ?*const anyopaque = null, src_subresource: ImageSubresourceLayers, src_offsets: [2]Offset3D, dst_subresource: ImageSubresourceLayers, dst_offsets: [2]Offset3D, }; pub const BufferImageCopy2KHR = extern struct { s_type: StructureType = .buffer_image_copy_2_khr, p_next: ?*const anyopaque = null, buffer_offset: DeviceSize, buffer_row_length: u32, buffer_image_height: u32, image_subresource: ImageSubresourceLayers, image_offset: Offset3D, image_extent: Extent3D, }; pub const ImageResolve2KHR = extern struct { s_type: StructureType = .image_resolve_2_khr, p_next: ?*const anyopaque = null, src_subresource: ImageSubresourceLayers, src_offset: Offset3D, dst_subresource: ImageSubresourceLayers, dst_offset: Offset3D, extent: Extent3D, }; pub const CopyBufferInfo2KHR = extern struct { s_type: StructureType = .copy_buffer_info_2_khr, p_next: ?*const anyopaque = null, src_buffer: Buffer, dst_buffer: Buffer, region_count: u32, p_regions: [*]const BufferCopy2KHR, }; pub const CopyImageInfo2KHR = extern struct { s_type: StructureType = .copy_image_info_2_khr, p_next: ?*const anyopaque = null, src_image: Image, src_image_layout: ImageLayout, dst_image: Image, dst_image_layout: ImageLayout, region_count: u32, p_regions: [*]const ImageCopy2KHR, }; pub const BlitImageInfo2KHR = extern struct { s_type: StructureType = .blit_image_info_2_khr, p_next: ?*const anyopaque = null, src_image: Image, src_image_layout: ImageLayout, dst_image: Image, dst_image_layout: ImageLayout, region_count: u32, p_regions: [*]const ImageBlit2KHR, filter: Filter, }; pub const CopyBufferToImageInfo2KHR = extern struct { s_type: StructureType = .copy_buffer_to_image_info_2_khr, p_next: ?*const anyopaque = null, src_buffer: Buffer, dst_image: Image, dst_image_layout: ImageLayout, region_count: u32, p_regions: [*]const BufferImageCopy2KHR, }; pub const CopyImageToBufferInfo2KHR = extern struct { s_type: StructureType = .copy_image_to_buffer_info_2_khr, p_next: ?*const anyopaque = null, src_image: Image, src_image_layout: ImageLayout, dst_buffer: Buffer, region_count: u32, p_regions: [*]const BufferImageCopy2KHR, }; pub const ResolveImageInfo2KHR = extern struct { s_type: StructureType = .resolve_image_info_2_khr, p_next: ?*const anyopaque = null, src_image: Image, src_image_layout: ImageLayout, dst_image: Image, dst_image_layout: ImageLayout, region_count: u32, p_regions: [*]const ImageResolve2KHR, }; pub const PhysicalDeviceShaderImageAtomicInt64FeaturesEXT = extern struct { s_type: StructureType = .physical_device_shader_image_atomic_int64_features_ext, p_next: ?*anyopaque = null, shader_image_int_64_atomics: Bool32, sparse_image_int_64_atomics: Bool32, }; pub const FragmentShadingRateAttachmentInfoKHR = extern struct { s_type: StructureType = .fragment_shading_rate_attachment_info_khr, p_next: ?*const anyopaque = null, p_fragment_shading_rate_attachment: *const AttachmentReference2, shading_rate_attachment_texel_size: Extent2D, }; pub const PipelineFragmentShadingRateStateCreateInfoKHR = extern struct { s_type: StructureType = .pipeline_fragment_shading_rate_state_create_info_khr, p_next: ?*const anyopaque = null, fragment_size: Extent2D, combiner_ops: [2]FragmentShadingRateCombinerOpKHR, }; pub const PhysicalDeviceFragmentShadingRateFeaturesKHR = extern struct { s_type: StructureType = .physical_device_fragment_shading_rate_features_khr, p_next: ?*anyopaque = null, pipeline_fragment_shading_rate: Bool32, primitive_fragment_shading_rate: Bool32, attachment_fragment_shading_rate: Bool32, }; pub const PhysicalDeviceFragmentShadingRatePropertiesKHR = extern struct { s_type: StructureType = .physical_device_fragment_shading_rate_properties_khr, p_next: ?*anyopaque = null, min_fragment_shading_rate_attachment_texel_size: Extent2D, max_fragment_shading_rate_attachment_texel_size: Extent2D, max_fragment_shading_rate_attachment_texel_size_aspect_ratio: u32, primitive_fragment_shading_rate_with_multiple_viewports: Bool32, layered_shading_rate_attachments: Bool32, fragment_shading_rate_non_trivial_combiner_ops: Bool32, max_fragment_size: Extent2D, max_fragment_size_aspect_ratio: u32, max_fragment_shading_rate_coverage_samples: u32, max_fragment_shading_rate_rasterization_samples: SampleCountFlags, fragment_shading_rate_with_shader_depth_stencil_writes: Bool32, fragment_shading_rate_with_sample_mask: Bool32, fragment_shading_rate_with_shader_sample_mask: Bool32, fragment_shading_rate_with_conservative_rasterization: Bool32, fragment_shading_rate_with_fragment_shader_interlock: Bool32, fragment_shading_rate_with_custom_sample_locations: Bool32, fragment_shading_rate_strict_multiply_combiner: Bool32, }; pub const PhysicalDeviceFragmentShadingRateKHR = extern struct { s_type: StructureType = .physical_device_fragment_shading_rate_khr, p_next: ?*anyopaque = null, sample_counts: SampleCountFlags, fragment_size: Extent2D, }; pub const PhysicalDeviceShaderTerminateInvocationFeaturesKHR = extern struct { s_type: StructureType = .physical_device_shader_terminate_invocation_features_khr, p_next: ?*anyopaque = null, shader_terminate_invocation: Bool32, }; pub const PhysicalDeviceFragmentShadingRateEnumsFeaturesNV = extern struct { s_type: StructureType = .physical_device_fragment_shading_rate_enums_features_nv, p_next: ?*anyopaque = null, fragment_shading_rate_enums: Bool32, supersample_fragment_shading_rates: Bool32, no_invocation_fragment_shading_rates: Bool32, }; pub const PhysicalDeviceFragmentShadingRateEnumsPropertiesNV = extern struct { s_type: StructureType = .physical_device_fragment_shading_rate_enums_properties_nv, p_next: ?*anyopaque = null, max_fragment_shading_rate_invocation_count: SampleCountFlags, }; pub const PipelineFragmentShadingRateEnumStateCreateInfoNV = extern struct { s_type: StructureType = .pipeline_fragment_shading_rate_enum_state_create_info_nv, p_next: ?*const anyopaque = null, shading_rate_type: FragmentShadingRateTypeNV, shading_rate: FragmentShadingRateNV, combiner_ops: [2]FragmentShadingRateCombinerOpKHR, }; pub const AccelerationStructureBuildSizesInfoKHR = extern struct { s_type: StructureType = .acceleration_structure_build_sizes_info_khr, p_next: ?*const anyopaque = null, acceleration_structure_size: DeviceSize, update_scratch_size: DeviceSize, build_scratch_size: DeviceSize, }; pub const PhysicalDeviceMutableDescriptorTypeFeaturesVALVE = extern struct { s_type: StructureType = .physical_device_mutable_descriptor_type_features_valve, p_next: *anyopaque = null, mutable_descriptor_type: Bool32, }; pub const MutableDescriptorTypeListVALVE = extern struct { descriptor_type_count: u32, p_descriptor_types: [*]const DescriptorType, }; pub const MutableDescriptorTypeCreateInfoVALVE = extern struct { s_type: StructureType = .mutable_descriptor_type_create_info_valve, p_next: *const anyopaque = null, mutable_descriptor_type_list_count: u32, p_mutable_descriptor_type_lists: [*]const MutableDescriptorTypeListVALVE, }; pub const PhysicalDeviceVertexInputDynamicStateFeaturesEXT = extern struct { s_type: StructureType = .physical_device_vertex_input_dynamic_state_features_ext, p_next: *anyopaque = null, vertex_input_dynamic_state: Bool32, }; pub const VertexInputBindingDescription2EXT = extern struct { s_type: StructureType = .vertex_input_binding_description_2_ext, p_next: *anyopaque = null, binding: u32, stride: u32, input_rate: VertexInputRate, divisor: u32, }; pub const VertexInputAttributeDescription2EXT = extern struct { s_type: StructureType = .vertex_input_attribute_description_2_ext, p_next: *anyopaque = null, location: u32, binding: u32, format: Format, offset: u32, }; pub const PhysicalDeviceColorWriteEnableFeaturesEXT = extern struct { s_type: StructureType = .physical_device_color_write_enable_features_ext, p_next: ?*anyopaque = null, color_write_enable: Bool32, }; pub const PipelineColorWriteCreateInfoEXT = extern struct { s_type: StructureType = .pipeline_color_write_create_info_ext, p_next: ?*const anyopaque = null, attachment_count: u32, p_color_write_enables: [*]const Bool32, }; pub const MemoryBarrier2KHR = extern struct { s_type: StructureType = .memory_barrier_2_khr, p_next: *const anyopaque = null, src_stage_mask: PipelineStageFlags2KHR, src_access_mask: AccessFlags2KHR, dst_stage_mask: PipelineStageFlags2KHR, dst_access_mask: AccessFlags2KHR, }; pub const ImageMemoryBarrier2KHR = extern struct { s_type: StructureType = .image_memory_barrier_2_khr, p_next: *const anyopaque = null, src_stage_mask: PipelineStageFlags2KHR, src_access_mask: AccessFlags2KHR, dst_stage_mask: PipelineStageFlags2KHR, dst_access_mask: AccessFlags2KHR, old_layout: ImageLayout, new_layout: ImageLayout, src_queue_family_index: u32, dst_queue_family_index: u32, image: Image, subresource_range: ImageSubresourceRange, }; pub const BufferMemoryBarrier2KHR = extern struct { s_type: StructureType = .buffer_memory_barrier_2_khr, p_next: *const anyopaque = null, src_stage_mask: PipelineStageFlags2KHR, src_access_mask: AccessFlags2KHR, dst_stage_mask: PipelineStageFlags2KHR, dst_access_mask: AccessFlags2KHR, src_queue_family_index: u32, dst_queue_family_index: u32, buffer: Buffer, offset: DeviceSize, size: DeviceSize, }; pub const DependencyInfoKHR = extern struct { s_type: StructureType = .dependency_info_khr, p_next: *const anyopaque = null, dependency_flags: DependencyFlags, memory_barrier_count: u32, p_memory_barriers: [*]const MemoryBarrier2KHR, buffer_memory_barrier_count: u32, p_buffer_memory_barriers: [*]const BufferMemoryBarrier2KHR, image_memory_barrier_count: u32, p_image_memory_barriers: [*]const ImageMemoryBarrier2KHR, }; pub const SemaphoreSubmitInfoKHR = extern struct { s_type: StructureType = .semaphore_submit_info_khr, p_next: *const anyopaque = null, semaphore: Semaphore, value: u64, stage_mask: PipelineStageFlags2KHR, device_index: u32, }; pub const CommandBufferSubmitInfoKHR = extern struct { s_type: StructureType = .command_buffer_submit_info_khr, p_next: *const anyopaque = null, command_buffer: CommandBuffer, device_mask: u32, }; pub const SubmitInfo2KHR = extern struct { s_type: StructureType = .submit_info_2_khr, p_next: *const anyopaque = null, flags: SubmitFlagsKHR, wait_semaphore_info_count: u32, p_wait_semaphore_infos: [*]const SemaphoreSubmitInfoKHR, command_buffer_info_count: u32, p_command_buffer_infos: [*]const CommandBufferSubmitInfoKHR, signal_semaphore_info_count: u32, p_signal_semaphore_infos: [*]const SemaphoreSubmitInfoKHR, }; pub const QueueFamilyCheckpointProperties2NV = extern struct { s_type: StructureType = .queue_family_checkpoint_properties_2_nv, p_next: *anyopaque = null, checkpoint_execution_stage_mask: PipelineStageFlags2KHR, }; pub const CheckpointData2NV = extern struct { s_type: StructureType = .checkpoint_data_2_nv, p_next: *anyopaque = null, stage: PipelineStageFlags2KHR, p_checkpoint_marker: *anyopaque, }; pub const PhysicalDeviceSynchronization2FeaturesKHR = extern struct { s_type: StructureType = .physical_device_synchronization_2_features_khr, p_next: *anyopaque = null, synchronization_2: Bool32, }; pub const VideoQueueFamilyProperties2KHR = extern struct { s_type: StructureType = .video_queue_family_properties_2_khr, p_next: *anyopaque = null, video_codec_operations: VideoCodecOperationFlagsKHR, }; pub const VideoProfilesKHR = extern struct { s_type: StructureType = .video_profiles_khr, p_next: *anyopaque = null, profile_count: u32, p_profiles: *const VideoProfileKHR, }; pub const PhysicalDeviceVideoFormatInfoKHR = extern struct { s_type: StructureType = .physical_device_video_format_info_khr, p_next: *const anyopaque = null, image_usage: ImageUsageFlags, p_video_profiles: *const VideoProfilesKHR, }; pub const VideoFormatPropertiesKHR = extern struct { s_type: StructureType = .video_format_properties_khr, p_next: *anyopaque = null, format: Format, }; pub const VideoProfileKHR = extern struct { s_type: StructureType = .video_profile_khr, p_next: *anyopaque = null, video_codec_operation: VideoCodecOperationFlagsKHR, chroma_subsampling: VideoChromaSubsamplingFlagsKHR, luma_bit_depth: VideoComponentBitDepthFlagsKHR, chroma_bit_depth: VideoComponentBitDepthFlagsKHR, }; pub const VideoCapabilitiesKHR = extern struct { s_type: StructureType = .video_capabilities_khr, p_next: *anyopaque = null, capability_flags: VideoCapabilitiesFlagsKHR, min_bitstream_buffer_offset_alignment: DeviceSize, min_bitstream_buffer_size_alignment: DeviceSize, video_picture_extent_granularity: Extent2D, min_extent: Extent2D, max_extent: Extent2D, max_reference_pictures_slots_count: u32, max_reference_pictures_active_count: u32, }; pub const VideoGetMemoryPropertiesKHR = extern struct { s_type: StructureType = .video_get_memory_properties_khr, p_next: *const anyopaque = null, memory_bind_index: u32, p_memory_requirements: *MemoryRequirements2, }; pub const VideoBindMemoryKHR = extern struct { s_type: StructureType = .video_bind_memory_khr, p_next: *const anyopaque = null, memory_bind_index: u32, memory: DeviceMemory, memory_offset: DeviceSize, memory_size: DeviceSize, }; pub const VideoPictureResourceKHR = extern struct { s_type: StructureType = .video_picture_resource_khr, p_next: *const anyopaque = null, coded_offset: Offset2D, coded_extent: Extent2D, base_array_layer: u32, image_view_binding: ImageView, }; pub const VideoReferenceSlotKHR = extern struct { s_type: StructureType = .video_reference_slot_khr, p_next: *const anyopaque = null, slot_index: i8, p_picture_resource: *const VideoPictureResourceKHR, }; pub const VideoDecodeInfoKHR = extern struct { s_type: StructureType = .video_decode_info_khr, p_next: *const anyopaque = null, flags: VideoDecodeFlagsKHR, coded_offset: Offset2D, coded_extent: Extent2D, src_buffer: Buffer, src_buffer_offset: DeviceSize, src_buffer_range: DeviceSize, dst_picture_resource: VideoPictureResourceKHR, p_setup_reference_slot: *const VideoReferenceSlotKHR, reference_slot_count: u32, p_reference_slots: [*]const VideoReferenceSlotKHR, }; pub const StdVideoH264ProfileIdc = if (@hasDecl(root, "StdVideoH264ProfileIdc")) root.StdVideoH264ProfileIdc else @compileError("Missing type definition of 'StdVideoH264ProfileIdc'"); pub const StdVideoDecodeH264PictureInfo = if (@hasDecl(root, "StdVideoDecodeH264PictureInfo")) root.StdVideoDecodeH264PictureInfo else @compileError("Missing type definition of 'StdVideoDecodeH264PictureInfo'"); pub const StdVideoDecodeH264ReferenceInfo = if (@hasDecl(root, "StdVideoDecodeH264ReferenceInfo")) root.StdVideoDecodeH264ReferenceInfo else @compileError("Missing type definition of 'StdVideoDecodeH264ReferenceInfo'"); pub const StdVideoDecodeH264Mvc = if (@hasDecl(root, "StdVideoDecodeH264Mvc")) root.StdVideoDecodeH264Mvc else @compileError("Missing type definition of 'StdVideoDecodeH264Mvc'"); pub const VideoDecodeH264ProfileEXT = extern struct { s_type: StructureType = .video_decode_h264_profile_ext, p_next: *const anyopaque = null, std_profile_idc: StdVideoH264ProfileIdc, field_layout: VideoDecodeH264FieldLayoutFlagsEXT, }; pub const VideoDecodeH264CapabilitiesEXT = extern struct { s_type: StructureType = .video_decode_h264_capabilities_ext, p_next: *anyopaque = null, max_level: u32, field_offset_granularity: Offset2D, std_extension_version: ExtensionProperties, }; pub const VideoDecodeH264SessionCreateInfoEXT = extern struct { s_type: StructureType = .video_decode_h264_session_create_info_ext, p_next: *const anyopaque = null, flags: VideoDecodeH264CreateFlagsEXT, p_std_extension_version: *const ExtensionProperties, }; pub const StdVideoH264SequenceParameterSet = if (@hasDecl(root, "StdVideoH264SequenceParameterSet")) root.StdVideoH264SequenceParameterSet else @compileError("Missing type definition of 'StdVideoH264SequenceParameterSet'"); pub const StdVideoH264PictureParameterSet = if (@hasDecl(root, "StdVideoH264PictureParameterSet")) root.StdVideoH264PictureParameterSet else @compileError("Missing type definition of 'StdVideoH264PictureParameterSet'"); pub const VideoDecodeH264SessionParametersAddInfoEXT = extern struct { s_type: StructureType = .video_decode_h264_session_parameters_add_info_ext, p_next: *const anyopaque = null, sps_std_count: u32, p_sps_std: ?[*]const StdVideoH264SequenceParameterSet, pps_std_count: u32, p_pps_std: ?[*]const StdVideoH264PictureParameterSet, }; pub const VideoDecodeH264SessionParametersCreateInfoEXT = extern struct { s_type: StructureType = .video_decode_h264_session_parameters_create_info_ext, p_next: *const anyopaque = null, max_sps_std_count: u32, max_pps_std_count: u32, p_parameters_add_info: ?*const VideoDecodeH264SessionParametersAddInfoEXT, }; pub const VideoDecodeH264PictureInfoEXT = extern struct { s_type: StructureType = .video_decode_h264_picture_info_ext, p_next: *const anyopaque = null, p_std_picture_info: *const StdVideoDecodeH264PictureInfo, slices_count: u32, p_slices_data_offsets: [*]const u32, }; pub const VideoDecodeH264DpbSlotInfoEXT = extern struct { s_type: StructureType = .video_decode_h264_dpb_slot_info_ext, p_next: *const anyopaque = null, p_std_reference_info: *const StdVideoDecodeH264ReferenceInfo, }; pub const VideoDecodeH264MvcEXT = extern struct { s_type: StructureType = .video_decode_h264_mvc_ext, p_next: *const anyopaque = null, p_std_mvc: *const StdVideoDecodeH264Mvc, }; pub const StdVideoH265ProfileIdc = if (@hasDecl(root, "StdVideoH265ProfileIdc")) root.StdVideoH265ProfileIdc else @compileError("Missing type definition of 'StdVideoH265ProfileIdc'"); pub const StdVideoH265VideoParameterSet = if (@hasDecl(root, "StdVideoH265VideoParameterSet")) root.StdVideoH265VideoParameterSet else @compileError("Missing type definition of 'StdVideoH265VideoParameterSet'"); pub const StdVideoH265SequenceParameterSet = if (@hasDecl(root, "StdVideoH265SequenceParameterSet")) root.StdVideoH265SequenceParameterSet else @compileError("Missing type definition of 'StdVideoH265SequenceParameterSet'"); pub const StdVideoH265PictureParameterSet = if (@hasDecl(root, "StdVideoH265PictureParameterSet")) root.StdVideoH265PictureParameterSet else @compileError("Missing type definition of 'StdVideoH265PictureParameterSet'"); pub const StdVideoDecodeH265PictureInfo = if (@hasDecl(root, "StdVideoDecodeH265PictureInfo")) root.StdVideoDecodeH265PictureInfo else @compileError("Missing type definition of 'StdVideoDecodeH265PictureInfo'"); pub const StdVideoDecodeH265ReferenceInfo = if (@hasDecl(root, "StdVideoDecodeH265ReferenceInfo")) root.StdVideoDecodeH265ReferenceInfo else @compileError("Missing type definition of 'StdVideoDecodeH265ReferenceInfo'"); pub const VideoDecodeH265ProfileEXT = extern struct { s_type: StructureType = .video_decode_h265_profile_ext, p_next: *const anyopaque = null, std_profile_idc: StdVideoH265ProfileIdc, }; pub const VideoDecodeH265CapabilitiesEXT = extern struct { s_type: StructureType = .video_decode_h265_capabilities_ext, p_next: *anyopaque = null, max_level: u32, std_extension_version: ExtensionProperties, }; pub const VideoDecodeH265SessionCreateInfoEXT = extern struct { s_type: StructureType = .video_decode_h265_session_create_info_ext, p_next: *const anyopaque = null, flags: VideoDecodeH265CreateFlagsEXT, p_std_extension_version: *const ExtensionProperties, }; pub const VideoDecodeH265SessionParametersAddInfoEXT = extern struct { s_type: StructureType = .video_decode_h265_session_parameters_add_info_ext, p_next: *const anyopaque = null, sps_std_count: u32, p_sps_std: ?[*]const StdVideoH265SequenceParameterSet, pps_std_count: u32, p_pps_std: ?[*]const StdVideoH265PictureParameterSet, }; pub const VideoDecodeH265SessionParametersCreateInfoEXT = extern struct { s_type: StructureType = .video_decode_h265_session_parameters_create_info_ext, p_next: *const anyopaque = null, max_sps_std_count: u32, max_pps_std_count: u32, p_parameters_add_info: ?*const VideoDecodeH265SessionParametersAddInfoEXT, }; pub const VideoDecodeH265PictureInfoEXT = extern struct { s_type: StructureType = .video_decode_h265_picture_info_ext, p_next: *const anyopaque = null, p_std_picture_info: *StdVideoDecodeH265PictureInfo, slices_count: u32, p_slices_data_offsets: [*]const u32, }; pub const VideoDecodeH265DpbSlotInfoEXT = extern struct { s_type: StructureType = .video_decode_h265_dpb_slot_info_ext, p_next: *const anyopaque = null, p_std_reference_info: *const StdVideoDecodeH265ReferenceInfo, }; pub const VideoSessionCreateInfoKHR = extern struct { s_type: StructureType = .video_session_create_info_khr, p_next: *const anyopaque = null, queue_family_index: u32, flags: VideoSessionCreateFlagsKHR, p_video_profile: *const VideoProfileKHR, picture_format: Format, max_coded_extent: Extent2D, reference_pictures_format: Format, max_reference_pictures_slots_count: u32, max_reference_pictures_active_count: u32, }; pub const VideoSessionParametersCreateInfoKHR = extern struct { s_type: StructureType = .video_session_parameters_create_info_khr, p_next: *const anyopaque = null, video_session_parameters_template: VideoSessionParametersKHR, video_session: VideoSessionKHR, }; pub const VideoSessionParametersUpdateInfoKHR = extern struct { s_type: StructureType = .video_session_parameters_update_info_khr, p_next: *const anyopaque = null, update_sequence_count: u32, }; pub const VideoBeginCodingInfoKHR = extern struct { s_type: StructureType = .video_begin_coding_info_khr, p_next: *const anyopaque = null, flags: VideoBeginCodingFlagsKHR, codec_quality_preset: VideoCodingQualityPresetFlagsKHR, video_session: VideoSessionKHR, video_session_parameters: VideoSessionParametersKHR, reference_slot_count: u32, p_reference_slots: [*]const VideoReferenceSlotKHR, }; pub const VideoEndCodingInfoKHR = extern struct { s_type: StructureType = .video_end_coding_info_khr, p_next: *const anyopaque = null, flags: VideoEndCodingFlagsKHR, }; pub const VideoCodingControlInfoKHR = extern struct { s_type: StructureType = .video_coding_control_info_khr, p_next: *const anyopaque = null, flags: VideoCodingControlFlagsKHR, }; pub const VideoEncodeInfoKHR = extern struct { s_type: StructureType = .video_encode_info_khr, p_next: *const anyopaque = null, flags: VideoEncodeFlagsKHR, quality_level: u32, coded_extent: Extent2D, dst_bitstream_buffer: Buffer, dst_bitstream_buffer_offset: DeviceSize, dst_bitstream_buffer_max_range: DeviceSize, src_picture_resource: VideoPictureResourceKHR, p_setup_reference_slot: *const VideoReferenceSlotKHR, reference_slot_count: u32, p_reference_slots: [*]const VideoReferenceSlotKHR, }; pub const VideoEncodeRateControlInfoKHR = extern struct { s_type: StructureType = .video_encode_rate_control_info_khr, p_next: *const anyopaque = null, flags: VideoEncodeRateControlFlagsKHR, rate_control_mode: VideoEncodeRateControlModeFlagsKHR, average_bitrate: u32, peak_to_average_bitrate_ratio: u16, frame_rate_numerator: u16, frame_rate_denominator: u16, virtual_buffer_size_in_ms: u32, }; pub const VideoEncodeH264CapabilitiesEXT = extern struct { s_type: StructureType = .video_encode_h264_capabilities_ext, p_next: *const anyopaque = null, flags: VideoEncodeH264CapabilitiesFlagsEXT, input_mode_flags: VideoEncodeH264InputModeFlagsEXT, output_mode_flags: VideoEncodeH264OutputModeFlagsEXT, min_picture_size_in_mbs: Extent2D, max_picture_size_in_mbs: Extent2D, input_image_data_alignment: Extent2D, max_num_l0_reference_for_p: u8, max_num_l0_reference_for_b: u8, max_num_l1_reference: u8, quality_level_count: u8, std_extension_version: ExtensionProperties, }; pub const VideoEncodeH264SessionCreateInfoEXT = extern struct { s_type: StructureType = .video_encode_h264_session_create_info_ext, p_next: *const anyopaque = null, flags: VideoEncodeH264CreateFlagsEXT, max_picture_size_in_mbs: Extent2D, p_std_extension_version: *const ExtensionProperties, }; pub const StdVideoEncodeH264SliceHeader = if (@hasDecl(root, "StdVideoEncodeH264SliceHeader")) root.StdVideoEncodeH264SliceHeader else @compileError("Missing type definition of 'StdVideoEncodeH264SliceHeader'"); pub const StdVideoEncodeH264PictureInfo = if (@hasDecl(root, "StdVideoEncodeH264PictureInfo")) root.StdVideoEncodeH264PictureInfo else @compileError("Missing type definition of 'StdVideoEncodeH264PictureInfo'"); pub const VideoEncodeH264SessionParametersAddInfoEXT = extern struct { s_type: StructureType = .video_encode_h264_session_parameters_add_info_ext, p_next: *const anyopaque = null, sps_std_count: u32, p_sps_std: ?[*]const StdVideoH264SequenceParameterSet, pps_std_count: u32, p_pps_std: ?[*]const StdVideoH264PictureParameterSet, }; pub const VideoEncodeH264SessionParametersCreateInfoEXT = extern struct { s_type: StructureType = .video_encode_h264_session_parameters_create_info_ext, p_next: *const anyopaque = null, max_sps_std_count: u32, max_pps_std_count: u32, p_parameters_add_info: ?*const VideoEncodeH264SessionParametersAddInfoEXT, }; pub const VideoEncodeH264DpbSlotInfoEXT = extern struct { s_type: StructureType = .video_encode_h264_dpb_slot_info_ext, p_next: *const anyopaque = null, slot_index: i8, p_std_picture_info: *const StdVideoEncodeH264PictureInfo, }; pub const VideoEncodeH264VclFrameInfoEXT = extern struct { s_type: StructureType = .video_encode_h264_vcl_frame_info_ext, p_next: *const anyopaque = null, ref_default_final_list_0_entry_count: u8, p_ref_default_final_list_0_entries: [*]const VideoEncodeH264DpbSlotInfoEXT, ref_default_final_list_1_entry_count: u8, p_ref_default_final_list_1_entries: [*]const VideoEncodeH264DpbSlotInfoEXT, nalu_slice_entry_count: u32, p_nalu_slice_entries: [*]const VideoEncodeH264NaluSliceEXT, p_current_picture_info: *const VideoEncodeH264DpbSlotInfoEXT, }; pub const VideoEncodeH264EmitPictureParametersEXT = extern struct { s_type: StructureType = .video_encode_h264_emit_picture_parameters_ext, p_next: *const anyopaque = null, sps_id: u8, emit_sps_enable: Bool32, pps_id_entry_count: u32, pps_id_entries: [*]const u8, }; pub const VideoEncodeH264ProfileEXT = extern struct { s_type: StructureType = .video_encode_h264_profile_ext, p_next: *const anyopaque = null, std_profile_idc: StdVideoH264ProfileIdc, }; pub const VideoEncodeH264NaluSliceEXT = extern struct { s_type: StructureType = .video_encode_h264_nalu_slice_ext, p_next: *const anyopaque = null, p_slice_header_std: *const StdVideoEncodeH264SliceHeader, mb_count: u32, ref_final_list_0_entry_count: u8, p_ref_final_list_0_entries: [*]const VideoEncodeH264DpbSlotInfoEXT, ref_final_list_1_entry_count: u8, p_ref_final_list_1_entries: [*]const VideoEncodeH264DpbSlotInfoEXT, preceding_nalu_bytes: u32, min_qp: u8, max_qp: u8, }; pub const PhysicalDeviceInheritedViewportScissorFeaturesNV = extern struct { s_type: StructureType = .physical_device_inherited_viewport_scissor_features_nv, p_next: *anyopaque = null, inherited_viewport_scissor_2d: Bool32, }; pub const CommandBufferInheritanceViewportScissorInfoNV = extern struct { s_type: StructureType = .command_buffer_inheritance_viewport_scissor_info_nv, p_next: *const anyopaque = null, viewport_scissor_2d: Bool32, viewport_depth_count: u32, p_viewport_depths: *const Viewport, }; pub const PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT = extern struct { s_type: StructureType = .physical_device_ycbcr_2_plane_444_formats_features_ext, p_next: ?*anyopaque = null, ycbcr_2plane_444_formats: Bool32, }; pub const PhysicalDeviceProvokingVertexFeaturesEXT = extern struct { s_type: StructureType = .physical_device_provoking_vertex_features_ext, p_next: *anyopaque = null, provoking_vertex_last: Bool32, transform_feedback_preserves_provoking_vertex: Bool32, }; pub const PhysicalDeviceProvokingVertexPropertiesEXT = extern struct { s_type: StructureType = .physical_device_provoking_vertex_properties_ext, p_next: *anyopaque = null, provoking_vertex_mode_per_pipeline: Bool32, transform_feedback_preserves_triangle_fan_provoking_vertex: Bool32, }; pub const PipelineRasterizationProvokingVertexStateCreateInfoEXT = extern struct { s_type: StructureType = .pipeline_rasterization_provoking_vertex_state_create_info_ext, p_next: *const anyopaque = null, provoking_vertex_mode: ProvokingVertexModeEXT, }; pub const ImageLayout = enum(i32) { @"undefined" = 0, general = 1, color_attachment_optimal = 2, depth_stencil_attachment_optimal = 3, depth_stencil_read_only_optimal = 4, shader_read_only_optimal = 5, transfer_src_optimal = 6, transfer_dst_optimal = 7, preinitialized = 8, depth_read_only_stencil_attachment_optimal = 1000117000, depth_attachment_stencil_read_only_optimal = 1000117001, depth_attachment_optimal = 1000241000, depth_read_only_optimal = 1000241001, stencil_attachment_optimal = 1000241002, stencil_read_only_optimal = 1000241003, present_src_khr = 1000001002, video_decode_dst_khr = 1000024000, video_decode_src_khr = 1000024001, video_decode_dpb_khr = 1000024002, video_encode_dst_khr = 1000299000, video_encode_src_khr = 1000299001, video_encode_dpb_khr = 1000299002, shared_present_khr = 1000111000, //depth_read_only_stencil_attachment_optimal_khr = 1000117000, // alias of depth_read_only_stencil_attachment_optimal //depth_attachment_stencil_read_only_optimal_khr = 1000117001, // alias of depth_attachment_stencil_read_only_optimal shading_rate_optimal_nv = 1000164003, fragment_density_map_optimal_ext = 1000218000, //fragment_shading_rate_attachment_optimal_khr = 1000164003, // alias of shading_rate_optimal_nv //depth_attachment_optimal_khr = 1000241000, // alias of depth_attachment_optimal //depth_read_only_optimal_khr = 1000241001, // alias of depth_read_only_optimal //stencil_attachment_optimal_khr = 1000241002, // alias of stencil_attachment_optimal //stencil_read_only_optimal_khr = 1000241003, // alias of stencil_read_only_optimal read_only_optimal_khr = 1000314000, attachment_optimal_khr = 1000314001, _, }; pub const AttachmentLoadOp = enum(i32) { load = 0, clear = 1, dont_care = 2, _, }; pub const AttachmentStoreOp = enum(i32) { store = 0, dont_care = 1, none_qcom = 1000301000, _, }; pub const ImageType = enum(i32) { @"1d" = 0, @"2d" = 1, @"3d" = 2, _, }; pub const ImageTiling = enum(i32) { optimal = 0, linear = 1, drm_format_modifier_ext = 1000158000, _, }; pub const ImageViewType = enum(i32) { @"1d" = 0, @"2d" = 1, @"3d" = 2, cube = 3, @"1d_array" = 4, @"2d_array" = 5, cube_array = 6, _, }; pub const CommandBufferLevel = enum(i32) { primary = 0, secondary = 1, _, }; pub const ComponentSwizzle = enum(i32) { identity = 0, zero = 1, one = 2, r = 3, g = 4, b = 5, a = 6, _, }; pub const DescriptorType = enum(i32) { sampler = 0, combined_image_sampler = 1, sampled_image = 2, storage_image = 3, uniform_texel_buffer = 4, storage_texel_buffer = 5, uniform_buffer = 6, storage_buffer = 7, uniform_buffer_dynamic = 8, storage_buffer_dynamic = 9, input_attachment = 10, inline_uniform_block_ext = 1000138000, acceleration_structure_khr = 1000150000, acceleration_structure_nv = 1000165000, mutable_valve = 1000351000, _, }; pub const QueryType = enum(i32) { occlusion = 0, pipeline_statistics = 1, timestamp = 2, result_status_only_khr = 1000023000, video_encode_bitstream_buffer_range_khr = 1000299000, transform_feedback_stream_ext = 1000028004, performance_query_khr = 1000116000, acceleration_structure_compacted_size_khr = 1000150000, acceleration_structure_serialization_size_khr = 1000150001, acceleration_structure_compacted_size_nv = 1000165000, performance_query_intel = 1000210000, _, }; pub const BorderColor = enum(i32) { float_transparent_black = 0, int_transparent_black = 1, float_opaque_black = 2, int_opaque_black = 3, float_opaque_white = 4, int_opaque_white = 5, float_custom_ext = 1000287003, int_custom_ext = 1000287004, _, }; pub const PipelineBindPoint = enum(i32) { graphics = 0, compute = 1, ray_tracing_khr = 1000165000, //ray_tracing_nv = 1000165000, // alias of ray_tracing_khr _, }; pub const PipelineCacheHeaderVersion = enum(i32) { one = 1, _, }; pub const PipelineCacheCreateFlags = packed struct { externally_synchronized_bit_ext: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(PipelineCacheCreateFlags, Flags); }; pub const PrimitiveTopology = enum(i32) { point_list = 0, line_list = 1, line_strip = 2, triangle_list = 3, triangle_strip = 4, triangle_fan = 5, line_list_with_adjacency = 6, line_strip_with_adjacency = 7, triangle_list_with_adjacency = 8, triangle_strip_with_adjacency = 9, patch_list = 10, _, }; pub const SharingMode = enum(i32) { exclusive = 0, concurrent = 1, _, }; pub const IndexType = enum(i32) { uint16 = 0, uint32 = 1, none_khr = 1000165000, //none_nv = 1000165000, // alias of none_khr uint8_ext = 1000265000, _, }; pub const Filter = enum(i32) { nearest = 0, linear = 1, cubic_img = 1000015000, //cubic_ext = 1000015000, // alias of cubic_img _, }; pub const SamplerMipmapMode = enum(i32) { nearest = 0, linear = 1, _, }; pub const SamplerAddressMode = enum(i32) { repeat = 0, mirrored_repeat = 1, clamp_to_edge = 2, clamp_to_border = 3, mirror_clamp_to_edge = 4, //mirror_clamp_to_edge_khr = 4, // alias of mirror_clamp_to_edge _, }; pub const CompareOp = enum(i32) { never = 0, less = 1, equal = 2, less_or_equal = 3, greater = 4, not_equal = 5, greater_or_equal = 6, always = 7, _, }; pub const PolygonMode = enum(i32) { fill = 0, line = 1, point = 2, fill_rectangle_nv = 1000153000, _, }; pub const FrontFace = enum(i32) { counter_clockwise = 0, clockwise = 1, _, }; pub const BlendFactor = enum(i32) { zero = 0, one = 1, src_color = 2, one_minus_src_color = 3, dst_color = 4, one_minus_dst_color = 5, src_alpha = 6, one_minus_src_alpha = 7, dst_alpha = 8, one_minus_dst_alpha = 9, constant_color = 10, one_minus_constant_color = 11, constant_alpha = 12, one_minus_constant_alpha = 13, src_alpha_saturate = 14, src1_color = 15, one_minus_src1_color = 16, src1_alpha = 17, one_minus_src1_alpha = 18, _, }; pub const BlendOp = enum(i32) { add = 0, subtract = 1, reverse_subtract = 2, min = 3, max = 4, zero_ext = 1000148000, src_ext = 1000148001, dst_ext = 1000148002, src_over_ext = 1000148003, dst_over_ext = 1000148004, src_in_ext = 1000148005, dst_in_ext = 1000148006, src_out_ext = 1000148007, dst_out_ext = 1000148008, src_atop_ext = 1000148009, dst_atop_ext = 1000148010, xor_ext = 1000148011, multiply_ext = 1000148012, screen_ext = 1000148013, overlay_ext = 1000148014, darken_ext = 1000148015, lighten_ext = 1000148016, colordodge_ext = 1000148017, colorburn_ext = 1000148018, hardlight_ext = 1000148019, softlight_ext = 1000148020, difference_ext = 1000148021, exclusion_ext = 1000148022, invert_ext = 1000148023, invert_rgb_ext = 1000148024, lineardodge_ext = 1000148025, linearburn_ext = 1000148026, vividlight_ext = 1000148027, linearlight_ext = 1000148028, pinlight_ext = 1000148029, hardmix_ext = 1000148030, hsl_hue_ext = 1000148031, hsl_saturation_ext = 1000148032, hsl_color_ext = 1000148033, hsl_luminosity_ext = 1000148034, plus_ext = 1000148035, plus_clamped_ext = 1000148036, plus_clamped_alpha_ext = 1000148037, plus_darker_ext = 1000148038, minus_ext = 1000148039, minus_clamped_ext = 1000148040, contrast_ext = 1000148041, invert_ovg_ext = 1000148042, red_ext = 1000148043, green_ext = 1000148044, blue_ext = 1000148045, _, }; pub const StencilOp = enum(i32) { keep = 0, zero = 1, replace = 2, increment_and_clamp = 3, decrement_and_clamp = 4, invert = 5, increment_and_wrap = 6, decrement_and_wrap = 7, _, }; pub const LogicOp = enum(i32) { clear = 0, @"and" = 1, and_reverse = 2, copy = 3, and_inverted = 4, no_op = 5, xor = 6, @"or" = 7, nor = 8, equivalent = 9, invert = 10, or_reverse = 11, copy_inverted = 12, or_inverted = 13, nand = 14, set = 15, _, }; pub const InternalAllocationType = enum(i32) { executable = 0, _, }; pub const SystemAllocationScope = enum(i32) { command = 0, object = 1, cache = 2, device = 3, instance = 4, _, }; pub const PhysicalDeviceType = enum(i32) { other = 0, integrated_gpu = 1, discrete_gpu = 2, virtual_gpu = 3, cpu = 4, _, }; pub const VertexInputRate = enum(i32) { vertex = 0, instance = 1, _, }; pub const Format = enum(i32) { @"undefined" = 0, r4g4_unorm_pack8 = 1, r4g4b4a4_unorm_pack16 = 2, b4g4r4a4_unorm_pack16 = 3, r5g6b5_unorm_pack16 = 4, b5g6r5_unorm_pack16 = 5, r5g5b5a1_unorm_pack16 = 6, b5g5r5a1_unorm_pack16 = 7, a1r5g5b5_unorm_pack16 = 8, r8_unorm = 9, r8_snorm = 10, r8_uscaled = 11, r8_sscaled = 12, r8_uint = 13, r8_sint = 14, r8_srgb = 15, r8g8_unorm = 16, r8g8_snorm = 17, r8g8_uscaled = 18, r8g8_sscaled = 19, r8g8_uint = 20, r8g8_sint = 21, r8g8_srgb = 22, r8g8b8_unorm = 23, r8g8b8_snorm = 24, r8g8b8_uscaled = 25, r8g8b8_sscaled = 26, r8g8b8_uint = 27, r8g8b8_sint = 28, r8g8b8_srgb = 29, b8g8r8_unorm = 30, b8g8r8_snorm = 31, b8g8r8_uscaled = 32, b8g8r8_sscaled = 33, b8g8r8_uint = 34, b8g8r8_sint = 35, b8g8r8_srgb = 36, r8g8b8a8_unorm = 37, r8g8b8a8_snorm = 38, r8g8b8a8_uscaled = 39, r8g8b8a8_sscaled = 40, r8g8b8a8_uint = 41, r8g8b8a8_sint = 42, r8g8b8a8_srgb = 43, b8g8r8a8_unorm = 44, b8g8r8a8_snorm = 45, b8g8r8a8_uscaled = 46, b8g8r8a8_sscaled = 47, b8g8r8a8_uint = 48, b8g8r8a8_sint = 49, b8g8r8a8_srgb = 50, a8b8g8r8_unorm_pack32 = 51, a8b8g8r8_snorm_pack32 = 52, a8b8g8r8_uscaled_pack32 = 53, a8b8g8r8_sscaled_pack32 = 54, a8b8g8r8_uint_pack32 = 55, a8b8g8r8_sint_pack32 = 56, a8b8g8r8_srgb_pack32 = 57, a2r10g10b10_unorm_pack32 = 58, a2r10g10b10_snorm_pack32 = 59, a2r10g10b10_uscaled_pack32 = 60, a2r10g10b10_sscaled_pack32 = 61, a2r10g10b10_uint_pack32 = 62, a2r10g10b10_sint_pack32 = 63, a2b10g10r10_unorm_pack32 = 64, a2b10g10r10_snorm_pack32 = 65, a2b10g10r10_uscaled_pack32 = 66, a2b10g10r10_sscaled_pack32 = 67, a2b10g10r10_uint_pack32 = 68, a2b10g10r10_sint_pack32 = 69, r16_unorm = 70, r16_snorm = 71, r16_uscaled = 72, r16_sscaled = 73, r16_uint = 74, r16_sint = 75, r16_sfloat = 76, r16g16_unorm = 77, r16g16_snorm = 78, r16g16_uscaled = 79, r16g16_sscaled = 80, r16g16_uint = 81, r16g16_sint = 82, r16g16_sfloat = 83, r16g16b16_unorm = 84, r16g16b16_snorm = 85, r16g16b16_uscaled = 86, r16g16b16_sscaled = 87, r16g16b16_uint = 88, r16g16b16_sint = 89, r16g16b16_sfloat = 90, r16g16b16a16_unorm = 91, r16g16b16a16_snorm = 92, r16g16b16a16_uscaled = 93, r16g16b16a16_sscaled = 94, r16g16b16a16_uint = 95, r16g16b16a16_sint = 96, r16g16b16a16_sfloat = 97, r32_uint = 98, r32_sint = 99, r32_sfloat = 100, r32g32_uint = 101, r32g32_sint = 102, r32g32_sfloat = 103, r32g32b32_uint = 104, r32g32b32_sint = 105, r32g32b32_sfloat = 106, r32g32b32a32_uint = 107, r32g32b32a32_sint = 108, r32g32b32a32_sfloat = 109, r64_uint = 110, r64_sint = 111, r64_sfloat = 112, r64g64_uint = 113, r64g64_sint = 114, r64g64_sfloat = 115, r64g64b64_uint = 116, r64g64b64_sint = 117, r64g64b64_sfloat = 118, r64g64b64a64_uint = 119, r64g64b64a64_sint = 120, r64g64b64a64_sfloat = 121, b10g11r11_ufloat_pack32 = 122, e5b9g9r9_ufloat_pack32 = 123, d16_unorm = 124, x8_d24_unorm_pack32 = 125, d32_sfloat = 126, s8_uint = 127, d16_unorm_s8_uint = 128, d24_unorm_s8_uint = 129, d32_sfloat_s8_uint = 130, bc1_rgb_unorm_block = 131, bc1_rgb_srgb_block = 132, bc1_rgba_unorm_block = 133, bc1_rgba_srgb_block = 134, bc2_unorm_block = 135, bc2_srgb_block = 136, bc3_unorm_block = 137, bc3_srgb_block = 138, bc4_unorm_block = 139, bc4_snorm_block = 140, bc5_unorm_block = 141, bc5_snorm_block = 142, bc6h_ufloat_block = 143, bc6h_sfloat_block = 144, bc7_unorm_block = 145, bc7_srgb_block = 146, etc2_r8g8b8_unorm_block = 147, etc2_r8g8b8_srgb_block = 148, etc2_r8g8b8a1_unorm_block = 149, etc2_r8g8b8a1_srgb_block = 150, etc2_r8g8b8a8_unorm_block = 151, etc2_r8g8b8a8_srgb_block = 152, eac_r11_unorm_block = 153, eac_r11_snorm_block = 154, eac_r11g11_unorm_block = 155, eac_r11g11_snorm_block = 156, astc_4x_4_unorm_block = 157, astc_4x_4_srgb_block = 158, astc_5x_4_unorm_block = 159, astc_5x_4_srgb_block = 160, astc_5x_5_unorm_block = 161, astc_5x_5_srgb_block = 162, astc_6x_5_unorm_block = 163, astc_6x_5_srgb_block = 164, astc_6x_6_unorm_block = 165, astc_6x_6_srgb_block = 166, astc_8x_5_unorm_block = 167, astc_8x_5_srgb_block = 168, astc_8x_6_unorm_block = 169, astc_8x_6_srgb_block = 170, astc_8x_8_unorm_block = 171, astc_8x_8_srgb_block = 172, astc_1_0x_5_unorm_block = 173, astc_1_0x_5_srgb_block = 174, astc_1_0x_6_unorm_block = 175, astc_1_0x_6_srgb_block = 176, astc_1_0x_8_unorm_block = 177, astc_1_0x_8_srgb_block = 178, astc_1_0x_10_unorm_block = 179, astc_1_0x_10_srgb_block = 180, astc_1_2x_10_unorm_block = 181, astc_1_2x_10_srgb_block = 182, astc_1_2x_12_unorm_block = 183, astc_1_2x_12_srgb_block = 184, g8b8g8r8_422_unorm = 1000156000, b8g8r8g8_422_unorm = 1000156001, g8_b8_r8_3plane_420_unorm = 1000156002, g8_b8r8_2plane_420_unorm = 1000156003, g8_b8_r8_3plane_422_unorm = 1000156004, g8_b8r8_2plane_422_unorm = 1000156005, g8_b8_r8_3plane_444_unorm = 1000156006, r10x6_unorm_pack16 = 1000156007, r10x6g10x6_unorm_2pack16 = 1000156008, r10x6g10x6b10x6a10x6_unorm_4pack16 = 1000156009, g10x6b10x6g10x6r10x6_422_unorm_4pack16 = 1000156010, b10x6g10x6r10x6g10x6_422_unorm_4pack16 = 1000156011, g10x6_b10x6_r10x6_3plane_420_unorm_3pack16 = 1000156012, g10x6_b10x6r10x6_2plane_420_unorm_3pack16 = 1000156013, g10x6_b10x6_r10x6_3plane_422_unorm_3pack16 = 1000156014, g10x6_b10x6r10x6_2plane_422_unorm_3pack16 = 1000156015, g10x6_b10x6_r10x6_3plane_444_unorm_3pack16 = 1000156016, r12x4_unorm_pack16 = 1000156017, r12x4g12x4_unorm_2pack16 = 1000156018, r12x4g12x4b12x4a12x4_unorm_4pack16 = 1000156019, g12x4b12x4g12x4r12x4_422_unorm_4pack16 = 1000156020, b12x4g12x4r12x4g12x4_422_unorm_4pack16 = 1000156021, g12x4_b12x4_r12x4_3plane_420_unorm_3pack16 = 1000156022, g12x4_b12x4r12x4_2plane_420_unorm_3pack16 = 1000156023, g12x4_b12x4_r12x4_3plane_422_unorm_3pack16 = 1000156024, g12x4_b12x4r12x4_2plane_422_unorm_3pack16 = 1000156025, g12x4_b12x4_r12x4_3plane_444_unorm_3pack16 = 1000156026, g16b16g16r16_422_unorm = 1000156027, b16g16r16g16_422_unorm = 1000156028, g16_b16_r16_3plane_420_unorm = 1000156029, g16_b16r16_2plane_420_unorm = 1000156030, g16_b16_r16_3plane_422_unorm = 1000156031, g16_b16r16_2plane_422_unorm = 1000156032, g16_b16_r16_3plane_444_unorm = 1000156033, pvrtc1_2bpp_unorm_block_img = 1000054000, pvrtc1_4bpp_unorm_block_img = 1000054001, pvrtc2_2bpp_unorm_block_img = 1000054002, pvrtc2_4bpp_unorm_block_img = 1000054003, pvrtc1_2bpp_srgb_block_img = 1000054004, pvrtc1_4bpp_srgb_block_img = 1000054005, pvrtc2_2bpp_srgb_block_img = 1000054006, pvrtc2_4bpp_srgb_block_img = 1000054007, astc_4x_4_sfloat_block_ext = 1000066000, astc_5x_4_sfloat_block_ext = 1000066001, astc_5x_5_sfloat_block_ext = 1000066002, astc_6x_5_sfloat_block_ext = 1000066003, astc_6x_6_sfloat_block_ext = 1000066004, astc_8x_5_sfloat_block_ext = 1000066005, astc_8x_6_sfloat_block_ext = 1000066006, astc_8x_8_sfloat_block_ext = 1000066007, astc_1_0x_5_sfloat_block_ext = 1000066008, astc_1_0x_6_sfloat_block_ext = 1000066009, astc_1_0x_8_sfloat_block_ext = 1000066010, astc_1_0x_10_sfloat_block_ext = 1000066011, astc_1_2x_10_sfloat_block_ext = 1000066012, astc_1_2x_12_sfloat_block_ext = 1000066013, //g8b8g8r8_422_unorm_khr = 1000156000, // alias of g8b8g8r8_422_unorm //b8g8r8g8_422_unorm_khr = 1000156001, // alias of b8g8r8g8_422_unorm //g8_b8_r8_3plane_420_unorm_khr = 1000156002, // alias of g8_b8_r8_3plane_420_unorm //g8_b8r8_2plane_420_unorm_khr = 1000156003, // alias of g8_b8r8_2plane_420_unorm //g8_b8_r8_3plane_422_unorm_khr = 1000156004, // alias of g8_b8_r8_3plane_422_unorm //g8_b8r8_2plane_422_unorm_khr = 1000156005, // alias of g8_b8r8_2plane_422_unorm //g8_b8_r8_3plane_444_unorm_khr = 1000156006, // alias of g8_b8_r8_3plane_444_unorm //r10x6_unorm_pack16_khr = 1000156007, // alias of r10x6_unorm_pack16 //r10x6g10x6_unorm_2pack16_khr = 1000156008, // alias of r10x6g10x6_unorm_2pack16 //r10x6g10x6b10x6a10x6_unorm_4pack16_khr = 1000156009, // alias of r10x6g10x6b10x6a10x6_unorm_4pack16 //g10x6b10x6g10x6r10x6_422_unorm_4pack16_khr = 1000156010, // alias of g10x6b10x6g10x6r10x6_422_unorm_4pack16 //b10x6g10x6r10x6g10x6_422_unorm_4pack16_khr = 1000156011, // alias of b10x6g10x6r10x6g10x6_422_unorm_4pack16 //g10x6_b10x6_r10x6_3plane_420_unorm_3pack16_khr = 1000156012, // alias of g10x6_b10x6_r10x6_3plane_420_unorm_3pack16 //g10x6_b10x6r10x6_2plane_420_unorm_3pack16_khr = 1000156013, // alias of g10x6_b10x6r10x6_2plane_420_unorm_3pack16 //g10x6_b10x6_r10x6_3plane_422_unorm_3pack16_khr = 1000156014, // alias of g10x6_b10x6_r10x6_3plane_422_unorm_3pack16 //g10x6_b10x6r10x6_2plane_422_unorm_3pack16_khr = 1000156015, // alias of g10x6_b10x6r10x6_2plane_422_unorm_3pack16 //g10x6_b10x6_r10x6_3plane_444_unorm_3pack16_khr = 1000156016, // alias of g10x6_b10x6_r10x6_3plane_444_unorm_3pack16 //r12x4_unorm_pack16_khr = 1000156017, // alias of r12x4_unorm_pack16 //r12x4g12x4_unorm_2pack16_khr = 1000156018, // alias of r12x4g12x4_unorm_2pack16 //r12x4g12x4b12x4a12x4_unorm_4pack16_khr = 1000156019, // alias of r12x4g12x4b12x4a12x4_unorm_4pack16 //g12x4b12x4g12x4r12x4_422_unorm_4pack16_khr = 1000156020, // alias of g12x4b12x4g12x4r12x4_422_unorm_4pack16 //b12x4g12x4r12x4g12x4_422_unorm_4pack16_khr = 1000156021, // alias of b12x4g12x4r12x4g12x4_422_unorm_4pack16 //g12x4_b12x4_r12x4_3plane_420_unorm_3pack16_khr = 1000156022, // alias of g12x4_b12x4_r12x4_3plane_420_unorm_3pack16 //g12x4_b12x4r12x4_2plane_420_unorm_3pack16_khr = 1000156023, // alias of g12x4_b12x4r12x4_2plane_420_unorm_3pack16 //g12x4_b12x4_r12x4_3plane_422_unorm_3pack16_khr = 1000156024, // alias of g12x4_b12x4_r12x4_3plane_422_unorm_3pack16 //g12x4_b12x4r12x4_2plane_422_unorm_3pack16_khr = 1000156025, // alias of g12x4_b12x4r12x4_2plane_422_unorm_3pack16 //g12x4_b12x4_r12x4_3plane_444_unorm_3pack16_khr = 1000156026, // alias of g12x4_b12x4_r12x4_3plane_444_unorm_3pack16 //g16b16g16r16_422_unorm_khr = 1000156027, // alias of g16b16g16r16_422_unorm //b16g16r16g16_422_unorm_khr = 1000156028, // alias of b16g16r16g16_422_unorm //g16_b16_r16_3plane_420_unorm_khr = 1000156029, // alias of g16_b16_r16_3plane_420_unorm //g16_b16r16_2plane_420_unorm_khr = 1000156030, // alias of g16_b16r16_2plane_420_unorm //g16_b16_r16_3plane_422_unorm_khr = 1000156031, // alias of g16_b16_r16_3plane_422_unorm //g16_b16r16_2plane_422_unorm_khr = 1000156032, // alias of g16_b16r16_2plane_422_unorm //g16_b16_r16_3plane_444_unorm_khr = 1000156033, // alias of g16_b16_r16_3plane_444_unorm g8_b8r8_2plane_444_unorm_ext = 1000330000, g10x6_b10x6r10x6_2plane_444_unorm_3pack16_ext = 1000330001, g12x4_b12x4r12x4_2plane_444_unorm_3pack16_ext = 1000330002, g16_b16r16_2plane_444_unorm_ext = 1000330003, a4r4g4b4_unorm_pack16_ext = 1000340000, a4b4g4r4_unorm_pack16_ext = 1000340001, _, }; pub const StructureType = enum(i32) { application_info = 0, instance_create_info = 1, device_queue_create_info = 2, device_create_info = 3, submit_info = 4, memory_allocate_info = 5, mapped_memory_range = 6, bind_sparse_info = 7, fence_create_info = 8, semaphore_create_info = 9, event_create_info = 10, query_pool_create_info = 11, buffer_create_info = 12, buffer_view_create_info = 13, image_create_info = 14, image_view_create_info = 15, shader_module_create_info = 16, pipeline_cache_create_info = 17, pipeline_shader_stage_create_info = 18, pipeline_vertex_input_state_create_info = 19, pipeline_input_assembly_state_create_info = 20, pipeline_tessellation_state_create_info = 21, pipeline_viewport_state_create_info = 22, pipeline_rasterization_state_create_info = 23, pipeline_multisample_state_create_info = 24, pipeline_depth_stencil_state_create_info = 25, pipeline_color_blend_state_create_info = 26, pipeline_dynamic_state_create_info = 27, graphics_pipeline_create_info = 28, compute_pipeline_create_info = 29, pipeline_layout_create_info = 30, sampler_create_info = 31, descriptor_set_layout_create_info = 32, descriptor_pool_create_info = 33, descriptor_set_allocate_info = 34, write_descriptor_set = 35, copy_descriptor_set = 36, framebuffer_create_info = 37, render_pass_create_info = 38, command_pool_create_info = 39, command_buffer_allocate_info = 40, command_buffer_inheritance_info = 41, command_buffer_begin_info = 42, render_pass_begin_info = 43, buffer_memory_barrier = 44, image_memory_barrier = 45, memory_barrier = 46, loader_instance_create_info = 47, loader_device_create_info = 48, physical_device_subgroup_properties = 1000094000, bind_buffer_memory_info = 1000157000, bind_image_memory_info = 1000157001, physical_device_16bit_storage_features = 1000083000, memory_dedicated_requirements = 1000127000, memory_dedicated_allocate_info = 1000127001, memory_allocate_flags_info = 1000060000, device_group_render_pass_begin_info = 1000060003, device_group_command_buffer_begin_info = 1000060004, device_group_submit_info = 1000060005, device_group_bind_sparse_info = 1000060006, bind_buffer_memory_device_group_info = 1000060013, bind_image_memory_device_group_info = 1000060014, physical_device_group_properties = 1000070000, device_group_device_create_info = 1000070001, buffer_memory_requirements_info_2 = 1000146000, image_memory_requirements_info_2 = 1000146001, image_sparse_memory_requirements_info_2 = 1000146002, memory_requirements_2 = 1000146003, sparse_image_memory_requirements_2 = 1000146004, physical_device_features_2 = 1000059000, physical_device_properties_2 = 1000059001, format_properties_2 = 1000059002, image_format_properties_2 = 1000059003, physical_device_image_format_info_2 = 1000059004, queue_family_properties_2 = 1000059005, physical_device_memory_properties_2 = 1000059006, sparse_image_format_properties_2 = 1000059007, physical_device_sparse_image_format_info_2 = 1000059008, physical_device_point_clipping_properties = 1000117000, render_pass_input_attachment_aspect_create_info = 1000117001, image_view_usage_create_info = 1000117002, pipeline_tessellation_domain_origin_state_create_info = 1000117003, render_pass_multiview_create_info = 1000053000, physical_device_multiview_features = 1000053001, physical_device_multiview_properties = 1000053002, physical_device_variable_pointers_features = 1000120000, //physical_device_variable_pointer_features = 1000120000, // alias of physical_device_variable_pointers_features protected_submit_info = 1000145000, physical_device_protected_memory_features = 1000145001, physical_device_protected_memory_properties = 1000145002, device_queue_info_2 = 1000145003, sampler_ycbcr_conversion_create_info = 1000156000, sampler_ycbcr_conversion_info = 1000156001, bind_image_plane_memory_info = 1000156002, image_plane_memory_requirements_info = 1000156003, physical_device_sampler_ycbcr_conversion_features = 1000156004, sampler_ycbcr_conversion_image_format_properties = 1000156005, descriptor_update_template_create_info = 1000085000, physical_device_external_image_format_info = 1000071000, external_image_format_properties = 1000071001, physical_device_external_buffer_info = 1000071002, external_buffer_properties = 1000071003, physical_device_id_properties = 1000071004, external_memory_buffer_create_info = 1000072000, external_memory_image_create_info = 1000072001, export_memory_allocate_info = 1000072002, physical_device_external_fence_info = 1000112000, external_fence_properties = 1000112001, export_fence_create_info = 1000113000, export_semaphore_create_info = 1000077000, physical_device_external_semaphore_info = 1000076000, external_semaphore_properties = 1000076001, physical_device_maintenance_3_properties = 1000168000, descriptor_set_layout_support = 1000168001, physical_device_shader_draw_parameters_features = 1000063000, //physical_device_shader_draw_parameter_features = 1000063000, // alias of physical_device_shader_draw_parameters_features physical_device_vulkan_1_1_features = 49, physical_device_vulkan_1_1_properties = 50, physical_device_vulkan_1_2_features = 51, physical_device_vulkan_1_2_properties = 52, image_format_list_create_info = 1000147000, attachment_description_2 = 1000109000, attachment_reference_2 = 1000109001, subpass_description_2 = 1000109002, subpass_dependency_2 = 1000109003, render_pass_create_info_2 = 1000109004, subpass_begin_info = 1000109005, subpass_end_info = 1000109006, physical_device_8bit_storage_features = 1000177000, physical_device_driver_properties = 1000196000, physical_device_shader_atomic_int64_features = 1000180000, physical_device_shader_float16_int8_features = 1000082000, physical_device_float_controls_properties = 1000197000, descriptor_set_layout_binding_flags_create_info = 1000161000, physical_device_descriptor_indexing_features = 1000161001, physical_device_descriptor_indexing_properties = 1000161002, descriptor_set_variable_descriptor_count_allocate_info = 1000161003, descriptor_set_variable_descriptor_count_layout_support = 1000161004, physical_device_depth_stencil_resolve_properties = 1000199000, subpass_description_depth_stencil_resolve = 1000199001, physical_device_scalar_block_layout_features = 1000221000, image_stencil_usage_create_info = 1000246000, physical_device_sampler_filter_minmax_properties = 1000130000, sampler_reduction_mode_create_info = 1000130001, physical_device_vulkan_memory_model_features = 1000211000, physical_device_imageless_framebuffer_features = 1000108000, framebuffer_attachments_create_info = 1000108001, framebuffer_attachment_image_info = 1000108002, render_pass_attachment_begin_info = 1000108003, physical_device_uniform_buffer_standard_layout_features = 1000253000, physical_device_shader_subgroup_extended_types_features = 1000175000, physical_device_separate_depth_stencil_layouts_features = 1000241000, attachment_reference_stencil_layout = 1000241001, attachment_description_stencil_layout = 1000241002, physical_device_host_query_reset_features = 1000261000, physical_device_timeline_semaphore_features = 1000207000, physical_device_timeline_semaphore_properties = 1000207001, semaphore_type_create_info = 1000207002, timeline_semaphore_submit_info = 1000207003, semaphore_wait_info = 1000207004, semaphore_signal_info = 1000207005, physical_device_buffer_device_address_features = 1000257000, buffer_device_address_info = 1000244001, buffer_opaque_capture_address_create_info = 1000257002, memory_opaque_capture_address_allocate_info = 1000257003, device_memory_opaque_capture_address_info = 1000257004, swapchain_create_info_khr = 1000001000, present_info_khr = 1000001001, device_group_present_capabilities_khr = 1000060007, image_swapchain_create_info_khr = 1000060008, bind_image_memory_swapchain_info_khr = 1000060009, acquire_next_image_info_khr = 1000060010, device_group_present_info_khr = 1000060011, device_group_swapchain_create_info_khr = 1000060012, display_mode_create_info_khr = 1000002000, display_surface_create_info_khr = 1000002001, display_present_info_khr = 1000003000, xlib_surface_create_info_khr = 1000004000, xcb_surface_create_info_khr = 1000005000, wayland_surface_create_info_khr = 1000006000, android_surface_create_info_khr = 1000008000, win32_surface_create_info_khr = 1000009000, debug_report_callback_create_info_ext = 1000011000, pipeline_rasterization_state_rasterization_order_amd = 1000018000, debug_marker_object_name_info_ext = 1000022000, debug_marker_object_tag_info_ext = 1000022001, debug_marker_marker_info_ext = 1000022002, video_profile_khr = 1000023000, video_capabilities_khr = 1000023001, video_picture_resource_khr = 1000023002, video_get_memory_properties_khr = 1000023003, video_bind_memory_khr = 1000023004, video_session_create_info_khr = 1000023005, video_session_parameters_create_info_khr = 1000023006, video_session_parameters_update_info_khr = 1000023007, video_begin_coding_info_khr = 1000023008, video_end_coding_info_khr = 1000023009, video_coding_control_info_khr = 1000023010, video_reference_slot_khr = 1000023011, video_queue_family_properties_2_khr = 1000023012, video_profiles_khr = 1000023013, physical_device_video_format_info_khr = 1000023014, video_format_properties_khr = 1000023015, video_decode_info_khr = 1000024000, video_encode_info_khr = 1000299000, video_encode_rate_control_info_khr = 1000299001, dedicated_allocation_image_create_info_nv = 1000026000, dedicated_allocation_buffer_create_info_nv = 1000026001, dedicated_allocation_memory_allocate_info_nv = 1000026002, physical_device_transform_feedback_features_ext = 1000028000, physical_device_transform_feedback_properties_ext = 1000028001, pipeline_rasterization_state_stream_create_info_ext = 1000028002, image_view_handle_info_nvx = 1000030000, image_view_address_properties_nvx = 1000030001, video_encode_h264_capabilities_ext = 1000038000, video_encode_h264_session_create_info_ext = 1000038001, video_encode_h264_session_parameters_create_info_ext = 1000038002, video_encode_h264_session_parameters_add_info_ext = 1000038003, video_encode_h264_vcl_frame_info_ext = 1000038004, video_encode_h264_dpb_slot_info_ext = 1000038005, video_encode_h264_nalu_slice_ext = 1000038006, video_encode_h264_emit_picture_parameters_ext = 1000038007, video_encode_h264_profile_ext = 1000038008, video_decode_h264_capabilities_ext = 1000040000, video_decode_h264_session_create_info_ext = 1000040001, video_decode_h264_picture_info_ext = 1000040002, video_decode_h264_mvc_ext = 1000040003, video_decode_h264_profile_ext = 1000040004, video_decode_h264_session_parameters_create_info_ext = 1000040005, video_decode_h264_session_parameters_add_info_ext = 1000040006, video_decode_h264_dpb_slot_info_ext = 1000040007, texture_lod_gather_format_properties_amd = 1000041000, stream_descriptor_surface_create_info_ggp = 1000049000, physical_device_corner_sampled_image_features_nv = 1000050000, //render_pass_multiview_create_info_khr = 1000053000, // alias of render_pass_multiview_create_info //physical_device_multiview_features_khr = 1000053001, // alias of physical_device_multiview_features //physical_device_multiview_properties_khr = 1000053002, // alias of physical_device_multiview_properties external_memory_image_create_info_nv = 1000056000, export_memory_allocate_info_nv = 1000056001, import_memory_win32_handle_info_nv = 1000057000, export_memory_win32_handle_info_nv = 1000057001, win32_keyed_mutex_acquire_release_info_nv = 1000058000, //physical_device_features_2_khr = 1000059000, // alias of physical_device_features_2 //physical_device_properties_2_khr = 1000059001, // alias of physical_device_properties_2 //format_properties_2_khr = 1000059002, // alias of format_properties_2 //image_format_properties_2_khr = 1000059003, // alias of image_format_properties_2 //physical_device_image_format_info_2_khr = 1000059004, // alias of physical_device_image_format_info_2 //queue_family_properties_2_khr = 1000059005, // alias of queue_family_properties_2 //physical_device_memory_properties_2_khr = 1000059006, // alias of physical_device_memory_properties_2 //sparse_image_format_properties_2_khr = 1000059007, // alias of sparse_image_format_properties_2 //physical_device_sparse_image_format_info_2_khr = 1000059008, // alias of physical_device_sparse_image_format_info_2 //memory_allocate_flags_info_khr = 1000060000, // alias of memory_allocate_flags_info //device_group_render_pass_begin_info_khr = 1000060003, // alias of device_group_render_pass_begin_info //device_group_command_buffer_begin_info_khr = 1000060004, // alias of device_group_command_buffer_begin_info //device_group_submit_info_khr = 1000060005, // alias of device_group_submit_info //device_group_bind_sparse_info_khr = 1000060006, // alias of device_group_bind_sparse_info //bind_buffer_memory_device_group_info_khr = 1000060013, // alias of bind_buffer_memory_device_group_info //bind_image_memory_device_group_info_khr = 1000060014, // alias of bind_image_memory_device_group_info validation_flags_ext = 1000061000, vi_surface_create_info_nn = 1000062000, physical_device_texture_compression_astc_hdr_features_ext = 1000066000, image_view_astc_decode_mode_ext = 1000067000, physical_device_astc_decode_features_ext = 1000067001, //physical_device_group_properties_khr = 1000070000, // alias of physical_device_group_properties //device_group_device_create_info_khr = 1000070001, // alias of device_group_device_create_info //physical_device_external_image_format_info_khr = 1000071000, // alias of physical_device_external_image_format_info //external_image_format_properties_khr = 1000071001, // alias of external_image_format_properties //physical_device_external_buffer_info_khr = 1000071002, // alias of physical_device_external_buffer_info //external_buffer_properties_khr = 1000071003, // alias of external_buffer_properties //physical_device_id_properties_khr = 1000071004, // alias of physical_device_id_properties //external_memory_buffer_create_info_khr = 1000072000, // alias of external_memory_buffer_create_info //external_memory_image_create_info_khr = 1000072001, // alias of external_memory_image_create_info //export_memory_allocate_info_khr = 1000072002, // alias of export_memory_allocate_info import_memory_win32_handle_info_khr = 1000073000, export_memory_win32_handle_info_khr = 1000073001, memory_win32_handle_properties_khr = 1000073002, memory_get_win32_handle_info_khr = 1000073003, import_memory_fd_info_khr = 1000074000, memory_fd_properties_khr = 1000074001, memory_get_fd_info_khr = 1000074002, win32_keyed_mutex_acquire_release_info_khr = 1000075000, //physical_device_external_semaphore_info_khr = 1000076000, // alias of physical_device_external_semaphore_info //external_semaphore_properties_khr = 1000076001, // alias of external_semaphore_properties //export_semaphore_create_info_khr = 1000077000, // alias of export_semaphore_create_info import_semaphore_win32_handle_info_khr = 1000078000, export_semaphore_win32_handle_info_khr = 1000078001, d3d12_fence_submit_info_khr = 1000078002, semaphore_get_win32_handle_info_khr = 1000078003, import_semaphore_fd_info_khr = 1000079000, semaphore_get_fd_info_khr = 1000079001, physical_device_push_descriptor_properties_khr = 1000080000, command_buffer_inheritance_conditional_rendering_info_ext = 1000081000, physical_device_conditional_rendering_features_ext = 1000081001, conditional_rendering_begin_info_ext = 1000081002, //physical_device_shader_float16_int8_features_khr = 1000082000, // alias of physical_device_shader_float16_int8_features //physical_device_float16_int8_features_khr = 1000082000, // alias of physical_device_shader_float16_int8_features //physical_device_16bit_storage_features_khr = 1000083000, // alias of physical_device_16bit_storage_features present_regions_khr = 1000084000, //descriptor_update_template_create_info_khr = 1000085000, // alias of descriptor_update_template_create_info pipeline_viewport_w_scaling_state_create_info_nv = 1000087000, surface_capabilities_2_ext = 1000090000, display_power_info_ext = 1000091000, device_event_info_ext = 1000091001, display_event_info_ext = 1000091002, swapchain_counter_create_info_ext = 1000091003, present_times_info_google = 1000092000, physical_device_multiview_per_view_attributes_properties_nvx = 1000097000, pipeline_viewport_swizzle_state_create_info_nv = 1000098000, physical_device_discard_rectangle_properties_ext = 1000099000, pipeline_discard_rectangle_state_create_info_ext = 1000099001, physical_device_conservative_rasterization_properties_ext = 1000101000, pipeline_rasterization_conservative_state_create_info_ext = 1000101001, physical_device_depth_clip_enable_features_ext = 1000102000, pipeline_rasterization_depth_clip_state_create_info_ext = 1000102001, hdr_metadata_ext = 1000105000, //physical_device_imageless_framebuffer_features_khr = 1000108000, // alias of physical_device_imageless_framebuffer_features //framebuffer_attachments_create_info_khr = 1000108001, // alias of framebuffer_attachments_create_info //framebuffer_attachment_image_info_khr = 1000108002, // alias of framebuffer_attachment_image_info //render_pass_attachment_begin_info_khr = 1000108003, // alias of render_pass_attachment_begin_info //attachment_description_2_khr = 1000109000, // alias of attachment_description_2 //attachment_reference_2_khr = 1000109001, // alias of attachment_reference_2 //subpass_description_2_khr = 1000109002, // alias of subpass_description_2 //subpass_dependency_2_khr = 1000109003, // alias of subpass_dependency_2 //render_pass_create_info_2_khr = 1000109004, // alias of render_pass_create_info_2 //subpass_begin_info_khr = 1000109005, // alias of subpass_begin_info //subpass_end_info_khr = 1000109006, // alias of subpass_end_info shared_present_surface_capabilities_khr = 1000111000, //physical_device_external_fence_info_khr = 1000112000, // alias of physical_device_external_fence_info //external_fence_properties_khr = 1000112001, // alias of external_fence_properties //export_fence_create_info_khr = 1000113000, // alias of export_fence_create_info import_fence_win32_handle_info_khr = 1000114000, export_fence_win32_handle_info_khr = 1000114001, fence_get_win32_handle_info_khr = 1000114002, import_fence_fd_info_khr = 1000115000, fence_get_fd_info_khr = 1000115001, physical_device_performance_query_features_khr = 1000116000, physical_device_performance_query_properties_khr = 1000116001, query_pool_performance_create_info_khr = 1000116002, performance_query_submit_info_khr = 1000116003, acquire_profiling_lock_info_khr = 1000116004, performance_counter_khr = 1000116005, performance_counter_description_khr = 1000116006, //physical_device_point_clipping_properties_khr = 1000117000, // alias of physical_device_point_clipping_properties //render_pass_input_attachment_aspect_create_info_khr = 1000117001, // alias of render_pass_input_attachment_aspect_create_info //image_view_usage_create_info_khr = 1000117002, // alias of image_view_usage_create_info //pipeline_tessellation_domain_origin_state_create_info_khr = 1000117003, // alias of pipeline_tessellation_domain_origin_state_create_info physical_device_surface_info_2_khr = 1000119000, surface_capabilities_2_khr = 1000119001, surface_format_2_khr = 1000119002, //physical_device_variable_pointers_features_khr = 1000120000, // alias of physical_device_variable_pointers_features //physical_device_variable_pointer_features_khr = 1000120000, // alias of physical_device_variable_pointers_features display_properties_2_khr = 1000121000, display_plane_properties_2_khr = 1000121001, display_mode_properties_2_khr = 1000121002, display_plane_info_2_khr = 1000121003, display_plane_capabilities_2_khr = 1000121004, ios_surface_create_info_mvk = 1000122000, macos_surface_create_info_mvk = 1000123000, //memory_dedicated_requirements_khr = 1000127000, // alias of memory_dedicated_requirements //memory_dedicated_allocate_info_khr = 1000127001, // alias of memory_dedicated_allocate_info debug_utils_object_name_info_ext = 1000128000, debug_utils_object_tag_info_ext = 1000128001, debug_utils_label_ext = 1000128002, debug_utils_messenger_callback_data_ext = 1000128003, debug_utils_messenger_create_info_ext = 1000128004, android_hardware_buffer_usage_android = 1000129000, android_hardware_buffer_properties_android = 1000129001, android_hardware_buffer_format_properties_android = 1000129002, import_android_hardware_buffer_info_android = 1000129003, memory_get_android_hardware_buffer_info_android = 1000129004, external_format_android = 1000129005, //physical_device_sampler_filter_minmax_properties_ext = 1000130000, // alias of physical_device_sampler_filter_minmax_properties //sampler_reduction_mode_create_info_ext = 1000130001, // alias of sampler_reduction_mode_create_info physical_device_inline_uniform_block_features_ext = 1000138000, physical_device_inline_uniform_block_properties_ext = 1000138001, write_descriptor_set_inline_uniform_block_ext = 1000138002, descriptor_pool_inline_uniform_block_create_info_ext = 1000138003, sample_locations_info_ext = 1000143000, render_pass_sample_locations_begin_info_ext = 1000143001, pipeline_sample_locations_state_create_info_ext = 1000143002, physical_device_sample_locations_properties_ext = 1000143003, multisample_properties_ext = 1000143004, //buffer_memory_requirements_info_2_khr = 1000146000, // alias of buffer_memory_requirements_info_2 //image_memory_requirements_info_2_khr = 1000146001, // alias of image_memory_requirements_info_2 //image_sparse_memory_requirements_info_2_khr = 1000146002, // alias of image_sparse_memory_requirements_info_2 //memory_requirements_2_khr = 1000146003, // alias of memory_requirements_2 //sparse_image_memory_requirements_2_khr = 1000146004, // alias of sparse_image_memory_requirements_2 //image_format_list_create_info_khr = 1000147000, // alias of image_format_list_create_info physical_device_blend_operation_advanced_features_ext = 1000148000, physical_device_blend_operation_advanced_properties_ext = 1000148001, pipeline_color_blend_advanced_state_create_info_ext = 1000148002, pipeline_coverage_to_color_state_create_info_nv = 1000149000, write_descriptor_set_acceleration_structure_khr = 1000150007, acceleration_structure_build_geometry_info_khr = 1000150000, acceleration_structure_device_address_info_khr = 1000150002, acceleration_structure_geometry_aabbs_data_khr = 1000150003, acceleration_structure_geometry_instances_data_khr = 1000150004, acceleration_structure_geometry_triangles_data_khr = 1000150005, acceleration_structure_geometry_khr = 1000150006, acceleration_structure_version_info_khr = 1000150009, copy_acceleration_structure_info_khr = 1000150010, copy_acceleration_structure_to_memory_info_khr = 1000150011, copy_memory_to_acceleration_structure_info_khr = 1000150012, physical_device_acceleration_structure_features_khr = 1000150013, physical_device_acceleration_structure_properties_khr = 1000150014, acceleration_structure_create_info_khr = 1000150017, acceleration_structure_build_sizes_info_khr = 1000150020, physical_device_ray_tracing_pipeline_features_khr = 1000347000, physical_device_ray_tracing_pipeline_properties_khr = 1000347001, ray_tracing_pipeline_create_info_khr = 1000150015, ray_tracing_shader_group_create_info_khr = 1000150016, ray_tracing_pipeline_interface_create_info_khr = 1000150018, physical_device_ray_query_features_khr = 1000348013, pipeline_coverage_modulation_state_create_info_nv = 1000152000, physical_device_shader_sm_builtins_features_nv = 1000154000, physical_device_shader_sm_builtins_properties_nv = 1000154001, //sampler_ycbcr_conversion_create_info_khr = 1000156000, // alias of sampler_ycbcr_conversion_create_info //sampler_ycbcr_conversion_info_khr = 1000156001, // alias of sampler_ycbcr_conversion_info //bind_image_plane_memory_info_khr = 1000156002, // alias of bind_image_plane_memory_info //image_plane_memory_requirements_info_khr = 1000156003, // alias of image_plane_memory_requirements_info //physical_device_sampler_ycbcr_conversion_features_khr = 1000156004, // alias of physical_device_sampler_ycbcr_conversion_features //sampler_ycbcr_conversion_image_format_properties_khr = 1000156005, // alias of sampler_ycbcr_conversion_image_format_properties //bind_buffer_memory_info_khr = 1000157000, // alias of bind_buffer_memory_info //bind_image_memory_info_khr = 1000157001, // alias of bind_image_memory_info drm_format_modifier_properties_list_ext = 1000158000, physical_device_image_drm_format_modifier_info_ext = 1000158002, image_drm_format_modifier_list_create_info_ext = 1000158003, image_drm_format_modifier_explicit_create_info_ext = 1000158004, image_drm_format_modifier_properties_ext = 1000158005, validation_cache_create_info_ext = 1000160000, shader_module_validation_cache_create_info_ext = 1000160001, //descriptor_set_layout_binding_flags_create_info_ext = 1000161000, // alias of descriptor_set_layout_binding_flags_create_info //physical_device_descriptor_indexing_features_ext = 1000161001, // alias of physical_device_descriptor_indexing_features //physical_device_descriptor_indexing_properties_ext = 1000161002, // alias of physical_device_descriptor_indexing_properties //descriptor_set_variable_descriptor_count_allocate_info_ext = 1000161003, // alias of descriptor_set_variable_descriptor_count_allocate_info //descriptor_set_variable_descriptor_count_layout_support_ext = 1000161004, // alias of descriptor_set_variable_descriptor_count_layout_support physical_device_portability_subset_features_khr = 1000163000, physical_device_portability_subset_properties_khr = 1000163001, pipeline_viewport_shading_rate_image_state_create_info_nv = 1000164000, physical_device_shading_rate_image_features_nv = 1000164001, physical_device_shading_rate_image_properties_nv = 1000164002, pipeline_viewport_coarse_sample_order_state_create_info_nv = 1000164005, ray_tracing_pipeline_create_info_nv = 1000165000, acceleration_structure_create_info_nv = 1000165001, geometry_nv = 1000165003, geometry_triangles_nv = 1000165004, geometry_aabb_nv = 1000165005, bind_acceleration_structure_memory_info_nv = 1000165006, write_descriptor_set_acceleration_structure_nv = 1000165007, acceleration_structure_memory_requirements_info_nv = 1000165008, physical_device_ray_tracing_properties_nv = 1000165009, ray_tracing_shader_group_create_info_nv = 1000165011, acceleration_structure_info_nv = 1000165012, physical_device_representative_fragment_test_features_nv = 1000166000, pipeline_representative_fragment_test_state_create_info_nv = 1000166001, //physical_device_maintenance_3_properties_khr = 1000168000, // alias of physical_device_maintenance_3_properties //descriptor_set_layout_support_khr = 1000168001, // alias of descriptor_set_layout_support physical_device_image_view_image_format_info_ext = 1000170000, filter_cubic_image_view_image_format_properties_ext = 1000170001, device_queue_global_priority_create_info_ext = 1000174000, //physical_device_shader_subgroup_extended_types_features_khr = 1000175000, // alias of physical_device_shader_subgroup_extended_types_features //physical_device_8bit_storage_features_khr = 1000177000, // alias of physical_device_8bit_storage_features import_memory_host_pointer_info_ext = 1000178000, memory_host_pointer_properties_ext = 1000178001, physical_device_external_memory_host_properties_ext = 1000178002, //physical_device_shader_atomic_int64_features_khr = 1000180000, // alias of physical_device_shader_atomic_int64_features physical_device_shader_clock_features_khr = 1000181000, pipeline_compiler_control_create_info_amd = 1000183000, calibrated_timestamp_info_ext = 1000184000, physical_device_shader_core_properties_amd = 1000185000, video_decode_h265_capabilities_ext = 1000187000, video_decode_h265_session_create_info_ext = 1000187001, video_decode_h265_session_parameters_create_info_ext = 1000187002, video_decode_h265_session_parameters_add_info_ext = 1000187003, video_decode_h265_profile_ext = 1000187004, video_decode_h265_picture_info_ext = 1000187005, video_decode_h265_dpb_slot_info_ext = 1000187006, device_memory_overallocation_create_info_amd = 1000189000, physical_device_vertex_attribute_divisor_properties_ext = 1000190000, pipeline_vertex_input_divisor_state_create_info_ext = 1000190001, physical_device_vertex_attribute_divisor_features_ext = 1000190002, present_frame_token_ggp = 1000191000, pipeline_creation_feedback_create_info_ext = 1000192000, //physical_device_driver_properties_khr = 1000196000, // alias of physical_device_driver_properties //physical_device_float_controls_properties_khr = 1000197000, // alias of physical_device_float_controls_properties //physical_device_depth_stencil_resolve_properties_khr = 1000199000, // alias of physical_device_depth_stencil_resolve_properties //subpass_description_depth_stencil_resolve_khr = 1000199001, // alias of subpass_description_depth_stencil_resolve physical_device_compute_shader_derivatives_features_nv = 1000201000, physical_device_mesh_shader_features_nv = 1000202000, physical_device_mesh_shader_properties_nv = 1000202001, physical_device_fragment_shader_barycentric_features_nv = 1000203000, physical_device_shader_image_footprint_features_nv = 1000204000, pipeline_viewport_exclusive_scissor_state_create_info_nv = 1000205000, physical_device_exclusive_scissor_features_nv = 1000205002, checkpoint_data_nv = 1000206000, queue_family_checkpoint_properties_nv = 1000206001, //physical_device_timeline_semaphore_features_khr = 1000207000, // alias of physical_device_timeline_semaphore_features //physical_device_timeline_semaphore_properties_khr = 1000207001, // alias of physical_device_timeline_semaphore_properties //semaphore_type_create_info_khr = 1000207002, // alias of semaphore_type_create_info //timeline_semaphore_submit_info_khr = 1000207003, // alias of timeline_semaphore_submit_info //semaphore_wait_info_khr = 1000207004, // alias of semaphore_wait_info //semaphore_signal_info_khr = 1000207005, // alias of semaphore_signal_info physical_device_shader_integer_functions_2_features_intel = 1000209000, query_pool_performance_query_create_info_intel = 1000210000, //query_pool_create_info_intel = 1000210000, // alias of query_pool_performance_query_create_info_intel initialize_performance_api_info_intel = 1000210001, performance_marker_info_intel = 1000210002, performance_stream_marker_info_intel = 1000210003, performance_override_info_intel = 1000210004, performance_configuration_acquire_info_intel = 1000210005, //physical_device_vulkan_memory_model_features_khr = 1000211000, // alias of physical_device_vulkan_memory_model_features physical_device_pci_bus_info_properties_ext = 1000212000, display_native_hdr_surface_capabilities_amd = 1000213000, swapchain_display_native_hdr_create_info_amd = 1000213001, imagepipe_surface_create_info_fuchsia = 1000214000, physical_device_shader_terminate_invocation_features_khr = 1000215000, metal_surface_create_info_ext = 1000217000, physical_device_fragment_density_map_features_ext = 1000218000, physical_device_fragment_density_map_properties_ext = 1000218001, render_pass_fragment_density_map_create_info_ext = 1000218002, //physical_device_scalar_block_layout_features_ext = 1000221000, // alias of physical_device_scalar_block_layout_features physical_device_subgroup_size_control_properties_ext = 1000225000, pipeline_shader_stage_required_subgroup_size_create_info_ext = 1000225001, physical_device_subgroup_size_control_features_ext = 1000225002, fragment_shading_rate_attachment_info_khr = 1000226000, pipeline_fragment_shading_rate_state_create_info_khr = 1000226001, physical_device_fragment_shading_rate_properties_khr = 1000226002, physical_device_fragment_shading_rate_features_khr = 1000226003, physical_device_fragment_shading_rate_khr = 1000226004, physical_device_shader_core_properties_2_amd = 1000227000, physical_device_coherent_memory_features_amd = 1000229000, physical_device_shader_image_atomic_int64_features_ext = 1000234000, physical_device_memory_budget_properties_ext = 1000237000, physical_device_memory_priority_features_ext = 1000238000, memory_priority_allocate_info_ext = 1000238001, surface_protected_capabilities_khr = 1000239000, physical_device_dedicated_allocation_image_aliasing_features_nv = 1000240000, //physical_device_separate_depth_stencil_layouts_features_khr = 1000241000, // alias of physical_device_separate_depth_stencil_layouts_features //attachment_reference_stencil_layout_khr = 1000241001, // alias of attachment_reference_stencil_layout //attachment_description_stencil_layout_khr = 1000241002, // alias of attachment_description_stencil_layout physical_device_buffer_device_address_features_ext = 1000244000, //physical_device_buffer_address_features_ext = 1000244000, // alias of physical_device_buffer_device_address_features_ext //buffer_device_address_info_ext = 1000244001, // alias of buffer_device_address_info buffer_device_address_create_info_ext = 1000244002, physical_device_tool_properties_ext = 1000245000, //image_stencil_usage_create_info_ext = 1000246000, // alias of image_stencil_usage_create_info validation_features_ext = 1000247000, physical_device_cooperative_matrix_features_nv = 1000249000, cooperative_matrix_properties_nv = 1000249001, physical_device_cooperative_matrix_properties_nv = 1000249002, physical_device_coverage_reduction_mode_features_nv = 1000250000, pipeline_coverage_reduction_state_create_info_nv = 1000250001, framebuffer_mixed_samples_combination_nv = 1000250002, physical_device_fragment_shader_interlock_features_ext = 1000251000, physical_device_ycbcr_image_arrays_features_ext = 1000252000, //physical_device_uniform_buffer_standard_layout_features_khr = 1000253000, // alias of physical_device_uniform_buffer_standard_layout_features physical_device_provoking_vertex_features_ext = 1000254000, pipeline_rasterization_provoking_vertex_state_create_info_ext = 1000254001, physical_device_provoking_vertex_properties_ext = 1000254002, surface_full_screen_exclusive_info_ext = 1000255000, surface_capabilities_full_screen_exclusive_ext = 1000255002, surface_full_screen_exclusive_win32_info_ext = 1000255001, headless_surface_create_info_ext = 1000256000, //physical_device_buffer_device_address_features_khr = 1000257000, // alias of physical_device_buffer_device_address_features //buffer_device_address_info_khr = 1000244001, // alias of buffer_device_address_info //buffer_opaque_capture_address_create_info_khr = 1000257002, // alias of buffer_opaque_capture_address_create_info //memory_opaque_capture_address_allocate_info_khr = 1000257003, // alias of memory_opaque_capture_address_allocate_info //device_memory_opaque_capture_address_info_khr = 1000257004, // alias of device_memory_opaque_capture_address_info physical_device_line_rasterization_features_ext = 1000259000, pipeline_rasterization_line_state_create_info_ext = 1000259001, physical_device_line_rasterization_properties_ext = 1000259002, physical_device_shader_atomic_float_features_ext = 1000260000, ////physical_device_host_query_reset_features_ext = 1000261000, // alias of physical_device_host_query_reset_features physical_device_index_type_uint8_features_ext = 1000265000, physical_device_extended_dynamic_state_features_ext = 1000267000, physical_device_pipeline_executable_properties_features_khr = 1000269000, pipeline_info_khr = 1000269001, pipeline_executable_properties_khr = 1000269002, pipeline_executable_info_khr = 1000269003, pipeline_executable_statistic_khr = 1000269004, pipeline_executable_internal_representation_khr = 1000269005, physical_device_shader_demote_to_helper_invocation_features_ext = 1000276000, physical_device_device_generated_commands_properties_nv = 1000277000, graphics_shader_group_create_info_nv = 1000277001, graphics_pipeline_shader_groups_create_info_nv = 1000277002, indirect_commands_layout_token_nv = 1000277003, indirect_commands_layout_create_info_nv = 1000277004, generated_commands_info_nv = 1000277005, generated_commands_memory_requirements_info_nv = 1000277006, physical_device_device_generated_commands_features_nv = 1000277007, physical_device_inherited_viewport_scissor_features_nv = 1000278000, command_buffer_inheritance_viewport_scissor_info_nv = 1000278001, physical_device_texel_buffer_alignment_features_ext = 1000281000, physical_device_texel_buffer_alignment_properties_ext = 1000281001, command_buffer_inheritance_render_pass_transform_info_qcom = 1000282000, render_pass_transform_begin_info_qcom = 1000282001, physical_device_device_memory_report_features_ext = 1000284000, device_device_memory_report_create_info_ext = 1000284001, device_memory_report_callback_data_ext = 1000284002, physical_device_robustness_2_features_ext = 1000286000, physical_device_robustness_2_properties_ext = 1000286001, sampler_custom_border_color_create_info_ext = 1000287000, physical_device_custom_border_color_properties_ext = 1000287001, physical_device_custom_border_color_features_ext = 1000287002, pipeline_library_create_info_khr = 1000290000, physical_device_private_data_features_ext = 1000295000, device_private_data_create_info_ext = 1000295001, private_data_slot_create_info_ext = 1000295002, physical_device_pipeline_creation_cache_control_features_ext = 1000297000, physical_device_diagnostics_config_features_nv = 1000300000, device_diagnostics_config_create_info_nv = 1000300001, memory_barrier_2_khr = 1000314000, buffer_memory_barrier_2_khr = 1000314001, image_memory_barrier_2_khr = 1000314002, dependency_info_khr = 1000314003, submit_info_2_khr = 1000314004, semaphore_submit_info_khr = 1000314005, command_buffer_submit_info_khr = 1000314006, physical_device_synchronization_2_features_khr = 1000314007, queue_family_checkpoint_properties_2_nv = 1000314008, checkpoint_data_2_nv = 1000314009, physical_device_zero_initialize_workgroup_memory_features_khr = 1000325000, physical_device_fragment_shading_rate_enums_properties_nv = 1000326000, physical_device_fragment_shading_rate_enums_features_nv = 1000326001, pipeline_fragment_shading_rate_enum_state_create_info_nv = 1000326002, physical_device_ycbcr_2_plane_444_formats_features_ext = 1000330000, physical_device_fragment_density_map_2_features_ext = 1000332000, physical_device_fragment_density_map_2_properties_ext = 1000332001, copy_command_transform_info_qcom = 1000333000, physical_device_image_robustness_features_ext = 1000335000, physical_device_workgroup_memory_explicit_layout_features_khr = 1000336000, copy_buffer_info_2_khr = 1000337000, copy_image_info_2_khr = 1000337001, copy_buffer_to_image_info_2_khr = 1000337002, copy_image_to_buffer_info_2_khr = 1000337003, blit_image_info_2_khr = 1000337004, resolve_image_info_2_khr = 1000337005, buffer_copy_2_khr = 1000337006, image_copy_2_khr = 1000337007, image_blit_2_khr = 1000337008, buffer_image_copy_2_khr = 1000337009, image_resolve_2_khr = 1000337010, physical_device_4444_formats_features_ext = 1000340000, directfb_surface_create_info_ext = 1000346000, physical_device_mutable_descriptor_type_features_valve = 1000351000, mutable_descriptor_type_create_info_valve = 1000351002, physical_device_vertex_input_dynamic_state_features_ext = 1000352000, vertex_input_binding_description_2_ext = 1000352001, vertex_input_attribute_description_2_ext = 1000352002, import_memory_zircon_handle_info_fuchsia = 1000364000, memory_zircon_handle_properties_fuchsia = 1000364001, memory_get_zircon_handle_info_fuchsia = 1000364002, import_semaphore_zircon_handle_info_fuchsia = 1000365000, semaphore_get_zircon_handle_info_fuchsia = 1000365001, physical_device_extended_dynamic_state_2_features_ext = 1000377000, screen_surface_create_info_qnx = 1000378000, physical_device_color_write_enable_features_ext = 1000381000, pipeline_color_write_create_info_ext = 1000381001, _, }; pub const SubpassContents = enum(i32) { @"inline" = 0, secondary_command_buffers = 1, _, }; pub const Result = enum(i32) { success = 0, not_ready = 1, timeout = 2, event_set = 3, event_reset = 4, incomplete = 5, error_out_of_host_memory = -1, error_out_of_device_memory = -2, error_initialization_failed = -3, error_device_lost = -4, error_memory_map_failed = -5, error_layer_not_present = -6, error_extension_not_present = -7, error_feature_not_present = -8, error_incompatible_driver = -9, error_too_many_objects = -10, error_format_not_supported = -11, error_fragmented_pool = -12, error_unknown = -13, error_out_of_pool_memory = -1000069000, error_invalid_external_handle = -1000072003, error_fragmentation = -1000161000, error_invalid_opaque_capture_address = -1000257000, error_surface_lost_khr = -1000000000, error_native_window_in_use_khr = -1000000001, suboptimal_khr = 1000001003, error_out_of_date_khr = -1000001004, error_incompatible_display_khr = -1000003001, error_validation_failed_ext = -1000011001, error_invalid_shader_nv = -1000012000, //error_out_of_pool_memory_khr = -1000069000, // alias of error_out_of_pool_memory //error_invalid_external_handle_khr = -1000072003, // alias of error_invalid_external_handle error_invalid_drm_format_modifier_plane_layout_ext = -1000158000, //error_fragmentation_ext = -1000161000, // alias of error_fragmentation error_not_permitted_ext = -1000174001, //error_invalid_device_address_ext = -1000257000, // alias of error_invalid_opaque_capture_address error_full_screen_exclusive_mode_lost_ext = -1000255000, //error_invalid_opaque_capture_address_khr = -1000257000, // alias of error_invalid_opaque_capture_address thread_idle_khr = 1000268000, thread_done_khr = 1000268001, operation_deferred_khr = 1000268002, operation_not_deferred_khr = 1000268003, pipeline_compile_required_ext = 1000297000, //error_pipeline_compile_required_ext = 1000297000, // alias of pipeline_compile_required_ext _, }; pub const DynamicState = enum(i32) { viewport = 0, scissor = 1, line_width = 2, depth_bias = 3, blend_constants = 4, depth_bounds = 5, stencil_compare_mask = 6, stencil_write_mask = 7, stencil_reference = 8, viewport_w_scaling_nv = 1000087000, discard_rectangle_ext = 1000099000, sample_locations_ext = 1000143000, ray_tracing_pipeline_stack_size_khr = 1000347000, viewport_shading_rate_palette_nv = 1000164004, viewport_coarse_sample_order_nv = 1000164006, exclusive_scissor_nv = 1000205001, fragment_shading_rate_khr = 1000226000, line_stipple_ext = 1000259000, cull_mode_ext = 1000267000, front_face_ext = 1000267001, primitive_topology_ext = 1000267002, viewport_with_count_ext = 1000267003, scissor_with_count_ext = 1000267004, vertex_input_binding_stride_ext = 1000267005, depth_test_enable_ext = 1000267006, depth_write_enable_ext = 1000267007, depth_compare_op_ext = 1000267008, depth_bounds_test_enable_ext = 1000267009, stencil_test_enable_ext = 1000267010, stencil_op_ext = 1000267011, vertex_input_ext = 1000352000, patch_control_points_ext = 1000377000, rasterizer_discard_enable_ext = 1000377001, depth_bias_enable_ext = 1000377002, logic_op_ext = 1000377003, primitive_restart_enable_ext = 1000377004, color_write_enable_ext = 1000381000, _, }; pub const DescriptorUpdateTemplateType = enum(i32) { descriptor_set = 0, push_descriptors_khr = 1, //descriptor_set_khr = 0, // alias of descriptor_set _, }; pub const ObjectType = enum(i32) { unknown = 0, instance = 1, physical_device = 2, device = 3, queue = 4, semaphore = 5, command_buffer = 6, fence = 7, device_memory = 8, buffer = 9, image = 10, event = 11, query_pool = 12, buffer_view = 13, image_view = 14, shader_module = 15, pipeline_cache = 16, pipeline_layout = 17, render_pass = 18, pipeline = 19, descriptor_set_layout = 20, sampler = 21, descriptor_pool = 22, descriptor_set = 23, framebuffer = 24, command_pool = 25, sampler_ycbcr_conversion = 1000156000, descriptor_update_template = 1000085000, surface_khr = 1000000000, swapchain_khr = 1000001000, display_khr = 1000002000, display_mode_khr = 1000002001, debug_report_callback_ext = 1000011000, video_session_khr = 1000023000, video_session_parameters_khr = 1000023001, //descriptor_update_template_khr = 1000085000, // alias of descriptor_update_template debug_utils_messenger_ext = 1000128000, acceleration_structure_khr = 1000150000, //sampler_ycbcr_conversion_khr = 1000156000, // alias of sampler_ycbcr_conversion validation_cache_ext = 1000160000, acceleration_structure_nv = 1000165000, performance_configuration_intel = 1000210000, deferred_operation_khr = 1000268000, indirect_commands_layout_nv = 1000277000, private_data_slot_ext = 1000295000, _, }; pub const QueueFlags = packed struct { graphics_bit: bool align(@alignOf(Flags)) = false, compute_bit: bool = false, transfer_bit: bool = false, sparse_binding_bit: bool = false, protected_bit: bool = false, video_decode_bit_khr: bool = false, video_encode_bit_khr: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(QueueFlags, Flags); }; pub const CullModeFlags = packed struct { front_bit: bool align(@alignOf(Flags)) = false, back_bit: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(CullModeFlags, Flags); }; pub const RenderPassCreateFlags = packed struct { _reserved_bit_0: bool align(@alignOf(Flags)) = false, transform_bit_qcom: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(RenderPassCreateFlags, Flags); }; pub const DeviceQueueCreateFlags = packed struct { protected_bit: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(DeviceQueueCreateFlags, Flags); }; pub const MemoryPropertyFlags = packed struct { device_local_bit: bool align(@alignOf(Flags)) = false, host_visible_bit: bool = false, host_coherent_bit: bool = false, host_cached_bit: bool = false, lazily_allocated_bit: bool = false, protected_bit: bool = false, device_coherent_bit_amd: bool = false, device_uncached_bit_amd: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(MemoryPropertyFlags, Flags); }; pub const MemoryHeapFlags = packed struct { device_local_bit: bool align(@alignOf(Flags)) = false, multi_instance_bit: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(MemoryHeapFlags, Flags); }; pub const AccessFlags = packed struct { indirect_command_read_bit: bool align(@alignOf(Flags)) = false, index_read_bit: bool = false, vertex_attribute_read_bit: bool = false, uniform_read_bit: bool = false, input_attachment_read_bit: bool = false, shader_read_bit: bool = false, shader_write_bit: bool = false, color_attachment_read_bit: bool = false, color_attachment_write_bit: bool = false, depth_stencil_attachment_read_bit: bool = false, depth_stencil_attachment_write_bit: bool = false, transfer_read_bit: bool = false, transfer_write_bit: bool = false, host_read_bit: bool = false, host_write_bit: bool = false, memory_read_bit: bool = false, memory_write_bit: bool = false, command_preprocess_read_bit_nv: bool = false, command_preprocess_write_bit_nv: bool = false, color_attachment_read_noncoherent_bit_ext: bool = false, conditional_rendering_read_bit_ext: bool = false, acceleration_structure_read_bit_khr: bool = false, acceleration_structure_write_bit_khr: bool = false, shading_rate_image_read_bit_nv: bool = false, fragment_density_map_read_bit_ext: bool = false, transform_feedback_write_bit_ext: bool = false, transform_feedback_counter_read_bit_ext: bool = false, transform_feedback_counter_write_bit_ext: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(AccessFlags, Flags); }; pub const BufferUsageFlags = packed struct { transfer_src_bit: bool align(@alignOf(Flags)) = false, transfer_dst_bit: bool = false, uniform_texel_buffer_bit: bool = false, storage_texel_buffer_bit: bool = false, uniform_buffer_bit: bool = false, storage_buffer_bit: bool = false, index_buffer_bit: bool = false, vertex_buffer_bit: bool = false, indirect_buffer_bit: bool = false, conditional_rendering_bit_ext: bool = false, shader_binding_table_bit_khr: bool = false, transform_feedback_buffer_bit_ext: bool = false, transform_feedback_counter_buffer_bit_ext: bool = false, video_decode_src_bit_khr: bool = false, video_decode_dst_bit_khr: bool = false, video_encode_dst_bit_khr: bool = false, video_encode_src_bit_khr: bool = false, shader_device_address_bit: bool = false, _reserved_bit_18: bool = false, acceleration_structure_build_input_read_only_bit_khr: bool = false, acceleration_structure_storage_bit_khr: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(BufferUsageFlags, Flags); }; pub const BufferCreateFlags = packed struct { sparse_binding_bit: bool align(@alignOf(Flags)) = false, sparse_residency_bit: bool = false, sparse_aliased_bit: bool = false, protected_bit: bool = false, device_address_capture_replay_bit: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(BufferCreateFlags, Flags); }; pub const ShaderStageFlags = packed struct { vertex_bit: bool align(@alignOf(Flags)) = false, tessellation_control_bit: bool = false, tessellation_evaluation_bit: bool = false, geometry_bit: bool = false, fragment_bit: bool = false, compute_bit: bool = false, task_bit_nv: bool = false, mesh_bit_nv: bool = false, raygen_bit_khr: bool = false, any_hit_bit_khr: bool = false, closest_hit_bit_khr: bool = false, miss_bit_khr: bool = false, intersection_bit_khr: bool = false, callable_bit_khr: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(ShaderStageFlags, Flags); }; pub const ImageUsageFlags = packed struct { transfer_src_bit: bool align(@alignOf(Flags)) = false, transfer_dst_bit: bool = false, sampled_bit: bool = false, storage_bit: bool = false, color_attachment_bit: bool = false, depth_stencil_attachment_bit: bool = false, transient_attachment_bit: bool = false, input_attachment_bit: bool = false, shading_rate_image_bit_nv: bool = false, fragment_density_map_bit_ext: bool = false, video_decode_dst_bit_khr: bool = false, video_decode_src_bit_khr: bool = false, video_decode_dpb_bit_khr: bool = false, video_encode_dst_bit_khr: bool = false, video_encode_src_bit_khr: bool = false, video_encode_dpb_bit_khr: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(ImageUsageFlags, Flags); }; pub const ImageCreateFlags = packed struct { sparse_binding_bit: bool align(@alignOf(Flags)) = false, sparse_residency_bit: bool = false, sparse_aliased_bit: bool = false, mutable_format_bit: bool = false, cube_compatible_bit: bool = false, @"2d_array_compatible_bit": bool = false, split_instance_bind_regions_bit: bool = false, block_texel_view_compatible_bit: bool = false, extended_usage_bit: bool = false, disjoint_bit: bool = false, alias_bit: bool = false, protected_bit: bool = false, sample_locations_compatible_depth_bit_ext: bool = false, corner_sampled_bit_nv: bool = false, subsampled_bit_ext: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(ImageCreateFlags, Flags); }; pub const ImageViewCreateFlags = packed struct { fragment_density_map_dynamic_bit_ext: bool align(@alignOf(Flags)) = false, fragment_density_map_deferred_bit_ext: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(ImageViewCreateFlags, Flags); }; pub const SamplerCreateFlags = packed struct { subsampled_bit_ext: bool align(@alignOf(Flags)) = false, subsampled_coarse_reconstruction_bit_ext: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(SamplerCreateFlags, Flags); }; pub const PipelineCreateFlags = packed struct { disable_optimization_bit: bool align(@alignOf(Flags)) = false, allow_derivatives_bit: bool = false, derivative_bit: bool = false, view_index_from_device_index_bit: bool = false, dispatch_base_bit: bool = false, defer_compile_bit_nv: bool = false, capture_statistics_bit_khr: bool = false, capture_internal_representations_bit_khr: bool = false, fail_on_pipeline_compile_required_bit_ext: bool = false, early_return_on_failure_bit_ext: bool = false, _reserved_bit_10: bool = false, library_bit_khr: bool = false, ray_tracing_skip_triangles_bit_khr: bool = false, ray_tracing_skip_aabbs_bit_khr: bool = false, ray_tracing_no_null_any_hit_shaders_bit_khr: bool = false, ray_tracing_no_null_closest_hit_shaders_bit_khr: bool = false, ray_tracing_no_null_miss_shaders_bit_khr: bool = false, ray_tracing_no_null_intersection_shaders_bit_khr: bool = false, indirect_bindable_bit_nv: bool = false, ray_tracing_shader_group_handle_capture_replay_bit_khr: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(PipelineCreateFlags, Flags); }; pub const PipelineShaderStageCreateFlags = packed struct { allow_varying_subgroup_size_bit_ext: bool align(@alignOf(Flags)) = false, require_full_subgroups_bit_ext: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(PipelineShaderStageCreateFlags, Flags); }; pub const ColorComponentFlags = packed struct { r_bit: bool align(@alignOf(Flags)) = false, g_bit: bool = false, b_bit: bool = false, a_bit: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(ColorComponentFlags, Flags); }; pub const FenceCreateFlags = packed struct { signaled_bit: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(FenceCreateFlags, Flags); }; pub const FormatFeatureFlags = packed struct { sampled_image_bit: bool align(@alignOf(Flags)) = false, storage_image_bit: bool = false, storage_image_atomic_bit: bool = false, uniform_texel_buffer_bit: bool = false, storage_texel_buffer_bit: bool = false, storage_texel_buffer_atomic_bit: bool = false, vertex_buffer_bit: bool = false, color_attachment_bit: bool = false, color_attachment_blend_bit: bool = false, depth_stencil_attachment_bit: bool = false, blit_src_bit: bool = false, blit_dst_bit: bool = false, sampled_image_filter_linear_bit: bool = false, sampled_image_filter_cubic_bit_img: bool = false, transfer_src_bit: bool = false, transfer_dst_bit: bool = false, sampled_image_filter_minmax_bit: bool = false, midpoint_chroma_samples_bit: bool = false, sampled_image_ycbcr_conversion_linear_filter_bit: bool = false, sampled_image_ycbcr_conversion_separate_reconstruction_filter_bit: bool = false, sampled_image_ycbcr_conversion_chroma_reconstruction_explicit_bit: bool = false, sampled_image_ycbcr_conversion_chroma_reconstruction_explicit_forceable_bit: bool = false, disjoint_bit: bool = false, cosited_chroma_samples_bit: bool = false, fragment_density_map_bit_ext: bool = false, video_decode_output_bit_khr: bool = false, video_decode_dpb_bit_khr: bool = false, video_encode_input_bit_khr: bool = false, video_encode_dpb_bit_khr: bool = false, acceleration_structure_vertex_buffer_bit_khr: bool = false, fragment_shading_rate_attachment_bit_khr: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(FormatFeatureFlags, Flags); }; pub const QueryControlFlags = packed struct { precise_bit: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(QueryControlFlags, Flags); }; pub const QueryResultFlags = packed struct { @"64_bit": bool align(@alignOf(Flags)) = false, wait_bit: bool = false, with_availability_bit: bool = false, partial_bit: bool = false, with_status_bit_khr: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(QueryResultFlags, Flags); }; pub const CommandBufferUsageFlags = packed struct { one_time_submit_bit: bool align(@alignOf(Flags)) = false, render_pass_continue_bit: bool = false, simultaneous_use_bit: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(CommandBufferUsageFlags, Flags); }; pub const QueryPipelineStatisticFlags = packed struct { input_assembly_vertices_bit: bool align(@alignOf(Flags)) = false, input_assembly_primitives_bit: bool = false, vertex_shader_invocations_bit: bool = false, geometry_shader_invocations_bit: bool = false, geometry_shader_primitives_bit: bool = false, clipping_invocations_bit: bool = false, clipping_primitives_bit: bool = false, fragment_shader_invocations_bit: bool = false, tessellation_control_shader_patches_bit: bool = false, tessellation_evaluation_shader_invocations_bit: bool = false, compute_shader_invocations_bit: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(QueryPipelineStatisticFlags, Flags); }; pub const ImageAspectFlags = packed struct { color_bit: bool align(@alignOf(Flags)) = false, depth_bit: bool = false, stencil_bit: bool = false, metadata_bit: bool = false, plane_0_bit: bool = false, plane_1_bit: bool = false, plane_2_bit: bool = false, memory_plane_0_bit_ext: bool = false, memory_plane_1_bit_ext: bool = false, memory_plane_2_bit_ext: bool = false, memory_plane_3_bit_ext: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(ImageAspectFlags, Flags); }; pub const SparseImageFormatFlags = packed struct { single_miptail_bit: bool align(@alignOf(Flags)) = false, aligned_mip_size_bit: bool = false, nonstandard_block_size_bit: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(SparseImageFormatFlags, Flags); }; pub const SparseMemoryBindFlags = packed struct { metadata_bit: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(SparseMemoryBindFlags, Flags); }; pub const PipelineStageFlags = packed struct { top_of_pipe_bit: bool align(@alignOf(Flags)) = false, draw_indirect_bit: bool = false, vertex_input_bit: bool = false, vertex_shader_bit: bool = false, tessellation_control_shader_bit: bool = false, tessellation_evaluation_shader_bit: bool = false, geometry_shader_bit: bool = false, fragment_shader_bit: bool = false, early_fragment_tests_bit: bool = false, late_fragment_tests_bit: bool = false, color_attachment_output_bit: bool = false, compute_shader_bit: bool = false, transfer_bit: bool = false, bottom_of_pipe_bit: bool = false, host_bit: bool = false, all_graphics_bit: bool = false, all_commands_bit: bool = false, command_preprocess_bit_nv: bool = false, conditional_rendering_bit_ext: bool = false, task_shader_bit_nv: bool = false, mesh_shader_bit_nv: bool = false, ray_tracing_shader_bit_khr: bool = false, shading_rate_image_bit_nv: bool = false, fragment_density_process_bit_ext: bool = false, transform_feedback_bit_ext: bool = false, acceleration_structure_build_bit_khr: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(PipelineStageFlags, Flags); }; pub const CommandPoolCreateFlags = packed struct { transient_bit: bool align(@alignOf(Flags)) = false, reset_command_buffer_bit: bool = false, protected_bit: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(CommandPoolCreateFlags, Flags); }; pub const CommandPoolResetFlags = packed struct { release_resources_bit: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(CommandPoolResetFlags, Flags); }; pub const CommandBufferResetFlags = packed struct { release_resources_bit: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(CommandBufferResetFlags, Flags); }; pub const SampleCountFlags = packed struct { @"1_bit": bool align(@alignOf(Flags)) = false, @"2_bit": bool = false, @"4_bit": bool = false, @"8_bit": bool = false, @"16_bit": bool = false, @"32_bit": bool = false, @"64_bit": bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(SampleCountFlags, Flags); }; pub const AttachmentDescriptionFlags = packed struct { may_alias_bit: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(AttachmentDescriptionFlags, Flags); }; pub const StencilFaceFlags = packed struct { front_bit: bool align(@alignOf(Flags)) = false, back_bit: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(StencilFaceFlags, Flags); }; pub const DescriptorPoolCreateFlags = packed struct { free_descriptor_set_bit: bool align(@alignOf(Flags)) = false, update_after_bind_bit: bool = false, host_only_bit_valve: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(DescriptorPoolCreateFlags, Flags); }; pub const DependencyFlags = packed struct { by_region_bit: bool align(@alignOf(Flags)) = false, view_local_bit: bool = false, device_group_bit: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(DependencyFlags, Flags); }; pub const SemaphoreType = enum(i32) { binary = 0, timeline = 1, //binary_khr = 0, // alias of binary //timeline_khr = 1, // alias of timeline _, }; pub const SemaphoreWaitFlags = packed struct { any_bit: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(SemaphoreWaitFlags, Flags); }; pub const PresentModeKHR = enum(i32) { immediate_khr = 0, mailbox_khr = 1, fifo_khr = 2, fifo_relaxed_khr = 3, shared_demand_refresh_khr = 1000111000, shared_continuous_refresh_khr = 1000111001, _, }; pub const ColorSpaceKHR = enum(i32) { srgb_nonlinear_khr = 0, display_p3_nonlinear_ext = 1000104001, extended_srgb_linear_ext = 1000104002, display_p3_linear_ext = 1000104003, dci_p3_nonlinear_ext = 1000104004, bt709_linear_ext = 1000104005, bt709_nonlinear_ext = 1000104006, bt2020_linear_ext = 1000104007, hdr10_st2084_ext = 1000104008, dolbyvision_ext = 1000104009, hdr10_hlg_ext = 1000104010, adobergb_linear_ext = 1000104011, adobergb_nonlinear_ext = 1000104012, pass_through_ext = 1000104013, extended_srgb_nonlinear_ext = 1000104014, display_native_amd = 1000213000, _, }; pub const DisplayPlaneAlphaFlagsKHR = packed struct { opaque_bit_khr: bool align(@alignOf(Flags)) = false, global_bit_khr: bool = false, per_pixel_bit_khr: bool = false, per_pixel_premultiplied_bit_khr: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(DisplayPlaneAlphaFlagsKHR, Flags); }; pub const CompositeAlphaFlagsKHR = packed struct { opaque_bit_khr: bool align(@alignOf(Flags)) = false, pre_multiplied_bit_khr: bool = false, post_multiplied_bit_khr: bool = false, inherit_bit_khr: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(CompositeAlphaFlagsKHR, Flags); }; pub const SurfaceTransformFlagsKHR = packed struct { identity_bit_khr: bool align(@alignOf(Flags)) = false, rotate_90_bit_khr: bool = false, rotate_180_bit_khr: bool = false, rotate_270_bit_khr: bool = false, horizontal_mirror_bit_khr: bool = false, horizontal_mirror_rotate_90_bit_khr: bool = false, horizontal_mirror_rotate_180_bit_khr: bool = false, horizontal_mirror_rotate_270_bit_khr: bool = false, inherit_bit_khr: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(SurfaceTransformFlagsKHR, Flags); }; pub const SwapchainImageUsageFlagsANDROID = packed struct { shared_bit_android: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(SwapchainImageUsageFlagsANDROID, Flags); }; pub const TimeDomainEXT = enum(i32) { device_ext = 0, clock_monotonic_ext = 1, clock_monotonic_raw_ext = 2, query_performance_counter_ext = 3, _, }; pub const DebugReportFlagsEXT = packed struct { information_bit_ext: bool align(@alignOf(Flags)) = false, warning_bit_ext: bool = false, performance_warning_bit_ext: bool = false, error_bit_ext: bool = false, debug_bit_ext: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(DebugReportFlagsEXT, Flags); }; pub const DebugReportObjectTypeEXT = enum(i32) { unknown_ext = 0, instance_ext = 1, physical_device_ext = 2, device_ext = 3, queue_ext = 4, semaphore_ext = 5, command_buffer_ext = 6, fence_ext = 7, device_memory_ext = 8, buffer_ext = 9, image_ext = 10, event_ext = 11, query_pool_ext = 12, buffer_view_ext = 13, image_view_ext = 14, shader_module_ext = 15, pipeline_cache_ext = 16, pipeline_layout_ext = 17, render_pass_ext = 18, pipeline_ext = 19, descriptor_set_layout_ext = 20, sampler_ext = 21, descriptor_pool_ext = 22, descriptor_set_ext = 23, framebuffer_ext = 24, command_pool_ext = 25, surface_khr_ext = 26, swapchain_khr_ext = 27, debug_report_callback_ext_ext = 28, display_khr_ext = 29, display_mode_khr_ext = 30, validation_cache_ext_ext = 33, sampler_ycbcr_conversion_ext = 1000156000, descriptor_update_template_ext = 1000085000, //descriptor_update_template_khr_ext = 1000085000, // alias of descriptor_update_template_ext acceleration_structure_khr_ext = 1000150000, //sampler_ycbcr_conversion_khr_ext = 1000156000, // alias of sampler_ycbcr_conversion_ext acceleration_structure_nv_ext = 1000165000, _, }; pub const DeviceMemoryReportEventTypeEXT = enum(i32) { allocate_ext = 0, free_ext = 1, import_ext = 2, unimport_ext = 3, allocation_failed_ext = 4, _, }; pub const RasterizationOrderAMD = enum(i32) { strict_amd = 0, relaxed_amd = 1, _, }; pub const ExternalMemoryHandleTypeFlagsNV = packed struct { opaque_win32_bit_nv: bool align(@alignOf(Flags)) = false, opaque_win32_kmt_bit_nv: bool = false, d3d11_image_bit_nv: bool = false, d3d11_image_kmt_bit_nv: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(ExternalMemoryHandleTypeFlagsNV, Flags); }; pub const ExternalMemoryFeatureFlagsNV = packed struct { dedicated_only_bit_nv: bool align(@alignOf(Flags)) = false, exportable_bit_nv: bool = false, importable_bit_nv: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(ExternalMemoryFeatureFlagsNV, Flags); }; pub const ValidationCheckEXT = enum(i32) { all_ext = 0, shaders_ext = 1, _, }; pub const ValidationFeatureEnableEXT = enum(i32) { gpu_assisted_ext = 0, gpu_assisted_reserve_binding_slot_ext = 1, best_practices_ext = 2, debug_printf_ext = 3, synchronization_validation_ext = 4, _, }; pub const ValidationFeatureDisableEXT = enum(i32) { all_ext = 0, shaders_ext = 1, thread_safety_ext = 2, api_parameters_ext = 3, object_lifetimes_ext = 4, core_checks_ext = 5, unique_handles_ext = 6, _, }; pub const SubgroupFeatureFlags = packed struct { basic_bit: bool align(@alignOf(Flags)) = false, vote_bit: bool = false, arithmetic_bit: bool = false, ballot_bit: bool = false, shuffle_bit: bool = false, shuffle_relative_bit: bool = false, clustered_bit: bool = false, quad_bit: bool = false, partitioned_bit_nv: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(SubgroupFeatureFlags, Flags); }; pub const IndirectCommandsLayoutUsageFlagsNV = packed struct { explicit_preprocess_bit_nv: bool align(@alignOf(Flags)) = false, indexed_sequences_bit_nv: bool = false, unordered_sequences_bit_nv: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(IndirectCommandsLayoutUsageFlagsNV, Flags); }; pub const IndirectStateFlagsNV = packed struct { flag_frontface_bit_nv: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(IndirectStateFlagsNV, Flags); }; pub const IndirectCommandsTokenTypeNV = enum(i32) { shader_group_nv = 0, state_flags_nv = 1, index_buffer_nv = 2, vertex_buffer_nv = 3, push_constant_nv = 4, draw_indexed_nv = 5, draw_nv = 6, draw_tasks_nv = 7, _, }; pub const PrivateDataSlotCreateFlagsEXT = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(PrivateDataSlotCreateFlagsEXT, Flags); }; pub const DescriptorSetLayoutCreateFlags = packed struct { push_descriptor_bit_khr: bool align(@alignOf(Flags)) = false, update_after_bind_pool_bit: bool = false, host_only_pool_bit_valve: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(DescriptorSetLayoutCreateFlags, Flags); }; pub const ExternalMemoryHandleTypeFlags = packed struct { opaque_fd_bit: bool align(@alignOf(Flags)) = false, opaque_win32_bit: bool = false, opaque_win32_kmt_bit: bool = false, d3d11_texture_bit: bool = false, d3d11_texture_kmt_bit: bool = false, d3d12_heap_bit: bool = false, d3d12_resource_bit: bool = false, host_allocation_bit_ext: bool = false, host_mapped_foreign_memory_bit_ext: bool = false, dma_buf_bit_ext: bool = false, android_hardware_buffer_bit_android: bool = false, zircon_vmo_bit_fuchsia: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(ExternalMemoryHandleTypeFlags, Flags); }; pub const ExternalMemoryFeatureFlags = packed struct { dedicated_only_bit: bool align(@alignOf(Flags)) = false, exportable_bit: bool = false, importable_bit: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(ExternalMemoryFeatureFlags, Flags); }; pub const ExternalSemaphoreHandleTypeFlags = packed struct { opaque_fd_bit: bool align(@alignOf(Flags)) = false, opaque_win32_bit: bool = false, opaque_win32_kmt_bit: bool = false, d3d12_fence_bit: bool = false, sync_fd_bit: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, zircon_event_bit_fuchsia: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(ExternalSemaphoreHandleTypeFlags, Flags); }; pub const ExternalSemaphoreFeatureFlags = packed struct { exportable_bit: bool align(@alignOf(Flags)) = false, importable_bit: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(ExternalSemaphoreFeatureFlags, Flags); }; pub const SemaphoreImportFlags = packed struct { temporary_bit: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(SemaphoreImportFlags, Flags); }; pub const ExternalFenceHandleTypeFlags = packed struct { opaque_fd_bit: bool align(@alignOf(Flags)) = false, opaque_win32_bit: bool = false, opaque_win32_kmt_bit: bool = false, sync_fd_bit: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(ExternalFenceHandleTypeFlags, Flags); }; pub const ExternalFenceFeatureFlags = packed struct { exportable_bit: bool align(@alignOf(Flags)) = false, importable_bit: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(ExternalFenceFeatureFlags, Flags); }; pub const FenceImportFlags = packed struct { temporary_bit: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(FenceImportFlags, Flags); }; pub const SurfaceCounterFlagsEXT = packed struct { vblank_bit_ext: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(SurfaceCounterFlagsEXT, Flags); }; pub const DisplayPowerStateEXT = enum(i32) { off_ext = 0, suspend_ext = 1, on_ext = 2, _, }; pub const DeviceEventTypeEXT = enum(i32) { display_hotplug_ext = 0, _, }; pub const DisplayEventTypeEXT = enum(i32) { first_pixel_out_ext = 0, _, }; pub const PeerMemoryFeatureFlags = packed struct { copy_src_bit: bool align(@alignOf(Flags)) = false, copy_dst_bit: bool = false, generic_src_bit: bool = false, generic_dst_bit: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(PeerMemoryFeatureFlags, Flags); }; pub const MemoryAllocateFlags = packed struct { device_mask_bit: bool align(@alignOf(Flags)) = false, device_address_bit: bool = false, device_address_capture_replay_bit: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(MemoryAllocateFlags, Flags); }; pub const DeviceGroupPresentModeFlagsKHR = packed struct { local_bit_khr: bool align(@alignOf(Flags)) = false, remote_bit_khr: bool = false, sum_bit_khr: bool = false, local_multi_device_bit_khr: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(DeviceGroupPresentModeFlagsKHR, Flags); }; pub const SwapchainCreateFlagsKHR = packed struct { split_instance_bind_regions_bit_khr: bool align(@alignOf(Flags)) = false, protected_bit_khr: bool = false, mutable_format_bit_khr: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(SwapchainCreateFlagsKHR, Flags); }; pub const ViewportCoordinateSwizzleNV = enum(i32) { positive_x_nv = 0, negative_x_nv = 1, positive_y_nv = 2, negative_y_nv = 3, positive_z_nv = 4, negative_z_nv = 5, positive_w_nv = 6, negative_w_nv = 7, _, }; pub const DiscardRectangleModeEXT = enum(i32) { inclusive_ext = 0, exclusive_ext = 1, _, }; pub const SubpassDescriptionFlags = packed struct { per_view_attributes_bit_nvx: bool align(@alignOf(Flags)) = false, per_view_position_x_only_bit_nvx: bool = false, fragment_region_bit_qcom: bool = false, shader_resolve_bit_qcom: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(SubpassDescriptionFlags, Flags); }; pub const PointClippingBehavior = enum(i32) { all_clip_planes = 0, user_clip_planes_only = 1, //all_clip_planes_khr = 0, // alias of all_clip_planes //user_clip_planes_only_khr = 1, // alias of user_clip_planes_only _, }; pub const SamplerReductionMode = enum(i32) { weighted_average = 0, min = 1, max = 2, //weighted_average_ext = 0, // alias of weighted_average //min_ext = 1, // alias of min //max_ext = 2, // alias of max _, }; pub const TessellationDomainOrigin = enum(i32) { upper_left = 0, lower_left = 1, //upper_left_khr = 0, // alias of upper_left //lower_left_khr = 1, // alias of lower_left _, }; pub const SamplerYcbcrModelConversion = enum(i32) { rgb_identity = 0, ycbcr_identity = 1, ycbcr_709 = 2, ycbcr_601 = 3, ycbcr_2020 = 4, //rgb_identity_khr = 0, // alias of rgb_identity //ycbcr_identity_khr = 1, // alias of ycbcr_identity //ycbcr_709_khr = 2, // alias of ycbcr_709 //ycbcr_601_khr = 3, // alias of ycbcr_601 //ycbcr_2020_khr = 4, // alias of ycbcr_2020 _, }; pub const SamplerYcbcrRange = enum(i32) { itu_full = 0, itu_narrow = 1, //itu_full_khr = 0, // alias of itu_full //itu_narrow_khr = 1, // alias of itu_narrow _, }; pub const ChromaLocation = enum(i32) { cosited_even = 0, midpoint = 1, //cosited_even_khr = 0, // alias of cosited_even //midpoint_khr = 1, // alias of midpoint _, }; pub const BlendOverlapEXT = enum(i32) { uncorrelated_ext = 0, disjoint_ext = 1, conjoint_ext = 2, _, }; pub const CoverageModulationModeNV = enum(i32) { none_nv = 0, rgb_nv = 1, alpha_nv = 2, rgba_nv = 3, _, }; pub const CoverageReductionModeNV = enum(i32) { merge_nv = 0, truncate_nv = 1, _, }; pub const ValidationCacheHeaderVersionEXT = enum(i32) { one_ext = 1, _, }; pub const ShaderInfoTypeAMD = enum(i32) { statistics_amd = 0, binary_amd = 1, disassembly_amd = 2, _, }; pub const QueueGlobalPriorityEXT = enum(i32) { low_ext = 128, medium_ext = 256, high_ext = 512, realtime_ext = 1024, _, }; pub const DebugUtilsMessageSeverityFlagsEXT = packed struct { verbose_bit_ext: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, info_bit_ext: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, warning_bit_ext: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, error_bit_ext: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(DebugUtilsMessageSeverityFlagsEXT, Flags); }; pub const DebugUtilsMessageTypeFlagsEXT = packed struct { general_bit_ext: bool align(@alignOf(Flags)) = false, validation_bit_ext: bool = false, performance_bit_ext: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(DebugUtilsMessageTypeFlagsEXT, Flags); }; pub const ConservativeRasterizationModeEXT = enum(i32) { disabled_ext = 0, overestimate_ext = 1, underestimate_ext = 2, _, }; pub const DescriptorBindingFlags = packed struct { update_after_bind_bit: bool align(@alignOf(Flags)) = false, update_unused_while_pending_bit: bool = false, partially_bound_bit: bool = false, variable_descriptor_count_bit: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(DescriptorBindingFlags, Flags); }; pub const VendorId = enum(i32) { _viv = 0x10001, _vsi = 0x10002, kazan = 0x10003, codeplay = 0x10004, _mesa = 0x10005, pocl = 0x10006, _, }; pub const DriverId = enum(i32) { amd_proprietary = 1, amd_open_source = 2, mesa_radv = 3, nvidia_proprietary = 4, intel_proprietary_windows = 5, intel_open_source_mesa = 6, imagination_proprietary = 7, qualcomm_proprietary = 8, arm_proprietary = 9, google_swiftshader = 10, ggp_proprietary = 11, broadcom_proprietary = 12, mesa_llvmpipe = 13, moltenvk = 14, coreavi_proprietary = 15, //amd_proprietary_khr = 1, // alias of amd_proprietary //amd_open_source_khr = 2, // alias of amd_open_source //mesa_radv_khr = 3, // alias of mesa_radv //nvidia_proprietary_khr = 4, // alias of nvidia_proprietary //intel_proprietary_windows_khr = 5, // alias of intel_proprietary_windows //intel_open_source_mesa_khr = 6, // alias of intel_open_source_mesa //imagination_proprietary_khr = 7, // alias of imagination_proprietary //qualcomm_proprietary_khr = 8, // alias of qualcomm_proprietary //arm_proprietary_khr = 9, // alias of arm_proprietary //google_swiftshader_khr = 10, // alias of google_swiftshader //ggp_proprietary_khr = 11, // alias of ggp_proprietary //broadcom_proprietary_khr = 12, // alias of broadcom_proprietary _, }; pub const ConditionalRenderingFlagsEXT = packed struct { inverted_bit_ext: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(ConditionalRenderingFlagsEXT, Flags); }; pub const ResolveModeFlags = packed struct { sample_zero_bit: bool align(@alignOf(Flags)) = false, average_bit: bool = false, min_bit: bool = false, max_bit: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(ResolveModeFlags, Flags); }; pub const ShadingRatePaletteEntryNV = enum(i32) { no_invocations_nv = 0, @"16_invocations_per_pixel_nv" = 1, @"8_invocations_per_pixel_nv" = 2, @"4_invocations_per_pixel_nv" = 3, @"2_invocations_per_pixel_nv" = 4, @"1_invocation_per_pixel_nv" = 5, @"1_invocation_per_2x1_pixels_nv" = 6, @"1_invocation_per_1x2_pixels_nv" = 7, @"1_invocation_per_2x2_pixels_nv" = 8, @"1_invocation_per_4x2_pixels_nv" = 9, @"1_invocation_per_2x4_pixels_nv" = 10, @"1_invocation_per_4x4_pixels_nv" = 11, _, }; pub const CoarseSampleOrderTypeNV = enum(i32) { default_nv = 0, custom_nv = 1, pixel_major_nv = 2, sample_major_nv = 3, _, }; pub const GeometryInstanceFlagsKHR = packed struct { triangle_facing_cull_disable_bit_khr: bool align(@alignOf(Flags)) = false, triangle_front_counterclockwise_bit_khr: bool = false, force_opaque_bit_khr: bool = false, force_no_opaque_bit_khr: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(GeometryInstanceFlagsKHR, Flags); }; pub const GeometryFlagsKHR = packed struct { opaque_bit_khr: bool align(@alignOf(Flags)) = false, no_duplicate_any_hit_invocation_bit_khr: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(GeometryFlagsKHR, Flags); }; pub const BuildAccelerationStructureFlagsKHR = packed struct { allow_update_bit_khr: bool align(@alignOf(Flags)) = false, allow_compaction_bit_khr: bool = false, prefer_fast_trace_bit_khr: bool = false, prefer_fast_build_bit_khr: bool = false, low_memory_bit_khr: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(BuildAccelerationStructureFlagsKHR, Flags); }; pub const AccelerationStructureCreateFlagsKHR = packed struct { device_address_capture_replay_bit_khr: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(AccelerationStructureCreateFlagsKHR, Flags); }; pub const CopyAccelerationStructureModeKHR = enum(i32) { clone_khr = 0, compact_khr = 1, serialize_khr = 2, deserialize_khr = 3, //clone_nv = 0, // alias of clone_khr //compact_nv = 1, // alias of compact_khr _, }; pub const BuildAccelerationStructureModeKHR = enum(i32) { build_khr = 0, update_khr = 1, _, }; pub const AccelerationStructureTypeKHR = enum(i32) { top_level_khr = 0, bottom_level_khr = 1, generic_khr = 2, //top_level_nv = 0, // alias of top_level_khr //bottom_level_nv = 1, // alias of bottom_level_khr _, }; pub const GeometryTypeKHR = enum(i32) { triangles_khr = 0, aabbs_khr = 1, instances_khr = 2, //triangles_nv = 0, // alias of triangles_khr //aabbs_nv = 1, // alias of aabbs_khr _, }; pub const AccelerationStructureMemoryRequirementsTypeNV = enum(i32) { object_nv = 0, build_scratch_nv = 1, update_scratch_nv = 2, _, }; pub const AccelerationStructureBuildTypeKHR = enum(i32) { host_khr = 0, device_khr = 1, host_or_device_khr = 2, _, }; pub const RayTracingShaderGroupTypeKHR = enum(i32) { general_khr = 0, triangles_hit_group_khr = 1, procedural_hit_group_khr = 2, //general_nv = 0, // alias of general_khr //triangles_hit_group_nv = 1, // alias of triangles_hit_group_khr //procedural_hit_group_nv = 2, // alias of procedural_hit_group_khr _, }; pub const AccelerationStructureCompatibilityKHR = enum(i32) { compatible_khr = 0, incompatible_khr = 1, _, }; pub const ShaderGroupShaderKHR = enum(i32) { general_khr = 0, closest_hit_khr = 1, any_hit_khr = 2, intersection_khr = 3, _, }; pub const MemoryOverallocationBehaviorAMD = enum(i32) { default_amd = 0, allowed_amd = 1, disallowed_amd = 2, _, }; pub const FramebufferCreateFlags = packed struct { imageless_bit: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(FramebufferCreateFlags, Flags); }; pub const ScopeNV = enum(i32) { device_nv = 1, workgroup_nv = 2, subgroup_nv = 3, queue_family_nv = 5, _, }; pub const ComponentTypeNV = enum(i32) { float16_nv = 0, float32_nv = 1, float64_nv = 2, sint8_nv = 3, sint16_nv = 4, sint32_nv = 5, sint64_nv = 6, uint8_nv = 7, uint16_nv = 8, uint32_nv = 9, uint64_nv = 10, _, }; pub const DeviceDiagnosticsConfigFlagsNV = packed struct { enable_shader_debug_info_bit_nv: bool align(@alignOf(Flags)) = false, enable_resource_tracking_bit_nv: bool = false, enable_automatic_checkpoints_bit_nv: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(DeviceDiagnosticsConfigFlagsNV, Flags); }; pub const PipelineCreationFeedbackFlagsEXT = packed struct { valid_bit_ext: bool align(@alignOf(Flags)) = false, application_pipeline_cache_hit_bit_ext: bool = false, base_pipeline_acceleration_bit_ext: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(PipelineCreationFeedbackFlagsEXT, Flags); }; pub const FullScreenExclusiveEXT = enum(i32) { default_ext = 0, allowed_ext = 1, disallowed_ext = 2, application_controlled_ext = 3, _, }; pub const PerformanceCounterScopeKHR = enum(i32) { command_buffer_khr = 0, render_pass_khr = 1, command_khr = 2, //query_scope_command_buffer_khr = 0, // alias of command_buffer_khr //query_scope_render_pass_khr = 1, // alias of render_pass_khr //query_scope_command_khr = 2, // alias of command_khr _, }; pub const PerformanceCounterUnitKHR = enum(i32) { generic_khr = 0, percentage_khr = 1, nanoseconds_khr = 2, bytes_khr = 3, bytes_per_second_khr = 4, kelvin_khr = 5, watts_khr = 6, volts_khr = 7, amps_khr = 8, hertz_khr = 9, cycles_khr = 10, _, }; pub const PerformanceCounterStorageKHR = enum(i32) { int32_khr = 0, int64_khr = 1, uint32_khr = 2, uint64_khr = 3, float32_khr = 4, float64_khr = 5, _, }; pub const PerformanceCounterDescriptionFlagsKHR = packed struct { performance_impacting_bit_khr: bool align(@alignOf(Flags)) = false, concurrently_impacted_bit_khr: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(PerformanceCounterDescriptionFlagsKHR, Flags); }; pub const AcquireProfilingLockFlagsKHR = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(AcquireProfilingLockFlagsKHR, Flags); }; pub const ShaderCorePropertiesFlagsAMD = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(ShaderCorePropertiesFlagsAMD, Flags); }; pub const PerformanceConfigurationTypeINTEL = enum(i32) { command_queue_metrics_discovery_activated_intel = 0, _, }; pub const QueryPoolSamplingModeINTEL = enum(i32) { manual_intel = 0, _, }; pub const PerformanceOverrideTypeINTEL = enum(i32) { null_hardware_intel = 0, flush_gpu_caches_intel = 1, _, }; pub const PerformanceParameterTypeINTEL = enum(i32) { hw_counters_supported_intel = 0, stream_marker_valid_bits_intel = 1, _, }; pub const PerformanceValueTypeINTEL = enum(i32) { uint32_intel = 0, uint64_intel = 1, float_intel = 2, bool_intel = 3, string_intel = 4, _, }; pub const ShaderFloatControlsIndependence = enum(i32) { @"32_bit_only" = 0, all = 1, none = 2, //@"32_bit_only_khr" = 0, // alias of @"32_bit_only" //all_khr = 1, // alias of all //none_khr = 2, // alias of none _, }; pub const PipelineExecutableStatisticFormatKHR = enum(i32) { bool32_khr = 0, int64_khr = 1, uint64_khr = 2, float64_khr = 3, _, }; pub const LineRasterizationModeEXT = enum(i32) { default_ext = 0, rectangular_ext = 1, bresenham_ext = 2, rectangular_smooth_ext = 3, _, }; pub const ShaderModuleCreateFlags = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(ShaderModuleCreateFlags, Flags); }; pub const PipelineCompilerControlFlagsAMD = packed struct { _reserved_bits: Flags = 0, pub usingnamespace FlagsMixin(PipelineCompilerControlFlagsAMD, Flags); }; pub const ToolPurposeFlagsEXT = packed struct { validation_bit_ext: bool align(@alignOf(Flags)) = false, profiling_bit_ext: bool = false, tracing_bit_ext: bool = false, additional_features_bit_ext: bool = false, modifying_features_bit_ext: bool = false, debug_reporting_bit_ext: bool = false, debug_markers_bit_ext: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(ToolPurposeFlagsEXT, Flags); }; pub const FragmentShadingRateCombinerOpKHR = enum(i32) { keep_khr = 0, replace_khr = 1, min_khr = 2, max_khr = 3, mul_khr = 4, _, }; pub const FragmentShadingRateNV = enum(i32) { @"1_invocation_per_pixel_nv" = 0, @"1_invocation_per_1x2_pixels_nv" = 1, @"1_invocation_per_2x1_pixels_nv" = 4, @"1_invocation_per_2x2_pixels_nv" = 5, @"1_invocation_per_2x4_pixels_nv" = 6, @"1_invocation_per_4x2_pixels_nv" = 9, @"1_invocation_per_4x4_pixels_nv" = 10, @"2_invocations_per_pixel_nv" = 11, @"4_invocations_per_pixel_nv" = 12, @"8_invocations_per_pixel_nv" = 13, @"16_invocations_per_pixel_nv" = 14, no_invocations_nv = 15, _, }; pub const FragmentShadingRateTypeNV = enum(i32) { fragment_size_nv = 0, enums_nv = 1, _, }; pub const AccessFlags2KHR = packed struct { indirect_command_read_bit_khr: bool align(@alignOf(Flags)) = false, index_read_bit_khr: bool = false, vertex_attribute_read_bit_khr: bool = false, uniform_read_bit_khr: bool = false, input_attachment_read_bit_khr: bool = false, shader_read_bit_khr: bool = false, shader_write_bit_khr: bool = false, color_attachment_read_bit_khr: bool = false, color_attachment_write_bit_khr: bool = false, depth_stencil_attachment_read_bit_khr: bool = false, depth_stencil_attachment_write_bit_khr: bool = false, transfer_read_bit_khr: bool = false, transfer_write_bit_khr: bool = false, host_read_bit_khr: bool = false, host_write_bit_khr: bool = false, memory_read_bit_khr: bool = false, memory_write_bit_khr: bool = false, command_preprocess_read_bit_nv: bool = false, command_preprocess_write_bit_nv: bool = false, color_attachment_read_noncoherent_bit_ext: bool = false, conditional_rendering_read_bit_ext: bool = false, acceleration_structure_read_bit_khr: bool = false, acceleration_structure_write_bit_khr: bool = false, fragment_shading_rate_attachment_read_bit_khr: bool = false, fragment_density_map_read_bit_ext: bool = false, transform_feedback_write_bit_ext: bool = false, transform_feedback_counter_read_bit_ext: bool = false, transform_feedback_counter_write_bit_ext: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, shader_sampled_read_bit_khr: bool = false, shader_storage_read_bit_khr: bool = false, shader_storage_write_bit_khr: bool = false, video_decode_read_bit_khr: bool = false, video_decode_write_bit_khr: bool = false, video_encode_read_bit_khr: bool = false, video_encode_write_bit_khr: bool = false, _reserved_bit_39: bool = false, _reserved_bit_40: bool = false, _reserved_bit_41: bool = false, _reserved_bit_42: bool = false, _reserved_bit_43: bool = false, _reserved_bit_44: bool = false, _reserved_bit_45: bool = false, _reserved_bit_46: bool = false, _reserved_bit_47: bool = false, _reserved_bit_48: bool = false, _reserved_bit_49: bool = false, _reserved_bit_50: bool = false, _reserved_bit_51: bool = false, _reserved_bit_52: bool = false, _reserved_bit_53: bool = false, _reserved_bit_54: bool = false, _reserved_bit_55: bool = false, _reserved_bit_56: bool = false, _reserved_bit_57: bool = false, _reserved_bit_58: bool = false, _reserved_bit_59: bool = false, _reserved_bit_60: bool = false, _reserved_bit_61: bool = false, _reserved_bit_62: bool = false, _reserved_bit_63: bool = false, pub usingnamespace FlagsMixin(AccessFlags2KHR, Flags64); }; pub const PipelineStageFlags2KHR = packed struct { top_of_pipe_bit_khr: bool align(@alignOf(Flags)) = false, draw_indirect_bit_khr: bool = false, vertex_input_bit_khr: bool = false, vertex_shader_bit_khr: bool = false, tessellation_control_shader_bit_khr: bool = false, tessellation_evaluation_shader_bit_khr: bool = false, geometry_shader_bit_khr: bool = false, fragment_shader_bit_khr: bool = false, early_fragment_tests_bit_khr: bool = false, late_fragment_tests_bit_khr: bool = false, color_attachment_output_bit_khr: bool = false, compute_shader_bit_khr: bool = false, all_transfer_bit_khr: bool = false, bottom_of_pipe_bit_khr: bool = false, host_bit_khr: bool = false, all_graphics_bit_khr: bool = false, all_commands_bit_khr: bool = false, command_preprocess_bit_nv: bool = false, conditional_rendering_bit_ext: bool = false, task_shader_bit_nv: bool = false, mesh_shader_bit_nv: bool = false, ray_tracing_shader_bit_khr: bool = false, fragment_shading_rate_attachment_bit_khr: bool = false, fragment_density_process_bit_ext: bool = false, transform_feedback_bit_ext: bool = false, acceleration_structure_build_bit_khr: bool = false, video_decode_bit_khr: bool = false, video_encode_bit_khr: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, copy_bit_khr: bool = false, resolve_bit_khr: bool = false, blit_bit_khr: bool = false, clear_bit_khr: bool = false, index_input_bit_khr: bool = false, vertex_attribute_input_bit_khr: bool = false, pre_rasterization_shaders_bit_khr: bool = false, _reserved_bit_39: bool = false, _reserved_bit_40: bool = false, _reserved_bit_41: bool = false, _reserved_bit_42: bool = false, _reserved_bit_43: bool = false, _reserved_bit_44: bool = false, _reserved_bit_45: bool = false, _reserved_bit_46: bool = false, _reserved_bit_47: bool = false, _reserved_bit_48: bool = false, _reserved_bit_49: bool = false, _reserved_bit_50: bool = false, _reserved_bit_51: bool = false, _reserved_bit_52: bool = false, _reserved_bit_53: bool = false, _reserved_bit_54: bool = false, _reserved_bit_55: bool = false, _reserved_bit_56: bool = false, _reserved_bit_57: bool = false, _reserved_bit_58: bool = false, _reserved_bit_59: bool = false, _reserved_bit_60: bool = false, _reserved_bit_61: bool = false, _reserved_bit_62: bool = false, _reserved_bit_63: bool = false, pub usingnamespace FlagsMixin(PipelineStageFlags2KHR, Flags64); }; pub const SubmitFlagsKHR = packed struct { protected_bit_khr: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(SubmitFlagsKHR, Flags); }; pub const EventCreateFlags = packed struct { device_only_bit_khr: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(EventCreateFlags, Flags); }; pub const ProvokingVertexModeEXT = enum(i32) { first_vertex_ext = 0, last_vertex_ext = 1, _, }; pub const VideoCodecOperationFlagsKHR = packed struct { decode_h264_bit_ext: bool align(@alignOf(Flags)) = false, decode_h265_bit_ext: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, encode_h264_bit_ext: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(VideoCodecOperationFlagsKHR, Flags); }; pub const VideoChromaSubsamplingFlagsKHR = packed struct { monochrome_bit_khr: bool align(@alignOf(Flags)) = false, @"420_bit_khr": bool = false, @"422_bit_khr": bool = false, @"444_bit_khr": bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(VideoChromaSubsamplingFlagsKHR, Flags); }; pub const VideoComponentBitDepthFlagsKHR = packed struct { @"8_bit_khr": bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, @"10_bit_khr": bool = false, _reserved_bit_3: bool = false, @"12_bit_khr": bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(VideoComponentBitDepthFlagsKHR, Flags); }; pub const VideoCapabilitiesFlagsKHR = packed struct { protected_content_bit_khr: bool align(@alignOf(Flags)) = false, separate_reference_images_bit_khr: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(VideoCapabilitiesFlagsKHR, Flags); }; pub const VideoSessionCreateFlagsKHR = packed struct { protected_content_bit_khr: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(VideoSessionCreateFlagsKHR, Flags); }; pub const VideoCodingQualityPresetFlagsKHR = packed struct { normal_bit_khr: bool align(@alignOf(Flags)) = false, power_bit_khr: bool = false, quality_bit_khr: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(VideoCodingQualityPresetFlagsKHR, Flags); }; pub const VideoDecodeH264FieldLayoutFlagsEXT = packed struct { line_interlaced_plane_bit_ext: bool align(@alignOf(Flags)) = false, separate_interlaced_plane_bit_ext: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(VideoDecodeH264FieldLayoutFlagsEXT, Flags); }; pub const VideoCodingControlFlagsKHR = packed struct { reset_bit_khr: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(VideoCodingControlFlagsKHR, Flags); }; pub const QueryResultStatusKHR = enum(i32) { error_khr = -1, not_ready_khr = 0, complete_khr = 1, _, }; pub const VideoDecodeFlagsKHR = packed struct { reserved_0_bit_khr: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(VideoDecodeFlagsKHR, Flags); }; pub const VideoEncodeFlagsKHR = packed struct { reserved_0_bit_khr: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(VideoEncodeFlagsKHR, Flags); }; pub const VideoEncodeRateControlFlagsKHR = packed struct { reset_bit_khr: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(VideoEncodeRateControlFlagsKHR, Flags); }; pub const VideoEncodeRateControlModeFlagsKHR = packed struct { _reserved_bit_0: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(VideoEncodeRateControlModeFlagsKHR, Flags); }; pub const VideoEncodeH264CapabilitiesFlagsEXT = packed struct { capability_cabac_bit_ext: bool align(@alignOf(Flags)) = false, capability_cavlc_bit_ext: bool = false, capability_weighted_bi_pred_implicit_bit_ext: bool = false, capability_transform_8x8_bit_ext: bool = false, capability_chroma_qp_offset_bit_ext: bool = false, capability_second_chroma_qp_offset_bit_ext: bool = false, capability_deblocking_filter_disabled_bit_ext: bool = false, capability_deblocking_filter_enabled_bit_ext: bool = false, capability_deblocking_filter_partial_bit_ext: bool = false, capability_multiple_slice_per_frame_bit_ext: bool = false, capability_evenly_distributed_slice_size_bit_ext: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(VideoEncodeH264CapabilitiesFlagsEXT, Flags); }; pub const VideoEncodeH264InputModeFlagsEXT = packed struct { frame_bit_ext: bool align(@alignOf(Flags)) = false, slice_bit_ext: bool = false, non_vcl_bit_ext: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(VideoEncodeH264InputModeFlagsEXT, Flags); }; pub const VideoEncodeH264OutputModeFlagsEXT = packed struct { frame_bit_ext: bool align(@alignOf(Flags)) = false, slice_bit_ext: bool = false, non_vcl_bit_ext: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(VideoEncodeH264OutputModeFlagsEXT, Flags); }; pub const VideoEncodeH264CreateFlagsEXT = packed struct { reserved_0_bit_ext: bool align(@alignOf(Flags)) = false, _reserved_bit_1: bool = false, _reserved_bit_2: bool = false, _reserved_bit_3: bool = false, _reserved_bit_4: bool = false, _reserved_bit_5: bool = false, _reserved_bit_6: bool = false, _reserved_bit_7: bool = false, _reserved_bit_8: bool = false, _reserved_bit_9: bool = false, _reserved_bit_10: bool = false, _reserved_bit_11: bool = false, _reserved_bit_12: bool = false, _reserved_bit_13: bool = false, _reserved_bit_14: bool = false, _reserved_bit_15: bool = false, _reserved_bit_16: bool = false, _reserved_bit_17: bool = false, _reserved_bit_18: bool = false, _reserved_bit_19: bool = false, _reserved_bit_20: bool = false, _reserved_bit_21: bool = false, _reserved_bit_22: bool = false, _reserved_bit_23: bool = false, _reserved_bit_24: bool = false, _reserved_bit_25: bool = false, _reserved_bit_26: bool = false, _reserved_bit_27: bool = false, _reserved_bit_28: bool = false, _reserved_bit_29: bool = false, _reserved_bit_30: bool = false, _reserved_bit_31: bool = false, pub usingnamespace FlagsMixin(VideoEncodeH264CreateFlagsEXT, Flags); }; pub const PfnCreateInstance = fn ( p_create_info: *const InstanceCreateInfo, p_allocator: ?*const AllocationCallbacks, p_instance: *Instance, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyInstance = fn ( instance: Instance, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnEnumeratePhysicalDevices = fn ( instance: Instance, p_physical_device_count: *u32, p_physical_devices: ?[*]PhysicalDevice, ) callconv(vulkan_call_conv) Result; pub const PfnGetDeviceProcAddr = fn ( device: Device, p_name: [*:0]const u8, ) callconv(vulkan_call_conv) PfnVoidFunction; pub const PfnGetInstanceProcAddr = fn ( instance: Instance, p_name: [*:0]const u8, ) callconv(vulkan_call_conv) PfnVoidFunction; pub const PfnGetPhysicalDeviceProperties = fn ( physical_device: PhysicalDevice, p_properties: *PhysicalDeviceProperties, ) callconv(vulkan_call_conv) void; pub const PfnGetPhysicalDeviceQueueFamilyProperties = fn ( physical_device: PhysicalDevice, p_queue_family_property_count: *u32, p_queue_family_properties: ?[*]QueueFamilyProperties, ) callconv(vulkan_call_conv) void; pub const PfnGetPhysicalDeviceMemoryProperties = fn ( physical_device: PhysicalDevice, p_memory_properties: *PhysicalDeviceMemoryProperties, ) callconv(vulkan_call_conv) void; pub const PfnGetPhysicalDeviceFeatures = fn ( physical_device: PhysicalDevice, p_features: *PhysicalDeviceFeatures, ) callconv(vulkan_call_conv) void; pub const PfnGetPhysicalDeviceFormatProperties = fn ( physical_device: PhysicalDevice, format: Format, p_format_properties: *FormatProperties, ) callconv(vulkan_call_conv) void; pub const PfnGetPhysicalDeviceImageFormatProperties = fn ( physical_device: PhysicalDevice, format: Format, type: ImageType, tiling: ImageTiling, usage: ImageUsageFlags.IntType, flags: ImageCreateFlags.IntType, p_image_format_properties: *ImageFormatProperties, ) callconv(vulkan_call_conv) Result; pub const PfnCreateDevice = fn ( physical_device: PhysicalDevice, p_create_info: *const DeviceCreateInfo, p_allocator: ?*const AllocationCallbacks, p_device: *Device, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyDevice = fn ( device: Device, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnEnumerateInstanceVersion = fn ( p_api_version: *u32, ) callconv(vulkan_call_conv) Result; pub const PfnEnumerateInstanceLayerProperties = fn ( p_property_count: *u32, p_properties: ?[*]LayerProperties, ) callconv(vulkan_call_conv) Result; pub const PfnEnumerateInstanceExtensionProperties = fn ( p_layer_name: ?[*:0]const u8, p_property_count: *u32, p_properties: ?[*]ExtensionProperties, ) callconv(vulkan_call_conv) Result; pub const PfnEnumerateDeviceLayerProperties = fn ( physical_device: PhysicalDevice, p_property_count: *u32, p_properties: ?[*]LayerProperties, ) callconv(vulkan_call_conv) Result; pub const PfnEnumerateDeviceExtensionProperties = fn ( physical_device: PhysicalDevice, p_layer_name: ?[*:0]const u8, p_property_count: *u32, p_properties: ?[*]ExtensionProperties, ) callconv(vulkan_call_conv) Result; pub const PfnGetDeviceQueue = fn ( device: Device, queue_family_index: u32, queue_index: u32, p_queue: *Queue, ) callconv(vulkan_call_conv) void; pub const PfnQueueSubmit = fn ( queue: Queue, submit_count: u32, p_submits: [*]const SubmitInfo, fence: Fence, ) callconv(vulkan_call_conv) Result; pub const PfnQueueWaitIdle = fn ( queue: Queue, ) callconv(vulkan_call_conv) Result; pub const PfnDeviceWaitIdle = fn ( device: Device, ) callconv(vulkan_call_conv) Result; pub const PfnAllocateMemory = fn ( device: Device, p_allocate_info: *const MemoryAllocateInfo, p_allocator: ?*const AllocationCallbacks, p_memory: *DeviceMemory, ) callconv(vulkan_call_conv) Result; pub const PfnFreeMemory = fn ( device: Device, memory: DeviceMemory, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnMapMemory = fn ( device: Device, memory: DeviceMemory, offset: DeviceSize, size: DeviceSize, flags: MemoryMapFlags.IntType, pp_data: *?*anyopaque, ) callconv(vulkan_call_conv) Result; pub const PfnUnmapMemory = fn ( device: Device, memory: DeviceMemory, ) callconv(vulkan_call_conv) void; pub const PfnFlushMappedMemoryRanges = fn ( device: Device, memory_range_count: u32, p_memory_ranges: [*]const MappedMemoryRange, ) callconv(vulkan_call_conv) Result; pub const PfnInvalidateMappedMemoryRanges = fn ( device: Device, memory_range_count: u32, p_memory_ranges: [*]const MappedMemoryRange, ) callconv(vulkan_call_conv) Result; pub const PfnGetDeviceMemoryCommitment = fn ( device: Device, memory: DeviceMemory, p_committed_memory_in_bytes: *DeviceSize, ) callconv(vulkan_call_conv) void; pub const PfnGetBufferMemoryRequirements = fn ( device: Device, buffer: Buffer, p_memory_requirements: *MemoryRequirements, ) callconv(vulkan_call_conv) void; pub const PfnBindBufferMemory = fn ( device: Device, buffer: Buffer, memory: DeviceMemory, memory_offset: DeviceSize, ) callconv(vulkan_call_conv) Result; pub const PfnGetImageMemoryRequirements = fn ( device: Device, image: Image, p_memory_requirements: *MemoryRequirements, ) callconv(vulkan_call_conv) void; pub const PfnBindImageMemory = fn ( device: Device, image: Image, memory: DeviceMemory, memory_offset: DeviceSize, ) callconv(vulkan_call_conv) Result; pub const PfnGetImageSparseMemoryRequirements = fn ( device: Device, image: Image, p_sparse_memory_requirement_count: *u32, p_sparse_memory_requirements: ?[*]SparseImageMemoryRequirements, ) callconv(vulkan_call_conv) void; pub const PfnGetPhysicalDeviceSparseImageFormatProperties = fn ( physical_device: PhysicalDevice, format: Format, type: ImageType, samples: SampleCountFlags.IntType, usage: ImageUsageFlags.IntType, tiling: ImageTiling, p_property_count: *u32, p_properties: ?[*]SparseImageFormatProperties, ) callconv(vulkan_call_conv) void; pub const PfnQueueBindSparse = fn ( queue: Queue, bind_info_count: u32, p_bind_info: [*]const BindSparseInfo, fence: Fence, ) callconv(vulkan_call_conv) Result; pub const PfnCreateFence = fn ( device: Device, p_create_info: *const FenceCreateInfo, p_allocator: ?*const AllocationCallbacks, p_fence: *Fence, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyFence = fn ( device: Device, fence: Fence, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnResetFences = fn ( device: Device, fence_count: u32, p_fences: [*]const Fence, ) callconv(vulkan_call_conv) Result; pub const PfnGetFenceStatus = fn ( device: Device, fence: Fence, ) callconv(vulkan_call_conv) Result; pub const PfnWaitForFences = fn ( device: Device, fence_count: u32, p_fences: [*]const Fence, wait_all: Bool32, timeout: u64, ) callconv(vulkan_call_conv) Result; pub const PfnCreateSemaphore = fn ( device: Device, p_create_info: *const SemaphoreCreateInfo, p_allocator: ?*const AllocationCallbacks, p_semaphore: *Semaphore, ) callconv(vulkan_call_conv) Result; pub const PfnDestroySemaphore = fn ( device: Device, semaphore: Semaphore, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnCreateEvent = fn ( device: Device, p_create_info: *const EventCreateInfo, p_allocator: ?*const AllocationCallbacks, p_event: *Event, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyEvent = fn ( device: Device, event: Event, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnGetEventStatus = fn ( device: Device, event: Event, ) callconv(vulkan_call_conv) Result; pub const PfnSetEvent = fn ( device: Device, event: Event, ) callconv(vulkan_call_conv) Result; pub const PfnResetEvent = fn ( device: Device, event: Event, ) callconv(vulkan_call_conv) Result; pub const PfnCreateQueryPool = fn ( device: Device, p_create_info: *const QueryPoolCreateInfo, p_allocator: ?*const AllocationCallbacks, p_query_pool: *QueryPool, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyQueryPool = fn ( device: Device, query_pool: QueryPool, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnGetQueryPoolResults = fn ( device: Device, query_pool: QueryPool, first_query: u32, query_count: u32, data_size: usize, p_data: *anyopaque, stride: DeviceSize, flags: QueryResultFlags.IntType, ) callconv(vulkan_call_conv) Result; pub const PfnResetQueryPool = fn ( device: Device, query_pool: QueryPool, first_query: u32, query_count: u32, ) callconv(vulkan_call_conv) void; pub const PfnCreateBuffer = fn ( device: Device, p_create_info: *const BufferCreateInfo, p_allocator: ?*const AllocationCallbacks, p_buffer: *Buffer, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyBuffer = fn ( device: Device, buffer: Buffer, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnCreateBufferView = fn ( device: Device, p_create_info: *const BufferViewCreateInfo, p_allocator: ?*const AllocationCallbacks, p_view: *BufferView, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyBufferView = fn ( device: Device, buffer_view: BufferView, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnCreateImage = fn ( device: Device, p_create_info: *const ImageCreateInfo, p_allocator: ?*const AllocationCallbacks, p_image: *Image, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyImage = fn ( device: Device, image: Image, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnGetImageSubresourceLayout = fn ( device: Device, image: Image, p_subresource: *const ImageSubresource, p_layout: *SubresourceLayout, ) callconv(vulkan_call_conv) void; pub const PfnCreateImageView = fn ( device: Device, p_create_info: *const ImageViewCreateInfo, p_allocator: ?*const AllocationCallbacks, p_view: *ImageView, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyImageView = fn ( device: Device, image_view: ImageView, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnCreateShaderModule = fn ( device: Device, p_create_info: *const ShaderModuleCreateInfo, p_allocator: ?*const AllocationCallbacks, p_shader_module: *ShaderModule, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyShaderModule = fn ( device: Device, shader_module: ShaderModule, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnCreatePipelineCache = fn ( device: Device, p_create_info: *const PipelineCacheCreateInfo, p_allocator: ?*const AllocationCallbacks, p_pipeline_cache: *PipelineCache, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyPipelineCache = fn ( device: Device, pipeline_cache: PipelineCache, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnGetPipelineCacheData = fn ( device: Device, pipeline_cache: PipelineCache, p_data_size: *usize, p_data: ?*anyopaque, ) callconv(vulkan_call_conv) Result; pub const PfnMergePipelineCaches = fn ( device: Device, dst_cache: PipelineCache, src_cache_count: u32, p_src_caches: [*]const PipelineCache, ) callconv(vulkan_call_conv) Result; pub const PfnCreateGraphicsPipelines = fn ( device: Device, pipeline_cache: PipelineCache, create_info_count: u32, p_create_infos: [*]const GraphicsPipelineCreateInfo, p_allocator: ?*const AllocationCallbacks, p_pipelines: [*]Pipeline, ) callconv(vulkan_call_conv) Result; pub const PfnCreateComputePipelines = fn ( device: Device, pipeline_cache: PipelineCache, create_info_count: u32, p_create_infos: [*]const ComputePipelineCreateInfo, p_allocator: ?*const AllocationCallbacks, p_pipelines: [*]Pipeline, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyPipeline = fn ( device: Device, pipeline: Pipeline, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnCreatePipelineLayout = fn ( device: Device, p_create_info: *const PipelineLayoutCreateInfo, p_allocator: ?*const AllocationCallbacks, p_pipeline_layout: *PipelineLayout, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyPipelineLayout = fn ( device: Device, pipeline_layout: PipelineLayout, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnCreateSampler = fn ( device: Device, p_create_info: *const SamplerCreateInfo, p_allocator: ?*const AllocationCallbacks, p_sampler: *Sampler, ) callconv(vulkan_call_conv) Result; pub const PfnDestroySampler = fn ( device: Device, sampler: Sampler, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnCreateDescriptorSetLayout = fn ( device: Device, p_create_info: *const DescriptorSetLayoutCreateInfo, p_allocator: ?*const AllocationCallbacks, p_set_layout: *DescriptorSetLayout, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyDescriptorSetLayout = fn ( device: Device, descriptor_set_layout: DescriptorSetLayout, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnCreateDescriptorPool = fn ( device: Device, p_create_info: *const DescriptorPoolCreateInfo, p_allocator: ?*const AllocationCallbacks, p_descriptor_pool: *DescriptorPool, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyDescriptorPool = fn ( device: Device, descriptor_pool: DescriptorPool, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnResetDescriptorPool = fn ( device: Device, descriptor_pool: DescriptorPool, flags: DescriptorPoolResetFlags.IntType, ) callconv(vulkan_call_conv) Result; pub const PfnAllocateDescriptorSets = fn ( device: Device, p_allocate_info: *const DescriptorSetAllocateInfo, p_descriptor_sets: [*]DescriptorSet, ) callconv(vulkan_call_conv) Result; pub const PfnFreeDescriptorSets = fn ( device: Device, descriptor_pool: DescriptorPool, descriptor_set_count: u32, p_descriptor_sets: [*]const DescriptorSet, ) callconv(vulkan_call_conv) Result; pub const PfnUpdateDescriptorSets = fn ( device: Device, descriptor_write_count: u32, p_descriptor_writes: [*]const WriteDescriptorSet, descriptor_copy_count: u32, p_descriptor_copies: [*]const CopyDescriptorSet, ) callconv(vulkan_call_conv) void; pub const PfnCreateFramebuffer = fn ( device: Device, p_create_info: *const FramebufferCreateInfo, p_allocator: ?*const AllocationCallbacks, p_framebuffer: *Framebuffer, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyFramebuffer = fn ( device: Device, framebuffer: Framebuffer, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnCreateRenderPass = fn ( device: Device, p_create_info: *const RenderPassCreateInfo, p_allocator: ?*const AllocationCallbacks, p_render_pass: *RenderPass, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyRenderPass = fn ( device: Device, render_pass: RenderPass, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnGetRenderAreaGranularity = fn ( device: Device, render_pass: RenderPass, p_granularity: *Extent2D, ) callconv(vulkan_call_conv) void; pub const PfnCreateCommandPool = fn ( device: Device, p_create_info: *const CommandPoolCreateInfo, p_allocator: ?*const AllocationCallbacks, p_command_pool: *CommandPool, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyCommandPool = fn ( device: Device, command_pool: CommandPool, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnResetCommandPool = fn ( device: Device, command_pool: CommandPool, flags: CommandPoolResetFlags.IntType, ) callconv(vulkan_call_conv) Result; pub const PfnAllocateCommandBuffers = fn ( device: Device, p_allocate_info: *const CommandBufferAllocateInfo, p_command_buffers: [*]CommandBuffer, ) callconv(vulkan_call_conv) Result; pub const PfnFreeCommandBuffers = fn ( device: Device, command_pool: CommandPool, command_buffer_count: u32, p_command_buffers: [*]const CommandBuffer, ) callconv(vulkan_call_conv) void; pub const PfnBeginCommandBuffer = fn ( command_buffer: CommandBuffer, p_begin_info: *const CommandBufferBeginInfo, ) callconv(vulkan_call_conv) Result; pub const PfnEndCommandBuffer = fn ( command_buffer: CommandBuffer, ) callconv(vulkan_call_conv) Result; pub const PfnResetCommandBuffer = fn ( command_buffer: CommandBuffer, flags: CommandBufferResetFlags.IntType, ) callconv(vulkan_call_conv) Result; pub const PfnCmdBindPipeline = fn ( command_buffer: CommandBuffer, pipeline_bind_point: PipelineBindPoint, pipeline: Pipeline, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetViewport = fn ( command_buffer: CommandBuffer, first_viewport: u32, viewport_count: u32, p_viewports: [*]const Viewport, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetScissor = fn ( command_buffer: CommandBuffer, first_scissor: u32, scissor_count: u32, p_scissors: [*]const Rect2D, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetLineWidth = fn ( command_buffer: CommandBuffer, line_width: f32, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetDepthBias = fn ( command_buffer: CommandBuffer, depth_bias_constant_factor: f32, depth_bias_clamp: f32, depth_bias_slope_factor: f32, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetBlendConstants = fn ( command_buffer: CommandBuffer, blend_constants: [4]f32, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetDepthBounds = fn ( command_buffer: CommandBuffer, min_depth_bounds: f32, max_depth_bounds: f32, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetStencilCompareMask = fn ( command_buffer: CommandBuffer, face_mask: StencilFaceFlags.IntType, compare_mask: u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetStencilWriteMask = fn ( command_buffer: CommandBuffer, face_mask: StencilFaceFlags.IntType, write_mask: u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetStencilReference = fn ( command_buffer: CommandBuffer, face_mask: StencilFaceFlags.IntType, reference: u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdBindDescriptorSets = fn ( command_buffer: CommandBuffer, pipeline_bind_point: PipelineBindPoint, layout: PipelineLayout, first_set: u32, descriptor_set_count: u32, p_descriptor_sets: [*]const DescriptorSet, dynamic_offset_count: u32, p_dynamic_offsets: [*]const u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdBindIndexBuffer = fn ( command_buffer: CommandBuffer, buffer: Buffer, offset: DeviceSize, index_type: IndexType, ) callconv(vulkan_call_conv) void; pub const PfnCmdBindVertexBuffers = fn ( command_buffer: CommandBuffer, first_binding: u32, binding_count: u32, p_buffers: [*]const Buffer, p_offsets: [*]const DeviceSize, ) callconv(vulkan_call_conv) void; pub const PfnCmdDraw = fn ( command_buffer: CommandBuffer, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdDrawIndexed = fn ( command_buffer: CommandBuffer, index_count: u32, instance_count: u32, first_index: u32, vertex_offset: i32, first_instance: u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdDrawIndirect = fn ( command_buffer: CommandBuffer, buffer: Buffer, offset: DeviceSize, draw_count: u32, stride: u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdDrawIndexedIndirect = fn ( command_buffer: CommandBuffer, buffer: Buffer, offset: DeviceSize, draw_count: u32, stride: u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdDispatch = fn ( command_buffer: CommandBuffer, group_count_x: u32, group_count_y: u32, group_count_z: u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdDispatchIndirect = fn ( command_buffer: CommandBuffer, buffer: Buffer, offset: DeviceSize, ) callconv(vulkan_call_conv) void; pub const PfnCmdCopyBuffer = fn ( command_buffer: CommandBuffer, src_buffer: Buffer, dst_buffer: Buffer, region_count: u32, p_regions: [*]const BufferCopy, ) callconv(vulkan_call_conv) void; pub const PfnCmdCopyImage = fn ( command_buffer: CommandBuffer, src_image: Image, src_image_layout: ImageLayout, dst_image: Image, dst_image_layout: ImageLayout, region_count: u32, p_regions: [*]const ImageCopy, ) callconv(vulkan_call_conv) void; pub const PfnCmdBlitImage = fn ( command_buffer: CommandBuffer, src_image: Image, src_image_layout: ImageLayout, dst_image: Image, dst_image_layout: ImageLayout, region_count: u32, p_regions: [*]const ImageBlit, filter: Filter, ) callconv(vulkan_call_conv) void; pub const PfnCmdCopyBufferToImage = fn ( command_buffer: CommandBuffer, src_buffer: Buffer, dst_image: Image, dst_image_layout: ImageLayout, region_count: u32, p_regions: [*]const BufferImageCopy, ) callconv(vulkan_call_conv) void; pub const PfnCmdCopyImageToBuffer = fn ( command_buffer: CommandBuffer, src_image: Image, src_image_layout: ImageLayout, dst_buffer: Buffer, region_count: u32, p_regions: [*]const BufferImageCopy, ) callconv(vulkan_call_conv) void; pub const PfnCmdUpdateBuffer = fn ( command_buffer: CommandBuffer, dst_buffer: Buffer, dst_offset: DeviceSize, data_size: DeviceSize, p_data: *const anyopaque, ) callconv(vulkan_call_conv) void; pub const PfnCmdFillBuffer = fn ( command_buffer: CommandBuffer, dst_buffer: Buffer, dst_offset: DeviceSize, size: DeviceSize, data: u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdClearColorImage = fn ( command_buffer: CommandBuffer, image: Image, image_layout: ImageLayout, p_color: *const ClearColorValue, range_count: u32, p_ranges: [*]const ImageSubresourceRange, ) callconv(vulkan_call_conv) void; pub const PfnCmdClearDepthStencilImage = fn ( command_buffer: CommandBuffer, image: Image, image_layout: ImageLayout, p_depth_stencil: *const ClearDepthStencilValue, range_count: u32, p_ranges: [*]const ImageSubresourceRange, ) callconv(vulkan_call_conv) void; pub const PfnCmdClearAttachments = fn ( command_buffer: CommandBuffer, attachment_count: u32, p_attachments: [*]const ClearAttachment, rect_count: u32, p_rects: [*]const ClearRect, ) callconv(vulkan_call_conv) void; pub const PfnCmdResolveImage = fn ( command_buffer: CommandBuffer, src_image: Image, src_image_layout: ImageLayout, dst_image: Image, dst_image_layout: ImageLayout, region_count: u32, p_regions: [*]const ImageResolve, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetEvent = fn ( command_buffer: CommandBuffer, event: Event, stage_mask: PipelineStageFlags.IntType, ) callconv(vulkan_call_conv) void; pub const PfnCmdResetEvent = fn ( command_buffer: CommandBuffer, event: Event, stage_mask: PipelineStageFlags.IntType, ) callconv(vulkan_call_conv) void; pub const PfnCmdWaitEvents = fn ( command_buffer: CommandBuffer, event_count: u32, p_events: [*]const Event, src_stage_mask: PipelineStageFlags.IntType, dst_stage_mask: PipelineStageFlags.IntType, memory_barrier_count: u32, p_memory_barriers: [*]const MemoryBarrier, buffer_memory_barrier_count: u32, p_buffer_memory_barriers: [*]const BufferMemoryBarrier, image_memory_barrier_count: u32, p_image_memory_barriers: [*]const ImageMemoryBarrier, ) callconv(vulkan_call_conv) void; pub const PfnCmdPipelineBarrier = fn ( command_buffer: CommandBuffer, src_stage_mask: PipelineStageFlags.IntType, dst_stage_mask: PipelineStageFlags.IntType, dependency_flags: DependencyFlags.IntType, memory_barrier_count: u32, p_memory_barriers: [*]const MemoryBarrier, buffer_memory_barrier_count: u32, p_buffer_memory_barriers: [*]const BufferMemoryBarrier, image_memory_barrier_count: u32, p_image_memory_barriers: [*]const ImageMemoryBarrier, ) callconv(vulkan_call_conv) void; pub const PfnCmdBeginQuery = fn ( command_buffer: CommandBuffer, query_pool: QueryPool, query: u32, flags: QueryControlFlags.IntType, ) callconv(vulkan_call_conv) void; pub const PfnCmdEndQuery = fn ( command_buffer: CommandBuffer, query_pool: QueryPool, query: u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdBeginConditionalRenderingEXT = fn ( command_buffer: CommandBuffer, p_conditional_rendering_begin: *const ConditionalRenderingBeginInfoEXT, ) callconv(vulkan_call_conv) void; pub const PfnCmdEndConditionalRenderingEXT = fn ( command_buffer: CommandBuffer, ) callconv(vulkan_call_conv) void; pub const PfnCmdResetQueryPool = fn ( command_buffer: CommandBuffer, query_pool: QueryPool, first_query: u32, query_count: u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdWriteTimestamp = fn ( command_buffer: CommandBuffer, pipeline_stage: PipelineStageFlags.IntType, query_pool: QueryPool, query: u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdCopyQueryPoolResults = fn ( command_buffer: CommandBuffer, query_pool: QueryPool, first_query: u32, query_count: u32, dst_buffer: Buffer, dst_offset: DeviceSize, stride: DeviceSize, flags: QueryResultFlags.IntType, ) callconv(vulkan_call_conv) void; pub const PfnCmdPushConstants = fn ( command_buffer: CommandBuffer, layout: PipelineLayout, stage_flags: ShaderStageFlags.IntType, offset: u32, size: u32, p_values: *const anyopaque, ) callconv(vulkan_call_conv) void; pub const PfnCmdBeginRenderPass = fn ( command_buffer: CommandBuffer, p_render_pass_begin: *const RenderPassBeginInfo, contents: SubpassContents, ) callconv(vulkan_call_conv) void; pub const PfnCmdNextSubpass = fn ( command_buffer: CommandBuffer, contents: SubpassContents, ) callconv(vulkan_call_conv) void; pub const PfnCmdEndRenderPass = fn ( command_buffer: CommandBuffer, ) callconv(vulkan_call_conv) void; pub const PfnCmdExecuteCommands = fn ( command_buffer: CommandBuffer, command_buffer_count: u32, p_command_buffers: [*]const CommandBuffer, ) callconv(vulkan_call_conv) void; pub const PfnCreateAndroidSurfaceKHR = fn ( instance: Instance, p_create_info: *const AndroidSurfaceCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, p_surface: *SurfaceKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetPhysicalDeviceDisplayPropertiesKHR = fn ( physical_device: PhysicalDevice, p_property_count: *u32, p_properties: ?[*]DisplayPropertiesKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetPhysicalDeviceDisplayPlanePropertiesKHR = fn ( physical_device: PhysicalDevice, p_property_count: *u32, p_properties: ?[*]DisplayPlanePropertiesKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetDisplayPlaneSupportedDisplaysKHR = fn ( physical_device: PhysicalDevice, plane_index: u32, p_display_count: *u32, p_displays: ?[*]DisplayKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetDisplayModePropertiesKHR = fn ( physical_device: PhysicalDevice, display: DisplayKHR, p_property_count: *u32, p_properties: ?[*]DisplayModePropertiesKHR, ) callconv(vulkan_call_conv) Result; pub const PfnCreateDisplayModeKHR = fn ( physical_device: PhysicalDevice, display: DisplayKHR, p_create_info: *const DisplayModeCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, p_mode: *DisplayModeKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetDisplayPlaneCapabilitiesKHR = fn ( physical_device: PhysicalDevice, mode: DisplayModeKHR, plane_index: u32, p_capabilities: *DisplayPlaneCapabilitiesKHR, ) callconv(vulkan_call_conv) Result; pub const PfnCreateDisplayPlaneSurfaceKHR = fn ( instance: Instance, p_create_info: *const DisplaySurfaceCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, p_surface: *SurfaceKHR, ) callconv(vulkan_call_conv) Result; pub const PfnCreateSharedSwapchainsKHR = fn ( device: Device, swapchain_count: u32, p_create_infos: [*]const SwapchainCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, p_swapchains: [*]SwapchainKHR, ) callconv(vulkan_call_conv) Result; pub const PfnDestroySurfaceKHR = fn ( instance: Instance, surface: SurfaceKHR, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnGetPhysicalDeviceSurfaceSupportKHR = fn ( physical_device: PhysicalDevice, queue_family_index: u32, surface: SurfaceKHR, p_supported: *Bool32, ) callconv(vulkan_call_conv) Result; pub const PfnGetPhysicalDeviceSurfaceCapabilitiesKHR = fn ( physical_device: PhysicalDevice, surface: SurfaceKHR, p_surface_capabilities: *SurfaceCapabilitiesKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetPhysicalDeviceSurfaceFormatsKHR = fn ( physical_device: PhysicalDevice, surface: SurfaceKHR, p_surface_format_count: *u32, p_surface_formats: ?[*]SurfaceFormatKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetPhysicalDeviceSurfacePresentModesKHR = fn ( physical_device: PhysicalDevice, surface: SurfaceKHR, p_present_mode_count: *u32, p_present_modes: ?[*]PresentModeKHR, ) callconv(vulkan_call_conv) Result; pub const PfnCreateSwapchainKHR = fn ( device: Device, p_create_info: *const SwapchainCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, p_swapchain: *SwapchainKHR, ) callconv(vulkan_call_conv) Result; pub const PfnDestroySwapchainKHR = fn ( device: Device, swapchain: SwapchainKHR, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnGetSwapchainImagesKHR = fn ( device: Device, swapchain: SwapchainKHR, p_swapchain_image_count: *u32, p_swapchain_images: ?[*]Image, ) callconv(vulkan_call_conv) Result; pub const PfnAcquireNextImageKHR = fn ( device: Device, swapchain: SwapchainKHR, timeout: u64, semaphore: Semaphore, fence: Fence, p_image_index: *u32, ) callconv(vulkan_call_conv) Result; pub const PfnQueuePresentKHR = fn ( queue: Queue, p_present_info: *const PresentInfoKHR, ) callconv(vulkan_call_conv) Result; pub const PfnCreateViSurfaceNN = fn ( instance: Instance, p_create_info: *const ViSurfaceCreateInfoNN, p_allocator: ?*const AllocationCallbacks, p_surface: *SurfaceKHR, ) callconv(vulkan_call_conv) Result; pub const PfnCreateWaylandSurfaceKHR = fn ( instance: Instance, p_create_info: *const WaylandSurfaceCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, p_surface: *SurfaceKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetPhysicalDeviceWaylandPresentationSupportKHR = fn ( physical_device: PhysicalDevice, queue_family_index: u32, display: *wl_display, ) callconv(vulkan_call_conv) Bool32; pub const PfnCreateWin32SurfaceKHR = fn ( instance: Instance, p_create_info: *const Win32SurfaceCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, p_surface: *SurfaceKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetPhysicalDeviceWin32PresentationSupportKHR = fn ( physical_device: PhysicalDevice, queue_family_index: u32, ) callconv(vulkan_call_conv) Bool32; pub const PfnCreateXlibSurfaceKHR = fn ( instance: Instance, p_create_info: *const XlibSurfaceCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, p_surface: *SurfaceKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetPhysicalDeviceXlibPresentationSupportKHR = fn ( physical_device: PhysicalDevice, queue_family_index: u32, dpy: *Display, visual_id: VisualID, ) callconv(vulkan_call_conv) Bool32; pub const PfnCreateXcbSurfaceKHR = fn ( instance: Instance, p_create_info: *const XcbSurfaceCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, p_surface: *SurfaceKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetPhysicalDeviceXcbPresentationSupportKHR = fn ( physical_device: PhysicalDevice, queue_family_index: u32, connection: *xcb_connection_t, visual_id: xcb_visualid_t, ) callconv(vulkan_call_conv) Bool32; pub const PfnCreateDirectFBSurfaceEXT = fn ( instance: Instance, p_create_info: *const DirectFBSurfaceCreateInfoEXT, p_allocator: ?*const AllocationCallbacks, p_surface: *SurfaceKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetPhysicalDeviceDirectFBPresentationSupportEXT = fn ( physical_device: PhysicalDevice, queue_family_index: u32, dfb: *IDirectFB, ) callconv(vulkan_call_conv) Bool32; pub const PfnCreateImagePipeSurfaceFUCHSIA = fn ( instance: Instance, p_create_info: *const ImagePipeSurfaceCreateInfoFUCHSIA, p_allocator: ?*const AllocationCallbacks, p_surface: *SurfaceKHR, ) callconv(vulkan_call_conv) Result; pub const PfnCreateStreamDescriptorSurfaceGGP = fn ( instance: Instance, p_create_info: *const StreamDescriptorSurfaceCreateInfoGGP, p_allocator: ?*const AllocationCallbacks, p_surface: *SurfaceKHR, ) callconv(vulkan_call_conv) Result; pub const PfnCreateScreenSurfaceQNX = fn ( instance: Instance, p_create_info: *const ScreenSurfaceCreateInfoQNX, p_allocator: ?*const AllocationCallbacks, p_surface: *SurfaceKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetPhysicalDeviceScreenPresentationSupportQNX = fn ( physical_device: PhysicalDevice, queue_family_index: u32, window: *_screen_window, ) callconv(vulkan_call_conv) Bool32; pub const PfnCreateDebugReportCallbackEXT = fn ( instance: Instance, p_create_info: *const DebugReportCallbackCreateInfoEXT, p_allocator: ?*const AllocationCallbacks, p_callback: *DebugReportCallbackEXT, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyDebugReportCallbackEXT = fn ( instance: Instance, callback: DebugReportCallbackEXT, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnDebugReportMessageEXT = fn ( instance: Instance, flags: DebugReportFlagsEXT.IntType, object_type: DebugReportObjectTypeEXT, object: u64, location: usize, message_code: i32, p_layer_prefix: [*:0]const u8, p_message: [*:0]const u8, ) callconv(vulkan_call_conv) void; pub const PfnDebugMarkerSetObjectNameEXT = fn ( device: Device, p_name_info: *const DebugMarkerObjectNameInfoEXT, ) callconv(vulkan_call_conv) Result; pub const PfnDebugMarkerSetObjectTagEXT = fn ( device: Device, p_tag_info: *const DebugMarkerObjectTagInfoEXT, ) callconv(vulkan_call_conv) Result; pub const PfnCmdDebugMarkerBeginEXT = fn ( command_buffer: CommandBuffer, p_marker_info: *const DebugMarkerMarkerInfoEXT, ) callconv(vulkan_call_conv) void; pub const PfnCmdDebugMarkerEndEXT = fn ( command_buffer: CommandBuffer, ) callconv(vulkan_call_conv) void; pub const PfnCmdDebugMarkerInsertEXT = fn ( command_buffer: CommandBuffer, p_marker_info: *const DebugMarkerMarkerInfoEXT, ) callconv(vulkan_call_conv) void; pub const PfnGetPhysicalDeviceExternalImageFormatPropertiesNV = fn ( physical_device: PhysicalDevice, format: Format, type: ImageType, tiling: ImageTiling, usage: ImageUsageFlags.IntType, flags: ImageCreateFlags.IntType, external_handle_type: ExternalMemoryHandleTypeFlagsNV.IntType, p_external_image_format_properties: *ExternalImageFormatPropertiesNV, ) callconv(vulkan_call_conv) Result; pub const PfnGetMemoryWin32HandleNV = fn ( device: Device, memory: DeviceMemory, handle_type: ExternalMemoryHandleTypeFlagsNV.IntType, p_handle: *HANDLE, ) callconv(vulkan_call_conv) Result; pub const PfnCmdExecuteGeneratedCommandsNV = fn ( command_buffer: CommandBuffer, is_preprocessed: Bool32, p_generated_commands_info: *const GeneratedCommandsInfoNV, ) callconv(vulkan_call_conv) void; pub const PfnCmdPreprocessGeneratedCommandsNV = fn ( command_buffer: CommandBuffer, p_generated_commands_info: *const GeneratedCommandsInfoNV, ) callconv(vulkan_call_conv) void; pub const PfnCmdBindPipelineShaderGroupNV = fn ( command_buffer: CommandBuffer, pipeline_bind_point: PipelineBindPoint, pipeline: Pipeline, group_index: u32, ) callconv(vulkan_call_conv) void; pub const PfnGetGeneratedCommandsMemoryRequirementsNV = fn ( device: Device, p_info: *const GeneratedCommandsMemoryRequirementsInfoNV, p_memory_requirements: *MemoryRequirements2, ) callconv(vulkan_call_conv) void; pub const PfnCreateIndirectCommandsLayoutNV = fn ( device: Device, p_create_info: *const IndirectCommandsLayoutCreateInfoNV, p_allocator: ?*const AllocationCallbacks, p_indirect_commands_layout: *IndirectCommandsLayoutNV, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyIndirectCommandsLayoutNV = fn ( device: Device, indirect_commands_layout: IndirectCommandsLayoutNV, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnGetPhysicalDeviceFeatures2 = fn ( physical_device: PhysicalDevice, p_features: *PhysicalDeviceFeatures2, ) callconv(vulkan_call_conv) void; pub const PfnGetPhysicalDeviceProperties2 = fn ( physical_device: PhysicalDevice, p_properties: *PhysicalDeviceProperties2, ) callconv(vulkan_call_conv) void; pub const PfnGetPhysicalDeviceFormatProperties2 = fn ( physical_device: PhysicalDevice, format: Format, p_format_properties: *FormatProperties2, ) callconv(vulkan_call_conv) void; pub const PfnGetPhysicalDeviceImageFormatProperties2 = fn ( physical_device: PhysicalDevice, p_image_format_info: *const PhysicalDeviceImageFormatInfo2, p_image_format_properties: *ImageFormatProperties2, ) callconv(vulkan_call_conv) Result; pub const PfnGetPhysicalDeviceQueueFamilyProperties2 = fn ( physical_device: PhysicalDevice, p_queue_family_property_count: *u32, p_queue_family_properties: ?[*]QueueFamilyProperties2, ) callconv(vulkan_call_conv) void; pub const PfnGetPhysicalDeviceMemoryProperties2 = fn ( physical_device: PhysicalDevice, p_memory_properties: *PhysicalDeviceMemoryProperties2, ) callconv(vulkan_call_conv) void; pub const PfnGetPhysicalDeviceSparseImageFormatProperties2 = fn ( physical_device: PhysicalDevice, p_format_info: *const PhysicalDeviceSparseImageFormatInfo2, p_property_count: *u32, p_properties: ?[*]SparseImageFormatProperties2, ) callconv(vulkan_call_conv) void; pub const PfnCmdPushDescriptorSetKHR = fn ( command_buffer: CommandBuffer, pipeline_bind_point: PipelineBindPoint, layout: PipelineLayout, set: u32, descriptor_write_count: u32, p_descriptor_writes: [*]const WriteDescriptorSet, ) callconv(vulkan_call_conv) void; pub const PfnTrimCommandPool = fn ( device: Device, command_pool: CommandPool, flags: CommandPoolTrimFlags.IntType, ) callconv(vulkan_call_conv) void; pub const PfnGetPhysicalDeviceExternalBufferProperties = fn ( physical_device: PhysicalDevice, p_external_buffer_info: *const PhysicalDeviceExternalBufferInfo, p_external_buffer_properties: *ExternalBufferProperties, ) callconv(vulkan_call_conv) void; pub const PfnGetMemoryWin32HandleKHR = fn ( device: Device, p_get_win_32_handle_info: *const MemoryGetWin32HandleInfoKHR, p_handle: *HANDLE, ) callconv(vulkan_call_conv) Result; pub const PfnGetMemoryWin32HandlePropertiesKHR = fn ( device: Device, handle_type: ExternalMemoryHandleTypeFlags.IntType, handle: HANDLE, p_memory_win_32_handle_properties: *MemoryWin32HandlePropertiesKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetMemoryFdKHR = fn ( device: Device, p_get_fd_info: *const MemoryGetFdInfoKHR, p_fd: *c_int, ) callconv(vulkan_call_conv) Result; pub const PfnGetMemoryFdPropertiesKHR = fn ( device: Device, handle_type: ExternalMemoryHandleTypeFlags.IntType, fd: c_int, p_memory_fd_properties: *MemoryFdPropertiesKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetMemoryZirconHandleFUCHSIA = fn ( device: Device, p_get_zircon_handle_info: *const MemoryGetZirconHandleInfoFUCHSIA, p_zircon_handle: *zx_handle_t, ) callconv(vulkan_call_conv) Result; pub const PfnGetMemoryZirconHandlePropertiesFUCHSIA = fn ( device: Device, handle_type: ExternalMemoryHandleTypeFlags.IntType, zircon_handle: zx_handle_t, p_memory_zircon_handle_properties: *MemoryZirconHandlePropertiesFUCHSIA, ) callconv(vulkan_call_conv) Result; pub const PfnGetPhysicalDeviceExternalSemaphoreProperties = fn ( physical_device: PhysicalDevice, p_external_semaphore_info: *const PhysicalDeviceExternalSemaphoreInfo, p_external_semaphore_properties: *ExternalSemaphoreProperties, ) callconv(vulkan_call_conv) void; pub const PfnGetSemaphoreWin32HandleKHR = fn ( device: Device, p_get_win_32_handle_info: *const SemaphoreGetWin32HandleInfoKHR, p_handle: *HANDLE, ) callconv(vulkan_call_conv) Result; pub const PfnImportSemaphoreWin32HandleKHR = fn ( device: Device, p_import_semaphore_win_32_handle_info: *const ImportSemaphoreWin32HandleInfoKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetSemaphoreFdKHR = fn ( device: Device, p_get_fd_info: *const SemaphoreGetFdInfoKHR, p_fd: *c_int, ) callconv(vulkan_call_conv) Result; pub const PfnImportSemaphoreFdKHR = fn ( device: Device, p_import_semaphore_fd_info: *const ImportSemaphoreFdInfoKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetSemaphoreZirconHandleFUCHSIA = fn ( device: Device, p_get_zircon_handle_info: *const SemaphoreGetZirconHandleInfoFUCHSIA, p_zircon_handle: *zx_handle_t, ) callconv(vulkan_call_conv) Result; pub const PfnImportSemaphoreZirconHandleFUCHSIA = fn ( device: Device, p_import_semaphore_zircon_handle_info: *const ImportSemaphoreZirconHandleInfoFUCHSIA, ) callconv(vulkan_call_conv) Result; pub const PfnGetPhysicalDeviceExternalFenceProperties = fn ( physical_device: PhysicalDevice, p_external_fence_info: *const PhysicalDeviceExternalFenceInfo, p_external_fence_properties: *ExternalFenceProperties, ) callconv(vulkan_call_conv) void; pub const PfnGetFenceWin32HandleKHR = fn ( device: Device, p_get_win_32_handle_info: *const FenceGetWin32HandleInfoKHR, p_handle: *HANDLE, ) callconv(vulkan_call_conv) Result; pub const PfnImportFenceWin32HandleKHR = fn ( device: Device, p_import_fence_win_32_handle_info: *const ImportFenceWin32HandleInfoKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetFenceFdKHR = fn ( device: Device, p_get_fd_info: *const FenceGetFdInfoKHR, p_fd: *c_int, ) callconv(vulkan_call_conv) Result; pub const PfnImportFenceFdKHR = fn ( device: Device, p_import_fence_fd_info: *const ImportFenceFdInfoKHR, ) callconv(vulkan_call_conv) Result; pub const PfnReleaseDisplayEXT = fn ( physical_device: PhysicalDevice, display: DisplayKHR, ) callconv(vulkan_call_conv) Result; pub const PfnAcquireXlibDisplayEXT = fn ( physical_device: PhysicalDevice, dpy: *Display, display: DisplayKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetRandROutputDisplayEXT = fn ( physical_device: PhysicalDevice, dpy: *Display, rr_output: RROutput, p_display: *DisplayKHR, ) callconv(vulkan_call_conv) Result; pub const PfnAcquireWinrtDisplayNV = fn ( physical_device: PhysicalDevice, display: DisplayKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetWinrtDisplayNV = fn ( physical_device: PhysicalDevice, device_relative_id: u32, p_display: *DisplayKHR, ) callconv(vulkan_call_conv) Result; pub const PfnDisplayPowerControlEXT = fn ( device: Device, display: DisplayKHR, p_display_power_info: *const DisplayPowerInfoEXT, ) callconv(vulkan_call_conv) Result; pub const PfnRegisterDeviceEventEXT = fn ( device: Device, p_device_event_info: *const DeviceEventInfoEXT, p_allocator: ?*const AllocationCallbacks, p_fence: *Fence, ) callconv(vulkan_call_conv) Result; pub const PfnRegisterDisplayEventEXT = fn ( device: Device, display: DisplayKHR, p_display_event_info: *const DisplayEventInfoEXT, p_allocator: ?*const AllocationCallbacks, p_fence: *Fence, ) callconv(vulkan_call_conv) Result; pub const PfnGetSwapchainCounterEXT = fn ( device: Device, swapchain: SwapchainKHR, counter: SurfaceCounterFlagsEXT.IntType, p_counter_value: *u64, ) callconv(vulkan_call_conv) Result; pub const PfnGetPhysicalDeviceSurfaceCapabilities2EXT = fn ( physical_device: PhysicalDevice, surface: SurfaceKHR, p_surface_capabilities: *SurfaceCapabilities2EXT, ) callconv(vulkan_call_conv) Result; pub const PfnEnumeratePhysicalDeviceGroups = fn ( instance: Instance, p_physical_device_group_count: *u32, p_physical_device_group_properties: ?[*]PhysicalDeviceGroupProperties, ) callconv(vulkan_call_conv) Result; pub const PfnGetDeviceGroupPeerMemoryFeatures = fn ( device: Device, heap_index: u32, local_device_index: u32, remote_device_index: u32, p_peer_memory_features: *PeerMemoryFeatureFlags, ) callconv(vulkan_call_conv) void; pub const PfnBindBufferMemory2 = fn ( device: Device, bind_info_count: u32, p_bind_infos: [*]const BindBufferMemoryInfo, ) callconv(vulkan_call_conv) Result; pub const PfnBindImageMemory2 = fn ( device: Device, bind_info_count: u32, p_bind_infos: [*]const BindImageMemoryInfo, ) callconv(vulkan_call_conv) Result; pub const PfnCmdSetDeviceMask = fn ( command_buffer: CommandBuffer, device_mask: u32, ) callconv(vulkan_call_conv) void; pub const PfnGetDeviceGroupPresentCapabilitiesKHR = fn ( device: Device, p_device_group_present_capabilities: *DeviceGroupPresentCapabilitiesKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetDeviceGroupSurfacePresentModesKHR = fn ( device: Device, surface: SurfaceKHR, p_modes: *DeviceGroupPresentModeFlagsKHR, ) callconv(vulkan_call_conv) Result; pub const PfnAcquireNextImage2KHR = fn ( device: Device, p_acquire_info: *const AcquireNextImageInfoKHR, p_image_index: *u32, ) callconv(vulkan_call_conv) Result; pub const PfnCmdDispatchBase = fn ( command_buffer: CommandBuffer, base_group_x: u32, base_group_y: u32, base_group_z: u32, group_count_x: u32, group_count_y: u32, group_count_z: u32, ) callconv(vulkan_call_conv) void; pub const PfnGetPhysicalDevicePresentRectanglesKHR = fn ( physical_device: PhysicalDevice, surface: SurfaceKHR, p_rect_count: *u32, p_rects: ?[*]Rect2D, ) callconv(vulkan_call_conv) Result; pub const PfnCreateDescriptorUpdateTemplate = fn ( device: Device, p_create_info: *const DescriptorUpdateTemplateCreateInfo, p_allocator: ?*const AllocationCallbacks, p_descriptor_update_template: *DescriptorUpdateTemplate, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyDescriptorUpdateTemplate = fn ( device: Device, descriptor_update_template: DescriptorUpdateTemplate, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnUpdateDescriptorSetWithTemplate = fn ( device: Device, descriptor_set: DescriptorSet, descriptor_update_template: DescriptorUpdateTemplate, p_data: *const anyopaque, ) callconv(vulkan_call_conv) void; pub const PfnCmdPushDescriptorSetWithTemplateKHR = fn ( command_buffer: CommandBuffer, descriptor_update_template: DescriptorUpdateTemplate, layout: PipelineLayout, set: u32, p_data: *const anyopaque, ) callconv(vulkan_call_conv) void; pub const PfnSetHdrMetadataEXT = fn ( device: Device, swapchain_count: u32, p_swapchains: [*]const SwapchainKHR, p_metadata: [*]const HdrMetadataEXT, ) callconv(vulkan_call_conv) void; pub const PfnGetSwapchainStatusKHR = fn ( device: Device, swapchain: SwapchainKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetRefreshCycleDurationGOOGLE = fn ( device: Device, swapchain: SwapchainKHR, p_display_timing_properties: *RefreshCycleDurationGOOGLE, ) callconv(vulkan_call_conv) Result; pub const PfnGetPastPresentationTimingGOOGLE = fn ( device: Device, swapchain: SwapchainKHR, p_presentation_timing_count: *u32, p_presentation_timings: ?[*]PastPresentationTimingGOOGLE, ) callconv(vulkan_call_conv) Result; pub const PfnCreateIOSSurfaceMVK = fn ( instance: Instance, p_create_info: *const IOSSurfaceCreateInfoMVK, p_allocator: ?*const AllocationCallbacks, p_surface: *SurfaceKHR, ) callconv(vulkan_call_conv) Result; pub const PfnCreateMacOSSurfaceMVK = fn ( instance: Instance, p_create_info: *const MacOSSurfaceCreateInfoMVK, p_allocator: ?*const AllocationCallbacks, p_surface: *SurfaceKHR, ) callconv(vulkan_call_conv) Result; pub const PfnCreateMetalSurfaceEXT = fn ( instance: Instance, p_create_info: *const MetalSurfaceCreateInfoEXT, p_allocator: ?*const AllocationCallbacks, p_surface: *SurfaceKHR, ) callconv(vulkan_call_conv) Result; pub const PfnCmdSetViewportWScalingNV = fn ( command_buffer: CommandBuffer, first_viewport: u32, viewport_count: u32, p_viewport_w_scalings: [*]const ViewportWScalingNV, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetDiscardRectangleEXT = fn ( command_buffer: CommandBuffer, first_discard_rectangle: u32, discard_rectangle_count: u32, p_discard_rectangles: [*]const Rect2D, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetSampleLocationsEXT = fn ( command_buffer: CommandBuffer, p_sample_locations_info: *const SampleLocationsInfoEXT, ) callconv(vulkan_call_conv) void; pub const PfnGetPhysicalDeviceMultisamplePropertiesEXT = fn ( physical_device: PhysicalDevice, samples: SampleCountFlags.IntType, p_multisample_properties: *MultisamplePropertiesEXT, ) callconv(vulkan_call_conv) void; pub const PfnGetPhysicalDeviceSurfaceCapabilities2KHR = fn ( physical_device: PhysicalDevice, p_surface_info: *const PhysicalDeviceSurfaceInfo2KHR, p_surface_capabilities: *SurfaceCapabilities2KHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetPhysicalDeviceSurfaceFormats2KHR = fn ( physical_device: PhysicalDevice, p_surface_info: *const PhysicalDeviceSurfaceInfo2KHR, p_surface_format_count: *u32, p_surface_formats: ?[*]SurfaceFormat2KHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetPhysicalDeviceDisplayProperties2KHR = fn ( physical_device: PhysicalDevice, p_property_count: *u32, p_properties: ?[*]DisplayProperties2KHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetPhysicalDeviceDisplayPlaneProperties2KHR = fn ( physical_device: PhysicalDevice, p_property_count: *u32, p_properties: ?[*]DisplayPlaneProperties2KHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetDisplayModeProperties2KHR = fn ( physical_device: PhysicalDevice, display: DisplayKHR, p_property_count: *u32, p_properties: ?[*]DisplayModeProperties2KHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetDisplayPlaneCapabilities2KHR = fn ( physical_device: PhysicalDevice, p_display_plane_info: *const DisplayPlaneInfo2KHR, p_capabilities: *DisplayPlaneCapabilities2KHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetBufferMemoryRequirements2 = fn ( device: Device, p_info: *const BufferMemoryRequirementsInfo2, p_memory_requirements: *MemoryRequirements2, ) callconv(vulkan_call_conv) void; pub const PfnGetImageMemoryRequirements2 = fn ( device: Device, p_info: *const ImageMemoryRequirementsInfo2, p_memory_requirements: *MemoryRequirements2, ) callconv(vulkan_call_conv) void; pub const PfnGetImageSparseMemoryRequirements2 = fn ( device: Device, p_info: *const ImageSparseMemoryRequirementsInfo2, p_sparse_memory_requirement_count: *u32, p_sparse_memory_requirements: ?[*]SparseImageMemoryRequirements2, ) callconv(vulkan_call_conv) void; pub const PfnCreateSamplerYcbcrConversion = fn ( device: Device, p_create_info: *const SamplerYcbcrConversionCreateInfo, p_allocator: ?*const AllocationCallbacks, p_ycbcr_conversion: *SamplerYcbcrConversion, ) callconv(vulkan_call_conv) Result; pub const PfnDestroySamplerYcbcrConversion = fn ( device: Device, ycbcr_conversion: SamplerYcbcrConversion, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnGetDeviceQueue2 = fn ( device: Device, p_queue_info: *const DeviceQueueInfo2, p_queue: *Queue, ) callconv(vulkan_call_conv) void; pub const PfnCreateValidationCacheEXT = fn ( device: Device, p_create_info: *const ValidationCacheCreateInfoEXT, p_allocator: ?*const AllocationCallbacks, p_validation_cache: *ValidationCacheEXT, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyValidationCacheEXT = fn ( device: Device, validation_cache: ValidationCacheEXT, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnGetValidationCacheDataEXT = fn ( device: Device, validation_cache: ValidationCacheEXT, p_data_size: *usize, p_data: ?*anyopaque, ) callconv(vulkan_call_conv) Result; pub const PfnMergeValidationCachesEXT = fn ( device: Device, dst_cache: ValidationCacheEXT, src_cache_count: u32, p_src_caches: [*]const ValidationCacheEXT, ) callconv(vulkan_call_conv) Result; pub const PfnGetDescriptorSetLayoutSupport = fn ( device: Device, p_create_info: *const DescriptorSetLayoutCreateInfo, p_support: *DescriptorSetLayoutSupport, ) callconv(vulkan_call_conv) void; pub const PfnGetSwapchainGrallocUsageANDROID = fn ( device: Device, format: Format, image_usage: ImageUsageFlags.IntType, gralloc_usage: *c_int, ) callconv(vulkan_call_conv) Result; pub const PfnGetSwapchainGrallocUsage2ANDROID = fn ( device: Device, format: Format, image_usage: ImageUsageFlags.IntType, swapchain_image_usage: SwapchainImageUsageFlagsANDROID.IntType, gralloc_consumer_usage: *u64, gralloc_producer_usage: *u64, ) callconv(vulkan_call_conv) Result; pub const PfnAcquireImageANDROID = fn ( device: Device, image: Image, native_fence_fd: c_int, semaphore: Semaphore, fence: Fence, ) callconv(vulkan_call_conv) Result; pub const PfnQueueSignalReleaseImageANDROID = fn ( queue: Queue, wait_semaphore_count: u32, p_wait_semaphores: [*]const Semaphore, image: Image, p_native_fence_fd: *c_int, ) callconv(vulkan_call_conv) Result; pub const PfnGetShaderInfoAMD = fn ( device: Device, pipeline: Pipeline, shader_stage: ShaderStageFlags.IntType, info_type: ShaderInfoTypeAMD, p_info_size: *usize, p_info: ?*anyopaque, ) callconv(vulkan_call_conv) Result; pub const PfnSetLocalDimmingAMD = fn ( device: Device, swap_chain: SwapchainKHR, local_dimming_enable: Bool32, ) callconv(vulkan_call_conv) void; pub const PfnGetPhysicalDeviceCalibrateableTimeDomainsEXT = fn ( physical_device: PhysicalDevice, p_time_domain_count: *u32, p_time_domains: ?[*]TimeDomainEXT, ) callconv(vulkan_call_conv) Result; pub const PfnGetCalibratedTimestampsEXT = fn ( device: Device, timestamp_count: u32, p_timestamp_infos: [*]const CalibratedTimestampInfoEXT, p_timestamps: [*]u64, p_max_deviation: *u64, ) callconv(vulkan_call_conv) Result; pub const PfnSetDebugUtilsObjectNameEXT = fn ( device: Device, p_name_info: *const DebugUtilsObjectNameInfoEXT, ) callconv(vulkan_call_conv) Result; pub const PfnSetDebugUtilsObjectTagEXT = fn ( device: Device, p_tag_info: *const DebugUtilsObjectTagInfoEXT, ) callconv(vulkan_call_conv) Result; pub const PfnQueueBeginDebugUtilsLabelEXT = fn ( queue: Queue, p_label_info: *const DebugUtilsLabelEXT, ) callconv(vulkan_call_conv) void; pub const PfnQueueEndDebugUtilsLabelEXT = fn ( queue: Queue, ) callconv(vulkan_call_conv) void; pub const PfnQueueInsertDebugUtilsLabelEXT = fn ( queue: Queue, p_label_info: *const DebugUtilsLabelEXT, ) callconv(vulkan_call_conv) void; pub const PfnCmdBeginDebugUtilsLabelEXT = fn ( command_buffer: CommandBuffer, p_label_info: *const DebugUtilsLabelEXT, ) callconv(vulkan_call_conv) void; pub const PfnCmdEndDebugUtilsLabelEXT = fn ( command_buffer: CommandBuffer, ) callconv(vulkan_call_conv) void; pub const PfnCmdInsertDebugUtilsLabelEXT = fn ( command_buffer: CommandBuffer, p_label_info: *const DebugUtilsLabelEXT, ) callconv(vulkan_call_conv) void; pub const PfnCreateDebugUtilsMessengerEXT = fn ( instance: Instance, p_create_info: *const DebugUtilsMessengerCreateInfoEXT, p_allocator: ?*const AllocationCallbacks, p_messenger: *DebugUtilsMessengerEXT, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyDebugUtilsMessengerEXT = fn ( instance: Instance, messenger: DebugUtilsMessengerEXT, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnSubmitDebugUtilsMessageEXT = fn ( instance: Instance, message_severity: DebugUtilsMessageSeverityFlagsEXT.IntType, message_types: DebugUtilsMessageTypeFlagsEXT.IntType, p_callback_data: *const DebugUtilsMessengerCallbackDataEXT, ) callconv(vulkan_call_conv) void; pub const PfnGetMemoryHostPointerPropertiesEXT = fn ( device: Device, handle_type: ExternalMemoryHandleTypeFlags.IntType, p_host_pointer: *const anyopaque, p_memory_host_pointer_properties: *MemoryHostPointerPropertiesEXT, ) callconv(vulkan_call_conv) Result; pub const PfnCmdWriteBufferMarkerAMD = fn ( command_buffer: CommandBuffer, pipeline_stage: PipelineStageFlags.IntType, dst_buffer: Buffer, dst_offset: DeviceSize, marker: u32, ) callconv(vulkan_call_conv) void; pub const PfnCreateRenderPass2 = fn ( device: Device, p_create_info: *const RenderPassCreateInfo2, p_allocator: ?*const AllocationCallbacks, p_render_pass: *RenderPass, ) callconv(vulkan_call_conv) Result; pub const PfnCmdBeginRenderPass2 = fn ( command_buffer: CommandBuffer, p_render_pass_begin: *const RenderPassBeginInfo, p_subpass_begin_info: *const SubpassBeginInfo, ) callconv(vulkan_call_conv) void; pub const PfnCmdNextSubpass2 = fn ( command_buffer: CommandBuffer, p_subpass_begin_info: *const SubpassBeginInfo, p_subpass_end_info: *const SubpassEndInfo, ) callconv(vulkan_call_conv) void; pub const PfnCmdEndRenderPass2 = fn ( command_buffer: CommandBuffer, p_subpass_end_info: *const SubpassEndInfo, ) callconv(vulkan_call_conv) void; pub const PfnGetSemaphoreCounterValue = fn ( device: Device, semaphore: Semaphore, p_value: *u64, ) callconv(vulkan_call_conv) Result; pub const PfnWaitSemaphores = fn ( device: Device, p_wait_info: *const SemaphoreWaitInfo, timeout: u64, ) callconv(vulkan_call_conv) Result; pub const PfnSignalSemaphore = fn ( device: Device, p_signal_info: *const SemaphoreSignalInfo, ) callconv(vulkan_call_conv) Result; pub const PfnGetAndroidHardwareBufferPropertiesANDROID = fn ( device: Device, buffer: *const AHardwareBuffer, p_properties: *AndroidHardwareBufferPropertiesANDROID, ) callconv(vulkan_call_conv) Result; pub const PfnGetMemoryAndroidHardwareBufferANDROID = fn ( device: Device, p_info: *const MemoryGetAndroidHardwareBufferInfoANDROID, p_buffer: **AHardwareBuffer, ) callconv(vulkan_call_conv) Result; pub const PfnCmdDrawIndirectCount = fn ( command_buffer: CommandBuffer, buffer: Buffer, offset: DeviceSize, count_buffer: Buffer, count_buffer_offset: DeviceSize, max_draw_count: u32, stride: u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdDrawIndexedIndirectCount = fn ( command_buffer: CommandBuffer, buffer: Buffer, offset: DeviceSize, count_buffer: Buffer, count_buffer_offset: DeviceSize, max_draw_count: u32, stride: u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetCheckpointNV = fn ( command_buffer: CommandBuffer, p_checkpoint_marker: *const anyopaque, ) callconv(vulkan_call_conv) void; pub const PfnGetQueueCheckpointDataNV = fn ( queue: Queue, p_checkpoint_data_count: *u32, p_checkpoint_data: ?[*]CheckpointDataNV, ) callconv(vulkan_call_conv) void; pub const PfnCmdBindTransformFeedbackBuffersEXT = fn ( command_buffer: CommandBuffer, first_binding: u32, binding_count: u32, p_buffers: [*]const Buffer, p_offsets: [*]const DeviceSize, p_sizes: ?[*]const DeviceSize, ) callconv(vulkan_call_conv) void; pub const PfnCmdBeginTransformFeedbackEXT = fn ( command_buffer: CommandBuffer, first_counter_buffer: u32, counter_buffer_count: u32, p_counter_buffers: [*]const Buffer, p_counter_buffer_offsets: ?[*]const DeviceSize, ) callconv(vulkan_call_conv) void; pub const PfnCmdEndTransformFeedbackEXT = fn ( command_buffer: CommandBuffer, first_counter_buffer: u32, counter_buffer_count: u32, p_counter_buffers: [*]const Buffer, p_counter_buffer_offsets: ?[*]const DeviceSize, ) callconv(vulkan_call_conv) void; pub const PfnCmdBeginQueryIndexedEXT = fn ( command_buffer: CommandBuffer, query_pool: QueryPool, query: u32, flags: QueryControlFlags.IntType, index: u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdEndQueryIndexedEXT = fn ( command_buffer: CommandBuffer, query_pool: QueryPool, query: u32, index: u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdDrawIndirectByteCountEXT = fn ( command_buffer: CommandBuffer, instance_count: u32, first_instance: u32, counter_buffer: Buffer, counter_buffer_offset: DeviceSize, counter_offset: u32, vertex_stride: u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetExclusiveScissorNV = fn ( command_buffer: CommandBuffer, first_exclusive_scissor: u32, exclusive_scissor_count: u32, p_exclusive_scissors: [*]const Rect2D, ) callconv(vulkan_call_conv) void; pub const PfnCmdBindShadingRateImageNV = fn ( command_buffer: CommandBuffer, image_view: ImageView, image_layout: ImageLayout, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetViewportShadingRatePaletteNV = fn ( command_buffer: CommandBuffer, first_viewport: u32, viewport_count: u32, p_shading_rate_palettes: [*]const ShadingRatePaletteNV, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetCoarseSampleOrderNV = fn ( command_buffer: CommandBuffer, sample_order_type: CoarseSampleOrderTypeNV, custom_sample_order_count: u32, p_custom_sample_orders: [*]const CoarseSampleOrderCustomNV, ) callconv(vulkan_call_conv) void; pub const PfnCmdDrawMeshTasksNV = fn ( command_buffer: CommandBuffer, task_count: u32, first_task: u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdDrawMeshTasksIndirectNV = fn ( command_buffer: CommandBuffer, buffer: Buffer, offset: DeviceSize, draw_count: u32, stride: u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdDrawMeshTasksIndirectCountNV = fn ( command_buffer: CommandBuffer, buffer: Buffer, offset: DeviceSize, count_buffer: Buffer, count_buffer_offset: DeviceSize, max_draw_count: u32, stride: u32, ) callconv(vulkan_call_conv) void; pub const PfnCompileDeferredNV = fn ( device: Device, pipeline: Pipeline, shader: u32, ) callconv(vulkan_call_conv) Result; pub const PfnCreateAccelerationStructureNV = fn ( device: Device, p_create_info: *const AccelerationStructureCreateInfoNV, p_allocator: ?*const AllocationCallbacks, p_acceleration_structure: *AccelerationStructureNV, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyAccelerationStructureKHR = fn ( device: Device, acceleration_structure: AccelerationStructureKHR, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnDestroyAccelerationStructureNV = fn ( device: Device, acceleration_structure: AccelerationStructureNV, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnGetAccelerationStructureMemoryRequirementsNV = fn ( device: Device, p_info: *const AccelerationStructureMemoryRequirementsInfoNV, p_memory_requirements: *MemoryRequirements2KHR, ) callconv(vulkan_call_conv) void; pub const PfnBindAccelerationStructureMemoryNV = fn ( device: Device, bind_info_count: u32, p_bind_infos: [*]const BindAccelerationStructureMemoryInfoNV, ) callconv(vulkan_call_conv) Result; pub const PfnCmdCopyAccelerationStructureNV = fn ( command_buffer: CommandBuffer, dst: AccelerationStructureNV, src: AccelerationStructureNV, mode: CopyAccelerationStructureModeKHR, ) callconv(vulkan_call_conv) void; pub const PfnCmdCopyAccelerationStructureKHR = fn ( command_buffer: CommandBuffer, p_info: *const CopyAccelerationStructureInfoKHR, ) callconv(vulkan_call_conv) void; pub const PfnCopyAccelerationStructureKHR = fn ( device: Device, deferred_operation: DeferredOperationKHR, p_info: *const CopyAccelerationStructureInfoKHR, ) callconv(vulkan_call_conv) Result; pub const PfnCmdCopyAccelerationStructureToMemoryKHR = fn ( command_buffer: CommandBuffer, p_info: *const CopyAccelerationStructureToMemoryInfoKHR, ) callconv(vulkan_call_conv) void; pub const PfnCopyAccelerationStructureToMemoryKHR = fn ( device: Device, deferred_operation: DeferredOperationKHR, p_info: *const CopyAccelerationStructureToMemoryInfoKHR, ) callconv(vulkan_call_conv) Result; pub const PfnCmdCopyMemoryToAccelerationStructureKHR = fn ( command_buffer: CommandBuffer, p_info: *const CopyMemoryToAccelerationStructureInfoKHR, ) callconv(vulkan_call_conv) void; pub const PfnCopyMemoryToAccelerationStructureKHR = fn ( device: Device, deferred_operation: DeferredOperationKHR, p_info: *const CopyMemoryToAccelerationStructureInfoKHR, ) callconv(vulkan_call_conv) Result; pub const PfnCmdWriteAccelerationStructuresPropertiesKHR = fn ( command_buffer: CommandBuffer, acceleration_structure_count: u32, p_acceleration_structures: [*]const AccelerationStructureKHR, query_type: QueryType, query_pool: QueryPool, first_query: u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdWriteAccelerationStructuresPropertiesNV = fn ( command_buffer: CommandBuffer, acceleration_structure_count: u32, p_acceleration_structures: [*]const AccelerationStructureNV, query_type: QueryType, query_pool: QueryPool, first_query: u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdBuildAccelerationStructureNV = fn ( command_buffer: CommandBuffer, p_info: *const AccelerationStructureInfoNV, instance_data: Buffer, instance_offset: DeviceSize, update: Bool32, dst: AccelerationStructureNV, src: AccelerationStructureNV, scratch: Buffer, scratch_offset: DeviceSize, ) callconv(vulkan_call_conv) void; pub const PfnWriteAccelerationStructuresPropertiesKHR = fn ( device: Device, acceleration_structure_count: u32, p_acceleration_structures: [*]const AccelerationStructureKHR, query_type: QueryType, data_size: usize, p_data: *anyopaque, stride: usize, ) callconv(vulkan_call_conv) Result; pub const PfnCmdTraceRaysKHR = fn ( command_buffer: CommandBuffer, p_raygen_shader_binding_table: *const StridedDeviceAddressRegionKHR, p_miss_shader_binding_table: *const StridedDeviceAddressRegionKHR, p_hit_shader_binding_table: *const StridedDeviceAddressRegionKHR, p_callable_shader_binding_table: *const StridedDeviceAddressRegionKHR, width: u32, height: u32, depth: u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdTraceRaysNV = fn ( command_buffer: CommandBuffer, raygen_shader_binding_table_buffer: Buffer, raygen_shader_binding_offset: DeviceSize, miss_shader_binding_table_buffer: Buffer, miss_shader_binding_offset: DeviceSize, miss_shader_binding_stride: DeviceSize, hit_shader_binding_table_buffer: Buffer, hit_shader_binding_offset: DeviceSize, hit_shader_binding_stride: DeviceSize, callable_shader_binding_table_buffer: Buffer, callable_shader_binding_offset: DeviceSize, callable_shader_binding_stride: DeviceSize, width: u32, height: u32, depth: u32, ) callconv(vulkan_call_conv) void; pub const PfnGetRayTracingShaderGroupHandlesKHR = fn ( device: Device, pipeline: Pipeline, first_group: u32, group_count: u32, data_size: usize, p_data: *anyopaque, ) callconv(vulkan_call_conv) Result; pub const PfnGetRayTracingCaptureReplayShaderGroupHandlesKHR = fn ( device: Device, pipeline: Pipeline, first_group: u32, group_count: u32, data_size: usize, p_data: *anyopaque, ) callconv(vulkan_call_conv) Result; pub const PfnGetAccelerationStructureHandleNV = fn ( device: Device, acceleration_structure: AccelerationStructureNV, data_size: usize, p_data: *anyopaque, ) callconv(vulkan_call_conv) Result; pub const PfnCreateRayTracingPipelinesNV = fn ( device: Device, pipeline_cache: PipelineCache, create_info_count: u32, p_create_infos: [*]const RayTracingPipelineCreateInfoNV, p_allocator: ?*const AllocationCallbacks, p_pipelines: [*]Pipeline, ) callconv(vulkan_call_conv) Result; pub const PfnCreateRayTracingPipelinesKHR = fn ( device: Device, deferred_operation: DeferredOperationKHR, pipeline_cache: PipelineCache, create_info_count: u32, p_create_infos: [*]const RayTracingPipelineCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, p_pipelines: [*]Pipeline, ) callconv(vulkan_call_conv) Result; pub const PfnGetPhysicalDeviceCooperativeMatrixPropertiesNV = fn ( physical_device: PhysicalDevice, p_property_count: *u32, p_properties: ?[*]CooperativeMatrixPropertiesNV, ) callconv(vulkan_call_conv) Result; pub const PfnCmdTraceRaysIndirectKHR = fn ( command_buffer: CommandBuffer, p_raygen_shader_binding_table: *const StridedDeviceAddressRegionKHR, p_miss_shader_binding_table: *const StridedDeviceAddressRegionKHR, p_hit_shader_binding_table: *const StridedDeviceAddressRegionKHR, p_callable_shader_binding_table: *const StridedDeviceAddressRegionKHR, indirect_device_address: DeviceAddress, ) callconv(vulkan_call_conv) void; pub const PfnGetDeviceAccelerationStructureCompatibilityKHR = fn ( device: Device, p_version_info: *const AccelerationStructureVersionInfoKHR, p_compatibility: *AccelerationStructureCompatibilityKHR, ) callconv(vulkan_call_conv) void; pub const PfnGetRayTracingShaderGroupStackSizeKHR = fn ( device: Device, pipeline: Pipeline, group: u32, group_shader: ShaderGroupShaderKHR, ) callconv(vulkan_call_conv) DeviceSize; pub const PfnCmdSetRayTracingPipelineStackSizeKHR = fn ( command_buffer: CommandBuffer, pipeline_stack_size: u32, ) callconv(vulkan_call_conv) void; pub const PfnGetImageViewHandleNVX = fn ( device: Device, p_info: *const ImageViewHandleInfoNVX, ) callconv(vulkan_call_conv) u32; pub const PfnGetImageViewAddressNVX = fn ( device: Device, image_view: ImageView, p_properties: *ImageViewAddressPropertiesNVX, ) callconv(vulkan_call_conv) Result; pub const PfnGetPhysicalDeviceSurfacePresentModes2EXT = fn ( physical_device: PhysicalDevice, p_surface_info: *const PhysicalDeviceSurfaceInfo2KHR, p_present_mode_count: *u32, p_present_modes: ?[*]PresentModeKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetDeviceGroupSurfacePresentModes2EXT = fn ( device: Device, p_surface_info: *const PhysicalDeviceSurfaceInfo2KHR, p_modes: *DeviceGroupPresentModeFlagsKHR, ) callconv(vulkan_call_conv) Result; pub const PfnAcquireFullScreenExclusiveModeEXT = fn ( device: Device, swapchain: SwapchainKHR, ) callconv(vulkan_call_conv) Result; pub const PfnReleaseFullScreenExclusiveModeEXT = fn ( device: Device, swapchain: SwapchainKHR, ) callconv(vulkan_call_conv) Result; pub const PfnEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR = fn ( physical_device: PhysicalDevice, queue_family_index: u32, p_counter_count: *u32, p_counters: ?[*]PerformanceCounterKHR, p_counter_descriptions: ?[*]PerformanceCounterDescriptionKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR = fn ( physical_device: PhysicalDevice, p_performance_query_create_info: *const QueryPoolPerformanceCreateInfoKHR, p_num_passes: *u32, ) callconv(vulkan_call_conv) void; pub const PfnAcquireProfilingLockKHR = fn ( device: Device, p_info: *const AcquireProfilingLockInfoKHR, ) callconv(vulkan_call_conv) Result; pub const PfnReleaseProfilingLockKHR = fn ( device: Device, ) callconv(vulkan_call_conv) void; pub const PfnGetImageDrmFormatModifierPropertiesEXT = fn ( device: Device, image: Image, p_properties: *ImageDrmFormatModifierPropertiesEXT, ) callconv(vulkan_call_conv) Result; pub const PfnGetBufferOpaqueCaptureAddress = fn ( device: Device, p_info: *const BufferDeviceAddressInfo, ) callconv(vulkan_call_conv) u64; pub const PfnGetBufferDeviceAddress = fn ( device: Device, p_info: *const BufferDeviceAddressInfo, ) callconv(vulkan_call_conv) DeviceAddress; pub const PfnCreateHeadlessSurfaceEXT = fn ( instance: Instance, p_create_info: *const HeadlessSurfaceCreateInfoEXT, p_allocator: ?*const AllocationCallbacks, p_surface: *SurfaceKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV = fn ( physical_device: PhysicalDevice, p_combination_count: *u32, p_combinations: ?[*]FramebufferMixedSamplesCombinationNV, ) callconv(vulkan_call_conv) Result; pub const PfnInitializePerformanceApiINTEL = fn ( device: Device, p_initialize_info: *const InitializePerformanceApiInfoINTEL, ) callconv(vulkan_call_conv) Result; pub const PfnUninitializePerformanceApiINTEL = fn ( device: Device, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetPerformanceMarkerINTEL = fn ( command_buffer: CommandBuffer, p_marker_info: *const PerformanceMarkerInfoINTEL, ) callconv(vulkan_call_conv) Result; pub const PfnCmdSetPerformanceStreamMarkerINTEL = fn ( command_buffer: CommandBuffer, p_marker_info: *const PerformanceStreamMarkerInfoINTEL, ) callconv(vulkan_call_conv) Result; pub const PfnCmdSetPerformanceOverrideINTEL = fn ( command_buffer: CommandBuffer, p_override_info: *const PerformanceOverrideInfoINTEL, ) callconv(vulkan_call_conv) Result; pub const PfnAcquirePerformanceConfigurationINTEL = fn ( device: Device, p_acquire_info: *const PerformanceConfigurationAcquireInfoINTEL, p_configuration: *PerformanceConfigurationINTEL, ) callconv(vulkan_call_conv) Result; pub const PfnReleasePerformanceConfigurationINTEL = fn ( device: Device, configuration: PerformanceConfigurationINTEL, ) callconv(vulkan_call_conv) Result; pub const PfnQueueSetPerformanceConfigurationINTEL = fn ( queue: Queue, configuration: PerformanceConfigurationINTEL, ) callconv(vulkan_call_conv) Result; pub const PfnGetPerformanceParameterINTEL = fn ( device: Device, parameter: PerformanceParameterTypeINTEL, p_value: *PerformanceValueINTEL, ) callconv(vulkan_call_conv) Result; pub const PfnGetDeviceMemoryOpaqueCaptureAddress = fn ( device: Device, p_info: *const DeviceMemoryOpaqueCaptureAddressInfo, ) callconv(vulkan_call_conv) u64; pub const PfnGetPipelineExecutablePropertiesKHR = fn ( device: Device, p_pipeline_info: *const PipelineInfoKHR, p_executable_count: *u32, p_properties: ?[*]PipelineExecutablePropertiesKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetPipelineExecutableStatisticsKHR = fn ( device: Device, p_executable_info: *const PipelineExecutableInfoKHR, p_statistic_count: *u32, p_statistics: ?[*]PipelineExecutableStatisticKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetPipelineExecutableInternalRepresentationsKHR = fn ( device: Device, p_executable_info: *const PipelineExecutableInfoKHR, p_internal_representation_count: *u32, p_internal_representations: ?[*]PipelineExecutableInternalRepresentationKHR, ) callconv(vulkan_call_conv) Result; pub const PfnCmdSetLineStippleEXT = fn ( command_buffer: CommandBuffer, line_stipple_factor: u32, line_stipple_pattern: u16, ) callconv(vulkan_call_conv) void; pub const PfnGetPhysicalDeviceToolPropertiesEXT = fn ( physical_device: PhysicalDevice, p_tool_count: *u32, p_tool_properties: ?[*]PhysicalDeviceToolPropertiesEXT, ) callconv(vulkan_call_conv) Result; pub const PfnCreateAccelerationStructureKHR = fn ( device: Device, p_create_info: *const AccelerationStructureCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, p_acceleration_structure: *AccelerationStructureKHR, ) callconv(vulkan_call_conv) Result; pub const PfnCmdBuildAccelerationStructuresKHR = fn ( command_buffer: CommandBuffer, info_count: u32, p_infos: [*]const AccelerationStructureBuildGeometryInfoKHR, pp_build_range_infos: [*]const *const AccelerationStructureBuildRangeInfoKHR, ) callconv(vulkan_call_conv) void; pub const PfnCmdBuildAccelerationStructuresIndirectKHR = fn ( command_buffer: CommandBuffer, info_count: u32, p_infos: [*]const AccelerationStructureBuildGeometryInfoKHR, p_indirect_device_addresses: [*]const DeviceAddress, p_indirect_strides: [*]const u32, pp_max_primitive_counts: [*]const *const u32, ) callconv(vulkan_call_conv) void; pub const PfnBuildAccelerationStructuresKHR = fn ( device: Device, deferred_operation: DeferredOperationKHR, info_count: u32, p_infos: [*]const AccelerationStructureBuildGeometryInfoKHR, pp_build_range_infos: [*]const *const AccelerationStructureBuildRangeInfoKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetAccelerationStructureDeviceAddressKHR = fn ( device: Device, p_info: *const AccelerationStructureDeviceAddressInfoKHR, ) callconv(vulkan_call_conv) DeviceAddress; pub const PfnCreateDeferredOperationKHR = fn ( device: Device, p_allocator: ?*const AllocationCallbacks, p_deferred_operation: *DeferredOperationKHR, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyDeferredOperationKHR = fn ( device: Device, operation: DeferredOperationKHR, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnGetDeferredOperationMaxConcurrencyKHR = fn ( device: Device, operation: DeferredOperationKHR, ) callconv(vulkan_call_conv) u32; pub const PfnGetDeferredOperationResultKHR = fn ( device: Device, operation: DeferredOperationKHR, ) callconv(vulkan_call_conv) Result; pub const PfnDeferredOperationJoinKHR = fn ( device: Device, operation: DeferredOperationKHR, ) callconv(vulkan_call_conv) Result; pub const PfnCmdSetCullModeEXT = fn ( command_buffer: CommandBuffer, cull_mode: CullModeFlags.IntType, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetFrontFaceEXT = fn ( command_buffer: CommandBuffer, front_face: FrontFace, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetPrimitiveTopologyEXT = fn ( command_buffer: CommandBuffer, primitive_topology: PrimitiveTopology, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetViewportWithCountEXT = fn ( command_buffer: CommandBuffer, viewport_count: u32, p_viewports: [*]const Viewport, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetScissorWithCountEXT = fn ( command_buffer: CommandBuffer, scissor_count: u32, p_scissors: [*]const Rect2D, ) callconv(vulkan_call_conv) void; pub const PfnCmdBindVertexBuffers2EXT = fn ( command_buffer: CommandBuffer, first_binding: u32, binding_count: u32, p_buffers: [*]const Buffer, p_offsets: [*]const DeviceSize, p_sizes: ?[*]const DeviceSize, p_strides: ?[*]const DeviceSize, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetDepthTestEnableEXT = fn ( command_buffer: CommandBuffer, depth_test_enable: Bool32, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetDepthWriteEnableEXT = fn ( command_buffer: CommandBuffer, depth_write_enable: Bool32, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetDepthCompareOpEXT = fn ( command_buffer: CommandBuffer, depth_compare_op: CompareOp, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetDepthBoundsTestEnableEXT = fn ( command_buffer: CommandBuffer, depth_bounds_test_enable: Bool32, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetStencilTestEnableEXT = fn ( command_buffer: CommandBuffer, stencil_test_enable: Bool32, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetStencilOpEXT = fn ( command_buffer: CommandBuffer, face_mask: StencilFaceFlags.IntType, fail_op: StencilOp, pass_op: StencilOp, depth_fail_op: StencilOp, compare_op: CompareOp, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetPatchControlPointsEXT = fn ( command_buffer: CommandBuffer, patch_control_points: u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetRasterizerDiscardEnableEXT = fn ( command_buffer: CommandBuffer, rasterizer_discard_enable: Bool32, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetDepthBiasEnableEXT = fn ( command_buffer: CommandBuffer, depth_bias_enable: Bool32, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetLogicOpEXT = fn ( command_buffer: CommandBuffer, logic_op: LogicOp, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetPrimitiveRestartEnableEXT = fn ( command_buffer: CommandBuffer, primitive_restart_enable: Bool32, ) callconv(vulkan_call_conv) void; pub const PfnCreatePrivateDataSlotEXT = fn ( device: Device, p_create_info: *const PrivateDataSlotCreateInfoEXT, p_allocator: ?*const AllocationCallbacks, p_private_data_slot: *PrivateDataSlotEXT, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyPrivateDataSlotEXT = fn ( device: Device, private_data_slot: PrivateDataSlotEXT, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnSetPrivateDataEXT = fn ( device: Device, object_type: ObjectType, object_handle: u64, private_data_slot: PrivateDataSlotEXT, data: u64, ) callconv(vulkan_call_conv) Result; pub const PfnGetPrivateDataEXT = fn ( device: Device, object_type: ObjectType, object_handle: u64, private_data_slot: PrivateDataSlotEXT, p_data: *u64, ) callconv(vulkan_call_conv) void; pub const PfnCmdCopyBuffer2KHR = fn ( command_buffer: CommandBuffer, p_copy_buffer_info: *const CopyBufferInfo2KHR, ) callconv(vulkan_call_conv) void; pub const PfnCmdCopyImage2KHR = fn ( command_buffer: CommandBuffer, p_copy_image_info: *const CopyImageInfo2KHR, ) callconv(vulkan_call_conv) void; pub const PfnCmdBlitImage2KHR = fn ( command_buffer: CommandBuffer, p_blit_image_info: *const BlitImageInfo2KHR, ) callconv(vulkan_call_conv) void; pub const PfnCmdCopyBufferToImage2KHR = fn ( command_buffer: CommandBuffer, p_copy_buffer_to_image_info: *const CopyBufferToImageInfo2KHR, ) callconv(vulkan_call_conv) void; pub const PfnCmdCopyImageToBuffer2KHR = fn ( command_buffer: CommandBuffer, p_copy_image_to_buffer_info: *const CopyImageToBufferInfo2KHR, ) callconv(vulkan_call_conv) void; pub const PfnCmdResolveImage2KHR = fn ( command_buffer: CommandBuffer, p_resolve_image_info: *const ResolveImageInfo2KHR, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetFragmentShadingRateKHR = fn ( command_buffer: CommandBuffer, p_fragment_size: *const Extent2D, combiner_ops: [2]FragmentShadingRateCombinerOpKHR, ) callconv(vulkan_call_conv) void; pub const PfnGetPhysicalDeviceFragmentShadingRatesKHR = fn ( physical_device: PhysicalDevice, p_fragment_shading_rate_count: *u32, p_fragment_shading_rates: ?[*]PhysicalDeviceFragmentShadingRateKHR, ) callconv(vulkan_call_conv) Result; pub const PfnCmdSetFragmentShadingRateEnumNV = fn ( command_buffer: CommandBuffer, shading_rate: FragmentShadingRateNV, combiner_ops: [2]FragmentShadingRateCombinerOpKHR, ) callconv(vulkan_call_conv) void; pub const PfnGetAccelerationStructureBuildSizesKHR = fn ( device: Device, build_type: AccelerationStructureBuildTypeKHR, p_build_info: *const AccelerationStructureBuildGeometryInfoKHR, p_max_primitive_counts: ?[*]const u32, p_size_info: *AccelerationStructureBuildSizesInfoKHR, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetVertexInputEXT = fn ( command_buffer: CommandBuffer, vertex_binding_description_count: u32, p_vertex_binding_descriptions: [*]const VertexInputBindingDescription2EXT, vertex_attribute_description_count: u32, p_vertex_attribute_descriptions: [*]const VertexInputAttributeDescription2EXT, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetColorWriteEnableEXT = fn ( command_buffer: CommandBuffer, attachment_count: u32, p_color_write_enables: [*]const Bool32, ) callconv(vulkan_call_conv) void; pub const PfnCmdSetEvent2KHR = fn ( command_buffer: CommandBuffer, event: Event, p_dependency_info: *const DependencyInfoKHR, ) callconv(vulkan_call_conv) void; pub const PfnCmdResetEvent2KHR = fn ( command_buffer: CommandBuffer, event: Event, stage_mask: PipelineStageFlags2KHR, ) callconv(vulkan_call_conv) void; pub const PfnCmdWaitEvents2KHR = fn ( command_buffer: CommandBuffer, event_count: u32, p_events: [*]const Event, p_dependency_infos: [*]const DependencyInfoKHR, ) callconv(vulkan_call_conv) void; pub const PfnCmdPipelineBarrier2KHR = fn ( command_buffer: CommandBuffer, p_dependency_info: *const DependencyInfoKHR, ) callconv(vulkan_call_conv) void; pub const PfnQueueSubmit2KHR = fn ( queue: Queue, submit_count: u32, p_submits: [*]const SubmitInfo2KHR, fence: Fence, ) callconv(vulkan_call_conv) Result; pub const PfnCmdWriteTimestamp2KHR = fn ( command_buffer: CommandBuffer, stage: PipelineStageFlags2KHR, query_pool: QueryPool, query: u32, ) callconv(vulkan_call_conv) void; pub const PfnCmdWriteBufferMarker2AMD = fn ( command_buffer: CommandBuffer, stage: PipelineStageFlags2KHR, dst_buffer: Buffer, dst_offset: DeviceSize, marker: u32, ) callconv(vulkan_call_conv) void; pub const PfnGetQueueCheckpointData2NV = fn ( queue: Queue, p_checkpoint_data_count: *u32, p_checkpoint_data: ?[*]CheckpointData2NV, ) callconv(vulkan_call_conv) void; pub const PfnGetPhysicalDeviceVideoCapabilitiesKHR = fn ( physical_device: PhysicalDevice, p_video_profile: *const VideoProfileKHR, p_capabilities: *VideoCapabilitiesKHR, ) callconv(vulkan_call_conv) Result; pub const PfnGetPhysicalDeviceVideoFormatPropertiesKHR = fn ( physical_device: PhysicalDevice, p_video_format_info: *const PhysicalDeviceVideoFormatInfoKHR, p_video_format_property_count: *u32, p_video_format_properties: ?[*]VideoFormatPropertiesKHR, ) callconv(vulkan_call_conv) Result; pub const PfnCreateVideoSessionKHR = fn ( device: Device, p_create_info: *const VideoSessionCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, p_video_session: *VideoSessionKHR, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyVideoSessionKHR = fn ( device: Device, video_session: VideoSessionKHR, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnCreateVideoSessionParametersKHR = fn ( device: Device, p_create_info: *const VideoSessionParametersCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, p_video_session_parameters: *VideoSessionParametersKHR, ) callconv(vulkan_call_conv) Result; pub const PfnUpdateVideoSessionParametersKHR = fn ( device: Device, video_session_parameters: VideoSessionParametersKHR, p_update_info: *const VideoSessionParametersUpdateInfoKHR, ) callconv(vulkan_call_conv) Result; pub const PfnDestroyVideoSessionParametersKHR = fn ( device: Device, video_session_parameters: VideoSessionParametersKHR, p_allocator: ?*const AllocationCallbacks, ) callconv(vulkan_call_conv) void; pub const PfnGetVideoSessionMemoryRequirementsKHR = fn ( device: Device, video_session: VideoSessionKHR, p_video_session_memory_requirements_count: *u32, p_video_session_memory_requirements: ?[*]VideoGetMemoryPropertiesKHR, ) callconv(vulkan_call_conv) Result; pub const PfnBindVideoSessionMemoryKHR = fn ( device: Device, video_session: VideoSessionKHR, video_session_bind_memory_count: u32, p_video_session_bind_memories: [*]const VideoBindMemoryKHR, ) callconv(vulkan_call_conv) Result; pub const PfnCmdDecodeVideoKHR = fn ( command_buffer: CommandBuffer, p_frame_info: *const VideoDecodeInfoKHR, ) callconv(vulkan_call_conv) void; pub const PfnCmdBeginVideoCodingKHR = fn ( command_buffer: CommandBuffer, p_begin_info: *const VideoBeginCodingInfoKHR, ) callconv(vulkan_call_conv) void; pub const PfnCmdControlVideoCodingKHR = fn ( command_buffer: CommandBuffer, p_coding_control_info: *const VideoCodingControlInfoKHR, ) callconv(vulkan_call_conv) void; pub const PfnCmdEndVideoCodingKHR = fn ( command_buffer: CommandBuffer, p_end_coding_info: *const VideoEndCodingInfoKHR, ) callconv(vulkan_call_conv) void; pub const PfnCmdEncodeVideoKHR = fn ( command_buffer: CommandBuffer, p_encode_info: *const VideoEncodeInfoKHR, ) callconv(vulkan_call_conv) void; pub const extension_info = struct { const Info = struct { name: [:0]const u8, version: u32, }; pub const khr_surface = Info{ .name = "VK_KHR_surface", .version = 25, }; pub const khr_swapchain = Info{ .name = "VK_KHR_swapchain", .version = 70, }; pub const khr_display = Info{ .name = "VK_KHR_display", .version = 23, }; pub const khr_display_swapchain = Info{ .name = "VK_KHR_display_swapchain", .version = 10, }; pub const khr_xlib_surface = Info{ .name = "VK_KHR_xlib_surface", .version = 6, }; pub const khr_xcb_surface = Info{ .name = "VK_KHR_xcb_surface", .version = 6, }; pub const khr_wayland_surface = Info{ .name = "VK_KHR_wayland_surface", .version = 6, }; pub const khr_android_surface = Info{ .name = "VK_KHR_android_surface", .version = 6, }; pub const khr_win_32_surface = Info{ .name = "VK_KHR_win32_surface", .version = 6, }; pub const ext_debug_report = Info{ .name = "VK_EXT_debug_report", .version = 10, }; pub const nv_glsl_shader = Info{ .name = "VK_NV_glsl_shader", .version = 1, }; pub const ext_depth_range_unrestricted = Info{ .name = "VK_EXT_depth_range_unrestricted", .version = 1, }; pub const khr_sampler_mirror_clamp_to_edge = Info{ .name = "VK_KHR_sampler_mirror_clamp_to_edge", .version = 3, }; pub const img_filter_cubic = Info{ .name = "VK_IMG_filter_cubic", .version = 1, }; pub const amd_rasterization_order = Info{ .name = "VK_AMD_rasterization_order", .version = 1, }; pub const amd_shader_trinary_minmax = Info{ .name = "VK_AMD_shader_trinary_minmax", .version = 1, }; pub const amd_shader_explicit_vertex_parameter = Info{ .name = "VK_AMD_shader_explicit_vertex_parameter", .version = 1, }; pub const ext_debug_marker = Info{ .name = "VK_EXT_debug_marker", .version = 4, }; pub const khr_video_queue = Info{ .name = "VK_KHR_video_queue", .version = 1, }; pub const khr_video_decode_queue = Info{ .name = "VK_KHR_video_decode_queue", .version = 1, }; pub const khr_video_encode_queue = Info{ .name = "VK_KHR_video_encode_queue", .version = 2, }; pub const amd_gcn_shader = Info{ .name = "VK_AMD_gcn_shader", .version = 1, }; pub const nv_dedicated_allocation = Info{ .name = "VK_NV_dedicated_allocation", .version = 1, }; pub const ext_transform_feedback = Info{ .name = "VK_EXT_transform_feedback", .version = 1, }; pub const nvx_image_view_handle = Info{ .name = "VK_NVX_image_view_handle", .version = 2, }; pub const amd_draw_indirect_count = Info{ .name = "VK_AMD_draw_indirect_count", .version = 2, }; pub const amd_negative_viewport_height = Info{ .name = "VK_AMD_negative_viewport_height", .version = 1, }; pub const amd_gpu_shader_half_float = Info{ .name = "VK_AMD_gpu_shader_half_float", .version = 2, }; pub const amd_shader_ballot = Info{ .name = "VK_AMD_shader_ballot", .version = 1, }; pub const ext_video_encode_h_264 = Info{ .name = "VK_EXT_video_encode_h264", .version = 1, }; pub const ext_video_decode_h_264 = Info{ .name = "VK_EXT_video_decode_h264", .version = 1, }; pub const amd_texture_gather_bias_lod = Info{ .name = "VK_AMD_texture_gather_bias_lod", .version = 1, }; pub const amd_shader_info = Info{ .name = "VK_AMD_shader_info", .version = 1, }; pub const amd_shader_image_load_store_lod = Info{ .name = "VK_AMD_shader_image_load_store_lod", .version = 1, }; pub const ggp_stream_descriptor_surface = Info{ .name = "VK_GGP_stream_descriptor_surface", .version = 1, }; pub const nv_corner_sampled_image = Info{ .name = "VK_NV_corner_sampled_image", .version = 2, }; pub const khr_multiview = Info{ .name = "VK_KHR_multiview", .version = 1, }; pub const img_format_pvrtc = Info{ .name = "VK_IMG_format_pvrtc", .version = 1, }; pub const nv_external_memory_capabilities = Info{ .name = "VK_NV_external_memory_capabilities", .version = 1, }; pub const nv_external_memory = Info{ .name = "VK_NV_external_memory", .version = 1, }; pub const nv_external_memory_win_32 = Info{ .name = "VK_NV_external_memory_win32", .version = 1, }; pub const nv_win_32_keyed_mutex = Info{ .name = "VK_NV_win32_keyed_mutex", .version = 2, }; pub const khr_get_physical_device_properties_2 = Info{ .name = "VK_KHR_get_physical_device_properties2", .version = 2, }; pub const khr_device_group = Info{ .name = "VK_KHR_device_group", .version = 4, }; pub const ext_validation_flags = Info{ .name = "VK_EXT_validation_flags", .version = 2, }; pub const nn_vi_surface = Info{ .name = "VK_NN_vi_surface", .version = 1, }; pub const khr_shader_draw_parameters = Info{ .name = "VK_KHR_shader_draw_parameters", .version = 1, }; pub const ext_shader_subgroup_ballot = Info{ .name = "VK_EXT_shader_subgroup_ballot", .version = 1, }; pub const ext_shader_subgroup_vote = Info{ .name = "VK_EXT_shader_subgroup_vote", .version = 1, }; pub const ext_texture_compression_astc_hdr = Info{ .name = "VK_EXT_texture_compression_astc_hdr", .version = 1, }; pub const ext_astc_decode_mode = Info{ .name = "VK_EXT_astc_decode_mode", .version = 1, }; pub const khr_maintenance_1 = Info{ .name = "VK_KHR_maintenance1", .version = 2, }; pub const khr_device_group_creation = Info{ .name = "VK_KHR_device_group_creation", .version = 1, }; pub const khr_external_memory_capabilities = Info{ .name = "VK_KHR_external_memory_capabilities", .version = 1, }; pub const khr_external_memory = Info{ .name = "VK_KHR_external_memory", .version = 1, }; pub const khr_external_memory_win_32 = Info{ .name = "VK_KHR_external_memory_win32", .version = 1, }; pub const khr_external_memory_fd = Info{ .name = "VK_KHR_external_memory_fd", .version = 1, }; pub const khr_win_32_keyed_mutex = Info{ .name = "VK_KHR_win32_keyed_mutex", .version = 1, }; pub const khr_external_semaphore_capabilities = Info{ .name = "VK_KHR_external_semaphore_capabilities", .version = 1, }; pub const khr_external_semaphore = Info{ .name = "VK_KHR_external_semaphore", .version = 1, }; pub const khr_external_semaphore_win_32 = Info{ .name = "VK_KHR_external_semaphore_win32", .version = 1, }; pub const khr_external_semaphore_fd = Info{ .name = "VK_KHR_external_semaphore_fd", .version = 1, }; pub const khr_push_descriptor = Info{ .name = "VK_KHR_push_descriptor", .version = 2, }; pub const ext_conditional_rendering = Info{ .name = "VK_EXT_conditional_rendering", .version = 2, }; pub const khr_shader_float_16_int_8 = Info{ .name = "VK_KHR_shader_float16_int8", .version = 1, }; pub const khr_1_6bit_storage = Info{ .name = "VK_KHR_16bit_storage", .version = 1, }; pub const khr_incremental_present = Info{ .name = "VK_KHR_incremental_present", .version = 2, }; pub const khr_descriptor_update_template = Info{ .name = "VK_KHR_descriptor_update_template", .version = 1, }; pub const nv_clip_space_w_scaling = Info{ .name = "VK_NV_clip_space_w_scaling", .version = 1, }; pub const ext_direct_mode_display = Info{ .name = "VK_EXT_direct_mode_display", .version = 1, }; pub const ext_acquire_xlib_display = Info{ .name = "VK_EXT_acquire_xlib_display", .version = 1, }; pub const ext_display_surface_counter = Info{ .name = "VK_EXT_display_surface_counter", .version = 1, }; pub const ext_display_control = Info{ .name = "VK_EXT_display_control", .version = 1, }; pub const google_display_timing = Info{ .name = "VK_GOOGLE_display_timing", .version = 1, }; pub const nv_sample_mask_override_coverage = Info{ .name = "VK_NV_sample_mask_override_coverage", .version = 1, }; pub const nv_geometry_shader_passthrough = Info{ .name = "VK_NV_geometry_shader_passthrough", .version = 1, }; pub const nv_viewport_array_2 = Info{ .name = "VK_NV_viewport_array2", .version = 1, }; pub const nvx_multiview_per_view_attributes = Info{ .name = "VK_NVX_multiview_per_view_attributes", .version = 1, }; pub const nv_viewport_swizzle = Info{ .name = "VK_NV_viewport_swizzle", .version = 1, }; pub const ext_discard_rectangles = Info{ .name = "VK_EXT_discard_rectangles", .version = 1, }; pub const ext_conservative_rasterization = Info{ .name = "VK_EXT_conservative_rasterization", .version = 1, }; pub const ext_depth_clip_enable = Info{ .name = "VK_EXT_depth_clip_enable", .version = 1, }; pub const ext_swapchain_colorspace = Info{ .name = "VK_EXT_swapchain_colorspace", .version = 4, }; pub const ext_hdr_metadata = Info{ .name = "VK_EXT_hdr_metadata", .version = 2, }; pub const khr_imageless_framebuffer = Info{ .name = "VK_KHR_imageless_framebuffer", .version = 1, }; pub const khr_create_renderpass_2 = Info{ .name = "VK_KHR_create_renderpass2", .version = 1, }; pub const khr_shared_presentable_image = Info{ .name = "VK_KHR_shared_presentable_image", .version = 1, }; pub const khr_external_fence_capabilities = Info{ .name = "VK_KHR_external_fence_capabilities", .version = 1, }; pub const khr_external_fence = Info{ .name = "VK_KHR_external_fence", .version = 1, }; pub const khr_external_fence_win_32 = Info{ .name = "VK_KHR_external_fence_win32", .version = 1, }; pub const khr_external_fence_fd = Info{ .name = "VK_KHR_external_fence_fd", .version = 1, }; pub const khr_performance_query = Info{ .name = "VK_KHR_performance_query", .version = 1, }; pub const khr_maintenance_2 = Info{ .name = "VK_KHR_maintenance2", .version = 1, }; pub const khr_get_surface_capabilities_2 = Info{ .name = "VK_KHR_get_surface_capabilities2", .version = 1, }; pub const khr_variable_pointers = Info{ .name = "VK_KHR_variable_pointers", .version = 1, }; pub const khr_get_display_properties_2 = Info{ .name = "VK_KHR_get_display_properties2", .version = 1, }; pub const mvk_ios_surface = Info{ .name = "VK_MVK_ios_surface", .version = 3, }; pub const mvk_macos_surface = Info{ .name = "VK_MVK_macos_surface", .version = 3, }; pub const ext_external_memory_dma_buf = Info{ .name = "VK_EXT_external_memory_dma_buf", .version = 1, }; pub const ext_queue_family_foreign = Info{ .name = "VK_EXT_queue_family_foreign", .version = 1, }; pub const khr_dedicated_allocation = Info{ .name = "VK_KHR_dedicated_allocation", .version = 3, }; pub const ext_debug_utils = Info{ .name = "VK_EXT_debug_utils", .version = 2, }; pub const android_external_memory_android_hardware_buffer = Info{ .name = "VK_ANDROID_external_memory_android_hardware_buffer", .version = 3, }; pub const ext_sampler_filter_minmax = Info{ .name = "VK_EXT_sampler_filter_minmax", .version = 2, }; pub const khr_storage_buffer_storage_class = Info{ .name = "VK_KHR_storage_buffer_storage_class", .version = 1, }; pub const amd_gpu_shader_int_16 = Info{ .name = "VK_AMD_gpu_shader_int16", .version = 2, }; pub const amd_mixed_attachment_samples = Info{ .name = "VK_AMD_mixed_attachment_samples", .version = 1, }; pub const amd_shader_fragment_mask = Info{ .name = "VK_AMD_shader_fragment_mask", .version = 1, }; pub const ext_inline_uniform_block = Info{ .name = "VK_EXT_inline_uniform_block", .version = 1, }; pub const ext_shader_stencil_export = Info{ .name = "VK_EXT_shader_stencil_export", .version = 1, }; pub const ext_sample_locations = Info{ .name = "VK_EXT_sample_locations", .version = 1, }; pub const khr_relaxed_block_layout = Info{ .name = "VK_KHR_relaxed_block_layout", .version = 1, }; pub const khr_get_memory_requirements_2 = Info{ .name = "VK_KHR_get_memory_requirements2", .version = 1, }; pub const khr_image_format_list = Info{ .name = "VK_KHR_image_format_list", .version = 1, }; pub const ext_blend_operation_advanced = Info{ .name = "VK_EXT_blend_operation_advanced", .version = 2, }; pub const nv_fragment_coverage_to_color = Info{ .name = "VK_NV_fragment_coverage_to_color", .version = 1, }; pub const khr_acceleration_structure = Info{ .name = "VK_KHR_acceleration_structure", .version = 11, }; pub const khr_ray_tracing_pipeline = Info{ .name = "VK_KHR_ray_tracing_pipeline", .version = 1, }; pub const khr_ray_query = Info{ .name = "VK_KHR_ray_query", .version = 1, }; pub const nv_framebuffer_mixed_samples = Info{ .name = "VK_NV_framebuffer_mixed_samples", .version = 1, }; pub const nv_fill_rectangle = Info{ .name = "VK_NV_fill_rectangle", .version = 1, }; pub const nv_shader_sm_builtins = Info{ .name = "VK_NV_shader_sm_builtins", .version = 1, }; pub const ext_post_depth_coverage = Info{ .name = "VK_EXT_post_depth_coverage", .version = 1, }; pub const khr_sampler_ycbcr_conversion = Info{ .name = "VK_KHR_sampler_ycbcr_conversion", .version = 14, }; pub const khr_bind_memory_2 = Info{ .name = "VK_KHR_bind_memory2", .version = 1, }; pub const ext_image_drm_format_modifier = Info{ .name = "VK_EXT_image_drm_format_modifier", .version = 1, }; pub const ext_validation_cache = Info{ .name = "VK_EXT_validation_cache", .version = 1, }; pub const ext_descriptor_indexing = Info{ .name = "VK_EXT_descriptor_indexing", .version = 2, }; pub const ext_shader_viewport_index_layer = Info{ .name = "VK_EXT_shader_viewport_index_layer", .version = 1, }; pub const khr_portability_subset = Info{ .name = "VK_KHR_portability_subset", .version = 1, }; pub const nv_shading_rate_image = Info{ .name = "VK_NV_shading_rate_image", .version = 3, }; pub const nv_ray_tracing = Info{ .name = "VK_NV_ray_tracing", .version = 3, }; pub const nv_representative_fragment_test = Info{ .name = "VK_NV_representative_fragment_test", .version = 2, }; pub const khr_maintenance_3 = Info{ .name = "VK_KHR_maintenance3", .version = 1, }; pub const khr_draw_indirect_count = Info{ .name = "VK_KHR_draw_indirect_count", .version = 1, }; pub const ext_filter_cubic = Info{ .name = "VK_EXT_filter_cubic", .version = 3, }; pub const qcom_render_pass_shader_resolve = Info{ .name = "VK_QCOM_render_pass_shader_resolve", .version = 4, }; pub const ext_global_priority = Info{ .name = "VK_EXT_global_priority", .version = 2, }; pub const khr_shader_subgroup_extended_types = Info{ .name = "VK_KHR_shader_subgroup_extended_types", .version = 1, }; pub const khr_8bit_storage = Info{ .name = "VK_KHR_8bit_storage", .version = 1, }; pub const ext_external_memory_host = Info{ .name = "VK_EXT_external_memory_host", .version = 1, }; pub const amd_buffer_marker = Info{ .name = "VK_AMD_buffer_marker", .version = 1, }; pub const khr_shader_atomic_int_64 = Info{ .name = "VK_KHR_shader_atomic_int64", .version = 1, }; pub const khr_shader_clock = Info{ .name = "VK_KHR_shader_clock", .version = 1, }; pub const amd_pipeline_compiler_control = Info{ .name = "VK_AMD_pipeline_compiler_control", .version = 1, }; pub const ext_calibrated_timestamps = Info{ .name = "VK_EXT_calibrated_timestamps", .version = 2, }; pub const amd_shader_core_properties = Info{ .name = "VK_AMD_shader_core_properties", .version = 2, }; pub const ext_video_decode_h_265 = Info{ .name = "VK_EXT_video_decode_h265", .version = 1, }; pub const amd_memory_overallocation_behavior = Info{ .name = "VK_AMD_memory_overallocation_behavior", .version = 1, }; pub const ext_vertex_attribute_divisor = Info{ .name = "VK_EXT_vertex_attribute_divisor", .version = 3, }; pub const ggp_frame_token = Info{ .name = "VK_GGP_frame_token", .version = 1, }; pub const ext_pipeline_creation_feedback = Info{ .name = "VK_EXT_pipeline_creation_feedback", .version = 1, }; pub const khr_driver_properties = Info{ .name = "VK_KHR_driver_properties", .version = 1, }; pub const khr_shader_float_controls = Info{ .name = "VK_KHR_shader_float_controls", .version = 4, }; pub const nv_shader_subgroup_partitioned = Info{ .name = "VK_NV_shader_subgroup_partitioned", .version = 1, }; pub const khr_depth_stencil_resolve = Info{ .name = "VK_KHR_depth_stencil_resolve", .version = 1, }; pub const khr_swapchain_mutable_format = Info{ .name = "VK_KHR_swapchain_mutable_format", .version = 1, }; pub const nv_compute_shader_derivatives = Info{ .name = "VK_NV_compute_shader_derivatives", .version = 1, }; pub const nv_mesh_shader = Info{ .name = "VK_NV_mesh_shader", .version = 1, }; pub const nv_fragment_shader_barycentric = Info{ .name = "VK_NV_fragment_shader_barycentric", .version = 1, }; pub const nv_shader_image_footprint = Info{ .name = "VK_NV_shader_image_footprint", .version = 2, }; pub const nv_scissor_exclusive = Info{ .name = "VK_NV_scissor_exclusive", .version = 1, }; pub const nv_device_diagnostic_checkpoints = Info{ .name = "VK_NV_device_diagnostic_checkpoints", .version = 2, }; pub const khr_timeline_semaphore = Info{ .name = "VK_KHR_timeline_semaphore", .version = 2, }; pub const intel_shader_integer_functions_2 = Info{ .name = "VK_INTEL_shader_integer_functions2", .version = 1, }; pub const intel_performance_query = Info{ .name = "VK_INTEL_performance_query", .version = 2, }; pub const khr_vulkan_memory_model = Info{ .name = "VK_KHR_vulkan_memory_model", .version = 3, }; pub const ext_pci_bus_info = Info{ .name = "VK_EXT_pci_bus_info", .version = 2, }; pub const amd_display_native_hdr = Info{ .name = "VK_AMD_display_native_hdr", .version = 1, }; pub const fuchsia_imagepipe_surface = Info{ .name = "VK_FUCHSIA_imagepipe_surface", .version = 1, }; pub const khr_shader_terminate_invocation = Info{ .name = "VK_KHR_shader_terminate_invocation", .version = 1, }; pub const ext_metal_surface = Info{ .name = "VK_EXT_metal_surface", .version = 1, }; pub const ext_fragment_density_map = Info{ .name = "VK_EXT_fragment_density_map", .version = 1, }; pub const ext_scalar_block_layout = Info{ .name = "VK_EXT_scalar_block_layout", .version = 1, }; pub const google_hlsl_functionality_1 = Info{ .name = "VK_GOOGLE_hlsl_functionality1", .version = 1, }; pub const google_decorate_string = Info{ .name = "VK_GOOGLE_decorate_string", .version = 1, }; pub const ext_subgroup_size_control = Info{ .name = "VK_EXT_subgroup_size_control", .version = 2, }; pub const khr_fragment_shading_rate = Info{ .name = "VK_KHR_fragment_shading_rate", .version = 1, }; pub const amd_shader_core_properties_2 = Info{ .name = "VK_AMD_shader_core_properties2", .version = 1, }; pub const amd_device_coherent_memory = Info{ .name = "VK_AMD_device_coherent_memory", .version = 1, }; pub const ext_shader_image_atomic_int_64 = Info{ .name = "VK_EXT_shader_image_atomic_int64", .version = 1, }; pub const khr_spirv_1_4 = Info{ .name = "VK_KHR_spirv_1_4", .version = 1, }; pub const ext_memory_budget = Info{ .name = "VK_EXT_memory_budget", .version = 1, }; pub const ext_memory_priority = Info{ .name = "VK_EXT_memory_priority", .version = 1, }; pub const khr_surface_protected_capabilities = Info{ .name = "VK_KHR_surface_protected_capabilities", .version = 1, }; pub const nv_dedicated_allocation_image_aliasing = Info{ .name = "VK_NV_dedicated_allocation_image_aliasing", .version = 1, }; pub const khr_separate_depth_stencil_layouts = Info{ .name = "VK_KHR_separate_depth_stencil_layouts", .version = 1, }; pub const ext_buffer_device_address = Info{ .name = "VK_EXT_buffer_device_address", .version = 2, }; pub const ext_tooling_info = Info{ .name = "VK_EXT_tooling_info", .version = 1, }; pub const ext_separate_stencil_usage = Info{ .name = "VK_EXT_separate_stencil_usage", .version = 1, }; pub const ext_validation_features = Info{ .name = "VK_EXT_validation_features", .version = 4, }; pub const nv_cooperative_matrix = Info{ .name = "VK_NV_cooperative_matrix", .version = 1, }; pub const nv_coverage_reduction_mode = Info{ .name = "VK_NV_coverage_reduction_mode", .version = 1, }; pub const ext_fragment_shader_interlock = Info{ .name = "VK_EXT_fragment_shader_interlock", .version = 1, }; pub const ext_ycbcr_image_arrays = Info{ .name = "VK_EXT_ycbcr_image_arrays", .version = 1, }; pub const khr_uniform_buffer_standard_layout = Info{ .name = "VK_KHR_uniform_buffer_standard_layout", .version = 1, }; pub const ext_provoking_vertex = Info{ .name = "VK_EXT_provoking_vertex", .version = 1, }; pub const ext_full_screen_exclusive = Info{ .name = "VK_EXT_full_screen_exclusive", .version = 4, }; pub const ext_headless_surface = Info{ .name = "VK_EXT_headless_surface", .version = 1, }; pub const khr_buffer_device_address = Info{ .name = "VK_KHR_buffer_device_address", .version = 1, }; pub const ext_line_rasterization = Info{ .name = "VK_EXT_line_rasterization", .version = 1, }; pub const ext_shader_atomic_float = Info{ .name = "VK_EXT_shader_atomic_float", .version = 1, }; pub const ext_host_query_reset = Info{ .name = "VK_EXT_host_query_reset", .version = 1, }; pub const ext_index_type_uint_8 = Info{ .name = "VK_EXT_index_type_uint8", .version = 1, }; pub const ext_extended_dynamic_state = Info{ .name = "VK_EXT_extended_dynamic_state", .version = 1, }; pub const khr_deferred_host_operations = Info{ .name = "VK_KHR_deferred_host_operations", .version = 4, }; pub const khr_pipeline_executable_properties = Info{ .name = "VK_KHR_pipeline_executable_properties", .version = 1, }; pub const ext_shader_demote_to_helper_invocation = Info{ .name = "VK_EXT_shader_demote_to_helper_invocation", .version = 1, }; pub const nv_device_generated_commands = Info{ .name = "VK_NV_device_generated_commands", .version = 3, }; pub const nv_inherited_viewport_scissor = Info{ .name = "VK_NV_inherited_viewport_scissor", .version = 1, }; pub const ext_texel_buffer_alignment = Info{ .name = "VK_EXT_texel_buffer_alignment", .version = 1, }; pub const qcom_render_pass_transform = Info{ .name = "VK_QCOM_render_pass_transform", .version = 2, }; pub const ext_device_memory_report = Info{ .name = "VK_EXT_device_memory_report", .version = 2, }; pub const ext_robustness_2 = Info{ .name = "VK_EXT_robustness2", .version = 1, }; pub const ext_custom_border_color = Info{ .name = "VK_EXT_custom_border_color", .version = 12, }; pub const google_user_type = Info{ .name = "VK_GOOGLE_user_type", .version = 1, }; pub const khr_pipeline_library = Info{ .name = "VK_KHR_pipeline_library", .version = 1, }; pub const khr_shader_non_semantic_info = Info{ .name = "VK_KHR_shader_non_semantic_info", .version = 1, }; pub const ext_private_data = Info{ .name = "VK_EXT_private_data", .version = 1, }; pub const ext_pipeline_creation_cache_control = Info{ .name = "VK_EXT_pipeline_creation_cache_control", .version = 3, }; pub const nv_device_diagnostics_config = Info{ .name = "VK_NV_device_diagnostics_config", .version = 1, }; pub const qcom_render_pass_store_ops = Info{ .name = "VK_QCOM_render_pass_store_ops", .version = 2, }; pub const khr_synchronization_2 = Info{ .name = "VK_KHR_synchronization2", .version = 1, }; pub const khr_zero_initialize_workgroup_memory = Info{ .name = "VK_KHR_zero_initialize_workgroup_memory", .version = 1, }; pub const nv_fragment_shading_rate_enums = Info{ .name = "VK_NV_fragment_shading_rate_enums", .version = 1, }; pub const ext_ycbcr_2plane_444_formats = Info{ .name = "VK_EXT_ycbcr_2plane_444_formats", .version = 1, }; pub const ext_fragment_density_map_2 = Info{ .name = "VK_EXT_fragment_density_map2", .version = 1, }; pub const qcom_rotated_copy_commands = Info{ .name = "VK_QCOM_rotated_copy_commands", .version = 1, }; pub const ext_image_robustness = Info{ .name = "VK_EXT_image_robustness", .version = 1, }; pub const khr_workgroup_memory_explicit_layout = Info{ .name = "VK_KHR_workgroup_memory_explicit_layout", .version = 1, }; pub const khr_copy_commands_2 = Info{ .name = "VK_KHR_copy_commands2", .version = 1, }; pub const ext_4444_formats = Info{ .name = "VK_EXT_4444_formats", .version = 1, }; pub const nv_acquire_winrt_display = Info{ .name = "VK_NV_acquire_winrt_display", .version = 1, }; pub const ext_directfb_surface = Info{ .name = "VK_EXT_directfb_surface", .version = 1, }; pub const valve_mutable_descriptor_type = Info{ .name = "VK_VALVE_mutable_descriptor_type", .version = 1, }; pub const ext_vertex_input_dynamic_state = Info{ .name = "VK_EXT_vertex_input_dynamic_state", .version = 2, }; pub const fuchsia_external_memory = Info{ .name = "VK_FUCHSIA_external_memory", .version = 1, }; pub const fuchsia_external_semaphore = Info{ .name = "VK_FUCHSIA_external_semaphore", .version = 1, }; pub const ext_extended_dynamic_state_2 = Info{ .name = "VK_EXT_extended_dynamic_state2", .version = 1, }; pub const qnx_screen_surface = Info{ .name = "VK_QNX_screen_surface", .version = 1, }; pub const ext_color_write_enable = Info{ .name = "VK_EXT_color_write_enable", .version = 1, }; }; pub fn BaseWrapper(comptime Self: type) type { return struct { pub fn load(loader: anytype) !Self { var self: Self = undefined; inline for (std.meta.fields(Self)) |field| { const name = @ptrCast([*:0]const u8, field.name ++ "\x00"); const cmd_ptr = loader(.null_handle, name) orelse return error.InvalidCommand; @field(self, field.name) = @ptrCast(field.field_type, cmd_ptr); } return self; } pub fn createInstance( self: Self, create_info: InstanceCreateInfo, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, InitializationFailed, LayerNotPresent, ExtensionNotPresent, IncompatibleDriver, Unknown, }!Instance { var instance: Instance = undefined; const result = self.vkCreateInstance( &create_info, p_allocator, &instance, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_initialization_failed => return error.InitializationFailed, .error_layer_not_present => return error.LayerNotPresent, .error_extension_not_present => return error.ExtensionNotPresent, .error_incompatible_driver => return error.IncompatibleDriver, else => return error.Unknown, } return instance; } pub fn getInstanceProcAddr( self: Self, instance: Instance, p_name: [*:0]const u8, ) PfnVoidFunction { return self.vkGetInstanceProcAddr( instance, p_name, ); } pub fn enumerateInstanceVersion( self: Self, ) error{ OutOfHostMemory, Unknown, }!u32 { var api_version: u32 = undefined; const result = self.vkEnumerateInstanceVersion( &api_version, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } return api_version; } pub fn enumerateInstanceLayerProperties( self: Self, p_property_count: *u32, p_properties: ?[*]LayerProperties, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Result { const result = self.vkEnumerateInstanceLayerProperties( p_property_count, p_properties, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return result; } pub fn enumerateInstanceExtensionProperties( self: Self, p_layer_name: ?[*:0]const u8, p_property_count: *u32, p_properties: ?[*]ExtensionProperties, ) error{ OutOfHostMemory, OutOfDeviceMemory, LayerNotPresent, Unknown, }!Result { const result = self.vkEnumerateInstanceExtensionProperties( p_layer_name, p_property_count, p_properties, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_layer_not_present => return error.LayerNotPresent, else => return error.Unknown, } return result; } }; } pub fn InstanceWrapper(comptime Self: type) type { return struct { pub fn load(instance: Instance, loader: anytype) !Self { var self: Self = undefined; inline for (std.meta.fields(Self)) |field| { const name = @ptrCast([*:0]const u8, field.name ++ "\x00"); const cmd_ptr = loader(instance, name) orelse return error.InvalidCommand; @field(self, field.name) = @ptrCast(field.field_type, cmd_ptr); } return self; } pub fn destroyInstance( self: Self, instance: Instance, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyInstance( instance, p_allocator, ); } pub fn enumeratePhysicalDevices( self: Self, instance: Instance, p_physical_device_count: *u32, p_physical_devices: ?[*]PhysicalDevice, ) error{ OutOfHostMemory, OutOfDeviceMemory, InitializationFailed, Unknown, }!Result { const result = self.vkEnumeratePhysicalDevices( instance, p_physical_device_count, p_physical_devices, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_initialization_failed => return error.InitializationFailed, else => return error.Unknown, } return result; } pub fn getDeviceProcAddr( self: Self, device: Device, p_name: [*:0]const u8, ) PfnVoidFunction { return self.vkGetDeviceProcAddr( device, p_name, ); } pub fn getPhysicalDeviceProperties( self: Self, physical_device: PhysicalDevice, ) PhysicalDeviceProperties { var properties: PhysicalDeviceProperties = undefined; self.vkGetPhysicalDeviceProperties( physical_device, &properties, ); return properties; } pub fn getPhysicalDeviceQueueFamilyProperties( self: Self, physical_device: PhysicalDevice, p_queue_family_property_count: *u32, p_queue_family_properties: ?[*]QueueFamilyProperties, ) void { self.vkGetPhysicalDeviceQueueFamilyProperties( physical_device, p_queue_family_property_count, p_queue_family_properties, ); } pub fn getPhysicalDeviceMemoryProperties( self: Self, physical_device: PhysicalDevice, ) PhysicalDeviceMemoryProperties { var memory_properties: PhysicalDeviceMemoryProperties = undefined; self.vkGetPhysicalDeviceMemoryProperties( physical_device, &memory_properties, ); return memory_properties; } pub fn getPhysicalDeviceFeatures( self: Self, physical_device: PhysicalDevice, ) PhysicalDeviceFeatures { var features: PhysicalDeviceFeatures = undefined; self.vkGetPhysicalDeviceFeatures( physical_device, &features, ); return features; } pub fn getPhysicalDeviceFormatProperties( self: Self, physical_device: PhysicalDevice, format: Format, ) FormatProperties { var format_properties: FormatProperties = undefined; self.vkGetPhysicalDeviceFormatProperties( physical_device, format, &format_properties, ); return format_properties; } pub fn getPhysicalDeviceImageFormatProperties( self: Self, physical_device: PhysicalDevice, format: Format, @"type": ImageType, tiling: ImageTiling, usage: ImageUsageFlags, flags: ImageCreateFlags, ) error{ OutOfHostMemory, OutOfDeviceMemory, FormatNotSupported, Unknown, }!ImageFormatProperties { _ = @"type"; var image_format_properties: ImageFormatProperties = undefined; const result = self.vkGetPhysicalDeviceImageFormatProperties( physical_device, format, type, tiling, usage.toInt(), flags.toInt(), &image_format_properties, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_format_not_supported => return error.FormatNotSupported, else => return error.Unknown, } return image_format_properties; } pub fn createDevice( self: Self, physical_device: PhysicalDevice, create_info: DeviceCreateInfo, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, InitializationFailed, ExtensionNotPresent, FeatureNotPresent, TooManyObjects, DeviceLost, Unknown, }!Device { var device: Device = undefined; const result = self.vkCreateDevice( physical_device, &create_info, p_allocator, &device, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_initialization_failed => return error.InitializationFailed, .error_extension_not_present => return error.ExtensionNotPresent, .error_feature_not_present => return error.FeatureNotPresent, .error_too_many_objects => return error.TooManyObjects, .error_device_lost => return error.DeviceLost, else => return error.Unknown, } return device; } pub fn enumerateDeviceLayerProperties( self: Self, physical_device: PhysicalDevice, p_property_count: *u32, p_properties: ?[*]LayerProperties, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Result { const result = self.vkEnumerateDeviceLayerProperties( physical_device, p_property_count, p_properties, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return result; } pub fn enumerateDeviceExtensionProperties( self: Self, physical_device: PhysicalDevice, p_layer_name: ?[*:0]const u8, p_property_count: *u32, p_properties: ?[*]ExtensionProperties, ) error{ OutOfHostMemory, OutOfDeviceMemory, LayerNotPresent, Unknown, }!Result { const result = self.vkEnumerateDeviceExtensionProperties( physical_device, p_layer_name, p_property_count, p_properties, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_layer_not_present => return error.LayerNotPresent, else => return error.Unknown, } return result; } pub fn getPhysicalDeviceSparseImageFormatProperties( self: Self, physical_device: PhysicalDevice, format: Format, @"type": ImageType, samples: SampleCountFlags, usage: ImageUsageFlags, tiling: ImageTiling, p_property_count: *u32, p_properties: ?[*]SparseImageFormatProperties, ) void { _ = @"type"; self.vkGetPhysicalDeviceSparseImageFormatProperties( physical_device, format, type, samples.toInt(), usage.toInt(), tiling, p_property_count, p_properties, ); } pub fn createAndroidSurfaceKHR( self: Self, instance: Instance, create_info: AndroidSurfaceCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, NativeWindowInUseKHR, Unknown, }!SurfaceKHR { var surface: SurfaceKHR = undefined; const result = self.vkCreateAndroidSurfaceKHR( instance, &create_info, p_allocator, &surface, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_native_window_in_use_khr => return error.NativeWindowInUseKHR, else => return error.Unknown, } return surface; } pub fn getPhysicalDeviceDisplayPropertiesKHR( self: Self, physical_device: PhysicalDevice, p_property_count: *u32, p_properties: ?[*]DisplayPropertiesKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Result { const result = self.vkGetPhysicalDeviceDisplayPropertiesKHR( physical_device, p_property_count, p_properties, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return result; } pub fn getPhysicalDeviceDisplayPlanePropertiesKHR( self: Self, physical_device: PhysicalDevice, p_property_count: *u32, p_properties: ?[*]DisplayPlanePropertiesKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Result { const result = self.vkGetPhysicalDeviceDisplayPlanePropertiesKHR( physical_device, p_property_count, p_properties, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return result; } pub fn getDisplayPlaneSupportedDisplaysKHR( self: Self, physical_device: PhysicalDevice, plane_index: u32, p_display_count: *u32, p_displays: ?[*]DisplayKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Result { const result = self.vkGetDisplayPlaneSupportedDisplaysKHR( physical_device, plane_index, p_display_count, p_displays, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return result; } pub fn getDisplayModePropertiesKHR( self: Self, physical_device: PhysicalDevice, display: DisplayKHR, p_property_count: *u32, p_properties: ?[*]DisplayModePropertiesKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Result { const result = self.vkGetDisplayModePropertiesKHR( physical_device, display, p_property_count, p_properties, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return result; } pub fn createDisplayModeKHR( self: Self, physical_device: PhysicalDevice, display: DisplayKHR, create_info: DisplayModeCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, InitializationFailed, Unknown, }!DisplayModeKHR { var mode: DisplayModeKHR = undefined; const result = self.vkCreateDisplayModeKHR( physical_device, display, &create_info, p_allocator, &mode, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_initialization_failed => return error.InitializationFailed, else => return error.Unknown, } return mode; } pub fn getDisplayPlaneCapabilitiesKHR( self: Self, physical_device: PhysicalDevice, mode: DisplayModeKHR, plane_index: u32, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!DisplayPlaneCapabilitiesKHR { var capabilities: DisplayPlaneCapabilitiesKHR = undefined; const result = self.vkGetDisplayPlaneCapabilitiesKHR( physical_device, mode, plane_index, &capabilities, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return capabilities; } pub fn createDisplayPlaneSurfaceKHR( self: Self, instance: Instance, create_info: DisplaySurfaceCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!SurfaceKHR { var surface: SurfaceKHR = undefined; const result = self.vkCreateDisplayPlaneSurfaceKHR( instance, &create_info, p_allocator, &surface, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return surface; } pub fn destroySurfaceKHR( self: Self, instance: Instance, surface: SurfaceKHR, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroySurfaceKHR( instance, surface, p_allocator, ); } pub fn getPhysicalDeviceSurfaceSupportKHR( self: Self, physical_device: PhysicalDevice, queue_family_index: u32, surface: SurfaceKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, SurfaceLostKHR, Unknown, }!Bool32 { var supported: Bool32 = undefined; const result = self.vkGetPhysicalDeviceSurfaceSupportKHR( physical_device, queue_family_index, surface, &supported, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_surface_lost_khr => return error.SurfaceLostKHR, else => return error.Unknown, } return supported; } pub fn getPhysicalDeviceSurfaceCapabilitiesKHR( self: Self, physical_device: PhysicalDevice, surface: SurfaceKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, SurfaceLostKHR, Unknown, }!SurfaceCapabilitiesKHR { var surface_capabilities: SurfaceCapabilitiesKHR = undefined; const result = self.vkGetPhysicalDeviceSurfaceCapabilitiesKHR( physical_device, surface, &surface_capabilities, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_surface_lost_khr => return error.SurfaceLostKHR, else => return error.Unknown, } return surface_capabilities; } pub fn getPhysicalDeviceSurfaceFormatsKHR( self: Self, physical_device: PhysicalDevice, surface: SurfaceKHR, p_surface_format_count: *u32, p_surface_formats: ?[*]SurfaceFormatKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, SurfaceLostKHR, Unknown, }!Result { const result = self.vkGetPhysicalDeviceSurfaceFormatsKHR( physical_device, surface, p_surface_format_count, p_surface_formats, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_surface_lost_khr => return error.SurfaceLostKHR, else => return error.Unknown, } return result; } pub fn getPhysicalDeviceSurfacePresentModesKHR( self: Self, physical_device: PhysicalDevice, surface: SurfaceKHR, p_present_mode_count: *u32, p_present_modes: ?[*]PresentModeKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, SurfaceLostKHR, Unknown, }!Result { const result = self.vkGetPhysicalDeviceSurfacePresentModesKHR( physical_device, surface, p_present_mode_count, p_present_modes, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_surface_lost_khr => return error.SurfaceLostKHR, else => return error.Unknown, } return result; } pub fn createViSurfaceNN( self: Self, instance: Instance, create_info: ViSurfaceCreateInfoNN, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, NativeWindowInUseKHR, Unknown, }!SurfaceKHR { var surface: SurfaceKHR = undefined; const result = self.vkCreateViSurfaceNN( instance, &create_info, p_allocator, &surface, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_native_window_in_use_khr => return error.NativeWindowInUseKHR, else => return error.Unknown, } return surface; } pub fn createWaylandSurfaceKHR( self: Self, instance: Instance, create_info: WaylandSurfaceCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!SurfaceKHR { var surface: SurfaceKHR = undefined; const result = self.vkCreateWaylandSurfaceKHR( instance, &create_info, p_allocator, &surface, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return surface; } pub fn getPhysicalDeviceWaylandPresentationSupportKHR( self: Self, physical_device: PhysicalDevice, queue_family_index: u32, display: *wl_display, ) Bool32 { return self.vkGetPhysicalDeviceWaylandPresentationSupportKHR( physical_device, queue_family_index, display, ); } pub fn createWin32SurfaceKHR( self: Self, instance: Instance, create_info: Win32SurfaceCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!SurfaceKHR { var surface: SurfaceKHR = undefined; const result = self.vkCreateWin32SurfaceKHR( instance, &create_info, p_allocator, &surface, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return surface; } pub fn getPhysicalDeviceWin32PresentationSupportKHR( self: Self, physical_device: PhysicalDevice, queue_family_index: u32, ) Bool32 { return self.vkGetPhysicalDeviceWin32PresentationSupportKHR( physical_device, queue_family_index, ); } pub fn createXlibSurfaceKHR( self: Self, instance: Instance, create_info: XlibSurfaceCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!SurfaceKHR { var surface: SurfaceKHR = undefined; const result = self.vkCreateXlibSurfaceKHR( instance, &create_info, p_allocator, &surface, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return surface; } pub fn getPhysicalDeviceXlibPresentationSupportKHR( self: Self, physical_device: PhysicalDevice, queue_family_index: u32, dpy: *Display, visual_id: VisualID, ) Bool32 { return self.vkGetPhysicalDeviceXlibPresentationSupportKHR( physical_device, queue_family_index, dpy, visual_id, ); } pub fn createXcbSurfaceKHR( self: Self, instance: Instance, create_info: XcbSurfaceCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!SurfaceKHR { var surface: SurfaceKHR = undefined; const result = self.vkCreateXcbSurfaceKHR( instance, &create_info, p_allocator, &surface, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return surface; } pub fn getPhysicalDeviceXcbPresentationSupportKHR( self: Self, physical_device: PhysicalDevice, queue_family_index: u32, connection: *xcb_connection_t, visual_id: xcb_visualid_t, ) Bool32 { return self.vkGetPhysicalDeviceXcbPresentationSupportKHR( physical_device, queue_family_index, connection, visual_id, ); } pub fn createDirectFbSurfaceEXT( self: Self, instance: Instance, create_info: DirectFBSurfaceCreateInfoEXT, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!SurfaceKHR { var surface: SurfaceKHR = undefined; const result = self.vkCreateDirectFBSurfaceEXT( instance, &create_info, p_allocator, &surface, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return surface; } pub fn getPhysicalDeviceDirectFbPresentationSupportEXT( self: Self, physical_device: PhysicalDevice, queue_family_index: u32, dfb: *IDirectFB, ) Bool32 { return self.vkGetPhysicalDeviceDirectFBPresentationSupportEXT( physical_device, queue_family_index, dfb, ); } pub fn createImagePipeSurfaceFUCHSIA( self: Self, instance: Instance, create_info: ImagePipeSurfaceCreateInfoFUCHSIA, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!SurfaceKHR { var surface: SurfaceKHR = undefined; const result = self.vkCreateImagePipeSurfaceFUCHSIA( instance, &create_info, p_allocator, &surface, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return surface; } pub fn createStreamDescriptorSurfaceGGP( self: Self, instance: Instance, create_info: StreamDescriptorSurfaceCreateInfoGGP, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, NativeWindowInUseKHR, Unknown, }!SurfaceKHR { var surface: SurfaceKHR = undefined; const result = self.vkCreateStreamDescriptorSurfaceGGP( instance, &create_info, p_allocator, &surface, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_native_window_in_use_khr => return error.NativeWindowInUseKHR, else => return error.Unknown, } return surface; } pub fn createScreenSurfaceQNX( self: Self, instance: Instance, create_info: ScreenSurfaceCreateInfoQNX, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!SurfaceKHR { var surface: SurfaceKHR = undefined; const result = self.vkCreateScreenSurfaceQNX( instance, &create_info, p_allocator, &surface, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return surface; } pub fn getPhysicalDeviceScreenPresentationSupportQNX( self: Self, physical_device: PhysicalDevice, queue_family_index: u32, window: *_screen_window, ) Bool32 { return self.vkGetPhysicalDeviceScreenPresentationSupportQNX( physical_device, queue_family_index, window, ); } pub fn createDebugReportCallbackEXT( self: Self, instance: Instance, create_info: DebugReportCallbackCreateInfoEXT, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, Unknown, }!DebugReportCallbackEXT { var callback: DebugReportCallbackEXT = undefined; const result = self.vkCreateDebugReportCallbackEXT( instance, &create_info, p_allocator, &callback, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } return callback; } pub fn destroyDebugReportCallbackEXT( self: Self, instance: Instance, callback: DebugReportCallbackEXT, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyDebugReportCallbackEXT( instance, callback, p_allocator, ); } pub fn debugReportMessageEXT( self: Self, instance: Instance, flags: DebugReportFlagsEXT, object_type: DebugReportObjectTypeEXT, object: u64, location: usize, message_code: i32, p_layer_prefix: [*:0]const u8, p_message: [*:0]const u8, ) void { self.vkDebugReportMessageEXT( instance, flags.toInt(), object_type, object, location, message_code, p_layer_prefix, p_message, ); } pub fn getPhysicalDeviceExternalImageFormatPropertiesNV( self: Self, physical_device: PhysicalDevice, format: Format, @"type": ImageType, tiling: ImageTiling, usage: ImageUsageFlags, flags: ImageCreateFlags, external_handle_type: ExternalMemoryHandleTypeFlagsNV, ) error{ OutOfHostMemory, OutOfDeviceMemory, FormatNotSupported, Unknown, }!ExternalImageFormatPropertiesNV { _ = @"type"; var external_image_format_properties: ExternalImageFormatPropertiesNV = undefined; const result = self.vkGetPhysicalDeviceExternalImageFormatPropertiesNV( physical_device, format, type, tiling, usage.toInt(), flags.toInt(), external_handle_type.toInt(), &external_image_format_properties, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_format_not_supported => return error.FormatNotSupported, else => return error.Unknown, } return external_image_format_properties; } pub fn getPhysicalDeviceFeatures2( self: Self, physical_device: PhysicalDevice, p_features: *PhysicalDeviceFeatures2, ) void { self.vkGetPhysicalDeviceFeatures2( physical_device, p_features, ); } pub fn getPhysicalDeviceProperties2( self: Self, physical_device: PhysicalDevice, p_properties: *PhysicalDeviceProperties2, ) void { self.vkGetPhysicalDeviceProperties2( physical_device, p_properties, ); } pub fn getPhysicalDeviceFormatProperties2( self: Self, physical_device: PhysicalDevice, format: Format, p_format_properties: *FormatProperties2, ) void { self.vkGetPhysicalDeviceFormatProperties2( physical_device, format, p_format_properties, ); } pub fn getPhysicalDeviceImageFormatProperties2( self: Self, physical_device: PhysicalDevice, image_format_info: PhysicalDeviceImageFormatInfo2, p_image_format_properties: *ImageFormatProperties2, ) error{ OutOfHostMemory, OutOfDeviceMemory, FormatNotSupported, Unknown, }!void { const result = self.vkGetPhysicalDeviceImageFormatProperties2( physical_device, &image_format_info, p_image_format_properties, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_format_not_supported => return error.FormatNotSupported, else => return error.Unknown, } } pub fn getPhysicalDeviceQueueFamilyProperties2( self: Self, physical_device: PhysicalDevice, p_queue_family_property_count: *u32, p_queue_family_properties: ?[*]QueueFamilyProperties2, ) void { self.vkGetPhysicalDeviceQueueFamilyProperties2( physical_device, p_queue_family_property_count, p_queue_family_properties, ); } pub fn getPhysicalDeviceMemoryProperties2( self: Self, physical_device: PhysicalDevice, p_memory_properties: *PhysicalDeviceMemoryProperties2, ) void { self.vkGetPhysicalDeviceMemoryProperties2( physical_device, p_memory_properties, ); } pub fn getPhysicalDeviceSparseImageFormatProperties2( self: Self, physical_device: PhysicalDevice, format_info: PhysicalDeviceSparseImageFormatInfo2, p_property_count: *u32, p_properties: ?[*]SparseImageFormatProperties2, ) void { self.vkGetPhysicalDeviceSparseImageFormatProperties2( physical_device, &format_info, p_property_count, p_properties, ); } pub fn getPhysicalDeviceExternalBufferProperties( self: Self, physical_device: PhysicalDevice, external_buffer_info: PhysicalDeviceExternalBufferInfo, p_external_buffer_properties: *ExternalBufferProperties, ) void { self.vkGetPhysicalDeviceExternalBufferProperties( physical_device, &external_buffer_info, p_external_buffer_properties, ); } pub fn getPhysicalDeviceExternalSemaphoreProperties( self: Self, physical_device: PhysicalDevice, external_semaphore_info: PhysicalDeviceExternalSemaphoreInfo, p_external_semaphore_properties: *ExternalSemaphoreProperties, ) void { self.vkGetPhysicalDeviceExternalSemaphoreProperties( physical_device, &external_semaphore_info, p_external_semaphore_properties, ); } pub fn getPhysicalDeviceExternalFenceProperties( self: Self, physical_device: PhysicalDevice, external_fence_info: PhysicalDeviceExternalFenceInfo, p_external_fence_properties: *ExternalFenceProperties, ) void { self.vkGetPhysicalDeviceExternalFenceProperties( physical_device, &external_fence_info, p_external_fence_properties, ); } pub fn releaseDisplayEXT( self: Self, physical_device: PhysicalDevice, display: DisplayKHR, ) error{ Unknown, }!void { const result = self.vkReleaseDisplayEXT( physical_device, display, ); switch (result) { .success => {}, else => return error.Unknown, } } pub fn acquireXlibDisplayEXT( self: Self, physical_device: PhysicalDevice, dpy: *Display, display: DisplayKHR, ) error{ OutOfHostMemory, InitializationFailed, Unknown, }!void { const result = self.vkAcquireXlibDisplayEXT( physical_device, dpy, display, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_initialization_failed => return error.InitializationFailed, else => return error.Unknown, } } pub fn getRandROutputDisplayEXT( self: Self, physical_device: PhysicalDevice, dpy: *Display, rr_output: RROutput, ) error{ OutOfHostMemory, Unknown, }!DisplayKHR { var display: DisplayKHR = undefined; const result = self.vkGetRandROutputDisplayEXT( physical_device, dpy, rr_output, &display, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } return display; } pub fn acquireWinrtDisplayNV( self: Self, physical_device: PhysicalDevice, display: DisplayKHR, ) error{ OutOfHostMemory, DeviceLost, InitializationFailed, Unknown, }!void { const result = self.vkAcquireWinrtDisplayNV( physical_device, display, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_device_lost => return error.DeviceLost, .error_initialization_failed => return error.InitializationFailed, else => return error.Unknown, } } pub fn getWinrtDisplayNV( self: Self, physical_device: PhysicalDevice, device_relative_id: u32, ) error{ OutOfHostMemory, DeviceLost, InitializationFailed, Unknown, }!DisplayKHR { var display: DisplayKHR = undefined; const result = self.vkGetWinrtDisplayNV( physical_device, device_relative_id, &display, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_device_lost => return error.DeviceLost, .error_initialization_failed => return error.InitializationFailed, else => return error.Unknown, } return display; } pub fn getPhysicalDeviceSurfaceCapabilities2EXT( self: Self, physical_device: PhysicalDevice, surface: SurfaceKHR, p_surface_capabilities: *SurfaceCapabilities2EXT, ) error{ OutOfHostMemory, OutOfDeviceMemory, SurfaceLostKHR, Unknown, }!void { const result = self.vkGetPhysicalDeviceSurfaceCapabilities2EXT( physical_device, surface, p_surface_capabilities, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_surface_lost_khr => return error.SurfaceLostKHR, else => return error.Unknown, } } pub fn enumeratePhysicalDeviceGroups( self: Self, instance: Instance, p_physical_device_group_count: *u32, p_physical_device_group_properties: ?[*]PhysicalDeviceGroupProperties, ) error{ OutOfHostMemory, OutOfDeviceMemory, InitializationFailed, Unknown, }!Result { const result = self.vkEnumeratePhysicalDeviceGroups( instance, p_physical_device_group_count, p_physical_device_group_properties, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_initialization_failed => return error.InitializationFailed, else => return error.Unknown, } return result; } pub fn getPhysicalDevicePresentRectanglesKHR( self: Self, physical_device: PhysicalDevice, surface: SurfaceKHR, p_rect_count: *u32, p_rects: ?[*]Rect2D, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Result { const result = self.vkGetPhysicalDevicePresentRectanglesKHR( physical_device, surface, p_rect_count, p_rects, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return result; } pub fn createIosSurfaceMVK( self: Self, instance: Instance, create_info: IOSSurfaceCreateInfoMVK, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, NativeWindowInUseKHR, Unknown, }!SurfaceKHR { var surface: SurfaceKHR = undefined; const result = self.vkCreateIOSSurfaceMVK( instance, &create_info, p_allocator, &surface, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_native_window_in_use_khr => return error.NativeWindowInUseKHR, else => return error.Unknown, } return surface; } pub fn createMacOsSurfaceMVK( self: Self, instance: Instance, create_info: MacOSSurfaceCreateInfoMVK, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, NativeWindowInUseKHR, Unknown, }!SurfaceKHR { var surface: SurfaceKHR = undefined; const result = self.vkCreateMacOSSurfaceMVK( instance, &create_info, p_allocator, &surface, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_native_window_in_use_khr => return error.NativeWindowInUseKHR, else => return error.Unknown, } return surface; } pub fn createMetalSurfaceEXT( self: Self, instance: Instance, create_info: MetalSurfaceCreateInfoEXT, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, NativeWindowInUseKHR, Unknown, }!SurfaceKHR { var surface: SurfaceKHR = undefined; const result = self.vkCreateMetalSurfaceEXT( instance, &create_info, p_allocator, &surface, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_native_window_in_use_khr => return error.NativeWindowInUseKHR, else => return error.Unknown, } return surface; } pub fn getPhysicalDeviceMultisamplePropertiesEXT( self: Self, physical_device: PhysicalDevice, samples: SampleCountFlags, p_multisample_properties: *MultisamplePropertiesEXT, ) void { self.vkGetPhysicalDeviceMultisamplePropertiesEXT( physical_device, samples.toInt(), p_multisample_properties, ); } pub fn getPhysicalDeviceSurfaceCapabilities2KHR( self: Self, physical_device: PhysicalDevice, surface_info: PhysicalDeviceSurfaceInfo2KHR, p_surface_capabilities: *SurfaceCapabilities2KHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, SurfaceLostKHR, Unknown, }!void { const result = self.vkGetPhysicalDeviceSurfaceCapabilities2KHR( physical_device, &surface_info, p_surface_capabilities, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_surface_lost_khr => return error.SurfaceLostKHR, else => return error.Unknown, } } pub fn getPhysicalDeviceSurfaceFormats2KHR( self: Self, physical_device: PhysicalDevice, surface_info: PhysicalDeviceSurfaceInfo2KHR, p_surface_format_count: *u32, p_surface_formats: ?[*]SurfaceFormat2KHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, SurfaceLostKHR, Unknown, }!Result { const result = self.vkGetPhysicalDeviceSurfaceFormats2KHR( physical_device, &surface_info, p_surface_format_count, p_surface_formats, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_surface_lost_khr => return error.SurfaceLostKHR, else => return error.Unknown, } return result; } pub fn getPhysicalDeviceDisplayProperties2KHR( self: Self, physical_device: PhysicalDevice, p_property_count: *u32, p_properties: ?[*]DisplayProperties2KHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Result { const result = self.vkGetPhysicalDeviceDisplayProperties2KHR( physical_device, p_property_count, p_properties, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return result; } pub fn getPhysicalDeviceDisplayPlaneProperties2KHR( self: Self, physical_device: PhysicalDevice, p_property_count: *u32, p_properties: ?[*]DisplayPlaneProperties2KHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Result { const result = self.vkGetPhysicalDeviceDisplayPlaneProperties2KHR( physical_device, p_property_count, p_properties, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return result; } pub fn getDisplayModeProperties2KHR( self: Self, physical_device: PhysicalDevice, display: DisplayKHR, p_property_count: *u32, p_properties: ?[*]DisplayModeProperties2KHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Result { const result = self.vkGetDisplayModeProperties2KHR( physical_device, display, p_property_count, p_properties, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return result; } pub fn getDisplayPlaneCapabilities2KHR( self: Self, physical_device: PhysicalDevice, display_plane_info: DisplayPlaneInfo2KHR, p_capabilities: *DisplayPlaneCapabilities2KHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!void { const result = self.vkGetDisplayPlaneCapabilities2KHR( physical_device, &display_plane_info, p_capabilities, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn getPhysicalDeviceCalibrateableTimeDomainsEXT( self: Self, physical_device: PhysicalDevice, p_time_domain_count: *u32, p_time_domains: ?[*]TimeDomainEXT, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Result { const result = self.vkGetPhysicalDeviceCalibrateableTimeDomainsEXT( physical_device, p_time_domain_count, p_time_domains, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return result; } pub fn createDebugUtilsMessengerEXT( self: Self, instance: Instance, create_info: DebugUtilsMessengerCreateInfoEXT, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, Unknown, }!DebugUtilsMessengerEXT { var messenger: DebugUtilsMessengerEXT = undefined; const result = self.vkCreateDebugUtilsMessengerEXT( instance, &create_info, p_allocator, &messenger, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } return messenger; } pub fn destroyDebugUtilsMessengerEXT( self: Self, instance: Instance, messenger: DebugUtilsMessengerEXT, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyDebugUtilsMessengerEXT( instance, messenger, p_allocator, ); } pub fn submitDebugUtilsMessageEXT( self: Self, instance: Instance, message_severity: DebugUtilsMessageSeverityFlagsEXT, message_types: DebugUtilsMessageTypeFlagsEXT, callback_data: DebugUtilsMessengerCallbackDataEXT, ) void { self.vkSubmitDebugUtilsMessageEXT( instance, message_severity.toInt(), message_types.toInt(), &callback_data, ); } pub fn getPhysicalDeviceCooperativeMatrixPropertiesNV( self: Self, physical_device: PhysicalDevice, p_property_count: *u32, p_properties: ?[*]CooperativeMatrixPropertiesNV, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Result { const result = self.vkGetPhysicalDeviceCooperativeMatrixPropertiesNV( physical_device, p_property_count, p_properties, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return result; } pub fn getPhysicalDeviceSurfacePresentModes2EXT( self: Self, physical_device: PhysicalDevice, surface_info: PhysicalDeviceSurfaceInfo2KHR, p_present_mode_count: *u32, p_present_modes: ?[*]PresentModeKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, SurfaceLostKHR, Unknown, }!Result { const result = self.vkGetPhysicalDeviceSurfacePresentModes2EXT( physical_device, &surface_info, p_present_mode_count, p_present_modes, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_surface_lost_khr => return error.SurfaceLostKHR, else => return error.Unknown, } return result; } pub fn enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR( self: Self, physical_device: PhysicalDevice, queue_family_index: u32, p_counter_count: *u32, p_counters: ?[*]PerformanceCounterKHR, p_counter_descriptions: ?[*]PerformanceCounterDescriptionKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, InitializationFailed, Unknown, }!Result { const result = self.vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR( physical_device, queue_family_index, p_counter_count, p_counters, p_counter_descriptions, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_initialization_failed => return error.InitializationFailed, else => return error.Unknown, } return result; } pub fn getPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR( self: Self, physical_device: PhysicalDevice, performance_query_create_info: QueryPoolPerformanceCreateInfoKHR, ) u32 { var num_passes: u32 = undefined; self.vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR( physical_device, &performance_query_create_info, &num_passes, ); return num_passes; } pub fn createHeadlessSurfaceEXT( self: Self, instance: Instance, create_info: HeadlessSurfaceCreateInfoEXT, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!SurfaceKHR { var surface: SurfaceKHR = undefined; const result = self.vkCreateHeadlessSurfaceEXT( instance, &create_info, p_allocator, &surface, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return surface; } pub fn getPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV( self: Self, physical_device: PhysicalDevice, p_combination_count: *u32, p_combinations: ?[*]FramebufferMixedSamplesCombinationNV, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Result { const result = self.vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV( physical_device, p_combination_count, p_combinations, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return result; } pub fn getPhysicalDeviceToolPropertiesEXT( self: Self, physical_device: PhysicalDevice, p_tool_count: *u32, p_tool_properties: ?[*]PhysicalDeviceToolPropertiesEXT, ) error{ OutOfHostMemory, Unknown, }!Result { const result = self.vkGetPhysicalDeviceToolPropertiesEXT( physical_device, p_tool_count, p_tool_properties, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } return result; } pub fn getPhysicalDeviceFragmentShadingRatesKHR( self: Self, physical_device: PhysicalDevice, p_fragment_shading_rate_count: *u32, p_fragment_shading_rates: ?[*]PhysicalDeviceFragmentShadingRateKHR, ) error{ OutOfHostMemory, Unknown, }!Result { const result = self.vkGetPhysicalDeviceFragmentShadingRatesKHR( physical_device, p_fragment_shading_rate_count, p_fragment_shading_rates, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } return result; } pub fn getPhysicalDeviceVideoCapabilitiesKHR( self: Self, physical_device: PhysicalDevice, video_profile: VideoProfileKHR, p_capabilities: *VideoCapabilitiesKHR, ) error{ ExtensionNotPresent, InitializationFailed, FeatureNotPresent, FormatNotSupported, Unknown, }!void { const result = self.vkGetPhysicalDeviceVideoCapabilitiesKHR( physical_device, &video_profile, p_capabilities, ); switch (result) { .success => {}, .error_extension_not_present => return error.ExtensionNotPresent, .error_initialization_failed => return error.InitializationFailed, .error_feature_not_present => return error.FeatureNotPresent, .error_format_not_supported => return error.FormatNotSupported, else => return error.Unknown, } } pub fn getPhysicalDeviceVideoFormatPropertiesKHR( self: Self, physical_device: PhysicalDevice, video_format_info: PhysicalDeviceVideoFormatInfoKHR, p_video_format_property_count: *u32, p_video_format_properties: ?[*]VideoFormatPropertiesKHR, ) error{ ExtensionNotPresent, InitializationFailed, FormatNotSupported, Unknown, }!Result { const result = self.vkGetPhysicalDeviceVideoFormatPropertiesKHR( physical_device, &video_format_info, p_video_format_property_count, p_video_format_properties, ); switch (result) { .success => {}, .incomplete => {}, .error_extension_not_present => return error.ExtensionNotPresent, .error_initialization_failed => return error.InitializationFailed, .error_format_not_supported => return error.FormatNotSupported, else => return error.Unknown, } return result; } }; } pub fn DeviceWrapper(comptime Self: type) type { return struct { pub fn load(device: Device, loader: anytype) !Self { var self: Self = undefined; inline for (std.meta.fields(Self)) |field| { const name = @ptrCast([*:0]const u8, field.name ++ "\x00"); const cmd_ptr = loader(device, name) orelse return error.InvalidCommand; @field(self, field.name) = @ptrCast(field.field_type, cmd_ptr); } return self; } pub fn destroyDevice( self: Self, device: Device, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyDevice( device, p_allocator, ); } pub fn getDeviceQueue( self: Self, device: Device, queue_family_index: u32, queue_index: u32, ) Queue { var queue: Queue = undefined; self.vkGetDeviceQueue( device, queue_family_index, queue_index, &queue, ); return queue; } pub fn queueSubmit( self: Self, queue: Queue, submit_count: u32, p_submits: [*]const SubmitInfo, fence: Fence, ) error{ OutOfHostMemory, OutOfDeviceMemory, DeviceLost, Unknown, }!void { const result = self.vkQueueSubmit( queue, submit_count, p_submits, fence, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_device_lost => return error.DeviceLost, else => return error.Unknown, } } pub fn queueWaitIdle( self: Self, queue: Queue, ) error{ OutOfHostMemory, OutOfDeviceMemory, DeviceLost, Unknown, }!void { const result = self.vkQueueWaitIdle( queue, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_device_lost => return error.DeviceLost, else => return error.Unknown, } } pub fn deviceWaitIdle( self: Self, device: Device, ) error{ OutOfHostMemory, OutOfDeviceMemory, DeviceLost, Unknown, }!void { const result = self.vkDeviceWaitIdle( device, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_device_lost => return error.DeviceLost, else => return error.Unknown, } } pub fn allocateMemory( self: Self, device: Device, allocate_info: MemoryAllocateInfo, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, InvalidExternalHandle, InvalidOpaqueCaptureAddressKHR, Unknown, }!DeviceMemory { var memory: DeviceMemory = undefined; const result = self.vkAllocateMemory( device, &allocate_info, p_allocator, &memory, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_invalid_external_handle => return error.InvalidExternalHandle, //.error_invalid_opaque_capture_address_khr => return error.InvalidOpaqueCaptureAddressKHR, else => return error.Unknown, } return memory; } pub fn freeMemory( self: Self, device: Device, memory: DeviceMemory, p_allocator: ?*const AllocationCallbacks, ) void { self.vkFreeMemory( device, memory, p_allocator, ); } pub fn mapMemory( self: Self, device: Device, memory: DeviceMemory, offset: DeviceSize, size: DeviceSize, flags: MemoryMapFlags, ) error{ OutOfHostMemory, OutOfDeviceMemory, MemoryMapFailed, Unknown, }!?*anyopaque { var pp_data: ?*anyopaque = undefined; const result = self.vkMapMemory( device, memory, offset, size, flags.toInt(), &pp_data, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_memory_map_failed => return error.MemoryMapFailed, else => return error.Unknown, } return pp_data; } pub fn unmapMemory( self: Self, device: Device, memory: DeviceMemory, ) void { self.vkUnmapMemory( device, memory, ); } pub fn flushMappedMemoryRanges( self: Self, device: Device, memory_range_count: u32, p_memory_ranges: [*]const MappedMemoryRange, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!void { const result = self.vkFlushMappedMemoryRanges( device, memory_range_count, p_memory_ranges, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn invalidateMappedMemoryRanges( self: Self, device: Device, memory_range_count: u32, p_memory_ranges: [*]const MappedMemoryRange, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!void { const result = self.vkInvalidateMappedMemoryRanges( device, memory_range_count, p_memory_ranges, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn getDeviceMemoryCommitment( self: Self, device: Device, memory: DeviceMemory, ) DeviceSize { var committed_memory_in_bytes: DeviceSize = undefined; self.vkGetDeviceMemoryCommitment( device, memory, &committed_memory_in_bytes, ); return committed_memory_in_bytes; } pub fn getBufferMemoryRequirements( self: Self, device: Device, buffer: Buffer, ) MemoryRequirements { var memory_requirements: MemoryRequirements = undefined; self.vkGetBufferMemoryRequirements( device, buffer, &memory_requirements, ); return memory_requirements; } pub fn bindBufferMemory( self: Self, device: Device, buffer: Buffer, memory: DeviceMemory, memory_offset: DeviceSize, ) error{ OutOfHostMemory, OutOfDeviceMemory, InvalidOpaqueCaptureAddressKHR, Unknown, }!void { const result = self.vkBindBufferMemory( device, buffer, memory, memory_offset, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, //.error_invalid_opaque_capture_address_khr => return error.InvalidOpaqueCaptureAddressKHR, else => return error.Unknown, } } pub fn getImageMemoryRequirements( self: Self, device: Device, image: Image, ) MemoryRequirements { var memory_requirements: MemoryRequirements = undefined; self.vkGetImageMemoryRequirements( device, image, &memory_requirements, ); return memory_requirements; } pub fn bindImageMemory( self: Self, device: Device, image: Image, memory: DeviceMemory, memory_offset: DeviceSize, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!void { const result = self.vkBindImageMemory( device, image, memory, memory_offset, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn getImageSparseMemoryRequirements( self: Self, device: Device, image: Image, p_sparse_memory_requirement_count: *u32, p_sparse_memory_requirements: ?[*]SparseImageMemoryRequirements, ) void { self.vkGetImageSparseMemoryRequirements( device, image, p_sparse_memory_requirement_count, p_sparse_memory_requirements, ); } pub fn queueBindSparse( self: Self, queue: Queue, bind_info_count: u32, p_bind_info: [*]const BindSparseInfo, fence: Fence, ) error{ OutOfHostMemory, OutOfDeviceMemory, DeviceLost, Unknown, }!void { const result = self.vkQueueBindSparse( queue, bind_info_count, p_bind_info, fence, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_device_lost => return error.DeviceLost, else => return error.Unknown, } } pub fn createFence( self: Self, device: Device, create_info: FenceCreateInfo, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Fence { var fence: Fence = undefined; const result = self.vkCreateFence( device, &create_info, p_allocator, &fence, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return fence; } pub fn destroyFence( self: Self, device: Device, fence: Fence, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyFence( device, fence, p_allocator, ); } pub fn resetFences( self: Self, device: Device, fence_count: u32, p_fences: [*]const Fence, ) error{ OutOfDeviceMemory, Unknown, }!void { const result = self.vkResetFences( device, fence_count, p_fences, ); switch (result) { .success => {}, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn getFenceStatus( self: Self, device: Device, fence: Fence, ) error{ OutOfHostMemory, OutOfDeviceMemory, DeviceLost, Unknown, }!Result { const result = self.vkGetFenceStatus( device, fence, ); switch (result) { .success => {}, .not_ready => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_device_lost => return error.DeviceLost, else => return error.Unknown, } return result; } pub fn waitForFences( self: Self, device: Device, fence_count: u32, p_fences: [*]const Fence, wait_all: Bool32, timeout: u64, ) error{ OutOfHostMemory, OutOfDeviceMemory, DeviceLost, Unknown, }!Result { const result = self.vkWaitForFences( device, fence_count, p_fences, wait_all, timeout, ); switch (result) { .success => {}, .timeout => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_device_lost => return error.DeviceLost, else => return error.Unknown, } return result; } pub fn createSemaphore( self: Self, device: Device, create_info: SemaphoreCreateInfo, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Semaphore { var semaphore: Semaphore = undefined; const result = self.vkCreateSemaphore( device, &create_info, p_allocator, &semaphore, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return semaphore; } pub fn destroySemaphore( self: Self, device: Device, semaphore: Semaphore, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroySemaphore( device, semaphore, p_allocator, ); } pub fn createEvent( self: Self, device: Device, create_info: EventCreateInfo, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Event { var event: Event = undefined; const result = self.vkCreateEvent( device, &create_info, p_allocator, &event, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return event; } pub fn destroyEvent( self: Self, device: Device, event: Event, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyEvent( device, event, p_allocator, ); } pub fn getEventStatus( self: Self, device: Device, event: Event, ) error{ OutOfHostMemory, OutOfDeviceMemory, DeviceLost, Unknown, }!Result { const result = self.vkGetEventStatus( device, event, ); switch (result) { .event_set => {}, .event_reset => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_device_lost => return error.DeviceLost, else => return error.Unknown, } return result; } pub fn setEvent( self: Self, device: Device, event: Event, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!void { const result = self.vkSetEvent( device, event, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn resetEvent( self: Self, device: Device, event: Event, ) error{ OutOfDeviceMemory, Unknown, }!void { const result = self.vkResetEvent( device, event, ); switch (result) { .success => {}, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn createQueryPool( self: Self, device: Device, create_info: QueryPoolCreateInfo, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!QueryPool { var query_pool: QueryPool = undefined; const result = self.vkCreateQueryPool( device, &create_info, p_allocator, &query_pool, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return query_pool; } pub fn destroyQueryPool( self: Self, device: Device, query_pool: QueryPool, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyQueryPool( device, query_pool, p_allocator, ); } pub fn getQueryPoolResults( self: Self, device: Device, query_pool: QueryPool, first_query: u32, query_count: u32, data_size: usize, p_data: *anyopaque, stride: DeviceSize, flags: QueryResultFlags, ) error{ OutOfHostMemory, OutOfDeviceMemory, DeviceLost, Unknown, }!Result { const result = self.vkGetQueryPoolResults( device, query_pool, first_query, query_count, data_size, p_data, stride, flags.toInt(), ); switch (result) { .success => {}, .not_ready => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_device_lost => return error.DeviceLost, else => return error.Unknown, } return result; } pub fn resetQueryPool( self: Self, device: Device, query_pool: QueryPool, first_query: u32, query_count: u32, ) void { self.vkResetQueryPool( device, query_pool, first_query, query_count, ); } pub fn createBuffer( self: Self, device: Device, create_info: BufferCreateInfo, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, InvalidOpaqueCaptureAddressKHR, Unknown, }!Buffer { var buffer: Buffer = undefined; const result = self.vkCreateBuffer( device, &create_info, p_allocator, &buffer, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_invalid_opaque_capture_address => return error.InvalidOpaqueCaptureAddressKHR, else => return error.Unknown, } return buffer; } pub fn destroyBuffer( self: Self, device: Device, buffer: Buffer, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyBuffer( device, buffer, p_allocator, ); } pub fn createBufferView( self: Self, device: Device, create_info: BufferViewCreateInfo, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!BufferView { var view: BufferView = undefined; const result = self.vkCreateBufferView( device, &create_info, p_allocator, &view, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return view; } pub fn destroyBufferView( self: Self, device: Device, buffer_view: BufferView, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyBufferView( device, buffer_view, p_allocator, ); } pub fn createImage( self: Self, device: Device, create_info: ImageCreateInfo, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Image { var image: Image = undefined; const result = self.vkCreateImage( device, &create_info, p_allocator, &image, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return image; } pub fn destroyImage( self: Self, device: Device, image: Image, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyImage( device, image, p_allocator, ); } pub fn getImageSubresourceLayout( self: Self, device: Device, image: Image, subresource: ImageSubresource, ) SubresourceLayout { var layout: SubresourceLayout = undefined; self.vkGetImageSubresourceLayout( device, image, &subresource, &layout, ); return layout; } pub fn createImageView( self: Self, device: Device, create_info: ImageViewCreateInfo, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!ImageView { var view: ImageView = undefined; const result = self.vkCreateImageView( device, &create_info, p_allocator, &view, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return view; } pub fn destroyImageView( self: Self, device: Device, image_view: ImageView, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyImageView( device, image_view, p_allocator, ); } pub fn createShaderModule( self: Self, device: Device, create_info: ShaderModuleCreateInfo, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, InvalidShaderNV, Unknown, }!ShaderModule { var shader_module: ShaderModule = undefined; const result = self.vkCreateShaderModule( device, &create_info, p_allocator, &shader_module, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_invalid_shader_nv => return error.InvalidShaderNV, else => return error.Unknown, } return shader_module; } pub fn destroyShaderModule( self: Self, device: Device, shader_module: ShaderModule, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyShaderModule( device, shader_module, p_allocator, ); } pub fn createPipelineCache( self: Self, device: Device, create_info: PipelineCacheCreateInfo, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!PipelineCache { var pipeline_cache: PipelineCache = undefined; const result = self.vkCreatePipelineCache( device, &create_info, p_allocator, &pipeline_cache, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return pipeline_cache; } pub fn destroyPipelineCache( self: Self, device: Device, pipeline_cache: PipelineCache, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyPipelineCache( device, pipeline_cache, p_allocator, ); } pub fn getPipelineCacheData( self: Self, device: Device, pipeline_cache: PipelineCache, p_data_size: *usize, p_data: ?*anyopaque, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Result { const result = self.vkGetPipelineCacheData( device, pipeline_cache, p_data_size, p_data, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return result; } pub fn mergePipelineCaches( self: Self, device: Device, dst_cache: PipelineCache, src_cache_count: u32, p_src_caches: [*]const PipelineCache, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!void { const result = self.vkMergePipelineCaches( device, dst_cache, src_cache_count, p_src_caches, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn createGraphicsPipelines( self: Self, device: Device, pipeline_cache: PipelineCache, create_info_count: u32, p_create_infos: [*]const GraphicsPipelineCreateInfo, p_allocator: ?*const AllocationCallbacks, p_pipelines: [*]Pipeline, ) error{ OutOfHostMemory, OutOfDeviceMemory, InvalidShaderNV, Unknown, }!Result { const result = self.vkCreateGraphicsPipelines( device, pipeline_cache, create_info_count, p_create_infos, p_allocator, p_pipelines, ); switch (result) { .success => {}, .pipeline_compile_required_ext => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_invalid_shader_nv => return error.InvalidShaderNV, else => return error.Unknown, } return result; } pub fn createComputePipelines( self: Self, device: Device, pipeline_cache: PipelineCache, create_info_count: u32, p_create_infos: [*]const ComputePipelineCreateInfo, p_allocator: ?*const AllocationCallbacks, p_pipelines: [*]Pipeline, ) error{ OutOfHostMemory, OutOfDeviceMemory, InvalidShaderNV, Unknown, }!Result { const result = self.vkCreateComputePipelines( device, pipeline_cache, create_info_count, p_create_infos, p_allocator, p_pipelines, ); switch (result) { .success => {}, .pipeline_compile_required_ext => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_invalid_shader_nv => return error.InvalidShaderNV, else => return error.Unknown, } return result; } pub fn destroyPipeline( self: Self, device: Device, pipeline: Pipeline, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyPipeline( device, pipeline, p_allocator, ); } pub fn createPipelineLayout( self: Self, device: Device, create_info: PipelineLayoutCreateInfo, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!PipelineLayout { var pipeline_layout: PipelineLayout = undefined; const result = self.vkCreatePipelineLayout( device, &create_info, p_allocator, &pipeline_layout, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return pipeline_layout; } pub fn destroyPipelineLayout( self: Self, device: Device, pipeline_layout: PipelineLayout, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyPipelineLayout( device, pipeline_layout, p_allocator, ); } pub fn createSampler( self: Self, device: Device, create_info: SamplerCreateInfo, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Sampler { var sampler: Sampler = undefined; const result = self.vkCreateSampler( device, &create_info, p_allocator, &sampler, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return sampler; } pub fn destroySampler( self: Self, device: Device, sampler: Sampler, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroySampler( device, sampler, p_allocator, ); } pub fn createDescriptorSetLayout( self: Self, device: Device, create_info: DescriptorSetLayoutCreateInfo, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!DescriptorSetLayout { var set_layout: DescriptorSetLayout = undefined; const result = self.vkCreateDescriptorSetLayout( device, &create_info, p_allocator, &set_layout, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return set_layout; } pub fn destroyDescriptorSetLayout( self: Self, device: Device, descriptor_set_layout: DescriptorSetLayout, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyDescriptorSetLayout( device, descriptor_set_layout, p_allocator, ); } pub fn createDescriptorPool( self: Self, device: Device, create_info: DescriptorPoolCreateInfo, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, FragmentationEXT, Unknown, }!DescriptorPool { var descriptor_pool: DescriptorPool = undefined; const result = self.vkCreateDescriptorPool( device, &create_info, p_allocator, &descriptor_pool, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_fragmentation => return error.FragmentationEXT, else => return error.Unknown, } return descriptor_pool; } pub fn destroyDescriptorPool( self: Self, device: Device, descriptor_pool: DescriptorPool, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyDescriptorPool( device, descriptor_pool, p_allocator, ); } pub fn resetDescriptorPool( self: Self, device: Device, descriptor_pool: DescriptorPool, flags: DescriptorPoolResetFlags, ) error{ Unknown, }!void { const result = self.vkResetDescriptorPool( device, descriptor_pool, flags.toInt(), ); switch (result) { .success => {}, else => return error.Unknown, } } pub fn allocateDescriptorSets( self: Self, device: Device, allocate_info: DescriptorSetAllocateInfo, p_descriptor_sets: [*]DescriptorSet, ) error{ OutOfHostMemory, OutOfDeviceMemory, FragmentedPool, OutOfPoolMemory, Unknown, }!void { const result = self.vkAllocateDescriptorSets( device, &allocate_info, p_descriptor_sets, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_fragmented_pool => return error.FragmentedPool, .error_out_of_pool_memory => return error.OutOfPoolMemory, else => return error.Unknown, } } pub fn freeDescriptorSets( self: Self, device: Device, descriptor_pool: DescriptorPool, descriptor_set_count: u32, p_descriptor_sets: [*]const DescriptorSet, ) error{ Unknown, }!void { const result = self.vkFreeDescriptorSets( device, descriptor_pool, descriptor_set_count, p_descriptor_sets, ); switch (result) { .success => {}, else => return error.Unknown, } } pub fn updateDescriptorSets( self: Self, device: Device, descriptor_write_count: u32, p_descriptor_writes: [*]const WriteDescriptorSet, descriptor_copy_count: u32, p_descriptor_copies: [*]const CopyDescriptorSet, ) void { self.vkUpdateDescriptorSets( device, descriptor_write_count, p_descriptor_writes, descriptor_copy_count, p_descriptor_copies, ); } pub fn createFramebuffer( self: Self, device: Device, create_info: FramebufferCreateInfo, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Framebuffer { var framebuffer: Framebuffer = undefined; const result = self.vkCreateFramebuffer( device, &create_info, p_allocator, &framebuffer, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return framebuffer; } pub fn destroyFramebuffer( self: Self, device: Device, framebuffer: Framebuffer, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyFramebuffer( device, framebuffer, p_allocator, ); } pub fn createRenderPass( self: Self, device: Device, create_info: RenderPassCreateInfo, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!RenderPass { var render_pass: RenderPass = undefined; const result = self.vkCreateRenderPass( device, &create_info, p_allocator, &render_pass, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return render_pass; } pub fn destroyRenderPass( self: Self, device: Device, render_pass: RenderPass, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyRenderPass( device, render_pass, p_allocator, ); } pub fn getRenderAreaGranularity( self: Self, device: Device, render_pass: RenderPass, ) Extent2D { var granularity: Extent2D = undefined; self.vkGetRenderAreaGranularity( device, render_pass, &granularity, ); return granularity; } pub fn createCommandPool( self: Self, device: Device, create_info: CommandPoolCreateInfo, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!CommandPool { var command_pool: CommandPool = undefined; const result = self.vkCreateCommandPool( device, &create_info, p_allocator, &command_pool, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return command_pool; } pub fn destroyCommandPool( self: Self, device: Device, command_pool: CommandPool, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyCommandPool( device, command_pool, p_allocator, ); } pub fn resetCommandPool( self: Self, device: Device, command_pool: CommandPool, flags: CommandPoolResetFlags, ) error{ OutOfDeviceMemory, Unknown, }!void { const result = self.vkResetCommandPool( device, command_pool, flags.toInt(), ); switch (result) { .success => {}, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn allocateCommandBuffers( self: Self, device: Device, allocate_info: CommandBufferAllocateInfo, p_command_buffers: [*]CommandBuffer, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!void { const result = self.vkAllocateCommandBuffers( device, &allocate_info, p_command_buffers, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn freeCommandBuffers( self: Self, device: Device, command_pool: CommandPool, command_buffer_count: u32, p_command_buffers: [*]const CommandBuffer, ) void { self.vkFreeCommandBuffers( device, command_pool, command_buffer_count, p_command_buffers, ); } pub fn beginCommandBuffer( self: Self, command_buffer: CommandBuffer, begin_info: CommandBufferBeginInfo, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!void { const result = self.vkBeginCommandBuffer( command_buffer, &begin_info, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn endCommandBuffer( self: Self, command_buffer: CommandBuffer, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!void { const result = self.vkEndCommandBuffer( command_buffer, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn resetCommandBuffer( self: Self, command_buffer: CommandBuffer, flags: CommandBufferResetFlags, ) error{ OutOfDeviceMemory, Unknown, }!void { const result = self.vkResetCommandBuffer( command_buffer, flags.toInt(), ); switch (result) { .success => {}, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn cmdBindPipeline( self: Self, command_buffer: CommandBuffer, pipeline_bind_point: PipelineBindPoint, pipeline: Pipeline, ) void { self.vkCmdBindPipeline( command_buffer, pipeline_bind_point, pipeline, ); } pub fn cmdSetViewport( self: Self, command_buffer: CommandBuffer, first_viewport: u32, viewport_count: u32, p_viewports: [*]const Viewport, ) void { self.vkCmdSetViewport( command_buffer, first_viewport, viewport_count, p_viewports, ); } pub fn cmdSetScissor( self: Self, command_buffer: CommandBuffer, first_scissor: u32, scissor_count: u32, p_scissors: [*]const Rect2D, ) void { self.vkCmdSetScissor( command_buffer, first_scissor, scissor_count, p_scissors, ); } pub fn cmdSetLineWidth( self: Self, command_buffer: CommandBuffer, line_width: f32, ) void { self.vkCmdSetLineWidth( command_buffer, line_width, ); } pub fn cmdSetDepthBias( self: Self, command_buffer: CommandBuffer, depth_bias_constant_factor: f32, depth_bias_clamp: f32, depth_bias_slope_factor: f32, ) void { self.vkCmdSetDepthBias( command_buffer, depth_bias_constant_factor, depth_bias_clamp, depth_bias_slope_factor, ); } pub fn cmdSetBlendConstants( self: Self, command_buffer: CommandBuffer, blend_constants: [4]f32, ) void { self.vkCmdSetBlendConstants( command_buffer, blend_constants, ); } pub fn cmdSetDepthBounds( self: Self, command_buffer: CommandBuffer, min_depth_bounds: f32, max_depth_bounds: f32, ) void { self.vkCmdSetDepthBounds( command_buffer, min_depth_bounds, max_depth_bounds, ); } pub fn cmdSetStencilCompareMask( self: Self, command_buffer: CommandBuffer, face_mask: StencilFaceFlags, compare_mask: u32, ) void { self.vkCmdSetStencilCompareMask( command_buffer, face_mask.toInt(), compare_mask, ); } pub fn cmdSetStencilWriteMask( self: Self, command_buffer: CommandBuffer, face_mask: StencilFaceFlags, write_mask: u32, ) void { self.vkCmdSetStencilWriteMask( command_buffer, face_mask.toInt(), write_mask, ); } pub fn cmdSetStencilReference( self: Self, command_buffer: CommandBuffer, face_mask: StencilFaceFlags, reference: u32, ) void { self.vkCmdSetStencilReference( command_buffer, face_mask.toInt(), reference, ); } pub fn cmdBindDescriptorSets( self: Self, command_buffer: CommandBuffer, pipeline_bind_point: PipelineBindPoint, layout: PipelineLayout, first_set: u32, descriptor_set_count: u32, p_descriptor_sets: [*]const DescriptorSet, dynamic_offset_count: u32, p_dynamic_offsets: [*]const u32, ) void { self.vkCmdBindDescriptorSets( command_buffer, pipeline_bind_point, layout, first_set, descriptor_set_count, p_descriptor_sets, dynamic_offset_count, p_dynamic_offsets, ); } pub fn cmdBindIndexBuffer( self: Self, command_buffer: CommandBuffer, buffer: Buffer, offset: DeviceSize, index_type: IndexType, ) void { self.vkCmdBindIndexBuffer( command_buffer, buffer, offset, index_type, ); } pub fn cmdBindVertexBuffers( self: Self, command_buffer: CommandBuffer, first_binding: u32, binding_count: u32, p_buffers: [*]const Buffer, p_offsets: [*]const DeviceSize, ) void { self.vkCmdBindVertexBuffers( command_buffer, first_binding, binding_count, p_buffers, p_offsets, ); } pub fn cmdDraw( self: Self, command_buffer: CommandBuffer, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32, ) void { self.vkCmdDraw( command_buffer, vertex_count, instance_count, first_vertex, first_instance, ); } pub fn cmdDrawIndexed( self: Self, command_buffer: CommandBuffer, index_count: u32, instance_count: u32, first_index: u32, vertex_offset: i32, first_instance: u32, ) void { self.vkCmdDrawIndexed( command_buffer, index_count, instance_count, first_index, vertex_offset, first_instance, ); } pub fn cmdDrawIndirect( self: Self, command_buffer: CommandBuffer, buffer: Buffer, offset: DeviceSize, draw_count: u32, stride: u32, ) void { self.vkCmdDrawIndirect( command_buffer, buffer, offset, draw_count, stride, ); } pub fn cmdDrawIndexedIndirect( self: Self, command_buffer: CommandBuffer, buffer: Buffer, offset: DeviceSize, draw_count: u32, stride: u32, ) void { self.vkCmdDrawIndexedIndirect( command_buffer, buffer, offset, draw_count, stride, ); } pub fn cmdDispatch( self: Self, command_buffer: CommandBuffer, group_count_x: u32, group_count_y: u32, group_count_z: u32, ) void { self.vkCmdDispatch( command_buffer, group_count_x, group_count_y, group_count_z, ); } pub fn cmdDispatchIndirect( self: Self, command_buffer: CommandBuffer, buffer: Buffer, offset: DeviceSize, ) void { self.vkCmdDispatchIndirect( command_buffer, buffer, offset, ); } pub fn cmdCopyBuffer( self: Self, command_buffer: CommandBuffer, src_buffer: Buffer, dst_buffer: Buffer, region_count: u32, p_regions: [*]const BufferCopy, ) void { self.vkCmdCopyBuffer( command_buffer, src_buffer, dst_buffer, region_count, p_regions, ); } pub fn cmdCopyImage( self: Self, command_buffer: CommandBuffer, src_image: Image, src_image_layout: ImageLayout, dst_image: Image, dst_image_layout: ImageLayout, region_count: u32, p_regions: [*]const ImageCopy, ) void { self.vkCmdCopyImage( command_buffer, src_image, src_image_layout, dst_image, dst_image_layout, region_count, p_regions, ); } pub fn cmdBlitImage( self: Self, command_buffer: CommandBuffer, src_image: Image, src_image_layout: ImageLayout, dst_image: Image, dst_image_layout: ImageLayout, region_count: u32, p_regions: [*]const ImageBlit, filter: Filter, ) void { self.vkCmdBlitImage( command_buffer, src_image, src_image_layout, dst_image, dst_image_layout, region_count, p_regions, filter, ); } pub fn cmdCopyBufferToImage( self: Self, command_buffer: CommandBuffer, src_buffer: Buffer, dst_image: Image, dst_image_layout: ImageLayout, region_count: u32, p_regions: [*]const BufferImageCopy, ) void { self.vkCmdCopyBufferToImage( command_buffer, src_buffer, dst_image, dst_image_layout, region_count, p_regions, ); } pub fn cmdCopyImageToBuffer( self: Self, command_buffer: CommandBuffer, src_image: Image, src_image_layout: ImageLayout, dst_buffer: Buffer, region_count: u32, p_regions: [*]const BufferImageCopy, ) void { self.vkCmdCopyImageToBuffer( command_buffer, src_image, src_image_layout, dst_buffer, region_count, p_regions, ); } pub fn cmdUpdateBuffer( self: Self, command_buffer: CommandBuffer, dst_buffer: Buffer, dst_offset: DeviceSize, data_size: DeviceSize, p_data: *const anyopaque, ) void { self.vkCmdUpdateBuffer( command_buffer, dst_buffer, dst_offset, data_size, p_data, ); } pub fn cmdFillBuffer( self: Self, command_buffer: CommandBuffer, dst_buffer: Buffer, dst_offset: DeviceSize, size: DeviceSize, data: u32, ) void { self.vkCmdFillBuffer( command_buffer, dst_buffer, dst_offset, size, data, ); } pub fn cmdClearColorImage( self: Self, command_buffer: CommandBuffer, image: Image, image_layout: ImageLayout, color: ClearColorValue, range_count: u32, p_ranges: [*]const ImageSubresourceRange, ) void { self.vkCmdClearColorImage( command_buffer, image, image_layout, &color, range_count, p_ranges, ); } pub fn cmdClearDepthStencilImage( self: Self, command_buffer: CommandBuffer, image: Image, image_layout: ImageLayout, depth_stencil: ClearDepthStencilValue, range_count: u32, p_ranges: [*]const ImageSubresourceRange, ) void { self.vkCmdClearDepthStencilImage( command_buffer, image, image_layout, &depth_stencil, range_count, p_ranges, ); } pub fn cmdClearAttachments( self: Self, command_buffer: CommandBuffer, attachment_count: u32, p_attachments: [*]const ClearAttachment, rect_count: u32, p_rects: [*]const ClearRect, ) void { self.vkCmdClearAttachments( command_buffer, attachment_count, p_attachments, rect_count, p_rects, ); } pub fn cmdResolveImage( self: Self, command_buffer: CommandBuffer, src_image: Image, src_image_layout: ImageLayout, dst_image: Image, dst_image_layout: ImageLayout, region_count: u32, p_regions: [*]const ImageResolve, ) void { self.vkCmdResolveImage( command_buffer, src_image, src_image_layout, dst_image, dst_image_layout, region_count, p_regions, ); } pub fn cmdSetEvent( self: Self, command_buffer: CommandBuffer, event: Event, stage_mask: PipelineStageFlags, ) void { self.vkCmdSetEvent( command_buffer, event, stage_mask.toInt(), ); } pub fn cmdResetEvent( self: Self, command_buffer: CommandBuffer, event: Event, stage_mask: PipelineStageFlags, ) void { self.vkCmdResetEvent( command_buffer, event, stage_mask.toInt(), ); } pub fn cmdWaitEvents( self: Self, command_buffer: CommandBuffer, event_count: u32, p_events: [*]const Event, src_stage_mask: PipelineStageFlags, dst_stage_mask: PipelineStageFlags, memory_barrier_count: u32, p_memory_barriers: [*]const MemoryBarrier, buffer_memory_barrier_count: u32, p_buffer_memory_barriers: [*]const BufferMemoryBarrier, image_memory_barrier_count: u32, p_image_memory_barriers: [*]const ImageMemoryBarrier, ) void { self.vkCmdWaitEvents( command_buffer, event_count, p_events, src_stage_mask.toInt(), dst_stage_mask.toInt(), memory_barrier_count, p_memory_barriers, buffer_memory_barrier_count, p_buffer_memory_barriers, image_memory_barrier_count, p_image_memory_barriers, ); } pub fn cmdPipelineBarrier( self: Self, command_buffer: CommandBuffer, src_stage_mask: PipelineStageFlags, dst_stage_mask: PipelineStageFlags, dependency_flags: DependencyFlags, memory_barrier_count: u32, p_memory_barriers: [*]const MemoryBarrier, buffer_memory_barrier_count: u32, p_buffer_memory_barriers: [*]const BufferMemoryBarrier, image_memory_barrier_count: u32, p_image_memory_barriers: [*]const ImageMemoryBarrier, ) void { self.vkCmdPipelineBarrier( command_buffer, src_stage_mask.toInt(), dst_stage_mask.toInt(), dependency_flags.toInt(), memory_barrier_count, p_memory_barriers, buffer_memory_barrier_count, p_buffer_memory_barriers, image_memory_barrier_count, p_image_memory_barriers, ); } pub fn cmdBeginQuery( self: Self, command_buffer: CommandBuffer, query_pool: QueryPool, query: u32, flags: QueryControlFlags, ) void { self.vkCmdBeginQuery( command_buffer, query_pool, query, flags.toInt(), ); } pub fn cmdEndQuery( self: Self, command_buffer: CommandBuffer, query_pool: QueryPool, query: u32, ) void { self.vkCmdEndQuery( command_buffer, query_pool, query, ); } pub fn cmdBeginConditionalRenderingEXT( self: Self, command_buffer: CommandBuffer, conditional_rendering_begin: ConditionalRenderingBeginInfoEXT, ) void { self.vkCmdBeginConditionalRenderingEXT( command_buffer, &conditional_rendering_begin, ); } pub fn cmdEndConditionalRenderingEXT( self: Self, command_buffer: CommandBuffer, ) void { self.vkCmdEndConditionalRenderingEXT( command_buffer, ); } pub fn cmdResetQueryPool( self: Self, command_buffer: CommandBuffer, query_pool: QueryPool, first_query: u32, query_count: u32, ) void { self.vkCmdResetQueryPool( command_buffer, query_pool, first_query, query_count, ); } pub fn cmdWriteTimestamp( self: Self, command_buffer: CommandBuffer, pipeline_stage: PipelineStageFlags, query_pool: QueryPool, query: u32, ) void { self.vkCmdWriteTimestamp( command_buffer, pipeline_stage.toInt(), query_pool, query, ); } pub fn cmdCopyQueryPoolResults( self: Self, command_buffer: CommandBuffer, query_pool: QueryPool, first_query: u32, query_count: u32, dst_buffer: Buffer, dst_offset: DeviceSize, stride: DeviceSize, flags: QueryResultFlags, ) void { self.vkCmdCopyQueryPoolResults( command_buffer, query_pool, first_query, query_count, dst_buffer, dst_offset, stride, flags.toInt(), ); } pub fn cmdPushConstants( self: Self, command_buffer: CommandBuffer, layout: PipelineLayout, stage_flags: ShaderStageFlags, offset: u32, size: u32, p_values: *const anyopaque, ) void { self.vkCmdPushConstants( command_buffer, layout, stage_flags.toInt(), offset, size, p_values, ); } pub fn cmdBeginRenderPass( self: Self, command_buffer: CommandBuffer, render_pass_begin: RenderPassBeginInfo, contents: SubpassContents, ) void { self.vkCmdBeginRenderPass( command_buffer, &render_pass_begin, contents, ); } pub fn cmdNextSubpass( self: Self, command_buffer: CommandBuffer, contents: SubpassContents, ) void { self.vkCmdNextSubpass( command_buffer, contents, ); } pub fn cmdEndRenderPass( self: Self, command_buffer: CommandBuffer, ) void { self.vkCmdEndRenderPass( command_buffer, ); } pub fn cmdExecuteCommands( self: Self, command_buffer: CommandBuffer, command_buffer_count: u32, p_command_buffers: [*]const CommandBuffer, ) void { self.vkCmdExecuteCommands( command_buffer, command_buffer_count, p_command_buffers, ); } pub fn createSharedSwapchainsKHR( self: Self, device: Device, swapchain_count: u32, p_create_infos: [*]const SwapchainCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, p_swapchains: [*]SwapchainKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, IncompatibleDisplayKHR, DeviceLost, SurfaceLostKHR, Unknown, }!void { const result = self.vkCreateSharedSwapchainsKHR( device, swapchain_count, p_create_infos, p_allocator, p_swapchains, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_incompatible_display_khr => return error.IncompatibleDisplayKHR, .error_device_lost => return error.DeviceLost, .error_surface_lost_khr => return error.SurfaceLostKHR, else => return error.Unknown, } } pub fn createSwapchainKHR( self: Self, device: Device, create_info: SwapchainCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, DeviceLost, SurfaceLostKHR, NativeWindowInUseKHR, InitializationFailed, Unknown, }!SwapchainKHR { var swapchain: SwapchainKHR = undefined; const result = self.vkCreateSwapchainKHR( device, &create_info, p_allocator, &swapchain, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_device_lost => return error.DeviceLost, .error_surface_lost_khr => return error.SurfaceLostKHR, .error_native_window_in_use_khr => return error.NativeWindowInUseKHR, .error_initialization_failed => return error.InitializationFailed, else => return error.Unknown, } return swapchain; } pub fn destroySwapchainKHR( self: Self, device: Device, swapchain: SwapchainKHR, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroySwapchainKHR( device, swapchain, p_allocator, ); } pub fn getSwapchainImagesKHR( self: Self, device: Device, swapchain: SwapchainKHR, p_swapchain_image_count: *u32, p_swapchain_images: ?[*]Image, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Result { const result = self.vkGetSwapchainImagesKHR( device, swapchain, p_swapchain_image_count, p_swapchain_images, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return result; } pub const AcquireNextImageKHRResult = struct { result: Result, image_index: u32, }; pub fn acquireNextImageKHR( self: Self, device: Device, swapchain: SwapchainKHR, timeout: u64, semaphore: Semaphore, fence: Fence, ) error{ OutOfHostMemory, OutOfDeviceMemory, DeviceLost, OutOfDateKHR, SurfaceLostKHR, FullScreenExclusiveModeLostEXT, Unknown, }!AcquireNextImageKHRResult { var return_values: AcquireNextImageKHRResult = undefined; const result = self.vkAcquireNextImageKHR( device, swapchain, timeout, semaphore, fence, &return_values.image_index, ); switch (result) { .success => {}, .timeout => {}, .not_ready => {}, .suboptimal_khr => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_device_lost => return error.DeviceLost, .error_out_of_date_khr => return error.OutOfDateKHR, .error_surface_lost_khr => return error.SurfaceLostKHR, .error_full_screen_exclusive_mode_lost_ext => return error.FullScreenExclusiveModeLostEXT, else => return error.Unknown, } return_values.result = result; return return_values; } pub fn queuePresentKHR( self: Self, queue: Queue, present_info: PresentInfoKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, DeviceLost, OutOfDateKHR, SurfaceLostKHR, FullScreenExclusiveModeLostEXT, Unknown, }!Result { const result = self.vkQueuePresentKHR( queue, &present_info, ); switch (result) { .success => {}, .suboptimal_khr => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_device_lost => return error.DeviceLost, .error_out_of_date_khr => return error.OutOfDateKHR, .error_surface_lost_khr => return error.SurfaceLostKHR, .error_full_screen_exclusive_mode_lost_ext => return error.FullScreenExclusiveModeLostEXT, else => return error.Unknown, } return result; } pub fn debugMarkerSetObjectNameEXT( self: Self, device: Device, name_info: DebugMarkerObjectNameInfoEXT, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!void { const result = self.vkDebugMarkerSetObjectNameEXT( device, &name_info, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn debugMarkerSetObjectTagEXT( self: Self, device: Device, tag_info: DebugMarkerObjectTagInfoEXT, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!void { const result = self.vkDebugMarkerSetObjectTagEXT( device, &tag_info, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn cmdDebugMarkerBeginEXT( self: Self, command_buffer: CommandBuffer, marker_info: DebugMarkerMarkerInfoEXT, ) void { self.vkCmdDebugMarkerBeginEXT( command_buffer, &marker_info, ); } pub fn cmdDebugMarkerEndEXT( self: Self, command_buffer: CommandBuffer, ) void { self.vkCmdDebugMarkerEndEXT( command_buffer, ); } pub fn cmdDebugMarkerInsertEXT( self: Self, command_buffer: CommandBuffer, marker_info: DebugMarkerMarkerInfoEXT, ) void { self.vkCmdDebugMarkerInsertEXT( command_buffer, &marker_info, ); } pub fn getMemoryWin32HandleNV( self: Self, device: Device, memory: DeviceMemory, handle_type: ExternalMemoryHandleTypeFlagsNV, p_handle: *HANDLE, ) error{ TooManyObjects, OutOfHostMemory, Unknown, }!void { const result = self.vkGetMemoryWin32HandleNV( device, memory, handle_type.toInt(), p_handle, ); switch (result) { .success => {}, .error_too_many_objects => return error.TooManyObjects, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } } pub fn cmdExecuteGeneratedCommandsNV( self: Self, command_buffer: CommandBuffer, is_preprocessed: Bool32, generated_commands_info: GeneratedCommandsInfoNV, ) void { self.vkCmdExecuteGeneratedCommandsNV( command_buffer, is_preprocessed, &generated_commands_info, ); } pub fn cmdPreprocessGeneratedCommandsNV( self: Self, command_buffer: CommandBuffer, generated_commands_info: GeneratedCommandsInfoNV, ) void { self.vkCmdPreprocessGeneratedCommandsNV( command_buffer, &generated_commands_info, ); } pub fn cmdBindPipelineShaderGroupNV( self: Self, command_buffer: CommandBuffer, pipeline_bind_point: PipelineBindPoint, pipeline: Pipeline, group_index: u32, ) void { self.vkCmdBindPipelineShaderGroupNV( command_buffer, pipeline_bind_point, pipeline, group_index, ); } pub fn getGeneratedCommandsMemoryRequirementsNV( self: Self, device: Device, info: GeneratedCommandsMemoryRequirementsInfoNV, p_memory_requirements: *MemoryRequirements2, ) void { self.vkGetGeneratedCommandsMemoryRequirementsNV( device, &info, p_memory_requirements, ); } pub fn createIndirectCommandsLayoutNV( self: Self, device: Device, create_info: IndirectCommandsLayoutCreateInfoNV, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!IndirectCommandsLayoutNV { var indirect_commands_layout: IndirectCommandsLayoutNV = undefined; const result = self.vkCreateIndirectCommandsLayoutNV( device, &create_info, p_allocator, &indirect_commands_layout, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return indirect_commands_layout; } pub fn destroyIndirectCommandsLayoutNV( self: Self, device: Device, indirect_commands_layout: IndirectCommandsLayoutNV, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyIndirectCommandsLayoutNV( device, indirect_commands_layout, p_allocator, ); } pub fn cmdPushDescriptorSetKHR( self: Self, command_buffer: CommandBuffer, pipeline_bind_point: PipelineBindPoint, layout: PipelineLayout, set: u32, descriptor_write_count: u32, p_descriptor_writes: [*]const WriteDescriptorSet, ) void { self.vkCmdPushDescriptorSetKHR( command_buffer, pipeline_bind_point, layout, set, descriptor_write_count, p_descriptor_writes, ); } pub fn trimCommandPool( self: Self, device: Device, command_pool: CommandPool, flags: CommandPoolTrimFlags, ) void { self.vkTrimCommandPool( device, command_pool, flags.toInt(), ); } pub fn getMemoryWin32HandleKHR( self: Self, device: Device, get_win_32_handle_info: MemoryGetWin32HandleInfoKHR, p_handle: *HANDLE, ) error{ TooManyObjects, OutOfHostMemory, Unknown, }!void { const result = self.vkGetMemoryWin32HandleKHR( device, &get_win_32_handle_info, p_handle, ); switch (result) { .success => {}, .error_too_many_objects => return error.TooManyObjects, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } } pub fn getMemoryWin32HandlePropertiesKHR( self: Self, device: Device, handle_type: ExternalMemoryHandleTypeFlags, handle: HANDLE, p_memory_win_32_handle_properties: *MemoryWin32HandlePropertiesKHR, ) error{ OutOfHostMemory, InvalidExternalHandle, Unknown, }!void { const result = self.vkGetMemoryWin32HandlePropertiesKHR( device, handle_type.toInt(), handle, p_memory_win_32_handle_properties, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_invalid_external_handle => return error.InvalidExternalHandle, else => return error.Unknown, } } pub fn getMemoryFdKHR( self: Self, device: Device, get_fd_info: MemoryGetFdInfoKHR, ) error{ TooManyObjects, OutOfHostMemory, Unknown, }!c_int { var fd: c_int = undefined; const result = self.vkGetMemoryFdKHR( device, &get_fd_info, &fd, ); switch (result) { .success => {}, .error_too_many_objects => return error.TooManyObjects, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } return fd; } pub fn getMemoryFdPropertiesKHR( self: Self, device: Device, handle_type: ExternalMemoryHandleTypeFlags, fd: c_int, p_memory_fd_properties: *MemoryFdPropertiesKHR, ) error{ OutOfHostMemory, InvalidExternalHandle, Unknown, }!void { const result = self.vkGetMemoryFdPropertiesKHR( device, handle_type.toInt(), fd, p_memory_fd_properties, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_invalid_external_handle => return error.InvalidExternalHandle, else => return error.Unknown, } } pub fn getMemoryZirconHandleFUCHSIA( self: Self, device: Device, get_zircon_handle_info: MemoryGetZirconHandleInfoFUCHSIA, p_zircon_handle: *zx_handle_t, ) error{ TooManyObjects, OutOfHostMemory, Unknown, }!void { const result = self.vkGetMemoryZirconHandleFUCHSIA( device, &get_zircon_handle_info, p_zircon_handle, ); switch (result) { .success => {}, .error_too_many_objects => return error.TooManyObjects, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } } pub fn getMemoryZirconHandlePropertiesFUCHSIA( self: Self, device: Device, handle_type: ExternalMemoryHandleTypeFlags, zircon_handle: zx_handle_t, p_memory_zircon_handle_properties: *MemoryZirconHandlePropertiesFUCHSIA, ) error{ InvalidExternalHandle, Unknown, }!void { const result = self.vkGetMemoryZirconHandlePropertiesFUCHSIA( device, handle_type.toInt(), zircon_handle, p_memory_zircon_handle_properties, ); switch (result) { .success => {}, .error_invalid_external_handle => return error.InvalidExternalHandle, else => return error.Unknown, } } pub fn getSemaphoreWin32HandleKHR( self: Self, device: Device, get_win_32_handle_info: SemaphoreGetWin32HandleInfoKHR, p_handle: *HANDLE, ) error{ TooManyObjects, OutOfHostMemory, Unknown, }!void { const result = self.vkGetSemaphoreWin32HandleKHR( device, &get_win_32_handle_info, p_handle, ); switch (result) { .success => {}, .error_too_many_objects => return error.TooManyObjects, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } } pub fn importSemaphoreWin32HandleKHR( self: Self, device: Device, import_semaphore_win_32_handle_info: ImportSemaphoreWin32HandleInfoKHR, ) error{ OutOfHostMemory, InvalidExternalHandle, Unknown, }!void { const result = self.vkImportSemaphoreWin32HandleKHR( device, &import_semaphore_win_32_handle_info, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_invalid_external_handle => return error.InvalidExternalHandle, else => return error.Unknown, } } pub fn getSemaphoreFdKHR( self: Self, device: Device, get_fd_info: SemaphoreGetFdInfoKHR, ) error{ TooManyObjects, OutOfHostMemory, Unknown, }!c_int { var fd: c_int = undefined; const result = self.vkGetSemaphoreFdKHR( device, &get_fd_info, &fd, ); switch (result) { .success => {}, .error_too_many_objects => return error.TooManyObjects, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } return fd; } pub fn importSemaphoreFdKHR( self: Self, device: Device, import_semaphore_fd_info: ImportSemaphoreFdInfoKHR, ) error{ OutOfHostMemory, InvalidExternalHandle, Unknown, }!void { const result = self.vkImportSemaphoreFdKHR( device, &import_semaphore_fd_info, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_invalid_external_handle => return error.InvalidExternalHandle, else => return error.Unknown, } } pub fn getSemaphoreZirconHandleFUCHSIA( self: Self, device: Device, get_zircon_handle_info: SemaphoreGetZirconHandleInfoFUCHSIA, p_zircon_handle: *zx_handle_t, ) error{ TooManyObjects, OutOfHostMemory, Unknown, }!void { const result = self.vkGetSemaphoreZirconHandleFUCHSIA( device, &get_zircon_handle_info, p_zircon_handle, ); switch (result) { .success => {}, .error_too_many_objects => return error.TooManyObjects, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } } pub fn importSemaphoreZirconHandleFUCHSIA( self: Self, device: Device, import_semaphore_zircon_handle_info: ImportSemaphoreZirconHandleInfoFUCHSIA, ) error{ OutOfHostMemory, InvalidExternalHandle, Unknown, }!void { const result = self.vkImportSemaphoreZirconHandleFUCHSIA( device, &import_semaphore_zircon_handle_info, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_invalid_external_handle => return error.InvalidExternalHandle, else => return error.Unknown, } } pub fn getFenceWin32HandleKHR( self: Self, device: Device, get_win_32_handle_info: FenceGetWin32HandleInfoKHR, p_handle: *HANDLE, ) error{ TooManyObjects, OutOfHostMemory, Unknown, }!void { const result = self.vkGetFenceWin32HandleKHR( device, &get_win_32_handle_info, p_handle, ); switch (result) { .success => {}, .error_too_many_objects => return error.TooManyObjects, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } } pub fn importFenceWin32HandleKHR( self: Self, device: Device, import_fence_win_32_handle_info: ImportFenceWin32HandleInfoKHR, ) error{ OutOfHostMemory, InvalidExternalHandle, Unknown, }!void { const result = self.vkImportFenceWin32HandleKHR( device, &import_fence_win_32_handle_info, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_invalid_external_handle => return error.InvalidExternalHandle, else => return error.Unknown, } } pub fn getFenceFdKHR( self: Self, device: Device, get_fd_info: FenceGetFdInfoKHR, ) error{ TooManyObjects, OutOfHostMemory, Unknown, }!c_int { var fd: c_int = undefined; const result = self.vkGetFenceFdKHR( device, &get_fd_info, &fd, ); switch (result) { .success => {}, .error_too_many_objects => return error.TooManyObjects, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } return fd; } pub fn importFenceFdKHR( self: Self, device: Device, import_fence_fd_info: ImportFenceFdInfoKHR, ) error{ OutOfHostMemory, InvalidExternalHandle, Unknown, }!void { const result = self.vkImportFenceFdKHR( device, &import_fence_fd_info, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_invalid_external_handle => return error.InvalidExternalHandle, else => return error.Unknown, } } pub fn displayPowerControlEXT( self: Self, device: Device, display: DisplayKHR, display_power_info: DisplayPowerInfoEXT, ) error{ OutOfHostMemory, Unknown, }!void { const result = self.vkDisplayPowerControlEXT( device, display, &display_power_info, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } } pub fn registerDeviceEventEXT( self: Self, device: Device, device_event_info: DeviceEventInfoEXT, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, Unknown, }!Fence { var fence: Fence = undefined; const result = self.vkRegisterDeviceEventEXT( device, &device_event_info, p_allocator, &fence, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } return fence; } pub fn registerDisplayEventEXT( self: Self, device: Device, display: DisplayKHR, display_event_info: DisplayEventInfoEXT, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, Unknown, }!Fence { var fence: Fence = undefined; const result = self.vkRegisterDisplayEventEXT( device, display, &display_event_info, p_allocator, &fence, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } return fence; } pub fn getSwapchainCounterEXT( self: Self, device: Device, swapchain: SwapchainKHR, counter: SurfaceCounterFlagsEXT, ) error{ OutOfHostMemory, DeviceLost, OutOfDateKHR, Unknown, }!u64 { var counter_value: u64 = undefined; const result = self.vkGetSwapchainCounterEXT( device, swapchain, counter.toInt(), &counter_value, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_device_lost => return error.DeviceLost, .error_out_of_date_khr => return error.OutOfDateKHR, else => return error.Unknown, } return counter_value; } pub fn getDeviceGroupPeerMemoryFeatures( self: Self, device: Device, heap_index: u32, local_device_index: u32, remote_device_index: u32, ) PeerMemoryFeatureFlags { var peer_memory_features: PeerMemoryFeatureFlags = undefined; self.vkGetDeviceGroupPeerMemoryFeatures( device, heap_index, local_device_index, remote_device_index, &peer_memory_features, ); return peer_memory_features; } pub fn bindBufferMemory2( self: Self, device: Device, bind_info_count: u32, p_bind_infos: [*]const BindBufferMemoryInfo, ) error{ OutOfHostMemory, OutOfDeviceMemory, InvalidOpaqueCaptureAddressKHR, Unknown, }!void { const result = self.vkBindBufferMemory2( device, bind_info_count, p_bind_infos, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_invalid_opaque_capture_address => return error.InvalidOpaqueCaptureAddressKHR, else => return error.Unknown, } } pub fn bindImageMemory2( self: Self, device: Device, bind_info_count: u32, p_bind_infos: [*]const BindImageMemoryInfo, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!void { const result = self.vkBindImageMemory2( device, bind_info_count, p_bind_infos, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn cmdSetDeviceMask( self: Self, command_buffer: CommandBuffer, device_mask: u32, ) void { self.vkCmdSetDeviceMask( command_buffer, device_mask, ); } pub fn getDeviceGroupPresentCapabilitiesKHR( self: Self, device: Device, p_device_group_present_capabilities: *DeviceGroupPresentCapabilitiesKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!void { const result = self.vkGetDeviceGroupPresentCapabilitiesKHR( device, p_device_group_present_capabilities, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn getDeviceGroupSurfacePresentModesKHR( self: Self, device: Device, surface: SurfaceKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, SurfaceLostKHR, Unknown, }!DeviceGroupPresentModeFlagsKHR { var modes: DeviceGroupPresentModeFlagsKHR = undefined; const result = self.vkGetDeviceGroupSurfacePresentModesKHR( device, surface, &modes, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_surface_lost_khr => return error.SurfaceLostKHR, else => return error.Unknown, } return modes; } pub const AcquireNextImage2KHRResult = struct { result: Result, image_index: u32, }; pub fn acquireNextImage2KHR( self: Self, device: Device, acquire_info: AcquireNextImageInfoKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, DeviceLost, OutOfDateKHR, SurfaceLostKHR, FullScreenExclusiveModeLostEXT, Unknown, }!AcquireNextImage2KHRResult { var return_values: AcquireNextImage2KHRResult = undefined; const result = self.vkAcquireNextImage2KHR( device, &acquire_info, &return_values.image_index, ); switch (result) { .success => {}, .timeout => {}, .not_ready => {}, .suboptimal_khr => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_device_lost => return error.DeviceLost, .error_out_of_date_khr => return error.OutOfDateKHR, .error_surface_lost_khr => return error.SurfaceLostKHR, .error_full_screen_exclusive_mode_lost_ext => return error.FullScreenExclusiveModeLostEXT, else => return error.Unknown, } return_values.result = result; return return_values; } pub fn cmdDispatchBase( self: Self, command_buffer: CommandBuffer, base_group_x: u32, base_group_y: u32, base_group_z: u32, group_count_x: u32, group_count_y: u32, group_count_z: u32, ) void { self.vkCmdDispatchBase( command_buffer, base_group_x, base_group_y, base_group_z, group_count_x, group_count_y, group_count_z, ); } pub fn createDescriptorUpdateTemplate( self: Self, device: Device, create_info: DescriptorUpdateTemplateCreateInfo, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!DescriptorUpdateTemplate { var descriptor_update_template: DescriptorUpdateTemplate = undefined; const result = self.vkCreateDescriptorUpdateTemplate( device, &create_info, p_allocator, &descriptor_update_template, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return descriptor_update_template; } pub fn destroyDescriptorUpdateTemplate( self: Self, device: Device, descriptor_update_template: DescriptorUpdateTemplate, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyDescriptorUpdateTemplate( device, descriptor_update_template, p_allocator, ); } pub fn updateDescriptorSetWithTemplate( self: Self, device: Device, descriptor_set: DescriptorSet, descriptor_update_template: DescriptorUpdateTemplate, p_data: *const anyopaque, ) void { self.vkUpdateDescriptorSetWithTemplate( device, descriptor_set, descriptor_update_template, p_data, ); } pub fn cmdPushDescriptorSetWithTemplateKHR( self: Self, command_buffer: CommandBuffer, descriptor_update_template: DescriptorUpdateTemplate, layout: PipelineLayout, set: u32, p_data: *const anyopaque, ) void { self.vkCmdPushDescriptorSetWithTemplateKHR( command_buffer, descriptor_update_template, layout, set, p_data, ); } pub fn setHdrMetadataEXT( self: Self, device: Device, swapchain_count: u32, p_swapchains: [*]const SwapchainKHR, p_metadata: [*]const HdrMetadataEXT, ) void { self.vkSetHdrMetadataEXT( device, swapchain_count, p_swapchains, p_metadata, ); } pub fn getSwapchainStatusKHR( self: Self, device: Device, swapchain: SwapchainKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, DeviceLost, OutOfDateKHR, SurfaceLostKHR, FullScreenExclusiveModeLostEXT, Unknown, }!Result { const result = self.vkGetSwapchainStatusKHR( device, swapchain, ); switch (result) { .success => {}, .suboptimal_khr => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_device_lost => return error.DeviceLost, .error_out_of_date_khr => return error.OutOfDateKHR, .error_surface_lost_khr => return error.SurfaceLostKHR, .error_full_screen_exclusive_mode_lost_ext => return error.FullScreenExclusiveModeLostEXT, else => return error.Unknown, } return result; } pub fn getRefreshCycleDurationGOOGLE( self: Self, device: Device, swapchain: SwapchainKHR, ) error{ OutOfHostMemory, DeviceLost, SurfaceLostKHR, Unknown, }!RefreshCycleDurationGOOGLE { var display_timing_properties: RefreshCycleDurationGOOGLE = undefined; const result = self.vkGetRefreshCycleDurationGOOGLE( device, swapchain, &display_timing_properties, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_device_lost => return error.DeviceLost, .error_surface_lost_khr => return error.SurfaceLostKHR, else => return error.Unknown, } return display_timing_properties; } pub fn getPastPresentationTimingGOOGLE( self: Self, device: Device, swapchain: SwapchainKHR, p_presentation_timing_count: *u32, p_presentation_timings: ?[*]PastPresentationTimingGOOGLE, ) error{ OutOfHostMemory, DeviceLost, OutOfDateKHR, SurfaceLostKHR, Unknown, }!Result { const result = self.vkGetPastPresentationTimingGOOGLE( device, swapchain, p_presentation_timing_count, p_presentation_timings, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_device_lost => return error.DeviceLost, .error_out_of_date_khr => return error.OutOfDateKHR, .error_surface_lost_khr => return error.SurfaceLostKHR, else => return error.Unknown, } return result; } pub fn cmdSetViewportWScalingNV( self: Self, command_buffer: CommandBuffer, first_viewport: u32, viewport_count: u32, p_viewport_w_scalings: [*]const ViewportWScalingNV, ) void { self.vkCmdSetViewportWScalingNV( command_buffer, first_viewport, viewport_count, p_viewport_w_scalings, ); } pub fn cmdSetDiscardRectangleEXT( self: Self, command_buffer: CommandBuffer, first_discard_rectangle: u32, discard_rectangle_count: u32, p_discard_rectangles: [*]const Rect2D, ) void { self.vkCmdSetDiscardRectangleEXT( command_buffer, first_discard_rectangle, discard_rectangle_count, p_discard_rectangles, ); } pub fn cmdSetSampleLocationsEXT( self: Self, command_buffer: CommandBuffer, sample_locations_info: SampleLocationsInfoEXT, ) void { self.vkCmdSetSampleLocationsEXT( command_buffer, &sample_locations_info, ); } pub fn getBufferMemoryRequirements2( self: Self, device: Device, info: BufferMemoryRequirementsInfo2, p_memory_requirements: *MemoryRequirements2, ) void { self.vkGetBufferMemoryRequirements2( device, &info, p_memory_requirements, ); } pub fn getImageMemoryRequirements2( self: Self, device: Device, info: ImageMemoryRequirementsInfo2, p_memory_requirements: *MemoryRequirements2, ) void { self.vkGetImageMemoryRequirements2( device, &info, p_memory_requirements, ); } pub fn getImageSparseMemoryRequirements2( self: Self, device: Device, info: ImageSparseMemoryRequirementsInfo2, p_sparse_memory_requirement_count: *u32, p_sparse_memory_requirements: ?[*]SparseImageMemoryRequirements2, ) void { self.vkGetImageSparseMemoryRequirements2( device, &info, p_sparse_memory_requirement_count, p_sparse_memory_requirements, ); } pub fn createSamplerYcbcrConversion( self: Self, device: Device, create_info: SamplerYcbcrConversionCreateInfo, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!SamplerYcbcrConversion { var ycbcr_conversion: SamplerYcbcrConversion = undefined; const result = self.vkCreateSamplerYcbcrConversion( device, &create_info, p_allocator, &ycbcr_conversion, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return ycbcr_conversion; } pub fn destroySamplerYcbcrConversion( self: Self, device: Device, ycbcr_conversion: SamplerYcbcrConversion, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroySamplerYcbcrConversion( device, ycbcr_conversion, p_allocator, ); } pub fn getDeviceQueue2( self: Self, device: Device, queue_info: DeviceQueueInfo2, ) Queue { var queue: Queue = undefined; self.vkGetDeviceQueue2( device, &queue_info, &queue, ); return queue; } pub fn createValidationCacheEXT( self: Self, device: Device, create_info: ValidationCacheCreateInfoEXT, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, Unknown, }!ValidationCacheEXT { var validation_cache: ValidationCacheEXT = undefined; const result = self.vkCreateValidationCacheEXT( device, &create_info, p_allocator, &validation_cache, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } return validation_cache; } pub fn destroyValidationCacheEXT( self: Self, device: Device, validation_cache: ValidationCacheEXT, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyValidationCacheEXT( device, validation_cache, p_allocator, ); } pub fn getValidationCacheDataEXT( self: Self, device: Device, validation_cache: ValidationCacheEXT, p_data_size: *usize, p_data: ?*anyopaque, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Result { const result = self.vkGetValidationCacheDataEXT( device, validation_cache, p_data_size, p_data, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return result; } pub fn mergeValidationCachesEXT( self: Self, device: Device, dst_cache: ValidationCacheEXT, src_cache_count: u32, p_src_caches: [*]const ValidationCacheEXT, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!void { const result = self.vkMergeValidationCachesEXT( device, dst_cache, src_cache_count, p_src_caches, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn getDescriptorSetLayoutSupport( self: Self, device: Device, create_info: DescriptorSetLayoutCreateInfo, p_support: *DescriptorSetLayoutSupport, ) void { self.vkGetDescriptorSetLayoutSupport( device, &create_info, p_support, ); } pub fn getSwapchainGrallocUsageANDROID( self: Self, device: Device, format: Format, image_usage: ImageUsageFlags, ) error{ Unknown, }!c_int { var gralloc_usage: c_int = undefined; const result = self.vkGetSwapchainGrallocUsageANDROID( device, format, image_usage.toInt(), &gralloc_usage, ); switch (result) { else => return error.Unknown, } return gralloc_usage; } pub const GetSwapchainGrallocUsage2ANDROIDResult = struct { gralloc_consumer_usage: u64, gralloc_producer_usage: u64, }; pub fn getSwapchainGrallocUsage2ANDROID( self: Self, device: Device, format: Format, image_usage: ImageUsageFlags, swapchain_image_usage: SwapchainImageUsageFlagsANDROID, ) error{ Unknown, }!GetSwapchainGrallocUsage2ANDROIDResult { var return_values: GetSwapchainGrallocUsage2ANDROIDResult = undefined; const result = self.vkGetSwapchainGrallocUsage2ANDROID( device, format, image_usage.toInt(), swapchain_image_usage.toInt(), &return_values.gralloc_consumer_usage, &return_values.gralloc_producer_usage, ); switch (result) { else => return error.Unknown, } return return_values; } pub fn acquireImageANDROID( self: Self, device: Device, image: Image, native_fence_fd: c_int, semaphore: Semaphore, fence: Fence, ) error{ Unknown, }!void { const result = self.vkAcquireImageANDROID( device, image, native_fence_fd, semaphore, fence, ); switch (result) { else => return error.Unknown, } } pub fn queueSignalReleaseImageANDROID( self: Self, queue: Queue, wait_semaphore_count: u32, p_wait_semaphores: [*]const Semaphore, image: Image, ) error{ Unknown, }!c_int { var native_fence_fd: c_int = undefined; const result = self.vkQueueSignalReleaseImageANDROID( queue, wait_semaphore_count, p_wait_semaphores, image, &native_fence_fd, ); switch (result) { else => return error.Unknown, } return native_fence_fd; } pub fn getShaderInfoAMD( self: Self, device: Device, pipeline: Pipeline, shader_stage: ShaderStageFlags, info_type: ShaderInfoTypeAMD, p_info_size: *usize, p_info: ?*anyopaque, ) error{ FeatureNotPresent, OutOfHostMemory, Unknown, }!Result { const result = self.vkGetShaderInfoAMD( device, pipeline, shader_stage.toInt(), info_type, p_info_size, p_info, ); switch (result) { .success => {}, .incomplete => {}, .error_feature_not_present => return error.FeatureNotPresent, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } return result; } pub fn setLocalDimmingAMD( self: Self, device: Device, swap_chain: SwapchainKHR, local_dimming_enable: Bool32, ) void { self.vkSetLocalDimmingAMD( device, swap_chain, local_dimming_enable, ); } pub fn getCalibratedTimestampsEXT( self: Self, device: Device, timestamp_count: u32, p_timestamp_infos: [*]const CalibratedTimestampInfoEXT, p_timestamps: [*]u64, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!u64 { var max_deviation: u64 = undefined; const result = self.vkGetCalibratedTimestampsEXT( device, timestamp_count, p_timestamp_infos, p_timestamps, &max_deviation, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return max_deviation; } pub fn setDebugUtilsObjectNameEXT( self: Self, device: Device, name_info: DebugUtilsObjectNameInfoEXT, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!void { const result = self.vkSetDebugUtilsObjectNameEXT( device, &name_info, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn setDebugUtilsObjectTagEXT( self: Self, device: Device, tag_info: DebugUtilsObjectTagInfoEXT, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!void { const result = self.vkSetDebugUtilsObjectTagEXT( device, &tag_info, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn queueBeginDebugUtilsLabelEXT( self: Self, queue: Queue, label_info: DebugUtilsLabelEXT, ) void { self.vkQueueBeginDebugUtilsLabelEXT( queue, &label_info, ); } pub fn queueEndDebugUtilsLabelEXT( self: Self, queue: Queue, ) void { self.vkQueueEndDebugUtilsLabelEXT( queue, ); } pub fn queueInsertDebugUtilsLabelEXT( self: Self, queue: Queue, label_info: DebugUtilsLabelEXT, ) void { self.vkQueueInsertDebugUtilsLabelEXT( queue, &label_info, ); } pub fn cmdBeginDebugUtilsLabelEXT( self: Self, command_buffer: CommandBuffer, label_info: DebugUtilsLabelEXT, ) void { self.vkCmdBeginDebugUtilsLabelEXT( command_buffer, &label_info, ); } pub fn cmdEndDebugUtilsLabelEXT( self: Self, command_buffer: CommandBuffer, ) void { self.vkCmdEndDebugUtilsLabelEXT( command_buffer, ); } pub fn cmdInsertDebugUtilsLabelEXT( self: Self, command_buffer: CommandBuffer, label_info: DebugUtilsLabelEXT, ) void { self.vkCmdInsertDebugUtilsLabelEXT( command_buffer, &label_info, ); } pub fn getMemoryHostPointerPropertiesEXT( self: Self, device: Device, handle_type: ExternalMemoryHandleTypeFlags, p_host_pointer: *const anyopaque, p_memory_host_pointer_properties: *MemoryHostPointerPropertiesEXT, ) error{ OutOfHostMemory, InvalidExternalHandle, Unknown, }!void { const result = self.vkGetMemoryHostPointerPropertiesEXT( device, handle_type.toInt(), p_host_pointer, p_memory_host_pointer_properties, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_invalid_external_handle => return error.InvalidExternalHandle, else => return error.Unknown, } } pub fn cmdWriteBufferMarkerAMD( self: Self, command_buffer: CommandBuffer, pipeline_stage: PipelineStageFlags, dst_buffer: Buffer, dst_offset: DeviceSize, marker: u32, ) void { self.vkCmdWriteBufferMarkerAMD( command_buffer, pipeline_stage.toInt(), dst_buffer, dst_offset, marker, ); } pub fn createRenderPass2( self: Self, device: Device, create_info: RenderPassCreateInfo2, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!RenderPass { var render_pass: RenderPass = undefined; const result = self.vkCreateRenderPass2( device, &create_info, p_allocator, &render_pass, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return render_pass; } pub fn cmdBeginRenderPass2( self: Self, command_buffer: CommandBuffer, render_pass_begin: RenderPassBeginInfo, subpass_begin_info: SubpassBeginInfo, ) void { self.vkCmdBeginRenderPass2( command_buffer, &render_pass_begin, &subpass_begin_info, ); } pub fn cmdNextSubpass2( self: Self, command_buffer: CommandBuffer, subpass_begin_info: SubpassBeginInfo, subpass_end_info: SubpassEndInfo, ) void { self.vkCmdNextSubpass2( command_buffer, &subpass_begin_info, &subpass_end_info, ); } pub fn cmdEndRenderPass2( self: Self, command_buffer: CommandBuffer, subpass_end_info: SubpassEndInfo, ) void { self.vkCmdEndRenderPass2( command_buffer, &subpass_end_info, ); } pub fn getSemaphoreCounterValue( self: Self, device: Device, semaphore: Semaphore, ) error{ OutOfHostMemory, OutOfDeviceMemory, DeviceLost, Unknown, }!u64 { var value: u64 = undefined; const result = self.vkGetSemaphoreCounterValue( device, semaphore, &value, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_device_lost => return error.DeviceLost, else => return error.Unknown, } return value; } pub fn waitSemaphores( self: Self, device: Device, wait_info: SemaphoreWaitInfo, timeout: u64, ) error{ OutOfHostMemory, OutOfDeviceMemory, DeviceLost, Unknown, }!Result { const result = self.vkWaitSemaphores( device, &wait_info, timeout, ); switch (result) { .success => {}, .timeout => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_device_lost => return error.DeviceLost, else => return error.Unknown, } return result; } pub fn signalSemaphore( self: Self, device: Device, signal_info: SemaphoreSignalInfo, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!void { const result = self.vkSignalSemaphore( device, &signal_info, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn getAndroidHardwareBufferPropertiesANDROID( self: Self, device: Device, buffer: *const AHardwareBuffer, p_properties: *AndroidHardwareBufferPropertiesANDROID, ) error{ OutOfHostMemory, InvalidExternalHandleKHR, Unknown, }!void { const result = self.vkGetAndroidHardwareBufferPropertiesANDROID( device, buffer, p_properties, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_invalid_external_handle_khr => return error.InvalidExternalHandleKHR, else => return error.Unknown, } } pub fn getMemoryAndroidHardwareBufferANDROID( self: Self, device: Device, info: MemoryGetAndroidHardwareBufferInfoANDROID, ) error{ TooManyObjects, OutOfHostMemory, Unknown, }!*AHardwareBuffer { var buffer: *AHardwareBuffer = undefined; const result = self.vkGetMemoryAndroidHardwareBufferANDROID( device, &info, &buffer, ); switch (result) { .success => {}, .error_too_many_objects => return error.TooManyObjects, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } return buffer; } pub fn cmdDrawIndirectCount( self: Self, command_buffer: CommandBuffer, buffer: Buffer, offset: DeviceSize, count_buffer: Buffer, count_buffer_offset: DeviceSize, max_draw_count: u32, stride: u32, ) void { self.vkCmdDrawIndirectCount( command_buffer, buffer, offset, count_buffer, count_buffer_offset, max_draw_count, stride, ); } pub fn cmdDrawIndexedIndirectCount( self: Self, command_buffer: CommandBuffer, buffer: Buffer, offset: DeviceSize, count_buffer: Buffer, count_buffer_offset: DeviceSize, max_draw_count: u32, stride: u32, ) void { self.vkCmdDrawIndexedIndirectCount( command_buffer, buffer, offset, count_buffer, count_buffer_offset, max_draw_count, stride, ); } pub fn cmdSetCheckpointNV( self: Self, command_buffer: CommandBuffer, p_checkpoint_marker: *const anyopaque, ) void { self.vkCmdSetCheckpointNV( command_buffer, p_checkpoint_marker, ); } pub fn getQueueCheckpointDataNV( self: Self, queue: Queue, p_checkpoint_data_count: *u32, p_checkpoint_data: ?[*]CheckpointDataNV, ) void { self.vkGetQueueCheckpointDataNV( queue, p_checkpoint_data_count, p_checkpoint_data, ); } pub fn cmdBindTransformFeedbackBuffersEXT( self: Self, command_buffer: CommandBuffer, first_binding: u32, binding_count: u32, p_buffers: [*]const Buffer, p_offsets: [*]const DeviceSize, p_sizes: ?[*]const DeviceSize, ) void { self.vkCmdBindTransformFeedbackBuffersEXT( command_buffer, first_binding, binding_count, p_buffers, p_offsets, p_sizes, ); } pub fn cmdBeginTransformFeedbackEXT( self: Self, command_buffer: CommandBuffer, first_counter_buffer: u32, counter_buffer_count: u32, p_counter_buffers: [*]const Buffer, p_counter_buffer_offsets: ?[*]const DeviceSize, ) void { self.vkCmdBeginTransformFeedbackEXT( command_buffer, first_counter_buffer, counter_buffer_count, p_counter_buffers, p_counter_buffer_offsets, ); } pub fn cmdEndTransformFeedbackEXT( self: Self, command_buffer: CommandBuffer, first_counter_buffer: u32, counter_buffer_count: u32, p_counter_buffers: [*]const Buffer, p_counter_buffer_offsets: ?[*]const DeviceSize, ) void { self.vkCmdEndTransformFeedbackEXT( command_buffer, first_counter_buffer, counter_buffer_count, p_counter_buffers, p_counter_buffer_offsets, ); } pub fn cmdBeginQueryIndexedEXT( self: Self, command_buffer: CommandBuffer, query_pool: QueryPool, query: u32, flags: QueryControlFlags, index: u32, ) void { self.vkCmdBeginQueryIndexedEXT( command_buffer, query_pool, query, flags.toInt(), index, ); } pub fn cmdEndQueryIndexedEXT( self: Self, command_buffer: CommandBuffer, query_pool: QueryPool, query: u32, index: u32, ) void { self.vkCmdEndQueryIndexedEXT( command_buffer, query_pool, query, index, ); } pub fn cmdDrawIndirectByteCountEXT( self: Self, command_buffer: CommandBuffer, instance_count: u32, first_instance: u32, counter_buffer: Buffer, counter_buffer_offset: DeviceSize, counter_offset: u32, vertex_stride: u32, ) void { self.vkCmdDrawIndirectByteCountEXT( command_buffer, instance_count, first_instance, counter_buffer, counter_buffer_offset, counter_offset, vertex_stride, ); } pub fn cmdSetExclusiveScissorNV( self: Self, command_buffer: CommandBuffer, first_exclusive_scissor: u32, exclusive_scissor_count: u32, p_exclusive_scissors: [*]const Rect2D, ) void { self.vkCmdSetExclusiveScissorNV( command_buffer, first_exclusive_scissor, exclusive_scissor_count, p_exclusive_scissors, ); } pub fn cmdBindShadingRateImageNV( self: Self, command_buffer: CommandBuffer, image_view: ImageView, image_layout: ImageLayout, ) void { self.vkCmdBindShadingRateImageNV( command_buffer, image_view, image_layout, ); } pub fn cmdSetViewportShadingRatePaletteNV( self: Self, command_buffer: CommandBuffer, first_viewport: u32, viewport_count: u32, p_shading_rate_palettes: [*]const ShadingRatePaletteNV, ) void { self.vkCmdSetViewportShadingRatePaletteNV( command_buffer, first_viewport, viewport_count, p_shading_rate_palettes, ); } pub fn cmdSetCoarseSampleOrderNV( self: Self, command_buffer: CommandBuffer, sample_order_type: CoarseSampleOrderTypeNV, custom_sample_order_count: u32, p_custom_sample_orders: [*]const CoarseSampleOrderCustomNV, ) void { self.vkCmdSetCoarseSampleOrderNV( command_buffer, sample_order_type, custom_sample_order_count, p_custom_sample_orders, ); } pub fn cmdDrawMeshTasksNV( self: Self, command_buffer: CommandBuffer, task_count: u32, first_task: u32, ) void { self.vkCmdDrawMeshTasksNV( command_buffer, task_count, first_task, ); } pub fn cmdDrawMeshTasksIndirectNV( self: Self, command_buffer: CommandBuffer, buffer: Buffer, offset: DeviceSize, draw_count: u32, stride: u32, ) void { self.vkCmdDrawMeshTasksIndirectNV( command_buffer, buffer, offset, draw_count, stride, ); } pub fn cmdDrawMeshTasksIndirectCountNV( self: Self, command_buffer: CommandBuffer, buffer: Buffer, offset: DeviceSize, count_buffer: Buffer, count_buffer_offset: DeviceSize, max_draw_count: u32, stride: u32, ) void { self.vkCmdDrawMeshTasksIndirectCountNV( command_buffer, buffer, offset, count_buffer, count_buffer_offset, max_draw_count, stride, ); } pub fn compileDeferredNV( self: Self, device: Device, pipeline: Pipeline, shader: u32, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!void { const result = self.vkCompileDeferredNV( device, pipeline, shader, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn createAccelerationStructureNV( self: Self, device: Device, create_info: AccelerationStructureCreateInfoNV, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, Unknown, }!AccelerationStructureNV { var acceleration_structure: AccelerationStructureNV = undefined; const result = self.vkCreateAccelerationStructureNV( device, &create_info, p_allocator, &acceleration_structure, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } return acceleration_structure; } pub fn destroyAccelerationStructureKHR( self: Self, device: Device, acceleration_structure: AccelerationStructureKHR, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyAccelerationStructureKHR( device, acceleration_structure, p_allocator, ); } pub fn destroyAccelerationStructureNV( self: Self, device: Device, acceleration_structure: AccelerationStructureNV, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyAccelerationStructureNV( device, acceleration_structure, p_allocator, ); } pub fn getAccelerationStructureMemoryRequirementsNV( self: Self, device: Device, info: AccelerationStructureMemoryRequirementsInfoNV, p_memory_requirements: *MemoryRequirements2KHR, ) void { self.vkGetAccelerationStructureMemoryRequirementsNV( device, &info, p_memory_requirements, ); } pub fn bindAccelerationStructureMemoryNV( self: Self, device: Device, bind_info_count: u32, p_bind_infos: [*]const BindAccelerationStructureMemoryInfoNV, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!void { const result = self.vkBindAccelerationStructureMemoryNV( device, bind_info_count, p_bind_infos, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn cmdCopyAccelerationStructureNV( self: Self, command_buffer: CommandBuffer, dst: AccelerationStructureNV, src: AccelerationStructureNV, mode: CopyAccelerationStructureModeKHR, ) void { self.vkCmdCopyAccelerationStructureNV( command_buffer, dst, src, mode, ); } pub fn cmdCopyAccelerationStructureKHR( self: Self, command_buffer: CommandBuffer, info: CopyAccelerationStructureInfoKHR, ) void { self.vkCmdCopyAccelerationStructureKHR( command_buffer, &info, ); } pub fn copyAccelerationStructureKHR( self: Self, device: Device, deferred_operation: DeferredOperationKHR, info: CopyAccelerationStructureInfoKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Result { const result = self.vkCopyAccelerationStructureKHR( device, deferred_operation, &info, ); switch (result) { .success => {}, .operation_deferred_khr => {}, .operation_not_deferred_khr => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return result; } pub fn cmdCopyAccelerationStructureToMemoryKHR( self: Self, command_buffer: CommandBuffer, info: CopyAccelerationStructureToMemoryInfoKHR, ) void { self.vkCmdCopyAccelerationStructureToMemoryKHR( command_buffer, &info, ); } pub fn copyAccelerationStructureToMemoryKHR( self: Self, device: Device, deferred_operation: DeferredOperationKHR, info: CopyAccelerationStructureToMemoryInfoKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Result { const result = self.vkCopyAccelerationStructureToMemoryKHR( device, deferred_operation, &info, ); switch (result) { .success => {}, .operation_deferred_khr => {}, .operation_not_deferred_khr => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return result; } pub fn cmdCopyMemoryToAccelerationStructureKHR( self: Self, command_buffer: CommandBuffer, info: CopyMemoryToAccelerationStructureInfoKHR, ) void { self.vkCmdCopyMemoryToAccelerationStructureKHR( command_buffer, &info, ); } pub fn copyMemoryToAccelerationStructureKHR( self: Self, device: Device, deferred_operation: DeferredOperationKHR, info: CopyMemoryToAccelerationStructureInfoKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Result { const result = self.vkCopyMemoryToAccelerationStructureKHR( device, deferred_operation, &info, ); switch (result) { .success => {}, .operation_deferred_khr => {}, .operation_not_deferred_khr => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return result; } pub fn cmdWriteAccelerationStructuresPropertiesKHR( self: Self, command_buffer: CommandBuffer, acceleration_structure_count: u32, p_acceleration_structures: [*]const AccelerationStructureKHR, query_type: QueryType, query_pool: QueryPool, first_query: u32, ) void { self.vkCmdWriteAccelerationStructuresPropertiesKHR( command_buffer, acceleration_structure_count, p_acceleration_structures, query_type, query_pool, first_query, ); } pub fn cmdWriteAccelerationStructuresPropertiesNV( self: Self, command_buffer: CommandBuffer, acceleration_structure_count: u32, p_acceleration_structures: [*]const AccelerationStructureNV, query_type: QueryType, query_pool: QueryPool, first_query: u32, ) void { self.vkCmdWriteAccelerationStructuresPropertiesNV( command_buffer, acceleration_structure_count, p_acceleration_structures, query_type, query_pool, first_query, ); } pub fn cmdBuildAccelerationStructureNV( self: Self, command_buffer: CommandBuffer, info: AccelerationStructureInfoNV, instance_data: Buffer, instance_offset: DeviceSize, update: Bool32, dst: AccelerationStructureNV, src: AccelerationStructureNV, scratch: Buffer, scratch_offset: DeviceSize, ) void { self.vkCmdBuildAccelerationStructureNV( command_buffer, &info, instance_data, instance_offset, update, dst, src, scratch, scratch_offset, ); } pub fn writeAccelerationStructuresPropertiesKHR( self: Self, device: Device, acceleration_structure_count: u32, p_acceleration_structures: [*]const AccelerationStructureKHR, query_type: QueryType, data_size: usize, p_data: *anyopaque, stride: usize, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!void { const result = self.vkWriteAccelerationStructuresPropertiesKHR( device, acceleration_structure_count, p_acceleration_structures, query_type, data_size, p_data, stride, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn cmdTraceRaysKHR( self: Self, command_buffer: CommandBuffer, raygen_shader_binding_table: StridedDeviceAddressRegionKHR, miss_shader_binding_table: StridedDeviceAddressRegionKHR, hit_shader_binding_table: StridedDeviceAddressRegionKHR, callable_shader_binding_table: StridedDeviceAddressRegionKHR, width: u32, height: u32, depth: u32, ) void { self.vkCmdTraceRaysKHR( command_buffer, &raygen_shader_binding_table, &miss_shader_binding_table, &hit_shader_binding_table, &callable_shader_binding_table, width, height, depth, ); } pub fn cmdTraceRaysNV( self: Self, command_buffer: CommandBuffer, raygen_shader_binding_table_buffer: Buffer, raygen_shader_binding_offset: DeviceSize, miss_shader_binding_table_buffer: Buffer, miss_shader_binding_offset: DeviceSize, miss_shader_binding_stride: DeviceSize, hit_shader_binding_table_buffer: Buffer, hit_shader_binding_offset: DeviceSize, hit_shader_binding_stride: DeviceSize, callable_shader_binding_table_buffer: Buffer, callable_shader_binding_offset: DeviceSize, callable_shader_binding_stride: DeviceSize, width: u32, height: u32, depth: u32, ) void { self.vkCmdTraceRaysNV( command_buffer, raygen_shader_binding_table_buffer, raygen_shader_binding_offset, miss_shader_binding_table_buffer, miss_shader_binding_offset, miss_shader_binding_stride, hit_shader_binding_table_buffer, hit_shader_binding_offset, hit_shader_binding_stride, callable_shader_binding_table_buffer, callable_shader_binding_offset, callable_shader_binding_stride, width, height, depth, ); } pub fn getRayTracingShaderGroupHandlesKHR( self: Self, device: Device, pipeline: Pipeline, first_group: u32, group_count: u32, data_size: usize, p_data: *anyopaque, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!void { const result = self.vkGetRayTracingShaderGroupHandlesKHR( device, pipeline, first_group, group_count, data_size, p_data, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn getRayTracingCaptureReplayShaderGroupHandlesKHR( self: Self, device: Device, pipeline: Pipeline, first_group: u32, group_count: u32, data_size: usize, p_data: *anyopaque, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!void { const result = self.vkGetRayTracingCaptureReplayShaderGroupHandlesKHR( device, pipeline, first_group, group_count, data_size, p_data, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn getAccelerationStructureHandleNV( self: Self, device: Device, acceleration_structure: AccelerationStructureNV, data_size: usize, p_data: *anyopaque, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!void { const result = self.vkGetAccelerationStructureHandleNV( device, acceleration_structure, data_size, p_data, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } } pub fn createRayTracingPipelinesNV( self: Self, device: Device, pipeline_cache: PipelineCache, create_info_count: u32, p_create_infos: [*]const RayTracingPipelineCreateInfoNV, p_allocator: ?*const AllocationCallbacks, p_pipelines: [*]Pipeline, ) error{ OutOfHostMemory, OutOfDeviceMemory, InvalidShaderNV, Unknown, }!Result { const result = self.vkCreateRayTracingPipelinesNV( device, pipeline_cache, create_info_count, p_create_infos, p_allocator, p_pipelines, ); switch (result) { .success => {}, .pipeline_compile_required_ext => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_invalid_shader_nv => return error.InvalidShaderNV, else => return error.Unknown, } return result; } pub fn createRayTracingPipelinesKHR( self: Self, device: Device, deferred_operation: DeferredOperationKHR, pipeline_cache: PipelineCache, create_info_count: u32, p_create_infos: [*]const RayTracingPipelineCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, p_pipelines: [*]Pipeline, ) error{ OutOfHostMemory, OutOfDeviceMemory, InvalidOpaqueCaptureAddress, Unknown, }!Result { const result = self.vkCreateRayTracingPipelinesKHR( device, deferred_operation, pipeline_cache, create_info_count, p_create_infos, p_allocator, p_pipelines, ); switch (result) { .success => {}, .operation_deferred_khr => {}, .operation_not_deferred_khr => {}, .pipeline_compile_required_ext => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_invalid_opaque_capture_address => return error.InvalidOpaqueCaptureAddress, else => return error.Unknown, } return result; } pub fn cmdTraceRaysIndirectKHR( self: Self, command_buffer: CommandBuffer, raygen_shader_binding_table: StridedDeviceAddressRegionKHR, miss_shader_binding_table: StridedDeviceAddressRegionKHR, hit_shader_binding_table: StridedDeviceAddressRegionKHR, callable_shader_binding_table: StridedDeviceAddressRegionKHR, indirect_device_address: DeviceAddress, ) void { self.vkCmdTraceRaysIndirectKHR( command_buffer, &raygen_shader_binding_table, &miss_shader_binding_table, &hit_shader_binding_table, &callable_shader_binding_table, indirect_device_address, ); } pub fn getDeviceAccelerationStructureCompatibilityKHR( self: Self, device: Device, version_info: AccelerationStructureVersionInfoKHR, ) AccelerationStructureCompatibilityKHR { var compatibility: AccelerationStructureCompatibilityKHR = undefined; self.vkGetDeviceAccelerationStructureCompatibilityKHR( device, &version_info, &compatibility, ); return compatibility; } pub fn getRayTracingShaderGroupStackSizeKHR( self: Self, device: Device, pipeline: Pipeline, group: u32, group_shader: ShaderGroupShaderKHR, ) DeviceSize { return self.vkGetRayTracingShaderGroupStackSizeKHR( device, pipeline, group, group_shader, ); } pub fn cmdSetRayTracingPipelineStackSizeKHR( self: Self, command_buffer: CommandBuffer, pipeline_stack_size: u32, ) void { self.vkCmdSetRayTracingPipelineStackSizeKHR( command_buffer, pipeline_stack_size, ); } pub fn getImageViewHandleNVX( self: Self, device: Device, info: ImageViewHandleInfoNVX, ) u32 { return self.vkGetImageViewHandleNVX( device, &info, ); } pub fn getImageViewAddressNVX( self: Self, device: Device, image_view: ImageView, p_properties: *ImageViewAddressPropertiesNVX, ) error{ OutOfHostMemory, Unknown, Unknown, }!void { const result = self.vkGetImageViewAddressNVX( device, image_view, p_properties, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_unknown => return error.Unknown, else => return error.Unknown, } } pub fn getDeviceGroupSurfacePresentModes2EXT( self: Self, device: Device, surface_info: PhysicalDeviceSurfaceInfo2KHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, SurfaceLostKHR, Unknown, }!DeviceGroupPresentModeFlagsKHR { var modes: DeviceGroupPresentModeFlagsKHR = undefined; const result = self.vkGetDeviceGroupSurfacePresentModes2EXT( device, &surface_info, &modes, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_surface_lost_khr => return error.SurfaceLostKHR, else => return error.Unknown, } return modes; } pub fn acquireFullScreenExclusiveModeEXT( self: Self, device: Device, swapchain: SwapchainKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, InitializationFailed, SurfaceLostKHR, Unknown, }!void { const result = self.vkAcquireFullScreenExclusiveModeEXT( device, swapchain, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_initialization_failed => return error.InitializationFailed, .error_surface_lost_khr => return error.SurfaceLostKHR, else => return error.Unknown, } } pub fn releaseFullScreenExclusiveModeEXT( self: Self, device: Device, swapchain: SwapchainKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, SurfaceLostKHR, Unknown, }!void { const result = self.vkReleaseFullScreenExclusiveModeEXT( device, swapchain, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_surface_lost_khr => return error.SurfaceLostKHR, else => return error.Unknown, } } pub fn acquireProfilingLockKHR( self: Self, device: Device, info: AcquireProfilingLockInfoKHR, ) error{ OutOfHostMemory, Timeout, Unknown, }!void { const result = self.vkAcquireProfilingLockKHR( device, &info, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .timeout => return error.Timeout, else => return error.Unknown, } } pub fn releaseProfilingLockKHR( self: Self, device: Device, ) void { self.vkReleaseProfilingLockKHR( device, ); } pub fn getImageDrmFormatModifierPropertiesEXT( self: Self, device: Device, image: Image, p_properties: *ImageDrmFormatModifierPropertiesEXT, ) error{ OutOfHostMemory, Unknown, }!void { const result = self.vkGetImageDrmFormatModifierPropertiesEXT( device, image, p_properties, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } } pub fn getBufferOpaqueCaptureAddress( self: Self, device: Device, info: BufferDeviceAddressInfo, ) u64 { return self.vkGetBufferOpaqueCaptureAddress( device, &info, ); } pub fn getBufferDeviceAddress( self: Self, device: Device, info: BufferDeviceAddressInfo, ) DeviceAddress { return self.vkGetBufferDeviceAddress( device, &info, ); } pub fn initializePerformanceApiINTEL( self: Self, device: Device, initialize_info: InitializePerformanceApiInfoINTEL, ) error{ TooManyObjects, OutOfHostMemory, Unknown, }!void { const result = self.vkInitializePerformanceApiINTEL( device, &initialize_info, ); switch (result) { .success => {}, .error_too_many_objects => return error.TooManyObjects, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } } pub fn uninitializePerformanceApiINTEL( self: Self, device: Device, ) void { self.vkUninitializePerformanceApiINTEL( device, ); } pub fn cmdSetPerformanceMarkerINTEL( self: Self, command_buffer: CommandBuffer, marker_info: PerformanceMarkerInfoINTEL, ) error{ TooManyObjects, OutOfHostMemory, Unknown, }!void { const result = self.vkCmdSetPerformanceMarkerINTEL( command_buffer, &marker_info, ); switch (result) { .success => {}, .error_too_many_objects => return error.TooManyObjects, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } } pub fn cmdSetPerformanceStreamMarkerINTEL( self: Self, command_buffer: CommandBuffer, marker_info: PerformanceStreamMarkerInfoINTEL, ) error{ TooManyObjects, OutOfHostMemory, Unknown, }!void { const result = self.vkCmdSetPerformanceStreamMarkerINTEL( command_buffer, &marker_info, ); switch (result) { .success => {}, .error_too_many_objects => return error.TooManyObjects, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } } pub fn cmdSetPerformanceOverrideINTEL( self: Self, command_buffer: CommandBuffer, override_info: PerformanceOverrideInfoINTEL, ) error{ TooManyObjects, OutOfHostMemory, Unknown, }!void { const result = self.vkCmdSetPerformanceOverrideINTEL( command_buffer, &override_info, ); switch (result) { .success => {}, .error_too_many_objects => return error.TooManyObjects, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } } pub fn acquirePerformanceConfigurationINTEL( self: Self, device: Device, acquire_info: PerformanceConfigurationAcquireInfoINTEL, ) error{ TooManyObjects, OutOfHostMemory, Unknown, }!PerformanceConfigurationINTEL { var configuration: PerformanceConfigurationINTEL = undefined; const result = self.vkAcquirePerformanceConfigurationINTEL( device, &acquire_info, &configuration, ); switch (result) { .success => {}, .error_too_many_objects => return error.TooManyObjects, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } return configuration; } pub fn releasePerformanceConfigurationINTEL( self: Self, device: Device, configuration: PerformanceConfigurationINTEL, ) error{ TooManyObjects, OutOfHostMemory, Unknown, }!void { const result = self.vkReleasePerformanceConfigurationINTEL( device, configuration, ); switch (result) { .success => {}, .error_too_many_objects => return error.TooManyObjects, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } } pub fn queueSetPerformanceConfigurationINTEL( self: Self, queue: Queue, configuration: PerformanceConfigurationINTEL, ) error{ TooManyObjects, OutOfHostMemory, Unknown, }!void { const result = self.vkQueueSetPerformanceConfigurationINTEL( queue, configuration, ); switch (result) { .success => {}, .error_too_many_objects => return error.TooManyObjects, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } } pub fn getPerformanceParameterINTEL( self: Self, device: Device, parameter: PerformanceParameterTypeINTEL, ) error{ TooManyObjects, OutOfHostMemory, Unknown, }!PerformanceValueINTEL { var value: PerformanceValueINTEL = undefined; const result = self.vkGetPerformanceParameterINTEL( device, parameter, &value, ); switch (result) { .success => {}, .error_too_many_objects => return error.TooManyObjects, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } return value; } pub fn getDeviceMemoryOpaqueCaptureAddress( self: Self, device: Device, info: DeviceMemoryOpaqueCaptureAddressInfo, ) u64 { return self.vkGetDeviceMemoryOpaqueCaptureAddress( device, &info, ); } pub fn getPipelineExecutablePropertiesKHR( self: Self, device: Device, pipeline_info: PipelineInfoKHR, p_executable_count: *u32, p_properties: ?[*]PipelineExecutablePropertiesKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Result { const result = self.vkGetPipelineExecutablePropertiesKHR( device, &pipeline_info, p_executable_count, p_properties, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return result; } pub fn getPipelineExecutableStatisticsKHR( self: Self, device: Device, executable_info: PipelineExecutableInfoKHR, p_statistic_count: *u32, p_statistics: ?[*]PipelineExecutableStatisticKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Result { const result = self.vkGetPipelineExecutableStatisticsKHR( device, &executable_info, p_statistic_count, p_statistics, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return result; } pub fn getPipelineExecutableInternalRepresentationsKHR( self: Self, device: Device, executable_info: PipelineExecutableInfoKHR, p_internal_representation_count: *u32, p_internal_representations: ?[*]PipelineExecutableInternalRepresentationKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Result { const result = self.vkGetPipelineExecutableInternalRepresentationsKHR( device, &executable_info, p_internal_representation_count, p_internal_representations, ); switch (result) { .success => {}, .incomplete => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return result; } pub fn cmdSetLineStippleEXT( self: Self, command_buffer: CommandBuffer, line_stipple_factor: u32, line_stipple_pattern: u16, ) void { self.vkCmdSetLineStippleEXT( command_buffer, line_stipple_factor, line_stipple_pattern, ); } pub fn createAccelerationStructureKHR( self: Self, device: Device, create_info: AccelerationStructureCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, InvalidOpaqueCaptureAddressKHR, Unknown, }!AccelerationStructureKHR { var acceleration_structure: AccelerationStructureKHR = undefined; const result = self.vkCreateAccelerationStructureKHR( device, &create_info, p_allocator, &acceleration_structure, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_invalid_opaque_capture_address => return error.InvalidOpaqueCaptureAddressKHR, else => return error.Unknown, } return acceleration_structure; } pub fn cmdBuildAccelerationStructuresKHR( self: Self, command_buffer: CommandBuffer, info_count: u32, p_infos: [*]const AccelerationStructureBuildGeometryInfoKHR, pp_build_range_infos: [*]const *const AccelerationStructureBuildRangeInfoKHR, ) void { self.vkCmdBuildAccelerationStructuresKHR( command_buffer, info_count, p_infos, pp_build_range_infos, ); } pub fn cmdBuildAccelerationStructuresIndirectKHR( self: Self, command_buffer: CommandBuffer, info_count: u32, p_infos: [*]const AccelerationStructureBuildGeometryInfoKHR, p_indirect_device_addresses: [*]const DeviceAddress, p_indirect_strides: [*]const u32, pp_max_primitive_counts: [*]const *const u32, ) void { self.vkCmdBuildAccelerationStructuresIndirectKHR( command_buffer, info_count, p_infos, p_indirect_device_addresses, p_indirect_strides, pp_max_primitive_counts, ); } pub fn buildAccelerationStructuresKHR( self: Self, device: Device, deferred_operation: DeferredOperationKHR, info_count: u32, p_infos: [*]const AccelerationStructureBuildGeometryInfoKHR, pp_build_range_infos: [*]const *const AccelerationStructureBuildRangeInfoKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Result { const result = self.vkBuildAccelerationStructuresKHR( device, deferred_operation, info_count, p_infos, pp_build_range_infos, ); switch (result) { .success => {}, .operation_deferred_khr => {}, .operation_not_deferred_khr => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return result; } pub fn getAccelerationStructureDeviceAddressKHR( self: Self, device: Device, info: AccelerationStructureDeviceAddressInfoKHR, ) DeviceAddress { return self.vkGetAccelerationStructureDeviceAddressKHR( device, &info, ); } pub fn createDeferredOperationKHR( self: Self, device: Device, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, Unknown, }!DeferredOperationKHR { var deferred_operation: DeferredOperationKHR = undefined; const result = self.vkCreateDeferredOperationKHR( device, p_allocator, &deferred_operation, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } return deferred_operation; } pub fn destroyDeferredOperationKHR( self: Self, device: Device, operation: DeferredOperationKHR, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyDeferredOperationKHR( device, operation, p_allocator, ); } pub fn getDeferredOperationMaxConcurrencyKHR( self: Self, device: Device, operation: DeferredOperationKHR, ) u32 { return self.vkGetDeferredOperationMaxConcurrencyKHR( device, operation, ); } pub fn getDeferredOperationResultKHR( self: Self, device: Device, operation: DeferredOperationKHR, ) error{ Unknown, }!Result { const result = self.vkGetDeferredOperationResultKHR( device, operation, ); switch (result) { .success => {}, .not_ready => {}, else => return error.Unknown, } return result; } pub fn deferredOperationJoinKHR( self: Self, device: Device, operation: DeferredOperationKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, Unknown, }!Result { const result = self.vkDeferredOperationJoinKHR( device, operation, ); switch (result) { .success => {}, .thread_done_khr => {}, .thread_idle_khr => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, else => return error.Unknown, } return result; } pub fn cmdSetCullModeEXT( self: Self, command_buffer: CommandBuffer, cull_mode: CullModeFlags, ) void { self.vkCmdSetCullModeEXT( command_buffer, cull_mode.toInt(), ); } pub fn cmdSetFrontFaceEXT( self: Self, command_buffer: CommandBuffer, front_face: FrontFace, ) void { self.vkCmdSetFrontFaceEXT( command_buffer, front_face, ); } pub fn cmdSetPrimitiveTopologyEXT( self: Self, command_buffer: CommandBuffer, primitive_topology: PrimitiveTopology, ) void { self.vkCmdSetPrimitiveTopologyEXT( command_buffer, primitive_topology, ); } pub fn cmdSetViewportWithCountEXT( self: Self, command_buffer: CommandBuffer, viewport_count: u32, p_viewports: [*]const Viewport, ) void { self.vkCmdSetViewportWithCountEXT( command_buffer, viewport_count, p_viewports, ); } pub fn cmdSetScissorWithCountEXT( self: Self, command_buffer: CommandBuffer, scissor_count: u32, p_scissors: [*]const Rect2D, ) void { self.vkCmdSetScissorWithCountEXT( command_buffer, scissor_count, p_scissors, ); } pub fn cmdBindVertexBuffers2EXT( self: Self, command_buffer: CommandBuffer, first_binding: u32, binding_count: u32, p_buffers: [*]const Buffer, p_offsets: [*]const DeviceSize, p_sizes: ?[*]const DeviceSize, p_strides: ?[*]const DeviceSize, ) void { self.vkCmdBindVertexBuffers2EXT( command_buffer, first_binding, binding_count, p_buffers, p_offsets, p_sizes, p_strides, ); } pub fn cmdSetDepthTestEnableEXT( self: Self, command_buffer: CommandBuffer, depth_test_enable: Bool32, ) void { self.vkCmdSetDepthTestEnableEXT( command_buffer, depth_test_enable, ); } pub fn cmdSetDepthWriteEnableEXT( self: Self, command_buffer: CommandBuffer, depth_write_enable: Bool32, ) void { self.vkCmdSetDepthWriteEnableEXT( command_buffer, depth_write_enable, ); } pub fn cmdSetDepthCompareOpEXT( self: Self, command_buffer: CommandBuffer, depth_compare_op: CompareOp, ) void { self.vkCmdSetDepthCompareOpEXT( command_buffer, depth_compare_op, ); } pub fn cmdSetDepthBoundsTestEnableEXT( self: Self, command_buffer: CommandBuffer, depth_bounds_test_enable: Bool32, ) void { self.vkCmdSetDepthBoundsTestEnableEXT( command_buffer, depth_bounds_test_enable, ); } pub fn cmdSetStencilTestEnableEXT( self: Self, command_buffer: CommandBuffer, stencil_test_enable: Bool32, ) void { self.vkCmdSetStencilTestEnableEXT( command_buffer, stencil_test_enable, ); } pub fn cmdSetStencilOpEXT( self: Self, command_buffer: CommandBuffer, face_mask: StencilFaceFlags, fail_op: StencilOp, pass_op: StencilOp, depth_fail_op: StencilOp, compare_op: CompareOp, ) void { self.vkCmdSetStencilOpEXT( command_buffer, face_mask.toInt(), fail_op, pass_op, depth_fail_op, compare_op, ); } pub fn cmdSetPatchControlPointsEXT( self: Self, command_buffer: CommandBuffer, patch_control_points: u32, ) void { self.vkCmdSetPatchControlPointsEXT( command_buffer, patch_control_points, ); } pub fn cmdSetRasterizerDiscardEnableEXT( self: Self, command_buffer: CommandBuffer, rasterizer_discard_enable: Bool32, ) void { self.vkCmdSetRasterizerDiscardEnableEXT( command_buffer, rasterizer_discard_enable, ); } pub fn cmdSetDepthBiasEnableEXT( self: Self, command_buffer: CommandBuffer, depth_bias_enable: Bool32, ) void { self.vkCmdSetDepthBiasEnableEXT( command_buffer, depth_bias_enable, ); } pub fn cmdSetLogicOpEXT( self: Self, command_buffer: CommandBuffer, logic_op: LogicOp, ) void { self.vkCmdSetLogicOpEXT( command_buffer, logic_op, ); } pub fn cmdSetPrimitiveRestartEnableEXT( self: Self, command_buffer: CommandBuffer, primitive_restart_enable: Bool32, ) void { self.vkCmdSetPrimitiveRestartEnableEXT( command_buffer, primitive_restart_enable, ); } pub fn createPrivateDataSlotEXT( self: Self, device: Device, create_info: PrivateDataSlotCreateInfoEXT, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, Unknown, }!PrivateDataSlotEXT { var private_data_slot: PrivateDataSlotEXT = undefined; const result = self.vkCreatePrivateDataSlotEXT( device, &create_info, p_allocator, &private_data_slot, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } return private_data_slot; } pub fn destroyPrivateDataSlotEXT( self: Self, device: Device, private_data_slot: PrivateDataSlotEXT, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyPrivateDataSlotEXT( device, private_data_slot, p_allocator, ); } pub fn setPrivateDataEXT( self: Self, device: Device, object_type: ObjectType, object_handle: u64, private_data_slot: PrivateDataSlotEXT, data: u64, ) error{ OutOfHostMemory, Unknown, }!void { const result = self.vkSetPrivateDataEXT( device, object_type, object_handle, private_data_slot, data, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, else => return error.Unknown, } } pub fn getPrivateDataEXT( self: Self, device: Device, object_type: ObjectType, object_handle: u64, private_data_slot: PrivateDataSlotEXT, ) u64 { var data: u64 = undefined; self.vkGetPrivateDataEXT( device, object_type, object_handle, private_data_slot, &data, ); return data; } pub fn cmdCopyBuffer2KHR( self: Self, command_buffer: CommandBuffer, copy_buffer_info: CopyBufferInfo2KHR, ) void { self.vkCmdCopyBuffer2KHR( command_buffer, &copy_buffer_info, ); } pub fn cmdCopyImage2KHR( self: Self, command_buffer: CommandBuffer, copy_image_info: CopyImageInfo2KHR, ) void { self.vkCmdCopyImage2KHR( command_buffer, &copy_image_info, ); } pub fn cmdBlitImage2KHR( self: Self, command_buffer: CommandBuffer, blit_image_info: BlitImageInfo2KHR, ) void { self.vkCmdBlitImage2KHR( command_buffer, &blit_image_info, ); } pub fn cmdCopyBufferToImage2KHR( self: Self, command_buffer: CommandBuffer, copy_buffer_to_image_info: CopyBufferToImageInfo2KHR, ) void { self.vkCmdCopyBufferToImage2KHR( command_buffer, &copy_buffer_to_image_info, ); } pub fn cmdCopyImageToBuffer2KHR( self: Self, command_buffer: CommandBuffer, copy_image_to_buffer_info: CopyImageToBufferInfo2KHR, ) void { self.vkCmdCopyImageToBuffer2KHR( command_buffer, &copy_image_to_buffer_info, ); } pub fn cmdResolveImage2KHR( self: Self, command_buffer: CommandBuffer, resolve_image_info: ResolveImageInfo2KHR, ) void { self.vkCmdResolveImage2KHR( command_buffer, &resolve_image_info, ); } pub fn cmdSetFragmentShadingRateKHR( self: Self, command_buffer: CommandBuffer, fragment_size: Extent2D, combiner_ops: [2]FragmentShadingRateCombinerOpKHR, ) void { self.vkCmdSetFragmentShadingRateKHR( command_buffer, &fragment_size, combiner_ops, ); } pub fn cmdSetFragmentShadingRateEnumNV( self: Self, command_buffer: CommandBuffer, shading_rate: FragmentShadingRateNV, combiner_ops: [2]FragmentShadingRateCombinerOpKHR, ) void { self.vkCmdSetFragmentShadingRateEnumNV( command_buffer, shading_rate, combiner_ops, ); } pub fn getAccelerationStructureBuildSizesKHR( self: Self, device: Device, build_type: AccelerationStructureBuildTypeKHR, build_info: AccelerationStructureBuildGeometryInfoKHR, p_max_primitive_counts: ?[*]const u32, p_size_info: *AccelerationStructureBuildSizesInfoKHR, ) void { self.vkGetAccelerationStructureBuildSizesKHR( device, build_type, &build_info, p_max_primitive_counts, p_size_info, ); } pub fn cmdSetVertexInputEXT( self: Self, command_buffer: CommandBuffer, vertex_binding_description_count: u32, p_vertex_binding_descriptions: [*]const VertexInputBindingDescription2EXT, vertex_attribute_description_count: u32, p_vertex_attribute_descriptions: [*]const VertexInputAttributeDescription2EXT, ) void { self.vkCmdSetVertexInputEXT( command_buffer, vertex_binding_description_count, p_vertex_binding_descriptions, vertex_attribute_description_count, p_vertex_attribute_descriptions, ); } pub fn cmdSetColorWriteEnableEXT( self: Self, command_buffer: CommandBuffer, attachment_count: u32, p_color_write_enables: [*]const Bool32, ) void { self.vkCmdSetColorWriteEnableEXT( command_buffer, attachment_count, p_color_write_enables, ); } pub fn cmdSetEvent2KHR( self: Self, command_buffer: CommandBuffer, event: Event, dependency_info: DependencyInfoKHR, ) void { self.vkCmdSetEvent2KHR( command_buffer, event, &dependency_info, ); } pub fn cmdResetEvent2KHR( self: Self, command_buffer: CommandBuffer, event: Event, stage_mask: PipelineStageFlags2KHR, ) void { self.vkCmdResetEvent2KHR( command_buffer, event, stage_mask, ); } pub fn cmdWaitEvents2KHR( self: Self, command_buffer: CommandBuffer, event_count: u32, p_events: [*]const Event, p_dependency_infos: [*]const DependencyInfoKHR, ) void { self.vkCmdWaitEvents2KHR( command_buffer, event_count, p_events, p_dependency_infos, ); } pub fn cmdPipelineBarrier2KHR( self: Self, command_buffer: CommandBuffer, dependency_info: DependencyInfoKHR, ) void { self.vkCmdPipelineBarrier2KHR( command_buffer, &dependency_info, ); } pub fn queueSubmit2KHR( self: Self, queue: Queue, submit_count: u32, p_submits: [*]const SubmitInfo2KHR, fence: Fence, ) error{ OutOfHostMemory, OutOfDeviceMemory, DeviceLost, Unknown, }!void { const result = self.vkQueueSubmit2KHR( queue, submit_count, p_submits, fence, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_device_lost => return error.DeviceLost, else => return error.Unknown, } } pub fn cmdWriteTimestamp2KHR( self: Self, command_buffer: CommandBuffer, stage: PipelineStageFlags2KHR, query_pool: QueryPool, query: u32, ) void { self.vkCmdWriteTimestamp2KHR( command_buffer, stage, query_pool, query, ); } pub fn cmdWriteBufferMarker2AMD( self: Self, command_buffer: CommandBuffer, stage: PipelineStageFlags2KHR, dst_buffer: Buffer, dst_offset: DeviceSize, marker: u32, ) void { self.vkCmdWriteBufferMarker2AMD( command_buffer, stage, dst_buffer, dst_offset, marker, ); } pub fn getQueueCheckpointData2NV( self: Self, queue: Queue, p_checkpoint_data_count: *u32, p_checkpoint_data: ?[*]CheckpointData2NV, ) void { self.vkGetQueueCheckpointData2NV( queue, p_checkpoint_data_count, p_checkpoint_data, ); } pub fn createVideoSessionKHR( self: Self, device: Device, create_info: VideoSessionCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, InitializationFailed, IncompatibleDriver, FeatureNotPresent, Unknown, }!VideoSessionKHR { var video_session: VideoSessionKHR = undefined; const result = self.vkCreateVideoSessionKHR( device, &create_info, p_allocator, &video_session, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_initialization_failed => return error.InitializationFailed, .error_incompatible_driver => return error.IncompatibleDriver, .error_feature_not_present => return error.FeatureNotPresent, else => return error.Unknown, } return video_session; } pub fn destroyVideoSessionKHR( self: Self, device: Device, video_session: VideoSessionKHR, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyVideoSessionKHR( device, video_session, p_allocator, ); } pub fn createVideoSessionParametersKHR( self: Self, device: Device, create_info: VideoSessionParametersCreateInfoKHR, p_allocator: ?*const AllocationCallbacks, ) error{ OutOfHostMemory, OutOfDeviceMemory, TooManyObjects, Unknown, }!VideoSessionParametersKHR { var video_session_parameters: VideoSessionParametersKHR = undefined; const result = self.vkCreateVideoSessionParametersKHR( device, &create_info, p_allocator, &video_session_parameters, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_too_many_objects => return error.TooManyObjects, else => return error.Unknown, } return video_session_parameters; } pub fn updateVideoSessionParametersKHR( self: Self, device: Device, video_session_parameters: VideoSessionParametersKHR, update_info: VideoSessionParametersUpdateInfoKHR, ) error{ InitializationFailed, TooManyObjects, Unknown, }!void { const result = self.vkUpdateVideoSessionParametersKHR( device, video_session_parameters, &update_info, ); switch (result) { .success => {}, .error_initialization_failed => return error.InitializationFailed, .error_too_many_objects => return error.TooManyObjects, else => return error.Unknown, } } pub fn destroyVideoSessionParametersKHR( self: Self, device: Device, video_session_parameters: VideoSessionParametersKHR, p_allocator: ?*const AllocationCallbacks, ) void { self.vkDestroyVideoSessionParametersKHR( device, video_session_parameters, p_allocator, ); } pub fn getVideoSessionMemoryRequirementsKHR( self: Self, device: Device, video_session: VideoSessionKHR, p_video_session_memory_requirements_count: *u32, p_video_session_memory_requirements: ?[*]VideoGetMemoryPropertiesKHR, ) error{ InitializationFailed, Unknown, }!Result { const result = self.vkGetVideoSessionMemoryRequirementsKHR( device, video_session, p_video_session_memory_requirements_count, p_video_session_memory_requirements, ); switch (result) { .success => {}, .incomplete => {}, .error_initialization_failed => return error.InitializationFailed, else => return error.Unknown, } return result; } pub fn bindVideoSessionMemoryKHR( self: Self, device: Device, video_session: VideoSessionKHR, video_session_bind_memory_count: u32, p_video_session_bind_memories: [*]const VideoBindMemoryKHR, ) error{ OutOfHostMemory, OutOfDeviceMemory, InitializationFailed, Unknown, }!void { const result = self.vkBindVideoSessionMemoryKHR( device, video_session, video_session_bind_memory_count, p_video_session_bind_memories, ); switch (result) { .success => {}, .error_out_of_host_memory => return error.OutOfHostMemory, .error_out_of_device_memory => return error.OutOfDeviceMemory, .error_initialization_failed => return error.InitializationFailed, else => return error.Unknown, } } pub fn cmdDecodeVideoKHR( self: Self, command_buffer: CommandBuffer, frame_info: VideoDecodeInfoKHR, ) void { self.vkCmdDecodeVideoKHR( command_buffer, &frame_info, ); } pub fn cmdBeginVideoCodingKHR( self: Self, command_buffer: CommandBuffer, begin_info: VideoBeginCodingInfoKHR, ) void { self.vkCmdBeginVideoCodingKHR( command_buffer, &begin_info, ); } pub fn cmdControlVideoCodingKHR( self: Self, command_buffer: CommandBuffer, coding_control_info: VideoCodingControlInfoKHR, ) void { self.vkCmdControlVideoCodingKHR( command_buffer, &coding_control_info, ); } pub fn cmdEndVideoCodingKHR( self: Self, command_buffer: CommandBuffer, end_coding_info: VideoEndCodingInfoKHR, ) void { self.vkCmdEndVideoCodingKHR( command_buffer, &end_coding_info, ); } pub fn cmdEncodeVideoKHR( self: Self, command_buffer: CommandBuffer, encode_info: VideoEncodeInfoKHR, ) void { self.vkCmdEncodeVideoKHR( command_buffer, &encode_info, ); } }; }
src/vk.zig
const std = @import( "std" ); const sqrt = std.math.sqrt; const Atomic = std.atomic.Atomic; const Allocator = std.mem.Allocator; usingnamespace @import( "core/util.zig" ); usingnamespace @import( "core/core.zig" ); usingnamespace @import( "core/gtkz.zig" ); usingnamespace @import( "core/support.zig" ); usingnamespace @import( "space/view.zig" ); usingnamespace @import( "space/dots.zig" ); usingnamespace @import( "time/view.zig" ); usingnamespace @import( "time/curve.zig" ); usingnamespace @import( "sim.zig" ); // Allow async/await to use multiple threads pub const io_mode = .evented; fn doRunSimulation( comptime N: usize, comptime P: usize, config: *const SimConfig(N,P), listeners: []const *SimListener(N,P), running: *const Atomic(bool) ) !void { // Indicate to the async/await mechanism that we're going to monopolize a thread std.event.Loop.startCpuBoundOperation( ); try runSimulation( N, P, config, listeners, running ); } fn ConstantAcceleration( comptime N: usize, comptime P: usize ) type { return struct { const Self = @This(); acceleration: [N]f64, xLimits: [N]Interval, accelerator: Accelerator(N,P) = .{ .addAccelerationFn = addAcceleration, .computePotentialEnergyFn = computePotentialEnergy, }, pub fn init( acceleration: [N]f64, xLimits: [N]Interval ) Self { return .{ .acceleration = acceleration, .xLimits = xLimits, }; } fn addAcceleration( accelerator: *const Accelerator(N,P), xs: *const [N*P]f64, ms: *const [P]f64, p: usize, x: [N]f64, aSum_OUT: *[N]f64 ) void { const self = @fieldParentPtr( Self, "accelerator", accelerator ); for ( self.acceleration ) |a_n, n| { aSum_OUT[n] += a_n; } } fn computePotentialEnergy( accelerator: *const Accelerator(N,P), xs: *const [N*P]f64, ms: *const [P]f64 ) f64 { const self = @fieldParentPtr( Self, "accelerator", accelerator ); const a = self.acceleration; var xZeroPotential = @as( [N]f64, undefined ); for ( a ) |a_n, n| { if ( a_n < 0 ) { xZeroPotential[n] = self.xLimits[n].start; } else { xZeroPotential[n] = self.xLimits[n].end( ); } } var totalPotentialEnergy = @as( f64, 0.0 ); for ( ms ) |m, p| { for ( a ) |a_n, n| { const x_n = xs[ p*N + n ]; totalPotentialEnergy += m * -a_n * ( x_n - xZeroPotential[n] ); } } return totalPotentialEnergy; } }; } fn SpringsAcceleration( comptime N: usize, comptime P: usize ) type { return struct { const Self = @This(); restLength: f64, stiffness: f64, accelerator: Accelerator(N,P), pub fn init( restLength: f64, stiffness: f64 ) Self { return .{ .restLength = restLength, .stiffness = stiffness, .accelerator = .{ .addAccelerationFn = addAcceleration, .computePotentialEnergyFn = computePotentialEnergy, }, }; } fn addAcceleration( accelerator: *const Accelerator(N,P), xs: *const [N*P]f64, ms: *const [P]f64, p: usize, x: [N]f64, aSum_OUT: *[N]f64 ) void { const self = @fieldParentPtr( Self, "accelerator", accelerator ); const stiffnessOverMass = self.stiffness / ms[p]; const pA = p; const xA = x; var pB = @as( usize, 0 ); while ( pB < P ) : ( pB += 1 ) { if ( pB != pA ) { const xB = xs[ pB*N.. ][ 0..N ]; var d = @as( [N]f64, undefined ); var dMagSquared = @as( f64, 0.0 ); for ( xB ) |xB_n, n| { const d_n = xB_n - xA[n]; d[n] = d_n; dMagSquared += d_n * d_n; } const dMag = sqrt( dMagSquared ); const offsetFromRest = dMag - self.restLength; const factor = stiffnessOverMass * offsetFromRest / dMag; for ( d ) |d_n, n| { // F = stiffness * offsetFromRest * d[n]/dMag // a = F / m // = ( stiffness * offsetFromRest * d[n]/dMag ) / m // = ( stiffness / m )*( offsetFromRest / dMag )*d[n] aSum_OUT[n] += factor * d_n; } } } } fn computePotentialEnergy( accelerator: *const Accelerator(N,P), xs: *const [N*P]f64, ms: *const [P]f64 ) f64 { const self = @fieldParentPtr( Self, "accelerator", accelerator ); const halfStiffness = 0.5 * self.stiffness; var totalPotentialEnergy = @as( f64, 0.0 ); var pA = @as( usize, 0 ); while ( pA < P ) : ( pA += 1 ) { const xA = xs[ pA*N.. ][ 0..N ]; var pB = @as( usize, pA + 1 ); while ( pB < P ) : ( pB += 1 ) { const xB = xs[ pB*N.. ][ 0..N ]; var d = @as( [N]f64, undefined ); var dMagSquared = @as( f64, 0.0 ); for ( xB ) |xB_n, n| { const d_n = xB_n - xA[n]; d[n] = d_n; dMagSquared += d_n * d_n; } const dMag = sqrt( dMagSquared ); const offsetFromRest = dMag - self.restLength; totalPotentialEnergy += halfStiffness * offsetFromRest*offsetFromRest; } } return totalPotentialEnergy; } }; } fn WidgetRepainter( comptime N: usize, comptime P: usize ) type { return struct { const Self = @This(); widgets: []const *GtkWidget, simListener: SimListener(N,P) = SimListener(N,P) { .handleFrameFn = handleFrame, }, pub fn init( widgets: []const *GtkWidget ) Self { return Self { .widgets = widgets, }; } /// Called on simulator thread fn handleFrame( simListener: *SimListener(N,P), frame: *const SimFrame(N,P) ) !void { const self = @fieldParentPtr( Self, "simListener", simListener ); for ( self.widgets ) |widget| { gtk_widget_queue_draw( widget ); } } }; } pub fn main( ) !void { var gpa = std.heap.GeneralPurposeAllocator( .{} ) {}; const allocator = &gpa.allocator; const N = 2; const P = 3; const xLimits = [N]Interval { Interval.initStartEnd( -8, 8 ), Interval.initStartEnd( -6, 6 ), }; var gravity = ConstantAcceleration(N,P).init( [N]f64 { 0.0, -9.80665 }, xLimits ); var springs = SpringsAcceleration(N,P).init( 0.6, 300.0 ); var accelerators = [_]*const Accelerator(N,P) { &gravity.accelerator, &springs.accelerator, }; const simConfig = SimConfig(N,P) { .frameInterval_MILLIS = 15, .timestep = 500e-9, .xLimits = xLimits, .particles = [P]Particle(N) { Particle(N).init( 1, [N]f64{ -6.0, -3.0 }, [N]f64{ 7.0, 13.0 } ), Particle(N).init( 1, [N]f64{ -6.5, -3.0 }, [N]f64{ 2.0, 14.0 } ), Particle(N).init( 1, [N]f64{ -6.1, -3.2 }, [N]f64{ 5.0, 6.0 } ), }, .accelerators = &accelerators, }; try gtkzInit( allocator ); var timeView = @as( TimeView(N,P), undefined ); try timeView.init( allocator ); defer timeView.deinit( ); var spaceView = @as( SpaceView(N,P), undefined ); try spaceView.init( &simConfig.xLimits, &timeView.cursor, allocator ); defer spaceView.deinit( ); const splitter = gtk_paned_new( .GTK_ORIENTATION_VERTICAL ); gtk_paned_set_wide_handle( @ptrCast( *GtkPaned, splitter ), 1 ); gtk_paned_pack1( @ptrCast( *GtkPaned, splitter ), spaceView.glArea, 1, 1 ); gtk_paned_pack2( @ptrCast( *GtkPaned, splitter ), timeView.glArea, 1, 1 ); gtk_widget_set_size_request( spaceView.glArea, -1, 70 ); gtk_widget_set_size_request( timeView.glArea, -1, 30 ); const window = gtk_window_new( .GTK_WINDOW_TOPLEVEL ); gtk_container_add( @ptrCast( *GtkContainer, window ), splitter ); gtk_window_set_title( @ptrCast( *GtkWindow, window ), "Sproingy" ); gtk_window_set_default_size( @ptrCast( *GtkWindow, window ), 480, 360 ); const fullscreenKeys = [_]guint { GDK_KEY_f, GDK_KEY_F11 }; var fullscreenKeysHandler = FullscreenKeysHandler.init( &fullscreenKeys ); _ = try gtkzConnectHandler( spaceView.glArea, "key-press-event", FullscreenKeysHandler.onKeyDown, &fullscreenKeysHandler ); _ = try gtkzConnectHandler( timeView.glArea, "key-press-event", FullscreenKeysHandler.onKeyDown, &fullscreenKeysHandler ); const closeKeys = [_]guint { GDK_KEY_Escape }; var closeKeysHandler = CloseKeysHandler.init( &closeKeys ); _ = try gtkzConnectHandler( spaceView.glArea, "key-press-event", CloseKeysHandler.onKeyDown, &closeKeysHandler ); _ = try gtkzConnectHandler( timeView.glArea, "key-press-event", CloseKeysHandler.onKeyDown, &closeKeysHandler ); var quittingHandler = QuittingHandler.init( ); _ = try gtkzConnectHandler( window, "delete-event", QuittingHandler.onWindowClosing, &quittingHandler ); _ = try gtkzConnectHandler( window, "delete-event", PaintingHandler.onWindowClosing, &timeView.paintingHandler ); _ = try gtkzConnectHandler( window, "delete-event", PaintingHandler.onWindowClosing, &spaceView.paintingHandler ); const widgets = [_]*GtkWidget { splitter }; var repainter = WidgetRepainter(N,P).init( &widgets ); const simListeners = [_]*SimListener(N,P) { &spaceView.dotsPaintable.simListener, &timeView.curvePaintable.simListener, &repainter.simListener, }; var simRunning = Atomic( bool ).init( true ); var simFrame = async doRunSimulation( N, P, &simConfig, &simListeners, &simRunning ); gtk_widget_show_all( window ); gtk_main( ); // Main-thread stack needs to stay valid until sim-thread exits simRunning.store( false, .SeqCst ); try await simFrame; }
src/main.zig
const std = @import("std"); const fs = std.fs; pub fn main() !void { var gpa = std.heap.GeneralPurposeAllocator(.{}){}; const allocator = &gpa.allocator; const input = try fs.cwd().readFileAlloc(allocator, "data/input_18_1.txt", std.math.maxInt(usize)); { // Solution one var lines = std.mem.tokenize(input, "\n"); var sum: u64 = 0; while (lines.next()) |raw_line| { const line = std.mem.trim(u8, raw_line, " \r\n"); if (line.len == 0) continue; sum += parseExpression(line).val; } std.debug.print("Day 18 - Solution 1: {}\n", .{sum}); } { // Solution two var lines = std.mem.tokenize(input, "\n"); var sum: u64 = 0; while (lines.next()) |raw_line| { const line = std.mem.trim(u8, raw_line, " \r\n"); if (line.len == 0) continue; sum += (try parseExpressionAdvanced(line, allocator)).val; } std.debug.print("Day 18 - Solution 2: {}\n", .{sum}); } } const ParseResult = struct { val: u64 = 0, txt: []const u8 = undefined }; inline fn skipWhitespaces(s: []const u8) []const u8 { var res = s; while (res.len > 0 and std.ascii.isSpace(res[0])) { res = res[1..]; } return res; } fn parseExpression(exp: []const u8) ParseResult { var s = skipWhitespaces(exp); var lhs = switch (s[0]) { '0'...'9' => blk: { const v = @intCast(u64, s[0] - '0'); s = s[1..]; break :blk v; }, '(' => blk: { const res = parseExpression(s[1..]); s = res.txt; break :blk res.val; }, else => unreachable }; while (true) { s = skipWhitespaces(s); if (s.len == 0) return .{ .val = lhs, .txt = s }; if (s[0] == ')') return .{ .val = lhs, .txt = s[1..] }; const op = s[0]; std.debug.assert(op == '*' or op == '+'); s = skipWhitespaces(s[1..]); var rhs = switch (s[0]) { '0'...'9' => blk: { const v = @intCast(u64, s[0] - '0'); s = s[1..]; break :blk v; }, '(' => blk: { const res = parseExpression(s[1..]); s = res.txt; break :blk res.val; }, else => unreachable, }; if (op == '*') { lhs *= rhs; } else if (op == '+') { lhs += rhs; } else unreachable; } } fn parseComponent(exp: []const u8, a: *std.mem.Allocator) ParseResult { var s = skipWhitespaces(exp); return switch (s[0]) { '0' ... '9' => .{ .val = s[0] - '0', .txt = s[1..] }, '(' => blk: { const r = parseExpressionAdvanced(s[1..], a) catch unreachable; break :blk r; }, else => unreachable }; } fn parseExpressionAdvanced(exp: []const u8, a: *std.mem.Allocator) !ParseResult { var s = exp; var comps = std.ArrayList(u64).init(a); defer comps.deinit(); var lhs = blk: { const r = parseComponent(s, a); s = r.txt; break :blk r.val; }; try comps.append(lhs); while (true) { if (s.len == 0 or s[0] == ')') break; s = skipWhitespaces(s); var op = s[0]; s = s[1..]; var rhs = blk: { const r = parseComponent(s, a); s = r.txt; break :blk r.val; }; if (op == '+') { comps.items[comps.items.len - 1] += rhs; } else if (op == '*') { try comps.append(rhs); } else unreachable; } std.debug.assert(comps.items.len > 0); var accum: u64 = 1; for (comps.items) |c| { accum *= c; } s = skipWhitespaces(s); if (s.len > 0) { std.debug.assert(s[0] == ')'); s = s[1..]; } return ParseResult{ .val = accum, .txt = s }; }
2020/src/day_18.zig
const Allocator = std.mem.Allocator; const File = std.fs.File; const FormatInterface = @import("../format_interface.zig").FormatInterface; const ImageFormat = image.ImageFormat; const ImageReader = image.ImageReader; const ImageInfo = image.ImageInfo; const ImageSeekStream = image.ImageSeekStream; const PixelFormat = @import("../pixel_format.zig").PixelFormat; const color = @import("../color.zig"); const errors = @import("../errors.zig"); const fs = std.fs; const image = @import("../image.zig"); const io = std.io; const mem = std.mem; const path = std.fs.path; const std = @import("std"); const utils = @import("../utils.zig"); const BitmapMagicHeader = [_]u8{ 'B', 'M' }; pub const BitmapFileHeader = packed struct { magic_header: [2]u8, size: u32, reserved: u32, pixel_offset: u32, }; pub const CompressionMethod = enum(u32) { None = 0, Rle8 = 1, Rle4 = 2, Bitfields = 3, Jpeg = 4, Png = 5, AlphaBitFields = 6, Cmyk = 11, CmykRle8 = 12, CmykRle4 = 13, }; pub const BitmapColorSpace = enum(u32) { CalibratedRgb = 0, sRgb = utils.toMagicNumberBig("sRGB"), WindowsColorSpace = utils.toMagicNumberBig("Win "), ProfileLinked = utils.toMagicNumberBig("LINK"), ProfileEmbedded = utils.toMagicNumberBig("MBED"), }; pub const BitmapIntent = enum(u32) { Business = 1, Graphics = 2, Images = 4, AbsoluteColorimetric = 8, }; pub const CieXyz = packed struct { x: u32 = 0, // TODO: Use FXPT2DOT30 y: u32 = 0, z: u32 = 0, }; pub const CieXyzTriple = packed struct { red: CieXyz = CieXyz{}, green: CieXyz = CieXyz{}, blue: CieXyz = CieXyz{}, }; pub const BitmapInfoHeaderWindows31 = packed struct { header_size: u32 = 0, width: i32 = 0, height: i32 = 0, color_plane: u16 = 0, bit_count: u16 = 0, compression_method: CompressionMethod = CompressionMethod.None, image_raw_size: u32 = 0, horizontal_resolution: u32 = 0, vertical_resolution: u32 = 0, palette_size: u32 = 0, important_colors: u32 = 0, pub const HeaderSize = @sizeOf(@This()); }; pub const BitmapInfoHeaderV4 = packed struct { header_size: u32 = 0, width: i32 = 0, height: i32 = 0, color_plane: u16 = 0, bit_count: u16 = 0, compression_method: CompressionMethod = CompressionMethod.None, image_raw_size: u32 = 0, horizontal_resolution: u32 = 0, vertical_resolution: u32 = 0, palette_size: u32 = 0, important_colors: u32 = 0, red_mask: u32 = 0, green_mask: u32 = 0, blue_mask: u32 = 0, alpha_mask: u32 = 0, color_space: BitmapColorSpace = BitmapColorSpace.sRgb, cie_end_points: CieXyzTriple = CieXyzTriple{}, gamma_red: u32 = 0, gamma_green: u32 = 0, gamma_blue: u32 = 0, pub const HeaderSize = @sizeOf(@This()); }; pub const BitmapInfoHeaderV5 = packed struct { header_size: u32 = 0, width: i32 = 0, height: i32 = 0, color_plane: u16 = 0, bit_count: u16 = 0, compression_method: CompressionMethod = CompressionMethod.None, image_raw_size: u32 = 0, horizontal_resolution: u32 = 0, vertical_resolution: u32 = 0, palette_size: u32 = 0, important_colors: u32 = 0, red_mask: u32 = 0, green_mask: u32 = 0, blue_mask: u32 = 0, alpha_mask: u32 = 0, color_space: BitmapColorSpace = BitmapColorSpace.sRgb, cie_end_points: CieXyzTriple = CieXyzTriple{}, gamma_red: u32 = 0, gamma_green: u32 = 0, gamma_blue: u32 = 0, intent: BitmapIntent = BitmapIntent.Graphics, profile_data: u32 = 0, profile_size: u32 = 0, reserved: u32 = 0, pub const HeaderSize = @sizeOf(@This()); }; pub const BitmapInfoHeader = union(enum) { Windows31: BitmapInfoHeaderWindows31, V4: BitmapInfoHeaderV4, V5: BitmapInfoHeaderV5, }; pub const Bitmap = struct { file_header: BitmapFileHeader = undefined, info_header: BitmapInfoHeader = undefined, const Self = @This(); pub fn formatInterface() FormatInterface { return FormatInterface{ .format = @ptrCast(FormatInterface.FormatFn, format), .formatDetect = @ptrCast(FormatInterface.FormatDetectFn, formatDetect), .readForImage = @ptrCast(FormatInterface.ReadForImageFn, readForImage), .writeForImage = @ptrCast(FormatInterface.WriteForImageFn, writeForImage), }; } pub fn format() ImageFormat { return ImageFormat.Bmp; } pub fn formatDetect(reader: ImageReader, seek_stream: ImageSeekStream) !bool { _ = seek_stream; var magic_number_buffer: [2]u8 = undefined; _ = try reader.read(magic_number_buffer[0..]); if (std.mem.eql(u8, magic_number_buffer[0..], BitmapMagicHeader[0..])) { return true; } return false; } pub fn readForImage(allocator: *Allocator, reader: ImageReader, seek_stream: ImageSeekStream, pixels: *?color.ColorStorage) !ImageInfo { var bmp = Self{}; try bmp.read(allocator, reader, seek_stream, pixels); var image_info = ImageInfo{}; image_info.width = @intCast(usize, bmp.width()); image_info.height = @intCast(usize, bmp.height()); return image_info; } pub fn writeForImage(allocator: *Allocator, write_stream: image.ImageWriterStream, seek_stream: ImageSeekStream, pixels: color.ColorStorage, save_info: image.ImageSaveInfo) !void { _ = allocator; _ = write_stream; _ = seek_stream; _ = pixels; _ = save_info; } pub fn width(self: Self) i32 { return switch (self.info_header) { .Windows31 => |win31| { return win31.width; }, .V4 => |v4Header| { return v4Header.width; }, .V5 => |v5Header| { return v5Header.width; }, }; } pub fn height(self: Self) i32 { return switch (self.info_header) { .Windows31 => |win31| { return win31.height; }, .V4 => |v4Header| { return v4Header.height; }, .V5 => |v5Header| { return v5Header.height; }, }; } pub fn pixelFormat(self: Self) !PixelFormat { return switch (self.info_header) { .V4 => |v4Header| try findPixelFormat(v4Header.bit_count, v4Header.compression_method), .V5 => |v5Header| try findPixelFormat(v5Header.bit_count, v5Header.compression_method), else => return errors.ImageError.UnsupportedPixelFormat, }; } pub fn read(self: *Self, allocator: *Allocator, reader: ImageReader, seek_stream: ImageSeekStream, pixels_opt: *?color.ColorStorage) !void { // Read file header self.file_header = try utils.readStructLittle(reader, BitmapFileHeader); if (!mem.eql(u8, self.file_header.magic_header[0..], BitmapMagicHeader[0..])) { return errors.ImageError.InvalidMagicHeader; } // Read header size to figure out the header type, also TODO: Use PeekableStream when I understand how to use it const current_header_pos = try seek_stream.getPos(); var header_size = try reader.readIntLittle(u32); try seek_stream.seekTo(current_header_pos); // Read info header self.info_header = switch (header_size) { BitmapInfoHeaderWindows31.HeaderSize => BitmapInfoHeader{ .Windows31 = try utils.readStructLittle(reader, BitmapInfoHeaderWindows31) }, BitmapInfoHeaderV4.HeaderSize => BitmapInfoHeader{ .V4 = try utils.readStructLittle(reader, BitmapInfoHeaderV4) }, BitmapInfoHeaderV5.HeaderSize => BitmapInfoHeader{ .V5 = try utils.readStructLittle(reader, BitmapInfoHeaderV5) }, else => return errors.ImageError.UnsupportedBitmapType, }; // Read pixel data _ = switch (self.info_header) { .V4 => |v4Header| { const pixel_width = v4Header.width; const pixel_height = v4Header.height; const pixel_format = try findPixelFormat(v4Header.bit_count, v4Header.compression_method); pixels_opt.* = try color.ColorStorage.init(allocator, pixel_format, @intCast(usize, pixel_width * pixel_height)); if (pixels_opt.*) |*pixels| { try readPixels(reader, pixel_width, pixel_height, pixel_format, pixels); } }, .V5 => |v5Header| { const pixel_width = v5Header.width; const pixel_height = v5Header.height; const pixel_format = try findPixelFormat(v5Header.bit_count, v5Header.compression_method); pixels_opt.* = try color.ColorStorage.init(allocator, pixel_format, @intCast(usize, pixel_width * pixel_height)); if (pixels_opt.*) |*pixels| { try readPixels(reader, pixel_width, pixel_height, pixel_format, pixels); } }, else => return errors.ImageError.UnsupportedBitmapType, }; } fn findPixelFormat(bit_count: u32, compression: CompressionMethod) !PixelFormat { if (bit_count == 32 and compression == CompressionMethod.Bitfields) { return PixelFormat.Bgra32; } else if (bit_count == 24 and compression == CompressionMethod.None) { return PixelFormat.Bgr24; } else { return errors.ImageError.UnsupportedPixelFormat; } } fn readPixels(reader: ImageReader, pixel_width: i32, pixel_height: i32, pixel_format: PixelFormat, pixels: *color.ColorStorage) !void { return switch (pixel_format) { PixelFormat.Bgr24 => { return readPixelsInternal(pixels.Bgr24, reader, pixel_width, pixel_height); }, PixelFormat.Bgra32 => { return readPixelsInternal(pixels.Bgra32, reader, pixel_width, pixel_height); }, else => { return errors.ImageError.UnsupportedPixelFormat; }, }; } fn readPixelsInternal(pixels: anytype, reader: ImageReader, pixel_width: i32, pixel_height: i32) !void { const ColorBufferType = @typeInfo(@TypeOf(pixels)).Pointer.child; var x: i32 = 0; var y: i32 = pixel_height - 1; while (y >= 0) : (y -= 1) { const scanline = y * pixel_width; x = 0; while (x < pixel_width) : (x += 1) { pixels[@intCast(usize, scanline + x)] = try utils.readStructLittle(reader, ColorBufferType); } } } };
src/formats/bmp.zig
const std = @import("std"); const debug = std.debug; const fmt = std.fmt; const io = std.io; const mem = std.mem; const os = std.os; pub fn main() !void { var allocator = &std.heap.DirectAllocator.init().allocator; var input01 = try get_file_contents(allocator, "input_01.txt"); defer allocator.free(input01); var result = try first_visited_twice(input01); debug.assert(result == 81204); debug.warn("01-2: {}\n", result); } fn first_visited_twice(input: []const u8) !i32 { var sum: i32 = 0; var index: usize = 0; const visited_magnitude: usize = 1000000; const visited_size: usize = (visited_magnitude * 2) + 1; // [ -visited_magnitude, ..., -3, -2, -1, 0, 1, 2, 3, ..., visited_magnitude ] var visited = []bool{false} ** visited_size; //debug.warn("{} ", sum); while (true) { var visited_index = @intCast(usize, @intCast(i32, visited_magnitude) + sum); debug.assert(visited_index >= 0); if (visited[visited_index] == true) { return sum; } else { visited[visited_index] = true; } var e = index; while (input[e] != '\n') { e += 1; } debug.assert('\n' == input[e]); var num = try fmt.parseInt(i32, input[index..e], 10); sum += num; //debug.warn("+ {}\n", num); //debug.warn("{} ", sum); index = (e + 1) % input.len; } debug.warn("\n---\n"); return sum; } test "first_visited_twice" { debug.assert(0 == try first_visited_twice("+1\n-1\n")); debug.assert(10 == try first_visited_twice("+3\n+3\n+4\n-2\n-4\n")); debug.assert(5 == try first_visited_twice("-6\n+3\n+8\n+5\n-6\n")); debug.assert(14 == try first_visited_twice("+7\n+7\n-2\n-7\n-4\n")); } fn get_file_contents(allocator: *mem.Allocator, file_name: []const u8) ![]u8 { var file = try os.File.openRead(file_name); defer file.close(); const file_size = try file.getEndPos(); var file_in_stream = io.FileInStream.init(file); var buf_stream = io.BufferedInStream(io.FileInStream.Error).init(&file_in_stream.stream); const st = &buf_stream.stream; return try st.readAllAlloc(allocator, 2 * file_size); }
2018/day_01_2.zig
const std = @import("std"); const testing = std.testing; const math = @import("std").math; const Mat2 = @import("mat2.zig").Mat2; const Mat3 = @import("mat3.zig").Mat3; const Mat4 = @import("mat4.zig").Mat4; const Quat = @import("quat.zig").Quat; const f_eq = @import("utils.zig").f_eq; const debug = @import("std").debug; pub const Vec3 = packed struct { x: f32, y: f32, z: f32, pub const zero = Vec3.create(0, 0, 0); pub fn create(x: f32, y: f32, z: f32) Vec3 { return Vec3{ .x = x, .y = y, .z = z, }; } pub fn add(a: Vec3, b: Vec3) Vec3 { return Vec3.create( a.x + b.x, a.y + b.y, a.z + b.z, ); } test "add" { const vecA = Vec3.create(1.0, 2.0, 3.0); const vecB = Vec3.create(7.0, 8.0, 9.0); const out = Vec3.add(vecA, vecB); const expected = Vec3.create(8.0, 10.0, 12.0); try Vec3.expectEqual(expected, out); } pub fn substract(a: Vec3, b: Vec3) Vec3 { return Vec3.create( a.x - b.x, a.y - b.y, a.z - b.z, ); } test "substract" { const vecA = Vec3.create(3.0, 2.0, 1.0); const vecB = Vec3.create(7.0, 8.0, 9.0); const out = Vec3.sub(vecA, vecB); const expected = Vec3.create(-4.0, -6.0, -8.0); try Vec3.expectEqual(expected, out); } pub fn multiply(a: Vec3, b: Vec3) Vec3 { return Vec3.create( a.x * b.x, a.y * b.y, a.z * b.z, ); } test "multiply" { const vecA = Vec3.create(1.0, 2.0, 3.0); const vecB = Vec3.create(7.0, 8.0, 9.0); const out = Vec3.mul(vecA, vecB); const expected = Vec3.create(7.0, 16.0, 27.0); try Vec3.expectEqual(expected, out); } pub fn divide(a: Vec3, b: Vec3) Vec3 { return Vec3.create( a.x / b.x, a.y / b.y, a.z / b.z, ); } test "divide" { const vecA = Vec3.create(7.0, 8.0, 9.0); const vecB = Vec3.create(1.0, 2.0, 3.0); const out = Vec3.div(vecA, vecB); const expected = Vec3.create(7.0, 4.0, 3.0); try Vec3.expectEqual(expected, out); } pub fn ceil(a: Vec3) Vec3 { return Vec3.create( @ceil(a.x), @ceil(a.y), @ceil(a.z), ); } test "ceil" { const vecA = Vec3.create(math.e, math.pi, @sqrt(2.0)); const out = vecA.ceil(); const expected = Vec3.create(3.0, 4.0, 2.0); try Vec3.expectEqual(expected, out); } pub fn floor(a: Vec3) Vec3 { return Vec3.create( @floor(a.x), @floor(a.y), @floor(a.z), ); } test "floor" { const vecA = Vec3.create(math.e, math.pi, @sqrt(2.0)); const out = vecA.floor(); const expected = Vec3.create(2.0, 3.0, 1.0); try Vec3.expectEqual(expected, out); } pub fn min(a: Vec3, b: Vec3) Vec3 { return Vec3.create( math.min(a.x, b.x), math.min(a.y, b.y), math.min(a.z, b.z), ); } test "min" { const vecA = Vec3.create(1.0, 3.0, 1.0); const vecB = Vec3.create(3.0, 1.0, 3.0); const out = Vec3.min(vecA, vecB); const expected = Vec3.create(1.0, 1.0, 1.0); try Vec3.expectEqual(expected, out); } pub fn max(a: Vec3, b: Vec3) Vec3 { return Vec3.create( math.max(a.x, b.x), math.max(a.y, b.y), math.max(a.z, b.z), ); } test "max" { const vecA = Vec3.create(1.0, 3.0, 1.0); const vecB = Vec3.create(3.0, 1.0, 3.0); const out = Vec3.max(vecA, vecB); const expected = Vec3.create(3.0, 3.0, 3.0); try Vec3.expectEqual(expected, out); } pub fn round(a: Vec3) Vec3 { return Vec3.create( @round(a.x), @round(a.y), @round(a.z), ); } test "round" { const vecA = Vec3.create(math.e, math.pi, @sqrt(2.0)); const out = vecA.round(); const expected = Vec3.create(3.0, 3.0, 1.0); try Vec3.expectEqual(expected, out); } pub fn scale(a: Vec3, s: f32) Vec3 { return Vec3.create( a.x * s, a.y * s, a.z * s, ); } test "scale" { const vecA = Vec3.create(1.0, 2.0, 3.0); const out = vecA.scale(2.0); const expected = Vec3.create(2.0, 4.0, 6.0); try Vec3.expectEqual(expected, out); } pub fn scaleAndAdd(a: Vec3, b: Vec3, s: f32) Vec3 { return Vec3.create( a.x + (b.x * s), a.y + (b.y * s), a.z + (b.z * s), ); } test "scaleAndAdd" { const vecA = Vec3.create(1.0, 2.0, 3.0); const vecB = Vec3.create(4.0, 5.0, 6.0); const out = vecA.scaleAndAdd(vecB, 0.5); const expected = Vec3.create(3.0, 4.5, 6.0); try Vec3.expectEqual(expected, out); } pub fn distance(a: Vec3, b: Vec3) f32 { // TODO: use std.math.hypot return @sqrt(Vec3.squaredDistance(a, b)); //const x = a.x - b.x; //const y = a.y - b.y; //const z = a.z - b.z; //return math.hypot(f32, x, y, z); } test "distance" { const vecA = Vec3.create(1.0, 2.0, 3.0); const vecB = Vec3.create(4.0, 5.0, 6.0); const out = vecA.distance(vecB); const expected = 5.196152; try testing.expectEqual(out, expected); } pub fn squaredDistance(a: Vec3, b: Vec3) f32 { const x = a.x - b.x; const y = a.y - b.y; const z = a.z - b.z; return x * x + y * y + z * z; } test "squaredDistance" { const vecA = Vec3.create(1.0, 2.0, 3.0); const vecB = Vec3.create(4.0, 5.0, 6.0); const out = vecA.squaredDistance(vecB); const expected = 27.0; try testing.expectEqual(out, expected); } pub fn length(a: Vec3) f32 { // TODO: use std.math.hypot return @sqrt(a.squaredLength()); //const x = a.x; //const y = a.y; //const z = a.z; //return math.hypot(f32, x, y) + math.hypot(f32, y, z); } test "length" { const vecA = Vec3.create(1.0, 2.0, 3.0); const out = vecA.length(); const expected = 3.74165749; try testing.expectEqual(out, expected); } pub fn squaredLength(a: Vec3) f32 { const x = a.x; const y = a.y; const z = a.z; return x * x + y * y + z * z; } test "squaredLength" { const vecA = Vec3.create(1.0, 2.0, 3.0); const out = vecA.squaredLength(); const expected = 14; try testing.expectEqual(out, expected); } pub fn negate(a: Vec3) Vec3 { const x = a.x; const y = a.y; const z = a.z; return Vec3.create( -x, -y, -z, ); } test "negate" { const vecA = Vec3.create(1.0, 2.0, 3.0); const out = vecA.negate(); const expected = Vec3.create(-1.0, -2.0, -3.0); try testing.expectEqual(out, expected); } pub fn inverse(a: Vec3) Vec3 { const x = 1.0 / a.x; const y = 1.0 / a.y; const z = 1.0 / a.z; return Vec3.create( -x, -y, -z, ); } pub fn normalize(a: Vec3) Vec3 { const x = a.x; const y = a.y; const z = a.z; var l = x * x + y * y + z * z; if (l > 0) l = 1 / @sqrt(l); return Vec3.create( x * l, y * l, z * l, ); } test "normalize" { const vecA = Vec3.create(5.0, 0.0, 0.0); const out = vecA.normalize(); const expected = Vec3.create(1.0, 0.0, 0.0); try Vec3.expectEqual(expected, out); } pub fn dot(a: Vec3, b: Vec3) f32 { return a.x * b.x // + a.y * b.y // + a.z * b.z; } test "dot" { const vecA = Vec3.create(1.0, 2.0, 3.0); const vecB = Vec3.create(4.0, 5.0, 6.0); const out = Vec3.dot(vecA, vecB); const expected = 32.0; try testing.expectEqual(out, expected); } pub fn cross(a: Vec3, b: Vec3) Vec3 { const ax = a.x; const ay = a.y; const az = a.z; const bx = b.x; const by = b.y; const bz = b.z; return Vec3.create( ay * bz - az * by, az * bx - ax * bz, ax * by - ay * bx, ); } test "cross" { const vecA = Vec3.create(1.0, 2.0, 3.0); const vecB = Vec3.create(4.0, 5.0, 6.0); const out = Vec3.cross(vecA, vecB); const expected = Vec3.create(-3.0, 6.0, -3.0); try Vec3.expectEqual(expected, out); } pub fn lerp(a: Vec3, b: Vec3, t: f32) Vec3 { return Vec3.create( a.x + t * (b.x - a.x), a.y + t * (b.y - a.y), a.z + t * (b.z - a.z), ); } test "lerp" { const vecA = Vec3.create(1.0, 2.0, 3.0); const vecB = Vec3.create(4.0, 5.0, 6.0); const out = Vec3.lerp(vecA, vecB, 0.5); const expected = Vec3.create(2.5, 3.5, 4.5); try Vec3.expectEqual(expected, out); } pub fn hermite(a: Vec3, b: Vec3, c: Vec3, d: Vec3, t: f32) Vec3 { const factorTimes2 = t * t; const factor1 = factorTimes2 * (2 * t - 3) + 1; const factor2 = factorTimes2 * (t - 2) + t; const factor3 = factorTimes2 * (t - 1); const factor4 = factorTimes2 * (3 - 2 * t); return Vec3.create( a.x * factor1 + b.x * factor2 + c.x * factor3 + d.x * factor4, a.y * factor1 + b.y * factor2 + c.y * factor3 + d.y * factor4, a.z * factor1 + b.z * factor2 + c.z * factor3 + d.z * factor4, ); } pub fn bezier(a: Vec3, b: Vec3, c: Vec3, d: Vec3, t: f32) Vec3 { const inverseFactor = 1 - t; const inverseFactorTimesTwo = inverseFactor * inverseFactor; const factorTimes2 = t * t; const factor1 = inverseFactorTimesTwo * inverseFactor; const factor2 = 3 * t * inverseFactorTimesTwo; const factor3 = 3 * factorTimes2 * inverseFactor; const factor4 = factorTimes2 * t; return Vec3.create( a.x * factor1 + b.x * factor2 + c.x * factor3 + d.x * factor4, a.y * factor1 + b.y * factor2 + c.y * factor3 + d.y * factor4, a.z * factor1 + b.z * factor2 + c.z * factor3 + d.z * factor4, ); } pub fn transformMat3(a: Vec3, m: Mat3) Vec3 { return Vec3.create( a.x * m.data[0][0] + a.y * m.data[1][0] + a.z * m.data[2][0], a.x * m.data[0][1] + a.y * m.data[1][1] + a.z * m.data[2][1], a.x * m.data[0][2] + a.y * m.data[1][2] + a.z * m.data[2][2], ); } pub fn transformQuat(a: Vec3, q: Quat) Vec3 { // var uv = vec3.cross([], qvec, a); var uvx = q.y * a.z - q.z * a.y; var uvy = q.z * a.x - q.x * a.z; var uvz = q.x * a.y - q.y * a.x; // var uuv = vec3.cross([], qvec, uv); var uuvx = q.y * uvz - q.z * uvy; var uuvy = q.z * uvx - q.x * uvz; var uuvz = q.x * uvy - q.y * uvx; // vec3.scale(uv, uv, 2 * w); const w2 = q.w * 2; uvx *= w2; uvy *= w2; uvz *= w2; // vec3.scale(uuv, uuv, 2); uuvx *= 2; uuvy *= 2; uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv)); return Vec3.create( a.x + uvx + uuvx, a.y + uvy + uuvy, a.z + uvz + uuvz, ); } pub fn transformMat4(a: Vec3, m: Mat4) Vec3 { const x = a.x; const y = a.y; const z = a.z; var w = m.data[0][3] * x + m.data[1][3] * y + m.data[2][3] * z + m.data[3][3]; if (w == 0.0) w = 1.0; return Vec3.create( (m.data[0][0] * x + m.data[1][0] * y + m.data[2][0] * z + m.data[3][0]) / w, (m.data[0][1] * x + m.data[1][1] * y + m.data[2][1] * z + m.data[3][1]) / w, (m.data[0][2] * x + m.data[1][2] * y + m.data[2][2] * z + m.data[3][2]) / w, ); } test "transformMat3 identity" { const vecA = Vec3.create(1.0, 2.0, 3.0); const m = Mat3.identity; const out = vecA.transformMat3(m); const expected = Vec3.create(1.0, 2.0, 3.0); try Vec3.expectEqual(expected, out); } test "transformMat3 with 90deg about X" { const vecA = Vec3.create(0.0, 1.0, 0.0); const m = Mat3.create(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, -1.0, 0.0); const out = vecA.transformMat3(m); const expected = Vec3.create(0.0, 0.0, 1.0); try Vec3.expectEqual(expected, out); } test "transformMat3 with 90deg about Y" { const vecA = Vec3.create(1.0, 0.0, 0.0); const m = Mat3.create(0.0, 0.0, -1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0); const out = vecA.transformMat3(m); const expected = Vec3.create(0.0, 0.0, -1.0); try Vec3.expectEqual(expected, out); } test "transformMat3 with 90deg about Z" { const vecA = Vec3.create(1.0, 0.0, 0.0); const m = Mat3.create(0.0, 1.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 1.0); const out = vecA.transformMat3(m); const expected = Vec3.create(0.0, 1.0, 0.0); try Vec3.expectEqual(expected, out); } pub fn rotateX(a: Vec3, origin: Vec3, rad: f32) Vec3 { //Translate point to the origin const px = a.x - origin.x; const py = a.y - origin.y; const pz = a.z - origin.z; const cos = @cos(rad); const sin = @sin(rad); //perform rotation const rx = px; const ry = py * cos - pz * sin; const rz = py * sin + pz * cos; //translate to correct position return Vec3.create( rx + origin.x, ry + origin.y, rz + origin.z, ); } test "rotateX around world origin [0, 0, 0]" { const vecA = Vec3.create(0.0, 1.0, 0.0); const vecB = Vec3.create(0.0, 0.0, 0.0); const out = Vec3.rotateX(vecA, vecB, math.pi); const expected = Vec3.create(0.0, -1.0, 0.0); try Vec3.expectEqual(expected, out); } test "rotateX around arbitrary origin" { const vecA = Vec3.create(2.0, 7.0, 0.0); const vecB = Vec3.create(2.0, 5.0, 0.0); const out = vecA.rotateX(vecB, math.pi); const expected = Vec3.create(2.0, 3.0, 0.0); try Vec3.expectEqual(expected, out); } pub fn rotateY(a: Vec3, origin: Vec3, rad: f32) Vec3 { const px = a.x - origin.x; const py = a.y - origin.y; const pz = a.z - origin.z; const cos = @cos(rad); const sin = @sin(rad); const rx = pz * sin + px * cos; const ry = py; const rz = pz * cos - px * sin; return Vec3.create( rx + origin.x, ry + origin.y, rz + origin.z, ); } test "rotateY around world origin [0, 0, 0]" { const vecA = Vec3.create(1.0, 0.0, 0.0); const vecB = Vec3.create(0.0, 0.0, 0.0); const out = vecA.rotateY(vecB, math.pi); const expected = Vec3.create(-1.0, 0.0, 0.0); try Vec3.expectEqual(expected, out); } test "rotateY around arbitrary origin" { const vecA = Vec3.create(-2.0, 3.0, 10.0); const vecB = Vec3.create(-4.0, 3.0, 10.0); const out = vecA.rotateY(vecB, math.pi); const expected = Vec3.create(-6.0, 3.0, 10.0); try Vec3.expectEqual(expected, out); } pub fn rotateZ(a: Vec3, origin: Vec3, rad: f32) Vec3 { //Translate point to the origin const px = a.x - origin.x; const py = a.y - origin.y; const pz = a.z - origin.z; const cos = @cos(rad); const sin = @sin(rad); //perform rotation const rx = px * cos - py * sin; const ry = px * sin + py * cos; const rz = pz; //translate to correct position return Vec3.create( rx + origin.x, ry + origin.y, rz + origin.z, ); } test "rotateZ around world origin [0, 0, 0]" { const vecA = Vec3.create(0.0, 1.0, 0.0); const vecB = Vec3.create(0.0, 0.0, 0.0); const out = vecA.rotateZ(vecB, math.pi); const expected = Vec3.create(0.0, -1.0, 0.0); try Vec3.expectEqual(expected, out); } test "rotateZ around arbitrary origin" { const vecA = Vec3.create(0.0, 6.0, -5.0); const vecB = Vec3.create(0.0, 0.0, -5.0); const out = vecA.rotateZ(vecB, math.pi); const expected = Vec3.create(0.0, -6.0, -5.0); try Vec3.expectEqual(expected, out); } pub fn angle(a: Vec3, b: Vec3) f32 { const tempA = a.normalize(); const tempB = b.normalize(); const cosine = Vec3.dot(tempA, tempB); if (cosine > 1.0) { return 0.0; } else if (cosine < -1.0) { return math.pi; } else { return math.acos(cosine); } } test "angle" { const vecA = Vec3.create(1.0, 2.0, 3.0); const vecB = Vec3.create(4.0, 5.0, 6.0); const out = vecA.angle(vecB); const expected = 0.225726; try testing.expect(f_eq(expected, out)); } pub fn equals(a: Vec3, b: Vec3) bool { return f_eq(a.x, b.x) and f_eq(a.y, b.y) and f_eq(a.z, b.z); } pub fn equalsExact(a: Vec3, b: Vec3) bool { return a.x == b.x and a.y == b.y and a.z == b.z; } pub fn format( value: @This(), comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype, ) !void { _ = options; _ = fmt; return std.fmt.format( writer, "Vec3({d:.3}, {d:.3}, {d:.3})", .{ value.x, value.y, value.z }, ); } pub const sub = substract; pub const mul = multiply; pub const div = divide; pub const dist = distance; pub const sqrDist = squaredDistance; pub const len = length; pub const sqrLen = squaredLength; pub fn expectEqual(expected: Vec3, actual: Vec3) !void { if (!equals(expected, actual)) { std.debug.warn("Expected: {}, found {}", .{ expected, actual }); return error.NotEqual; } } };
src/vec3.zig
const std = @import("std"); const gk = @import("gamekit"); const math = gk.math; const gfx = gk.gfx; var tex: gfx.Texture = undefined; var colored_tex: gfx.Texture = undefined; var mesh: gfx.Mesh = undefined; var dyn_mesh: gfx.DynamicMesh(u16, gfx.Vertex) = undefined; pub fn main() !void { try gk.run(.{ .init = init, .update = update, .render = render, }); } fn init() !void { tex = gfx.Texture.initCheckerTexture(); colored_tex = gfx.Texture.initSingleColor(0xFFFF0000); var vertices = [_]gfx.Vertex{ .{ .pos = .{ .x = 10, .y = 10 }, .uv = .{ .x = 0, .y = 0 } }, // tl .{ .pos = .{ .x = 100, .y = 10 }, .uv = .{ .x = 1, .y = 0 } }, // tr .{ .pos = .{ .x = 100, .y = 100 }, .uv = .{ .x = 1, .y = 1 } }, // br .{ .pos = .{ .x = 50, .y = 130 }, .uv = .{ .x = 0.5, .y = 1 } }, // bc .{ .pos = .{ .x = 10, .y = 100 }, .uv = .{ .x = 0, .y = 1 } }, // bl .{ .pos = .{ .x = 50, .y = 50 }, .uv = .{ .x = 0.5, .y = 0.5 } }, // c }; var indices = [_]u16{ 0, 5, 4, 5, 3, 4, 5, 2, 3, 5, 1, 2, 5, 0, 1 }; mesh = gfx.Mesh.init(u16, indices[0..], gfx.Vertex, vertices[0..]); var dyn_vertices = [_]gfx.Vertex{ .{ .pos = .{ .x = 10, .y = 10 }, .uv = .{ .x = 0, .y = 0 } }, // tl .{ .pos = .{ .x = 100, .y = 10 }, .uv = .{ .x = 1, .y = 0 } }, // tr .{ .pos = .{ .x = 100, .y = 100 }, .uv = .{ .x = 1, .y = 1 } }, // br .{ .pos = .{ .x = 10, .y = 100 }, .uv = .{ .x = 0, .y = 1 } }, // bl }; var dyn_indices = [_]u16{ 0, 1, 2, 2, 3, 0 }; dyn_mesh = try gfx.DynamicMesh(u16, gfx.Vertex).init(std.heap.c_allocator, vertices.len, &dyn_indices); for (dyn_vertices) |*vert, i| { vert.pos.x += 200; vert.pos.y += 200; dyn_mesh.verts[i] = vert.*; } } fn update() !void { for (dyn_mesh.verts) |*vert| { vert.pos.x += 0.1; vert.pos.y += 0.1; } dyn_mesh.updateAllVerts(); } fn render() !void { gk.gfx.beginPass(.{ .color = math.Color.beige }); mesh.bindImage(tex.img, 0); mesh.draw(); dyn_mesh.bindImage(colored_tex.img, 0); dyn_mesh.drawAllVerts(); gk.gfx.endPass(); }
examples/meshes.zig
const tone = @import("tone.zig"); const tune = @import("tune.zig"); const note = @import("note.zig"); const music = @import("music.zig"); const c5 = note.getFreq("C 5".*); const c4 = note.getFreq("C 4".*); const c3 = note.getFreq("C 3".*); const e4 = note.getFreq("E 4".*); const e5 = note.getFreq("E 5".*); const ds5 = note.getFreq("D#5".*); const d5 = note.getFreq("D 5".*); const d4 = note.getFreq("D 4".*); const g4 = note.getFreq("G 4".*); const f4 = note.getFreq("F 4".*); const b3 = note.getFreq("B 3".*); const a4 = note.getFreq("A 4".*); const fs3 = note.getFreq("F#3".*); const es3 = note.getFreq("E#3".*); const d3 = note.getFreq("D 3".*); const e3 = note.getFreq("E 3".*); const f3 = note.getFreq("F 3".*); const g3 = note.getFreq("G 3".*); const a3 = note.getFreq("A 3".*); const d2 = note.getFreq("D 2".*); const g2 = note.getFreq("G 2".*); const a2 = note.getFreq("A 2".*); const c2 = note.getFreq("C 2".*); const b2 = note.getFreq("B 2".*); const b1 = note.getFreq("B 1".*); // Half sharps const bhs2 = note.getFreqHalfSharp("B 2".*); const ehs3 = note.getFreqHalfSharp("E 3".*); const fds3 = note.getFreqHalfSharp("F#3".*); var melodyTone = tone.Tone{ .sfreq = c5, .efreq = c5, .channel = 1, .mode = 2, .volume = 30 }; var drumTone = tone.Tone{ .sfreq = c5, .efreq = c5, .channel = 3, .release = 10, .volume = 25, .mode = 3 }; var bassTone = tone.Tone{ .sfreq = c5, .efreq = c5, .channel = 2, .volume = 100 }; var melodyNotes = [_]note.Note{ note.Note{ .sfreq = e4, .efreq = e5, .length = 30 }, note.Note{ .sfreq = e4, .efreq = ds5, .length = 30 }, note.Note{ .sfreq = d4, .efreq = d5, .length = 30 }, note.Note{ .sfreq = g4, .efreq = d4, .length = 30 }, note.Note{ .sfreq = d4, .efreq = d4, .length = 8 }, note.Note{ .sfreq = d4, .efreq = d4, .length = 7 }, note.Note{ .sfreq = d4, .efreq = d4, .length = 30, .on = false }, note.Note{ .sfreq = d4, .efreq = d4, .length = 8 }, note.Note{ .sfreq = d4, .efreq = d4, .length = 7 }, note.Note{ .sfreq = d4, .efreq = d4, .length = 45, .on = false }, note.Note{ .sfreq = e4, .efreq = e4, .length = 135 }, note.Note{ .sfreq = d4, .efreq = d4, .length = 240 }, note.Note{ .sfreq = d4, .efreq = d4, .length = 240 }, note.Note{ .sfreq = g4, .efreq = g4, .length = 8 }, note.Note{ .sfreq = g4, .efreq = g4, .length = 7 }, note.Note{ .sfreq = d4, .efreq = d4, .length = 30, .on = false }, note.Note{ .sfreq = f4, .efreq = f4, .length = 8 }, note.Note{ .sfreq = f4, .efreq = f4, .length = 7 }, note.Note{ .sfreq = d4, .efreq = d4, .length = 30, .on = false }, note.Note{ .sfreq = e4, .efreq = e4, .length = 8 }, note.Note{ .sfreq = e4, .efreq = e4, .length = 7 }, note.Note{ .sfreq = d4, .efreq = d4, .length = 15, .on = false }, note.Note{ .sfreq = e4, .efreq = e4, .length = 120 }, note.Note{ .sfreq = d4, .efreq = d4, .length = 8 }, note.Note{ .sfreq = d4, .efreq = d4, .length = 7 }, note.Note{ .sfreq = d4, .efreq = d4, .length = 30, .on = false }, note.Note{ .sfreq = c4, .efreq = c4, .length = 8 }, note.Note{ .sfreq = c4, .efreq = c4, .length = 7 }, note.Note{ .sfreq = d4, .efreq = c4, .length = 30, .on = false }, note.Note{ .sfreq = b3, .efreq = b3, .length = 8 }, note.Note{ .sfreq = b3, .efreq = b3, .length = 7 }, note.Note{ .sfreq = d4, .efreq = d4, .length = 15, .on = false }, note.Note{ .sfreq = b3, .efreq = b3, .length = 120 }, note.Note{ .sfreq = a4, .efreq = a4, .length = 8 }, note.Note{ .sfreq = a4, .efreq = a4, .length = 7 }, note.Note{ .sfreq = d4, .efreq = c4, .length = 30, .on = false }, note.Note{ .sfreq = a4, .efreq = a4, .length = 60 }, note.Note{ .sfreq = d4, .efreq = c4, .length = 15, .on = false }, note.Note{ .sfreq = g4, .efreq = g4, .length = 8 }, note.Note{ .sfreq = g4, .efreq = g4, .length = 7 }, note.Note{ .sfreq = d4, .efreq = c4, .length = 30, .on = false }, note.Note{ .sfreq = g4, .efreq = g4, .length = 60 }, note.Note{ .sfreq = d4, .efreq = c4, .length = 15, .on = false }, note.Note{ .sfreq = d4, .efreq = d4, .length = 8 }, note.Note{ .sfreq = d4, .efreq = d4, .length = 7 }, note.Note{ .sfreq = d4, .efreq = d4, .length = 30, .on = false }, note.Note{ .sfreq = c4, .efreq = c4, .length = 8 }, note.Note{ .sfreq = c4, .efreq = c4, .length = 7 }, note.Note{ .sfreq = d4, .efreq = c4, .length = 30, .on = false }, note.Note{ .sfreq = d4, .efreq = d4, .length = 8 }, note.Note{ .sfreq = d4, .efreq = d4, .length = 7 }, note.Note{ .sfreq = d4, .efreq = d4, .length = 15, .on = false }, note.Note{ .sfreq = d4, .efreq = d4, .length = 120 }, }; var drumNotes = [_]note.Note{ note.Note{ .sfreq = c5, .efreq = c5, .length = 240, .on = false }, note.Note{ .sfreq = c3, .efreq = c3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 20, .on = false }, note.Note{ .sfreq = c3, .efreq = c3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 20, .on = false }, note.Note{ .sfreq = c3, .efreq = c3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 12, .on = false }, note.Note{ .sfreq = c3, .efreq = c3, .length = 8 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = c3, .efreq = c3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = c3, .efreq = c3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = c3, .efreq = c4, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c4, .length = 5, .on = false }, note.Note{ .sfreq = c3, .efreq = c3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 12, .on = false }, note.Note{ .sfreq = c3, .efreq = c4, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c4, .length = 13, .on = false }, note.Note{ .sfreq = c3, .efreq = c3, .length = 7 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 8 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = c3, .efreq = c4, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c4, .length = 5, .on = false }, }; var bassNotes = [_]note.Note{ note.Note{ .sfreq = c5, .efreq = c5, .length = 120, .on = false }, note.Note{ .sfreq = fs3, .efreq = fs3, .length = 8 }, note.Note{ .sfreq = fs3, .efreq = fs3, .length = 7 }, note.Note{ .sfreq = d4, .efreq = d4, .length = 30, .on = false }, note.Note{ .sfreq = fs3, .efreq = fs3, .length = 8 }, note.Note{ .sfreq = fs3, .efreq = fs3, .length = 7 }, note.Note{ .sfreq = d4, .efreq = d4, .length = 45, .on = false }, note.Note{ .sfreq = c4, .efreq = c4, .length = 135 }, note.Note{ .sfreq = d2, .efreq = d2, .length = 10 }, // Marker bar 1 note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = d3, .efreq = d3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = g2, .efreq = g2, .length = 8 }, note.Note{ .sfreq = a2, .efreq = a2, .length = 7 }, note.Note{ .sfreq = bhs2, .efreq = bhs2, .length = 8 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 7 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 8, .on = false }, note.Note{ .sfreq = a2, .efreq = a2, .length = 7 }, note.Note{ .sfreq = a2, .efreq = a2, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = c3, .efreq = c3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = d3, .efreq = d3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = d2, .efreq = d2, .length = 10 }, // Marker bar 2 note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = d3, .efreq = d3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = c2, .efreq = c2, .length = 8 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 7 }, note.Note{ .sfreq = c2, .efreq = c2, .length = 8 }, note.Note{ .sfreq = b1, .efreq = b1, .length = 7 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 8, .on = false }, note.Note{ .sfreq = b2, .efreq = b2, .length = 7 }, note.Note{ .sfreq = b2, .efreq = bhs2, .length = 8 }, note.Note{ .sfreq = a2, .efreq = a2, .length = 7 }, note.Note{ .sfreq = d3, .efreq = d3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = c3, .efreq = c3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = d2, .efreq = d2, .length = 10 }, // Marker bar 3 note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = d3, .efreq = d3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = g2, .efreq = g2, .length = 8 }, note.Note{ .sfreq = a2, .efreq = a2, .length = 7 }, note.Note{ .sfreq = bhs2, .efreq = bhs2, .length = 8 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 7 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 8, .on = false }, note.Note{ .sfreq = a2, .efreq = a2, .length = 7 }, note.Note{ .sfreq = a2, .efreq = a2, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = c3, .efreq = c3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = d3, .efreq = d3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = e3, .efreq = e3, .length = 8 }, // Marker bar 4 note.Note{ .sfreq = d3, .efreq = d3, .length = 7 }, note.Note{ .sfreq = d3, .efreq = d3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = g3, .efreq = g3, .length = 8 }, note.Note{ .sfreq = a3, .efreq = a3, .length = 7 }, note.Note{ .sfreq = es3, .efreq = es3, .length = 8 }, note.Note{ .sfreq = d3, .efreq = d3, .length = 15 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 15 }, note.Note{ .sfreq = b2, .efreq = b2, .length = 15 }, note.Note{ .sfreq = g2, .efreq = g2, .length = 7 }, note.Note{ .sfreq = a2, .efreq = a2, .length = 15 }, note.Note{ .sfreq = g2, .efreq = g2, .length = 10 }, // Marker bar 5 note.Note{ .sfreq = g3, .efreq = g3, .length = 5, .on = false }, note.Note{ .sfreq = g3, .efreq = g3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = c3, .efreq = c3, .length = 8 }, note.Note{ .sfreq = d3, .efreq = d3, .length = 7 }, note.Note{ .sfreq = e3, .efreq = ehs3, .length = 8 }, note.Note{ .sfreq = es3, .efreq = es3, .length = 7 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 8, .on = false }, note.Note{ .sfreq = d3, .efreq = d3, .length = 7 }, note.Note{ .sfreq = d3, .efreq = d3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = es3, .efreq = es3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = g3, .efreq = g3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = e3, .efreq = e3, .length = 8 }, // Marker bar 6 note.Note{ .sfreq = d3, .efreq = d3, .length = 7 }, note.Note{ .sfreq = d3, .efreq = d3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = g3, .efreq = g3, .length = 8 }, note.Note{ .sfreq = a3, .efreq = a3, .length = 7 }, note.Note{ .sfreq = es3, .efreq = es3, .length = 8 }, note.Note{ .sfreq = fs3, .efreq = fs3, .length = 15 }, note.Note{ .sfreq = d3, .efreq = d3, .length = 15 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 15 }, note.Note{ .sfreq = a2, .efreq = a2, .length = 7 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 8 }, note.Note{ .sfreq = es3, .efreq = es3, .length = 7 }, note.Note{ .sfreq = d2, .efreq = d2, .length = 10 }, // Marker bar 7 note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = d3, .efreq = d3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = g2, .efreq = g2, .length = 8 }, note.Note{ .sfreq = a2, .efreq = a2, .length = 7 }, note.Note{ .sfreq = bhs2, .efreq = bhs2, .length = 8 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 7 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 8, .on = false }, note.Note{ .sfreq = a2, .efreq = a2, .length = 7 }, note.Note{ .sfreq = a2, .efreq = a2, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = c3, .efreq = c3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = d3, .efreq = d3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = d2, .efreq = d2, .length = 10 }, // Marker bar 8 note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = d3, .efreq = d3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = g2, .efreq = g2, .length = 8 }, note.Note{ .sfreq = a2, .efreq = a2, .length = 7 }, note.Note{ .sfreq = bhs2, .efreq = bhs2, .length = 8 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 7 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 8, .on = false }, note.Note{ .sfreq = a2, .efreq = a2, .length = 7 }, note.Note{ .sfreq = a2, .efreq = a2, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = c3, .efreq = c3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = d3, .efreq = d3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = a2, .efreq = a2, .length = 10 }, // Marker bar 9 note.Note{ .sfreq = a3, .efreq = a3, .length = 5, .on = false }, note.Note{ .sfreq = a3, .efreq = a3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = d3, .efreq = d3, .length = 8 }, note.Note{ .sfreq = e3, .efreq = e3, .length = 7 }, note.Note{ .sfreq = fs3, .efreq = fds3, .length = 8 }, note.Note{ .sfreq = g3, .efreq = g3, .length = 7 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 8, .on = false }, note.Note{ .sfreq = e3, .efreq = e3, .length = 7 }, note.Note{ .sfreq = e3, .efreq = e3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = g3, .efreq = g3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = a3, .efreq = a3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = g2, .efreq = g2, .length = 10 }, // Marker bar 10 note.Note{ .sfreq = g3, .efreq = g3, .length = 5, .on = false }, note.Note{ .sfreq = g3, .efreq = g3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = c3, .efreq = c3, .length = 8 }, note.Note{ .sfreq = d3, .efreq = d3, .length = 7 }, note.Note{ .sfreq = ehs3, .efreq = ehs3, .length = 8 }, note.Note{ .sfreq = f3, .efreq = f3, .length = 7 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 8, .on = false }, note.Note{ .sfreq = d3, .efreq = d3, .length = 7 }, note.Note{ .sfreq = d3, .efreq = d3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = f3, .efreq = f3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = g3, .efreq = g3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = d2, .efreq = d2, .length = 10 }, // Marker bar 11 note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = d3, .efreq = d3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = g2, .efreq = g2, .length = 8 }, note.Note{ .sfreq = a2, .efreq = a2, .length = 7 }, note.Note{ .sfreq = bhs2, .efreq = bhs2, .length = 8 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 7 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 8, .on = false }, note.Note{ .sfreq = a2, .efreq = a2, .length = 7 }, note.Note{ .sfreq = a2, .efreq = a2, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = c3, .efreq = c3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = d3, .efreq = d3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = d3, .efreq = d3, .length = 8 }, // Marker bar 12 note.Note{ .sfreq = d4, .efreq = d4, .length = 7 }, note.Note{ .sfreq = c4, .efreq = c4, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = b3, .efreq = b3, .length = 10 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 5, .on = false }, note.Note{ .sfreq = g3, .efreq = g3, .length = 8 }, note.Note{ .sfreq = a3, .efreq = a3, .length = 7 }, note.Note{ .sfreq = es3, .efreq = es3, .length = 8 }, note.Note{ .sfreq = d3, .efreq = d3, .length = 7 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 8 }, note.Note{ .sfreq = a2, .efreq = a2, .length = 7 }, note.Note{ .sfreq = c3, .efreq = c3, .length = 8 }, note.Note{ .sfreq = d3, .efreq = d3, .length = 7 }, note.Note{ .sfreq = e3, .efreq = e3, .length = 8 }, note.Note{ .sfreq = d3, .efreq = f3, .length = 7 }, }; var melody = tune.Tune{ .notes = &melodyNotes, .numNotes = melodyNotes.len, .tone = &melodyTone, .introEndNote = 13 }; var drums = tune.Tune{ .notes = &drumNotes, .numNotes = drumNotes.len, .tone = &drumTone, .introEndNote = 12 }; var bass = tune.Tune{ .notes = &bassNotes, .numNotes = bassNotes.len, .tone = &bassTone, .introEndNote = 8 }; pub const partyVibezMusic = music.Music{ .part1 = &melody, .part2 = &drums, .part3 = &bass };
src/music/party-vibez.zig
const addv = @import("addo.zig"); const std = @import("std"); const testing = std.testing; const math = std.math; fn test__addoti4(a: i128, b: i128) !void { var result_ov: c_int = undefined; var expected_ov: c_int = undefined; var result = addv.__addoti4(a, b, &result_ov); var expected: i128 = simple_addoti4(a, b, &expected_ov); try testing.expectEqual(expected, result); try testing.expectEqual(expected_ov, result_ov); } fn simple_addoti4(a: i128, b: i128, overflow: *c_int) i128 { overflow.* = 0; const min: i128 = math.minInt(i128); const max: i128 = math.maxInt(i128); if (((a > 0) and (b > max - a)) or ((a < 0) and (b < min - a))) overflow.* = 1; return a +% b; } test "addoti4" { const min: i128 = math.minInt(i128); const max: i128 = math.maxInt(i128); var i: i128 = 1; while (i < max) : (i *|= 2) { try test__addoti4(i, i); try test__addoti4(-i, -i); try test__addoti4(i, -i); try test__addoti4(-i, i); } // edge cases // 0 + 0 = 0 // MIN + MIN overflow // MAX + MAX overflow // 0 + MIN MIN // 0 + MAX MAX // MIN + 0 MIN // MAX + 0 MAX // MIN + MAX -1 // MAX + MIN -1 try test__addoti4(0, 0); try test__addoti4(min, min); try test__addoti4(max, max); try test__addoti4(0, min); try test__addoti4(0, max); try test__addoti4(min, 0); try test__addoti4(max, 0); try test__addoti4(min, max); try test__addoti4(max, min); // derived edge cases // MIN+1 + MIN overflow // MAX-1 + MAX overflow // 1 + MIN = MIN+1 // -1 + MIN overflow // -1 + MAX = MAX-1 // +1 + MAX overflow // MIN + 1 = MIN+1 // MIN + -1 overflow // MAX + 1 overflow // MAX + -1 = MAX-1 try test__addoti4(min + 1, min); try test__addoti4(max - 1, max); try test__addoti4(1, min); try test__addoti4(-1, min); try test__addoti4(-1, max); try test__addoti4(1, max); try test__addoti4(min, 1); try test__addoti4(min, -1); try test__addoti4(max, -1); try test__addoti4(max, 1); }
lib/std/special/compiler_rt/addoti4_test.zig
const std = @import("std"); const print = std.debug.print; const List = std.ArrayList; const util = @import("util.zig"); const gpa = util.gpa; const data = @embedFile("../data/day10.txt"); fn find(char: u8) ?u8 { const openings = [_]u8{ '(', '[', '{', '<' }; const closings = [_]u8{ ')', ']', '}', '>' }; for (openings) |opener, i| { if (char == opener) return closings[i]; } return null; } const asc = std.sort.asc(usize); pub fn main() !void { var stack = List(u8).init(gpa); defer stack.deinit(); var lines = try util.toStrSlice(data, "\n"); defer gpa.free(lines); var score: usize = 0; var scores_incomplete = List(usize).init(gpa); for (lines) |line| { var is_incomplete = true; for (line) |char| { if (find(char)) |closing| { // an opening try stack.append(closing); } else { // a closing var expect = stack.pop(); if (expect != char) { score += switch (char) { ')' => 3, ']' => 57, '}' => 1197, '>' => 25137, else => @as(usize, 0), }; is_incomplete = false; break; } } } // incomplete if (is_incomplete) { var incomplete: usize = 0; while (stack.items.len > 0) { incomplete *= 5; var char = stack.pop(); incomplete += switch (char) { ')' => 1, ']' => 2, '}' => 3, '>' => 4, else => @as(usize, 0), }; } try scores_incomplete.append(incomplete); } stack.clearAndFree(); } std.sort.sort(usize, scores_incomplete.items, {}, asc); print("{}\n", .{score}); print("{}\n", .{scores_incomplete.items[scores_incomplete.items.len / 2]}); }
2021/src/day10.zig
const std = @import("std"); const Arena = std.heap.ArenaAllocator; const expectEqual = std.testing.expectEqual; const expectEqualStrings = std.testing.expectEqualStrings; const yeti = @import("yeti"); const initCodebase = yeti.initCodebase; const tokenize = yeti.tokenize; const parse = yeti.parse; const analyzeSemantics = yeti.analyzeSemantics; const codegen = yeti.codegen; const printWasm = yeti.printWasm; const components = yeti.components; const literalOf = yeti.query.literalOf; const typeOf = yeti.query.typeOf; const MockFileSystem = yeti.FileSystem; const Entity = yeti.ecs.Entity; test "parse if" { var arena = Arena.init(std.heap.page_allocator); defer arena.deinit(); var codebase = try initCodebase(&arena); const module = try codebase.createEntity(.{}); const code = \\start() u64 { \\ if 10 > 5 { 20 } else { 30 } \\} ; var tokens = try tokenize(module, code); try parse(module, &tokens); const top_level = module.get(components.TopLevel); const start = top_level.findString("start"); const overloads = start.get(components.Overloads).slice(); try expectEqual(overloads.len, 1); const body = overloads[0].get(components.Body).slice(); try expectEqual(body.len, 1); const if_ = body[0]; try expectEqual(if_.get(components.AstKind), .if_); const conditional = if_.get(components.Conditional).entity; try expectEqual(conditional.get(components.AstKind), .binary_op); try expectEqual(conditional.get(components.BinaryOp), .greater_than); const then = if_.get(components.Then).slice(); try expectEqual(then.len, 1); try expectEqualStrings(literalOf(then[0]), "20"); const else_ = if_.get(components.Else).slice(); try expectEqual(else_.len, 1); try expectEqualStrings(literalOf(else_[0]), "30"); } test "parse if using arguments of function" { var arena = Arena.init(std.heap.page_allocator); defer arena.deinit(); var codebase = try initCodebase(&arena); const module = try codebase.createEntity(.{}); const code = \\min(x: i64, y: i64) i64 { \\ if x < y { x } else { y } \\} ; var tokens = try tokenize(module, code); try parse(module, &tokens); const top_level = module.get(components.TopLevel); const overloads = top_level.findString("min").get(components.Overloads).slice(); try expectEqual(overloads.len, 1); const min = overloads[0]; const return_type = min.get(components.ReturnTypeAst).entity; try expectEqual(return_type.get(components.AstKind), .symbol); try expectEqualStrings(literalOf(return_type), "i64"); const body = overloads[0].get(components.Body).slice(); try expectEqual(body.len, 1); const if_ = body[0]; try expectEqual(if_.get(components.AstKind), .if_); const conditional = if_.get(components.Conditional).entity; try expectEqual(conditional.get(components.AstKind), .binary_op); try expectEqual(conditional.get(components.BinaryOp), .less_than); const then = if_.get(components.Then).slice(); try expectEqual(then.len, 1); try expectEqualStrings(literalOf(then[0]), "x"); const else_ = if_.get(components.Else).slice(); try expectEqual(else_.len, 1); try expectEqualStrings(literalOf(else_[0]), "y"); } test "parse multiline if then else" { var arena = Arena.init(std.heap.page_allocator); defer arena.deinit(); var codebase = try initCodebase(&arena); const module = try codebase.createEntity(.{}); const code = \\start() u64 { \\ if 10 > 5 { \\ x = 20 \\ x \\ } else { \\ y = 30 \\ y \\ } \\} ; var tokens = try tokenize(module, code); try parse(module, &tokens); const top_level = module.get(components.TopLevel); const start = top_level.findString("start"); const overloads = start.get(components.Overloads).slice(); try expectEqual(overloads.len, 1); const body = overloads[0].get(components.Body).slice(); try expectEqual(body.len, 1); const if_ = body[0]; try expectEqual(if_.get(components.AstKind), .if_); const conditional = if_.get(components.Conditional).entity; try expectEqual(conditional.get(components.AstKind), .binary_op); try expectEqual(conditional.get(components.BinaryOp), .greater_than); const then = if_.get(components.Then).slice(); try expectEqual(then.len, 2); { const define = then[0]; try expectEqual(define.get(components.AstKind), .define); try expectEqualStrings(literalOf(define.get(components.Name).entity), "x"); try expectEqualStrings(literalOf(define.get(components.Value).entity), "20"); const x = then[1]; try expectEqual(x.get(components.AstKind), .symbol); try expectEqualStrings(literalOf(x), "x"); } const else_ = if_.get(components.Else).slice(); try expectEqual(else_.len, 2); { const define = else_[0]; try expectEqual(define.get(components.AstKind), .define); try expectEqualStrings(literalOf(define.get(components.Name).entity), "y"); try expectEqualStrings(literalOf(define.get(components.Value).entity), "30"); const y = else_[1]; try expectEqual(y.get(components.AstKind), .symbol); try expectEqualStrings(literalOf(y), "y"); } } test "analyze semantics if" { var arena = Arena.init(std.heap.page_allocator); defer arena.deinit(); var codebase = try initCodebase(&arena); const builtins = codebase.get(components.Builtins); const types = [_][]const u8{"i64"}; const builtin_types = [_]Entity{builtins.I64}; for (types) |type_of, i| { var fs = try MockFileSystem.init(&arena); _ = try fs.newFile("foo.yeti", try std.fmt.allocPrint(arena.allocator(), \\start() {s} {{ \\ if 1 {{ 20 }} else {{ 30 }} \\}} , .{type_of})); const module = try analyzeSemantics(codebase, fs, "foo.yeti"); const top_level = module.get(components.TopLevel); const start = top_level.findString("start").get(components.Overloads).slice()[0]; try expectEqualStrings(literalOf(start.get(components.Module).entity), "foo"); try expectEqualStrings(literalOf(start.get(components.Name).entity), "start"); try expectEqual(start.get(components.Parameters).len(), 0); try expectEqual(start.get(components.ReturnType).entity, builtin_types[i]); const body = start.get(components.Body).slice(); try expectEqual(body.len, 1); const if_ = body[0]; try expectEqual(if_.get(components.AstKind), .if_); try expectEqual(typeOf(if_), builtin_types[i]); const conditional = if_.get(components.Conditional).entity; try expectEqual(conditional.get(components.AstKind), .int); try expectEqualStrings(literalOf(conditional), "1"); try expectEqual(typeOf(conditional), builtins.I32); const then = if_.get(components.Then).slice(); try expectEqual(then.len, 1); const twenty = then[0]; try expectEqual(twenty.get(components.AstKind), .int); try expectEqualStrings(literalOf(twenty), "20"); try expectEqual(typeOf(twenty), builtin_types[i]); const else_ = if_.get(components.Else).slice(); try expectEqual(else_.len, 1); const thirty = else_[0]; try expectEqual(thirty.get(components.AstKind), .int); try expectEqualStrings(literalOf(thirty), "30"); try expectEqual(typeOf(thirty), builtin_types[i]); } } test "analyze semantics if non constant conditional" { var arena = Arena.init(std.heap.page_allocator); defer arena.deinit(); var codebase = try initCodebase(&arena); const builtins = codebase.get(components.Builtins); const types = [_][]const u8{"i64"}; const builtin_types = [_]Entity{builtins.I64}; for (types) |type_of, i| { var fs = try MockFileSystem.init(&arena); _ = try fs.newFile("foo.yeti", try std.fmt.allocPrint(arena.allocator(), \\start() {s} {{ \\ if f() {{ 20 }} else {{ 30 }} \\}} \\ \\f() i32 {{ \\ 1 \\}} , .{type_of})); const module = try analyzeSemantics(codebase, fs, "foo.yeti"); const top_level = module.get(components.TopLevel); const start = top_level.findString("start").get(components.Overloads).slice()[0]; try expectEqualStrings(literalOf(start.get(components.Module).entity), "foo"); try expectEqualStrings(literalOf(start.get(components.Name).entity), "start"); try expectEqual(start.get(components.Parameters).len(), 0); try expectEqual(start.get(components.ReturnType).entity, builtin_types[i]); const f = blk: { const body = start.get(components.Body).slice(); try expectEqual(body.len, 1); const if_ = body[0]; try expectEqual(if_.get(components.AstKind), .if_); try expectEqual(typeOf(if_), builtin_types[i]); const conditional = if_.get(components.Conditional).entity; try expectEqual(conditional.get(components.AstKind), .call); try expectEqual(typeOf(conditional), builtins.I32); const f = conditional.get(components.Callable).entity; const then = if_.get(components.Then).slice(); try expectEqual(then.len, 1); const twenty = then[0]; try expectEqual(twenty.get(components.AstKind), .int); try expectEqualStrings(literalOf(twenty), "20"); try expectEqual(typeOf(twenty), builtin_types[i]); const else_ = if_.get(components.Else).slice(); try expectEqual(else_.len, 1); const thirty = else_[0]; try expectEqual(thirty.get(components.AstKind), .int); try expectEqualStrings(literalOf(thirty), "30"); try expectEqual(typeOf(thirty), builtin_types[i]); break :blk f; }; try expectEqualStrings(literalOf(f.get(components.Module).entity), "foo"); try expectEqualStrings(literalOf(f.get(components.Name).entity), "f"); try expectEqual(f.get(components.Parameters).len(), 0); try expectEqual(f.get(components.ReturnType).entity, builtins.I32); const body = f.get(components.Body).slice(); try expectEqual(body.len, 1); } } test "analyze semantics if with different type branches" { var arena = Arena.init(std.heap.page_allocator); defer arena.deinit(); var codebase = try initCodebase(&arena); const builtins = codebase.get(components.Builtins); const types = [_][]const u8{"i64"}; const builtin_types = [_]Entity{builtins.I64}; for (types) |type_of, i| { var fs = try MockFileSystem.init(&arena); _ = try fs.newFile("foo.yeti", try std.fmt.allocPrint(arena.allocator(), \\start() {s} {{ \\ if 1 {{ 20 }} else {{ f() }} \\}} \\ \\f() {s} {{ \\ 0 \\}} , .{ type_of, type_of })); const module = try analyzeSemantics(codebase, fs, "foo.yeti"); const top_level = module.get(components.TopLevel); const start = top_level.findString("start").get(components.Overloads).slice()[0]; try expectEqualStrings(literalOf(start.get(components.Module).entity), "foo"); try expectEqualStrings(literalOf(start.get(components.Name).entity), "start"); try expectEqual(start.get(components.Parameters).len(), 0); try expectEqual(start.get(components.ReturnType).entity, builtin_types[i]); const body = start.get(components.Body).slice(); try expectEqual(body.len, 1); const if_ = body[0]; try expectEqual(if_.get(components.AstKind), .if_); try expectEqual(typeOf(if_), builtin_types[i]); const conditional = if_.get(components.Conditional).entity; try expectEqual(conditional.get(components.AstKind), .int); try expectEqualStrings(literalOf(conditional), "1"); try expectEqual(typeOf(conditional), builtins.I32); const then = if_.get(components.Then).slice(); try expectEqual(then.len, 1); const twenty = then[0]; try expectEqual(twenty.get(components.AstKind), .int); try expectEqualStrings(literalOf(twenty), "20"); try expectEqual(typeOf(twenty), builtin_types[i]); const else_ = if_.get(components.Else).slice(); try expectEqual(else_.len, 1); const call = else_[0]; try expectEqual(call.get(components.AstKind), .call); } } test "codegen if where then branch taken statically" { var arena = Arena.init(std.heap.page_allocator); defer arena.deinit(); var codebase = try initCodebase(&arena); const types = [_][]const u8{ "i64", "i32", "u64", "u32", "f64", "f32" }; const const_kinds = [_]components.WasmInstructionKind{ .i64_const, .i32_const, .i64_const, .i32_const, .f64_const, .f32_const, }; for (types) |type_of, i| { var fs = try MockFileSystem.init(&arena); _ = try fs.newFile("foo.yeti", try std.fmt.allocPrint(arena.allocator(), \\start() {s} {{ \\ if 1 {{ 20 }} else {{ 30 }} \\}} , .{type_of})); const module = try analyzeSemantics(codebase, fs, "foo.yeti"); try codegen(module); const top_level = module.get(components.TopLevel); const start = top_level.findString("start").get(components.Overloads).slice()[0]; const start_instructions = start.get(components.WasmInstructions).slice(); try expectEqual(start_instructions.len, 1); const constant = start_instructions[0]; try expectEqual(constant.get(components.WasmInstructionKind), const_kinds[i]); try expectEqualStrings(literalOf(constant.get(components.Constant).entity), "20"); } } test "codegen if where else branch taken statically" { var arena = Arena.init(std.heap.page_allocator); defer arena.deinit(); var codebase = try initCodebase(&arena); const types = [_][]const u8{ "i64", "i32", "u64", "u32", "f64", "f32" }; const const_kinds = [_]components.WasmInstructionKind{ .i64_const, .i32_const, .i64_const, .i32_const, .f64_const, .f32_const, }; for (types) |type_of, i| { var fs = try MockFileSystem.init(&arena); _ = try fs.newFile("foo.yeti", try std.fmt.allocPrint(arena.allocator(), \\start() {s} {{ \\ if 0 {{ 20 }} else {{ 30 }} \\}} , .{type_of})); const module = try analyzeSemantics(codebase, fs, "foo.yeti"); try codegen(module); const top_level = module.get(components.TopLevel); const start = top_level.findString("start").get(components.Overloads).slice()[0]; const start_instructions = start.get(components.WasmInstructions).slice(); try expectEqual(start_instructions.len, 1); const constant = start_instructions[0]; try expectEqual(constant.get(components.WasmInstructionKind), const_kinds[i]); try expectEqualStrings(literalOf(constant.get(components.Constant).entity), "30"); } } test "codegen if non const conditional" { var arena = Arena.init(std.heap.page_allocator); defer arena.deinit(); var codebase = try initCodebase(&arena); const types = [_][]const u8{ "i64", "i32", "u64", "u32", "f64", "f32" }; const b = codebase.get(components.Builtins); const builtin_types = [_]Entity{ b.I64, b.I32, b.U64, b.U32, b.F64, b.F32, }; const const_kinds = [_]components.WasmInstructionKind{ .i64_const, .i32_const, .i64_const, .i32_const, .f64_const, .f32_const, }; for (types) |type_of, i| { var fs = try MockFileSystem.init(&arena); _ = try fs.newFile("foo.yeti", try std.fmt.allocPrint(arena.allocator(), \\start() {s} {{ \\ if f() {{ 20 }} else {{ 30 }} \\}} \\ \\f() i32 {{ 1 }} , .{type_of})); const module = try analyzeSemantics(codebase, fs, "foo.yeti"); try codegen(module); const top_level = module.get(components.TopLevel); const start = top_level.findString("start").get(components.Overloads).slice()[0]; const start_instructions = start.get(components.WasmInstructions).slice(); try expectEqual(start_instructions.len, 6); const call = start_instructions[0]; try expectEqual(call.get(components.WasmInstructionKind), .call); const f = call.get(components.Callable).entity; const if_ = start_instructions[1]; try expectEqual(if_.get(components.WasmInstructionKind), .if_); try expectEqual(if_.get(components.Type).entity, builtin_types[i]); const twenty = start_instructions[2]; try expectEqual(twenty.get(components.WasmInstructionKind), const_kinds[i]); try expectEqualStrings(literalOf(twenty.get(components.Constant).entity), "20"); try expectEqual(start_instructions[3].get(components.WasmInstructionKind), .else_); const thirty = start_instructions[4]; try expectEqual(thirty.get(components.WasmInstructionKind), const_kinds[i]); try expectEqualStrings(literalOf(thirty.get(components.Constant).entity), "30"); try expectEqual(start_instructions[5].get(components.WasmInstructionKind), .end); try expectEqualStrings(literalOf(f.get(components.Name).entity), "f"); const f_instructions = f.get(components.WasmInstructions).slice(); try expectEqual(f_instructions.len, 1); const constant = f_instructions[0]; try expectEqual(constant.get(components.WasmInstructionKind), .i32_const); try expectEqualStrings(literalOf(constant.get(components.Constant).entity), "1"); } } test "print wasm if where then branch taken statically" { var arena = Arena.init(std.heap.page_allocator); defer arena.deinit(); var codebase = try initCodebase(&arena); const types = [_][]const u8{ "i64", "i32", "u64", "u32", "f64", "f32" }; const wasm_types = [_][]const u8{ "i64", "i32", "i64", "i32", "f64", "f32" }; for (types) |type_of, i| { var fs = try MockFileSystem.init(&arena); _ = try fs.newFile("foo.yeti", try std.fmt.allocPrint(arena.allocator(), \\start() {s} {{ \\ if 1 {{ 20 }} else {{ 30 }} \\}} , .{type_of})); const module = try analyzeSemantics(codebase, fs, "foo.yeti"); try codegen(module); const wasm = try printWasm(module); try expectEqualStrings(wasm, try std.fmt.allocPrint(arena.allocator(), \\(module \\ \\ (func $foo/start (result {s}) \\ ({s}.const 20)) \\ \\ (export "_start" (func $foo/start))) , .{ wasm_types[i], wasm_types[i] })); } } test "print wasm if where else branch taken statically" { var arena = Arena.init(std.heap.page_allocator); defer arena.deinit(); var codebase = try initCodebase(&arena); const types = [_][]const u8{ "i64", "i32", "u64", "u32", "f64", "f32" }; const wasm_types = [_][]const u8{ "i64", "i32", "i64", "i32", "f64", "f32" }; for (types) |type_of, i| { var fs = try MockFileSystem.init(&arena); _ = try fs.newFile("foo.yeti", try std.fmt.allocPrint(arena.allocator(), \\start() {s} {{ \\ if 0 {{ 20 }} else {{ 30 }} \\}} , .{type_of})); const module = try analyzeSemantics(codebase, fs, "foo.yeti"); try codegen(module); const wasm = try printWasm(module); try expectEqualStrings(wasm, try std.fmt.allocPrint(arena.allocator(), \\(module \\ \\ (func $foo/start (result {s}) \\ ({s}.const 30)) \\ \\ (export "_start" (func $foo/start))) , .{ wasm_types[i], wasm_types[i] })); } } test "print wasm if non const conditional" { var arena = Arena.init(std.heap.page_allocator); defer arena.deinit(); var codebase = try initCodebase(&arena); const types = [_][]const u8{ "i64", "i32", "u64", "u32", "f64", "f32" }; const wasm_types = [_][]const u8{ "i64", "i32", "i64", "i32", "f64", "f32" }; for (types) |type_of, i| { var fs = try MockFileSystem.init(&arena); _ = try fs.newFile("foo.yeti", try std.fmt.allocPrint(arena.allocator(), \\start() {s} {{ \\ if f() {{ 20 }} else {{ 30 }} \\}} \\ \\f() i32 {{ 1 }} , .{type_of})); const module = try analyzeSemantics(codebase, fs, "foo.yeti"); try codegen(module); const wasm = try printWasm(module); try expectEqualStrings(wasm, try std.fmt.allocPrint(arena.allocator(), \\(module \\ \\ (func $foo/start (result {s}) \\ (call $foo/f) \\ if (result {s}) \\ ({s}.const 20) \\ else \\ ({s}.const 30) \\ end) \\ \\ (func $foo/f (result i32) \\ (i32.const 1)) \\ \\ (export "_start" (func $foo/start))) , .{ wasm_types[i], wasm_types[i], wasm_types[i], wasm_types[i] })); } }
src/tests/test_if.zig
const std = @import("std"); const ArrayList = std.ArrayList; const AutoHashMap = std.AutoHashMap; const Allocator = std.mem.Allocator; const expect = std.testing.expect; /// HashMap of ArrayLists pub fn HashedArrayList(comptime K: type, comptime V: type) type { return struct { const Self = @This(); alloc: *Allocator, hash: AutoHashMap(K, *ArrayList(V)), pub const Size = u32; pub const Entry = struct { key_ptr: *K, value_ptr: *V, }; pub fn init(allocator: *Allocator) Self { return Self{ .alloc = allocator, .hash = AutoHashMap(K, *ArrayList(V)).init(allocator), }; } pub fn deinit(self: *Self) void { var it = self.hash.keyIterator(); while (it.next()) |key| { var ar_ptr = self.hash.get(key.*).?; ar_ptr.deinit(); self.alloc.destroy(ar_ptr); } self.hash.deinit(); } /// Get backing ArrayList for key, or null. pub fn getKey(self: *Self, key: K) ?*ArrayList(V) { if (self.hash.get(key)) |al_ptr| { return al_ptr; } return null; } /// Try to get backing ArrayList for key, creating it if it does not exist. pub fn getOrPutKey(self: *Self, key: K) !*ArrayList(V) { if (self.hash.get(key)) |al_ptr| { return al_ptr; } else { var new_ptr = try self.alloc.create(ArrayList(V)); new_ptr.* = ArrayList(V).init(self.alloc); try self.hash.putNoClobber(key, new_ptr); return new_ptr; } } /// Removes the key and backing ArrayList, if the key exists. /// Does nothing if the key does not exist. /// Returns whether it removed a key or not. pub fn removeKey(self: *Self, key: K) bool { if (self.getKey(key)) |al_ptr| { // If we have an entry, purge the ArrayList and remove key al_ptr.deinit(); self.alloc.destroy(al_ptr); return self.hash.remove(key); } return false; } /// Removes the key and backing ArrayList if the key exists. /// Does nothing if the key does not exist. /// Returns the owned slice of the arraylist. pub fn removeAndReturnOwned(self: *Self, key: K) ?ArrayList(V).Slice { if (self.getKey(key)) |al_ptr| { var slice = al_ptr.toOwnedSlice(); al_ptr.deinit(); self.alloc.destroy(al_ptr); return slice; } return null; } /// Extend the list by 1 element. Allocates more memory as necessary. /// Creates key if it does not exist. pub fn append(self: *Self, key: K, item: V) !void { var arr = try self.getOrPutKey(key); try arr.append(item); } /// Append the slice of items to the list. Allocates more memory as necessary. /// Creates key if it does not exist. pub fn appendSlice(self: *Self, key: K, items: []const V) !void { var arr = try self.getOrPutKey(key); try arr.appendSlice(items); } /// Insert item at index n by moving list[n .. list.len] to make room. /// This operation is O(N). /// Creates key if it does not exist. pub fn insert(self: *Self, key: K, n: usize, item: V) !void { var arr = try self.getOrPutKey(key); try arr.insert(n, item); } /// Insert slice items at index i by moving list[i .. list.len] to make room. /// This operation is O(N). /// Creates key if it does not exist. pub fn insertSlice(self: *Self, key: K, n: usize, items: []const V) !void { var arr = try self.getOrPutKey(key); try arr.insertSlice(n, items); } /// Remove the element at index i, shift elements after index i forward, and return the removed element. /// Asserts the array has at least one item. /// Invalidates pointers to end of list. /// This operation is O(N). pub fn orderedRemove(self: *Self, key: K, i: usize) V { var arr = self.getOrPutKey(key) catch unreachable; return arr.orderedRemove(i); } /// Removes the element at the specified index and returns it. /// The empty slot is filled from the end of the list. /// This operation is O(1). pub fn swapRemove(self: *Self, key: K, i: usize) V { var arr = self.getOrPutKey(key) catch unreachable; return arr.swapRemove(i); } /// The caller owns the returned memory. Empties this ArrayList. /// Leaves the key behind. pub fn toOwnedSlice(self: *Self, key: K) ArrayList(V).Slice { var arr = self.getOrPutKey(key) catch unreachable; return arr.toOwnedSlice(); } /// Remove and return the last element from the list. /// Asserts the list has at least one item. /// Invalidates pointers to the removed element. pub fn pop(self: *Self, key: K) V { var arr = self.getOrPutKey(key) catch unreachable; return arr.pop(); } /// Remove and return the last element from the list, or return null if list is empty. /// Invalidates pointers to the removed element, if any. pub fn popOrNull(self: *Self, key: K) ?V { var arr = self.getOrPutKey(key) catch unreachable; return arr.popOrNull(); } //TODO: Unimplemented // replaceRange // replaceRange // appendNTimes // clearAndFree // addOne (returns type.*) /// Key iterator pub fn iterator(self: *Self) Iterator { return self.hash.iterator(); } /// Iterator that iterates over all possible K,V pairs for every V. pub fn flatIterator(self: *Self) FlatIterator { return .{ .target = self, //.hm = &self.hash, .ki = self.hash.iterator(), }; } pub const FlatIterator = struct { target: *Self, //hm: *AutoHashMap(K,*ArrayList(V)), vindex: Size = 0, ki: AutoHashMap(K, *ArrayList(V)).Iterator, ci: AutoHashMap(K, *ArrayList(V)).Entry = undefined, fetch: bool = true, pub fn next(it: *FlatIterator) ?Entry { if (it.fetch) { if (it.ki.next()) |nx| { it.ci = nx; } else { return null; } it.fetch = false; } const key = it.ci.key_ptr; const value = &it.ci.value_ptr.*.items[it.vindex]; if (it.vindex >= it.ci.value_ptr.*.items.len - 1) { it.vindex = 0; it.fetch = true; } else { it.vindex += 1; it.fetch = false; } return Entry{ .key_ptr = key, .value_ptr = value }; } }; }; } test "Basic operation" { const hal = &HashedArrayList(u8, u8).init(std.testing.allocator); defer hal.deinit(); hal.append(1, 1) catch unreachable; hal.append(2, 1) catch unreachable; hal.append(2, 2) catch unreachable; hal.append(2, 3) catch unreachable; hal.append(3, 1) catch unreachable; hal.append(3, 2) catch unreachable; hal.append(3, 3) catch unreachable; hal.append(3, 4) catch unreachable; hal.append(4, 1) catch unreachable; try expect(hal.getKey(3).?.items[2] == 3); const ha3 = hal.*.getOrPutKey(3) catch unreachable; try expect(ha3.items[1] == 2); const ha4 = hal.*.getOrPutKey(5) catch unreachable; ha4.append('S') catch unreachable; try expect(ha4.items[0] == 'S'); try expect(hal.removeKey(2)); try expect(hal.getKey(2) == null); hal.appendSlice(5, "PAM") catch unreachable; const ha9 = hal.*.getKey(5).?; try expect(ha9.items[0] == 'S'); try expect(ha9.items[1] == 'P'); try expect(ha9.items[2] == 'A'); try expect(ha9.items[3] == 'M'); try expect(hal.pop(5) == 'M'); try expect(hal.popOrNull(5).? == 'A'); try expect(hal.popOrNull(5).? == 'P'); try expect(hal.popOrNull(5).? == 'S'); try expect(hal.popOrNull(5) == null); } test "Iterators" { const hal = &HashedArrayList(u8, u8).init(std.testing.allocator); defer hal.deinit(); hal.append(1, 1) catch unreachable; hal.append(2, 1) catch unreachable; hal.append(2, 2) catch unreachable; hal.append(2, 3) catch unreachable; hal.append(3, 1) catch unreachable; hal.append(3, 2) catch unreachable; hal.append(3, 3) catch unreachable; hal.append(3, 4) catch unreachable; hal.append(4, 1) catch unreachable; std.debug.print("KEYS:\n", .{}); const it = &hal.hash.iterator(); while (it.next()) |item| { std.debug.print(">>> {}\n", .{item.key_ptr.*}); } var ctr: u8 = 0; std.debug.print("FLAT:\n", .{}); const it2 = &hal.flatIterator(); while (it2.next()) |item| { ctr += 1; std.debug.print(">>> {} -> {}\n", .{ item.key_ptr.*, item.value_ptr.* }); } try expect(ctr == 9); }
src/libs/hashed_array_list.zig
const std = @import("std"); const testing = std.testing; // The same as `AutoUnique`, but accepts custom hash and equality functions. pub fn Unique( comptime T: type, comptime Context: type, comptime hash: fn ( ctx: Context, key: T, ) u64, comptime eql: fn (ctx: Context, a: T, b: T) bool, ) fn (Context, []T) []T { return struct { pub fn inPlace(ctx: Context, data: []T) []T { return doInPlace(ctx, data, 0); } fn swap(data: []T, i: usize, j: usize) void { var tmp = data[i]; data[i] = data[j]; data[j] = tmp; } fn doInPlace(ctx: Context, dataIn: []T, start: usize) []T { if (dataIn.len - start < 2) { return dataIn; } const sentinel = dataIn[start]; const data = dataIn[start + 1 .. dataIn.len]; var index: usize = 0; while (index < data.len) { if (eql(ctx, data[index], sentinel)) { index += 1; continue; } const hsh = hash(ctx, data[index]) % data.len; if (index == hsh) { index += 1; continue; } if (eql(ctx, data[index], data[hsh])) { data[index] = sentinel; index += 1; continue; } if (eql(ctx, data[hsh], sentinel)) { swap(data, hsh, index); index += 1; continue; } const hashHash = hash(ctx, data[hsh]) % data.len; if (hashHash != hsh) { swap(data, index, hsh); if (hsh < index) { index += 1; } } else { index += 1; } } var swapPos: usize = 0; for (data) |v, i| { if ((!eql(ctx, v, sentinel)) and (i == (hash(ctx, v) % data.len))) { swap(data, i, swapPos); swapPos += 1; } } var sentinelPos: usize = data.len; var i = swapPos; while (i < sentinelPos) { if (eql(ctx, data[i], sentinel)) { sentinelPos -= 1; swap(data, i, sentinelPos); } else { i += 1; } } return doInPlace(ctx, dataIn[0 .. sentinelPos + start + 1], start + swapPos + 1); } }.inPlace; } /// Modifies a slice in-place to contain only unique values. /// /// The input slice is modified, with element positions being swapped. The returned slice is an /// equal length or subset with duplicate entries omitted. /// /// It is guaranteed to be O(1) in axillary space, and is typically O(N) time complexity. /// Order preservation is not guaranteed. /// /// The algorithm is described here: https://stackoverflow.com/a/1533667 /// /// To hash T and perform equality checks of T, `std.hash_map.getAutoHashFn` and /// `std.hash_map.getAutoEqlFn` are used, which support most data types. Use `Unique` if you need /// to use your own hash and equality functions. pub fn AutoUnique(comptime T: type, comptime Context: type) fn (void, []T) []T { return comptime Unique( T, Context, std.hash_map.getAutoHashFn(T, Context), std.hash_map.getAutoEqlFn(T, Context), ); } test "AutoUnique_simple" { var array = [_]i32{ 1, 2, 2, 3, 3, 4, 2, 1, 4, 1, 2, 3, 4, 4, 3, 2, 1 }; const unique = AutoUnique(i32, void)({}, array[0..]); const expected = &[_]i32{ 1, 4, 3, 2 }; try testing.expectEqualSlices(i32, expected, unique); } test "AutoUnique_complex" { // Produce an array with 3x duplicated keys const allocator = std.heap.page_allocator; const size = 10; var keys = try allocator.alloc(u64, size * 3); defer allocator.free(keys); var i: usize = 0; while (i < size * 3) : (i += 3) { keys[i] = i % size; keys[i + 1] = i % size; keys[i + 2] = i % size; } const unique = AutoUnique(u64, void)({}, keys[0..]); try testing.expect(unique.len == size); }
src/unique.zig
pub const FWPM_NET_EVENT_KEYWORD_INBOUND_MCAST = @as(u32, 1); pub const FWPM_NET_EVENT_KEYWORD_INBOUND_BCAST = @as(u32, 2); pub const FWPM_NET_EVENT_KEYWORD_CAPABILITY_DROP = @as(u32, 4); pub const FWPM_NET_EVENT_KEYWORD_CAPABILITY_ALLOW = @as(u32, 8); pub const FWPM_NET_EVENT_KEYWORD_CLASSIFY_ALLOW = @as(u32, 16); pub const FWPM_NET_EVENT_KEYWORD_PORT_SCANNING_DROP = @as(u32, 32); pub const FWPM_ENGINE_OPTION_PACKET_QUEUE_NONE = @as(u32, 0); pub const FWPM_ENGINE_OPTION_PACKET_QUEUE_INBOUND = @as(u32, 1); pub const FWPM_ENGINE_OPTION_PACKET_QUEUE_FORWARD = @as(u32, 2); pub const FWPM_ENGINE_OPTION_PACKET_BATCH_INBOUND = @as(u32, 4); pub const FWPM_SESSION_FLAG_DYNAMIC = @as(u32, 1); pub const FWPM_SESSION_FLAG_RESERVED = @as(u32, 268435456); pub const FWPM_PROVIDER_FLAG_PERSISTENT = @as(u32, 1); pub const FWPM_PROVIDER_FLAG_DISABLED = @as(u32, 16); pub const FWPM_PROVIDER_CONTEXT_FLAG_PERSISTENT = @as(u32, 1); pub const FWPM_PROVIDER_CONTEXT_FLAG_DOWNLEVEL = @as(u32, 2); pub const FWPM_SUBLAYER_FLAG_PERSISTENT = @as(u32, 1); pub const FWPM_LAYER_FLAG_KERNEL = @as(u32, 1); pub const FWPM_LAYER_FLAG_BUILTIN = @as(u32, 2); pub const FWPM_LAYER_FLAG_CLASSIFY_MOSTLY = @as(u32, 4); pub const FWPM_LAYER_FLAG_BUFFERED = @as(u32, 8); pub const FWPM_CALLOUT_FLAG_PERSISTENT = @as(u32, 65536); pub const FWPM_CALLOUT_FLAG_USES_PROVIDER_CONTEXT = @as(u32, 131072); pub const FWPM_CALLOUT_FLAG_REGISTERED = @as(u32, 262144); pub const FWPM_FILTER_FLAG_HAS_SECURITY_REALM_PROVIDER_CONTEXT = @as(u32, 128); pub const FWPM_FILTER_FLAG_SYSTEMOS_ONLY = @as(u32, 256); pub const FWPM_FILTER_FLAG_GAMEOS_ONLY = @as(u32, 512); pub const FWPM_FILTER_FLAG_SILENT_MODE = @as(u32, 1024); pub const FWPM_FILTER_FLAG_IPSEC_NO_ACQUIRE_INITIATE = @as(u32, 2048); pub const FWPM_NET_EVENT_FLAG_IP_PROTOCOL_SET = @as(u32, 1); pub const FWPM_NET_EVENT_FLAG_LOCAL_ADDR_SET = @as(u32, 2); pub const FWPM_NET_EVENT_FLAG_REMOTE_ADDR_SET = @as(u32, 4); pub const FWPM_NET_EVENT_FLAG_LOCAL_PORT_SET = @as(u32, 8); pub const FWPM_NET_EVENT_FLAG_REMOTE_PORT_SET = @as(u32, 16); pub const FWPM_NET_EVENT_FLAG_APP_ID_SET = @as(u32, 32); pub const FWPM_NET_EVENT_FLAG_USER_ID_SET = @as(u32, 64); pub const FWPM_NET_EVENT_FLAG_SCOPE_ID_SET = @as(u32, 128); pub const FWPM_NET_EVENT_FLAG_IP_VERSION_SET = @as(u32, 256); pub const FWPM_NET_EVENT_FLAG_REAUTH_REASON_SET = @as(u32, 512); pub const FWPM_NET_EVENT_FLAG_PACKAGE_ID_SET = @as(u32, 1024); pub const FWPM_NET_EVENT_FLAG_ENTERPRISE_ID_SET = @as(u32, 2048); pub const FWPM_NET_EVENT_FLAG_POLICY_FLAGS_SET = @as(u32, 4096); pub const FWPM_NET_EVENT_FLAG_EFFECTIVE_NAME_SET = @as(u32, 8192); pub const IKEEXT_CERT_HASH_LEN = @as(u32, 20); pub const FWPM_NET_EVENT_IKEEXT_MM_FAILURE_FLAG_BENIGN = @as(u32, 1); pub const FWPM_NET_EVENT_IKEEXT_MM_FAILURE_FLAG_MULTIPLE = @as(u32, 2); pub const FWPM_NET_EVENT_IKEEXT_EM_FAILURE_FLAG_MULTIPLE = @as(u32, 1); pub const FWPM_NET_EVENT_IKEEXT_EM_FAILURE_FLAG_BENIGN = @as(u32, 2); pub const FWPM_CONNECTION_ENUM_FLAG_QUERY_BYTES_TRANSFERRED = @as(u32, 1); pub const FWPS_FILTER_FLAG_CLEAR_ACTION_RIGHT = @as(u32, 1); pub const FWPS_FILTER_FLAG_PERMIT_IF_CALLOUT_UNREGISTERED = @as(u32, 2); pub const FWPS_FILTER_FLAG_OR_CONDITIONS = @as(u32, 4); pub const FWPS_FILTER_FLAG_HAS_SECURITY_REALM_PROVIDER_CONTEXT = @as(u32, 8); pub const FWPS_FILTER_FLAG_SILENT_MODE = @as(u32, 16); pub const FWPS_FILTER_FLAG_IPSEC_NO_ACQUIRE_INITIATE = @as(u32, 32); pub const FWPS_INCOMING_FLAG_CACHE_SAFE = @as(u32, 1); pub const FWPS_INCOMING_FLAG_ENFORCE_QUERY = @as(u32, 2); pub const FWPS_INCOMING_FLAG_ABSORB = @as(u32, 4); pub const FWPS_INCOMING_FLAG_CONNECTION_FAILING_INDICATION = @as(u32, 8); pub const FWPS_INCOMING_FLAG_MID_STREAM_INSPECTION = @as(u32, 16); pub const FWPS_INCOMING_FLAG_RECLASSIFY = @as(u32, 32); pub const FWPS_INCOMING_FLAG_IS_LOOSE_SOURCE_FLOW = @as(u32, 64); pub const FWPS_INCOMING_FLAG_IS_LOCAL_ONLY_FLOW = @as(u32, 128); pub const FWPS_L2_INCOMING_FLAG_IS_RAW_IPV4_FRAMING = @as(u32, 1); pub const FWPS_L2_INCOMING_FLAG_IS_RAW_IPV6_FRAMING = @as(u32, 2); pub const FWPS_L2_INCOMING_FLAG_RECLASSIFY_MULTI_DESTINATION = @as(u32, 8); pub const FWPS_INCOMING_FLAG_RESERVED0 = @as(u32, 256); pub const FWPS_RIGHT_ACTION_WRITE = @as(u32, 1); pub const FWPS_CLASSIFY_OUT_FLAG_ABSORB = @as(u32, 1); pub const FWPS_CLASSIFY_OUT_FLAG_BUFFER_LIMIT_REACHED = @as(u32, 2); pub const FWPS_CLASSIFY_OUT_FLAG_NO_MORE_DATA = @as(u32, 4); pub const FWPS_CLASSIFY_OUT_FLAG_ALE_FAST_CACHE_CHECK = @as(u32, 8); pub const FWPS_CLASSIFY_OUT_FLAG_ALE_FAST_CACHE_POSSIBLE = @as(u32, 16); pub const FWPS_ALE_ENDPOINT_FLAG_IPSEC_SECURED = @as(u32, 1); pub const FWP_BYTEMAP_ARRAY64_SIZE = @as(u32, 8); pub const FWP_BITMAP_ARRAY64_SIZE = @as(u32, 64); pub const FWP_BYTE_ARRAY6_SIZE = @as(u32, 6); pub const FWP_V6_ADDR_SIZE = @as(u32, 16); pub const FWP_ACTRL_MATCH_FILTER = @as(u32, 1); pub const FWP_OPTION_VALUE_ALLOW_MULTICAST_STATE = @as(u32, 0); pub const FWP_OPTION_VALUE_DENY_MULTICAST_STATE = @as(u32, 1); pub const FWP_OPTION_VALUE_ALLOW_GLOBAL_MULTICAST_STATE = @as(u32, 2); pub const FWP_OPTION_VALUE_DISABLE_LOOSE_SOURCE = @as(u32, 0); pub const FWP_OPTION_VALUE_ENABLE_LOOSE_SOURCE = @as(u32, 1); pub const FWP_OPTION_VALUE_DISABLE_LOCAL_ONLY_MAPPING = @as(u32, 0); pub const FWP_OPTION_VALUE_ENABLE_LOCAL_ONLY_MAPPING = @as(u32, 1); pub const FWP_ACTION_FLAG_TERMINATING = @as(u32, 4096); pub const FWP_ACTION_FLAG_NON_TERMINATING = @as(u32, 8192); pub const FWP_ACTION_FLAG_CALLOUT = @as(u32, 16384); pub const FWP_ACTION_NONE = @as(u32, 7); pub const FWP_ACTION_NONE_NO_MATCH = @as(u32, 8); pub const FWP_ACTION_BITMAP_INDEX_SET = @as(u32, 9); pub const FWP_CONDITION_FLAG_IS_LOOPBACK = @as(u32, 1); pub const FWP_CONDITION_FLAG_IS_IPSEC_SECURED = @as(u32, 2); pub const FWP_CONDITION_FLAG_IS_REAUTHORIZE = @as(u32, 4); pub const FWP_CONDITION_FLAG_IS_WILDCARD_BIND = @as(u32, 8); pub const FWP_CONDITION_FLAG_IS_RAW_ENDPOINT = @as(u32, 16); pub const FWP_CONDITION_FLAG_IS_FRAGMENT = @as(u32, 32); pub const FWP_CONDITION_FLAG_IS_FRAGMENT_GROUP = @as(u32, 64); pub const FWP_CONDITION_FLAG_IS_IPSEC_NATT_RECLASSIFY = @as(u32, 128); pub const FWP_CONDITION_FLAG_REQUIRES_ALE_CLASSIFY = @as(u32, 256); pub const FWP_CONDITION_FLAG_IS_IMPLICIT_BIND = @as(u32, 512); pub const FWP_CONDITION_FLAG_IS_REASSEMBLED = @as(u32, 1024); pub const FWP_CONDITION_FLAG_IS_NAME_APP_SPECIFIED = @as(u32, 16384); pub const FWP_CONDITION_FLAG_IS_PROMISCUOUS = @as(u32, 32768); pub const FWP_CONDITION_FLAG_IS_AUTH_FW = @as(u32, 65536); pub const FWP_CONDITION_FLAG_IS_RECLASSIFY = @as(u32, 131072); pub const FWP_CONDITION_FLAG_IS_OUTBOUND_PASS_THRU = @as(u32, 262144); pub const FWP_CONDITION_FLAG_IS_INBOUND_PASS_THRU = @as(u32, 524288); pub const FWP_CONDITION_FLAG_IS_CONNECTION_REDIRECTED = @as(u32, 1048576); pub const FWP_CONDITION_FLAG_IS_PROXY_CONNECTION = @as(u32, 2097152); pub const FWP_CONDITION_FLAG_IS_APPCONTAINER_LOOPBACK = @as(u32, 4194304); pub const FWP_CONDITION_FLAG_IS_NON_APPCONTAINER_LOOPBACK = @as(u32, 8388608); pub const FWP_CONDITION_FLAG_IS_RESERVED = @as(u32, 16777216); pub const FWP_CONDITION_FLAG_IS_HONORING_POLICY_AUTHORIZE = @as(u32, 33554432); pub const FWP_CONDITION_REAUTHORIZE_REASON_POLICY_CHANGE = @as(u32, 1); pub const FWP_CONDITION_REAUTHORIZE_REASON_NEW_ARRIVAL_INTERFACE = @as(u32, 2); pub const FWP_CONDITION_REAUTHORIZE_REASON_NEW_NEXTHOP_INTERFACE = @as(u32, 4); pub const FWP_CONDITION_REAUTHORIZE_REASON_PROFILE_CROSSING = @as(u32, 8); pub const FWP_CONDITION_REAUTHORIZE_REASON_CLASSIFY_COMPLETION = @as(u32, 16); pub const FWP_CONDITION_REAUTHORIZE_REASON_IPSEC_PROPERTIES_CHANGED = @as(u32, 32); pub const FWP_CONDITION_REAUTHORIZE_REASON_MID_STREAM_INSPECTION = @as(u32, 64); pub const FWP_CONDITION_REAUTHORIZE_REASON_SOCKET_PROPERTY_CHANGED = @as(u32, 128); pub const FWP_CONDITION_REAUTHORIZE_REASON_NEW_INBOUND_MCAST_BCAST_PACKET = @as(u32, 256); pub const FWP_CONDITION_REAUTHORIZE_REASON_EDP_POLICY_CHANGED = @as(u32, 512); pub const FWP_CONDITION_REAUTHORIZE_REASON_PRECLASSIFY_LOCALADDR_LAYER_CHANGE = @as(u32, 1024); pub const FWP_CONDITION_REAUTHORIZE_REASON_PRECLASSIFY_REMOTEADDR_LAYER_CHANGE = @as(u32, 2048); pub const FWP_CONDITION_REAUTHORIZE_REASON_PRECLASSIFY_LOCALPORT_LAYER_CHANGE = @as(u32, 4096); pub const FWP_CONDITION_REAUTHORIZE_REASON_PRECLASSIFY_REMOTEPORT_LAYER_CHANGE = @as(u32, 8192); pub const FWP_CONDITION_REAUTHORIZE_REASON_PROXY_HANDLE_CHANGED = @as(u32, 16384); pub const FWP_CONDITION_REAUTHORIZE_REASON_PRECLASSIFY_POLICY_CHANGED = @as(u32, 32768); pub const FWP_CONDITION_REAUTHORIZE_REASON_CHECK_OFFLOAD = @as(u32, 65536); pub const FWP_CONDITION_SOCKET_PROPERTY_FLAG_IS_SYSTEM_PORT_RPC = @as(u32, 1); pub const FWP_CONDITION_SOCKET_PROPERTY_FLAG_ALLOW_EDGE_TRAFFIC = @as(u32, 2); pub const FWP_CONDITION_SOCKET_PROPERTY_FLAG_DENY_EDGE_TRAFFIC = @as(u32, 4); pub const FWP_CONDITION_L2_IS_NATIVE_ETHERNET = @as(u32, 1); pub const FWP_CONDITION_L2_IS_WIFI = @as(u32, 2); pub const FWP_CONDITION_L2_IS_MOBILE_BROADBAND = @as(u32, 4); pub const FWP_CONDITION_L2_IS_WIFI_DIRECT_DATA = @as(u32, 8); pub const FWP_CONDITION_L2_IS_VM2VM = @as(u32, 16); pub const FWP_CONDITION_L2_IS_MALFORMED_PACKET = @as(u32, 32); pub const FWP_CONDITION_L2_IS_IP_FRAGMENT_GROUP = @as(u32, 64); pub const FWP_CONDITION_L2_IF_CONNECTOR_PRESENT = @as(u32, 128); pub const FWP_FILTER_ENUM_FLAG_BEST_TERMINATING_MATCH = @as(u32, 1); pub const FWP_FILTER_ENUM_FLAG_SORTED = @as(u32, 2); pub const FWP_FILTER_ENUM_FLAG_BOOTTIME_ONLY = @as(u32, 4); pub const FWP_FILTER_ENUM_FLAG_INCLUDE_BOOTTIME = @as(u32, 8); pub const FWP_FILTER_ENUM_FLAG_INCLUDE_DISABLED = @as(u32, 16); pub const FWP_FILTER_ENUM_FLAG_RESERVED1 = @as(u32, 32); pub const FWP_CALLOUT_FLAG_CONDITIONAL_ON_FLOW = @as(u32, 1); pub const FWP_CALLOUT_FLAG_ALLOW_OFFLOAD = @as(u32, 2); pub const FWP_CALLOUT_FLAG_ENABLE_COMMIT_ADD_NOTIFY = @as(u32, 4); pub const FWP_CALLOUT_FLAG_ALLOW_MID_STREAM_INSPECTION = @as(u32, 8); pub const FWP_CALLOUT_FLAG_ALLOW_RECLASSIFY = @as(u32, 16); pub const FWP_CALLOUT_FLAG_RESERVED1 = @as(u32, 32); pub const FWP_CALLOUT_FLAG_ALLOW_RSC = @as(u32, 64); pub const FWP_CALLOUT_FLAG_ALLOW_L2_BATCH_CLASSIFY = @as(u32, 128); pub const FWP_CALLOUT_FLAG_ALLOW_USO = @as(u32, 256); pub const FWP_CALLOUT_FLAG_ALLOW_URO = @as(u32, 512); pub const IKEEXT_CERT_AUTH_FLAG_DISABLE_CRL_CHECK = @as(u32, 2); pub const IKEEXT_CERT_AUTH_FLAG_DISABLE_REQUEST_PAYLOAD = @as(u32, 64); pub const IKEEXT_KERB_AUTH_FORCE_PROXY_ON_INITIATOR = @as(u32, 4); pub const IKEEXT_NTLM_V2_AUTH_DONT_ACCEPT_EXPLICIT_CREDENTIALS = @as(u32, 1); pub const IKEEXT_POLICY_FLAG_MOBIKE_NOT_SUPPORTED = @as(u32, 16); pub const IKEEXT_POLICY_FLAG_SITE_TO_SITE = @as(u32, 32); pub const IKEEXT_POLICY_FLAG_IMS_VPN = @as(u32, 64); pub const IKEEXT_POLICY_ENABLE_IKEV2_FRAGMENTATION = @as(u32, 128); pub const IKEEXT_POLICY_SUPPORT_LOW_POWER_MODE = @as(u32, 256); pub const IKEEXT_CERT_CREDENTIAL_FLAG_NAP_CERT = @as(u32, 1); pub const IPSEC_AUTH_CONFIG_HMAC_MD5_96 = @as(u32, 0); pub const IPSEC_AUTH_CONFIG_HMAC_SHA_1_96 = @as(u32, 1); pub const IPSEC_AUTH_CONFIG_HMAC_SHA_256_128 = @as(u32, 2); pub const IPSEC_AUTH_CONFIG_GCM_AES_128 = @as(u32, 3); pub const IPSEC_AUTH_CONFIG_GCM_AES_192 = @as(u32, 4); pub const IPSEC_AUTH_CONFIG_GCM_AES_256 = @as(u32, 5); pub const IPSEC_AUTH_CONFIG_MAX = @as(u32, 6); pub const IPSEC_CIPHER_CONFIG_CBC_DES = @as(u32, 1); pub const IPSEC_CIPHER_CONFIG_CBC_3DES = @as(u32, 2); pub const IPSEC_CIPHER_CONFIG_CBC_AES_128 = @as(u32, 3); pub const IPSEC_CIPHER_CONFIG_CBC_AES_192 = @as(u32, 4); pub const IPSEC_CIPHER_CONFIG_CBC_AES_256 = @as(u32, 5); pub const IPSEC_CIPHER_CONFIG_GCM_AES_128 = @as(u32, 6); pub const IPSEC_CIPHER_CONFIG_GCM_AES_192 = @as(u32, 7); pub const IPSEC_CIPHER_CONFIG_GCM_AES_256 = @as(u32, 8); pub const IPSEC_CIPHER_CONFIG_MAX = @as(u32, 9); pub const IPSEC_POLICY_FLAG_KEY_MANAGER_ALLOW_NOTIFY_KEY = @as(u32, 16384); pub const IPSEC_POLICY_FLAG_RESERVED1 = @as(u32, 32768); pub const IPSEC_POLICY_FLAG_SITE_TO_SITE_TUNNEL = @as(u32, 65536); pub const IPSEC_KEYING_POLICY_FLAG_TERMINATING_MATCH = @as(u32, 1); pub const IPSEC_SA_BUNDLE_FLAG_NLB = @as(u32, 16); pub const IPSEC_SA_BUNDLE_FLAG_NO_MACHINE_LUID_VERIFY = @as(u32, 32); pub const IPSEC_SA_BUNDLE_FLAG_NO_IMPERSONATION_LUID_VERIFY = @as(u32, 64); pub const IPSEC_SA_BUNDLE_FLAG_NO_EXPLICIT_CRED_MATCH = @as(u32, 128); pub const IPSEC_SA_BUNDLE_FLAG_FORCE_INBOUND_CONNECTIONS = @as(u32, 32768); pub const IPSEC_SA_BUNDLE_FLAG_FORCE_OUTBOUND_CONNECTIONS = @as(u32, 65536); pub const IPSEC_SA_BUNDLE_FLAG_FORWARD_PATH_INITIATOR = @as(u32, 131072); pub const IPSEC_SA_BUNDLE_FLAG_ENABLE_OPTIONAL_ASYMMETRIC_IDLE = @as(u32, 262144); pub const IPSEC_SA_BUNDLE_FLAG_USING_DICTATED_KEYS = @as(u32, 524288); pub const IPSEC_SA_BUNDLE_FLAG_LOCALLY_DICTATED_KEYS = @as(u32, 1048576); pub const IPSEC_SA_BUNDLE_FLAG_SA_OFFLOADED = @as(u32, 2097152); pub const IPSEC_SA_BUNDLE_FLAG_IP_IN_IP_PKT = @as(u32, 4194304); pub const IPSEC_SA_BUNDLE_FLAG_LOW_POWER_MODE_SUPPORT = @as(u32, 8388608); pub const IPSEC_DOSP_DSCP_DISABLE_VALUE = @as(u32, 255); pub const IPSEC_DOSP_RATE_LIMIT_DISABLE_VALUE = @as(u32, 0); pub const IPSEC_KEY_MANAGER_FLAG_DICTATE_KEY = @as(u32, 1); pub const _LITTLE_ENDIAN = @as(u32, 1234); pub const _BIG_ENDIAN = @as(u32, 4321); pub const _PDP_ENDIAN = @as(u32, 3412); pub const DL_HEADER_LENGTH_MAXIMUM = @as(u32, 64); pub const SNAP_DSAP = @as(u32, 170); pub const SNAP_SSAP = @as(u32, 170); pub const SNAP_CONTROL = @as(u32, 3); pub const SNAP_OUI = @as(u32, 0); pub const ETH_LENGTH_OF_HEADER = @as(u32, 14); pub const ETH_LENGTH_OF_VLAN_HEADER = @as(u32, 4); pub const ETH_LENGTH_OF_SNAP_HEADER = @as(u32, 8); pub const ETHERNET_TYPE_MINIMUM = @as(u32, 1536); pub const ETHERNET_TYPE_IPV4 = @as(u32, 2048); pub const ETHERNET_TYPE_ARP = @as(u32, 2054); pub const ETHERNET_TYPE_IPV6 = @as(u32, 34525); pub const ETHERNET_TYPE_802_1Q = @as(u32, 33024); pub const IP_VER_MASK = @as(u32, 240); pub const IPV4_VERSION = @as(u32, 4); pub const MAX_IPV4_PACKET = @as(u32, 65535); pub const MAX_IPV4_HLEN = @as(u32, 60); pub const IPV4_MINIMUM_MTU = @as(u32, 576); pub const IPV4_MIN_MINIMUM_MTU = @as(u32, 352); pub const SIZEOF_IP_OPT_ROUTING_HEADER = @as(u32, 3); pub const SIZEOF_IP_OPT_TIMESTAMP_HEADER = @as(u32, 4); pub const SIZEOF_IP_OPT_SECURITY = @as(u32, 11); pub const SIZEOF_IP_OPT_STREAMIDENTIFIER = @as(u32, 4); pub const SIZEOF_IP_OPT_ROUTERALERT = @as(u32, 4); pub const IP4_OFF_MASK = @as(u32, 65311); pub const ICMPV4_INVALID_PREFERENCE_LEVEL = @as(u32, 2147483648); pub const IGMP_QUERY_TYPE = @as(u32, 17); pub const IGMP_VERSION1_REPORT_TYPE = @as(u32, 18); pub const IGMP_VERSION2_REPORT_TYPE = @as(u32, 22); pub const IGMP_LEAVE_GROUP_TYPE = @as(u32, 23); pub const IGMP_VERSION3_REPORT_TYPE = @as(u32, 34); pub const IPV6_VERSION = @as(u32, 96); pub const IPV6_TRAFFIC_CLASS_MASK = @as(u32, 49167); pub const IPV6_FULL_TRAFFIC_CLASS_MASK = @as(u32, 61455); pub const IPV6_ECN_MASK = @as(u32, 12288); pub const IPV6_FLOW_LABEL_MASK = @as(u32, 4294905600); pub const MAX_IPV6_PAYLOAD = @as(u32, 65535); pub const IPV6_ECN_SHIFT = @as(u32, 12); pub const IPV6_MINIMUM_MTU = @as(u32, 1280); pub const IP6F_OFF_MASK = @as(u32, 63743); pub const IP6F_RESERVED_MASK = @as(u32, 1536); pub const IP6F_MORE_FRAG = @as(u32, 256); pub const EXT_LEN_UNIT = @as(u32, 8); pub const IP6OPT_TYPE_SKIP = @as(u32, 0); pub const IP6OPT_TYPE_DISCARD = @as(u32, 64); pub const IP6OPT_TYPE_FORCEICMP = @as(u32, 128); pub const IP6OPT_TYPE_ICMP = @as(u32, 192); pub const IP6OPT_MUTABLE = @as(u32, 32); pub const ICMP6_DST_UNREACH_NOROUTE = @as(u32, 0); pub const ICMP6_DST_UNREACH_ADMIN = @as(u32, 1); pub const ICMP6_DST_UNREACH_BEYONDSCOPE = @as(u32, 2); pub const ICMP6_DST_UNREACH_ADDR = @as(u32, 3); pub const ICMP6_DST_UNREACH_NOPORT = @as(u32, 4); pub const ICMP6_TIME_EXCEED_TRANSIT = @as(u32, 0); pub const ICMP6_TIME_EXCEED_REASSEMBLY = @as(u32, 1); pub const ICMP6_PARAMPROB_HEADER = @as(u32, 0); pub const ICMP6_PARAMPROB_NEXTHEADER = @as(u32, 1); pub const ICMP6_PARAMPROB_OPTION = @as(u32, 2); pub const ICMPV6_ECHO_REQUEST_FLAG_REVERSE = @as(u32, 1); pub const ND_RA_FLAG_MANAGED = @as(u32, 128); pub const ND_RA_FLAG_OTHER = @as(u32, 64); pub const ND_RA_FLAG_HOME_AGENT = @as(u32, 32); pub const ND_RA_FLAG_PREFERENCE = @as(u32, 24); pub const ND_NA_FLAG_ROUTER = @as(u32, 2147483648); pub const ND_NA_FLAG_SOLICITED = @as(u32, 1073741824); pub const ND_NA_FLAG_OVERRIDE = @as(u32, 536870912); pub const ND_OPT_PI_FLAG_ONLINK = @as(u32, 128); pub const ND_OPT_PI_FLAG_AUTO = @as(u32, 64); pub const ND_OPT_PI_FLAG_ROUTER_ADDR = @as(u32, 32); pub const ND_OPT_PI_FLAG_SITE_PREFIX = @as(u32, 16); pub const ND_OPT_PI_FLAG_ROUTE = @as(u32, 1); pub const ND_OPT_RI_FLAG_PREFERENCE = @as(u32, 24); pub const ND_OPT_RDNSS_MIN_LEN = @as(u32, 24); pub const ND_OPT_DNSSL_MIN_LEN = @as(u32, 16); pub const IN6_EMBEDDEDV4_UOCTET_POSITION = @as(u32, 8); pub const IN6_EMBEDDEDV4_BITS_IN_BYTE = @as(u32, 8); pub const TH_FIN = @as(u32, 1); pub const TH_SYN = @as(u32, 2); pub const TH_RST = @as(u32, 4); pub const TH_PSH = @as(u32, 8); pub const TH_ACK = @as(u32, 16); pub const TH_URG = @as(u32, 32); pub const TH_ECE = @as(u32, 64); pub const TH_CWR = @as(u32, 128); pub const TH_OPT_EOL = @as(u32, 0); pub const TH_OPT_NOP = @as(u32, 1); pub const TH_OPT_MSS = @as(u32, 2); pub const TH_OPT_WS = @as(u32, 3); pub const TH_OPT_SACK_PERMITTED = @as(u32, 4); pub const TH_OPT_SACK = @as(u32, 5); pub const TH_OPT_TS = @as(u32, 8); pub const TH_OPT_FASTOPEN = @as(u32, 34); pub const FWPM_LAYER_INBOUND_IPPACKET_V4 = Guid.initString("c86fd1bf-21cd-497e-a0bb-17425c885c58"); pub const FWPM_LAYER_INBOUND_IPPACKET_V4_DISCARD = Guid.initString("b5a230d0-a8c0-44f2-916e-991b53ded1f7"); pub const FWPM_LAYER_INBOUND_IPPACKET_V6 = Guid.initString("f52032cb-991c-46e7-971d-2601459a91ca"); pub const FWPM_LAYER_INBOUND_IPPACKET_V6_DISCARD = Guid.initString("bb24c279-93b4-47a2-83ad-ae1698b50885"); pub const FWPM_LAYER_OUTBOUND_IPPACKET_V4 = Guid.initString("1e5c9fae-8a84-4135-a331-950b54229ecd"); pub const FWPM_LAYER_OUTBOUND_IPPACKET_V4_DISCARD = Guid.initString("08e4bcb5-b647-48f3-953c-e5ddbd03937e"); pub const FWPM_LAYER_OUTBOUND_IPPACKET_V6 = Guid.initString("a3b3ab6b-3564-488c-9117-f34e82142763"); pub const FWPM_LAYER_OUTBOUND_IPPACKET_V6_DISCARD = Guid.initString("9513d7c4-a934-49dc-91a7-6ccb80cc02e3"); pub const FWPM_LAYER_IPFORWARD_V4 = Guid.initString("a82acc24-4ee1-4ee1-b465-fd1d25cb10a4"); pub const FWPM_LAYER_IPFORWARD_V4_DISCARD = Guid.initString("9e9ea773-2fae-4210-8f17-34129ef369eb"); pub const FWPM_LAYER_IPFORWARD_V6 = Guid.initString("7b964818-19c7-493a-b71f-832c3684d28c"); pub const FWPM_LAYER_IPFORWARD_V6_DISCARD = Guid.initString("31524a5d-1dfe-472f-bb93-518ee945d8a2"); pub const FWPM_LAYER_INBOUND_TRANSPORT_V4 = Guid.initString("5926dfc8-e3cf-4426-a283-dc393f5d0f9d"); pub const FWPM_LAYER_INBOUND_TRANSPORT_V4_DISCARD = Guid.initString("ac4a9833-f69d-4648-b261-6dc84835ef39"); pub const FWPM_LAYER_INBOUND_TRANSPORT_V6 = Guid.initString("634a869f-fc23-4b90-b0c1-bf620a36ae6f"); pub const FWPM_LAYER_INBOUND_TRANSPORT_V6_DISCARD = Guid.initString("2a6ff955-3b2b-49d2-9848-ad9d72dcaab7"); pub const FWPM_LAYER_OUTBOUND_TRANSPORT_V4 = Guid.initString("09e61aea-d214-46e2-9b21-b26b0b2f28c8"); pub const FWPM_LAYER_OUTBOUND_TRANSPORT_V4_DISCARD = Guid.initString("c5f10551-bdb0-43d7-a313-50e211f4d68a"); pub const FWPM_LAYER_OUTBOUND_TRANSPORT_V6 = Guid.initString("e1735bde-013f-4655-b351-a49e15762df0"); pub const FWPM_LAYER_OUTBOUND_TRANSPORT_V6_DISCARD = Guid.initString("f433df69-ccbd-482e-b9b2-57165658c3b3"); pub const FWPM_LAYER_STREAM_V4 = Guid.initString("3b89653c-c170-49e4-b1cd-e0eeeee19a3e"); pub const FWPM_LAYER_STREAM_V4_DISCARD = Guid.initString("25c4c2c2-25ff-4352-82f9-c54a4a4726dc"); pub const FWPM_LAYER_STREAM_V6 = Guid.initString("47c9137a-7ec4-46b3-b6e4-48e926b1eda4"); pub const FWPM_LAYER_STREAM_V6_DISCARD = Guid.initString("10a59fc7-b628-4c41-9eb8-cf37d55103cf"); pub const FWPM_LAYER_DATAGRAM_DATA_V4 = Guid.initString("3d08bf4e-45f6-4930-a922-417098e20027"); pub const FWPM_LAYER_DATAGRAM_DATA_V4_DISCARD = Guid.initString("18e330c6-7248-4e52-aaab-472ed67704fd"); pub const FWPM_LAYER_DATAGRAM_DATA_V6 = Guid.initString("fa45fe2f-3cba-4427-87fc-57b9a4b10d00"); pub const FWPM_LAYER_DATAGRAM_DATA_V6_DISCARD = Guid.initString("09d1dfe1-9b86-4a42-be9d-8c315b92a5d0"); pub const FWPM_LAYER_INBOUND_ICMP_ERROR_V4 = Guid.initString("61499990-3cb6-4e84-b950-53b94b6964f3"); pub const FWPM_LAYER_INBOUND_ICMP_ERROR_V4_DISCARD = Guid.initString("a6b17075-ebaf-4053-a4e7-213c8121ede5"); pub const FWPM_LAYER_INBOUND_ICMP_ERROR_V6 = Guid.initString("65f9bdff-3b2d-4e5d-b8c6-c720651fe898"); pub const FWPM_LAYER_INBOUND_ICMP_ERROR_V6_DISCARD = Guid.initString("a6e7ccc0-08fb-468d-a472-9771d5595e09"); pub const FWPM_LAYER_OUTBOUND_ICMP_ERROR_V4 = Guid.initString("41390100-564c-4b32-bc1d-718048354d7c"); pub const FWPM_LAYER_OUTBOUND_ICMP_ERROR_V4_DISCARD = Guid.initString("b3598d36-0561-4588-a6bf-e955e3f6264b"); pub const FWPM_LAYER_OUTBOUND_ICMP_ERROR_V6 = Guid.initString("7fb03b60-7b8d-4dfa-badd-980176fc4e12"); pub const FWPM_LAYER_OUTBOUND_ICMP_ERROR_V6_DISCARD = Guid.initString("65f2e647-8d0c-4f47-b19b-33a4d3f1357c"); pub const FWPM_LAYER_ALE_RESOURCE_ASSIGNMENT_V4 = Guid.initString("1247d66d-0b60-4a15-8d44-7155d0f53a0c"); pub const FWPM_LAYER_ALE_RESOURCE_ASSIGNMENT_V4_DISCARD = Guid.initString("0b5812a2-c3ff-4eca-b88d-c79e20ac6322"); pub const FWPM_LAYER_ALE_RESOURCE_ASSIGNMENT_V6 = Guid.initString("55a650e1-5f0a-4eca-a653-88f53b26aa8c"); pub const FWPM_LAYER_ALE_RESOURCE_ASSIGNMENT_V6_DISCARD = Guid.initString("cbc998bb-c51f-4c1a-bb4f-9775fcacab2f"); pub const FWPM_LAYER_ALE_AUTH_LISTEN_V4 = Guid.initString("88bb5dad-76d7-4227-9c71-df0a3ed7be7e"); pub const FWPM_LAYER_ALE_AUTH_LISTEN_V4_DISCARD = Guid.initString("371dfada-9f26-45fd-b4eb-c29eb212893f"); pub const FWPM_LAYER_ALE_AUTH_LISTEN_V6 = Guid.initString("7ac9de24-17dd-4814-b4bd-a9fbc95a321b"); pub const FWPM_LAYER_ALE_AUTH_LISTEN_V6_DISCARD = Guid.initString("60703b07-63c8-48e9-ada3-12b1af40a617"); pub const FWPM_LAYER_ALE_AUTH_RECV_ACCEPT_V4 = Guid.initString("e1cd9fe7-f4b5-4273-96c0-592e487b8650"); pub const FWPM_LAYER_ALE_AUTH_RECV_ACCEPT_V4_DISCARD = Guid.initString("9eeaa99b-bd22-4227-919f-0073c63357b1"); pub const FWPM_LAYER_ALE_AUTH_RECV_ACCEPT_V6 = Guid.initString("a3b42c97-9f04-4672-b87e-cee9c483257f"); pub const FWPM_LAYER_ALE_AUTH_RECV_ACCEPT_V6_DISCARD = Guid.initString("89455b97-dbe1-453f-a224-13da895af396"); pub const FWPM_LAYER_ALE_AUTH_CONNECT_V4 = Guid.initString("c38d57d1-05a7-4c33-904f-7fbceee60e82"); pub const FWPM_LAYER_ALE_AUTH_CONNECT_V4_DISCARD = Guid.initString("d632a801-f5ba-4ad6-96e3-607017d9836a"); pub const FWPM_LAYER_ALE_AUTH_CONNECT_V6 = Guid.initString("4a72393b-319f-44bc-84c3-ba54dcb3b6b4"); pub const FWPM_LAYER_ALE_AUTH_CONNECT_V6_DISCARD = Guid.initString("c97bc3b8-c9a3-4e33-8695-8e17aad4de09"); pub const FWPM_LAYER_ALE_FLOW_ESTABLISHED_V4 = Guid.initString("af80470a-5596-4c13-9992-539e6fe57967"); pub const FWPM_LAYER_ALE_FLOW_ESTABLISHED_V4_DISCARD = Guid.initString("146ae4a9-a1d2-4d43-a31a-4c42682b8e4f"); pub const FWPM_LAYER_ALE_FLOW_ESTABLISHED_V6 = Guid.initString("7021d2b3-dfa4-406e-afeb-6afaf7e70efd"); pub const FWPM_LAYER_ALE_FLOW_ESTABLISHED_V6_DISCARD = Guid.initString("46928636-bbca-4b76-941d-0fa7f5d7d372"); pub const FWPM_LAYER_INBOUND_MAC_FRAME_ETHERNET = Guid.initString("effb7edb-0055-4f9a-a231-4ff8131ad191"); pub const FWPM_LAYER_OUTBOUND_MAC_FRAME_ETHERNET = Guid.initString("694673bc-d6db-4870-adee-0acdbdb7f4b2"); pub const FWPM_LAYER_INBOUND_MAC_FRAME_NATIVE = Guid.initString("d4220bd3-62ce-4f08-ae88-b56e8526df50"); pub const FWPM_LAYER_OUTBOUND_MAC_FRAME_NATIVE = Guid.initString("94c44912-9d6f-4ebf-b995-05ab8a088d1b"); pub const FWPM_LAYER_INGRESS_VSWITCH_ETHERNET = Guid.initString("7d98577a-9a87-41ec-9718-7cf589c9f32d"); pub const FWPM_LAYER_EGRESS_VSWITCH_ETHERNET = Guid.initString("86c872b0-76fa-4b79-93a4-0750530ae292"); pub const FWPM_LAYER_INGRESS_VSWITCH_TRANSPORT_V4 = Guid.initString("b2696ff6-774f-4554-9f7d-3da3945f8e85"); pub const FWPM_LAYER_INGRESS_VSWITCH_TRANSPORT_V6 = Guid.initString("5ee314fc-7d8a-47f4-b7e3-291a36da4e12"); pub const FWPM_LAYER_EGRESS_VSWITCH_TRANSPORT_V4 = Guid.initString("b92350b6-91f0-46b6-bdc4-871dfd4a7c98"); pub const FWPM_LAYER_EGRESS_VSWITCH_TRANSPORT_V6 = Guid.initString("1b2def23-1881-40bd-82f4-4254e63141cb"); pub const FWPM_LAYER_INBOUND_TRANSPORT_FAST = Guid.initString("e41d2719-05c7-40f0-8983-ea8d17bbc2f6"); pub const FWPM_LAYER_OUTBOUND_TRANSPORT_FAST = Guid.initString("13ed4388-a070-4815-9935-7a9be6408b78"); pub const FWPM_LAYER_INBOUND_MAC_FRAME_NATIVE_FAST = Guid.initString("853aaa8e-2b78-4d24-a804-36db08b29711"); pub const FWPM_LAYER_OUTBOUND_MAC_FRAME_NATIVE_FAST = Guid.initString("470df946-c962-486f-9446-8293cbc75eb8"); pub const FWPM_LAYER_IPSEC_KM_DEMUX_V4 = Guid.initString("f02b1526-a459-4a51-b9e3-759de52b9d2c"); pub const FWPM_LAYER_IPSEC_KM_DEMUX_V6 = Guid.initString("2f755cf6-2fd4-4e88-b3e4-a91bca495235"); pub const FWPM_LAYER_IPSEC_V4 = Guid.initString("eda65c74-610d-4bc5-948f-3c4f89556867"); pub const FWPM_LAYER_IPSEC_V6 = Guid.initString("13c48442-8d87-4261-9a29-59d2abc348b4"); pub const FWPM_LAYER_IKEEXT_V4 = Guid.initString("b14b7bdb-dbbd-473e-bed4-8b4708d4f270"); pub const FWPM_LAYER_IKEEXT_V6 = Guid.initString("b64786b3-f687-4eb9-89d2-8ef32acdabe2"); pub const FWPM_LAYER_RPC_UM = Guid.initString("75a89dda-95e4-40f3-adc7-7688a9c847e1"); pub const FWPM_LAYER_RPC_EPMAP = Guid.initString("9247bc61-eb07-47ee-872c-bfd78bfd1616"); pub const FWPM_LAYER_RPC_EP_ADD = Guid.initString("618dffc7-c450-4943-95db-99b4c16a55d4"); pub const FWPM_LAYER_RPC_PROXY_CONN = Guid.initString("94a4b50b-ba5c-4f27-907a-229fac0c2a7a"); pub const FWPM_LAYER_RPC_PROXY_IF = Guid.initString("f8a38615-e12c-41ac-98df-121ad981aade"); pub const FWPM_LAYER_KM_AUTHORIZATION = Guid.initString("4aa226e9-9020-45fb-956a-c0249d841195"); pub const FWPM_LAYER_NAME_RESOLUTION_CACHE_V4 = Guid.initString("0c2aa681-905b-4ccd-a467-4dd811d07b7b"); pub const FWPM_LAYER_NAME_RESOLUTION_CACHE_V6 = Guid.initString("92d592fa-6b01-434a-9dea-d1e96ea97da9"); pub const FWPM_LAYER_ALE_RESOURCE_RELEASE_V4 = Guid.initString("74365cce-ccb0-401a-bfc1-b89934ad7e15"); pub const FWPM_LAYER_ALE_RESOURCE_RELEASE_V6 = Guid.initString("f4e5ce80-edcc-4e13-8a2f-b91454bb057b"); pub const FWPM_LAYER_ALE_ENDPOINT_CLOSURE_V4 = Guid.initString("b4766427-e2a2-467a-bd7e-dbcd1bd85a09"); pub const FWPM_LAYER_ALE_ENDPOINT_CLOSURE_V6 = Guid.initString("bb536ccd-4755-4ba9-9ff7-f9edf8699c7b"); pub const FWPM_LAYER_ALE_CONNECT_REDIRECT_V4 = Guid.initString("c6e63c8c-b784-4562-aa7d-0a67cfcaf9a3"); pub const FWPM_LAYER_ALE_CONNECT_REDIRECT_V6 = Guid.initString("587e54a7-8046-42ba-a0aa-b716250fc7fd"); pub const FWPM_LAYER_ALE_BIND_REDIRECT_V4 = Guid.initString("66978cad-c704-42ac-86ac-7c1a231bd253"); pub const FWPM_LAYER_ALE_BIND_REDIRECT_V6 = Guid.initString("bef02c9c-606b-4536-8c26-1c2fc7b631d4"); pub const FWPM_LAYER_STREAM_PACKET_V4 = Guid.initString("af52d8ec-cb2d-44e5-ad92-f8dc38d2eb29"); pub const FWPM_LAYER_STREAM_PACKET_V6 = Guid.initString("779a8ca3-f099-468f-b5d4-83535c461c02"); pub const FWPM_LAYER_INBOUND_RESERVED2 = Guid.initString("f4fb8d55-c076-46d8-a2c7-6a4c722ca4ed"); pub const FWPM_SUBLAYER_RPC_AUDIT = Guid.initString("758c84f4-fb48-4de9-9aeb-3ed9551ab1fd"); pub const FWPM_SUBLAYER_IPSEC_TUNNEL = Guid.initString("83f299ed-9ff4-4967-aff4-c309f4dab827"); pub const FWPM_SUBLAYER_UNIVERSAL = Guid.initString("eebecc03-ced4-4380-819a-2734397b2b74"); pub const FWPM_SUBLAYER_LIPS = Guid.initString("1b75c0ce-ff60-4711-a70f-b4958cc3b2d0"); pub const FWPM_SUBLAYER_SECURE_SOCKET = Guid.initString("15a66e17-3f3c-4f7b-aa6c-812aa613dd82"); pub const FWPM_SUBLAYER_TCP_CHIMNEY_OFFLOAD = Guid.initString("337608b9-b7d5-4d5f-82f9-3618618bc058"); pub const FWPM_SUBLAYER_INSPECTION = Guid.initString("877519e1-e6a9-41a5-81b4-8c4f118e4a60"); pub const FWPM_SUBLAYER_TEREDO = Guid.initString("ba69dc66-5176-4979-9c89-26a7b46a8327"); pub const FWPM_SUBLAYER_IPSEC_FORWARD_OUTBOUND_TUNNEL = Guid.initString("a5082e73-8f71-4559-8a9a-101cea04ef87"); pub const FWPM_SUBLAYER_IPSEC_DOSP = Guid.initString("e076d572-5d3d-48ef-802b-909eddb098bd"); pub const FWPM_SUBLAYER_TCP_TEMPLATES = Guid.initString("24421dcf-0ac5-4caa-9e14-50f6e3636af0"); pub const FWPM_SUBLAYER_IPSEC_SECURITY_REALM = Guid.initString("37a57701-5884-4964-92b8-3e704688b0ad"); pub const FWPM_CONDITION_INTERFACE_MAC_ADDRESS = Guid.initString("f6e63dce-1f4b-4c6b-b6ef-1165e71f8ee7"); pub const FWPM_CONDITION_MAC_LOCAL_ADDRESS = Guid.initString("d999e981-7948-4c83-b742-c84e3b678f8f"); pub const FWPM_CONDITION_MAC_REMOTE_ADDRESS = Guid.initString("408f2ed4-3a70-4b4d-92a6-415ac20e2f12"); pub const FWPM_CONDITION_ETHER_TYPE = Guid.initString("fd08948d-a219-4d52-bb98-1a5540ee7b4e"); pub const FWPM_CONDITION_VLAN_ID = Guid.initString("938eab21-3618-4e64-9ca5-2141ebda1ca2"); pub const FWPM_CONDITION_VSWITCH_TENANT_NETWORK_ID = Guid.initString("dc04843c-79e6-4e44-a025-65b9bb0f9f94"); pub const FWPM_CONDITION_NDIS_PORT = Guid.initString("db7bb42b-2dac-4cd4-a59a-e0bdce1e6834"); pub const FWPM_CONDITION_NDIS_MEDIA_TYPE = Guid.initString("cb31cef1-791d-473b-89d1-61c5984304a0"); pub const FWPM_CONDITION_NDIS_PHYSICAL_MEDIA_TYPE = Guid.initString("34c79823-c229-44f2-b83c-74020882ae77"); pub const FWPM_CONDITION_L2_FLAGS = Guid.initString("7bc43cbf-37ba-45f1-b74a-82ff518eeb10"); pub const FWPM_CONDITION_MAC_LOCAL_ADDRESS_TYPE = Guid.initString("cc31355c-3073-4ffb-a14f-79415cb1ead1"); pub const FWPM_CONDITION_MAC_REMOTE_ADDRESS_TYPE = Guid.initString("027fedb4-f1c1-4030-b564-ee777fd867ea"); pub const FWPM_CONDITION_ALE_PACKAGE_ID = Guid.initString("71bc78fa-f17c-4997-a602-6abb261f351c"); pub const FWPM_CONDITION_MAC_SOURCE_ADDRESS = Guid.initString("7b795451-f1f6-4d05-b7cb-21779d802336"); pub const FWPM_CONDITION_MAC_DESTINATION_ADDRESS = Guid.initString("04ea2a93-858c-4027-b613-b43180c7859e"); pub const FWPM_CONDITION_MAC_SOURCE_ADDRESS_TYPE = Guid.initString("5c1b72e4-299e-4437-a298-bc3f014b3dc2"); pub const FWPM_CONDITION_MAC_DESTINATION_ADDRESS_TYPE = Guid.initString("ae052932-ef42-4e99-b129-f3b3139e34f7"); pub const FWPM_CONDITION_IP_SOURCE_PORT = Guid.initString("a6afef91-3df4-4730-a214-f5426aebf821"); pub const FWPM_CONDITION_IP_DESTINATION_PORT = Guid.initString("ce6def45-60fb-4a7b-a304-af30a117000e"); pub const FWPM_CONDITION_VSWITCH_ID = Guid.initString("c4a414ba-437b-4de6-9946-d99c1b95b312"); pub const FWPM_CONDITION_VSWITCH_NETWORK_TYPE = Guid.initString("11d48b4b-e77a-40b4-9155-392c906c2608"); pub const FWPM_CONDITION_VSWITCH_SOURCE_INTERFACE_ID = Guid.initString("7f4ef24b-b2c1-4938-ba33-a1ecbed512ba"); pub const FWPM_CONDITION_VSWITCH_DESTINATION_INTERFACE_ID = Guid.initString("8ed48be4-c926-49f6-a4f6-ef3030e3fc16"); pub const FWPM_CONDITION_VSWITCH_SOURCE_VM_ID = Guid.initString("9c2a9ec2-9fc6-42bc-bdd8-406d4da0be64"); pub const FWPM_CONDITION_VSWITCH_DESTINATION_VM_ID = Guid.initString("6106aace-4de1-4c84-9671-3637f8bcf731"); pub const FWPM_CONDITION_VSWITCH_SOURCE_INTERFACE_TYPE = Guid.initString("e6b040a2-edaf-4c36-908b-f2f58ae43807"); pub const FWPM_CONDITION_VSWITCH_DESTINATION_INTERFACE_TYPE = Guid.initString("fa9b3f06-2f1a-4c57-9e68-a7098b28dbfe"); pub const FWPM_CONDITION_ALE_SECURITY_ATTRIBUTE_FQBN_VALUE = Guid.initString("37a57699-5883-4963-92b8-3e704688b0ad"); pub const FWPM_CONDITION_IPSEC_SECURITY_REALM_ID = Guid.initString("37a57700-5884-4964-92b8-3e704688b0ad"); pub const FWPM_CONDITION_ALE_EFFECTIVE_NAME = Guid.initString("b1277b9a-b781-40fc-9671-e5f1b989f34e"); pub const FWPM_CONDITION_IP_LOCAL_ADDRESS = Guid.initString("d9ee00de-c1ef-4617-bfe3-ffd8f5a08957"); pub const FWPM_CONDITION_IP_REMOTE_ADDRESS = Guid.initString("b235ae9a-1d64-49b8-a44c-5ff3d9095045"); pub const FWPM_CONDITION_IP_SOURCE_ADDRESS = Guid.initString("ae96897e-2e94-4bc9-b313-b27ee80e574d"); pub const FWPM_CONDITION_IP_DESTINATION_ADDRESS = Guid.initString("2d79133b-b390-45c6-8699-acaceaafed33"); pub const FWPM_CONDITION_IP_LOCAL_ADDRESS_TYPE = Guid.initString("6ec7f6c4-376b-45d7-9e9c-d337cedcd237"); pub const FWPM_CONDITION_IP_DESTINATION_ADDRESS_TYPE = Guid.initString("1ec1b7c9-4eea-4f5e-b9ef-76beaaaf17ee"); pub const FWPM_CONDITION_BITMAP_IP_LOCAL_ADDRESS = Guid.initString("16ebc3df-957a-452e-a1fc-3d2ff6a730ba"); pub const FWPM_CONDITION_BITMAP_IP_LOCAL_PORT = Guid.initString("9f90a920-c3b5-4569-ba31-8bd3910dc656"); pub const FWPM_CONDITION_BITMAP_IP_REMOTE_ADDRESS = Guid.initString("33f00e25-8eec-4531-a005-41b911f62452"); pub const FWPM_CONDITION_BITMAP_IP_REMOTE_PORT = Guid.initString("2663d549-aaf2-46a2-8666-1e7667f86985"); pub const FWPM_CONDITION_IP_NEXTHOP_ADDRESS = Guid.initString("eabe448a-a711-4d64-85b7-3f76b65299c7"); pub const FWPM_CONDITION_BITMAP_INDEX_KEY = Guid.initString("0f36514c-3226-4a81-a214-2d518b04d08a"); pub const FWPM_CONDITION_IP_LOCAL_INTERFACE = Guid.initString("4cd62a49-59c3-4969-b7f3-bda5d32890a4"); pub const FWPM_CONDITION_IP_ARRIVAL_INTERFACE = Guid.initString("618a9b6d-386b-4136-ad6e-b51587cfb1cd"); pub const FWPM_CONDITION_ARRIVAL_INTERFACE_TYPE = Guid.initString("89f990de-e798-4e6d-ab76-7c9558292e6f"); pub const FWPM_CONDITION_ARRIVAL_TUNNEL_TYPE = Guid.initString("511166dc-7a8c-4aa7-b533-95ab59fb0340"); pub const FWPM_CONDITION_ARRIVAL_INTERFACE_INDEX = Guid.initString("cc088db3-1792-4a71-b0f9-037d21cd828b"); pub const FWPM_CONDITION_NEXTHOP_SUB_INTERFACE_INDEX = Guid.initString("ef8a6122-0577-45a7-9aaf-825fbeb4fb95"); pub const FWPM_CONDITION_IP_NEXTHOP_INTERFACE = Guid.initString("93ae8f5b-7f6f-4719-98c8-14e97429ef04"); pub const FWPM_CONDITION_NEXTHOP_INTERFACE_TYPE = Guid.initString("97537c6c-d9a3-4767-a381-e942675cd920"); pub const FWPM_CONDITION_NEXTHOP_TUNNEL_TYPE = Guid.initString("72b1a111-987b-4720-99dd-c7c576fa2d4c"); pub const FWPM_CONDITION_NEXTHOP_INTERFACE_INDEX = Guid.initString("138e6888-7ab8-4d65-9ee8-0591bcf6a494"); pub const FWPM_CONDITION_ORIGINAL_PROFILE_ID = Guid.initString("46ea1551-2255-492b-8019-aabeee349f40"); pub const FWPM_CONDITION_CURRENT_PROFILE_ID = Guid.initString("ab3033c9-c0e3-4759-937d-5758c65d4ae3"); pub const FWPM_CONDITION_LOCAL_INTERFACE_PROFILE_ID = Guid.initString("4ebf7562-9f18-4d06-9941-a7a625744d71"); pub const FWPM_CONDITION_ARRIVAL_INTERFACE_PROFILE_ID = Guid.initString("cdfe6aab-c083-4142-8679-c08f95329c61"); pub const FWPM_CONDITION_NEXTHOP_INTERFACE_PROFILE_ID = Guid.initString("d7ff9a56-cdaa-472b-84db-d23963c1d1bf"); pub const FWPM_CONDITION_REAUTHORIZE_REASON = Guid.initString("11205e8c-11ae-457a-8a44-477026dd764a"); pub const FWPM_CONDITION_ORIGINAL_ICMP_TYPE = Guid.initString("076dfdbe-c56c-4f72-ae8a-2cfe7e5c8286"); pub const FWPM_CONDITION_IP_PHYSICAL_ARRIVAL_INTERFACE = Guid.initString("da50d5c8-fa0d-4c89-b032-6e62136d1e96"); pub const FWPM_CONDITION_IP_PHYSICAL_NEXTHOP_INTERFACE = Guid.initString("f09bd5ce-5150-48be-b098-c25152fb1f92"); pub const FWPM_CONDITION_INTERFACE_QUARANTINE_EPOCH = Guid.initString("cce68d5e-053b-43a8-9a6f-33384c28e4f6"); pub const FWPM_CONDITION_INTERFACE_TYPE = Guid.initString("daf8cd14-e09e-4c93-a5ae-c5c13b73ffca"); pub const FWPM_CONDITION_TUNNEL_TYPE = Guid.initString("77a40437-8779-4868-a261-f5a902f1c0cd"); pub const FWPM_CONDITION_IP_FORWARD_INTERFACE = Guid.initString("1076b8a5-6323-4c5e-9810-e8d3fc9e6136"); pub const FWPM_CONDITION_IP_PROTOCOL = Guid.initString("3971ef2b-623e-4f9a-8cb1-6e79b806b9a7"); pub const FWPM_CONDITION_IP_LOCAL_PORT = Guid.initString("0c1ba1af-5765-453f-af22-a8f791ac775b"); pub const FWPM_CONDITION_IP_REMOTE_PORT = Guid.initString("c35a604d-d22b-4e1a-91b4-68f674ee674b"); pub const FWPM_CONDITION_EMBEDDED_LOCAL_ADDRESS_TYPE = Guid.initString("4672a468-8a0a-4202-abb4-849e92e66809"); pub const FWPM_CONDITION_EMBEDDED_REMOTE_ADDRESS = Guid.initString("77ee4b39-3273-4671-b63b-ab6feb66eeb6"); pub const FWPM_CONDITION_EMBEDDED_PROTOCOL = Guid.initString("07784107-a29e-4c7b-9ec7-29c44afafdbc"); pub const FWPM_CONDITION_EMBEDDED_LOCAL_PORT = Guid.initString("bfca394d-acdb-484e-b8e6-2aff79757345"); pub const FWPM_CONDITION_EMBEDDED_REMOTE_PORT = Guid.initString("cae4d6a1-2968-40ed-a4ce-547160dda88d"); pub const FWPM_CONDITION_FLAGS = Guid.initString("632ce23b-5167-435c-86d7-e903684aa80c"); pub const FWPM_CONDITION_DIRECTION = Guid.initString("8784c146-ca97-44d6-9fd1-19fb1840cbf7"); pub const FWPM_CONDITION_INTERFACE_INDEX = Guid.initString("667fd755-d695-434a-8af5-d3835a1259bc"); pub const FWPM_CONDITION_SUB_INTERFACE_INDEX = Guid.initString("0cd42473-d621-4be3-ae8c-72a348d283e1"); pub const FWPM_CONDITION_SOURCE_INTERFACE_INDEX = Guid.initString("2311334d-c92d-45bf-9496-edf447820e2d"); pub const FWPM_CONDITION_SOURCE_SUB_INTERFACE_INDEX = Guid.initString("055edd9d-acd2-4361-8dab-f9525d97662f"); pub const FWPM_CONDITION_DESTINATION_INTERFACE_INDEX = Guid.initString("35cf6522-4139-45ee-a0d5-67b80949d879"); pub const FWPM_CONDITION_DESTINATION_SUB_INTERFACE_INDEX = Guid.initString("2b7d4399-d4c7-4738-a2f5-e994b43da388"); pub const FWPM_CONDITION_ALE_APP_ID = Guid.initString("d78e1e87-8644-4ea5-9437-d809ecefc971"); pub const FWPM_CONDITION_ALE_ORIGINAL_APP_ID = Guid.initString("0e6cd086-e1fb-4212-842f-8a9f993fb3f6"); pub const FWPM_CONDITION_ALE_USER_ID = Guid.initString("af043a0a-b34d-4f86-979c-c90371af6e66"); pub const FWPM_CONDITION_ALE_REMOTE_USER_ID = Guid.initString("f63073b7-0189-4ab0-95a4-6123cbfab862"); pub const FWPM_CONDITION_ALE_REMOTE_MACHINE_ID = Guid.initString("1aa47f51-7f93-4508-a271-81abb00c9cab"); pub const FWPM_CONDITION_ALE_PROMISCUOUS_MODE = Guid.initString("1c974776-7182-46e9-afd3-b02910e30334"); pub const FWPM_CONDITION_ALE_SIO_FIREWALL_SYSTEM_PORT = Guid.initString("b9f4e088-cb98-4efb-a2c7-ad07332643db"); pub const FWPM_CONDITION_ALE_REAUTH_REASON = Guid.initString("b482d227-1979-4a98-8044-18bbe6237542"); pub const FWPM_CONDITION_ALE_NAP_CONTEXT = Guid.initString("46275a9d-c03f-4d77-b784-1c57f4d02753"); pub const FWPM_CONDITION_KM_AUTH_NAP_CONTEXT = Guid.initString("35d0ea0e-15ca-492b-900e-97fd46352cce"); pub const FWPM_CONDITION_REMOTE_USER_TOKEN = Guid.initString("<PASSWORD>"); pub const FWPM_CONDITION_RPC_IF_UUID = Guid.initString("7c9c7d9f-0075-4d35-a0d1-8311c4cf6af1"); pub const FWPM_CONDITION_RPC_IF_VERSION = Guid.initString("eabfd9b7-1262-4a2e-adaa-5f96f6fe326d"); pub const FWPM_CONDITION_RPC_IF_FLAG = Guid.initString("238a8a32-3199-467d-871c-272621ab3896"); pub const FWPM_CONDITION_DCOM_APP_ID = Guid.initString("ff2e7b4d-3112-4770-b636-4d24ae3a6af2"); pub const FWPM_CONDITION_IMAGE_NAME = Guid.initString("d024de4d-deaa-4317-9c85-e40ef6e140c3"); pub const FWPM_CONDITION_RPC_PROTOCOL = Guid.initString("2717bc74-3a35-4ce7-b7ef-c838fabdec45"); pub const FWPM_CONDITION_RPC_AUTH_TYPE = Guid.initString("daba74ab-0d67-43e7-986e-75b84f82f594"); pub const FWPM_CONDITION_RPC_AUTH_LEVEL = Guid.initString("e5a0aed5-59ac-46ea-be05-a5f05ecf446e"); pub const FWPM_CONDITION_SEC_ENCRYPT_ALGORITHM = Guid.initString("0d306ef0-e974-4f74-b5c7-591b0da7d562"); pub const FWPM_CONDITION_SEC_KEY_SIZE = Guid.initString("<KEY>"); pub const FWPM_CONDITION_IP_LOCAL_ADDRESS_V4 = Guid.initString("03a629cb-6e52-49f8-9c41-5709633c09cf"); pub const FWPM_CONDITION_IP_LOCAL_ADDRESS_V6 = Guid.initString("2381be84-7524-45b3-a05b-1e637d9c7a6a"); pub const FWPM_CONDITION_PIPE = Guid.initString("1bd0741d-e3df-4e24-8634-762046eef6eb"); pub const FWPM_CONDITION_IP_REMOTE_ADDRESS_V4 = Guid.initString("1febb610-3bcc-45e1-bc36-2e067e2cb186"); pub const FWPM_CONDITION_IP_REMOTE_ADDRESS_V6 = Guid.initString("246e1d8c-8bee-4018-9b98-31d4582f3361"); pub const FWPM_CONDITION_PROCESS_WITH_RPC_IF_UUID = Guid.initString("e31180a8-bbbd-4d14-a65e-7157b06233bb"); pub const FWPM_CONDITION_RPC_EP_VALUE = Guid.initString("dccea0b9-0886-4360-9c6a-ab043a24fba9"); pub const FWPM_CONDITION_RPC_EP_FLAGS = Guid.initString("218b814a-0a39-49b8-8e71-c20c39c7dd2e"); pub const FWPM_CONDITION_CLIENT_TOKEN = Guid.initString("<PASSWORD>"); pub const FWPM_CONDITION_RPC_SERVER_NAME = Guid.initString("b605a225-c3b3-48c7-9833-7aefa9527546"); pub const FWPM_CONDITION_RPC_SERVER_PORT = Guid.initString("8090f645-9ad5-4e3b-9f9f-8023ca097909"); pub const FWPM_CONDITION_RPC_PROXY_AUTH_TYPE = Guid.initString("40953fe2-8565-4759-8488-1771b4b4b5db"); pub const FWPM_CONDITION_CLIENT_CERT_KEY_LENGTH = Guid.initString("<KEY>"); pub const FWPM_CONDITION_CLIENT_CERT_OID = Guid.initString("c491ad5e-f882-4283-b916-436b103ff4ad"); pub const FWPM_CONDITION_NET_EVENT_TYPE = Guid.initString("206e9996-490e-40cf-b831-b38641eb6fcb"); pub const FWPM_CONDITION_PEER_NAME = Guid.initString("9b539082-eb90-4186-a6cc-de5b63235016"); pub const FWPM_CONDITION_REMOTE_ID = Guid.initString("f68166fd-0682-4c89-b8f5-86436c7ef9b7"); pub const FWPM_CONDITION_AUTHENTICATION_TYPE = Guid.initString("eb458cd5-da7b-4ef9-8d43-7b0a840332f2"); pub const FWPM_CONDITION_KM_TYPE = Guid.initString("ff0f5f49-0ceb-481b-8638-1479791f3f2c"); pub const FWPM_CONDITION_KM_MODE = Guid.initString("feef4582-ef8f-4f7b-858b-9077d122de47"); pub const FWPM_CONDITION_IPSEC_POLICY_KEY = Guid.initString("ad37dee3-722f-45cc-a4e3-068048124452"); pub const FWPM_CONDITION_QM_MODE = Guid.initString("f64fc6d1-f9cb-43d2-8a5f-e13bc894f265"); pub const FWPM_CONDITION_COMPARTMENT_ID = Guid.initString("35a791ab-04ac-4ff2-a6bb-da6cfac71806"); pub const FWPM_CONDITION_RESERVED0 = Guid.initString("678f4deb-45af-4882-93fe-19d4729d9834"); pub const FWPM_CONDITION_RESERVED1 = Guid.initString("d818f827-5c69-48eb-bf80-d86b17755f97"); pub const FWPM_CONDITION_RESERVED2 = Guid.initString("53d4123d-e15b-4e84-b7a8-dce16f7b62d9"); pub const FWPM_CONDITION_RESERVED3 = Guid.initString("7f6e8ca3-6606-4932-97c7-e1f20710af3b"); pub const FWPM_CONDITION_RESERVED4 = Guid.initString("5f58e642-b937-495e-a94b-f6b051a49250"); pub const FWPM_CONDITION_RESERVED5 = Guid.initString("9ba8f6cd-f77c-43e6-8847-11939dc5db5a"); pub const FWPM_CONDITION_RESERVED6 = Guid.initString("f13d84bd-59d5-44c4-8817-5ecdae1805bd"); pub const FWPM_CONDITION_RESERVED7 = Guid.initString("65a0f930-45dd-4983-aa33-efc7b611af08"); pub const FWPM_CONDITION_RESERVED8 = Guid.initString("4f424974-0c12-4816-9b47-9a547db39a32"); pub const FWPM_CONDITION_RESERVED9 = Guid.initString("ce78e10f-13ff-4c70-8643-36ad1879afa3"); pub const FWPM_CONDITION_RESERVED10 = Guid.initString("b979e282-d621-4c8c-b184-b105a61c36ce"); pub const FWPM_CONDITION_RESERVED11 = Guid.initString("2d62ee4d-023d-411f-9582-43acbb795975"); pub const FWPM_CONDITION_RESERVED12 = Guid.initString("a3677c32-7e35-4ddc-93da-e8c33fc923c7"); pub const FWPM_CONDITION_RESERVED13 = Guid.initString("335a3e90-84aa-42f5-9e6f-59309536a44c"); pub const FWPM_CONDITION_RESERVED14 = Guid.initString("30e44da2-2f1a-4116-a559-f907de83604a"); pub const FWPM_CONDITION_RESERVED15 = Guid.initString("bab8340f-afe0-43d1-80d8-5ca456962de3"); pub const FWPM_PROVIDER_IKEEXT = Guid.initString("10ad9216-ccde-456c-8b16-e9f04e60a90b"); pub const FWPM_PROVIDER_IPSEC_DOSP_CONFIG = Guid.initString("3c6c05a9-c05c-4bb9-8338-2327814ce8bf"); pub const FWPM_PROVIDER_TCP_CHIMNEY_OFFLOAD = Guid.initString("896aa19e-9a34-4bcb-ae79-beb9127c84b9"); pub const FWPM_PROVIDER_TCP_TEMPLATES = Guid.initString("76cfcd30-3394-432d-bed3-441ae50e63c3"); pub const FWPM_CALLOUT_IPSEC_INBOUND_TRANSPORT_V4 = Guid.initString("5132900d-5e84-4b5f-80e4-01741e81ff10"); pub const FWPM_CALLOUT_IPSEC_INBOUND_TRANSPORT_V6 = Guid.initString("49d3ac92-2a6c-4dcf-955f-1c3be009dd99"); pub const FWPM_CALLOUT_IPSEC_OUTBOUND_TRANSPORT_V4 = Guid.initString("4b46bf0a-4523-4e57-aa38-a87987c910d9"); pub const FWPM_CALLOUT_IPSEC_OUTBOUND_TRANSPORT_V6 = Guid.initString("38d87722-ad83-4f11-a91f-df0fb077225b"); pub const FWPM_CALLOUT_IPSEC_INBOUND_TUNNEL_V4 = Guid.initString("191a8a46-0bf8-46cf-b045-4b45dfa6a324"); pub const FWPM_CALLOUT_IPSEC_INBOUND_TUNNEL_V6 = Guid.initString("80c342e3-1e53-4d6f-9b44-03df5aeee154"); pub const FWPM_CALLOUT_IPSEC_OUTBOUND_TUNNEL_V4 = Guid.initString("70a4196c-835b-4fb0-98e8-075f4d977d46"); pub const FWPM_CALLOUT_IPSEC_OUTBOUND_TUNNEL_V6 = Guid.initString("f1835363-a6a5-4e62-b180-23db789d8da6"); pub const FWPM_CALLOUT_IPSEC_FORWARD_INBOUND_TUNNEL_V4 = Guid.initString("28829633-c4f0-4e66-873f-844db2a899c7"); pub const FWPM_CALLOUT_IPSEC_FORWARD_INBOUND_TUNNEL_V6 = Guid.initString("af50bec2-c686-429a-884d-b74443e7b0b4"); pub const FWPM_CALLOUT_IPSEC_FORWARD_OUTBOUND_TUNNEL_V4 = Guid.initString("fb532136-15cb-440b-937c-1717ca320c40"); pub const FWPM_CALLOUT_IPSEC_FORWARD_OUTBOUND_TUNNEL_V6 = Guid.initString("dae640cc-e021-4bee-9eb6-a48b275c8c1d"); pub const FWPM_CALLOUT_IPSEC_INBOUND_INITIATE_SECURE_V4 = Guid.initString("7dff309b-ba7d-4aba-91aa-ae5c6640c944"); pub const FWPM_CALLOUT_IPSEC_INBOUND_INITIATE_SECURE_V6 = Guid.initString("a9a0d6d9-c58c-474e-8aeb-3cfe99d6d53d"); pub const FWPM_CALLOUT_IPSEC_INBOUND_TUNNEL_ALE_ACCEPT_V4 = Guid.initString("3df6e7de-fd20-48f2-9f26-f854444cba79"); pub const FWPM_CALLOUT_IPSEC_INBOUND_TUNNEL_ALE_ACCEPT_V6 = Guid.initString("a1e392d3-72ac-47bb-87a7-0122c69434ab"); pub const FWPM_CALLOUT_IPSEC_ALE_CONNECT_V4 = Guid.initString("6ac141fc-f75d-4203-b9c8-48e6149c2712"); pub const FWPM_CALLOUT_IPSEC_ALE_CONNECT_V6 = Guid.initString("4c0dda05-e31f-4666-90b0-b3dfad34129a"); pub const FWPM_CALLOUT_IPSEC_DOSP_FORWARD_V6 = Guid.initString("6d08a342-db9e-4fbe-9ed2-57374ce89f79"); pub const FWPM_CALLOUT_IPSEC_DOSP_FORWARD_V4 = Guid.initString("2fcb56ec-cd37-4b4f-b108-62c2b1850a0c"); pub const FWPM_CALLOUT_WFP_TRANSPORT_LAYER_V4_SILENT_DROP = Guid.initString("eda08606-2494-4d78-89bc-67837c03b969"); pub const FWPM_CALLOUT_WFP_TRANSPORT_LAYER_V6_SILENT_DROP = Guid.initString("8693cc74-a075-4156-b476-9286eece814e"); pub const FWPM_CALLOUT_TCP_CHIMNEY_CONNECT_LAYER_V4 = Guid.initString("f3e10ab3-2c25-4279-ac36-c30fc181bec4"); pub const FWPM_CALLOUT_TCP_CHIMNEY_CONNECT_LAYER_V6 = Guid.initString("39e22085-a341-42fc-a279-aec94e689c56"); pub const FWPM_CALLOUT_TCP_CHIMNEY_ACCEPT_LAYER_V4 = Guid.initString("e183ecb2-3a7f-4b54-8ad9-76050ed880ca"); pub const FWPM_CALLOUT_TCP_CHIMNEY_ACCEPT_LAYER_V6 = Guid.initString("0378cf41-bf98-4603-81f2-7f12586079f6"); pub const FWPM_CALLOUT_SET_OPTIONS_AUTH_CONNECT_LAYER_V4 = Guid.initString("bc582280-1677-41e9-94ab-c2fcb15c2eeb"); pub const FWPM_CALLOUT_SET_OPTIONS_AUTH_CONNECT_LAYER_V6 = Guid.initString("98e5373c-b884-490f-b65f-2f6a4a575195"); pub const FWPM_CALLOUT_SET_OPTIONS_AUTH_RECV_ACCEPT_LAYER_V4 = Guid.initString("2d55f008-0c01-4f92-b26e-a08a94569b8d"); pub const FWPM_CALLOUT_SET_OPTIONS_AUTH_RECV_ACCEPT_LAYER_V6 = Guid.initString("63018537-f281-4dc4-83d3-8dec18b7ade2"); pub const FWPM_CALLOUT_RESERVED_AUTH_CONNECT_LAYER_V4 = Guid.initString("288b524d-0566-4e19-b612-8f441a2e5949"); pub const FWPM_CALLOUT_RESERVED_AUTH_CONNECT_LAYER_V6 = Guid.initString("00b84b92-2b5e-4b71-ab0e-aaca43e387e6"); pub const FWPM_CALLOUT_TEREDO_ALE_RESOURCE_ASSIGNMENT_V6 = Guid.initString("31b95392-066e-42a2-b7db-92f8acdd56f9"); pub const FWPM_CALLOUT_EDGE_TRAVERSAL_ALE_RESOURCE_ASSIGNMENT_V4 = Guid.initString("079b1010-f1c5-4fcd-ae05-da41107abd0b"); pub const FWPM_CALLOUT_TEREDO_ALE_LISTEN_V6 = Guid.initString("81a434e7-f60c-4378-bab8-c625a30f0197"); pub const FWPM_CALLOUT_EDGE_TRAVERSAL_ALE_LISTEN_V4 = Guid.initString("33486ab5-6d5e-4e65-a00b-a7afed0ba9a1"); pub const FWPM_CALLOUT_TCP_TEMPLATES_CONNECT_LAYER_V4 = Guid.initString("215a0b39-4b7e-4eda-8ce4-179679df6224"); pub const FWPM_CALLOUT_TCP_TEMPLATES_CONNECT_LAYER_V6 = Guid.initString("838b37a1-5c12-4d34-8b38-078728b2d25c"); pub const FWPM_CALLOUT_TCP_TEMPLATES_ACCEPT_LAYER_V4 = Guid.initString("2f23f5d0-40c4-4c41-a254-46d8dba8957c"); pub const FWPM_CALLOUT_TCP_TEMPLATES_ACCEPT_LAYER_V6 = Guid.initString("b25152f0-991c-4f53-bbe7-d24b45fe632c"); pub const FWPM_CALLOUT_POLICY_SILENT_MODE_AUTH_CONNECT_LAYER_V4 = Guid.initString("5fbfc31d-a51c-44dc-acb6-0624a030a700"); pub const FWPM_CALLOUT_POLICY_SILENT_MODE_AUTH_CONNECT_LAYER_V6 = Guid.initString("5fbfc31d-a51c-44dc-acb6-0624a030a701"); pub const FWPM_CALLOUT_POLICY_SILENT_MODE_AUTH_RECV_ACCEPT_LAYER_V4 = Guid.initString("5fbfc31d-a51c-44dc-acb6-0624a030a702"); pub const FWPM_CALLOUT_POLICY_SILENT_MODE_AUTH_RECV_ACCEPT_LAYER_V6 = Guid.initString("5fbfc31d-a51c-44dc-acb6-0624a030a703"); pub const FWPM_CALLOUT_HTTP_TEMPLATE_SSL_HANDSHAKE = Guid.initString("b3423249-8d09-4858-9210-95c7fda8e30f"); pub const FWPM_PROVIDER_CONTEXT_SECURE_SOCKET_AUTHIP = Guid.initString("b25ea800-0d02-46ed-92bd-7fa84bb73e9d"); pub const FWPM_PROVIDER_CONTEXT_SECURE_SOCKET_IPSEC = Guid.initString("8c2d4144-f8e0-42c0-94ce-7ccfc63b2f9b"); pub const FWPM_KEYING_MODULE_IKE = Guid.initString("a9bbf787-82a8-45bb-a400-5d7e5952c7a9"); pub const FWPM_KEYING_MODULE_AUTHIP = Guid.initString("11e3dae0-dd26-4590-857d-ab4b28d1a095"); pub const FWPM_KEYING_MODULE_IKEV2 = Guid.initString("041792cc-8f07-419d-a394-716968cb1647"); pub const FWPM_AUTO_WEIGHT_BITS = @as(u32, 60); pub const FWPM_WEIGHT_RANGE_IPSEC = @as(u32, 0); pub const FWPM_WEIGHT_RANGE_IKE_EXEMPTIONS = @as(u32, 12); pub const FWPM_ACTRL_ADD = @as(u32, 1); pub const FWPM_ACTRL_ADD_LINK = @as(u32, 2); pub const FWPM_ACTRL_BEGIN_READ_TXN = @as(u32, 4); pub const FWPM_ACTRL_BEGIN_WRITE_TXN = @as(u32, 8); pub const FWPM_ACTRL_CLASSIFY = @as(u32, 16); pub const FWPM_ACTRL_ENUM = @as(u32, 32); pub const FWPM_ACTRL_OPEN = @as(u32, 64); pub const FWPM_ACTRL_READ = @as(u32, 128); pub const FWPM_ACTRL_READ_STATS = @as(u32, 256); pub const FWPM_ACTRL_SUBSCRIBE = @as(u32, 512); pub const FWPM_ACTRL_WRITE = @as(u32, 1024); pub const FWPM_TXN_READ_ONLY = @as(u32, 1); pub const FWPM_TUNNEL_FLAG_POINT_TO_POINT = @as(u32, 1); pub const FWPM_TUNNEL_FLAG_ENABLE_VIRTUAL_IF_TUNNELING = @as(u32, 2); pub const FWPM_TUNNEL_FLAG_SITE_TO_SITE = @as(u32, 4); pub const FWPS_METADATA_FIELD_DISCARD_REASON = @as(u32, 1); pub const FWPS_METADATA_FIELD_FLOW_HANDLE = @as(u32, 2); pub const FWPS_METADATA_FIELD_IP_HEADER_SIZE = @as(u32, 4); pub const FWPS_METADATA_FIELD_PROCESS_PATH = @as(u32, 8); pub const FWPS_METADATA_FIELD_TOKEN = @as(u32, 16); pub const FWPS_METADATA_FIELD_PROCESS_ID = @as(u32, 32); pub const FWPS_METADATA_FIELD_SYSTEM_FLAGS = @as(u32, 64); pub const FWPS_METADATA_FIELD_RESERVED = @as(u32, 128); pub const FWPS_METADATA_FIELD_SOURCE_INTERFACE_INDEX = @as(u32, 256); pub const FWPS_METADATA_FIELD_DESTINATION_INTERFACE_INDEX = @as(u32, 512); pub const FWPS_METADATA_FIELD_TRANSPORT_HEADER_SIZE = @as(u32, 1024); pub const FWPS_METADATA_FIELD_COMPARTMENT_ID = @as(u32, 2048); pub const FWPS_METADATA_FIELD_FRAGMENT_DATA = @as(u32, 4096); pub const FWPS_METADATA_FIELD_PATH_MTU = @as(u32, 8192); pub const FWPS_METADATA_FIELD_COMPLETION_HANDLE = @as(u32, 16384); pub const FWPS_METADATA_FIELD_TRANSPORT_ENDPOINT_HANDLE = @as(u32, 32768); pub const FWPS_METADATA_FIELD_TRANSPORT_CONTROL_DATA = @as(u32, 65536); pub const FWPS_METADATA_FIELD_REMOTE_SCOPE_ID = @as(u32, 131072); pub const FWPS_METADATA_FIELD_PACKET_DIRECTION = @as(u32, 262144); pub const FWPS_METADATA_FIELD_PACKET_SYSTEM_CRITICAL = @as(u32, 524288); pub const FWPS_METADATA_FIELD_FORWARD_LAYER_OUTBOUND_PASS_THRU = @as(u32, 1048576); pub const FWPS_METADATA_FIELD_FORWARD_LAYER_INBOUND_PASS_THRU = @as(u32, 2097152); pub const FWPS_METADATA_FIELD_ALE_CLASSIFY_REQUIRED = @as(u32, 4194304); pub const FWPS_METADATA_FIELD_TRANSPORT_HEADER_INCLUDE_HEADER = @as(u32, 8388608); pub const FWPS_METADATA_FIELD_DESTINATION_PREFIX = @as(u32, 16777216); pub const FWPS_METADATA_FIELD_ETHER_FRAME_LENGTH = @as(u32, 33554432); pub const FWPS_METADATA_FIELD_PARENT_ENDPOINT_HANDLE = @as(u32, 67108864); pub const FWPS_METADATA_FIELD_ICMP_ID_AND_SEQUENCE = @as(u32, 134217728); pub const FWPS_METADATA_FIELD_LOCAL_REDIRECT_TARGET_PID = @as(u32, 268435456); pub const FWPS_METADATA_FIELD_ORIGINAL_DESTINATION = @as(u32, 536870912); pub const FWPS_METADATA_FIELD_REDIRECT_RECORD_HANDLE = @as(u32, 1073741824); pub const FWPS_METADATA_FIELD_SUB_PROCESS_TAG = @as(u32, 2147483648); pub const FWPS_L2_METADATA_FIELD_ETHERNET_MAC_HEADER_SIZE = @as(u32, 1); pub const FWPS_L2_METADATA_FIELD_WIFI_OPERATION_MODE = @as(u32, 2); pub const FWPS_L2_METADATA_FIELD_VSWITCH_SOURCE_PORT_ID = @as(u32, 4); pub const FWPS_L2_METADATA_FIELD_VSWITCH_SOURCE_NIC_INDEX = @as(u32, 8); pub const FWPS_L2_METADATA_FIELD_VSWITCH_PACKET_CONTEXT = @as(u32, 16); pub const FWPS_L2_METADATA_FIELD_VSWITCH_DESTINATION_PORT_ID = @as(u32, 32); pub const FWPS_L2_METADATA_FIELD_RESERVED = @as(u32, 2147483648); //-------------------------------------------------------------------------------- // Section: Types (345) //-------------------------------------------------------------------------------- pub const IPSEC_SA_BUNDLE_FLAGS = enum(u32) { ND_SECURE = 1, ND_BOUNDARY = 2, ND_PEER_NAT_BOUNDARY = 4, GUARANTEE_ENCRYPTION = 8, ALLOW_NULL_TARGET_NAME_MATCH = 512, CLEAR_DF_ON_TUNNEL = 1024, ASSUME_UDP_CONTEXT_OUTBOUND = 2048, ND_PEER_BOUNDARY = 4096, SUPPRESS_DUPLICATE_DELETION = 8192, PEER_SUPPORTS_GUARANTEE_ENCRYPTION = 16384, _, pub fn initFlags(o: struct { ND_SECURE: u1 = 0, ND_BOUNDARY: u1 = 0, ND_PEER_NAT_BOUNDARY: u1 = 0, GUARANTEE_ENCRYPTION: u1 = 0, ALLOW_NULL_TARGET_NAME_MATCH: u1 = 0, CLEAR_DF_ON_TUNNEL: u1 = 0, ASSUME_UDP_CONTEXT_OUTBOUND: u1 = 0, ND_PEER_BOUNDARY: u1 = 0, SUPPRESS_DUPLICATE_DELETION: u1 = 0, PEER_SUPPORTS_GUARANTEE_ENCRYPTION: u1 = 0, }) IPSEC_SA_BUNDLE_FLAGS { return @intToEnum(IPSEC_SA_BUNDLE_FLAGS, (if (o.ND_SECURE == 1) @enumToInt(IPSEC_SA_BUNDLE_FLAGS.ND_SECURE) else 0) | (if (o.ND_BOUNDARY == 1) @enumToInt(IPSEC_SA_BUNDLE_FLAGS.ND_BOUNDARY) else 0) | (if (o.ND_PEER_NAT_BOUNDARY == 1) @enumToInt(IPSEC_SA_BUNDLE_FLAGS.ND_PEER_NAT_BOUNDARY) else 0) | (if (o.GUARANTEE_ENCRYPTION == 1) @enumToInt(IPSEC_SA_BUNDLE_FLAGS.GUARANTEE_ENCRYPTION) else 0) | (if (o.ALLOW_NULL_TARGET_NAME_MATCH == 1) @enumToInt(IPSEC_SA_BUNDLE_FLAGS.ALLOW_NULL_TARGET_NAME_MATCH) else 0) | (if (o.CLEAR_DF_ON_TUNNEL == 1) @enumToInt(IPSEC_SA_BUNDLE_FLAGS.CLEAR_DF_ON_TUNNEL) else 0) | (if (o.ASSUME_UDP_CONTEXT_OUTBOUND == 1) @enumToInt(IPSEC_SA_BUNDLE_FLAGS.ASSUME_UDP_CONTEXT_OUTBOUND) else 0) | (if (o.ND_PEER_BOUNDARY == 1) @enumToInt(IPSEC_SA_BUNDLE_FLAGS.ND_PEER_BOUNDARY) else 0) | (if (o.SUPPRESS_DUPLICATE_DELETION == 1) @enumToInt(IPSEC_SA_BUNDLE_FLAGS.SUPPRESS_DUPLICATE_DELETION) else 0) | (if (o.PEER_SUPPORTS_GUARANTEE_ENCRYPTION == 1) @enumToInt(IPSEC_SA_BUNDLE_FLAGS.PEER_SUPPORTS_GUARANTEE_ENCRYPTION) else 0) ); } }; pub const IPSEC_SA_BUNDLE_FLAG_ND_SECURE = IPSEC_SA_BUNDLE_FLAGS.ND_SECURE; pub const IPSEC_SA_BUNDLE_FLAG_ND_BOUNDARY = IPSEC_SA_BUNDLE_FLAGS.ND_BOUNDARY; pub const IPSEC_SA_BUNDLE_FLAG_ND_PEER_NAT_BOUNDARY = IPSEC_SA_BUNDLE_FLAGS.ND_PEER_NAT_BOUNDARY; pub const IPSEC_SA_BUNDLE_FLAG_GUARANTEE_ENCRYPTION = IPSEC_SA_BUNDLE_FLAGS.GUARANTEE_ENCRYPTION; pub const IPSEC_SA_BUNDLE_FLAG_ALLOW_NULL_TARGET_NAME_MATCH = IPSEC_SA_BUNDLE_FLAGS.ALLOW_NULL_TARGET_NAME_MATCH; pub const IPSEC_SA_BUNDLE_FLAG_CLEAR_DF_ON_TUNNEL = IPSEC_SA_BUNDLE_FLAGS.CLEAR_DF_ON_TUNNEL; pub const IPSEC_SA_BUNDLE_FLAG_ASSUME_UDP_CONTEXT_OUTBOUND = IPSEC_SA_BUNDLE_FLAGS.ASSUME_UDP_CONTEXT_OUTBOUND; pub const IPSEC_SA_BUNDLE_FLAG_ND_PEER_BOUNDARY = IPSEC_SA_BUNDLE_FLAGS.ND_PEER_BOUNDARY; pub const IPSEC_SA_BUNDLE_FLAG_SUPPRESS_DUPLICATE_DELETION = IPSEC_SA_BUNDLE_FLAGS.SUPPRESS_DUPLICATE_DELETION; pub const IPSEC_SA_BUNDLE_FLAG_PEER_SUPPORTS_GUARANTEE_ENCRYPTION = IPSEC_SA_BUNDLE_FLAGS.PEER_SUPPORTS_GUARANTEE_ENCRYPTION; pub const IPSEC_POLICY_FLAG = enum(u32) { ND_SECURE = 2, ND_BOUNDARY = 4, NAT_ENCAP_ALLOW_PEER_BEHIND_NAT = 16, NAT_ENCAP_ALLOW_GENERAL_NAT_TRAVERSAL = 32, DONT_NEGOTIATE_SECOND_LIFETIME = 64, DONT_NEGOTIATE_BYTE_LIFETIME = 128, CLEAR_DF_ON_TUNNEL = 8, ENABLE_V6_IN_V4_TUNNELING = 256, ENABLE_SERVER_ADDR_ASSIGNMENT = 512, TUNNEL_ALLOW_OUTBOUND_CLEAR_CONNECTION = 1024, TUNNEL_BYPASS_ALREADY_SECURE_CONNECTION = 2048, TUNNEL_BYPASS_ICMPV6 = 4096, KEY_MANAGER_ALLOW_DICTATE_KEY = 8192, _, pub fn initFlags(o: struct { ND_SECURE: u1 = 0, ND_BOUNDARY: u1 = 0, NAT_ENCAP_ALLOW_PEER_BEHIND_NAT: u1 = 0, NAT_ENCAP_ALLOW_GENERAL_NAT_TRAVERSAL: u1 = 0, DONT_NEGOTIATE_SECOND_LIFETIME: u1 = 0, DONT_NEGOTIATE_BYTE_LIFETIME: u1 = 0, CLEAR_DF_ON_TUNNEL: u1 = 0, ENABLE_V6_IN_V4_TUNNELING: u1 = 0, ENABLE_SERVER_ADDR_ASSIGNMENT: u1 = 0, TUNNEL_ALLOW_OUTBOUND_CLEAR_CONNECTION: u1 = 0, TUNNEL_BYPASS_ALREADY_SECURE_CONNECTION: u1 = 0, TUNNEL_BYPASS_ICMPV6: u1 = 0, KEY_MANAGER_ALLOW_DICTATE_KEY: u1 = 0, }) IPSEC_POLICY_FLAG { return @intToEnum(IPSEC_POLICY_FLAG, (if (o.ND_SECURE == 1) @enumToInt(IPSEC_POLICY_FLAG.ND_SECURE) else 0) | (if (o.ND_BOUNDARY == 1) @enumToInt(IPSEC_POLICY_FLAG.ND_BOUNDARY) else 0) | (if (o.NAT_ENCAP_ALLOW_PEER_BEHIND_NAT == 1) @enumToInt(IPSEC_POLICY_FLAG.NAT_ENCAP_ALLOW_PEER_BEHIND_NAT) else 0) | (if (o.NAT_ENCAP_ALLOW_GENERAL_NAT_TRAVERSAL == 1) @enumToInt(IPSEC_POLICY_FLAG.NAT_ENCAP_ALLOW_GENERAL_NAT_TRAVERSAL) else 0) | (if (o.DONT_NEGOTIATE_SECOND_LIFETIME == 1) @enumToInt(IPSEC_POLICY_FLAG.DONT_NEGOTIATE_SECOND_LIFETIME) else 0) | (if (o.DONT_NEGOTIATE_BYTE_LIFETIME == 1) @enumToInt(IPSEC_POLICY_FLAG.DONT_NEGOTIATE_BYTE_LIFETIME) else 0) | (if (o.CLEAR_DF_ON_TUNNEL == 1) @enumToInt(IPSEC_POLICY_FLAG.CLEAR_DF_ON_TUNNEL) else 0) | (if (o.ENABLE_V6_IN_V4_TUNNELING == 1) @enumToInt(IPSEC_POLICY_FLAG.ENABLE_V6_IN_V4_TUNNELING) else 0) | (if (o.ENABLE_SERVER_ADDR_ASSIGNMENT == 1) @enumToInt(IPSEC_POLICY_FLAG.ENABLE_SERVER_ADDR_ASSIGNMENT) else 0) | (if (o.TUNNEL_ALLOW_OUTBOUND_CLEAR_CONNECTION == 1) @enumToInt(IPSEC_POLICY_FLAG.TUNNEL_ALLOW_OUTBOUND_CLEAR_CONNECTION) else 0) | (if (o.TUNNEL_BYPASS_ALREADY_SECURE_CONNECTION == 1) @enumToInt(IPSEC_POLICY_FLAG.TUNNEL_BYPASS_ALREADY_SECURE_CONNECTION) else 0) | (if (o.TUNNEL_BYPASS_ICMPV6 == 1) @enumToInt(IPSEC_POLICY_FLAG.TUNNEL_BYPASS_ICMPV6) else 0) | (if (o.KEY_MANAGER_ALLOW_DICTATE_KEY == 1) @enumToInt(IPSEC_POLICY_FLAG.KEY_MANAGER_ALLOW_DICTATE_KEY) else 0) ); } }; pub const IPSEC_POLICY_FLAG_ND_SECURE = IPSEC_POLICY_FLAG.ND_SECURE; pub const IPSEC_POLICY_FLAG_ND_BOUNDARY = IPSEC_POLICY_FLAG.ND_BOUNDARY; pub const IPSEC_POLICY_FLAG_NAT_ENCAP_ALLOW_PEER_BEHIND_NAT = IPSEC_POLICY_FLAG.NAT_ENCAP_ALLOW_PEER_BEHIND_NAT; pub const IPSEC_POLICY_FLAG_NAT_ENCAP_ALLOW_GENERAL_NAT_TRAVERSAL = IPSEC_POLICY_FLAG.NAT_ENCAP_ALLOW_GENERAL_NAT_TRAVERSAL; pub const IPSEC_POLICY_FLAG_DONT_NEGOTIATE_SECOND_LIFETIME = IPSEC_POLICY_FLAG.DONT_NEGOTIATE_SECOND_LIFETIME; pub const IPSEC_POLICY_FLAG_DONT_NEGOTIATE_BYTE_LIFETIME = IPSEC_POLICY_FLAG.DONT_NEGOTIATE_BYTE_LIFETIME; pub const IPSEC_POLICY_FLAG_CLEAR_DF_ON_TUNNEL = IPSEC_POLICY_FLAG.CLEAR_DF_ON_TUNNEL; pub const IPSEC_POLICY_FLAG_ENABLE_V6_IN_V4_TUNNELING = IPSEC_POLICY_FLAG.ENABLE_V6_IN_V4_TUNNELING; pub const IPSEC_POLICY_FLAG_ENABLE_SERVER_ADDR_ASSIGNMENT = IPSEC_POLICY_FLAG.ENABLE_SERVER_ADDR_ASSIGNMENT; pub const IPSEC_POLICY_FLAG_TUNNEL_ALLOW_OUTBOUND_CLEAR_CONNECTION = IPSEC_POLICY_FLAG.TUNNEL_ALLOW_OUTBOUND_CLEAR_CONNECTION; pub const IPSEC_POLICY_FLAG_TUNNEL_BYPASS_ALREADY_SECURE_CONNECTION = IPSEC_POLICY_FLAG.TUNNEL_BYPASS_ALREADY_SECURE_CONNECTION; pub const IPSEC_POLICY_FLAG_TUNNEL_BYPASS_ICMPV6 = IPSEC_POLICY_FLAG.TUNNEL_BYPASS_ICMPV6; pub const IPSEC_POLICY_FLAG_KEY_MANAGER_ALLOW_DICTATE_KEY = IPSEC_POLICY_FLAG.KEY_MANAGER_ALLOW_DICTATE_KEY; pub const IKEEXT_CERT_AUTH = enum(u32) { FLAG_SSL_ONE_WAY = 1, ENABLE_CRL_CHECK_STRONG = 4, DISABLE_SSL_CERT_VALIDATION = 8, ALLOW_HTTP_CERT_LOOKUP = 16, URL_CONTAINS_BUNDLE = 32, _, pub fn initFlags(o: struct { FLAG_SSL_ONE_WAY: u1 = 0, ENABLE_CRL_CHECK_STRONG: u1 = 0, DISABLE_SSL_CERT_VALIDATION: u1 = 0, ALLOW_HTTP_CERT_LOOKUP: u1 = 0, URL_CONTAINS_BUNDLE: u1 = 0, }) IKEEXT_CERT_AUTH { return @intToEnum(IKEEXT_CERT_AUTH, (if (o.FLAG_SSL_ONE_WAY == 1) @enumToInt(IKEEXT_CERT_AUTH.FLAG_SSL_ONE_WAY) else 0) | (if (o.ENABLE_CRL_CHECK_STRONG == 1) @enumToInt(IKEEXT_CERT_AUTH.ENABLE_CRL_CHECK_STRONG) else 0) | (if (o.DISABLE_SSL_CERT_VALIDATION == 1) @enumToInt(IKEEXT_CERT_AUTH.DISABLE_SSL_CERT_VALIDATION) else 0) | (if (o.ALLOW_HTTP_CERT_LOOKUP == 1) @enumToInt(IKEEXT_CERT_AUTH.ALLOW_HTTP_CERT_LOOKUP) else 0) | (if (o.URL_CONTAINS_BUNDLE == 1) @enumToInt(IKEEXT_CERT_AUTH.URL_CONTAINS_BUNDLE) else 0) ); } }; pub const IKEEXT_CERT_AUTH_FLAG_SSL_ONE_WAY = IKEEXT_CERT_AUTH.FLAG_SSL_ONE_WAY; pub const IKEEXT_CERT_AUTH_ENABLE_CRL_CHECK_STRONG = IKEEXT_CERT_AUTH.ENABLE_CRL_CHECK_STRONG; pub const IKEEXT_CERT_AUTH_DISABLE_SSL_CERT_VALIDATION = IKEEXT_CERT_AUTH.DISABLE_SSL_CERT_VALIDATION; pub const IKEEXT_CERT_AUTH_ALLOW_HTTP_CERT_LOOKUP = IKEEXT_CERT_AUTH.ALLOW_HTTP_CERT_LOOKUP; pub const IKEEXT_CERT_AUTH_URL_CONTAINS_BUNDLE = IKEEXT_CERT_AUTH.URL_CONTAINS_BUNDLE; pub const IKEEXT_PRESHARED_KEY_AUTHENTICATION_FLAGS = enum(u32) { LOCAL_AUTH_ONLY = 1, REMOTE_AUTH_ONLY = 2, _, pub fn initFlags(o: struct { LOCAL_AUTH_ONLY: u1 = 0, REMOTE_AUTH_ONLY: u1 = 0, }) IKEEXT_PRESHARED_KEY_AUTHENTICATION_FLAGS { return @intToEnum(IKEEXT_PRESHARED_KEY_AUTHENTICATION_FLAGS, (if (o.LOCAL_AUTH_ONLY == 1) @enumToInt(IKEEXT_PRESHARED_KEY_AUTHENTICATION_FLAGS.LOCAL_AUTH_ONLY) else 0) | (if (o.REMOTE_AUTH_ONLY == 1) @enumToInt(IKEEXT_PRESHARED_KEY_AUTHENTICATION_FLAGS.REMOTE_AUTH_ONLY) else 0) ); } }; pub const IKEEXT_PSK_FLAG_LOCAL_AUTH_ONLY = IKEEXT_PRESHARED_KEY_AUTHENTICATION_FLAGS.LOCAL_AUTH_ONLY; pub const IKEEXT_PSK_FLAG_REMOTE_AUTH_ONLY = IKEEXT_PRESHARED_KEY_AUTHENTICATION_FLAGS.REMOTE_AUTH_ONLY; pub const IKEEXT_POLICY_FLAG = enum(u32) { DISABLE_DIAGNOSTICS = 1, NO_MACHINE_LUID_VERIFY = 2, NO_IMPERSONATION_LUID_VERIFY = 4, ENABLE_OPTIONAL_DH = 8, _, pub fn initFlags(o: struct { DISABLE_DIAGNOSTICS: u1 = 0, NO_MACHINE_LUID_VERIFY: u1 = 0, NO_IMPERSONATION_LUID_VERIFY: u1 = 0, ENABLE_OPTIONAL_DH: u1 = 0, }) IKEEXT_POLICY_FLAG { return @intToEnum(IKEEXT_POLICY_FLAG, (if (o.DISABLE_DIAGNOSTICS == 1) @enumToInt(IKEEXT_POLICY_FLAG.DISABLE_DIAGNOSTICS) else 0) | (if (o.NO_MACHINE_LUID_VERIFY == 1) @enumToInt(IKEEXT_POLICY_FLAG.NO_MACHINE_LUID_VERIFY) else 0) | (if (o.NO_IMPERSONATION_LUID_VERIFY == 1) @enumToInt(IKEEXT_POLICY_FLAG.NO_IMPERSONATION_LUID_VERIFY) else 0) | (if (o.ENABLE_OPTIONAL_DH == 1) @enumToInt(IKEEXT_POLICY_FLAG.ENABLE_OPTIONAL_DH) else 0) ); } }; pub const IKEEXT_POLICY_FLAG_DISABLE_DIAGNOSTICS = IKEEXT_POLICY_FLAG.DISABLE_DIAGNOSTICS; pub const IKEEXT_POLICY_FLAG_NO_MACHINE_LUID_VERIFY = IKEEXT_POLICY_FLAG.NO_MACHINE_LUID_VERIFY; pub const IKEEXT_POLICY_FLAG_NO_IMPERSONATION_LUID_VERIFY = IKEEXT_POLICY_FLAG.NO_IMPERSONATION_LUID_VERIFY; pub const IKEEXT_POLICY_FLAG_ENABLE_OPTIONAL_DH = IKEEXT_POLICY_FLAG.ENABLE_OPTIONAL_DH; pub const FWPM_SUBSCRIPTION_FLAGS = enum(u32) { ADD = 1, DELETE = 2, }; pub const FWPM_SUBSCRIPTION_FLAG_NOTIFY_ON_ADD = FWPM_SUBSCRIPTION_FLAGS.ADD; pub const FWPM_SUBSCRIPTION_FLAG_NOTIFY_ON_DELETE = FWPM_SUBSCRIPTION_FLAGS.DELETE; pub const IKEEXT_CERT_FLAGS = enum(u32) { ENABLE_ACCOUNT_MAPPING = 1, DISABLE_REQUEST_PAYLOAD = 2, USE_NAP_CERTIFICATE = 4, INTERMEDIATE_CA = 8, IGNORE_INIT_CERT_MAP_FAILURE = 16, PREFER_NAP_CERTIFICATE_OUTBOUND = 32, SELECT_NAP_CERTIFICATE = 64, VERIFY_NAP_CERTIFICATE = 128, FOLLOW_RENEWAL_CERTIFICATE = 256, _, pub fn initFlags(o: struct { ENABLE_ACCOUNT_MAPPING: u1 = 0, DISABLE_REQUEST_PAYLOAD: u1 = 0, USE_NAP_CERTIFICATE: u1 = 0, INTERMEDIATE_CA: u1 = 0, IGNORE_INIT_CERT_MAP_FAILURE: u1 = 0, PREFER_NAP_CERTIFICATE_OUTBOUND: u1 = 0, SELECT_NAP_CERTIFICATE: u1 = 0, VERIFY_NAP_CERTIFICATE: u1 = 0, FOLLOW_RENEWAL_CERTIFICATE: u1 = 0, }) IKEEXT_CERT_FLAGS { return @intToEnum(IKEEXT_CERT_FLAGS, (if (o.ENABLE_ACCOUNT_MAPPING == 1) @enumToInt(IKEEXT_CERT_FLAGS.ENABLE_ACCOUNT_MAPPING) else 0) | (if (o.DISABLE_REQUEST_PAYLOAD == 1) @enumToInt(IKEEXT_CERT_FLAGS.DISABLE_REQUEST_PAYLOAD) else 0) | (if (o.USE_NAP_CERTIFICATE == 1) @enumToInt(IKEEXT_CERT_FLAGS.USE_NAP_CERTIFICATE) else 0) | (if (o.INTERMEDIATE_CA == 1) @enumToInt(IKEEXT_CERT_FLAGS.INTERMEDIATE_CA) else 0) | (if (o.IGNORE_INIT_CERT_MAP_FAILURE == 1) @enumToInt(IKEEXT_CERT_FLAGS.IGNORE_INIT_CERT_MAP_FAILURE) else 0) | (if (o.PREFER_NAP_CERTIFICATE_OUTBOUND == 1) @enumToInt(IKEEXT_CERT_FLAGS.PREFER_NAP_CERTIFICATE_OUTBOUND) else 0) | (if (o.SELECT_NAP_CERTIFICATE == 1) @enumToInt(IKEEXT_CERT_FLAGS.SELECT_NAP_CERTIFICATE) else 0) | (if (o.VERIFY_NAP_CERTIFICATE == 1) @enumToInt(IKEEXT_CERT_FLAGS.VERIFY_NAP_CERTIFICATE) else 0) | (if (o.FOLLOW_RENEWAL_CERTIFICATE == 1) @enumToInt(IKEEXT_CERT_FLAGS.FOLLOW_RENEWAL_CERTIFICATE) else 0) ); } }; pub const IKEEXT_CERT_FLAG_ENABLE_ACCOUNT_MAPPING = IKEEXT_CERT_FLAGS.ENABLE_ACCOUNT_MAPPING; pub const IKEEXT_CERT_FLAG_DISABLE_REQUEST_PAYLOAD = IKEEXT_CERT_FLAGS.DISABLE_REQUEST_PAYLOAD; pub const IKEEXT_CERT_FLAG_USE_NAP_CERTIFICATE = IKEEXT_CERT_FLAGS.USE_NAP_CERTIFICATE; pub const IKEEXT_CERT_FLAG_INTERMEDIATE_CA = IKEEXT_CERT_FLAGS.INTERMEDIATE_CA; pub const IKEEXT_CERT_FLAG_IGNORE_INIT_CERT_MAP_FAILURE = IKEEXT_CERT_FLAGS.IGNORE_INIT_CERT_MAP_FAILURE; pub const IKEEXT_CERT_FLAG_PREFER_NAP_CERTIFICATE_OUTBOUND = IKEEXT_CERT_FLAGS.PREFER_NAP_CERTIFICATE_OUTBOUND; pub const IKEEXT_CERT_FLAG_SELECT_NAP_CERTIFICATE = IKEEXT_CERT_FLAGS.SELECT_NAP_CERTIFICATE; pub const IKEEXT_CERT_FLAG_VERIFY_NAP_CERTIFICATE = IKEEXT_CERT_FLAGS.VERIFY_NAP_CERTIFICATE; pub const IKEEXT_CERT_FLAG_FOLLOW_RENEWAL_CERTIFICATE = IKEEXT_CERT_FLAGS.FOLLOW_RENEWAL_CERTIFICATE; pub const IPSEC_DOSP_FLAGS = enum(u32) { ENABLE_IKEV1 = 1, ENABLE_IKEV2 = 2, DISABLE_AUTHIP = 4, DISABLE_DEFAULT_BLOCK = 8, FILTER_BLOCK = 16, FILTER_EXEMPT = 32, _, pub fn initFlags(o: struct { ENABLE_IKEV1: u1 = 0, ENABLE_IKEV2: u1 = 0, DISABLE_AUTHIP: u1 = 0, DISABLE_DEFAULT_BLOCK: u1 = 0, FILTER_BLOCK: u1 = 0, FILTER_EXEMPT: u1 = 0, }) IPSEC_DOSP_FLAGS { return @intToEnum(IPSEC_DOSP_FLAGS, (if (o.ENABLE_IKEV1 == 1) @enumToInt(IPSEC_DOSP_FLAGS.ENABLE_IKEV1) else 0) | (if (o.ENABLE_IKEV2 == 1) @enumToInt(IPSEC_DOSP_FLAGS.ENABLE_IKEV2) else 0) | (if (o.DISABLE_AUTHIP == 1) @enumToInt(IPSEC_DOSP_FLAGS.DISABLE_AUTHIP) else 0) | (if (o.DISABLE_DEFAULT_BLOCK == 1) @enumToInt(IPSEC_DOSP_FLAGS.DISABLE_DEFAULT_BLOCK) else 0) | (if (o.FILTER_BLOCK == 1) @enumToInt(IPSEC_DOSP_FLAGS.FILTER_BLOCK) else 0) | (if (o.FILTER_EXEMPT == 1) @enumToInt(IPSEC_DOSP_FLAGS.FILTER_EXEMPT) else 0) ); } }; pub const IPSEC_DOSP_FLAG_ENABLE_IKEV1 = IPSEC_DOSP_FLAGS.ENABLE_IKEV1; pub const IPSEC_DOSP_FLAG_ENABLE_IKEV2 = IPSEC_DOSP_FLAGS.ENABLE_IKEV2; pub const IPSEC_DOSP_FLAG_DISABLE_AUTHIP = IPSEC_DOSP_FLAGS.DISABLE_AUTHIP; pub const IPSEC_DOSP_FLAG_DISABLE_DEFAULT_BLOCK = IPSEC_DOSP_FLAGS.DISABLE_DEFAULT_BLOCK; pub const IPSEC_DOSP_FLAG_FILTER_BLOCK = IPSEC_DOSP_FLAGS.FILTER_BLOCK; pub const IPSEC_DOSP_FLAG_FILTER_EXEMPT = IPSEC_DOSP_FLAGS.FILTER_EXEMPT; pub const IKEEXT_KERBEROS_AUTHENTICATION_FLAGS = enum(u32) { ISABLE_INITIATOR_TOKEN_GENERATION = 1, ONT_ACCEPT_EXPLICIT_CREDENTIALS = 2, _, pub fn initFlags(o: struct { ISABLE_INITIATOR_TOKEN_GENERATION: u1 = 0, ONT_ACCEPT_EXPLICIT_CREDENTIALS: u1 = 0, }) IKEEXT_KERBEROS_AUTHENTICATION_FLAGS { return @intToEnum(IKEEXT_KERBEROS_AUTHENTICATION_FLAGS, (if (o.ISABLE_INITIATOR_TOKEN_GENERATION == 1) @enumToInt(IKEEXT_KERBEROS_AUTHENTICATION_FLAGS.ISABLE_INITIATOR_TOKEN_GENERATION) else 0) | (if (o.ONT_ACCEPT_EXPLICIT_CREDENTIALS == 1) @enumToInt(IKEEXT_KERBEROS_AUTHENTICATION_FLAGS.ONT_ACCEPT_EXPLICIT_CREDENTIALS) else 0) ); } }; pub const IKEEXT_KERB_AUTH_DISABLE_INITIATOR_TOKEN_GENERATION = IKEEXT_KERBEROS_AUTHENTICATION_FLAGS.ISABLE_INITIATOR_TOKEN_GENERATION; pub const IKEEXT_KERB_AUTH_DONT_ACCEPT_EXPLICIT_CREDENTIALS = IKEEXT_KERBEROS_AUTHENTICATION_FLAGS.ONT_ACCEPT_EXPLICIT_CREDENTIALS; pub const IKEEXT_RESERVED_AUTHENTICATION_FLAGS = enum(u32) { N = 1, _, pub fn initFlags(o: struct { N: u1 = 0, }) IKEEXT_RESERVED_AUTHENTICATION_FLAGS { return @intToEnum(IKEEXT_RESERVED_AUTHENTICATION_FLAGS, (if (o.N == 1) @enumToInt(IKEEXT_RESERVED_AUTHENTICATION_FLAGS.N) else 0) ); } }; pub const IKEEXT_RESERVED_AUTH_DISABLE_INITIATOR_TOKEN_GENERATION = IKEEXT_RESERVED_AUTHENTICATION_FLAGS.N; pub const IKEEXT_EAP_AUTHENTICATION_FLAGS = enum(u32) { LOCAL_AUTH_ONLY = 1, REMOTE_AUTH_ONLY = 2, _, pub fn initFlags(o: struct { LOCAL_AUTH_ONLY: u1 = 0, REMOTE_AUTH_ONLY: u1 = 0, }) IKEEXT_EAP_AUTHENTICATION_FLAGS { return @intToEnum(IKEEXT_EAP_AUTHENTICATION_FLAGS, (if (o.LOCAL_AUTH_ONLY == 1) @enumToInt(IKEEXT_EAP_AUTHENTICATION_FLAGS.LOCAL_AUTH_ONLY) else 0) | (if (o.REMOTE_AUTH_ONLY == 1) @enumToInt(IKEEXT_EAP_AUTHENTICATION_FLAGS.REMOTE_AUTH_ONLY) else 0) ); } }; pub const IKEEXT_EAP_FLAG_LOCAL_AUTH_ONLY = IKEEXT_EAP_AUTHENTICATION_FLAGS.LOCAL_AUTH_ONLY; pub const IKEEXT_EAP_FLAG_REMOTE_AUTH_ONLY = IKEEXT_EAP_AUTHENTICATION_FLAGS.REMOTE_AUTH_ONLY; pub const FWPM_FILTER_FLAGS = enum(u32) { NONE = 0, PERSISTENT = 1, BOOTTIME = 2, HAS_PROVIDER_CONTEXT = 4, CLEAR_ACTION_RIGHT = 8, PERMIT_IF_CALLOUT_UNREGISTERED = 16, DISABLED = 32, INDEXED = 64, _, pub fn initFlags(o: struct { NONE: u1 = 0, PERSISTENT: u1 = 0, BOOTTIME: u1 = 0, HAS_PROVIDER_CONTEXT: u1 = 0, CLEAR_ACTION_RIGHT: u1 = 0, PERMIT_IF_CALLOUT_UNREGISTERED: u1 = 0, DISABLED: u1 = 0, INDEXED: u1 = 0, }) FWPM_FILTER_FLAGS { return @intToEnum(FWPM_FILTER_FLAGS, (if (o.NONE == 1) @enumToInt(FWPM_FILTER_FLAGS.NONE) else 0) | (if (o.PERSISTENT == 1) @enumToInt(FWPM_FILTER_FLAGS.PERSISTENT) else 0) | (if (o.BOOTTIME == 1) @enumToInt(FWPM_FILTER_FLAGS.BOOTTIME) else 0) | (if (o.HAS_PROVIDER_CONTEXT == 1) @enumToInt(FWPM_FILTER_FLAGS.HAS_PROVIDER_CONTEXT) else 0) | (if (o.CLEAR_ACTION_RIGHT == 1) @enumToInt(FWPM_FILTER_FLAGS.CLEAR_ACTION_RIGHT) else 0) | (if (o.PERMIT_IF_CALLOUT_UNREGISTERED == 1) @enumToInt(FWPM_FILTER_FLAGS.PERMIT_IF_CALLOUT_UNREGISTERED) else 0) | (if (o.DISABLED == 1) @enumToInt(FWPM_FILTER_FLAGS.DISABLED) else 0) | (if (o.INDEXED == 1) @enumToInt(FWPM_FILTER_FLAGS.INDEXED) else 0) ); } }; pub const FWPM_FILTER_FLAG_NONE = FWPM_FILTER_FLAGS.NONE; pub const FWPM_FILTER_FLAG_PERSISTENT = FWPM_FILTER_FLAGS.PERSISTENT; pub const FWPM_FILTER_FLAG_BOOTTIME = FWPM_FILTER_FLAGS.BOOTTIME; pub const FWPM_FILTER_FLAG_HAS_PROVIDER_CONTEXT = FWPM_FILTER_FLAGS.HAS_PROVIDER_CONTEXT; pub const FWPM_FILTER_FLAG_CLEAR_ACTION_RIGHT = FWPM_FILTER_FLAGS.CLEAR_ACTION_RIGHT; pub const FWPM_FILTER_FLAG_PERMIT_IF_CALLOUT_UNREGISTERED = FWPM_FILTER_FLAGS.PERMIT_IF_CALLOUT_UNREGISTERED; pub const FWPM_FILTER_FLAG_DISABLED = FWPM_FILTER_FLAGS.DISABLED; pub const FWPM_FILTER_FLAG_INDEXED = FWPM_FILTER_FLAGS.INDEXED; pub const FWP_DIRECTION = enum(i32) { OUTBOUND = 0, INBOUND = 1, MAX = 2, }; pub const FWP_DIRECTION_OUTBOUND = FWP_DIRECTION.OUTBOUND; pub const FWP_DIRECTION_INBOUND = FWP_DIRECTION.INBOUND; pub const FWP_DIRECTION_MAX = FWP_DIRECTION.MAX; pub const FWP_IP_VERSION = enum(i32) { V4 = 0, V6 = 1, NONE = 2, MAX = 3, }; pub const FWP_IP_VERSION_V4 = FWP_IP_VERSION.V4; pub const FWP_IP_VERSION_V6 = FWP_IP_VERSION.V6; pub const FWP_IP_VERSION_NONE = FWP_IP_VERSION.NONE; pub const FWP_IP_VERSION_MAX = FWP_IP_VERSION.MAX; pub const FWP_AF = enum(i32) { INET = 0, INET6 = 1, ETHER = 2, NONE = 3, }; pub const FWP_AF_INET = FWP_AF.INET; pub const FWP_AF_INET6 = FWP_AF.INET6; pub const FWP_AF_ETHER = FWP_AF.ETHER; pub const FWP_AF_NONE = FWP_AF.NONE; pub const FWP_ETHER_ENCAP_METHOD = enum(i32) { ETHER_V2 = 0, SNAP = 1, SNAP_W_OUI_ZERO = 3, }; pub const FWP_ETHER_ENCAP_METHOD_ETHER_V2 = FWP_ETHER_ENCAP_METHOD.ETHER_V2; pub const FWP_ETHER_ENCAP_METHOD_SNAP = FWP_ETHER_ENCAP_METHOD.SNAP; pub const FWP_ETHER_ENCAP_METHOD_SNAP_W_OUI_ZERO = FWP_ETHER_ENCAP_METHOD.SNAP_W_OUI_ZERO; pub const FWP_DATA_TYPE = enum(i32) { EMPTY = 0, UINT8 = 1, UINT16 = 2, UINT32 = 3, UINT64 = 4, INT8 = 5, INT16 = 6, INT32 = 7, INT64 = 8, FLOAT = 9, DOUBLE = 10, BYTE_ARRAY16_TYPE = 11, BYTE_BLOB_TYPE = 12, SID = 13, SECURITY_DESCRIPTOR_TYPE = 14, TOKEN_INFORMATION_TYPE = 15, TOKEN_ACCESS_INFORMATION_TYPE = 16, UNICODE_STRING_TYPE = 17, BYTE_ARRAY6_TYPE = 18, BITMAP_INDEX_TYPE = 19, BITMAP_ARRAY64_TYPE = 20, SINGLE_DATA_TYPE_MAX = 255, V4_ADDR_MASK = 256, V6_ADDR_MASK = 257, RANGE_TYPE = 258, DATA_TYPE_MAX = 259, }; pub const FWP_EMPTY = FWP_DATA_TYPE.EMPTY; pub const FWP_UINT8 = FWP_DATA_TYPE.UINT8; pub const FWP_UINT16 = FWP_DATA_TYPE.UINT16; pub const FWP_UINT32 = FWP_DATA_TYPE.UINT32; pub const FWP_UINT64 = FWP_DATA_TYPE.UINT64; pub const FWP_INT8 = FWP_DATA_TYPE.INT8; pub const FWP_INT16 = FWP_DATA_TYPE.INT16; pub const FWP_INT32 = FWP_DATA_TYPE.INT32; pub const FWP_INT64 = FWP_DATA_TYPE.INT64; pub const FWP_FLOAT = FWP_DATA_TYPE.FLOAT; pub const FWP_DOUBLE = FWP_DATA_TYPE.DOUBLE; pub const FWP_BYTE_ARRAY16_TYPE = FWP_DATA_TYPE.BYTE_ARRAY16_TYPE; pub const FWP_BYTE_BLOB_TYPE = FWP_DATA_TYPE.BYTE_BLOB_TYPE; pub const FWP_SID = FWP_DATA_TYPE.SID; pub const FWP_SECURITY_DESCRIPTOR_TYPE = FWP_DATA_TYPE.SECURITY_DESCRIPTOR_TYPE; pub const FWP_TOKEN_INFORMATION_TYPE = FWP_DATA_TYPE.TOKEN_INFORMATION_TYPE; pub const FWP_TOKEN_ACCESS_INFORMATION_TYPE = FWP_DATA_TYPE.TOKEN_ACCESS_INFORMATION_TYPE; pub const FWP_UNICODE_STRING_TYPE = FWP_DATA_TYPE.UNICODE_STRING_TYPE; pub const FWP_BYTE_ARRAY6_TYPE = FWP_DATA_TYPE.BYTE_ARRAY6_TYPE; pub const FWP_BITMAP_INDEX_TYPE = FWP_DATA_TYPE.BITMAP_INDEX_TYPE; pub const FWP_BITMAP_ARRAY64_TYPE = FWP_DATA_TYPE.BITMAP_ARRAY64_TYPE; pub const FWP_SINGLE_DATA_TYPE_MAX = FWP_DATA_TYPE.SINGLE_DATA_TYPE_MAX; pub const FWP_V4_ADDR_MASK = FWP_DATA_TYPE.V4_ADDR_MASK; pub const FWP_V6_ADDR_MASK = FWP_DATA_TYPE.V6_ADDR_MASK; pub const FWP_RANGE_TYPE = FWP_DATA_TYPE.RANGE_TYPE; pub const FWP_DATA_TYPE_MAX = FWP_DATA_TYPE.DATA_TYPE_MAX; pub const FWP_BITMAP_ARRAY64_ = extern struct { bitmapArray64: [8]u8, }; pub const FWP_BYTE_ARRAY6 = extern struct { byteArray6: [6]u8, }; pub const FWP_BYTE_ARRAY16 = extern struct { byteArray16: [16]u8, }; pub const FWP_BYTE_BLOB = extern struct { size: u32, data: ?*u8, }; pub const FWP_TOKEN_INFORMATION = extern struct { sidCount: u32, sids: ?*SID_AND_ATTRIBUTES, restrictedSidCount: u32, restrictedSids: ?*SID_AND_ATTRIBUTES, }; pub const FWP_VALUE0 = extern struct { type: FWP_DATA_TYPE, Anonymous: extern union { uint8: u8, uint16: u16, uint32: u32, uint64: ?*u64, int8: i8, int16: i16, int32: i32, int64: ?*i64, float32: f32, double64: ?*f64, byteArray16: ?*FWP_BYTE_ARRAY16, byteBlob: ?*FWP_BYTE_BLOB, sid: ?*SID, sd: ?*FWP_BYTE_BLOB, tokenInformation: ?*FWP_TOKEN_INFORMATION, tokenAccessInformation: ?*FWP_BYTE_BLOB, unicodeString: ?PWSTR, byteArray6: ?*FWP_BYTE_ARRAY6, bitmapArray64: ?*FWP_BITMAP_ARRAY64_, }, }; pub const FWP_MATCH_TYPE = enum(i32) { EQUAL = 0, GREATER = 1, LESS = 2, GREATER_OR_EQUAL = 3, LESS_OR_EQUAL = 4, RANGE = 5, FLAGS_ALL_SET = 6, FLAGS_ANY_SET = 7, FLAGS_NONE_SET = 8, EQUAL_CASE_INSENSITIVE = 9, NOT_EQUAL = 10, PREFIX = 11, NOT_PREFIX = 12, TYPE_MAX = 13, }; pub const FWP_MATCH_EQUAL = FWP_MATCH_TYPE.EQUAL; pub const FWP_MATCH_GREATER = FWP_MATCH_TYPE.GREATER; pub const FWP_MATCH_LESS = FWP_MATCH_TYPE.LESS; pub const FWP_MATCH_GREATER_OR_EQUAL = FWP_MATCH_TYPE.GREATER_OR_EQUAL; pub const FWP_MATCH_LESS_OR_EQUAL = FWP_MATCH_TYPE.LESS_OR_EQUAL; pub const FWP_MATCH_RANGE = FWP_MATCH_TYPE.RANGE; pub const FWP_MATCH_FLAGS_ALL_SET = FWP_MATCH_TYPE.FLAGS_ALL_SET; pub const FWP_MATCH_FLAGS_ANY_SET = FWP_MATCH_TYPE.FLAGS_ANY_SET; pub const FWP_MATCH_FLAGS_NONE_SET = FWP_MATCH_TYPE.FLAGS_NONE_SET; pub const FWP_MATCH_EQUAL_CASE_INSENSITIVE = FWP_MATCH_TYPE.EQUAL_CASE_INSENSITIVE; pub const FWP_MATCH_NOT_EQUAL = FWP_MATCH_TYPE.NOT_EQUAL; pub const FWP_MATCH_PREFIX = FWP_MATCH_TYPE.PREFIX; pub const FWP_MATCH_NOT_PREFIX = FWP_MATCH_TYPE.NOT_PREFIX; pub const FWP_MATCH_TYPE_MAX = FWP_MATCH_TYPE.TYPE_MAX; pub const FWP_V4_ADDR_AND_MASK = extern struct { addr: u32, mask: u32, }; pub const FWP_V6_ADDR_AND_MASK = extern struct { addr: [16]u8, prefixLength: u8, }; pub const FWP_RANGE0 = extern struct { valueLow: FWP_VALUE0, valueHigh: FWP_VALUE0, }; pub const FWP_CONDITION_VALUE0 = extern struct { type: FWP_DATA_TYPE, Anonymous: extern union { uint8: u8, uint16: u16, uint32: u32, uint64: ?*u64, int8: i8, int16: i16, int32: i32, int64: ?*i64, float32: f32, double64: ?*f64, byteArray16: ?*FWP_BYTE_ARRAY16, byteBlob: ?*FWP_BYTE_BLOB, sid: ?*SID, sd: ?*FWP_BYTE_BLOB, tokenInformation: ?*FWP_TOKEN_INFORMATION, tokenAccessInformation: ?*FWP_BYTE_BLOB, unicodeString: ?PWSTR, byteArray6: ?*FWP_BYTE_ARRAY6, bitmapArray64: ?*FWP_BITMAP_ARRAY64_, v4AddrMask: ?*FWP_V4_ADDR_AND_MASK, v6AddrMask: ?*FWP_V6_ADDR_AND_MASK, rangeValue: ?*FWP_RANGE0, }, }; pub const FWP_CLASSIFY_OPTION_TYPE = enum(i32) { MULTICAST_STATE = 0, LOOSE_SOURCE_MAPPING = 1, UNICAST_LIFETIME = 2, MCAST_BCAST_LIFETIME = 3, SECURE_SOCKET_SECURITY_FLAGS = 4, SECURE_SOCKET_AUTHIP_MM_POLICY_KEY = 5, SECURE_SOCKET_AUTHIP_QM_POLICY_KEY = 6, LOCAL_ONLY_MAPPING = 7, MAX = 8, }; pub const FWP_CLASSIFY_OPTION_MULTICAST_STATE = FWP_CLASSIFY_OPTION_TYPE.MULTICAST_STATE; pub const FWP_CLASSIFY_OPTION_LOOSE_SOURCE_MAPPING = FWP_CLASSIFY_OPTION_TYPE.LOOSE_SOURCE_MAPPING; pub const FWP_CLASSIFY_OPTION_UNICAST_LIFETIME = FWP_CLASSIFY_OPTION_TYPE.UNICAST_LIFETIME; pub const FWP_CLASSIFY_OPTION_MCAST_BCAST_LIFETIME = FWP_CLASSIFY_OPTION_TYPE.MCAST_BCAST_LIFETIME; pub const FWP_CLASSIFY_OPTION_SECURE_SOCKET_SECURITY_FLAGS = FWP_CLASSIFY_OPTION_TYPE.SECURE_SOCKET_SECURITY_FLAGS; pub const FWP_CLASSIFY_OPTION_SECURE_SOCKET_AUTHIP_MM_POLICY_KEY = FWP_CLASSIFY_OPTION_TYPE.SECURE_SOCKET_AUTHIP_MM_POLICY_KEY; pub const FWP_CLASSIFY_OPTION_SECURE_SOCKET_AUTHIP_QM_POLICY_KEY = FWP_CLASSIFY_OPTION_TYPE.SECURE_SOCKET_AUTHIP_QM_POLICY_KEY; pub const FWP_CLASSIFY_OPTION_LOCAL_ONLY_MAPPING = FWP_CLASSIFY_OPTION_TYPE.LOCAL_ONLY_MAPPING; pub const FWP_CLASSIFY_OPTION_MAX = FWP_CLASSIFY_OPTION_TYPE.MAX; pub const FWP_VSWITCH_NETWORK_TYPE = enum(i32) { UNKNOWN = 0, PRIVATE = 1, INTERNAL = 2, EXTERNAL = 3, }; pub const FWP_VSWITCH_NETWORK_TYPE_UNKNOWN = FWP_VSWITCH_NETWORK_TYPE.UNKNOWN; pub const FWP_VSWITCH_NETWORK_TYPE_PRIVATE = FWP_VSWITCH_NETWORK_TYPE.PRIVATE; pub const FWP_VSWITCH_NETWORK_TYPE_INTERNAL = FWP_VSWITCH_NETWORK_TYPE.INTERNAL; pub const FWP_VSWITCH_NETWORK_TYPE_EXTERNAL = FWP_VSWITCH_NETWORK_TYPE.EXTERNAL; pub const FWP_FILTER_ENUM_TYPE = enum(i32) { FULLY_CONTAINED = 0, OVERLAPPING = 1, TYPE_MAX = 2, }; pub const FWP_FILTER_ENUM_FULLY_CONTAINED = FWP_FILTER_ENUM_TYPE.FULLY_CONTAINED; pub const FWP_FILTER_ENUM_OVERLAPPING = FWP_FILTER_ENUM_TYPE.OVERLAPPING; pub const FWP_FILTER_ENUM_TYPE_MAX = FWP_FILTER_ENUM_TYPE.TYPE_MAX; pub const FWPM_DISPLAY_DATA0 = extern struct { name: ?PWSTR, description: ?PWSTR, }; pub const IPSEC_VIRTUAL_IF_TUNNEL_INFO0 = extern struct { virtualIfTunnelId: u64, trafficSelectorId: u64, }; pub const IKEEXT_KEY_MODULE_TYPE = enum(i32) { IKE = 0, AUTHIP = 1, IKEV2 = 2, MAX = 3, }; pub const IKEEXT_KEY_MODULE_IKE = IKEEXT_KEY_MODULE_TYPE.IKE; pub const IKEEXT_KEY_MODULE_AUTHIP = IKEEXT_KEY_MODULE_TYPE.AUTHIP; pub const IKEEXT_KEY_MODULE_IKEV2 = IKEEXT_KEY_MODULE_TYPE.IKEV2; pub const IKEEXT_KEY_MODULE_MAX = IKEEXT_KEY_MODULE_TYPE.MAX; pub const IKEEXT_AUTHENTICATION_METHOD_TYPE = enum(i32) { PRESHARED_KEY = 0, CERTIFICATE = 1, KERBEROS = 2, ANONYMOUS = 3, SSL = 4, NTLM_V2 = 5, IPV6_CGA = 6, CERTIFICATE_ECDSA_P256 = 7, CERTIFICATE_ECDSA_P384 = 8, SSL_ECDSA_P256 = 9, SSL_ECDSA_P384 = 10, EAP = 11, RESERVED = 12, AUTHENTICATION_METHOD_TYPE_MAX = 13, }; pub const IKEEXT_PRESHARED_KEY = IKEEXT_AUTHENTICATION_METHOD_TYPE.PRESHARED_KEY; pub const IKEEXT_CERTIFICATE = IKEEXT_AUTHENTICATION_METHOD_TYPE.CERTIFICATE; pub const IKEEXT_KERBEROS = IKEEXT_AUTHENTICATION_METHOD_TYPE.KERBEROS; pub const IKEEXT_ANONYMOUS = IKEEXT_AUTHENTICATION_METHOD_TYPE.ANONYMOUS; pub const IKEEXT_SSL = IKEEXT_AUTHENTICATION_METHOD_TYPE.SSL; pub const IKEEXT_NTLM_V2 = IKEEXT_AUTHENTICATION_METHOD_TYPE.NTLM_V2; pub const IKEEXT_IPV6_CGA = IKEEXT_AUTHENTICATION_METHOD_TYPE.IPV6_CGA; pub const IKEEXT_CERTIFICATE_ECDSA_P256 = IKEEXT_AUTHENTICATION_METHOD_TYPE.CERTIFICATE_ECDSA_P256; pub const IKEEXT_CERTIFICATE_ECDSA_P384 = IKEEXT_AUTHENTICATION_METHOD_TYPE.CERTIFICATE_ECDSA_P384; pub const IKEEXT_SSL_ECDSA_P256 = IKEEXT_AUTHENTICATION_METHOD_TYPE.SSL_ECDSA_P256; pub const IKEEXT_SSL_ECDSA_P384 = IKEEXT_AUTHENTICATION_METHOD_TYPE.SSL_ECDSA_P384; pub const IKEEXT_EAP = IKEEXT_AUTHENTICATION_METHOD_TYPE.EAP; pub const IKEEXT_RESERVED = IKEEXT_AUTHENTICATION_METHOD_TYPE.RESERVED; pub const IKEEXT_AUTHENTICATION_METHOD_TYPE_MAX = IKEEXT_AUTHENTICATION_METHOD_TYPE.AUTHENTICATION_METHOD_TYPE_MAX; pub const IKEEXT_AUTHENTICATION_IMPERSONATION_TYPE = enum(i32) { NONE = 0, SOCKET_PRINCIPAL = 1, MAX = 2, }; pub const IKEEXT_IMPERSONATION_NONE = IKEEXT_AUTHENTICATION_IMPERSONATION_TYPE.NONE; pub const IKEEXT_IMPERSONATION_SOCKET_PRINCIPAL = IKEEXT_AUTHENTICATION_IMPERSONATION_TYPE.SOCKET_PRINCIPAL; pub const IKEEXT_IMPERSONATION_MAX = IKEEXT_AUTHENTICATION_IMPERSONATION_TYPE.MAX; pub const IKEEXT_PRESHARED_KEY_AUTHENTICATION0 = extern struct { presharedKey: FWP_BYTE_BLOB, }; pub const IKEEXT_PRESHARED_KEY_AUTHENTICATION1 = extern struct { presharedKey: FWP_BYTE_BLOB, flags: IKEEXT_PRESHARED_KEY_AUTHENTICATION_FLAGS, }; pub const IKEEXT_CERT_ROOT_CONFIG0 = extern struct { certData: FWP_BYTE_BLOB, flags: IKEEXT_CERT_FLAGS, }; pub const IKEEXT_CERT_CONFIG_TYPE = enum(i32) { EXPLICIT_TRUST_LIST = 0, ENTERPRISE_STORE = 1, TRUSTED_ROOT_STORE = 2, UNSPECIFIED = 3, TYPE_MAX = 4, }; pub const IKEEXT_CERT_CONFIG_EXPLICIT_TRUST_LIST = IKEEXT_CERT_CONFIG_TYPE.EXPLICIT_TRUST_LIST; pub const IKEEXT_CERT_CONFIG_ENTERPRISE_STORE = IKEEXT_CERT_CONFIG_TYPE.ENTERPRISE_STORE; pub const IKEEXT_CERT_CONFIG_TRUSTED_ROOT_STORE = IKEEXT_CERT_CONFIG_TYPE.TRUSTED_ROOT_STORE; pub const IKEEXT_CERT_CONFIG_UNSPECIFIED = IKEEXT_CERT_CONFIG_TYPE.UNSPECIFIED; pub const IKEEXT_CERT_CONFIG_TYPE_MAX = IKEEXT_CERT_CONFIG_TYPE.TYPE_MAX; pub const IKEEXT_CERTIFICATE_AUTHENTICATION0 = extern struct { inboundConfigType: IKEEXT_CERT_CONFIG_TYPE, Anonymous1: extern union { Anonymous: extern struct { inboundRootArraySize: u32, inboundRootArray: ?*IKEEXT_CERT_ROOT_CONFIG0, }, inboundEnterpriseStoreConfig: ?*IKEEXT_CERT_ROOT_CONFIG0, inboundTrustedRootStoreConfig: ?*IKEEXT_CERT_ROOT_CONFIG0, }, outboundConfigType: IKEEXT_CERT_CONFIG_TYPE, Anonymous2: extern union { Anonymous: extern struct { outboundRootArraySize: u32, outboundRootArray: ?*IKEEXT_CERT_ROOT_CONFIG0, }, outboundEnterpriseStoreConfig: ?*IKEEXT_CERT_ROOT_CONFIG0, outboundTrustedRootStoreConfig: ?*IKEEXT_CERT_ROOT_CONFIG0, }, flags: IKEEXT_CERT_AUTH, }; pub const IKEEXT_CERTIFICATE_AUTHENTICATION1 = extern struct { inboundConfigType: IKEEXT_CERT_CONFIG_TYPE, Anonymous1: extern union { Anonymous: extern struct { inboundRootArraySize: u32, inboundRootArray: ?*IKEEXT_CERT_ROOT_CONFIG0, }, inboundEnterpriseStoreConfig: ?*IKEEXT_CERT_ROOT_CONFIG0, inboundTrustedRootStoreConfig: ?*IKEEXT_CERT_ROOT_CONFIG0, }, outboundConfigType: IKEEXT_CERT_CONFIG_TYPE, Anonymous2: extern union { Anonymous: extern struct { outboundRootArraySize: u32, outboundRootArray: ?*IKEEXT_CERT_ROOT_CONFIG0, }, outboundEnterpriseStoreConfig: ?*IKEEXT_CERT_ROOT_CONFIG0, outboundTrustedRootStoreConfig: ?*IKEEXT_CERT_ROOT_CONFIG0, }, flags: IKEEXT_CERT_AUTH, localCertLocationUrl: FWP_BYTE_BLOB, }; pub const IKEEXT_CERT_CRITERIA_NAME_TYPE = enum(i32) { DNS = 0, UPN = 1, RFC822 = 2, CN = 3, OU = 4, O = 5, DC = 6, NAME_TYPE_MAX = 7, }; pub const IKEEXT_CERT_CRITERIA_DNS = IKEEXT_CERT_CRITERIA_NAME_TYPE.DNS; pub const IKEEXT_CERT_CRITERIA_UPN = IKEEXT_CERT_CRITERIA_NAME_TYPE.UPN; pub const IKEEXT_CERT_CRITERIA_RFC822 = IKEEXT_CERT_CRITERIA_NAME_TYPE.RFC822; pub const IKEEXT_CERT_CRITERIA_CN = IKEEXT_CERT_CRITERIA_NAME_TYPE.CN; pub const IKEEXT_CERT_CRITERIA_OU = IKEEXT_CERT_CRITERIA_NAME_TYPE.OU; pub const IKEEXT_CERT_CRITERIA_O = IKEEXT_CERT_CRITERIA_NAME_TYPE.O; pub const IKEEXT_CERT_CRITERIA_DC = IKEEXT_CERT_CRITERIA_NAME_TYPE.DC; pub const IKEEXT_CERT_CRITERIA_NAME_TYPE_MAX = IKEEXT_CERT_CRITERIA_NAME_TYPE.NAME_TYPE_MAX; pub const IKEEXT_CERT_EKUS0 = extern struct { numEku: u32, eku: ?*?PSTR, }; pub const IKEEXT_CERT_NAME0 = extern struct { nameType: IKEEXT_CERT_CRITERIA_NAME_TYPE, certName: ?PWSTR, }; pub const IKEEXT_CERTIFICATE_CRITERIA0 = extern struct { certData: FWP_BYTE_BLOB, certHash: FWP_BYTE_BLOB, eku: ?*IKEEXT_CERT_EKUS0, name: ?*IKEEXT_CERT_NAME0, flags: u32, }; pub const IKEEXT_CERTIFICATE_AUTHENTICATION2 = extern struct { inboundConfigType: IKEEXT_CERT_CONFIG_TYPE, Anonymous1: extern union { Anonymous1: extern struct { inboundRootArraySize: u32, inboundRootCriteria: ?*IKEEXT_CERTIFICATE_CRITERIA0, }, Anonymous2: extern struct { inboundEnterpriseStoreArraySize: u32, inboundEnterpriseStoreCriteria: ?*IKEEXT_CERTIFICATE_CRITERIA0, }, Anonymous3: extern struct { inboundRootStoreArraySize: u32, inboundTrustedRootStoreCriteria: ?*IKEEXT_CERTIFICATE_CRITERIA0, }, }, outboundConfigType: IKEEXT_CERT_CONFIG_TYPE, Anonymous2: extern union { Anonymous1: extern struct { outboundRootArraySize: u32, outboundRootCriteria: ?*IKEEXT_CERTIFICATE_CRITERIA0, }, Anonymous2: extern struct { outboundEnterpriseStoreArraySize: u32, outboundEnterpriseStoreCriteria: ?*IKEEXT_CERTIFICATE_CRITERIA0, }, Anonymous3: extern struct { outboundRootStoreArraySize: u32, outboundTrustedRootStoreCriteria: ?*IKEEXT_CERTIFICATE_CRITERIA0, }, }, flags: IKEEXT_CERT_AUTH, localCertLocationUrl: FWP_BYTE_BLOB, }; pub const IKEEXT_IPV6_CGA_AUTHENTICATION0 = extern struct { keyContainerName: ?PWSTR, cspName: ?PWSTR, cspType: u32, cgaModifier: FWP_BYTE_ARRAY16, cgaCollisionCount: u8, }; pub const IKEEXT_KERBEROS_AUTHENTICATION0 = extern struct { flags: IKEEXT_KERBEROS_AUTHENTICATION_FLAGS, }; pub const IKEEXT_KERBEROS_AUTHENTICATION1 = extern struct { flags: IKEEXT_KERBEROS_AUTHENTICATION_FLAGS, proxyServer: ?PWSTR, }; pub const IKEEXT_RESERVED_AUTHENTICATION0 = extern struct { flags: IKEEXT_RESERVED_AUTHENTICATION_FLAGS, }; pub const IKEEXT_NTLM_V2_AUTHENTICATION0 = extern struct { flags: u32, }; pub const IKEEXT_EAP_AUTHENTICATION0 = extern struct { flags: IKEEXT_EAP_AUTHENTICATION_FLAGS, }; pub const IKEEXT_AUTHENTICATION_METHOD0 = extern struct { authenticationMethodType: IKEEXT_AUTHENTICATION_METHOD_TYPE, Anonymous: extern union { presharedKeyAuthentication: IKEEXT_PRESHARED_KEY_AUTHENTICATION0, certificateAuthentication: IKEEXT_CERTIFICATE_AUTHENTICATION0, kerberosAuthentication: IKEEXT_KERBEROS_AUTHENTICATION0, ntlmV2Authentication: IKEEXT_NTLM_V2_AUTHENTICATION0, sslAuthentication: IKEEXT_CERTIFICATE_AUTHENTICATION0, cgaAuthentication: IKEEXT_IPV6_CGA_AUTHENTICATION0, }, }; pub const IKEEXT_AUTHENTICATION_METHOD1 = extern struct { authenticationMethodType: IKEEXT_AUTHENTICATION_METHOD_TYPE, Anonymous: extern union { presharedKeyAuthentication: IKEEXT_PRESHARED_KEY_AUTHENTICATION1, certificateAuthentication: IKEEXT_CERTIFICATE_AUTHENTICATION1, kerberosAuthentication: IKEEXT_KERBEROS_AUTHENTICATION0, ntlmV2Authentication: IKEEXT_NTLM_V2_AUTHENTICATION0, sslAuthentication: IKEEXT_CERTIFICATE_AUTHENTICATION1, cgaAuthentication: IKEEXT_IPV6_CGA_AUTHENTICATION0, eapAuthentication: IKEEXT_EAP_AUTHENTICATION0, }, }; pub const IKEEXT_AUTHENTICATION_METHOD2 = extern struct { authenticationMethodType: IKEEXT_AUTHENTICATION_METHOD_TYPE, Anonymous: extern union { presharedKeyAuthentication: IKEEXT_PRESHARED_KEY_AUTHENTICATION1, certificateAuthentication: IKEEXT_CERTIFICATE_AUTHENTICATION2, kerberosAuthentication: IKEEXT_KERBEROS_AUTHENTICATION1, reservedAuthentication: IKEEXT_RESERVED_AUTHENTICATION0, ntlmV2Authentication: IKEEXT_NTLM_V2_AUTHENTICATION0, sslAuthentication: IKEEXT_CERTIFICATE_AUTHENTICATION2, cgaAuthentication: IKEEXT_IPV6_CGA_AUTHENTICATION0, eapAuthentication: IKEEXT_EAP_AUTHENTICATION0, }, }; pub const IKEEXT_CIPHER_TYPE = enum(i32) { DES = 0, @"3DES" = 1, AES_128 = 2, AES_192 = 3, AES_256 = 4, AES_GCM_128_16ICV = 5, AES_GCM_256_16ICV = 6, TYPE_MAX = 7, }; pub const IKEEXT_CIPHER_DES = IKEEXT_CIPHER_TYPE.DES; pub const IKEEXT_CIPHER_3DES = IKEEXT_CIPHER_TYPE.@"3DES"; pub const IKEEXT_CIPHER_AES_128 = IKEEXT_CIPHER_TYPE.AES_128; pub const IKEEXT_CIPHER_AES_192 = IKEEXT_CIPHER_TYPE.AES_192; pub const IKEEXT_CIPHER_AES_256 = IKEEXT_CIPHER_TYPE.AES_256; pub const IKEEXT_CIPHER_AES_GCM_128_16ICV = IKEEXT_CIPHER_TYPE.AES_GCM_128_16ICV; pub const IKEEXT_CIPHER_AES_GCM_256_16ICV = IKEEXT_CIPHER_TYPE.AES_GCM_256_16ICV; pub const IKEEXT_CIPHER_TYPE_MAX = IKEEXT_CIPHER_TYPE.TYPE_MAX; pub const IKEEXT_CIPHER_ALGORITHM0 = extern struct { algoIdentifier: IKEEXT_CIPHER_TYPE, keyLen: u32, rounds: u32, }; pub const IKEEXT_INTEGRITY_TYPE = enum(i32) { MD5 = 0, SHA1 = 1, SHA_256 = 2, SHA_384 = 3, TYPE_MAX = 4, }; pub const IKEEXT_INTEGRITY_MD5 = IKEEXT_INTEGRITY_TYPE.MD5; pub const IKEEXT_INTEGRITY_SHA1 = IKEEXT_INTEGRITY_TYPE.SHA1; pub const IKEEXT_INTEGRITY_SHA_256 = IKEEXT_INTEGRITY_TYPE.SHA_256; pub const IKEEXT_INTEGRITY_SHA_384 = IKEEXT_INTEGRITY_TYPE.SHA_384; pub const IKEEXT_INTEGRITY_TYPE_MAX = IKEEXT_INTEGRITY_TYPE.TYPE_MAX; pub const IKEEXT_INTEGRITY_ALGORITHM0 = extern struct { algoIdentifier: IKEEXT_INTEGRITY_TYPE, }; pub const IKEEXT_DH_GROUP = enum(i32) { GROUP_NONE = 0, GROUP_1 = 1, GROUP_2 = 2, GROUP_14 = 3, // GROUP_2048 = 3, this enum value conflicts with GROUP_14 ECP_256 = 4, ECP_384 = 5, GROUP_24 = 6, GROUP_MAX = 7, }; pub const IKEEXT_DH_GROUP_NONE = IKEEXT_DH_GROUP.GROUP_NONE; pub const IKEEXT_DH_GROUP_1 = IKEEXT_DH_GROUP.GROUP_1; pub const IKEEXT_DH_GROUP_2 = IKEEXT_DH_GROUP.GROUP_2; pub const IKEEXT_DH_GROUP_14 = IKEEXT_DH_GROUP.GROUP_14; pub const IKEEXT_DH_GROUP_2048 = IKEEXT_DH_GROUP.GROUP_14; pub const IKEEXT_DH_ECP_256 = IKEEXT_DH_GROUP.ECP_256; pub const IKEEXT_DH_ECP_384 = IKEEXT_DH_GROUP.ECP_384; pub const IKEEXT_DH_GROUP_24 = IKEEXT_DH_GROUP.GROUP_24; pub const IKEEXT_DH_GROUP_MAX = IKEEXT_DH_GROUP.GROUP_MAX; pub const IKEEXT_PROPOSAL0 = extern struct { cipherAlgorithm: IKEEXT_CIPHER_ALGORITHM0, integrityAlgorithm: IKEEXT_INTEGRITY_ALGORITHM0, maxLifetimeSeconds: u32, dhGroup: IKEEXT_DH_GROUP, quickModeLimit: u32, }; pub const IKEEXT_POLICY0 = extern struct { softExpirationTime: u32, numAuthenticationMethods: u32, authenticationMethods: ?*IKEEXT_AUTHENTICATION_METHOD0, initiatorImpersonationType: IKEEXT_AUTHENTICATION_IMPERSONATION_TYPE, numIkeProposals: u32, ikeProposals: ?*IKEEXT_PROPOSAL0, flags: IKEEXT_POLICY_FLAG, maxDynamicFilters: u32, }; pub const IKEEXT_POLICY1 = extern struct { softExpirationTime: u32, numAuthenticationMethods: u32, authenticationMethods: ?*IKEEXT_AUTHENTICATION_METHOD1, initiatorImpersonationType: IKEEXT_AUTHENTICATION_IMPERSONATION_TYPE, numIkeProposals: u32, ikeProposals: ?*IKEEXT_PROPOSAL0, flags: IKEEXT_POLICY_FLAG, maxDynamicFilters: u32, retransmitDurationSecs: u32, }; pub const IKEEXT_POLICY2 = extern struct { softExpirationTime: u32, numAuthenticationMethods: u32, authenticationMethods: ?*IKEEXT_AUTHENTICATION_METHOD2, initiatorImpersonationType: IKEEXT_AUTHENTICATION_IMPERSONATION_TYPE, numIkeProposals: u32, ikeProposals: ?*IKEEXT_PROPOSAL0, flags: IKEEXT_POLICY_FLAG, maxDynamicFilters: u32, retransmitDurationSecs: u32, }; pub const IKEEXT_EM_POLICY0 = extern struct { numAuthenticationMethods: u32, authenticationMethods: ?*IKEEXT_AUTHENTICATION_METHOD0, initiatorImpersonationType: IKEEXT_AUTHENTICATION_IMPERSONATION_TYPE, }; pub const IKEEXT_EM_POLICY1 = extern struct { numAuthenticationMethods: u32, authenticationMethods: ?*IKEEXT_AUTHENTICATION_METHOD1, initiatorImpersonationType: IKEEXT_AUTHENTICATION_IMPERSONATION_TYPE, }; pub const IKEEXT_EM_POLICY2 = extern struct { numAuthenticationMethods: u32, authenticationMethods: ?*IKEEXT_AUTHENTICATION_METHOD2, initiatorImpersonationType: IKEEXT_AUTHENTICATION_IMPERSONATION_TYPE, }; pub const IKEEXT_IP_VERSION_SPECIFIC_KEYMODULE_STATISTICS0 = extern struct { currentActiveMainModes: u32, totalMainModesStarted: u32, totalSuccessfulMainModes: u32, totalFailedMainModes: u32, totalResponderMainModes: u32, currentNewResponderMainModes: u32, currentActiveQuickModes: u32, totalQuickModesStarted: u32, totalSuccessfulQuickModes: u32, totalFailedQuickModes: u32, totalAcquires: u32, totalReinitAcquires: u32, currentActiveExtendedModes: u32, totalExtendedModesStarted: u32, totalSuccessfulExtendedModes: u32, totalFailedExtendedModes: u32, totalImpersonationExtendedModes: u32, totalImpersonationMainModes: u32, }; pub const IKEEXT_IP_VERSION_SPECIFIC_KEYMODULE_STATISTICS1 = extern struct { currentActiveMainModes: u32, totalMainModesStarted: u32, totalSuccessfulMainModes: u32, totalFailedMainModes: u32, totalResponderMainModes: u32, currentNewResponderMainModes: u32, currentActiveQuickModes: u32, totalQuickModesStarted: u32, totalSuccessfulQuickModes: u32, totalFailedQuickModes: u32, totalAcquires: u32, totalReinitAcquires: u32, currentActiveExtendedModes: u32, totalExtendedModesStarted: u32, totalSuccessfulExtendedModes: u32, totalFailedExtendedModes: u32, totalImpersonationExtendedModes: u32, totalImpersonationMainModes: u32, }; pub const IKEEXT_KEYMODULE_STATISTICS0 = extern struct { v4Statistics: IKEEXT_IP_VERSION_SPECIFIC_KEYMODULE_STATISTICS0, v6Statistics: IKEEXT_IP_VERSION_SPECIFIC_KEYMODULE_STATISTICS0, errorFrequencyTable: [97]u32, mainModeNegotiationTime: u32, quickModeNegotiationTime: u32, extendedModeNegotiationTime: u32, }; pub const IKEEXT_KEYMODULE_STATISTICS1 = extern struct { v4Statistics: IKEEXT_IP_VERSION_SPECIFIC_KEYMODULE_STATISTICS1, v6Statistics: IKEEXT_IP_VERSION_SPECIFIC_KEYMODULE_STATISTICS1, errorFrequencyTable: [97]u32, mainModeNegotiationTime: u32, quickModeNegotiationTime: u32, extendedModeNegotiationTime: u32, }; pub const IKEEXT_IP_VERSION_SPECIFIC_COMMON_STATISTICS0 = extern struct { totalSocketReceiveFailures: u32, totalSocketSendFailures: u32, }; pub const IKEEXT_IP_VERSION_SPECIFIC_COMMON_STATISTICS1 = extern struct { totalSocketReceiveFailures: u32, totalSocketSendFailures: u32, }; pub const IKEEXT_COMMON_STATISTICS0 = extern struct { v4Statistics: IKEEXT_IP_VERSION_SPECIFIC_COMMON_STATISTICS0, v6Statistics: IKEEXT_IP_VERSION_SPECIFIC_COMMON_STATISTICS0, totalPacketsReceived: u32, totalInvalidPacketsReceived: u32, currentQueuedWorkitems: u32, }; pub const IKEEXT_COMMON_STATISTICS1 = extern struct { v4Statistics: IKEEXT_IP_VERSION_SPECIFIC_COMMON_STATISTICS1, v6Statistics: IKEEXT_IP_VERSION_SPECIFIC_COMMON_STATISTICS1, totalPacketsReceived: u32, totalInvalidPacketsReceived: u32, currentQueuedWorkitems: u32, }; pub const IKEEXT_STATISTICS0 = extern struct { ikeStatistics: IKEEXT_KEYMODULE_STATISTICS0, authipStatistics: IKEEXT_KEYMODULE_STATISTICS0, commonStatistics: IKEEXT_COMMON_STATISTICS0, }; pub const IKEEXT_STATISTICS1 = extern struct { ikeStatistics: IKEEXT_KEYMODULE_STATISTICS1, authipStatistics: IKEEXT_KEYMODULE_STATISTICS1, ikeV2Statistics: IKEEXT_KEYMODULE_STATISTICS1, commonStatistics: IKEEXT_COMMON_STATISTICS1, }; pub const IKEEXT_TRAFFIC0 = extern struct { ipVersion: FWP_IP_VERSION, Anonymous1: extern union { localV4Address: u32, localV6Address: [16]u8, }, Anonymous2: extern union { remoteV4Address: u32, remoteV6Address: [16]u8, }, authIpFilterId: u64, }; pub const IKEEXT_COOKIE_PAIR0 = extern struct { initiator: u64, responder: u64, }; pub const IKEEXT_CERTIFICATE_CREDENTIAL0 = extern struct { subjectName: FWP_BYTE_BLOB, certHash: FWP_BYTE_BLOB, flags: u32, }; pub const IKEEXT_NAME_CREDENTIAL0 = extern struct { principalName: ?PWSTR, }; pub const IKEEXT_CREDENTIAL0 = extern struct { authenticationMethodType: IKEEXT_AUTHENTICATION_METHOD_TYPE, impersonationType: IKEEXT_AUTHENTICATION_IMPERSONATION_TYPE, Anonymous: extern union { presharedKey: ?*IKEEXT_PRESHARED_KEY_AUTHENTICATION0, certificate: ?*IKEEXT_CERTIFICATE_CREDENTIAL0, name: ?*IKEEXT_NAME_CREDENTIAL0, }, }; pub const IKEEXT_CREDENTIAL_PAIR0 = extern struct { localCredentials: IKEEXT_CREDENTIAL0, peerCredentials: IKEEXT_CREDENTIAL0, }; pub const IKEEXT_CREDENTIALS0 = extern struct { numCredentials: u32, credentials: ?*IKEEXT_CREDENTIAL_PAIR0, }; pub const IKEEXT_SA_DETAILS0 = extern struct { saId: u64, keyModuleType: IKEEXT_KEY_MODULE_TYPE, ipVersion: FWP_IP_VERSION, Anonymous: extern union { v4UdpEncapsulation: ?*IPSEC_V4_UDP_ENCAPSULATION0, }, ikeTraffic: IKEEXT_TRAFFIC0, ikeProposal: IKEEXT_PROPOSAL0, cookiePair: IKEEXT_COOKIE_PAIR0, ikeCredentials: IKEEXT_CREDENTIALS0, ikePolicyKey: Guid, virtualIfTunnelId: u64, }; pub const IKEEXT_CERTIFICATE_CREDENTIAL1 = extern struct { subjectName: FWP_BYTE_BLOB, certHash: FWP_BYTE_BLOB, flags: u32, certificate: FWP_BYTE_BLOB, }; pub const IKEEXT_CREDENTIAL1 = extern struct { authenticationMethodType: IKEEXT_AUTHENTICATION_METHOD_TYPE, impersonationType: IKEEXT_AUTHENTICATION_IMPERSONATION_TYPE, Anonymous: extern union { presharedKey: ?*IKEEXT_PRESHARED_KEY_AUTHENTICATION1, certificate: ?*IKEEXT_CERTIFICATE_CREDENTIAL1, name: ?*IKEEXT_NAME_CREDENTIAL0, }, }; pub const IKEEXT_CREDENTIAL_PAIR1 = extern struct { localCredentials: IKEEXT_CREDENTIAL1, peerCredentials: IKEEXT_CREDENTIAL1, }; pub const IKEEXT_CREDENTIALS1 = extern struct { numCredentials: u32, credentials: ?*IKEEXT_CREDENTIAL_PAIR1, }; pub const IKEEXT_SA_DETAILS1 = extern struct { saId: u64, keyModuleType: IKEEXT_KEY_MODULE_TYPE, ipVersion: FWP_IP_VERSION, Anonymous: extern union { v4UdpEncapsulation: ?*IPSEC_V4_UDP_ENCAPSULATION0, }, ikeTraffic: IKEEXT_TRAFFIC0, ikeProposal: IKEEXT_PROPOSAL0, cookiePair: IKEEXT_COOKIE_PAIR0, ikeCredentials: IKEEXT_CREDENTIALS1, ikePolicyKey: Guid, virtualIfTunnelId: u64, correlationKey: FWP_BYTE_BLOB, }; pub const IKEEXT_CREDENTIAL2 = extern struct { authenticationMethodType: IKEEXT_AUTHENTICATION_METHOD_TYPE, impersonationType: IKEEXT_AUTHENTICATION_IMPERSONATION_TYPE, Anonymous: extern union { presharedKey: ?*IKEEXT_PRESHARED_KEY_AUTHENTICATION1, certificate: ?*IKEEXT_CERTIFICATE_CREDENTIAL1, name: ?*IKEEXT_NAME_CREDENTIAL0, }, }; pub const IKEEXT_CREDENTIAL_PAIR2 = extern struct { localCredentials: IKEEXT_CREDENTIAL2, peerCredentials: IKEEXT_CREDENTIAL2, }; pub const IKEEXT_CREDENTIALS2 = extern struct { numCredentials: u32, credentials: ?*IKEEXT_CREDENTIAL_PAIR2, }; pub const IKEEXT_SA_DETAILS2 = extern struct { saId: u64, keyModuleType: IKEEXT_KEY_MODULE_TYPE, ipVersion: FWP_IP_VERSION, Anonymous: extern union { v4UdpEncapsulation: ?*IPSEC_V4_UDP_ENCAPSULATION0, }, ikeTraffic: IKEEXT_TRAFFIC0, ikeProposal: IKEEXT_PROPOSAL0, cookiePair: IKEEXT_COOKIE_PAIR0, ikeCredentials: IKEEXT_CREDENTIALS2, ikePolicyKey: Guid, virtualIfTunnelId: u64, correlationKey: FWP_BYTE_BLOB, }; pub const IKEEXT_SA_ENUM_TEMPLATE0 = extern struct { localSubNet: FWP_CONDITION_VALUE0, remoteSubNet: FWP_CONDITION_VALUE0, localMainModeCertHash: FWP_BYTE_BLOB, }; pub const IKEEXT_MM_SA_STATE = enum(i32) { NONE = 0, SA_SENT = 1, SSPI_SENT = 2, FINAL = 3, FINAL_SENT = 4, COMPLETE = 5, MAX = 6, }; pub const IKEEXT_MM_SA_STATE_NONE = IKEEXT_MM_SA_STATE.NONE; pub const IKEEXT_MM_SA_STATE_SA_SENT = IKEEXT_MM_SA_STATE.SA_SENT; pub const IKEEXT_MM_SA_STATE_SSPI_SENT = IKEEXT_MM_SA_STATE.SSPI_SENT; pub const IKEEXT_MM_SA_STATE_FINAL = IKEEXT_MM_SA_STATE.FINAL; pub const IKEEXT_MM_SA_STATE_FINAL_SENT = IKEEXT_MM_SA_STATE.FINAL_SENT; pub const IKEEXT_MM_SA_STATE_COMPLETE = IKEEXT_MM_SA_STATE.COMPLETE; pub const IKEEXT_MM_SA_STATE_MAX = IKEEXT_MM_SA_STATE.MAX; pub const IKEEXT_QM_SA_STATE = enum(i32) { NONE = 0, INITIAL = 1, FINAL = 2, COMPLETE = 3, MAX = 4, }; pub const IKEEXT_QM_SA_STATE_NONE = IKEEXT_QM_SA_STATE.NONE; pub const IKEEXT_QM_SA_STATE_INITIAL = IKEEXT_QM_SA_STATE.INITIAL; pub const IKEEXT_QM_SA_STATE_FINAL = IKEEXT_QM_SA_STATE.FINAL; pub const IKEEXT_QM_SA_STATE_COMPLETE = IKEEXT_QM_SA_STATE.COMPLETE; pub const IKEEXT_QM_SA_STATE_MAX = IKEEXT_QM_SA_STATE.MAX; pub const IKEEXT_EM_SA_STATE = enum(i32) { NONE = 0, SENT_ATTS = 1, SSPI_SENT = 2, AUTH_COMPLETE = 3, FINAL = 4, COMPLETE = 5, MAX = 6, }; pub const IKEEXT_EM_SA_STATE_NONE = IKEEXT_EM_SA_STATE.NONE; pub const IKEEXT_EM_SA_STATE_SENT_ATTS = IKEEXT_EM_SA_STATE.SENT_ATTS; pub const IKEEXT_EM_SA_STATE_SSPI_SENT = IKEEXT_EM_SA_STATE.SSPI_SENT; pub const IKEEXT_EM_SA_STATE_AUTH_COMPLETE = IKEEXT_EM_SA_STATE.AUTH_COMPLETE; pub const IKEEXT_EM_SA_STATE_FINAL = IKEEXT_EM_SA_STATE.FINAL; pub const IKEEXT_EM_SA_STATE_COMPLETE = IKEEXT_EM_SA_STATE.COMPLETE; pub const IKEEXT_EM_SA_STATE_MAX = IKEEXT_EM_SA_STATE.MAX; pub const IKEEXT_SA_ROLE = enum(i32) { INITIATOR = 0, RESPONDER = 1, MAX = 2, }; pub const IKEEXT_SA_ROLE_INITIATOR = IKEEXT_SA_ROLE.INITIATOR; pub const IKEEXT_SA_ROLE_RESPONDER = IKEEXT_SA_ROLE.RESPONDER; pub const IKEEXT_SA_ROLE_MAX = IKEEXT_SA_ROLE.MAX; pub const IPSEC_SA_LIFETIME0 = extern struct { lifetimeSeconds: u32, lifetimeKilobytes: u32, lifetimePackets: u32, }; pub const IPSEC_TRANSFORM_TYPE = enum(i32) { AH = 1, ESP_AUTH = 2, ESP_CIPHER = 3, ESP_AUTH_AND_CIPHER = 4, ESP_AUTH_FW = 5, TYPE_MAX = 6, }; pub const IPSEC_TRANSFORM_AH = IPSEC_TRANSFORM_TYPE.AH; pub const IPSEC_TRANSFORM_ESP_AUTH = IPSEC_TRANSFORM_TYPE.ESP_AUTH; pub const IPSEC_TRANSFORM_ESP_CIPHER = IPSEC_TRANSFORM_TYPE.ESP_CIPHER; pub const IPSEC_TRANSFORM_ESP_AUTH_AND_CIPHER = IPSEC_TRANSFORM_TYPE.ESP_AUTH_AND_CIPHER; pub const IPSEC_TRANSFORM_ESP_AUTH_FW = IPSEC_TRANSFORM_TYPE.ESP_AUTH_FW; pub const IPSEC_TRANSFORM_TYPE_MAX = IPSEC_TRANSFORM_TYPE.TYPE_MAX; pub const IPSEC_AUTH_TYPE = enum(i32) { MD5 = 0, SHA_1 = 1, SHA_256 = 2, AES_128 = 3, AES_192 = 4, AES_256 = 5, MAX = 6, }; pub const IPSEC_AUTH_MD5 = IPSEC_AUTH_TYPE.MD5; pub const IPSEC_AUTH_SHA_1 = IPSEC_AUTH_TYPE.SHA_1; pub const IPSEC_AUTH_SHA_256 = IPSEC_AUTH_TYPE.SHA_256; pub const IPSEC_AUTH_AES_128 = IPSEC_AUTH_TYPE.AES_128; pub const IPSEC_AUTH_AES_192 = IPSEC_AUTH_TYPE.AES_192; pub const IPSEC_AUTH_AES_256 = IPSEC_AUTH_TYPE.AES_256; pub const IPSEC_AUTH_MAX = IPSEC_AUTH_TYPE.MAX; pub const IPSEC_AUTH_TRANSFORM_ID0 = extern struct { authType: IPSEC_AUTH_TYPE, authConfig: u8, }; pub const IPSEC_AUTH_TRANSFORM0 = extern struct { authTransformId: IPSEC_AUTH_TRANSFORM_ID0, cryptoModuleId: ?*Guid, }; pub const IPSEC_CIPHER_TYPE = enum(i32) { DES = 1, @"3DES" = 2, AES_128 = 3, AES_192 = 4, AES_256 = 5, MAX = 6, }; pub const IPSEC_CIPHER_TYPE_DES = IPSEC_CIPHER_TYPE.DES; pub const IPSEC_CIPHER_TYPE_3DES = IPSEC_CIPHER_TYPE.@"3DES"; pub const IPSEC_CIPHER_TYPE_AES_128 = IPSEC_CIPHER_TYPE.AES_128; pub const IPSEC_CIPHER_TYPE_AES_192 = IPSEC_CIPHER_TYPE.AES_192; pub const IPSEC_CIPHER_TYPE_AES_256 = IPSEC_CIPHER_TYPE.AES_256; pub const IPSEC_CIPHER_TYPE_MAX = IPSEC_CIPHER_TYPE.MAX; pub const IPSEC_CIPHER_TRANSFORM_ID0 = extern struct { cipherType: IPSEC_CIPHER_TYPE, cipherConfig: u8, }; pub const IPSEC_CIPHER_TRANSFORM0 = extern struct { cipherTransformId: IPSEC_CIPHER_TRANSFORM_ID0, cryptoModuleId: ?*Guid, }; pub const IPSEC_AUTH_AND_CIPHER_TRANSFORM0 = extern struct { authTransform: IPSEC_AUTH_TRANSFORM0, cipherTransform: IPSEC_CIPHER_TRANSFORM0, }; pub const IPSEC_SA_TRANSFORM0 = extern struct { ipsecTransformType: IPSEC_TRANSFORM_TYPE, Anonymous: extern union { ahTransform: ?*IPSEC_AUTH_TRANSFORM0, espAuthTransform: ?*IPSEC_AUTH_TRANSFORM0, espCipherTransform: ?*IPSEC_CIPHER_TRANSFORM0, espAuthAndCipherTransform: ?*IPSEC_AUTH_AND_CIPHER_TRANSFORM0, espAuthFwTransform: ?*IPSEC_AUTH_TRANSFORM0, }, }; pub const IPSEC_PFS_GROUP = enum(i32) { NONE = 0, @"1" = 1, @"2" = 2, @"2048" = 3, // @"14" = 3, this enum value conflicts with @"2048" ECP_256 = 4, ECP_384 = 5, MM = 6, @"24" = 7, MAX = 8, }; pub const IPSEC_PFS_NONE = IPSEC_PFS_GROUP.NONE; pub const IPSEC_PFS_1 = IPSEC_PFS_GROUP.@"1"; pub const IPSEC_PFS_2 = IPSEC_PFS_GROUP.@"2"; pub const IPSEC_PFS_2048 = IPSEC_PFS_GROUP.@"2048"; pub const IPSEC_PFS_14 = IPSEC_PFS_GROUP.@"2048"; pub const IPSEC_PFS_ECP_256 = IPSEC_PFS_GROUP.ECP_256; pub const IPSEC_PFS_ECP_384 = IPSEC_PFS_GROUP.ECP_384; pub const IPSEC_PFS_MM = IPSEC_PFS_GROUP.MM; pub const IPSEC_PFS_24 = IPSEC_PFS_GROUP.@"24"; pub const IPSEC_PFS_MAX = IPSEC_PFS_GROUP.MAX; pub const IPSEC_PROPOSAL0 = extern struct { lifetime: IPSEC_SA_LIFETIME0, numSaTransforms: u32, saTransforms: ?*IPSEC_SA_TRANSFORM0, pfsGroup: IPSEC_PFS_GROUP, }; pub const IPSEC_SA_IDLE_TIMEOUT0 = extern struct { idleTimeoutSeconds: u32, idleTimeoutSecondsFailOver: u32, }; pub const IPSEC_TRAFFIC_SELECTOR0_ = extern struct { protocolId: u8, portStart: u16, portEnd: u16, ipVersion: FWP_IP_VERSION, Anonymous1: extern union { startV4Address: u32, startV6Address: [16]u8, }, Anonymous2: extern union { endV4Address: u32, endV6Address: [16]u8, }, }; pub const IPSEC_TRAFFIC_SELECTOR_POLICY0_ = extern struct { flags: u32, numLocalTrafficSelectors: u32, localTrafficSelectors: ?*IPSEC_TRAFFIC_SELECTOR0_, numRemoteTrafficSelectors: u32, remoteTrafficSelectors: ?*IPSEC_TRAFFIC_SELECTOR0_, }; pub const IPSEC_TRANSPORT_POLICY0 = extern struct { numIpsecProposals: u32, ipsecProposals: ?*IPSEC_PROPOSAL0, flags: IPSEC_POLICY_FLAG, ndAllowClearTimeoutSeconds: u32, saIdleTimeout: IPSEC_SA_IDLE_TIMEOUT0, emPolicy: ?*IKEEXT_EM_POLICY0, }; pub const IPSEC_TRANSPORT_POLICY1 = extern struct { numIpsecProposals: u32, ipsecProposals: ?*IPSEC_PROPOSAL0, flags: IPSEC_POLICY_FLAG, ndAllowClearTimeoutSeconds: u32, saIdleTimeout: IPSEC_SA_IDLE_TIMEOUT0, emPolicy: ?*IKEEXT_EM_POLICY1, }; pub const IPSEC_TRANSPORT_POLICY2 = extern struct { numIpsecProposals: u32, ipsecProposals: ?*IPSEC_PROPOSAL0, flags: IPSEC_POLICY_FLAG, ndAllowClearTimeoutSeconds: u32, saIdleTimeout: IPSEC_SA_IDLE_TIMEOUT0, emPolicy: ?*IKEEXT_EM_POLICY2, }; pub const IPSEC_TUNNEL_ENDPOINTS0 = extern struct { ipVersion: FWP_IP_VERSION, Anonymous1: extern union { localV4Address: u32, localV6Address: [16]u8, }, Anonymous2: extern union { remoteV4Address: u32, remoteV6Address: [16]u8, }, }; pub const IPSEC_TUNNEL_ENDPOINT0 = extern struct { ipVersion: FWP_IP_VERSION, Anonymous: extern union { v4Address: u32, v6Address: [16]u8, }, }; pub const IPSEC_TUNNEL_ENDPOINTS2 = extern struct { ipVersion: FWP_IP_VERSION, Anonymous1: extern union { localV4Address: u32, localV6Address: [16]u8, }, Anonymous2: extern union { remoteV4Address: u32, remoteV6Address: [16]u8, }, localIfLuid: u64, remoteFqdn: ?PWSTR, numAddresses: u32, remoteAddresses: ?*IPSEC_TUNNEL_ENDPOINT0, }; pub const IPSEC_TUNNEL_ENDPOINTS1 = extern struct { ipVersion: FWP_IP_VERSION, Anonymous1: extern union { localV4Address: u32, localV6Address: [16]u8, }, Anonymous2: extern union { remoteV4Address: u32, remoteV6Address: [16]u8, }, localIfLuid: u64, }; pub const IPSEC_TUNNEL_POLICY0 = extern struct { flags: IPSEC_POLICY_FLAG, numIpsecProposals: u32, ipsecProposals: ?*IPSEC_PROPOSAL0, tunnelEndpoints: IPSEC_TUNNEL_ENDPOINTS0, saIdleTimeout: IPSEC_SA_IDLE_TIMEOUT0, emPolicy: ?*IKEEXT_EM_POLICY0, }; pub const IPSEC_TUNNEL_POLICY1 = extern struct { flags: IPSEC_POLICY_FLAG, numIpsecProposals: u32, ipsecProposals: ?*IPSEC_PROPOSAL0, tunnelEndpoints: IPSEC_TUNNEL_ENDPOINTS1, saIdleTimeout: IPSEC_SA_IDLE_TIMEOUT0, emPolicy: ?*IKEEXT_EM_POLICY1, }; pub const IPSEC_TUNNEL_POLICY2 = extern struct { flags: IPSEC_POLICY_FLAG, numIpsecProposals: u32, ipsecProposals: ?*IPSEC_PROPOSAL0, tunnelEndpoints: IPSEC_TUNNEL_ENDPOINTS2, saIdleTimeout: IPSEC_SA_IDLE_TIMEOUT0, emPolicy: ?*IKEEXT_EM_POLICY2, fwdPathSaLifetime: u32, }; pub const IPSEC_TUNNEL_POLICY3_ = extern struct { flags: u32, numIpsecProposals: u32, ipsecProposals: ?*IPSEC_PROPOSAL0, tunnelEndpoints: IPSEC_TUNNEL_ENDPOINTS2, saIdleTimeout: IPSEC_SA_IDLE_TIMEOUT0, emPolicy: ?*IKEEXT_EM_POLICY2, fwdPathSaLifetime: u32, compartmentId: u32, numTrafficSelectorPolicy: u32, trafficSelectorPolicies: ?*IPSEC_TRAFFIC_SELECTOR_POLICY0_, }; pub const IPSEC_KEYING_POLICY0 = extern struct { numKeyMods: u32, keyModKeys: ?*Guid, }; pub const IPSEC_KEYING_POLICY1 = extern struct { numKeyMods: u32, keyModKeys: ?*Guid, flags: u32, }; pub const IPSEC_AGGREGATE_SA_STATISTICS0 = extern struct { activeSas: u32, pendingSaNegotiations: u32, totalSasAdded: u32, totalSasDeleted: u32, successfulRekeys: u32, activeTunnels: u32, offloadedSas: u32, }; pub const IPSEC_ESP_DROP_PACKET_STATISTICS0 = extern struct { invalidSpisOnInbound: u32, decryptionFailuresOnInbound: u32, authenticationFailuresOnInbound: u32, replayCheckFailuresOnInbound: u32, saNotInitializedOnInbound: u32, }; pub const IPSEC_AH_DROP_PACKET_STATISTICS0 = extern struct { invalidSpisOnInbound: u32, authenticationFailuresOnInbound: u32, replayCheckFailuresOnInbound: u32, saNotInitializedOnInbound: u32, }; pub const IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0 = extern struct { invalidSpisOnInbound: u32, decryptionFailuresOnInbound: u32, authenticationFailuresOnInbound: u32, udpEspValidationFailuresOnInbound: u32, replayCheckFailuresOnInbound: u32, invalidClearTextInbound: u32, saNotInitializedOnInbound: u32, receiveOverIncorrectSaInbound: u32, secureReceivesNotMatchingFilters: u32, }; pub const IPSEC_AGGREGATE_DROP_PACKET_STATISTICS1 = extern struct { invalidSpisOnInbound: u32, decryptionFailuresOnInbound: u32, authenticationFailuresOnInbound: u32, udpEspValidationFailuresOnInbound: u32, replayCheckFailuresOnInbound: u32, invalidClearTextInbound: u32, saNotInitializedOnInbound: u32, receiveOverIncorrectSaInbound: u32, secureReceivesNotMatchingFilters: u32, totalDropPacketsInbound: u32, }; pub const IPSEC_TRAFFIC_STATISTICS0 = extern struct { encryptedByteCount: u64, authenticatedAHByteCount: u64, authenticatedESPByteCount: u64, transportByteCount: u64, tunnelByteCount: u64, offloadByteCount: u64, }; pub const IPSEC_TRAFFIC_STATISTICS1 = extern struct { encryptedByteCount: u64, authenticatedAHByteCount: u64, authenticatedESPByteCount: u64, transportByteCount: u64, tunnelByteCount: u64, offloadByteCount: u64, totalSuccessfulPackets: u64, }; pub const IPSEC_STATISTICS0 = extern struct { aggregateSaStatistics: IPSEC_AGGREGATE_SA_STATISTICS0, espDropPacketStatistics: IPSEC_ESP_DROP_PACKET_STATISTICS0, ahDropPacketStatistics: IPSEC_AH_DROP_PACKET_STATISTICS0, aggregateDropPacketStatistics: IPSEC_AGGREGATE_DROP_PACKET_STATISTICS0, inboundTrafficStatistics: IPSEC_TRAFFIC_STATISTICS0, outboundTrafficStatistics: IPSEC_TRAFFIC_STATISTICS0, }; pub const IPSEC_STATISTICS1 = extern struct { aggregateSaStatistics: IPSEC_AGGREGATE_SA_STATISTICS0, espDropPacketStatistics: IPSEC_ESP_DROP_PACKET_STATISTICS0, ahDropPacketStatistics: IPSEC_AH_DROP_PACKET_STATISTICS0, aggregateDropPacketStatistics: IPSEC_AGGREGATE_DROP_PACKET_STATISTICS1, inboundTrafficStatistics: IPSEC_TRAFFIC_STATISTICS1, outboundTrafficStatistics: IPSEC_TRAFFIC_STATISTICS1, }; pub const IPSEC_SA_AUTH_INFORMATION0 = extern struct { authTransform: IPSEC_AUTH_TRANSFORM0, authKey: FWP_BYTE_BLOB, }; pub const IPSEC_SA_CIPHER_INFORMATION0 = extern struct { cipherTransform: IPSEC_CIPHER_TRANSFORM0, cipherKey: FWP_BYTE_BLOB, }; pub const IPSEC_SA_AUTH_AND_CIPHER_INFORMATION0 = extern struct { saCipherInformation: IPSEC_SA_CIPHER_INFORMATION0, saAuthInformation: IPSEC_SA_AUTH_INFORMATION0, }; pub const IPSEC_SA0 = extern struct { spi: u32, saTransformType: IPSEC_TRANSFORM_TYPE, Anonymous: extern union { ahInformation: ?*IPSEC_SA_AUTH_INFORMATION0, espAuthInformation: ?*IPSEC_SA_AUTH_INFORMATION0, espCipherInformation: ?*IPSEC_SA_CIPHER_INFORMATION0, espAuthAndCipherInformation: ?*IPSEC_SA_AUTH_AND_CIPHER_INFORMATION0, espAuthFwInformation: ?*IPSEC_SA_AUTH_INFORMATION0, }, }; pub const IPSEC_KEYMODULE_STATE0 = extern struct { keyModuleKey: Guid, stateBlob: FWP_BYTE_BLOB, }; pub const IPSEC_TOKEN_TYPE = enum(i32) { MACHINE = 0, IMPERSONATION = 1, MAX = 2, }; pub const IPSEC_TOKEN_TYPE_MACHINE = IPSEC_TOKEN_TYPE.MACHINE; pub const IPSEC_TOKEN_TYPE_IMPERSONATION = IPSEC_TOKEN_TYPE.IMPERSONATION; pub const IPSEC_TOKEN_TYPE_MAX = IPSEC_TOKEN_TYPE.MAX; pub const IPSEC_TOKEN_PRINCIPAL = enum(i32) { LOCAL = 0, PEER = 1, MAX = 2, }; pub const IPSEC_TOKEN_PRINCIPAL_LOCAL = IPSEC_TOKEN_PRINCIPAL.LOCAL; pub const IPSEC_TOKEN_PRINCIPAL_PEER = IPSEC_TOKEN_PRINCIPAL.PEER; pub const IPSEC_TOKEN_PRINCIPAL_MAX = IPSEC_TOKEN_PRINCIPAL.MAX; pub const IPSEC_TOKEN_MODE = enum(i32) { MAIN = 0, EXTENDED = 1, MAX = 2, }; pub const IPSEC_TOKEN_MODE_MAIN = IPSEC_TOKEN_MODE.MAIN; pub const IPSEC_TOKEN_MODE_EXTENDED = IPSEC_TOKEN_MODE.EXTENDED; pub const IPSEC_TOKEN_MODE_MAX = IPSEC_TOKEN_MODE.MAX; pub const IPSEC_TOKEN0 = extern struct { type: IPSEC_TOKEN_TYPE, principal: IPSEC_TOKEN_PRINCIPAL, mode: IPSEC_TOKEN_MODE, token: u64, }; pub const IPSEC_ID0 = extern struct { mmTargetName: ?PWSTR, emTargetName: ?PWSTR, numTokens: u32, tokens: ?*IPSEC_TOKEN0, explicitCredentials: u64, logonId: u64, }; pub const IPSEC_SA_BUNDLE0 = extern struct { flags: IPSEC_SA_BUNDLE_FLAGS, lifetime: IPSEC_SA_LIFETIME0, idleTimeoutSeconds: u32, ndAllowClearTimeoutSeconds: u32, ipsecId: ?*IPSEC_ID0, napContext: u32, qmSaId: u32, numSAs: u32, saList: ?*IPSEC_SA0, keyModuleState: ?*IPSEC_KEYMODULE_STATE0, ipVersion: FWP_IP_VERSION, Anonymous: extern union { peerV4PrivateAddress: u32, }, mmSaId: u64, pfsGroup: IPSEC_PFS_GROUP, }; pub const IPSEC_SA_BUNDLE1 = extern struct { flags: IPSEC_SA_BUNDLE_FLAGS, lifetime: IPSEC_SA_LIFETIME0, idleTimeoutSeconds: u32, ndAllowClearTimeoutSeconds: u32, ipsecId: ?*IPSEC_ID0, napContext: u32, qmSaId: u32, numSAs: u32, saList: ?*IPSEC_SA0, keyModuleState: ?*IPSEC_KEYMODULE_STATE0, ipVersion: FWP_IP_VERSION, Anonymous: extern union { peerV4PrivateAddress: u32, }, mmSaId: u64, pfsGroup: IPSEC_PFS_GROUP, saLookupContext: Guid, qmFilterId: u64, }; pub const IPSEC_TRAFFIC_TYPE = enum(i32) { TRANSPORT = 0, TUNNEL = 1, MAX = 2, }; pub const IPSEC_TRAFFIC_TYPE_TRANSPORT = IPSEC_TRAFFIC_TYPE.TRANSPORT; pub const IPSEC_TRAFFIC_TYPE_TUNNEL = IPSEC_TRAFFIC_TYPE.TUNNEL; pub const IPSEC_TRAFFIC_TYPE_MAX = IPSEC_TRAFFIC_TYPE.MAX; pub const IPSEC_TRAFFIC0 = extern struct { ipVersion: FWP_IP_VERSION, Anonymous1: extern union { localV4Address: u32, localV6Address: [16]u8, }, Anonymous2: extern union { remoteV4Address: u32, remoteV6Address: [16]u8, }, trafficType: IPSEC_TRAFFIC_TYPE, Anonymous3: extern union { ipsecFilterId: u64, tunnelPolicyId: u64, }, remotePort: u16, }; pub const IPSEC_TRAFFIC1 = extern struct { ipVersion: FWP_IP_VERSION, Anonymous1: extern union { localV4Address: u32, localV6Address: [16]u8, }, Anonymous2: extern union { remoteV4Address: u32, remoteV6Address: [16]u8, }, trafficType: IPSEC_TRAFFIC_TYPE, Anonymous3: extern union { ipsecFilterId: u64, tunnelPolicyId: u64, }, remotePort: u16, localPort: u16, ipProtocol: u8, localIfLuid: u64, realIfProfileId: u32, }; pub const IPSEC_V4_UDP_ENCAPSULATION0 = extern struct { localUdpEncapPort: u16, remoteUdpEncapPort: u16, }; pub const IPSEC_GETSPI0 = extern struct { inboundIpsecTraffic: IPSEC_TRAFFIC0, ipVersion: FWP_IP_VERSION, Anonymous: extern union { inboundUdpEncapsulation: ?*IPSEC_V4_UDP_ENCAPSULATION0, }, rngCryptoModuleID: ?*Guid, }; pub const IPSEC_GETSPI1 = extern struct { inboundIpsecTraffic: IPSEC_TRAFFIC1, ipVersion: FWP_IP_VERSION, Anonymous: extern union { inboundUdpEncapsulation: ?*IPSEC_V4_UDP_ENCAPSULATION0, }, rngCryptoModuleID: ?*Guid, }; pub const IPSEC_SA_DETAILS0 = extern struct { ipVersion: FWP_IP_VERSION, saDirection: FWP_DIRECTION, traffic: IPSEC_TRAFFIC0, saBundle: IPSEC_SA_BUNDLE0, Anonymous: extern union { udpEncapsulation: ?*IPSEC_V4_UDP_ENCAPSULATION0, }, transportFilter: ?*FWPM_FILTER0, }; pub const IPSEC_SA_DETAILS1 = extern struct { ipVersion: FWP_IP_VERSION, saDirection: FWP_DIRECTION, traffic: IPSEC_TRAFFIC1, saBundle: IPSEC_SA_BUNDLE1, Anonymous: extern union { udpEncapsulation: ?*IPSEC_V4_UDP_ENCAPSULATION0, }, transportFilter: ?*FWPM_FILTER0, virtualIfTunnelInfo: IPSEC_VIRTUAL_IF_TUNNEL_INFO0, }; pub const IPSEC_SA_CONTEXT0 = extern struct { saContextId: u64, inboundSa: ?*IPSEC_SA_DETAILS0, outboundSa: ?*IPSEC_SA_DETAILS0, }; pub const IPSEC_SA_CONTEXT1 = extern struct { saContextId: u64, inboundSa: ?*IPSEC_SA_DETAILS1, outboundSa: ?*IPSEC_SA_DETAILS1, }; pub const IPSEC_SA_CONTEXT_ENUM_TEMPLATE0 = extern struct { localSubNet: FWP_CONDITION_VALUE0, remoteSubNet: FWP_CONDITION_VALUE0, }; pub const IPSEC_SA_ENUM_TEMPLATE0 = extern struct { saDirection: FWP_DIRECTION, }; pub const IPSEC_SA_CONTEXT_SUBSCRIPTION0 = extern struct { enumTemplate: ?*IPSEC_SA_CONTEXT_ENUM_TEMPLATE0, flags: u32, sessionKey: Guid, }; pub const IPSEC_SA_CONTEXT_EVENT_TYPE0 = enum(i32) { ADD = 1, DELETE = 2, MAX = 3, }; pub const IPSEC_SA_CONTEXT_EVENT_ADD = IPSEC_SA_CONTEXT_EVENT_TYPE0.ADD; pub const IPSEC_SA_CONTEXT_EVENT_DELETE = IPSEC_SA_CONTEXT_EVENT_TYPE0.DELETE; pub const IPSEC_SA_CONTEXT_EVENT_MAX = IPSEC_SA_CONTEXT_EVENT_TYPE0.MAX; pub const IPSEC_SA_CONTEXT_CHANGE0 = extern struct { changeType: IPSEC_SA_CONTEXT_EVENT_TYPE0, saContextId: u64, }; pub const IPSEC_FAILURE_POINT = enum(i32) { NONE = 0, ME = 1, PEER = 2, POINT_MAX = 3, }; pub const IPSEC_FAILURE_NONE = IPSEC_FAILURE_POINT.NONE; pub const IPSEC_FAILURE_ME = IPSEC_FAILURE_POINT.ME; pub const IPSEC_FAILURE_PEER = IPSEC_FAILURE_POINT.PEER; pub const IPSEC_FAILURE_POINT_MAX = IPSEC_FAILURE_POINT.POINT_MAX; pub const IPSEC_ADDRESS_INFO0 = extern struct { numV4Addresses: u32, v4Addresses: ?*u32, numV6Addresses: u32, v6Addresses: ?*FWP_BYTE_ARRAY16, }; pub const IPSEC_DOSP_OPTIONS0 = extern struct { stateIdleTimeoutSeconds: u32, perIPRateLimitQueueIdleTimeoutSeconds: u32, ipV6IPsecUnauthDscp: u8, ipV6IPsecUnauthRateLimitBytesPerSec: u32, ipV6IPsecUnauthPerIPRateLimitBytesPerSec: u32, ipV6IPsecAuthDscp: u8, ipV6IPsecAuthRateLimitBytesPerSec: u32, icmpV6Dscp: u8, icmpV6RateLimitBytesPerSec: u32, ipV6FilterExemptDscp: u8, ipV6FilterExemptRateLimitBytesPerSec: u32, defBlockExemptDscp: u8, defBlockExemptRateLimitBytesPerSec: u32, maxStateEntries: u32, maxPerIPRateLimitQueues: u32, flags: IPSEC_DOSP_FLAGS, numPublicIFLuids: u32, publicIFLuids: ?*u64, numInternalIFLuids: u32, internalIFLuids: ?*u64, publicV6AddrMask: FWP_V6_ADDR_AND_MASK, internalV6AddrMask: FWP_V6_ADDR_AND_MASK, }; pub const IPSEC_DOSP_STATISTICS0 = extern struct { totalStateEntriesCreated: u64, currentStateEntries: u64, totalInboundAllowedIPv6IPsecUnauthPkts: u64, totalInboundRatelimitDiscardedIPv6IPsecUnauthPkts: u64, totalInboundPerIPRatelimitDiscardedIPv6IPsecUnauthPkts: u64, totalInboundOtherDiscardedIPv6IPsecUnauthPkts: u64, totalInboundAllowedIPv6IPsecAuthPkts: u64, totalInboundRatelimitDiscardedIPv6IPsecAuthPkts: u64, totalInboundOtherDiscardedIPv6IPsecAuthPkts: u64, totalInboundAllowedICMPv6Pkts: u64, totalInboundRatelimitDiscardedICMPv6Pkts: u64, totalInboundAllowedIPv6FilterExemptPkts: u64, totalInboundRatelimitDiscardedIPv6FilterExemptPkts: u64, totalInboundDiscardedIPv6FilterBlockPkts: u64, totalInboundAllowedDefBlockExemptPkts: u64, totalInboundRatelimitDiscardedDefBlockExemptPkts: u64, totalInboundDiscardedDefBlockPkts: u64, currentInboundIPv6IPsecUnauthPerIPRateLimitQueues: u64, }; pub const IPSEC_DOSP_STATE0 = extern struct { publicHostV6Addr: [16]u8, internalHostV6Addr: [16]u8, totalInboundIPv6IPsecAuthPackets: u64, totalOutboundIPv6IPsecAuthPackets: u64, durationSecs: u32, }; pub const IPSEC_DOSP_STATE_ENUM_TEMPLATE0 = extern struct { publicV6AddrMask: FWP_V6_ADDR_AND_MASK, internalV6AddrMask: FWP_V6_ADDR_AND_MASK, }; pub const IPSEC_KEY_MANAGER0 = extern struct { keyManagerKey: Guid, displayData: FWPM_DISPLAY_DATA0, flags: u32, keyDictationTimeoutHint: u8, }; pub const DL_ADDRESS_TYPE = enum(i32) { Unicast = 0, Multicast = 1, Broadcast = 2, }; pub const DlUnicast = DL_ADDRESS_TYPE.Unicast; pub const DlMulticast = DL_ADDRESS_TYPE.Multicast; pub const DlBroadcast = DL_ADDRESS_TYPE.Broadcast; pub const FWPM_CHANGE_TYPE = enum(i32) { ADD = 1, DELETE = 2, TYPE_MAX = 3, }; pub const FWPM_CHANGE_ADD = FWPM_CHANGE_TYPE.ADD; pub const FWPM_CHANGE_DELETE = FWPM_CHANGE_TYPE.DELETE; pub const FWPM_CHANGE_TYPE_MAX = FWPM_CHANGE_TYPE.TYPE_MAX; pub const FWPM_SERVICE_STATE = enum(i32) { STOPPED = 0, START_PENDING = 1, STOP_PENDING = 2, RUNNING = 3, STATE_MAX = 4, }; pub const FWPM_SERVICE_STOPPED = FWPM_SERVICE_STATE.STOPPED; pub const FWPM_SERVICE_START_PENDING = FWPM_SERVICE_STATE.START_PENDING; pub const FWPM_SERVICE_STOP_PENDING = FWPM_SERVICE_STATE.STOP_PENDING; pub const FWPM_SERVICE_RUNNING = FWPM_SERVICE_STATE.RUNNING; pub const FWPM_SERVICE_STATE_MAX = FWPM_SERVICE_STATE.STATE_MAX; pub const FWPM_ENGINE_OPTION = enum(i32) { COLLECT_NET_EVENTS = 0, NET_EVENT_MATCH_ANY_KEYWORDS = 1, NAME_CACHE = 2, MONITOR_IPSEC_CONNECTIONS = 3, PACKET_QUEUING = 4, TXN_WATCHDOG_TIMEOUT_IN_MSEC = 5, OPTION_MAX = 6, }; pub const FWPM_ENGINE_COLLECT_NET_EVENTS = FWPM_ENGINE_OPTION.COLLECT_NET_EVENTS; pub const FWPM_ENGINE_NET_EVENT_MATCH_ANY_KEYWORDS = FWPM_ENGINE_OPTION.NET_EVENT_MATCH_ANY_KEYWORDS; pub const FWPM_ENGINE_NAME_CACHE = FWPM_ENGINE_OPTION.NAME_CACHE; pub const FWPM_ENGINE_MONITOR_IPSEC_CONNECTIONS = FWPM_ENGINE_OPTION.MONITOR_IPSEC_CONNECTIONS; pub const FWPM_ENGINE_PACKET_QUEUING = FWPM_ENGINE_OPTION.PACKET_QUEUING; pub const FWPM_ENGINE_TXN_WATCHDOG_TIMEOUT_IN_MSEC = FWPM_ENGINE_OPTION.TXN_WATCHDOG_TIMEOUT_IN_MSEC; pub const FWPM_ENGINE_OPTION_MAX = FWPM_ENGINE_OPTION.OPTION_MAX; pub const FWPM_SESSION0 = extern struct { sessionKey: Guid, displayData: FWPM_DISPLAY_DATA0, flags: u32, txnWaitTimeoutInMSec: u32, processId: u32, sid: ?*SID, username: ?PWSTR, kernelMode: BOOL, }; pub const FWPM_SESSION_ENUM_TEMPLATE0 = extern struct { reserved: u64, }; pub const FWPM_PROVIDER0 = extern struct { providerKey: Guid, displayData: FWPM_DISPLAY_DATA0, flags: u32, providerData: FWP_BYTE_BLOB, serviceName: ?PWSTR, }; pub const FWPM_PROVIDER_ENUM_TEMPLATE0 = extern struct { reserved: u64, }; pub const FWPM_PROVIDER_CHANGE0 = extern struct { changeType: FWPM_CHANGE_TYPE, providerKey: Guid, }; pub const FWPM_PROVIDER_SUBSCRIPTION0 = extern struct { enumTemplate: ?*FWPM_PROVIDER_ENUM_TEMPLATE0, flags: u32, sessionKey: Guid, }; pub const FWPM_CLASSIFY_OPTION0 = extern struct { type: FWP_CLASSIFY_OPTION_TYPE, value: FWP_VALUE0, }; pub const FWPM_CLASSIFY_OPTIONS0 = extern struct { numOptions: u32, options: ?*FWPM_CLASSIFY_OPTION0, }; pub const FWPM_PROVIDER_CONTEXT_TYPE = enum(i32) { IPSEC_KEYING_CONTEXT = 0, IPSEC_IKE_QM_TRANSPORT_CONTEXT = 1, IPSEC_IKE_QM_TUNNEL_CONTEXT = 2, IPSEC_AUTHIP_QM_TRANSPORT_CONTEXT = 3, IPSEC_AUTHIP_QM_TUNNEL_CONTEXT = 4, IPSEC_IKE_MM_CONTEXT = 5, IPSEC_AUTHIP_MM_CONTEXT = 6, CLASSIFY_OPTIONS_CONTEXT = 7, GENERAL_CONTEXT = 8, IPSEC_IKEV2_QM_TUNNEL_CONTEXT = 9, IPSEC_IKEV2_MM_CONTEXT = 10, IPSEC_DOSP_CONTEXT = 11, IPSEC_IKEV2_QM_TRANSPORT_CONTEXT = 12, PROVIDER_CONTEXT_TYPE_MAX = 13, }; pub const FWPM_IPSEC_KEYING_CONTEXT = FWPM_PROVIDER_CONTEXT_TYPE.IPSEC_KEYING_CONTEXT; pub const FWPM_IPSEC_IKE_QM_TRANSPORT_CONTEXT = FWPM_PROVIDER_CONTEXT_TYPE.IPSEC_IKE_QM_TRANSPORT_CONTEXT; pub const FWPM_IPSEC_IKE_QM_TUNNEL_CONTEXT = FWPM_PROVIDER_CONTEXT_TYPE.IPSEC_IKE_QM_TUNNEL_CONTEXT; pub const FWPM_IPSEC_AUTHIP_QM_TRANSPORT_CONTEXT = FWPM_PROVIDER_CONTEXT_TYPE.IPSEC_AUTHIP_QM_TRANSPORT_CONTEXT; pub const FWPM_IPSEC_AUTHIP_QM_TUNNEL_CONTEXT = FWPM_PROVIDER_CONTEXT_TYPE.IPSEC_AUTHIP_QM_TUNNEL_CONTEXT; pub const FWPM_IPSEC_IKE_MM_CONTEXT = FWPM_PROVIDER_CONTEXT_TYPE.IPSEC_IKE_MM_CONTEXT; pub const FWPM_IPSEC_AUTHIP_MM_CONTEXT = FWPM_PROVIDER_CONTEXT_TYPE.IPSEC_AUTHIP_MM_CONTEXT; pub const FWPM_CLASSIFY_OPTIONS_CONTEXT = FWPM_PROVIDER_CONTEXT_TYPE.CLASSIFY_OPTIONS_CONTEXT; pub const FWPM_GENERAL_CONTEXT = FWPM_PROVIDER_CONTEXT_TYPE.GENERAL_CONTEXT; pub const FWPM_IPSEC_IKEV2_QM_TUNNEL_CONTEXT = FWPM_PROVIDER_CONTEXT_TYPE.IPSEC_IKEV2_QM_TUNNEL_CONTEXT; pub const FWPM_IPSEC_IKEV2_MM_CONTEXT = FWPM_PROVIDER_CONTEXT_TYPE.IPSEC_IKEV2_MM_CONTEXT; pub const FWPM_IPSEC_DOSP_CONTEXT = FWPM_PROVIDER_CONTEXT_TYPE.IPSEC_DOSP_CONTEXT; pub const FWPM_IPSEC_IKEV2_QM_TRANSPORT_CONTEXT = FWPM_PROVIDER_CONTEXT_TYPE.IPSEC_IKEV2_QM_TRANSPORT_CONTEXT; pub const FWPM_PROVIDER_CONTEXT_TYPE_MAX = FWPM_PROVIDER_CONTEXT_TYPE.PROVIDER_CONTEXT_TYPE_MAX; pub const FWPM_PROVIDER_CONTEXT0 = extern struct { providerContextKey: Guid, displayData: FWPM_DISPLAY_DATA0, flags: u32, providerKey: ?*Guid, providerData: FWP_BYTE_BLOB, type: FWPM_PROVIDER_CONTEXT_TYPE, Anonymous: extern union { keyingPolicy: ?*IPSEC_KEYING_POLICY0, ikeQmTransportPolicy: ?*IPSEC_TRANSPORT_POLICY0, ikeQmTunnelPolicy: ?*IPSEC_TUNNEL_POLICY0, authipQmTransportPolicy: ?*IPSEC_TRANSPORT_POLICY0, authipQmTunnelPolicy: ?*IPSEC_TUNNEL_POLICY0, ikeMmPolicy: ?*IKEEXT_POLICY0, authIpMmPolicy: ?*IKEEXT_POLICY0, dataBuffer: ?*FWP_BYTE_BLOB, classifyOptions: ?*FWPM_CLASSIFY_OPTIONS0, }, providerContextId: u64, }; pub const FWPM_PROVIDER_CONTEXT1 = extern struct { providerContextKey: Guid, displayData: FWPM_DISPLAY_DATA0, flags: u32, providerKey: ?*Guid, providerData: FWP_BYTE_BLOB, type: FWPM_PROVIDER_CONTEXT_TYPE, Anonymous: extern union { keyingPolicy: ?*IPSEC_KEYING_POLICY0, ikeQmTransportPolicy: ?*IPSEC_TRANSPORT_POLICY1, ikeQmTunnelPolicy: ?*IPSEC_TUNNEL_POLICY1, authipQmTransportPolicy: ?*IPSEC_TRANSPORT_POLICY1, authipQmTunnelPolicy: ?*IPSEC_TUNNEL_POLICY1, ikeMmPolicy: ?*IKEEXT_POLICY1, authIpMmPolicy: ?*IKEEXT_POLICY1, dataBuffer: ?*FWP_BYTE_BLOB, classifyOptions: ?*FWPM_CLASSIFY_OPTIONS0, ikeV2QmTunnelPolicy: ?*IPSEC_TUNNEL_POLICY1, ikeV2MmPolicy: ?*IKEEXT_POLICY1, idpOptions: ?*IPSEC_DOSP_OPTIONS0, }, providerContextId: u64, }; pub const FWPM_PROVIDER_CONTEXT2 = extern struct { providerContextKey: Guid, displayData: FWPM_DISPLAY_DATA0, flags: u32, providerKey: ?*Guid, providerData: FWP_BYTE_BLOB, type: FWPM_PROVIDER_CONTEXT_TYPE, Anonymous: extern union { keyingPolicy: ?*IPSEC_KEYING_POLICY1, ikeQmTransportPolicy: ?*IPSEC_TRANSPORT_POLICY2, ikeQmTunnelPolicy: ?*IPSEC_TUNNEL_POLICY2, authipQmTransportPolicy: ?*IPSEC_TRANSPORT_POLICY2, authipQmTunnelPolicy: ?*IPSEC_TUNNEL_POLICY2, ikeMmPolicy: ?*IKEEXT_POLICY2, authIpMmPolicy: ?*IKEEXT_POLICY2, dataBuffer: ?*FWP_BYTE_BLOB, classifyOptions: ?*FWPM_CLASSIFY_OPTIONS0, ikeV2QmTunnelPolicy: ?*IPSEC_TUNNEL_POLICY2, ikeV2QmTransportPolicy: ?*IPSEC_TRANSPORT_POLICY2, ikeV2MmPolicy: ?*IKEEXT_POLICY2, idpOptions: ?*IPSEC_DOSP_OPTIONS0, }, providerContextId: u64, }; pub const FWPM_PROVIDER_CONTEXT3_ = extern struct { providerContextKey: Guid, displayData: FWPM_DISPLAY_DATA0, flags: u32, providerKey: ?*Guid, providerData: FWP_BYTE_BLOB, type: FWPM_PROVIDER_CONTEXT_TYPE, Anonymous: extern union { keyingPolicy: ?*IPSEC_KEYING_POLICY1, ikeQmTransportPolicy: ?*IPSEC_TRANSPORT_POLICY2, ikeQmTunnelPolicy: ?*IPSEC_TUNNEL_POLICY3_, authipQmTransportPolicy: ?*IPSEC_TRANSPORT_POLICY2, authipQmTunnelPolicy: ?*IPSEC_TUNNEL_POLICY3_, ikeMmPolicy: ?*IKEEXT_POLICY2, authIpMmPolicy: ?*IKEEXT_POLICY2, dataBuffer: ?*FWP_BYTE_BLOB, classifyOptions: ?*FWPM_CLASSIFY_OPTIONS0, ikeV2QmTunnelPolicy: ?*IPSEC_TUNNEL_POLICY3_, ikeV2QmTransportPolicy: ?*IPSEC_TRANSPORT_POLICY2, ikeV2MmPolicy: ?*IKEEXT_POLICY2, idpOptions: ?*IPSEC_DOSP_OPTIONS0, }, providerContextId: u64, }; pub const FWPM_PROVIDER_CONTEXT_ENUM_TEMPLATE0 = extern struct { providerKey: ?*Guid, providerContextType: FWPM_PROVIDER_CONTEXT_TYPE, }; pub const FWPM_PROVIDER_CONTEXT_CHANGE0 = extern struct { changeType: FWPM_CHANGE_TYPE, providerContextKey: Guid, providerContextId: u64, }; pub const FWPM_PROVIDER_CONTEXT_SUBSCRIPTION0 = extern struct { enumTemplate: ?*FWPM_PROVIDER_CONTEXT_ENUM_TEMPLATE0, flags: FWPM_SUBSCRIPTION_FLAGS, sessionKey: Guid, }; pub const FWPM_SUBLAYER0 = extern struct { subLayerKey: Guid, displayData: FWPM_DISPLAY_DATA0, flags: u32, providerKey: ?*Guid, providerData: FWP_BYTE_BLOB, weight: u16, }; pub const FWPM_SUBLAYER_ENUM_TEMPLATE0 = extern struct { providerKey: ?*Guid, }; pub const FWPM_SUBLAYER_CHANGE0 = extern struct { changeType: FWPM_CHANGE_TYPE, subLayerKey: Guid, }; pub const FWPM_SUBLAYER_SUBSCRIPTION0 = extern struct { enumTemplate: ?*FWPM_SUBLAYER_ENUM_TEMPLATE0, flags: FWPM_SUBSCRIPTION_FLAGS, sessionKey: Guid, }; pub const FWPM_FIELD_TYPE = enum(i32) { RAW_DATA = 0, IP_ADDRESS = 1, FLAGS = 2, TYPE_MAX = 3, }; pub const FWPM_FIELD_RAW_DATA = FWPM_FIELD_TYPE.RAW_DATA; pub const FWPM_FIELD_IP_ADDRESS = FWPM_FIELD_TYPE.IP_ADDRESS; pub const FWPM_FIELD_FLAGS = FWPM_FIELD_TYPE.FLAGS; pub const FWPM_FIELD_TYPE_MAX = FWPM_FIELD_TYPE.TYPE_MAX; pub const FWPM_FIELD0 = extern struct { fieldKey: ?*Guid, type: FWPM_FIELD_TYPE, dataType: FWP_DATA_TYPE, }; pub const FWPM_LAYER0 = extern struct { layerKey: Guid, displayData: FWPM_DISPLAY_DATA0, flags: u32, numFields: u32, field: ?*FWPM_FIELD0, defaultSubLayerKey: Guid, layerId: u16, }; pub const FWPM_LAYER_ENUM_TEMPLATE0 = extern struct { reserved: u64, }; pub const FWPM_CALLOUT0 = extern struct { calloutKey: Guid, displayData: FWPM_DISPLAY_DATA0, flags: u32, providerKey: ?*Guid, providerData: FWP_BYTE_BLOB, applicableLayer: Guid, calloutId: u32, }; pub const FWPM_CALLOUT_ENUM_TEMPLATE0 = extern struct { providerKey: ?*Guid, layerKey: Guid, }; pub const FWPM_CALLOUT_CHANGE0 = extern struct { changeType: FWPM_CHANGE_TYPE, calloutKey: Guid, calloutId: u32, }; pub const FWPM_CALLOUT_SUBSCRIPTION0 = extern struct { enumTemplate: ?*FWPM_CALLOUT_ENUM_TEMPLATE0, flags: u32, sessionKey: Guid, }; pub const FWPM_ACTION0 = extern struct { type: u32, Anonymous: extern union { filterType: Guid, calloutKey: Guid, bitmapIndex: u8, }, }; pub const FWPM_FILTER_CONDITION0 = extern struct { fieldKey: Guid, matchType: FWP_MATCH_TYPE, conditionValue: FWP_CONDITION_VALUE0, }; pub const FWPM_FILTER0 = extern struct { filterKey: Guid, displayData: FWPM_DISPLAY_DATA0, flags: FWPM_FILTER_FLAGS, providerKey: ?*Guid, providerData: FWP_BYTE_BLOB, layerKey: Guid, subLayerKey: Guid, weight: FWP_VALUE0, numFilterConditions: u32, filterCondition: ?*FWPM_FILTER_CONDITION0, action: FWPM_ACTION0, Anonymous: extern union { rawContext: u64, providerContextKey: Guid, }, reserved: ?*Guid, filterId: u64, effectiveWeight: FWP_VALUE0, }; pub const FWPM_FILTER_ENUM_TEMPLATE0 = extern struct { providerKey: ?*Guid, layerKey: Guid, enumType: FWP_FILTER_ENUM_TYPE, flags: u32, providerContextTemplate: ?*FWPM_PROVIDER_CONTEXT_ENUM_TEMPLATE0, numFilterConditions: u32, filterCondition: ?*FWPM_FILTER_CONDITION0, actionMask: u32, calloutKey: ?*Guid, }; pub const FWPM_FILTER_CHANGE0 = extern struct { changeType: FWPM_CHANGE_TYPE, filterKey: Guid, filterId: u64, }; pub const FWPM_FILTER_SUBSCRIPTION0 = extern struct { enumTemplate: ?*FWPM_FILTER_ENUM_TEMPLATE0, flags: u32, sessionKey: Guid, }; pub const FWPM_LAYER_STATISTICS0 = extern struct { layerId: Guid, classifyPermitCount: u32, classifyBlockCount: u32, classifyVetoCount: u32, numCacheEntries: u32, }; pub const FWPM_STATISTICS0 = extern struct { numLayerStatistics: u32, layerStatistics: ?*FWPM_LAYER_STATISTICS0, inboundAllowedConnectionsV4: u32, inboundBlockedConnectionsV4: u32, outboundAllowedConnectionsV4: u32, outboundBlockedConnectionsV4: u32, inboundAllowedConnectionsV6: u32, inboundBlockedConnectionsV6: u32, outboundAllowedConnectionsV6: u32, outboundBlockedConnectionsV6: u32, inboundActiveConnectionsV4: u32, outboundActiveConnectionsV4: u32, inboundActiveConnectionsV6: u32, outboundActiveConnectionsV6: u32, reauthDirInbound: u64, reauthDirOutbound: u64, reauthFamilyV4: u64, reauthFamilyV6: u64, reauthProtoOther: u64, reauthProtoIPv4: u64, reauthProtoIPv6: u64, reauthProtoICMP: u64, reauthProtoICMP6: u64, reauthProtoUDP: u64, reauthProtoTCP: u64, reauthReasonPolicyChange: u64, reauthReasonNewArrivalInterface: u64, reauthReasonNewNextHopInterface: u64, reauthReasonProfileCrossing: u64, reauthReasonClassifyCompletion: u64, reauthReasonIPSecPropertiesChanged: u64, reauthReasonMidStreamInspection: u64, reauthReasonSocketPropertyChanged: u64, reauthReasonNewInboundMCastBCastPacket: u64, reauthReasonEDPPolicyChanged: u64, reauthReasonPreclassifyLocalAddrLayerChange: u64, reauthReasonPreclassifyRemoteAddrLayerChange: u64, reauthReasonPreclassifyLocalPortLayerChange: u64, reauthReasonPreclassifyRemotePortLayerChange: u64, reauthReasonProxyHandleChanged: u64, }; pub const FWPM_NET_EVENT_HEADER0 = extern struct { timeStamp: FILETIME, flags: u32, ipVersion: FWP_IP_VERSION, ipProtocol: u8, Anonymous1: extern union { localAddrV4: u32, localAddrV6: FWP_BYTE_ARRAY16, }, Anonymous2: extern union { remoteAddrV4: u32, remoteAddrV6: FWP_BYTE_ARRAY16, }, localPort: u16, remotePort: u16, scopeId: u32, appId: FWP_BYTE_BLOB, userId: ?*SID, }; pub const FWPM_NET_EVENT_HEADER1 = extern struct { timeStamp: FILETIME, flags: u32, ipVersion: FWP_IP_VERSION, ipProtocol: u8, Anonymous1: extern union { localAddrV4: u32, localAddrV6: FWP_BYTE_ARRAY16, }, Anonymous2: extern union { remoteAddrV4: u32, remoteAddrV6: FWP_BYTE_ARRAY16, }, localPort: u16, remotePort: u16, scopeId: u32, appId: FWP_BYTE_BLOB, userId: ?*SID, Anonymous3: extern union { Anonymous: extern struct { reserved1: FWP_AF, Anonymous: extern union { Anonymous: extern struct { reserved2: FWP_BYTE_ARRAY6, reserved3: FWP_BYTE_ARRAY6, reserved4: u32, reserved5: u32, reserved6: u16, reserved7: u32, reserved8: u32, reserved9: u16, reserved10: u64, }, }, }, }, }; pub const FWPM_NET_EVENT_HEADER2 = extern struct { timeStamp: FILETIME, flags: u32, ipVersion: FWP_IP_VERSION, ipProtocol: u8, Anonymous1: extern union { localAddrV4: u32, localAddrV6: FWP_BYTE_ARRAY16, }, Anonymous2: extern union { remoteAddrV4: u32, remoteAddrV6: FWP_BYTE_ARRAY16, }, localPort: u16, remotePort: u16, scopeId: u32, appId: FWP_BYTE_BLOB, userId: ?*SID, addressFamily: FWP_AF, packageSid: ?*SID, }; pub const FWPM_NET_EVENT_HEADER3 = extern struct { timeStamp: FILETIME, flags: u32, ipVersion: FWP_IP_VERSION, ipProtocol: u8, Anonymous1: extern union { localAddrV4: u32, localAddrV6: FWP_BYTE_ARRAY16, }, Anonymous2: extern union { remoteAddrV4: u32, remoteAddrV6: FWP_BYTE_ARRAY16, }, localPort: u16, remotePort: u16, scopeId: u32, appId: FWP_BYTE_BLOB, userId: ?*SID, addressFamily: FWP_AF, packageSid: ?*SID, enterpriseId: ?PWSTR, policyFlags: u64, effectiveName: FWP_BYTE_BLOB, }; pub const FWPM_NET_EVENT_TYPE = enum(i32) { IKEEXT_MM_FAILURE = 0, IKEEXT_QM_FAILURE = 1, IKEEXT_EM_FAILURE = 2, CLASSIFY_DROP = 3, IPSEC_KERNEL_DROP = 4, IPSEC_DOSP_DROP = 5, CLASSIFY_ALLOW = 6, CAPABILITY_DROP = 7, CAPABILITY_ALLOW = 8, CLASSIFY_DROP_MAC = 9, LPM_PACKET_ARRIVAL = 10, MAX = 11, }; pub const FWPM_NET_EVENT_TYPE_IKEEXT_MM_FAILURE = FWPM_NET_EVENT_TYPE.IKEEXT_MM_FAILURE; pub const FWPM_NET_EVENT_TYPE_IKEEXT_QM_FAILURE = FWPM_NET_EVENT_TYPE.IKEEXT_QM_FAILURE; pub const FWPM_NET_EVENT_TYPE_IKEEXT_EM_FAILURE = FWPM_NET_EVENT_TYPE.IKEEXT_EM_FAILURE; pub const FWPM_NET_EVENT_TYPE_CLASSIFY_DROP = FWPM_NET_EVENT_TYPE.CLASSIFY_DROP; pub const FWPM_NET_EVENT_TYPE_IPSEC_KERNEL_DROP = FWPM_NET_EVENT_TYPE.IPSEC_KERNEL_DROP; pub const FWPM_NET_EVENT_TYPE_IPSEC_DOSP_DROP = FWPM_NET_EVENT_TYPE.IPSEC_DOSP_DROP; pub const FWPM_NET_EVENT_TYPE_CLASSIFY_ALLOW = FWPM_NET_EVENT_TYPE.CLASSIFY_ALLOW; pub const FWPM_NET_EVENT_TYPE_CAPABILITY_DROP = FWPM_NET_EVENT_TYPE.CAPABILITY_DROP; pub const FWPM_NET_EVENT_TYPE_CAPABILITY_ALLOW = FWPM_NET_EVENT_TYPE.CAPABILITY_ALLOW; pub const FWPM_NET_EVENT_TYPE_CLASSIFY_DROP_MAC = FWPM_NET_EVENT_TYPE.CLASSIFY_DROP_MAC; pub const FWPM_NET_EVENT_TYPE_LPM_PACKET_ARRIVAL = FWPM_NET_EVENT_TYPE.LPM_PACKET_ARRIVAL; pub const FWPM_NET_EVENT_TYPE_MAX = FWPM_NET_EVENT_TYPE.MAX; pub const FWPM_NET_EVENT_IKEEXT_MM_FAILURE0 = extern struct { failureErrorCode: u32, failurePoint: IPSEC_FAILURE_POINT, flags: u32, keyingModuleType: IKEEXT_KEY_MODULE_TYPE, mmState: IKEEXT_MM_SA_STATE, saRole: IKEEXT_SA_ROLE, mmAuthMethod: IKEEXT_AUTHENTICATION_METHOD_TYPE, endCertHash: [20]u8, mmId: u64, mmFilterId: u64, }; pub const FWPM_NET_EVENT_IKEEXT_MM_FAILURE1 = extern struct { failureErrorCode: u32, failurePoint: IPSEC_FAILURE_POINT, flags: u32, keyingModuleType: IKEEXT_KEY_MODULE_TYPE, mmState: IKEEXT_MM_SA_STATE, saRole: IKEEXT_SA_ROLE, mmAuthMethod: IKEEXT_AUTHENTICATION_METHOD_TYPE, endCertHash: [20]u8, mmId: u64, mmFilterId: u64, localPrincipalNameForAuth: ?PWSTR, remotePrincipalNameForAuth: ?PWSTR, numLocalPrincipalGroupSids: u32, localPrincipalGroupSids: ?*?PWSTR, numRemotePrincipalGroupSids: u32, remotePrincipalGroupSids: ?*?PWSTR, }; pub const FWPM_NET_EVENT_IKEEXT_MM_FAILURE2_ = extern struct { failureErrorCode: u32, failurePoint: IPSEC_FAILURE_POINT, flags: u32, keyingModuleType: IKEEXT_KEY_MODULE_TYPE, mmState: IKEEXT_MM_SA_STATE, saRole: IKEEXT_SA_ROLE, mmAuthMethod: IKEEXT_AUTHENTICATION_METHOD_TYPE, endCertHash: [20]u8, mmId: u64, mmFilterId: u64, localPrincipalNameForAuth: ?PWSTR, remotePrincipalNameForAuth: ?PWSTR, numLocalPrincipalGroupSids: u32, localPrincipalGroupSids: ?*?PWSTR, numRemotePrincipalGroupSids: u32, remotePrincipalGroupSids: ?*?PWSTR, providerContextKey: ?*Guid, }; pub const FWPM_NET_EVENT_IKEEXT_QM_FAILURE0 = extern struct { failureErrorCode: u32, failurePoint: IPSEC_FAILURE_POINT, keyingModuleType: IKEEXT_KEY_MODULE_TYPE, qmState: IKEEXT_QM_SA_STATE, saRole: IKEEXT_SA_ROLE, saTrafficType: IPSEC_TRAFFIC_TYPE, Anonymous1: extern union { localSubNet: FWP_CONDITION_VALUE0, }, Anonymous2: extern union { remoteSubNet: FWP_CONDITION_VALUE0, }, qmFilterId: u64, }; pub const FWPM_NET_EVENT_IKEEXT_QM_FAILURE1_ = extern struct { failureErrorCode: u32, failurePoint: IPSEC_FAILURE_POINT, keyingModuleType: IKEEXT_KEY_MODULE_TYPE, qmState: IKEEXT_QM_SA_STATE, saRole: IKEEXT_SA_ROLE, saTrafficType: IPSEC_TRAFFIC_TYPE, Anonymous1: extern union { localSubNet: FWP_CONDITION_VALUE0, }, Anonymous2: extern union { remoteSubNet: FWP_CONDITION_VALUE0, }, qmFilterId: u64, mmSaLuid: u64, mmProviderContextKey: Guid, }; pub const FWPM_NET_EVENT_IKEEXT_EM_FAILURE0 = extern struct { failureErrorCode: u32, failurePoint: IPSEC_FAILURE_POINT, flags: u32, emState: IKEEXT_EM_SA_STATE, saRole: IKEEXT_SA_ROLE, emAuthMethod: IKEEXT_AUTHENTICATION_METHOD_TYPE, endCertHash: [20]u8, mmId: u64, qmFilterId: u64, }; pub const FWPM_NET_EVENT_IKEEXT_EM_FAILURE1 = extern struct { failureErrorCode: u32, failurePoint: IPSEC_FAILURE_POINT, flags: u32, emState: IKEEXT_EM_SA_STATE, saRole: IKEEXT_SA_ROLE, emAuthMethod: IKEEXT_AUTHENTICATION_METHOD_TYPE, endCertHash: [20]u8, mmId: u64, qmFilterId: u64, localPrincipalNameForAuth: ?PWSTR, remotePrincipalNameForAuth: ?PWSTR, numLocalPrincipalGroupSids: u32, localPrincipalGroupSids: ?*?PWSTR, numRemotePrincipalGroupSids: u32, remotePrincipalGroupSids: ?*?PWSTR, saTrafficType: IPSEC_TRAFFIC_TYPE, }; pub const FWPM_NET_EVENT_CLASSIFY_DROP0 = extern struct { filterId: u64, layerId: u16, }; pub const FWPM_NET_EVENT_CLASSIFY_DROP1 = extern struct { filterId: u64, layerId: u16, reauthReason: u32, originalProfile: u32, currentProfile: u32, msFwpDirection: u32, isLoopback: BOOL, }; pub const FWPM_NET_EVENT_CLASSIFY_DROP2 = extern struct { filterId: u64, layerId: u16, reauthReason: u32, originalProfile: u32, currentProfile: u32, msFwpDirection: u32, isLoopback: BOOL, vSwitchId: FWP_BYTE_BLOB, vSwitchSourcePort: u32, vSwitchDestinationPort: u32, }; pub const FWPM_NET_EVENT_CLASSIFY_DROP_MAC0 = extern struct { localMacAddr: FWP_BYTE_ARRAY6, remoteMacAddr: FWP_BYTE_ARRAY6, mediaType: u32, ifType: u32, etherType: u16, ndisPortNumber: u32, reserved: u32, vlanTag: u16, ifLuid: u64, filterId: u64, layerId: u16, reauthReason: u32, originalProfile: u32, currentProfile: u32, msFwpDirection: u32, isLoopback: BOOL, vSwitchId: FWP_BYTE_BLOB, vSwitchSourcePort: u32, vSwitchDestinationPort: u32, }; pub const FWPM_NET_EVENT_CLASSIFY_ALLOW0 = extern struct { filterId: u64, layerId: u16, reauthReason: u32, originalProfile: u32, currentProfile: u32, msFwpDirection: u32, isLoopback: BOOL, }; pub const FWPM_NET_EVENT_IPSEC_KERNEL_DROP0 = extern struct { failureStatus: i32, direction: FWP_DIRECTION, spi: u32, filterId: u64, layerId: u16, }; pub const FWPM_NET_EVENT_IPSEC_DOSP_DROP0 = extern struct { ipVersion: FWP_IP_VERSION, Anonymous1: extern union { publicHostV4Addr: u32, publicHostV6Addr: [16]u8, }, Anonymous2: extern union { internalHostV4Addr: u32, internalHostV6Addr: [16]u8, }, failureStatus: i32, direction: FWP_DIRECTION, }; pub const FWPM_APPC_NETWORK_CAPABILITY_TYPE = enum(i32) { CLIENT = 0, CLIENT_SERVER = 1, PRIVATE_NETWORK = 2, }; pub const FWPM_APPC_NETWORK_CAPABILITY_INTERNET_CLIENT = FWPM_APPC_NETWORK_CAPABILITY_TYPE.CLIENT; pub const FWPM_APPC_NETWORK_CAPABILITY_INTERNET_CLIENT_SERVER = FWPM_APPC_NETWORK_CAPABILITY_TYPE.CLIENT_SERVER; pub const FWPM_APPC_NETWORK_CAPABILITY_INTERNET_PRIVATE_NETWORK = FWPM_APPC_NETWORK_CAPABILITY_TYPE.PRIVATE_NETWORK; pub const FWPM_NET_EVENT_CAPABILITY_DROP0 = extern struct { networkCapabilityId: FWPM_APPC_NETWORK_CAPABILITY_TYPE, filterId: u64, isLoopback: BOOL, }; pub const FWPM_NET_EVENT_CAPABILITY_ALLOW0 = extern struct { networkCapabilityId: FWPM_APPC_NETWORK_CAPABILITY_TYPE, filterId: u64, isLoopback: BOOL, }; pub const FWPM_NET_EVENT_LPM_PACKET_ARRIVAL0_ = extern struct { spi: u32, }; pub const FWPM_NET_EVENT0 = extern struct { header: FWPM_NET_EVENT_HEADER0, type: FWPM_NET_EVENT_TYPE, Anonymous: extern union { ikeMmFailure: ?*FWPM_NET_EVENT_IKEEXT_MM_FAILURE0, ikeQmFailure: ?*FWPM_NET_EVENT_IKEEXT_QM_FAILURE0, ikeEmFailure: ?*FWPM_NET_EVENT_IKEEXT_EM_FAILURE0, classifyDrop: ?*FWPM_NET_EVENT_CLASSIFY_DROP0, ipsecDrop: ?*FWPM_NET_EVENT_IPSEC_KERNEL_DROP0, idpDrop: ?*FWPM_NET_EVENT_IPSEC_DOSP_DROP0, }, }; pub const FWPM_NET_EVENT1 = extern struct { header: FWPM_NET_EVENT_HEADER1, type: FWPM_NET_EVENT_TYPE, Anonymous: extern union { ikeMmFailure: ?*FWPM_NET_EVENT_IKEEXT_MM_FAILURE1, ikeQmFailure: ?*FWPM_NET_EVENT_IKEEXT_QM_FAILURE0, ikeEmFailure: ?*FWPM_NET_EVENT_IKEEXT_EM_FAILURE1, classifyDrop: ?*FWPM_NET_EVENT_CLASSIFY_DROP1, ipsecDrop: ?*FWPM_NET_EVENT_IPSEC_KERNEL_DROP0, idpDrop: ?*FWPM_NET_EVENT_IPSEC_DOSP_DROP0, }, }; pub const FWPM_NET_EVENT2 = extern struct { header: FWPM_NET_EVENT_HEADER2, type: FWPM_NET_EVENT_TYPE, Anonymous: extern union { ikeMmFailure: ?*FWPM_NET_EVENT_IKEEXT_MM_FAILURE1, ikeQmFailure: ?*FWPM_NET_EVENT_IKEEXT_QM_FAILURE0, ikeEmFailure: ?*FWPM_NET_EVENT_IKEEXT_EM_FAILURE1, classifyDrop: ?*FWPM_NET_EVENT_CLASSIFY_DROP2, ipsecDrop: ?*FWPM_NET_EVENT_IPSEC_KERNEL_DROP0, idpDrop: ?*FWPM_NET_EVENT_IPSEC_DOSP_DROP0, classifyAllow: ?*FWPM_NET_EVENT_CLASSIFY_ALLOW0, capabilityDrop: ?*FWPM_NET_EVENT_CAPABILITY_DROP0, capabilityAllow: ?*FWPM_NET_EVENT_CAPABILITY_ALLOW0, classifyDropMac: ?*FWPM_NET_EVENT_CLASSIFY_DROP_MAC0, }, }; pub const FWPM_NET_EVENT3 = extern struct { header: FWPM_NET_EVENT_HEADER3, type: FWPM_NET_EVENT_TYPE, Anonymous: extern union { ikeMmFailure: ?*FWPM_NET_EVENT_IKEEXT_MM_FAILURE1, ikeQmFailure: ?*FWPM_NET_EVENT_IKEEXT_QM_FAILURE0, ikeEmFailure: ?*FWPM_NET_EVENT_IKEEXT_EM_FAILURE1, classifyDrop: ?*FWPM_NET_EVENT_CLASSIFY_DROP2, ipsecDrop: ?*FWPM_NET_EVENT_IPSEC_KERNEL_DROP0, idpDrop: ?*FWPM_NET_EVENT_IPSEC_DOSP_DROP0, classifyAllow: ?*FWPM_NET_EVENT_CLASSIFY_ALLOW0, capabilityDrop: ?*FWPM_NET_EVENT_CAPABILITY_DROP0, capabilityAllow: ?*FWPM_NET_EVENT_CAPABILITY_ALLOW0, classifyDropMac: ?*FWPM_NET_EVENT_CLASSIFY_DROP_MAC0, }, }; pub const FWPM_NET_EVENT4_ = extern struct { header: FWPM_NET_EVENT_HEADER3, type: FWPM_NET_EVENT_TYPE, Anonymous: extern union { ikeMmFailure: ?*FWPM_NET_EVENT_IKEEXT_MM_FAILURE2_, ikeQmFailure: ?*FWPM_NET_EVENT_IKEEXT_QM_FAILURE1_, ikeEmFailure: ?*FWPM_NET_EVENT_IKEEXT_EM_FAILURE1, classifyDrop: ?*FWPM_NET_EVENT_CLASSIFY_DROP2, ipsecDrop: ?*FWPM_NET_EVENT_IPSEC_KERNEL_DROP0, idpDrop: ?*FWPM_NET_EVENT_IPSEC_DOSP_DROP0, classifyAllow: ?*FWPM_NET_EVENT_CLASSIFY_ALLOW0, capabilityDrop: ?*FWPM_NET_EVENT_CAPABILITY_DROP0, capabilityAllow: ?*FWPM_NET_EVENT_CAPABILITY_ALLOW0, classifyDropMac: ?*FWPM_NET_EVENT_CLASSIFY_DROP_MAC0, }, }; pub const FWPM_NET_EVENT5_ = extern struct { header: FWPM_NET_EVENT_HEADER3, type: FWPM_NET_EVENT_TYPE, Anonymous: extern union { ikeMmFailure: ?*FWPM_NET_EVENT_IKEEXT_MM_FAILURE2_, ikeQmFailure: ?*FWPM_NET_EVENT_IKEEXT_QM_FAILURE1_, ikeEmFailure: ?*FWPM_NET_EVENT_IKEEXT_EM_FAILURE1, classifyDrop: ?*FWPM_NET_EVENT_CLASSIFY_DROP2, ipsecDrop: ?*FWPM_NET_EVENT_IPSEC_KERNEL_DROP0, idpDrop: ?*FWPM_NET_EVENT_IPSEC_DOSP_DROP0, classifyAllow: ?*FWPM_NET_EVENT_CLASSIFY_ALLOW0, capabilityDrop: ?*FWPM_NET_EVENT_CAPABILITY_DROP0, capabilityAllow: ?*FWPM_NET_EVENT_CAPABILITY_ALLOW0, classifyDropMac: ?*FWPM_NET_EVENT_CLASSIFY_DROP_MAC0, lpmPacketArrival: ?*FWPM_NET_EVENT_LPM_PACKET_ARRIVAL0_, }, }; pub const FWPM_NET_EVENT_ENUM_TEMPLATE0 = extern struct { startTime: FILETIME, endTime: FILETIME, numFilterConditions: u32, filterCondition: ?*FWPM_FILTER_CONDITION0, }; pub const FWPM_NET_EVENT_SUBSCRIPTION0 = extern struct { enumTemplate: ?*FWPM_NET_EVENT_ENUM_TEMPLATE0, flags: u32, sessionKey: Guid, }; pub const FWPM_SYSTEM_PORT_TYPE = enum(i32) { RPC_EPMAP = 0, TEREDO = 1, IPHTTPS_IN = 2, IPHTTPS_OUT = 3, TYPE_MAX = 4, }; pub const FWPM_SYSTEM_PORT_RPC_EPMAP = FWPM_SYSTEM_PORT_TYPE.RPC_EPMAP; pub const FWPM_SYSTEM_PORT_TEREDO = FWPM_SYSTEM_PORT_TYPE.TEREDO; pub const FWPM_SYSTEM_PORT_IPHTTPS_IN = FWPM_SYSTEM_PORT_TYPE.IPHTTPS_IN; pub const FWPM_SYSTEM_PORT_IPHTTPS_OUT = FWPM_SYSTEM_PORT_TYPE.IPHTTPS_OUT; pub const FWPM_SYSTEM_PORT_TYPE_MAX = FWPM_SYSTEM_PORT_TYPE.TYPE_MAX; pub const FWPM_SYSTEM_PORTS_BY_TYPE0 = extern struct { type: FWPM_SYSTEM_PORT_TYPE, numPorts: u32, ports: ?*u16, }; pub const FWPM_SYSTEM_PORTS0 = extern struct { numTypes: u32, types: ?*FWPM_SYSTEM_PORTS_BY_TYPE0, }; pub const FWPM_CONNECTION0 = extern struct { connectionId: u64, ipVersion: FWP_IP_VERSION, Anonymous1: extern union { localV4Address: u32, localV6Address: [16]u8, }, Anonymous2: extern union { remoteV4Address: u32, remoteV6Address: [16]u8, }, providerKey: ?*Guid, ipsecTrafficModeType: IPSEC_TRAFFIC_TYPE, keyModuleType: IKEEXT_KEY_MODULE_TYPE, mmCrypto: IKEEXT_PROPOSAL0, mmPeer: IKEEXT_CREDENTIAL2, emPeer: IKEEXT_CREDENTIAL2, bytesTransferredIn: u64, bytesTransferredOut: u64, bytesTransferredTotal: u64, startSysTime: FILETIME, }; pub const FWPM_CONNECTION_ENUM_TEMPLATE0 = extern struct { connectionId: u64, flags: u32, }; pub const FWPM_CONNECTION_SUBSCRIPTION0 = extern struct { enumTemplate: ?*FWPM_CONNECTION_ENUM_TEMPLATE0, flags: u32, sessionKey: Guid, }; pub const FWPM_CONNECTION_EVENT_TYPE = enum(i32) { ADD = 0, DELETE = 1, MAX = 2, }; pub const FWPM_CONNECTION_EVENT_ADD = FWPM_CONNECTION_EVENT_TYPE.ADD; pub const FWPM_CONNECTION_EVENT_DELETE = FWPM_CONNECTION_EVENT_TYPE.DELETE; pub const FWPM_CONNECTION_EVENT_MAX = FWPM_CONNECTION_EVENT_TYPE.MAX; pub const FWPM_VSWITCH_EVENT_TYPE = enum(i32) { FILTER_ADD_TO_INCOMPLETE_LAYER = 0, FILTER_ENGINE_NOT_IN_REQUIRED_POSITION = 1, ENABLED_FOR_INSPECTION = 2, DISABLED_FOR_INSPECTION = 3, FILTER_ENGINE_REORDER = 4, MAX = 5, }; pub const FWPM_VSWITCH_EVENT_FILTER_ADD_TO_INCOMPLETE_LAYER = FWPM_VSWITCH_EVENT_TYPE.FILTER_ADD_TO_INCOMPLETE_LAYER; pub const FWPM_VSWITCH_EVENT_FILTER_ENGINE_NOT_IN_REQUIRED_POSITION = FWPM_VSWITCH_EVENT_TYPE.FILTER_ENGINE_NOT_IN_REQUIRED_POSITION; pub const FWPM_VSWITCH_EVENT_ENABLED_FOR_INSPECTION = FWPM_VSWITCH_EVENT_TYPE.ENABLED_FOR_INSPECTION; pub const FWPM_VSWITCH_EVENT_DISABLED_FOR_INSPECTION = FWPM_VSWITCH_EVENT_TYPE.DISABLED_FOR_INSPECTION; pub const FWPM_VSWITCH_EVENT_FILTER_ENGINE_REORDER = FWPM_VSWITCH_EVENT_TYPE.FILTER_ENGINE_REORDER; pub const FWPM_VSWITCH_EVENT_MAX = FWPM_VSWITCH_EVENT_TYPE.MAX; pub const FWPM_VSWITCH_EVENT0 = extern struct { eventType: FWPM_VSWITCH_EVENT_TYPE, vSwitchId: ?PWSTR, Anonymous: extern union { positionInfo: extern struct { numvSwitchFilterExtensions: u32, vSwitchFilterExtensions: ?*?PWSTR, }, reorderInfo: extern struct { inRequiredPosition: BOOL, numvSwitchFilterExtensions: u32, vSwitchFilterExtensions: ?*?PWSTR, }, }, }; pub const FWPM_VSWITCH_EVENT_SUBSCRIPTION0 = extern struct { flags: u32, sessionKey: Guid, }; pub const FWPM_PROVIDER_CHANGE_CALLBACK0 = fn( context: ?*c_void, change: ?*const FWPM_PROVIDER_CHANGE0, ) callconv(@import("std").os.windows.WINAPI) void; pub const FWPM_PROVIDER_CONTEXT_CHANGE_CALLBACK0 = fn( context: ?*c_void, change: ?*const FWPM_PROVIDER_CONTEXT_CHANGE0, ) callconv(@import("std").os.windows.WINAPI) void; pub const FWPM_SUBLAYER_CHANGE_CALLBACK0 = fn( context: ?*c_void, change: ?*const FWPM_SUBLAYER_CHANGE0, ) callconv(@import("std").os.windows.WINAPI) void; pub const FWPM_CALLOUT_CHANGE_CALLBACK0 = fn( context: ?*c_void, change: ?*const FWPM_CALLOUT_CHANGE0, ) callconv(@import("std").os.windows.WINAPI) void; pub const FWPM_FILTER_CHANGE_CALLBACK0 = fn( context: ?*c_void, change: ?*const FWPM_FILTER_CHANGE0, ) callconv(@import("std").os.windows.WINAPI) void; pub const IPSEC_SA_CONTEXT_CALLBACK0 = fn( context: ?*c_void, change: ?*const IPSEC_SA_CONTEXT_CHANGE0, ) callconv(@import("std").os.windows.WINAPI) void; pub const IPSEC_KEY_MANAGER_KEY_DICTATION_CHECK0 = fn( ikeTraffic: ?*const IKEEXT_TRAFFIC0, willDictateKey: ?*BOOL, weight: ?*u32, ) callconv(@import("std").os.windows.WINAPI) void; pub const IPSEC_KEY_MANAGER_DICTATE_KEY0 = fn( inboundSaDetails: ?*IPSEC_SA_DETAILS1, outboundSaDetails: ?*IPSEC_SA_DETAILS1, keyingModuleGenKey: ?*BOOL, ) callconv(@import("std").os.windows.WINAPI) u32; pub const IPSEC_KEY_MANAGER_NOTIFY_KEY0 = fn( inboundSa: ?*const IPSEC_SA_DETAILS1, outboundSa: ?*const IPSEC_SA_DETAILS1, ) callconv(@import("std").os.windows.WINAPI) void; pub const IPSEC_KEY_MANAGER_CALLBACKS0 = extern struct { reserved: Guid, flags: u32, keyDictationCheck: ?IPSEC_KEY_MANAGER_KEY_DICTATION_CHECK0, keyDictation: ?IPSEC_KEY_MANAGER_DICTATE_KEY0, keyNotify: ?IPSEC_KEY_MANAGER_NOTIFY_KEY0, }; pub const FWPM_NET_EVENT_CALLBACK0 = fn( context: ?*c_void, event: ?*const FWPM_NET_EVENT1, ) callconv(@import("std").os.windows.WINAPI) void; pub const FWPM_NET_EVENT_CALLBACK1 = fn( context: ?*c_void, event: ?*const FWPM_NET_EVENT2, ) callconv(@import("std").os.windows.WINAPI) void; pub const FWPM_NET_EVENT_CALLBACK2 = fn( context: ?*c_void, event: ?*const FWPM_NET_EVENT3, ) callconv(@import("std").os.windows.WINAPI) void; pub const FWPM_NET_EVENT_CALLBACK3 = fn( context: ?*c_void, event: ?*const FWPM_NET_EVENT4_, ) callconv(@import("std").os.windows.WINAPI) void; pub const FWPM_NET_EVENT_CALLBACK4 = fn( context: ?*c_void, event: ?*const FWPM_NET_EVENT5_, ) callconv(@import("std").os.windows.WINAPI) void; pub const FWPM_SYSTEM_PORTS_CALLBACK0 = fn( context: ?*c_void, sysPorts: ?*const FWPM_SYSTEM_PORTS0, ) callconv(@import("std").os.windows.WINAPI) void; pub const FWPM_CONNECTION_CALLBACK0 = fn( context: ?*c_void, eventType: FWPM_CONNECTION_EVENT_TYPE, connection: ?*const FWPM_CONNECTION0, ) callconv(@import("std").os.windows.WINAPI) void; pub const FWPM_VSWITCH_EVENT_CALLBACK0 = fn( context: ?*c_void, vSwitchEvent: ?*const FWPM_VSWITCH_EVENT0, ) callconv(@import("std").os.windows.WINAPI) u32; pub const DL_OUI = extern union { Byte: [3]u8, Anonymous: extern struct { _bitfield: u8, }, }; pub const DL_EI48 = extern union { Byte: [3]u8, }; pub const DL_EUI48 = extern union { Byte: [6]u8, Anonymous: extern struct { Oui: DL_OUI, Ei48: DL_EI48, }, }; pub const DL_EI64 = extern union { Byte: [5]u8, }; pub const DL_EUI64 = extern union { Byte: [8]u8, Value: u64, Anonymous: extern struct { Oui: DL_OUI, Anonymous: extern union { Ei64: DL_EI64, Anonymous: extern struct { Type: u8, Tse: u8, Ei48: DL_EI48, }, }, }, }; pub const SNAP_HEADER = extern struct { Dsap: u8, Ssap: u8, Control: u8, Oui: [3]u8, Type: u16, }; pub const ETHERNET_HEADER = extern struct { Destination: DL_EUI48, Source: DL_EUI48, Anonymous: extern union { Type: u16, Length: u16, }, }; pub const VLAN_TAG = extern struct { Anonymous: extern union { Tag: u16, Anonymous: extern struct { _bitfield: u16, }, }, Type: u16, }; pub const ICMP_HEADER = extern struct { Type: u8, Code: u8, Checksum: u16, }; pub const ICMP_MESSAGE = extern struct { Header: ICMP_HEADER, Data: extern union { Data32: [1]u32, Data16: [2]u16, Data8: [4]u8, }, }; pub const IPV4_HEADER = extern struct { Anonymous1: extern union { VersionAndHeaderLength: u8, Anonymous: extern struct { _bitfield: u8, }, }, Anonymous2: extern union { TypeOfServiceAndEcnField: u8, Anonymous: extern struct { _bitfield: u8, }, }, TotalLength: u16, Identification: u16, Anonymous3: extern union { FlagsAndOffset: u16, Anonymous: extern struct { _bitfield: u16, }, }, TimeToLive: u8, Protocol: u8, HeaderChecksum: u16, SourceAddress: IN_ADDR, DestinationAddress: IN_ADDR, }; pub const IPV4_OPTION_HEADER = extern struct { Anonymous: extern union { OptionType: u8, Anonymous: extern struct { _bitfield: u8, }, }, OptionLength: u8, }; pub const IPV4_OPTION_TYPE = enum(i32) { EOL = 0, NOP = 1, SECURITY = 130, LSRR = 131, TS = 68, RR = 7, SSRR = 137, SID = 136, ROUTER_ALERT = 148, MULTIDEST = 149, }; pub const IP_OPT_EOL = IPV4_OPTION_TYPE.EOL; pub const IP_OPT_NOP = IPV4_OPTION_TYPE.NOP; pub const IP_OPT_SECURITY = IPV4_OPTION_TYPE.SECURITY; pub const IP_OPT_LSRR = IPV4_OPTION_TYPE.LSRR; pub const IP_OPT_TS = IPV4_OPTION_TYPE.TS; pub const IP_OPT_RR = IPV4_OPTION_TYPE.RR; pub const IP_OPT_SSRR = IPV4_OPTION_TYPE.SSRR; pub const IP_OPT_SID = IPV4_OPTION_TYPE.SID; pub const IP_OPT_ROUTER_ALERT = IPV4_OPTION_TYPE.ROUTER_ALERT; pub const IP_OPT_MULTIDEST = IPV4_OPTION_TYPE.MULTIDEST; pub const IPV4_TIMESTAMP_OPTION = extern struct { OptionHeader: IPV4_OPTION_HEADER, Pointer: u8, Anonymous: extern union { FlagsOverflow: u8, Anonymous: extern struct { _bitfield: u8, }, }, }; pub const IP_OPTION_TIMESTAMP_FLAGS = enum(i32) { ONLY = 0, ADDRESS = 1, SPECIFIC_ADDRESS = 3, }; pub const IP_OPTION_TIMESTAMP_ONLY = IP_OPTION_TIMESTAMP_FLAGS.ONLY; pub const IP_OPTION_TIMESTAMP_ADDRESS = IP_OPTION_TIMESTAMP_FLAGS.ADDRESS; pub const IP_OPTION_TIMESTAMP_SPECIFIC_ADDRESS = IP_OPTION_TIMESTAMP_FLAGS.SPECIFIC_ADDRESS; pub const IPV4_ROUTING_HEADER = extern struct { OptionHeader: IPV4_OPTION_HEADER, Pointer: u8, }; pub const ICMP4_UNREACH_CODE = enum(i32) { NET = 0, HOST = 1, PROTOCOL = 2, PORT = 3, FRAG_NEEDED = 4, SOURCEROUTE_FAILED = 5, NET_UNKNOWN = 6, HOST_UNKNOWN = 7, ISOLATED = 8, NET_ADMIN = 9, HOST_ADMIN = 10, NET_TOS = 11, HOST_TOS = 12, ADMIN = 13, }; pub const ICMP4_UNREACH_NET = ICMP4_UNREACH_CODE.NET; pub const ICMP4_UNREACH_HOST = ICMP4_UNREACH_CODE.HOST; pub const ICMP4_UNREACH_PROTOCOL = ICMP4_UNREACH_CODE.PROTOCOL; pub const ICMP4_UNREACH_PORT = ICMP4_UNREACH_CODE.PORT; pub const ICMP4_UNREACH_FRAG_NEEDED = ICMP4_UNREACH_CODE.FRAG_NEEDED; pub const ICMP4_UNREACH_SOURCEROUTE_FAILED = ICMP4_UNREACH_CODE.SOURCEROUTE_FAILED; pub const ICMP4_UNREACH_NET_UNKNOWN = ICMP4_UNREACH_CODE.NET_UNKNOWN; pub const ICMP4_UNREACH_HOST_UNKNOWN = ICMP4_UNREACH_CODE.HOST_UNKNOWN; pub const ICMP4_UNREACH_ISOLATED = ICMP4_UNREACH_CODE.ISOLATED; pub const ICMP4_UNREACH_NET_ADMIN = ICMP4_UNREACH_CODE.NET_ADMIN; pub const ICMP4_UNREACH_HOST_ADMIN = ICMP4_UNREACH_CODE.HOST_ADMIN; pub const ICMP4_UNREACH_NET_TOS = ICMP4_UNREACH_CODE.NET_TOS; pub const ICMP4_UNREACH_HOST_TOS = ICMP4_UNREACH_CODE.HOST_TOS; pub const ICMP4_UNREACH_ADMIN = ICMP4_UNREACH_CODE.ADMIN; pub const ICMP4_TIME_EXCEED_CODE = enum(i32) { TRANSIT = 0, REASSEMBLY = 1, }; pub const ICMP4_TIME_EXCEED_TRANSIT = ICMP4_TIME_EXCEED_CODE.TRANSIT; pub const ICMP4_TIME_EXCEED_REASSEMBLY = ICMP4_TIME_EXCEED_CODE.REASSEMBLY; pub const ICMPV4_ROUTER_SOLICIT = extern struct { RsHeader: ICMP_MESSAGE, }; pub const ICMPV4_ROUTER_ADVERT_HEADER = extern struct { RaHeader: ICMP_MESSAGE, }; pub const ICMPV4_ROUTER_ADVERT_ENTRY = extern struct { RouterAdvertAddr: IN_ADDR, PreferenceLevel: i32, }; pub const ICMPV4_TIMESTAMP_MESSAGE = extern struct { Header: ICMP_MESSAGE, OriginateTimestamp: u32, ReceiveTimestamp: u32, TransmitTimestamp: u32, }; pub const ICMPV4_ADDRESS_MASK_MESSAGE = extern struct { Header: ICMP_MESSAGE, AddressMask: u32, }; pub const ARP_HEADER = extern struct { HardwareAddressSpace: u16, ProtocolAddressSpace: u16, HardwareAddressLength: u8, ProtocolAddressLength: u8, Opcode: u16, SenderHardwareAddress: [1]u8, }; pub const ARP_OPCODE = enum(i32) { QUEST = 1, SPONSE = 2, }; pub const ARP_REQUEST = ARP_OPCODE.QUEST; pub const ARP_RESPONSE = ARP_OPCODE.SPONSE; pub const ARP_HARDWARE_TYPE = enum(i32) { ENET = 1, @"802" = 6, }; pub const ARP_HW_ENET = ARP_HARDWARE_TYPE.ENET; pub const ARP_HW_802 = ARP_HARDWARE_TYPE.@"802"; pub const IGMP_HEADER = extern struct { Anonymous1: extern union { Anonymous: extern struct { _bitfield: u8, }, VersionType: u8, }, Anonymous2: extern union { Reserved: u8, MaxRespTime: u8, Code: u8, }, Checksum: u16, MulticastAddress: IN_ADDR, }; pub const IGMP_MAX_RESP_CODE_TYPE = enum(i32) { NORMAL = 0, FLOAT = 1, }; pub const IGMP_MAX_RESP_CODE_TYPE_NORMAL = IGMP_MAX_RESP_CODE_TYPE.NORMAL; pub const IGMP_MAX_RESP_CODE_TYPE_FLOAT = IGMP_MAX_RESP_CODE_TYPE.FLOAT; pub const IGMPV3_QUERY_HEADER = extern struct { Type: u8, Anonymous1: extern union { MaxRespCode: u8, Anonymous: extern struct { _bitfield: u8, }, }, Checksum: u16, MulticastAddress: IN_ADDR, _bitfield: u8, Anonymous2: extern union { QueriersQueryInterfaceCode: u8, Anonymous: extern struct { _bitfield: u8, }, }, SourceCount: u16, }; pub const IGMPV3_REPORT_RECORD_HEADER = extern struct { Type: u8, AuxillaryDataLength: u8, SourceCount: u16, MulticastAddress: IN_ADDR, }; pub const IGMPV3_REPORT_HEADER = extern struct { Type: u8, Reserved: u8, Checksum: u16, Reserved2: u16, RecordCount: u16, }; pub const IPV6_HEADER = extern struct { Anonymous: extern union { VersionClassFlow: u32, Anonymous: extern struct { _bitfield: u32, }, }, PayloadLength: u16, NextHeader: u8, HopLimit: u8, SourceAddress: IN6_ADDR, DestinationAddress: IN6_ADDR, }; pub const IPV6_FRAGMENT_HEADER = extern struct { NextHeader: u8, Reserved: u8, Anonymous: extern union { Anonymous: extern struct { _bitfield: u16, }, OffsetAndFlags: u16, }, Id: u32, }; pub const IPV6_EXTENSION_HEADER = extern struct { NextHeader: u8, Length: u8, }; pub const IPV6_OPTION_HEADER = extern struct { Type: u8, DataLength: u8, }; pub const IPV6_OPTION_TYPE = enum(i32) { PAD1 = 0, PADN = 1, TUNNEL_LIMIT = 4, ROUTER_ALERT = 5, JUMBO = 194, NSAP_ADDR = 195, }; pub const IP6OPT_PAD1 = IPV6_OPTION_TYPE.PAD1; pub const IP6OPT_PADN = IPV6_OPTION_TYPE.PADN; pub const IP6OPT_TUNNEL_LIMIT = IPV6_OPTION_TYPE.TUNNEL_LIMIT; pub const IP6OPT_ROUTER_ALERT = IPV6_OPTION_TYPE.ROUTER_ALERT; pub const IP6OPT_JUMBO = IPV6_OPTION_TYPE.JUMBO; pub const IP6OPT_NSAP_ADDR = IPV6_OPTION_TYPE.NSAP_ADDR; pub const IPV6_OPTION_JUMBOGRAM = extern struct { Header: IPV6_OPTION_HEADER, JumbogramLength: [4]u8, }; pub const IPV6_OPTION_ROUTER_ALERT = extern struct { Header: IPV6_OPTION_HEADER, Value: [2]u8, }; pub const IPV6_ROUTING_HEADER = extern struct { NextHeader: u8, Length: u8, RoutingType: u8, SegmentsLeft: u8, Reserved: [4]u8, }; pub const nd_router_solicit = extern struct { nd_rs_hdr: ICMP_MESSAGE, }; pub const nd_router_advert = extern struct { nd_ra_hdr: ICMP_MESSAGE, nd_ra_reachable: u32, nd_ra_retransmit: u32, }; pub const IPV6_ROUTER_ADVERTISEMENT_FLAGS = extern union { Anonymous: extern struct { _bitfield: u8, }, Value: u8, }; pub const nd_neighbor_solicit = extern struct { nd_ns_hdr: ICMP_MESSAGE, nd_ns_target: IN6_ADDR, }; pub const nd_neighbor_advert = extern struct { nd_na_hdr: ICMP_MESSAGE, nd_na_target: IN6_ADDR, }; pub const IPV6_NEIGHBOR_ADVERTISEMENT_FLAGS = extern union { Anonymous: extern struct { _bitfield: u8, Reserved2: [3]u8, }, Value: u32, }; pub const nd_redirect = extern struct { nd_rd_hdr: ICMP_MESSAGE, nd_rd_target: IN6_ADDR, nd_rd_dst: IN6_ADDR, }; pub const nd_opt_hdr = extern struct { nd_opt_type: u8, nd_opt_len: u8, }; pub const ND_OPTION_TYPE = enum(i32) { SOURCE_LINKADDR = 1, TARGET_LINKADDR = 2, PREFIX_INFORMATION = 3, REDIRECTED_HEADER = 4, MTU = 5, NBMA_SHORTCUT_LIMIT = 6, ADVERTISEMENT_INTERVAL = 7, HOME_AGENT_INFORMATION = 8, SOURCE_ADDR_LIST = 9, TARGET_ADDR_LIST = 10, ROUTE_INFO = 24, RDNSS = 25, DNSSL = 31, }; pub const ND_OPT_SOURCE_LINKADDR = ND_OPTION_TYPE.SOURCE_LINKADDR; pub const ND_OPT_TARGET_LINKADDR = ND_OPTION_TYPE.TARGET_LINKADDR; pub const ND_OPT_PREFIX_INFORMATION = ND_OPTION_TYPE.PREFIX_INFORMATION; pub const ND_OPT_REDIRECTED_HEADER = ND_OPTION_TYPE.REDIRECTED_HEADER; pub const ND_OPT_MTU = ND_OPTION_TYPE.MTU; pub const ND_OPT_NBMA_SHORTCUT_LIMIT = ND_OPTION_TYPE.NBMA_SHORTCUT_LIMIT; pub const ND_OPT_ADVERTISEMENT_INTERVAL = ND_OPTION_TYPE.ADVERTISEMENT_INTERVAL; pub const ND_OPT_HOME_AGENT_INFORMATION = ND_OPTION_TYPE.HOME_AGENT_INFORMATION; pub const ND_OPT_SOURCE_ADDR_LIST = ND_OPTION_TYPE.SOURCE_ADDR_LIST; pub const ND_OPT_TARGET_ADDR_LIST = ND_OPTION_TYPE.TARGET_ADDR_LIST; pub const ND_OPT_ROUTE_INFO = ND_OPTION_TYPE.ROUTE_INFO; pub const ND_OPT_RDNSS = ND_OPTION_TYPE.RDNSS; pub const ND_OPT_DNSSL = ND_OPTION_TYPE.DNSSL; pub const nd_opt_prefix_info = extern struct { nd_opt_pi_type: u8, nd_opt_pi_len: u8, nd_opt_pi_prefix_len: u8, Anonymous1: extern union { nd_opt_pi_flags_reserved: u8, Flags: extern struct { _bitfield: u8, }, }, nd_opt_pi_valid_time: u32, nd_opt_pi_preferred_time: u32, Anonymous2: extern union { nd_opt_pi_reserved2: u32, Anonymous: extern struct { nd_opt_pi_reserved3: [3]u8, nd_opt_pi_site_prefix_len: u8, }, }, nd_opt_pi_prefix: IN6_ADDR, }; pub const nd_opt_rd_hdr = extern struct { nd_opt_rh_type: u8, nd_opt_rh_len: u8, nd_opt_rh_reserved1: u16, nd_opt_rh_reserved2: u32, }; pub const nd_opt_mtu = extern struct { nd_opt_mtu_type: u8, nd_opt_mtu_len: u8, nd_opt_mtu_reserved: u16, nd_opt_mtu_mtu: u32, }; pub const nd_opt_route_info = extern struct { nd_opt_ri_type: u8, nd_opt_ri_len: u8, nd_opt_ri_prefix_len: u8, Anonymous: extern union { nd_opt_ri_flags_reserved: u8, Flags: extern struct { _bitfield: u8, }, }, nd_opt_ri_route_lifetime: u32, nd_opt_ri_prefix: IN6_ADDR, }; pub const nd_opt_rdnss = extern struct { nd_opt_rdnss_type: u8, nd_opt_rdnss_len: u8, nd_opt_rdnss_reserved: u16, nd_opt_rdnss_lifetime: u32, }; pub const nd_opt_dnssl = extern struct { nd_opt_dnssl_type: u8, nd_opt_dnssl_len: u8, nd_opt_dnssl_reserved: u16, nd_opt_dnssl_lifetime: u32, }; pub const MLD_HEADER = extern struct { IcmpHeader: ICMP_HEADER, MaxRespTime: u16, Reserved: u16, MulticastAddress: IN6_ADDR, }; pub const MLD_MAX_RESP_CODE_TYPE = enum(i32) { NORMAL = 0, FLOAT = 1, }; pub const MLD_MAX_RESP_CODE_TYPE_NORMAL = MLD_MAX_RESP_CODE_TYPE.NORMAL; pub const MLD_MAX_RESP_CODE_TYPE_FLOAT = MLD_MAX_RESP_CODE_TYPE.FLOAT; pub const MLDV2_QUERY_HEADER = extern struct { IcmpHeader: ICMP_HEADER, Anonymous1: extern union { MaxRespCode: u16, Anonymous: extern struct { _bitfield: u16, }, }, Reserved: u16, MulticastAddress: IN6_ADDR, _bitfield: u8, Anonymous2: extern union { QueriersQueryInterfaceCode: u8, Anonymous: extern struct { _bitfield: u8, }, }, SourceCount: u16, }; pub const MLDV2_REPORT_RECORD_HEADER = extern struct { Type: u8, AuxillaryDataLength: u8, SourceCount: u16, MulticastAddress: IN6_ADDR, }; pub const MLDV2_REPORT_HEADER = extern struct { IcmpHeader: ICMP_HEADER, Reserved: u16, RecordCount: u16, }; pub const tcp_hdr = packed struct { th_sport: u16, th_dport: u16, th_seq: u32, th_ack: u32, _bitfield: u8, th_flags: u8, th_win: u16, th_sum: u16, th_urp: u16, }; pub const tcp_opt_mss = packed struct { Kind: u8, Length: u8, Mss: u16, }; pub const tcp_opt_ws = extern struct { Kind: u8, Length: u8, ShiftCnt: u8, }; pub const tcp_opt_sack_permitted = extern struct { Kind: u8, Length: u8, }; pub const tcp_opt_sack = extern struct { pub const tcp_opt_sack_block = packed struct { Left: u32, Right: u32, }; Kind: u8, Length: u8, Block: [1]tcp_opt_sack_block, }; pub const tcp_opt_ts = packed struct { Kind: u8, Length: u8, Val: u32, EcR: u32, }; pub const tcp_opt_unknown = extern struct { Kind: u8, Length: u8, }; pub const tcp_opt_fastopen = extern struct { Kind: u8, Length: u8, Cookie: [1]u8, }; pub const DL_TUNNEL_ADDRESS = extern struct { CompartmentId: COMPARTMENT_ID, ScopeId: SCOPE_ID, IpAddress: [1]u8, }; pub const TUNNEL_SUB_TYPE = enum(i32) { NONE = 0, CP = 1, IPTLS = 2, HA = 3, }; pub const TUNNEL_SUB_TYPE_NONE = TUNNEL_SUB_TYPE.NONE; pub const TUNNEL_SUB_TYPE_CP = TUNNEL_SUB_TYPE.CP; pub const TUNNEL_SUB_TYPE_IPTLS = TUNNEL_SUB_TYPE.IPTLS; pub const TUNNEL_SUB_TYPE_HA = TUNNEL_SUB_TYPE.HA; pub const DL_TEREDO_ADDRESS = extern struct { Reserved: [6]u8, Anonymous: packed union { Eui64: DL_EUI64, Anonymous: packed struct { Flags: u16, MappedPort: u16, MappedAddress: IN_ADDR, }, }, }; pub const DL_TEREDO_ADDRESS_PRV = extern struct { Reserved: [6]u8, Anonymous: packed union { Eui64: DL_EUI64, Anonymous: packed struct { Flags: u16, MappedPort: u16, MappedAddress: IN_ADDR, LocalAddress: IN_ADDR, InterfaceIndex: u32, LocalPort: u16, DlDestination: DL_EUI48, }, }, }; pub const IPTLS_METADATA = packed struct { SequenceNumber: u64, }; pub const NPI_MODULEID_TYPE = enum(i32) { GUID = 1, IF_LUID = 2, }; pub const MIT_GUID = NPI_MODULEID_TYPE.GUID; pub const MIT_IF_LUID = NPI_MODULEID_TYPE.IF_LUID; pub const NPI_MODULEID = extern struct { Length: u16, Type: NPI_MODULEID_TYPE, Anonymous: extern union { Guid: Guid, IfLuid: LUID, }, }; pub const FALLBACK_INDEX = enum(i32) { TcpFastopen = 0, Max = 1, }; pub const FallbackIndexTcpFastopen = FALLBACK_INDEX.TcpFastopen; pub const FallbackIndexMax = FALLBACK_INDEX.Max; //-------------------------------------------------------------------------------- // Section: Functions (186) //-------------------------------------------------------------------------------- // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmFreeMemory0( p: ?*?*c_void, ) callconv(@import("std").os.windows.WINAPI) void; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmEngineOpen0( serverName: ?[*:0]const u16, authnService: u32, authIdentity: ?*SEC_WINNT_AUTH_IDENTITY_W, session: ?*const FWPM_SESSION0, engineHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmEngineClose0( engineHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmEngineGetOption0( engineHandle: ?HANDLE, option: FWPM_ENGINE_OPTION, value: ?*?*FWP_VALUE0, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmEngineSetOption0( engineHandle: ?HANDLE, option: FWPM_ENGINE_OPTION, newValue: ?*const FWP_VALUE0, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmEngineGetSecurityInfo0( engineHandle: ?HANDLE, securityInfo: u32, sidOwner: ?*?PSID, sidGroup: ?*?PSID, dacl: ?*?*ACL, sacl: ?*?*ACL, securityDescriptor: ?*?*SECURITY_DESCRIPTOR, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmEngineSetSecurityInfo0( engineHandle: ?HANDLE, securityInfo: u32, sidOwner: ?*const SID, sidGroup: ?*const SID, dacl: ?*const ACL, sacl: ?*const ACL, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmSessionCreateEnumHandle0( engineHandle: ?HANDLE, enumTemplate: ?*const FWPM_SESSION_ENUM_TEMPLATE0, enumHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmSessionEnum0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*FWPM_SESSION0, numEntriesReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmSessionDestroyEnumHandle0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmTransactionBegin0( engineHandle: ?HANDLE, flags: u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmTransactionCommit0( engineHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmTransactionAbort0( engineHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmProviderAdd0( engineHandle: ?HANDLE, provider: ?*const FWPM_PROVIDER0, sd: ?*SECURITY_DESCRIPTOR, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmProviderDeleteByKey0( engineHandle: ?HANDLE, key: ?*const Guid, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmProviderGetByKey0( engineHandle: ?HANDLE, key: ?*const Guid, provider: ?*?*FWPM_PROVIDER0, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmProviderCreateEnumHandle0( engineHandle: ?HANDLE, enumTemplate: ?*const FWPM_PROVIDER_ENUM_TEMPLATE0, enumHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmProviderEnum0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*FWPM_PROVIDER0, numEntriesReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmProviderDestroyEnumHandle0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmProviderGetSecurityInfoByKey0( engineHandle: ?HANDLE, key: ?*const Guid, securityInfo: u32, sidOwner: ?*?PSID, sidGroup: ?*?PSID, dacl: ?*?*ACL, sacl: ?*?*ACL, securityDescriptor: ?*?*SECURITY_DESCRIPTOR, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmProviderSetSecurityInfoByKey0( engineHandle: ?HANDLE, key: ?*const Guid, securityInfo: u32, sidOwner: ?*const SID, sidGroup: ?*const SID, dacl: ?*const ACL, sacl: ?*const ACL, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmProviderSubscribeChanges0( engineHandle: ?HANDLE, subscription: ?*const FWPM_PROVIDER_SUBSCRIPTION0, callback: ?FWPM_PROVIDER_CHANGE_CALLBACK0, context: ?*c_void, changeHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmProviderUnsubscribeChanges0( engineHandle: ?HANDLE, changeHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmProviderSubscriptionsGet0( engineHandle: ?HANDLE, entries: ?*?*?*FWPM_PROVIDER_SUBSCRIPTION0, numEntries: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmProviderContextAdd0( engineHandle: ?HANDLE, providerContext: ?*const FWPM_PROVIDER_CONTEXT0, sd: ?*SECURITY_DESCRIPTOR, id: ?*u64, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn FwpmProviderContextAdd1( engineHandle: ?HANDLE, providerContext: ?*const FWPM_PROVIDER_CONTEXT1, sd: ?*SECURITY_DESCRIPTOR, id: ?*u64, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn FwpmProviderContextAdd2( engineHandle: ?HANDLE, providerContext: ?*const FWPM_PROVIDER_CONTEXT2, sd: ?*SECURITY_DESCRIPTOR, id: ?*u64, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "fwpuclnt" fn FwpmProviderContextAdd3( engineHandle: ?HANDLE, providerContext: ?*const FWPM_PROVIDER_CONTEXT3_, sd: ?*SECURITY_DESCRIPTOR, id: ?*u64, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmProviderContextDeleteById0( engineHandle: ?HANDLE, id: u64, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmProviderContextDeleteByKey0( engineHandle: ?HANDLE, key: ?*const Guid, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmProviderContextGetById0( engineHandle: ?HANDLE, id: u64, providerContext: ?*?*FWPM_PROVIDER_CONTEXT0, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn FwpmProviderContextGetById1( engineHandle: ?HANDLE, id: u64, providerContext: ?*?*FWPM_PROVIDER_CONTEXT1, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn FwpmProviderContextGetById2( engineHandle: ?HANDLE, id: u64, providerContext: ?*?*FWPM_PROVIDER_CONTEXT2, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "fwpuclnt" fn FwpmProviderContextGetById3( engineHandle: ?HANDLE, id: u64, providerContext: ?*?*FWPM_PROVIDER_CONTEXT3_, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmProviderContextGetByKey0( engineHandle: ?HANDLE, key: ?*const Guid, providerContext: ?*?*FWPM_PROVIDER_CONTEXT0, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn FwpmProviderContextGetByKey1( engineHandle: ?HANDLE, key: ?*const Guid, providerContext: ?*?*FWPM_PROVIDER_CONTEXT1, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn FwpmProviderContextGetByKey2( engineHandle: ?HANDLE, key: ?*const Guid, providerContext: ?*?*FWPM_PROVIDER_CONTEXT2, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "fwpuclnt" fn FwpmProviderContextGetByKey3( engineHandle: ?HANDLE, key: ?*const Guid, providerContext: ?*?*FWPM_PROVIDER_CONTEXT3_, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmProviderContextCreateEnumHandle0( engineHandle: ?HANDLE, enumTemplate: ?*const FWPM_PROVIDER_CONTEXT_ENUM_TEMPLATE0, enumHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmProviderContextEnum0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*FWPM_PROVIDER_CONTEXT0, numEntriesReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn FwpmProviderContextEnum1( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*FWPM_PROVIDER_CONTEXT1, numEntriesReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn FwpmProviderContextEnum2( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*FWPM_PROVIDER_CONTEXT2, numEntriesReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "fwpuclnt" fn FwpmProviderContextEnum3( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*FWPM_PROVIDER_CONTEXT3_, numEntriesReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmProviderContextDestroyEnumHandle0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmProviderContextGetSecurityInfoByKey0( engineHandle: ?HANDLE, key: ?*const Guid, securityInfo: u32, sidOwner: ?*?PSID, sidGroup: ?*?PSID, dacl: ?*?*ACL, sacl: ?*?*ACL, securityDescriptor: ?*?*SECURITY_DESCRIPTOR, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmProviderContextSetSecurityInfoByKey0( engineHandle: ?HANDLE, key: ?*const Guid, securityInfo: u32, sidOwner: ?*const SID, sidGroup: ?*const SID, dacl: ?*const ACL, sacl: ?*const ACL, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmProviderContextSubscribeChanges0( engineHandle: ?HANDLE, subscription: ?*const FWPM_PROVIDER_CONTEXT_SUBSCRIPTION0, callback: ?FWPM_PROVIDER_CONTEXT_CHANGE_CALLBACK0, context: ?*c_void, changeHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmProviderContextUnsubscribeChanges0( engineHandle: ?HANDLE, changeHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmProviderContextSubscriptionsGet0( engineHandle: ?HANDLE, entries: ?*?*?*FWPM_PROVIDER_CONTEXT_SUBSCRIPTION0, numEntries: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmSubLayerAdd0( engineHandle: ?HANDLE, subLayer: ?*const FWPM_SUBLAYER0, sd: ?*SECURITY_DESCRIPTOR, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmSubLayerDeleteByKey0( engineHandle: ?HANDLE, key: ?*const Guid, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmSubLayerGetByKey0( engineHandle: ?HANDLE, key: ?*const Guid, subLayer: ?*?*FWPM_SUBLAYER0, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmSubLayerCreateEnumHandle0( engineHandle: ?HANDLE, enumTemplate: ?*const FWPM_SUBLAYER_ENUM_TEMPLATE0, enumHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmSubLayerEnum0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*FWPM_SUBLAYER0, numEntriesReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmSubLayerDestroyEnumHandle0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmSubLayerGetSecurityInfoByKey0( engineHandle: ?HANDLE, key: ?*const Guid, securityInfo: u32, sidOwner: ?*?PSID, sidGroup: ?*?PSID, dacl: ?*?*ACL, sacl: ?*?*ACL, securityDescriptor: ?*?*SECURITY_DESCRIPTOR, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmSubLayerSetSecurityInfoByKey0( engineHandle: ?HANDLE, key: ?*const Guid, securityInfo: u32, sidOwner: ?*const SID, sidGroup: ?*const SID, dacl: ?*const ACL, sacl: ?*const ACL, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmSubLayerSubscribeChanges0( engineHandle: ?HANDLE, subscription: ?*const FWPM_SUBLAYER_SUBSCRIPTION0, callback: ?FWPM_SUBLAYER_CHANGE_CALLBACK0, context: ?*c_void, changeHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmSubLayerUnsubscribeChanges0( engineHandle: ?HANDLE, changeHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmSubLayerSubscriptionsGet0( engineHandle: ?HANDLE, entries: ?*?*?*FWPM_SUBLAYER_SUBSCRIPTION0, numEntries: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmLayerGetById0( engineHandle: ?HANDLE, id: u16, layer: ?*?*FWPM_LAYER0, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmLayerGetByKey0( engineHandle: ?HANDLE, key: ?*const Guid, layer: ?*?*FWPM_LAYER0, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmLayerCreateEnumHandle0( engineHandle: ?HANDLE, enumTemplate: ?*const FWPM_LAYER_ENUM_TEMPLATE0, enumHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmLayerEnum0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*FWPM_LAYER0, numEntriesReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmLayerDestroyEnumHandle0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmLayerGetSecurityInfoByKey0( engineHandle: ?HANDLE, key: ?*const Guid, securityInfo: u32, sidOwner: ?*?PSID, sidGroup: ?*?PSID, dacl: ?*?*ACL, sacl: ?*?*ACL, securityDescriptor: ?*?*SECURITY_DESCRIPTOR, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmLayerSetSecurityInfoByKey0( engineHandle: ?HANDLE, key: ?*const Guid, securityInfo: u32, sidOwner: ?*const SID, sidGroup: ?*const SID, dacl: ?*const ACL, sacl: ?*const ACL, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmCalloutAdd0( engineHandle: ?HANDLE, callout: ?*const FWPM_CALLOUT0, sd: ?*SECURITY_DESCRIPTOR, id: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmCalloutDeleteById0( engineHandle: ?HANDLE, id: u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmCalloutDeleteByKey0( engineHandle: ?HANDLE, key: ?*const Guid, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmCalloutGetById0( engineHandle: ?HANDLE, id: u32, callout: ?*?*FWPM_CALLOUT0, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmCalloutGetByKey0( engineHandle: ?HANDLE, key: ?*const Guid, callout: ?*?*FWPM_CALLOUT0, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmCalloutCreateEnumHandle0( engineHandle: ?HANDLE, enumTemplate: ?*const FWPM_CALLOUT_ENUM_TEMPLATE0, enumHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmCalloutEnum0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*FWPM_CALLOUT0, numEntriesReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmCalloutDestroyEnumHandle0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmCalloutGetSecurityInfoByKey0( engineHandle: ?HANDLE, key: ?*const Guid, securityInfo: u32, sidOwner: ?*?PSID, sidGroup: ?*?PSID, dacl: ?*?*ACL, sacl: ?*?*ACL, securityDescriptor: ?*?*SECURITY_DESCRIPTOR, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmCalloutSetSecurityInfoByKey0( engineHandle: ?HANDLE, key: ?*const Guid, securityInfo: u32, sidOwner: ?*const SID, sidGroup: ?*const SID, dacl: ?*const ACL, sacl: ?*const ACL, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmCalloutSubscribeChanges0( engineHandle: ?HANDLE, subscription: ?*const FWPM_CALLOUT_SUBSCRIPTION0, callback: ?FWPM_CALLOUT_CHANGE_CALLBACK0, context: ?*c_void, changeHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmCalloutUnsubscribeChanges0( engineHandle: ?HANDLE, changeHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmCalloutSubscriptionsGet0( engineHandle: ?HANDLE, entries: ?*?*?*FWPM_CALLOUT_SUBSCRIPTION0, numEntries: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmFilterAdd0( engineHandle: ?HANDLE, filter: ?*const FWPM_FILTER0, sd: ?*SECURITY_DESCRIPTOR, id: ?*u64, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmFilterDeleteById0( engineHandle: ?HANDLE, id: u64, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmFilterDeleteByKey0( engineHandle: ?HANDLE, key: ?*const Guid, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmFilterGetById0( engineHandle: ?HANDLE, id: u64, filter: ?*?*FWPM_FILTER0, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmFilterGetByKey0( engineHandle: ?HANDLE, key: ?*const Guid, filter: ?*?*FWPM_FILTER0, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmFilterCreateEnumHandle0( engineHandle: ?HANDLE, enumTemplate: ?*const FWPM_FILTER_ENUM_TEMPLATE0, enumHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmFilterEnum0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*FWPM_FILTER0, numEntriesReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmFilterDestroyEnumHandle0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmFilterGetSecurityInfoByKey0( engineHandle: ?HANDLE, key: ?*const Guid, securityInfo: u32, sidOwner: ?*?PSID, sidGroup: ?*?PSID, dacl: ?*?*ACL, sacl: ?*?*ACL, securityDescriptor: ?*?*SECURITY_DESCRIPTOR, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmFilterSetSecurityInfoByKey0( engineHandle: ?HANDLE, key: ?*const Guid, securityInfo: u32, sidOwner: ?*const SID, sidGroup: ?*const SID, dacl: ?*const ACL, sacl: ?*const ACL, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmFilterSubscribeChanges0( engineHandle: ?HANDLE, subscription: ?*const FWPM_FILTER_SUBSCRIPTION0, callback: ?FWPM_FILTER_CHANGE_CALLBACK0, context: ?*c_void, changeHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmFilterUnsubscribeChanges0( engineHandle: ?HANDLE, changeHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmFilterSubscriptionsGet0( engineHandle: ?HANDLE, entries: ?*?*?*FWPM_FILTER_SUBSCRIPTION0, numEntries: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmGetAppIdFromFileName0( fileName: ?[*:0]const u16, appId: ?*?*FWP_BYTE_BLOB, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "fwpuclnt" fn FwpmBitmapIndexGet0( engineHandle: ?HANDLE, fieldId: ?*const Guid, idx: ?*u8, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "fwpuclnt" fn FwpmBitmapIndexFree0( engineHandle: ?HANDLE, fieldId: ?*const Guid, idx: ?*u8, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmIPsecTunnelAdd0( engineHandle: ?HANDLE, flags: u32, mainModePolicy: ?*const FWPM_PROVIDER_CONTEXT0, tunnelPolicy: ?*const FWPM_PROVIDER_CONTEXT0, numFilterConditions: u32, filterConditions: [*]const FWPM_FILTER_CONDITION0, sd: ?*SECURITY_DESCRIPTOR, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn FwpmIPsecTunnelAdd1( engineHandle: ?HANDLE, flags: u32, mainModePolicy: ?*const FWPM_PROVIDER_CONTEXT1, tunnelPolicy: ?*const FWPM_PROVIDER_CONTEXT1, numFilterConditions: u32, filterConditions: [*]const FWPM_FILTER_CONDITION0, keyModKey: ?*const Guid, sd: ?*SECURITY_DESCRIPTOR, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn FwpmIPsecTunnelAdd2( engineHandle: ?HANDLE, flags: u32, mainModePolicy: ?*const FWPM_PROVIDER_CONTEXT2, tunnelPolicy: ?*const FWPM_PROVIDER_CONTEXT2, numFilterConditions: u32, filterConditions: [*]const FWPM_FILTER_CONDITION0, keyModKey: ?*const Guid, sd: ?*SECURITY_DESCRIPTOR, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "fwpuclnt" fn FwpmIPsecTunnelAdd3( engineHandle: ?HANDLE, flags: u32, mainModePolicy: ?*const FWPM_PROVIDER_CONTEXT3_, tunnelPolicy: ?*const FWPM_PROVIDER_CONTEXT3_, numFilterConditions: u32, filterConditions: [*]const FWPM_FILTER_CONDITION0, keyModKey: ?*const Guid, sd: ?*SECURITY_DESCRIPTOR, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmIPsecTunnelDeleteByKey0( engineHandle: ?HANDLE, key: ?*const Guid, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn IPsecGetStatistics0( engineHandle: ?HANDLE, ipsecStatistics: ?*IPSEC_STATISTICS0, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn IPsecGetStatistics1( engineHandle: ?HANDLE, ipsecStatistics: ?*IPSEC_STATISTICS1, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn IPsecSaContextCreate0( engineHandle: ?HANDLE, outboundTraffic: ?*const IPSEC_TRAFFIC0, inboundFilterId: ?*u64, id: ?*u64, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn IPsecSaContextCreate1( engineHandle: ?HANDLE, outboundTraffic: ?*const IPSEC_TRAFFIC1, virtualIfTunnelInfo: ?*const IPSEC_VIRTUAL_IF_TUNNEL_INFO0, inboundFilterId: ?*u64, id: ?*u64, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn IPsecSaContextDeleteById0( engineHandle: ?HANDLE, id: u64, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn IPsecSaContextGetById0( engineHandle: ?HANDLE, id: u64, saContext: ?*?*IPSEC_SA_CONTEXT0, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn IPsecSaContextGetById1( engineHandle: ?HANDLE, id: u64, saContext: ?*?*IPSEC_SA_CONTEXT1, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn IPsecSaContextGetSpi0( engineHandle: ?HANDLE, id: u64, getSpi: ?*const IPSEC_GETSPI0, inboundSpi: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn IPsecSaContextGetSpi1( engineHandle: ?HANDLE, id: u64, getSpi: ?*const IPSEC_GETSPI1, inboundSpi: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn IPsecSaContextSetSpi0( engineHandle: ?HANDLE, id: u64, getSpi: ?*const IPSEC_GETSPI1, inboundSpi: u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn IPsecSaContextAddInbound0( engineHandle: ?HANDLE, id: u64, inboundBundle: ?*const IPSEC_SA_BUNDLE0, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn IPsecSaContextAddOutbound0( engineHandle: ?HANDLE, id: u64, outboundBundle: ?*const IPSEC_SA_BUNDLE0, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn IPsecSaContextAddInbound1( engineHandle: ?HANDLE, id: u64, inboundBundle: ?*const IPSEC_SA_BUNDLE1, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn IPsecSaContextAddOutbound1( engineHandle: ?HANDLE, id: u64, outboundBundle: ?*const IPSEC_SA_BUNDLE1, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn IPsecSaContextExpire0( engineHandle: ?HANDLE, id: u64, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn IPsecSaContextUpdate0( engineHandle: ?HANDLE, flags: u64, newValues: ?*const IPSEC_SA_CONTEXT1, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn IPsecSaContextCreateEnumHandle0( engineHandle: ?HANDLE, enumTemplate: ?*const IPSEC_SA_CONTEXT_ENUM_TEMPLATE0, enumHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn IPsecSaContextEnum0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*IPSEC_SA_CONTEXT0, numEntriesReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn IPsecSaContextEnum1( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*IPSEC_SA_CONTEXT1, numEntriesReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn IPsecSaContextDestroyEnumHandle0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn IPsecSaContextSubscribe0( engineHandle: ?HANDLE, subscription: ?*const IPSEC_SA_CONTEXT_SUBSCRIPTION0, callback: ?IPSEC_SA_CONTEXT_CALLBACK0, context: ?*c_void, eventsHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn IPsecSaContextUnsubscribe0( engineHandle: ?HANDLE, eventsHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn IPsecSaContextSubscriptionsGet0( engineHandle: ?HANDLE, entries: ?*?*?*IPSEC_SA_CONTEXT_SUBSCRIPTION0, numEntries: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn IPsecSaCreateEnumHandle0( engineHandle: ?HANDLE, enumTemplate: ?*const IPSEC_SA_ENUM_TEMPLATE0, enumHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn IPsecSaEnum0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*IPSEC_SA_DETAILS0, numEntriesReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn IPsecSaEnum1( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*IPSEC_SA_DETAILS1, numEntriesReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn IPsecSaDestroyEnumHandle0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn IPsecSaDbGetSecurityInfo0( engineHandle: ?HANDLE, securityInfo: u32, sidOwner: ?*?PSID, sidGroup: ?*?PSID, dacl: ?*?*ACL, sacl: ?*?*ACL, securityDescriptor: ?*?*SECURITY_DESCRIPTOR, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn IPsecSaDbSetSecurityInfo0( engineHandle: ?HANDLE, securityInfo: u32, sidOwner: ?*const SID, sidGroup: ?*const SID, dacl: ?*const ACL, sacl: ?*const ACL, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn IPsecDospGetStatistics0( engineHandle: ?HANDLE, idpStatistics: ?*IPSEC_DOSP_STATISTICS0, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn IPsecDospStateCreateEnumHandle0( engineHandle: ?HANDLE, enumTemplate: ?*const IPSEC_DOSP_STATE_ENUM_TEMPLATE0, enumHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn IPsecDospStateEnum0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*IPSEC_DOSP_STATE0, numEntries: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn IPsecDospStateDestroyEnumHandle0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn IPsecDospGetSecurityInfo0( engineHandle: ?HANDLE, securityInfo: u32, sidOwner: ?*?PSID, sidGroup: ?*?PSID, dacl: ?*?*ACL, sacl: ?*?*ACL, securityDescriptor: ?*?*SECURITY_DESCRIPTOR, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn IPsecDospSetSecurityInfo0( engineHandle: ?HANDLE, securityInfo: u32, sidOwner: ?*const SID, sidGroup: ?*const SID, dacl: ?*const ACL, sacl: ?*const ACL, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn IPsecKeyManagerAddAndRegister0( engineHandle: ?HANDLE, keyManager: ?*const IPSEC_KEY_MANAGER0, keyManagerCallbacks: ?*const IPSEC_KEY_MANAGER_CALLBACKS0, keyMgmtHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn IPsecKeyManagerUnregisterAndDelete0( engineHandle: ?HANDLE, keyMgmtHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn IPsecKeyManagersGet0( engineHandle: ?HANDLE, entries: ?*?*?*IPSEC_KEY_MANAGER0, numEntries: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn IPsecKeyManagerGetSecurityInfoByKey0( engineHandle: ?HANDLE, reserved: ?*const c_void, securityInfo: u32, sidOwner: ?*?PSID, sidGroup: ?*?PSID, dacl: ?*?*ACL, sacl: ?*?*ACL, securityDescriptor: ?*?*SECURITY_DESCRIPTOR, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn IPsecKeyManagerSetSecurityInfoByKey0( engineHandle: ?HANDLE, reserved: ?*const c_void, securityInfo: u32, sidOwner: ?*const SID, sidGroup: ?*const SID, dacl: ?*const ACL, sacl: ?*const ACL, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn IkeextGetStatistics0( engineHandle: ?HANDLE, ikeextStatistics: ?*IKEEXT_STATISTICS0, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn IkeextGetStatistics1( engineHandle: ?HANDLE, ikeextStatistics: ?*IKEEXT_STATISTICS1, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn IkeextSaDeleteById0( engineHandle: ?HANDLE, id: u64, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn IkeextSaGetById0( engineHandle: ?HANDLE, id: u64, sa: ?*?*IKEEXT_SA_DETAILS0, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn IkeextSaGetById1( engineHandle: ?HANDLE, id: u64, saLookupContext: ?*Guid, sa: ?*?*IKEEXT_SA_DETAILS1, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn IkeextSaGetById2( engineHandle: ?HANDLE, id: u64, saLookupContext: ?*Guid, sa: ?*?*IKEEXT_SA_DETAILS2, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn IkeextSaCreateEnumHandle0( engineHandle: ?HANDLE, enumTemplate: ?*const IKEEXT_SA_ENUM_TEMPLATE0, enumHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn IkeextSaEnum0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*IKEEXT_SA_DETAILS0, numEntriesReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn IkeextSaEnum1( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*IKEEXT_SA_DETAILS1, numEntriesReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn IkeextSaEnum2( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*IKEEXT_SA_DETAILS2, numEntriesReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn IkeextSaDestroyEnumHandle0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn IkeextSaDbGetSecurityInfo0( engineHandle: ?HANDLE, securityInfo: u32, sidOwner: ?*?PSID, sidGroup: ?*?PSID, dacl: ?*?*ACL, sacl: ?*?*ACL, securityDescriptor: ?*?*SECURITY_DESCRIPTOR, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn IkeextSaDbSetSecurityInfo0( engineHandle: ?HANDLE, securityInfo: u32, sidOwner: ?*const SID, sidGroup: ?*const SID, dacl: ?*const ACL, sacl: ?*const ACL, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmNetEventCreateEnumHandle0( engineHandle: ?HANDLE, enumTemplate: ?*const FWPM_NET_EVENT_ENUM_TEMPLATE0, enumHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmNetEventEnum0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*FWPM_NET_EVENT0, numEntriesReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn FwpmNetEventEnum1( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*FWPM_NET_EVENT1, numEntriesReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn FwpmNetEventEnum2( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*FWPM_NET_EVENT2, numEntriesReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows10.0.14393' pub extern "fwpuclnt" fn FwpmNetEventEnum3( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*FWPM_NET_EVENT3, numEntriesReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "fwpuclnt" fn FwpmNetEventEnum4( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*FWPM_NET_EVENT4_, numEntriesReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "fwpuclnt" fn FwpmNetEventEnum5( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*FWPM_NET_EVENT5_, numEntriesReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmNetEventDestroyEnumHandle0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmNetEventsGetSecurityInfo0( engineHandle: ?HANDLE, securityInfo: u32, sidOwner: ?*?PSID, sidGroup: ?*?PSID, dacl: ?*?*ACL, sacl: ?*?*ACL, securityDescriptor: ?*?*SECURITY_DESCRIPTOR, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.0.6000' pub extern "fwpuclnt" fn FwpmNetEventsSetSecurityInfo0( engineHandle: ?HANDLE, securityInfo: u32, sidOwner: ?*const SID, sidGroup: ?*const SID, dacl: ?*const ACL, sacl: ?*const ACL, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn FwpmNetEventSubscribe0( engineHandle: ?HANDLE, subscription: ?*const FWPM_NET_EVENT_SUBSCRIPTION0, callback: ?FWPM_NET_EVENT_CALLBACK0, context: ?*c_void, eventsHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn FwpmNetEventUnsubscribe0( engineHandle: ?HANDLE, eventsHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn FwpmNetEventSubscriptionsGet0( engineHandle: ?HANDLE, entries: ?*?*?*FWPM_NET_EVENT_SUBSCRIPTION0, numEntries: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn FwpmNetEventSubscribe1( engineHandle: ?HANDLE, subscription: ?*const FWPM_NET_EVENT_SUBSCRIPTION0, callback: ?FWPM_NET_EVENT_CALLBACK1, context: ?*c_void, eventsHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows10.0.14393' pub extern "fwpuclnt" fn FwpmNetEventSubscribe2( engineHandle: ?HANDLE, subscription: ?*const FWPM_NET_EVENT_SUBSCRIPTION0, callback: ?FWPM_NET_EVENT_CALLBACK2, context: ?*c_void, eventsHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "fwpuclnt" fn FwpmNetEventSubscribe3( engineHandle: ?HANDLE, subscription: ?*const FWPM_NET_EVENT_SUBSCRIPTION0, callback: ?FWPM_NET_EVENT_CALLBACK3, context: ?*c_void, eventsHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; pub extern "fwpuclnt" fn FwpmNetEventSubscribe4( engineHandle: ?HANDLE, subscription: ?*const FWPM_NET_EVENT_SUBSCRIPTION0, callback: ?FWPM_NET_EVENT_CALLBACK4, context: ?*c_void, eventsHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn FwpmSystemPortsGet0( engineHandle: ?HANDLE, sysPorts: ?*?*FWPM_SYSTEM_PORTS0, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn FwpmSystemPortsSubscribe0( engineHandle: ?HANDLE, reserved: ?*c_void, callback: ?FWPM_SYSTEM_PORTS_CALLBACK0, context: ?*c_void, sysPortsHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows6.1' pub extern "fwpuclnt" fn FwpmSystemPortsUnsubscribe0( engineHandle: ?HANDLE, sysPortsHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn FwpmConnectionGetById0( engineHandle: ?HANDLE, id: u64, connection: ?*?*FWPM_CONNECTION0, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn FwpmConnectionEnum0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, numEntriesRequested: u32, entries: ?*?*?*FWPM_CONNECTION0, numEntriesReturned: ?*u32, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn FwpmConnectionCreateEnumHandle0( engineHandle: ?HANDLE, enumTemplate: ?*const FWPM_CONNECTION_ENUM_TEMPLATE0, enumHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn FwpmConnectionDestroyEnumHandle0( engineHandle: ?HANDLE, enumHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn FwpmConnectionGetSecurityInfo0( engineHandle: ?HANDLE, securityInfo: u32, sidOwner: ?*?PSID, sidGroup: ?*?PSID, dacl: ?*?*ACL, sacl: ?*?*ACL, securityDescriptor: ?*?*SECURITY_DESCRIPTOR, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn FwpmConnectionSetSecurityInfo0( engineHandle: ?HANDLE, securityInfo: u32, sidOwner: ?*const SID, sidGroup: ?*const SID, dacl: ?*const ACL, sacl: ?*const ACL, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn FwpmConnectionSubscribe0( engineHandle: ?HANDLE, subscription: ?*const FWPM_CONNECTION_SUBSCRIPTION0, callback: ?FWPM_CONNECTION_CALLBACK0, context: ?*c_void, eventsHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn FwpmConnectionUnsubscribe0( engineHandle: ?HANDLE, eventsHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn FwpmvSwitchEventSubscribe0( engineHandle: ?HANDLE, subscription: ?*const FWPM_VSWITCH_EVENT_SUBSCRIPTION0, callback: ?FWPM_VSWITCH_EVENT_CALLBACK0, context: ?*c_void, subscriptionHandle: ?*?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn FwpmvSwitchEventUnsubscribe0( engineHandle: ?HANDLE, subscriptionHandle: ?HANDLE, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn FwpmvSwitchEventsGetSecurityInfo0( engineHandle: ?HANDLE, securityInfo: u32, sidOwner: ?*?PSID, sidGroup: ?*?PSID, dacl: ?*?*ACL, sacl: ?*?*ACL, securityDescriptor: ?*?*SECURITY_DESCRIPTOR, ) callconv(@import("std").os.windows.WINAPI) u32; // TODO: this type is limited to platform 'windows8.0' pub extern "fwpuclnt" fn FwpmvSwitchEventsSetSecurityInfo0( engineHandle: ?HANDLE, securityInfo: u32, sidOwner: ?*const SID, sidGroup: ?*const SID, dacl: ?*const ACL, sacl: ?*const ACL, ) callconv(@import("std").os.windows.WINAPI) u32; //-------------------------------------------------------------------------------- // Section: Unicode Aliases (0) //-------------------------------------------------------------------------------- const thismodule = @This(); pub usingnamespace switch (@import("../zig.zig").unicode_mode) { .ansi => struct { }, .wide => struct { }, .unspecified => if (@import("builtin").is_test) struct { } else struct { }, }; //-------------------------------------------------------------------------------- // Section: Imports (17) //-------------------------------------------------------------------------------- const Guid = @import("../zig.zig").Guid; const ACL = @import("../security.zig").ACL; const BOOL = @import("../foundation.zig").BOOL; const COMPARTMENT_ID = @import("../system/kernel.zig").COMPARTMENT_ID; const FILETIME = @import("../foundation.zig").FILETIME; const HANDLE = @import("../foundation.zig").HANDLE; const IN6_ADDR = @import("../networking/win_sock.zig").IN6_ADDR; const IN_ADDR = @import("../networking/win_sock.zig").IN_ADDR; const LUID = @import("../system/system_services.zig").LUID; const PSID = @import("../foundation.zig").PSID; const PSTR = @import("../foundation.zig").PSTR; const PWSTR = @import("../foundation.zig").PWSTR; const SCOPE_ID = @import("../networking/win_sock.zig").SCOPE_ID; const SEC_WINNT_AUTH_IDENTITY_W = @import("../system/rpc.zig").SEC_WINNT_AUTH_IDENTITY_W; const SECURITY_DESCRIPTOR = @import("../security.zig").SECURITY_DESCRIPTOR; const SID = @import("../security.zig").SID; const SID_AND_ATTRIBUTES = @import("../security.zig").SID_AND_ATTRIBUTES; test { // The following '_ = <FuncPtrType>' lines are a workaround for https://github.com/ziglang/zig/issues/4476 if (@hasDecl(@This(), "FWPM_PROVIDER_CHANGE_CALLBACK0")) { _ = FWPM_PROVIDER_CHANGE_CALLBACK0; } if (@hasDecl(@This(), "FWPM_PROVIDER_CONTEXT_CHANGE_CALLBACK0")) { _ = FWPM_PROVIDER_CONTEXT_CHANGE_CALLBACK0; } if (@hasDecl(@This(), "FWPM_SUBLAYER_CHANGE_CALLBACK0")) { _ = FWPM_SUBLAYER_CHANGE_CALLBACK0; } if (@hasDecl(@This(), "FWPM_CALLOUT_CHANGE_CALLBACK0")) { _ = FWPM_CALLOUT_CHANGE_CALLBACK0; } if (@hasDecl(@This(), "FWPM_FILTER_CHANGE_CALLBACK0")) { _ = FWPM_FILTER_CHANGE_CALLBACK0; } if (@hasDecl(@This(), "IPSEC_SA_CONTEXT_CALLBACK0")) { _ = IPSEC_SA_CONTEXT_CALLBACK0; } if (@hasDecl(@This(), "IPSEC_KEY_MANAGER_KEY_DICTATION_CHECK0")) { _ = IPSEC_KEY_MANAGER_KEY_DICTATION_CHECK0; } if (@hasDecl(@This(), "IPSEC_KEY_MANAGER_DICTATE_KEY0")) { _ = IPSEC_KEY_MANAGER_DICTATE_KEY0; } if (@hasDecl(@This(), "IPSEC_KEY_MANAGER_NOTIFY_KEY0")) { _ = IPSEC_KEY_MANAGER_NOTIFY_KEY0; } if (@hasDecl(@This(), "FWPM_NET_EVENT_CALLBACK0")) { _ = FWPM_NET_EVENT_CALLBACK0; } if (@hasDecl(@This(), "FWPM_NET_EVENT_CALLBACK1")) { _ = FWPM_NET_EVENT_CALLBACK1; } if (@hasDecl(@This(), "FWPM_NET_EVENT_CALLBACK2")) { _ = FWPM_NET_EVENT_CALLBACK2; } if (@hasDecl(@This(), "FWPM_NET_EVENT_CALLBACK3")) { _ = FWPM_NET_EVENT_CALLBACK3; } if (@hasDecl(@This(), "FWPM_NET_EVENT_CALLBACK4")) { _ = FWPM_NET_EVENT_CALLBACK4; } if (@hasDecl(@This(), "FWPM_SYSTEM_PORTS_CALLBACK0")) { _ = FWPM_SYSTEM_PORTS_CALLBACK0; } if (@hasDecl(@This(), "FWPM_CONNECTION_CALLBACK0")) { _ = FWPM_CONNECTION_CALLBACK0; } if (@hasDecl(@This(), "FWPM_VSWITCH_EVENT_CALLBACK0")) { _ = FWPM_VSWITCH_EVENT_CALLBACK0; } @setEvalBranchQuota( @import("std").meta.declarations(@This()).len * 3 ); // reference all the pub declarations if (!@import("builtin").is_test) return; inline for (@import("std").meta.declarations(@This())) |decl| { if (decl.is_pub) { _ = decl; } } }
deps/zigwin32/win32/network_management/windows_filtering_platform.zig
const std = @import("std"); const allocator = std.heap.page_allocator; const debug = std.debug; const assert = debug.assert; test "Run End-to-End test with Envoy proxy" { try requireWasmBinary(); const envoy = try requireRunAndWaitEnvoyStarted(); defer _ = envoy.kill() catch unreachable; errdefer printFileReader(envoy.stderr.?.reader()) catch unreachable; try requireHttpHeaderOperations(); try requireHttpBodyOperations(); try requireHttpRandomAuth(); try requireTcpDataSizeCounter(); try requireEnvoyLogs(envoy); } const E2EError = error{RequiredStringNotFound}; fn requireWasmBinary() !void { const cwd = try std.process.getCwdAlloc(allocator); defer allocator.free(cwd); const wasm_path = try std.fmt.allocPrint(allocator, "{s}/zig-out/bin/example.wasm", .{cwd}); defer allocator.free(wasm_path); const file = try std.fs.openFileAbsolute(wasm_path, .{}); defer file.close(); // Check Wasm header. var header_buf: [8]u8 = undefined; const read = try file.readAll(header_buf[0..]); assert(read == 8); const exp_header = [8]u8{ 0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00 }; assert(std.mem.eql(u8, header_buf[0..], exp_header[0..])); } fn requireRunAndWaitEnvoyStarted() !*std.ChildProcess { // Create a child process. const envoy_argv = [_][]const u8{ "envoy", "-c", "example/envoy.yaml", "--concurrency", "2" }; const envoy = try std.ChildProcess.init(envoy_argv[0..], allocator); envoy.stdin_behavior = .Ignore; envoy.stdout_behavior = .Ignore; envoy.stderr_behavior = .Pipe; // Run the process. try envoy.spawn(); errdefer _ = envoy.kill() catch unreachable; errdefer printFileReader(envoy.stderr.?.reader()) catch unreachable; // Check endpoints are healthy. for ([_][]const u8{ "localhost:8001", "localhost:18000", "localhost:18001", "localhost:18002", "localhost:18003", }) |endpoint| { const argv = [_][]const u8{ "curl", "-s", "--head", endpoint }; const exps = [_][]const u8{"HTTP/1.1"}; try requireExecStdout(std.time.ns_per_ms * 100, 10, argv[0..], exps[0..]); } std.time.sleep(std.time.ns_per_s * 5); return envoy; } fn printFileReader(reader: std.fs.File.Reader) !void { // TODO: this assumes that the reader continue emitting logs so that we wouldn't be blocked. // Use thread or async call (polling) equivalent so we won't be in deadlock in anycase. var timer = try std.time.Timer.start(); while (timer.read() / std.time.ns_per_s < 10) { if (try reader.readUntilDelimiterOrEofAlloc(allocator, '\n', 50 * 1024)) |line| { defer allocator.free(line); debug.print("{s}\n", .{line}); } } } fn requireExecStdout(comptime intervalInNanoSec: u64, comptime maxRetry: u64, argv: []const []const u8, expects: []const []const u8) !void { var i: u64 = 0; while (i < maxRetry) : (i += 1) { // Exec args. const res = try std.ChildProcess.exec(.{ .allocator = allocator, .argv = argv }); defer allocator.free(res.stdout); defer allocator.free(res.stderr); // Find all the expected strings. var j: u64 = 0; while (j < expects.len) : (j += 1) if (std.mem.indexOf(u8, res.stdout, expects[j]) == null) break; // If all found, break the loop. if (j == expects.len) break; std.time.sleep(intervalInNanoSec); } if (i == maxRetry) { return E2EError.RequiredStringNotFound; } } fn requireHttpHeaderOperations() !void { { debug.print("Running shared-random-value test..\n", .{}); const argv = [_][]const u8{ "curl", "--head", "localhost:18000/shared-random-value" }; const exps = [_][]const u8{"shared-random-value"}; try requireExecStdout(std.time.ns_per_ms * 1000, 50, argv[0..], exps[0..]); } { debug.print("Running badclusters test..\n", .{}); const argv = [_][]const u8{ "curl", "-s", "localhost:18000/badclusters" }; const exps = [_][]const u8{"admin::127.0.0.1:8001::health_flags::healthy"}; try requireExecStdout(std.time.ns_per_ms * 100, 50, argv[0..], exps[0..]); } { debug.print("Running original headers test..\n", .{}); const argv = [_][]const u8{ "curl", "-s", "--head", "localhost:18000?response-headers" }; const exps = [_][]const u8{ "cache-control: no-cache, max-age=0, zig-original", "proxy-wasm: zig-sdk" }; try requireExecStdout(std.time.ns_per_ms * 100, 50, argv[0..], exps[0..]); } { debug.print("Running force-500 test..\n", .{}); const argv = [_][]const u8{ "curl", "-s", "--head", "localhost:18000/force-500" }; const exps = [_][]const u8{"HTTP/1.1 500 Internal Server Error"}; try requireExecStdout(std.time.ns_per_ms * 100, 50, argv[0..], exps[0..]); } { debug.print("Running tick-count test..\n", .{}); const argv = [_][]const u8{ "curl", "-s", "--head", "localhost:18000?tick-count" }; const exps = [_][]const u8{"current-tick-count: "}; try requireExecStdout(std.time.ns_per_ms * 100, 50, argv[0..], exps[0..]); } } fn requireHttpBodyOperations() !void { { debug.print("Running echo body test..\n", .{}); const argv = [_][]const u8{ "curl", "-s", "localhost:18001/echo", "--data", "'this is my body'" }; const exps = [_][]const u8{"this is my body"}; try requireExecStdout(std.time.ns_per_ms * 1000, 50, argv[0..], exps[0..]); } { debug.print("Running sha256 response body test..\n", .{}); const argv = [_][]const u8{ "curl", "localhost:18001/stats?sha256-response" }; const exps = [_][]const u8{"response body sha256"}; try requireExecStdout(std.time.ns_per_ms * 1000, 50, argv[0..], exps[0..]); } } fn requireHttpRandomAuth() !void { const argv = [_][]const u8{ "curl", "-s", "--head", "localhost:18002" }; { debug.print("Running OK under random auth..\n", .{}); const exps = [_][]const u8{"HTTP/1.1 200 OK"}; try requireExecStdout(std.time.ns_per_ms * 100, 50, argv[0..], exps[0..]); } { debug.print("Running 403 at response..\n", .{}); const exps = [_][]const u8{ "HTTP/1.1 403 Forbidden", "forbidden-at: response" }; try requireExecStdout(std.time.ns_per_ms * 100, 50, argv[0..], exps[0..]); } { debug.print("Running 403 at request..\n", .{}); const exps = [_][]const u8{ "HTTP/1.1 403 Forbidden", "forbidden-at: request" }; try requireExecStdout(std.time.ns_per_ms * 100, 50, argv[0..], exps[0..]); } } fn requireTcpDataSizeCounter() !void { debug.print("Running TCP data size counter..\n", .{}); { const argv = [_][]const u8{ "curl", "localhost:18003" }; const exps = [_][]const u8{}; try requireExecStdout(std.time.ns_per_ms * 100, 50, argv[0..], exps[0..]); } { const argv = [_][]const u8{ "curl", "localhost:8001/stats" }; const exps = [_][]const u8{"zig_sdk_tcp_total_data_size:"}; try requireExecStdout(std.time.ns_per_ms * 100, 50, argv[0..], exps[0..]); } } fn requireEnvoyLogs(envoy: *std.ChildProcess) !void { const exps = [_][]const u8{ "wasm log http-header-operation ziglang_vm: plugin configuration: root=\"\", http=\"header-operation\", stream=\"\"", "wasm log http-body-operation ziglang_vm: plugin configuration: root=\"\", http=\"body-operation\", stream=\"\"", "wasm log tcp-total-data-size-counter ziglang_vm: plugin configuration: root=\"\", http=\"\", stream=\"total-data-size-counter\"", "wasm log http-header-operation ziglang_vm: request header: --> key: :method, value: HEAD", "wasm log http-body-operation ziglang_vm: response body sha256 (original size=", "wasm log http-random-auth ziglang_vm: uuid=", "wasm log tcp-total-data-size-counter ziglang_vm: upstream connection for peer at", "wasm log tcp-total-data-size-counter ziglang_vm: deleting tcp context", "wasm log singleton ziglang_vm: on tick called at", "wasm log singleton ziglang_vm: user-agent curl/", }; // Collect stderr until timeout // TODO: this assumes that the Envoy continue emitting logs so that we wouldn't be blocked. // Use thread or async call (polling) equivalent so we won't be in deadlock in anycase. const reader = envoy.stderr.?.reader(); var stderr = std.ArrayList(u8).init(allocator); defer stderr.deinit(); var timer = try std.time.Timer.start(); while (timer.read() / std.time.ns_per_s < 10) { if (try reader.readUntilDelimiterOrEofAlloc(allocator, '\n', 50 * 1024)) |line| { defer allocator.free(line); try stderr.appendSlice(line); } } // Check logs. for (exps) |exp| { debug.print("Checking '{s}' in Envoy logs..\n", .{exp}); if (std.mem.indexOf(u8, stderr.items, exp) == null) { return E2EError.RequiredStringNotFound; } } }
example/e2e_test.zig
const std = @import("std"); const expect = std.testing.expect; const ZigClangSourceLocation = @import("clang.zig").ZigClangSourceLocation; const Context = @import("translate_c.zig").Context; const failDecl = @import("translate_c.zig").failDecl; pub const TokenList = std.SegmentedList(CToken, 32); pub const CToken = struct { id: Id, bytes: []const u8 = "", num_lit_suffix: NumLitSuffix = .None, pub const Id = enum { CharLit, StrLit, NumLitInt, NumLitFloat, Identifier, Plus, Minus, Slash, LParen, RParen, Eof, Dot, Asterisk, // * Ampersand, // & And, // && Assign, // = Or, // || Bang, // ! Tilde, // ~ Shl, // << Shr, // >> Lt, // < Lte, // <= Gt, // > Gte, // >= Eq, // == Ne, // != Increment, // ++ Decrement, // -- Comma, Fn, Arrow, // -> LBrace, RBrace, Pipe, QuestionMark, Colon, }; pub const NumLitSuffix = enum { None, F, L, U, LU, LL, LLU, }; }; pub fn tokenizeCMacro(ctx: *Context, loc: ZigClangSourceLocation, name: []const u8, tl: *TokenList, chars: [*:0]const u8) !void { var index: usize = 0; var first = true; while (true) { const tok = try next(ctx, loc, name, chars, &index); if (tok.id == .StrLit or tok.id == .CharLit) try tl.push(try zigifyEscapeSequences(ctx, loc, name, tl.allocator, tok)) else try tl.push(tok); if (tok.id == .Eof) return; if (first) { // distinguish NAME (EXPR) from NAME(ARGS) first = false; if (chars[index] == '(') { try tl.push(.{ .id = .Fn, .bytes = "", }); } } } } fn zigifyEscapeSequences(ctx: *Context, loc: ZigClangSourceLocation, name: []const u8, allocator: *std.mem.Allocator, tok: CToken) !CToken { for (tok.bytes) |c| { if (c == '\\') { break; } } else return tok; var bytes = try allocator.alloc(u8, tok.bytes.len * 2); var state: enum { Start, Escape, Hex, Octal, } = .Start; var i: usize = 0; var count: u8 = 0; var num: u8 = 0; for (tok.bytes) |c| { switch (state) { .Escape => { switch (c) { 'n', 'r', 't', '\\', '\'', '\"' => { bytes[i] = c; }, '0'...'7' => { count += 1; num += c - '0'; state = .Octal; bytes[i] = 'x'; }, 'x' => { state = .Hex; bytes[i] = 'x'; }, 'a' => { bytes[i] = 'x'; i += 1; bytes[i] = '0'; i += 1; bytes[i] = '7'; }, 'b' => { bytes[i] = 'x'; i += 1; bytes[i] = '0'; i += 1; bytes[i] = '8'; }, 'f' => { bytes[i] = 'x'; i += 1; bytes[i] = '0'; i += 1; bytes[i] = 'C'; }, 'v' => { bytes[i] = 'x'; i += 1; bytes[i] = '0'; i += 1; bytes[i] = 'B'; }, '?' => { i -= 1; bytes[i] = '?'; }, 'u', 'U' => { try failDecl(ctx, loc, name, "macro tokenizing failed: TODO unicode escape sequences", .{}); return error.TokenizingFailed; }, else => { try failDecl(ctx, loc, name, "macro tokenizing failed: unknown escape sequence", .{}); return error.TokenizingFailed; }, } i += 1; if (state == .Escape) state = .Start; }, .Start => { if (c == '\\') { state = .Escape; } bytes[i] = c; i += 1; }, .Hex => { switch (c) { '0'...'9' => { num = std.math.mul(u8, num, 16) catch { try failDecl(ctx, loc, name, "macro tokenizing failed: hex literal overflowed", .{}); return error.TokenizingFailed; }; num += c - '0'; }, 'a'...'f' => { num = std.math.mul(u8, num, 16) catch { try failDecl(ctx, loc, name, "macro tokenizing failed: hex literal overflowed", .{}); return error.TokenizingFailed; }; num += c - 'a' + 10; }, 'A'...'F' => { num = std.math.mul(u8, num, 16) catch { try failDecl(ctx, loc, name, "macro tokenizing failed: hex literal overflowed", .{}); return error.TokenizingFailed; }; num += c - 'A' + 10; }, else => { i += std.fmt.formatIntBuf(bytes[i..], num, 16, false, std.fmt.FormatOptions{ .fill = '0', .width = 2 }); num = 0; if (c == '\\') state = .Escape else state = .Start; bytes[i] = c; i += 1; }, } }, .Octal => { const accept_digit = switch (c) { // The maximum length of a octal literal is 3 digits '0'...'7' => count < 3, else => false, }; if (accept_digit) { count += 1; num = std.math.mul(u8, num, 8) catch { try failDecl(ctx, loc, name, "macro tokenizing failed: octal literal overflowed", .{}); return error.TokenizingFailed; }; num += c - '0'; } else { i += std.fmt.formatIntBuf(bytes[i..], num, 16, false, std.fmt.FormatOptions{ .fill = '0', .width = 2 }); num = 0; count = 0; if (c == '\\') state = .Escape else state = .Start; bytes[i] = c; i += 1; } }, } } if (state == .Hex or state == .Octal) i += std.fmt.formatIntBuf(bytes[i..], num, 16, false, std.fmt.FormatOptions{ .fill = '0', .width = 2 }); return CToken{ .id = tok.id, .bytes = bytes[0..i], }; } fn next(ctx: *Context, loc: ZigClangSourceLocation, name: []const u8, chars: [*:0]const u8, i: *usize) !CToken { var state: enum { Start, SawLt, SawGt, SawPlus, SawMinus, SawAmpersand, SawPipe, SawBang, SawEq, CharLit, OpenComment, Comment, CommentStar, Backslash, String, Identifier, Decimal, Octal, SawZero, Hex, Bin, Float, ExpSign, FloatExp, FloatExpFirst, NumLitIntSuffixU, NumLitIntSuffixL, NumLitIntSuffixLL, NumLitIntSuffixUL, Done, } = .Start; var result = CToken{ .bytes = "", .id = .Eof, }; var begin_index: usize = 0; var digits: u8 = 0; var pre_escape = state; while (true) { const c = chars[i.*]; if (c == 0) { switch (state) { .Identifier, .Decimal, .Hex, .Bin, .Octal, .SawZero, .Float, .FloatExp, => { result.bytes = chars[begin_index..i.*]; return result; }, .Start, .SawMinus, .Done, .NumLitIntSuffixU, .NumLitIntSuffixL, .NumLitIntSuffixUL, .NumLitIntSuffixLL, .SawLt, .SawGt, .SawPlus, .SawAmpersand, .SawPipe, .SawBang, .SawEq, => { return result; }, .CharLit, .OpenComment, .Comment, .CommentStar, .Backslash, .String, .ExpSign, .FloatExpFirst, => { try failDecl(ctx, loc, name, "macro tokenizing failed: unexpected EOF", .{}); return error.TokenizingFailed; }, } } switch (state) { .Start => { switch (c) { ' ', '\t', '\x0B', '\x0C' => {}, '\'' => { state = .CharLit; result.id = .CharLit; begin_index = i.*; }, '\"' => { state = .String; result.id = .StrLit; begin_index = i.*; }, '/' => { state = .OpenComment; }, '\\' => { state = .Backslash; }, '\n', '\r' => { return result; }, 'a'...'z', 'A'...'Z', '_' => { state = .Identifier; result.id = .Identifier; begin_index = i.*; }, '1'...'9' => { state = .Decimal; result.id = .NumLitInt; begin_index = i.*; }, '0' => { state = .SawZero; result.id = .NumLitInt; begin_index = i.*; }, '.' => { result.id = .Dot; state = .Done; }, '<' => { result.id = .Lt; state = .SawLt; }, '>' => { result.id = .Gt; state = .SawGt; }, '(' => { result.id = .LParen; state = .Done; }, ')' => { result.id = .RParen; state = .Done; }, '*' => { result.id = .Asterisk; state = .Done; }, '+' => { result.id = .Plus; state = .SawPlus; }, '-' => { result.id = .Minus; state = .SawMinus; }, '!' => { result.id = .Bang; state = .SawBang; }, '~' => { result.id = .Tilde; state = .Done; }, '=' => { result.id = .Assign; state = .SawEq; }, ',' => { result.id = .Comma; state = .Done; }, '[' => { result.id = .LBrace; state = .Done; }, ']' => { result.id = .RBrace; state = .Done; }, '|' => { result.id = .Pipe; state = .SawPipe; }, '&' => { result.id = .Ampersand; state = .SawAmpersand; }, '?' => { result.id = .QuestionMark; state = .Done; }, ':' => { result.id = .Colon; state = .Done; }, else => { try failDecl(ctx, loc, name, "macro tokenizing failed: unexpected character '{c}'", .{c}); return error.TokenizingFailed; }, } }, .Done => return result, .SawMinus => { switch (c) { '>' => { result.id = .Arrow; state = .Done; }, '-' => { result.id = .Decrement; state = .Done; }, else => return result, } }, .SawPlus => { switch (c) { '+' => { result.id = .Increment; state = .Done; }, else => return result, } }, .SawLt => { switch (c) { '<' => { result.id = .Shl; state = .Done; }, '=' => { result.id = .Lte; state = .Done; }, else => return result, } }, .SawGt => { switch (c) { '>' => { result.id = .Shr; state = .Done; }, '=' => { result.id = .Gte; state = .Done; }, else => return result, } }, .SawPipe => { switch (c) { '|' => { result.id = .Or; state = .Done; }, else => return result, } }, .SawAmpersand => { switch (c) { '&' => { result.id = .And; state = .Done; }, else => return result, } }, .SawBang => { switch (c) { '=' => { result.id = .Ne; state = .Done; }, else => return result, } }, .SawEq => { switch (c) { '=' => { result.id = .Eq; state = .Done; }, else => return result, } }, .Float => { switch (c) { '.', '0'...'9' => {}, 'e', 'E' => { state = .ExpSign; }, 'f', 'F', => { result.num_lit_suffix = .F; result.bytes = chars[begin_index..i.*]; state = .Done; }, 'l', 'L' => { result.num_lit_suffix = .L; result.bytes = chars[begin_index..i.*]; state = .Done; }, else => { result.bytes = chars[begin_index..i.*]; return result; }, } }, .ExpSign => { switch (c) { '+', '-' => { state = .FloatExpFirst; }, '0'...'9' => { state = .FloatExp; }, else => { try failDecl(ctx, loc, name, "macro tokenizing failed: expected a digit or '+' or '-'", .{}); return error.TokenizingFailed; }, } }, .FloatExpFirst => { switch (c) { '0'...'9' => { state = .FloatExp; }, else => { try failDecl(ctx, loc, name, "macro tokenizing failed: expected a digit", .{}); return error.TokenizingFailed; }, } }, .FloatExp => { switch (c) { '0'...'9' => {}, 'f', 'F' => { result.num_lit_suffix = .F; result.bytes = chars[begin_index..i.*]; state = .Done; }, 'l', 'L' => { result.num_lit_suffix = .L; result.bytes = chars[begin_index..i.*]; state = .Done; }, else => { result.bytes = chars[begin_index..i.*]; return result; }, } }, .Decimal => { switch (c) { '0'...'9' => {}, '\'' => {}, 'u', 'U' => { state = .NumLitIntSuffixU; result.num_lit_suffix = .U; result.bytes = chars[begin_index..i.*]; }, 'l', 'L' => { state = .NumLitIntSuffixL; result.num_lit_suffix = .L; result.bytes = chars[begin_index..i.*]; }, '.' => { result.id = .NumLitFloat; state = .Float; }, else => { result.bytes = chars[begin_index..i.*]; return result; }, } }, .SawZero => { switch (c) { 'x', 'X' => { state = .Hex; }, 'b', 'B' => { state = .Bin; }, '.' => { state = .Float; result.id = .NumLitFloat; }, 'u', 'U' => { state = .NumLitIntSuffixU; result.num_lit_suffix = .U; result.bytes = chars[begin_index..i.*]; }, 'l', 'L' => { state = .NumLitIntSuffixL; result.num_lit_suffix = .L; result.bytes = chars[begin_index..i.*]; }, else => { i.* -= 1; state = .Octal; }, } }, .Octal => { switch (c) { '0'...'7' => {}, '8', '9' => { try failDecl(ctx, loc, name, "macro tokenizing failed: invalid digit '{c}' in octal number", .{c}); return error.TokenizingFailed; }, else => { result.bytes = chars[begin_index..i.*]; return result; }, } }, .Hex => { switch (c) { '0'...'9', 'a'...'f', 'A'...'F' => {}, 'u', 'U' => { // marks the number literal as unsigned state = .NumLitIntSuffixU; result.num_lit_suffix = .U; result.bytes = chars[begin_index..i.*]; }, 'l', 'L' => { // marks the number literal as long state = .NumLitIntSuffixL; result.num_lit_suffix = .L; result.bytes = chars[begin_index..i.*]; }, else => { result.bytes = chars[begin_index..i.*]; return result; }, } }, .Bin => { switch (c) { '0'...'1' => {}, '2'...'9' => { try failDecl(ctx, loc, name, "macro tokenizing failed: invalid digit '{c}' in binary number", .{c}); return error.TokenizingFailed; }, 'u', 'U' => { // marks the number literal as unsigned state = .NumLitIntSuffixU; result.num_lit_suffix = .U; result.bytes = chars[begin_index..i.*]; }, 'l', 'L' => { // marks the number literal as long state = .NumLitIntSuffixL; result.num_lit_suffix = .L; result.bytes = chars[begin_index..i.*]; }, else => { result.bytes = chars[begin_index..i.*]; return result; }, } }, .NumLitIntSuffixU => { switch (c) { 'l', 'L' => { result.num_lit_suffix = .LU; state = .NumLitIntSuffixUL; }, else => { return result; }, } }, .NumLitIntSuffixL => { switch (c) { 'l', 'L' => { result.num_lit_suffix = .LL; state = .NumLitIntSuffixLL; }, 'u', 'U' => { result.num_lit_suffix = .LU; state = .Done; }, else => { return result; }, } }, .NumLitIntSuffixLL => { switch (c) { 'u', 'U' => { result.num_lit_suffix = .LLU; state = .Done; }, else => { return result; }, } }, .NumLitIntSuffixUL => { switch (c) { 'l', 'L' => { result.num_lit_suffix = .LLU; state = .Done; }, else => { return result; }, } }, .Identifier => { switch (c) { '_', 'a'...'z', 'A'...'Z', '0'...'9' => {}, else => { result.bytes = chars[begin_index..i.*]; return result; }, } }, .String => { switch (c) { '\"' => { result.bytes = chars[begin_index .. i.* + 1]; state = .Done; }, else => {}, } }, .CharLit => { switch (c) { '\'' => { result.bytes = chars[begin_index .. i.* + 1]; state = .Done; }, else => {}, } }, .OpenComment => { switch (c) { '/' => { return result; }, '*' => { state = .Comment; }, else => { result.id = .Slash; state = .Done; }, } }, .Comment => { switch (c) { '*' => { state = .CommentStar; }, else => {}, } }, .CommentStar => { switch (c) { '/' => { state = .Start; }, else => { state = .Comment; }, } }, .Backslash => { switch (c) { ' ', '\t', '\x0B', '\x0C' => {}, '\n', '\r' => { state = .Start; }, else => { try failDecl(ctx, loc, name, "macro tokenizing failed: expected whitespace", .{}); return error.TokenizingFailed; }, } }, } i.* += 1; } unreachable; } fn expectTokens(tl: *TokenList, src: [*:0]const u8, expected: []CToken) void { // these can be undefined since they are only used for error reporting tokenizeCMacro(undefined, undefined, undefined, tl, src) catch unreachable; var it = tl.iterator(0); for (expected) |t| { var tok = it.next().?; std.testing.expectEqual(t.id, tok.id); if (t.bytes.len > 0) { //std.debug.warn(" {} = {}\n", .{tok.bytes, t.bytes}); std.testing.expectEqualSlices(u8, tok.bytes, t.bytes); } if (t.num_lit_suffix != .None) { std.testing.expectEqual(t.num_lit_suffix, tok.num_lit_suffix); } } std.testing.expect(it.next() == null); tl.shrink(0); } test "tokenize macro" { var tl = TokenList.init(std.heap.page_allocator); defer tl.deinit(); expectTokens(&tl, "TEST(0\n", &[_]CToken{ .{ .id = .Identifier, .bytes = "TEST" }, .{ .id = .Fn }, .{ .id = .LParen }, .{ .id = .NumLitInt, .bytes = "0" }, .{ .id = .Eof }, }); expectTokens(&tl, "__FLT_MIN_10_EXP__ -37\n", &[_]CToken{ .{ .id = .Identifier, .bytes = "__FLT_MIN_10_EXP__" }, .{ .id = .Minus }, .{ .id = .NumLitInt, .bytes = "37" }, .{ .id = .Eof }, }); expectTokens(&tl, "__llvm__ 1\n#define", &[_]CToken{ .{ .id = .Identifier, .bytes = "__llvm__" }, .{ .id = .NumLitInt, .bytes = "1" }, .{ .id = .Eof }, }); expectTokens(&tl, "TEST 2", &[_]CToken{ .{ .id = .Identifier, .bytes = "TEST" }, .{ .id = .NumLitInt, .bytes = "2" }, .{ .id = .Eof }, }); expectTokens(&tl, "FOO 0ull", &[_]CToken{ .{ .id = .Identifier, .bytes = "FOO" }, .{ .id = .NumLitInt, .bytes = "0", .num_lit_suffix = .LLU }, .{ .id = .Eof }, }); } test "tokenize macro ops" { var tl = TokenList.init(std.heap.page_allocator); defer tl.deinit(); expectTokens(&tl, "ADD A + B", &[_]CToken{ .{ .id = .Identifier, .bytes = "ADD" }, .{ .id = .Identifier, .bytes = "A" }, .{ .id = .Plus }, .{ .id = .Identifier, .bytes = "B" }, .{ .id = .Eof }, }); expectTokens(&tl, "ADD (A) + B", &[_]CToken{ .{ .id = .Identifier, .bytes = "ADD" }, .{ .id = .LParen }, .{ .id = .Identifier, .bytes = "A" }, .{ .id = .RParen }, .{ .id = .Plus }, .{ .id = .Identifier, .bytes = "B" }, .{ .id = .Eof }, }); expectTokens(&tl, "ADD (A) + B", &[_]CToken{ .{ .id = .Identifier, .bytes = "ADD" }, .{ .id = .LParen }, .{ .id = .Identifier, .bytes = "A" }, .{ .id = .RParen }, .{ .id = .Plus }, .{ .id = .Identifier, .bytes = "B" }, .{ .id = .Eof }, }); } test "escape sequences" { var buf: [1024]u8 = undefined; var alloc = std.heap.FixedBufferAllocator.init(buf[0..]); const a = &alloc.allocator; // these can be undefined since they are only used for error reporting expect(std.mem.eql(u8, (try zigifyEscapeSequences(undefined, undefined, undefined, a, .{ .id = .StrLit, .bytes = "\\x0077", })).bytes, "\\x77")); expect(std.mem.eql(u8, (try zigifyEscapeSequences(undefined, undefined, undefined, a, .{ .id = .StrLit, .bytes = "\\24500", })).bytes, "\\xa500")); expect(std.mem.eql(u8, (try zigifyEscapeSequences(undefined, undefined, undefined, a, .{ .id = .StrLit, .bytes = "\\x0077 abc", })).bytes, "\\x77 abc")); expect(std.mem.eql(u8, (try zigifyEscapeSequences(undefined, undefined, undefined, a, .{ .id = .StrLit, .bytes = "\\045abc", })).bytes, "\\x25abc")); expect(std.mem.eql(u8, (try zigifyEscapeSequences(undefined, undefined, undefined, a, .{ .id = .CharLit, .bytes = "\\0", })).bytes, "\\x00")); expect(std.mem.eql(u8, (try zigifyEscapeSequences(undefined, undefined, undefined, a, .{ .id = .CharLit, .bytes = "\\00", })).bytes, "\\x00")); expect(std.mem.eql(u8, (try zigifyEscapeSequences(undefined, undefined, undefined, a, .{ .id = .CharLit, .bytes = "\\000\\001", })).bytes, "\\x00\\x01")); expect(std.mem.eql(u8, (try zigifyEscapeSequences(undefined, undefined, undefined, a, .{ .id = .CharLit, .bytes = "\\000abc", })).bytes, "\\x00abc")); }
src-self-hosted/c_tokenizer.zig
const std = @import("std"); const io = std.io; const RawTerm = @import("term.zig").RawTerm; const cursor = @import("cursor.zig"); const ComptimeStringMap = std.ComptimeStringMap; // Reference: // https://en.wikipedia.org/wiki/ANSI_escape_code#Terminal_input_sequences // https://gitlab.redox-os.org/redox-os/termion/-/blob/8054e082b01c3f45f89f0db96bc374f1e378deb1/src/event.rs // https://gitlab.redox-os.org/redox-os/termion/-/blob/8054e082b01c3f45f89f0db96bc374f1e378deb1/src/input.rs const KeyMap = ComptimeStringMap(Key, .{ .{ "\x01", .ctrlA }, .{ "\x02", .ctrlB }, .{ "\x03", .ctrlC }, .{ "\x04", .ctrlD }, .{ "\x05", .ctrlE }, .{ "\x06", .ctrlF }, .{ "\x07", .ctrlG }, .{ "\x08", .ctrlH }, .{ "\x09", .ctrlI }, .{ "\x0A", .ctrlJ }, .{ "\x0B", .ctrlK }, .{ "\x0C", .ctrlL }, .{ "\x0D", .ctrlM }, .{ "\x0E", .ctrlN }, .{ "\x0F", .ctrlO }, .{ "\x10", .ctrlP }, .{ "\x11", .ctrlQ }, .{ "\x12", .ctrlR }, .{ "\x13", .ctrlS }, .{ "\x14", .ctrlT }, .{ "\x15", .ctrlU }, .{ "\x16", .ctrlV }, .{ "\x17", .ctrlW }, .{ "\x18", .ctrlX }, .{ "\x19", .ctrlY }, .{ "\x1A", .ctrlZ }, .{ "\x1B", .escape }, .{ "\x1C", .fs }, .{ "\x1D", .gs }, .{ "\x1E", .rs }, .{ "\x1F", .us }, .{ "\x7F", .delete }, }); pub const Key = union(enum) { up, down, right, left, /// char is an array because it can contain utf-8 chars /// it will ALWAYS contains at least one char // TODO: Unicode compatible char: u21, fun: u8, alt: u8, // ctrl keys ctrlA, ctrlB, ctrlC, ctrlD, ctrlE, ctrlF, ctrlG, ctrlH, ctrlI, ctrlJ, ctrlK, ctrlL, ctrlM, ctrlN, ctrlO, ctrlP, ctrlQ, ctrlR, ctrlS, ctrlT, ctrlU, ctrlV, ctrlW, ctrlX, ctrlY, ctrlZ, escape, fs, gs, rs, us, delete, }; /// Returns the next event received. /// If raw term is `.blocking` or term is canonical it will block until read at least one event. /// otherwise it will return `.none` if it didnt read any event pub fn next(buf: []const u8) !EventParseResult { if (buf.len == 0) { return .none; } return switch (buf[0]) { '\x1b' => { if (buf.len == 1) { return EventParseResult{ .event = .{ .bytes_read = 1, .event = Event{ .key = .escape } } }; } switch (buf[1]) { // can be fn (1 - 4) 'O' => { if (buf.len == 2) { return .not_supported; } return EventParseResult{ .event = .{ .bytes_read = 3, .event = Event{ .key = Key{ .fun = (buf[2] - 'O') } }, } }; }, // csi '[' => { return try parse_cs(buf[2..]); }, else => return .not_supported, } }, // ctrl arm + specials '\x01'...'\x1A', '\x1C'...'\x1F', '\x7F' => EventParseResult{ .event = .{ .bytes_read = 1, .event = Event{ .key = KeyMap.get(buf[0..1]).? }, } }, // chars else => { var len = try std.unicode.utf8ByteSequenceLength(buf[0]); if (buf.len < len) { return .incomplete; } else { return EventParseResult{ .event = .{ .bytes_read = len, .event = Event{ .key = Key{ .char = try std.unicode.utf8Decode(buf[0..len]) } }, } }; } }, }; } fn parse_cs(buf: []const u8) !EventParseResult { if (buf.len == 0) { return .incomplete; } return switch (buf[0]) { // keys 'A' => EventParseResult{ .event = .{ .event = Event{ .key = .up }, .bytes_read = 3 } }, 'B' => EventParseResult{ .event = .{ .event = Event{ .key = .down }, .bytes_read = 3 } }, 'C' => EventParseResult{ .event = .{ .event = Event{ .key = .right }, .bytes_read = 3 } }, 'D' => EventParseResult{ .event = .{ .event = Event{ .key = .left }, .bytes_read = 3 } }, '1'...'2' => { if (buf.len < 2) { return .incomplete; } return switch (buf[1]) { '5' => EventParseResult{ .event = .{ .event = Event{ .key = Key{ .fun = 5 } }, .bytes_read = 5 } }, '7' => EventParseResult{ .event = .{ .event = Event{ .key = Key{ .fun = 6 } }, .bytes_read = 5 } }, '8' => EventParseResult{ .event = .{ .event = Event{ .key = Key{ .fun = 7 } }, .bytes_read = 5 } }, '9' => EventParseResult{ .event = .{ .event = Event{ .key = Key{ .fun = 8 } }, .bytes_read = 5 } }, '0' => EventParseResult{ .event = .{ .event = Event{ .key = Key{ .fun = 9 } }, .bytes_read = 5 } }, '1' => EventParseResult{ .event = .{ .event = Event{ .key = Key{ .fun = 10 } }, .bytes_read = 5 } }, '3' => EventParseResult{ .event = .{ .event = Event{ .key = Key{ .fun = 11 } }, .bytes_read = 5 } }, '4' => EventParseResult{ .event = .{ .event = Event{ .key = Key{ .fun = 12 } }, .bytes_read = 5 } }, else => .not_supported, }; }, else => .not_supported, }; } fn read_until(buf: []const u8, del: u8) !usize { var offset: usize = 0; while (offset < buf.len) { offset += 1; if (buf[offset] == del) { return offset; } } return error.CantReadEvent; } pub const CursorLocation = struct { row: usize, col: usize, }; pub const Event = union(enum) { key: Key, // cursor_report: CursorLocation, // resize, // mouse, }; pub const EventParseResult = union(enum) { none, not_supported, incomplete, event: struct { bytes_read: usize, event: Event, }, }; fn test_event_equal(bytes: []const u8, expected: Event) !void { try std.testing.expectEqual(expected, (try next(bytes)).event.event); } test "ctrl keys" { try test_event_equal("\x03", Event{ .key = Key.ctrlC }); try test_event_equal("\x0a", Event{ .key = Key.ctrlJ }); // aka newline try test_event_equal("\x0d", Event{ .key = Key.ctrlM }); // aka carriage return try test_event_equal("\x1b", Event{ .key = Key.escape }); } test "low function keys" { try test_event_equal("\x1bOP", Event{ .key = Key{ .fun = 1 } }); try test_event_equal("\x1bOQ", Event{ .key = Key{ .fun = 2 } }); try test_event_equal("\x1bOR", Event{ .key = Key{ .fun = 3 } }); try test_event_equal("\x1bOS", Event{ .key = Key{ .fun = 4 } }); } test "high function keys" { try test_event_equal("\x1b[15~", Event{ .key = Key{ .fun = 5 } }); try test_event_equal("\x1b[17~", Event{ .key = Key{ .fun = 6 } }); try test_event_equal("\x1b[18~", Event{ .key = Key{ .fun = 7 } }); try test_event_equal("\x1b[19~", Event{ .key = Key{ .fun = 8 } }); try test_event_equal("\x1b[20~", Event{ .key = Key{ .fun = 9 } }); try test_event_equal("\x1b[21~", Event{ .key = Key{ .fun = 10 } }); try test_event_equal("\x1b[23~", Event{ .key = Key{ .fun = 11 } }); try test_event_equal("\x1b[24~", Event{ .key = Key{ .fun = 12 } }); } test "arrow keys" { try test_event_equal("\x1b[A", Event{ .key = Key.up }); try test_event_equal("\x1b[B", Event{ .key = Key.down }); try test_event_equal("\x1b[C", Event{ .key = Key.right }); try test_event_equal("\x1b[D", Event{ .key = Key.left }); } test "normal characters" { try test_event_equal("q", Event{ .key = Key{ .char = 'q' } }); try test_event_equal("😁", Event{ .key = Key{ .char = '😁' } }); } test "incompletes" { // Utf8 incomplete code point try std.testing.expectEqual(try next(&[_]u8{0b11000000}), .incomplete); // Incomplete csi sequence try std.testing.expectEqual(try next("\x1b["), .incomplete); // incomplete prefix of a supported command sequence try std.testing.expectEqual(try next("\x1b[1"), .incomplete); // (compared to unsupported command sequences) try std.testing.expectEqual(try next("\x1b[34~"), .not_supported); } // For example, pasting into the terminal // Or, maybe your program just doesn't read often enough // and the user typed multiple characters test "long text" { var event = (try next("abcdefg")).event.event; try std.testing.expectEqual(Event{ .key = Key{ .char = 'a' } }, event); }
src/event.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const common = @import("common.zig"); const instruction_ = @import("../instruction.zig"); const Op = instruction_.Op; const Addressing = instruction_.Addressing; const Access = instruction_.Access; const Instruction = instruction_.Instruction; const opToString = instruction_.opToString; const console_ = @import("../console.zig"); const Config = console_.Config; const Console = console_.Console; const Cart = @import("../cart.zig").Cart; const Ppu = @import("../ppu.zig").Ppu; const Apu = @import("../apu.zig").Apu; const Controller = @import("../controller.zig").Controller; const flags = @import("../flags.zig"); pub fn Cpu(comptime config: Config) type { return struct { const Self = @This(); reg: common.Registers, mem: Memory(config), ppu: *Ppu(config), apu: *Apu(config), irq_pin: IrqSource = std.mem.zeroes(IrqSource), nmi_pin: bool = false, interrupt_acknowledged: bool = false, interrupt_at_check: Interrupt = undefined, cycles: usize = 0, state: ExecState = .{ .opcode = 0, .op = .op_brk, .addressing = .implied, .access = .read, }, const IrqSource = packed struct { brk: bool, apu_frame_counter: bool, mapper: bool, padding: u5, pub fn value(self: IrqSource) u8 { return @bitCast(u8, self); } }; const Interrupt = enum { irq, nmi, }; const ExecState = struct { opcode: u8, op: Op(.accurate), addressing: Addressing(.accurate), access: Access, cycle: u4 = 0, // values constructed during opcode execution // use is instruction specific c_byte: u8 = 0, c_addr: u16 = 0, }; pub fn init(console: *Console(config)) Self { return Self{ .reg = common.Registers.startup(), .mem = Memory(config).zeroes(&console.cart, &console.ppu, &console.apu, &console.controller), .ppu = &console.ppu, .apu = &console.apu, }; } pub fn deinit(_: Self) void {} pub fn reset(self: *Self) void { flags.setMask(u16, &self.reg.pc, self.mem.peek(0xfffc), 0xff); flags.setMask(u16, &self.reg.pc, @as(u16, self.mem.peek(0xfffd)) << 8, 0xff00); std.log.debug("PC set to {x:0>4}", .{self.reg.pc}); } pub fn setIrqSource(self: *Self, comptime source: []const u8) void { @field(self.irq_pin, source) = true; } pub fn clearIrqSource(self: *Self, comptime source: []const u8) void { @field(self.irq_pin, source) = false; } pub fn setNmi(self: *Self) void { self.nmi_pin = true; } fn dma(self: *Self, addr_high: u8) void { // will set open_bus via mem.read, check if accurate const oam_addr = self.ppu.reg.oam_addr; var i: usize = 0; while (i < 256) : (i += 1) { const oam_i: u8 = oam_addr +% @truncate(u8, i); self.ppu.oam.primary[oam_i] = self.mem.read((@as(u16, addr_high) << 8) | @truncate(u8, i)); common.cpuCycled(self); common.cpuCycled(self); } } fn readStack(self: *Self) u8 { return self.mem.read(0x100 | @as(u9, self.reg.s)); } fn pushStack(self: *Self, val: u8) void { self.mem.write(0x100 | @as(u9, self.reg.s), val); self.reg.s -%= 1; } fn cycleSideEffects(self: *Self) void { common.cpuCycled(self); self.state.cycle +%= 1; self.cycles += 1; } pub fn runStep(self: *Self) void { // TODO: accurate interrupt polling if (!self.interrupt_acknowledged) { switch (self.state.cycle) { 0 => if (!self.pollInterrupt()) { self.runCycle0(); }, 1 => self.runCycle1(), 2 => self.runCycle2(), 3 => self.runCycle3(), 4 => self.runCycle4(), 5 => self.runCycle5(), 6 => self.runCycle6(), 7 => self.runCycle7(), // 8 => {}, else => unreachable, } } if (self.interrupt_acknowledged) { self.execInterrupt(); } if (@import("build_options").log_step) { self.logCycle(); } self.cycleSideEffects(); } /// Dummy read fn readNextByte(self: *Self) void { _ = self.mem.read(self.reg.pc); } /// Increment PC, byte is part of instruction fn fetchNextByte(self: *Self) u8 { self.readNextByte(); self.reg.pc +%= 1; return self.mem.open_bus; } fn finishInstruction(self: *Self) void { // janky way to get it back to 0 as it's incremented right after this self.state.cycle = std.math.maxInt(u4); } fn pollInterrupt(self: *Self) bool { if (self.nmi_pin or (!self.reg.getFlag("I") and self.irq_pin.value() != 0)) { self.state.cycle = 0; self.interrupt_acknowledged = true; return true; } return false; } fn execInterrupt(self: *Self) void { switch (self.state.cycle) { 0 => { self.readNextByte(); self.state.op = .op_brk; self.state.opcode = 0; }, 1 => self.readNextByte(), 2 => self.pushStack(@truncate(u8, self.reg.pc >> 8)), 3 => self.pushStack(@truncate(u8, self.reg.pc)), 4 => { const brk_flag = if (self.irq_pin.brk) @as(u8, 0x10) else 0; self.pushStack(self.reg.p | 0b0010_0000 | brk_flag); if (self.nmi_pin) { self.interrupt_at_check = .nmi; self.nmi_pin = false; } else { self.interrupt_at_check = .irq; self.irq_pin.brk = false; } }, 5 => { const addr: u16 = switch (self.interrupt_at_check) { .irq => 0xfffe, .nmi => 0xfffa, }; const low = self.mem.read(addr); flags.setMask(u16, &self.reg.pc, low, 0xff); self.reg.setFlag("I", true); }, 6 => { const addr: u16 = switch (self.interrupt_at_check) { .irq => 0xffff, .nmi => 0xfffb, }; const high: u16 = self.mem.read(addr); flags.setMask(u16, &self.reg.pc, high << 8, 0xff00); self.interrupt_acknowledged = false; self.finishInstruction(); }, else => unreachable, } } fn setStateFromOpcode(self: *Self, opcode: u8) void { const instruction = Instruction(.accurate).decode(opcode); self.state.opcode = opcode; self.state.op = instruction.op; self.state.addressing = instruction.addressing; self.state.access = instruction.access; } fn runCycle0(self: *Self) void { const opcode = self.fetchNextByte(); self.setStateFromOpcode(opcode); } fn runCycle1(self: *Self) void { switch (self.state.addressing) { .special => self.runCycle1Special(), .absolute, .absoluteX, .absoluteY => _ = self.fetchNextByte(), .indirectX, .indirectY, .relative => self.state.c_byte = self.fetchNextByte(), .implied => self.runCycle1Implied(), .immediate => self.runCycle1Immediate(), .zeroPage, .zeroPageX, .zeroPageY => self.state.c_addr = self.fetchNextByte(), } } fn runCycle2(self: *Self) void { switch (self.state.addressing) { .special => self.runCycle2Special(), .absolute => self.runCycle2Absolute(), .absoluteX => self.runCycle2AbsoluteIndexed(self.reg.x), .absoluteY => self.runCycle2AbsoluteIndexed(self.reg.y), .indirectX => self.runCycle2IndirectX(), .indirectY => _ = self.mem.read(self.state.c_byte), .relative => self.runCycle2Relative(), .zeroPage => self.runCycleAccess0(), .zeroPageX => self.runCycle2ZpIndirect(self.reg.x), .zeroPageY => self.runCycle2ZpIndirect(self.reg.y), else => unreachable, } } fn runCycle3(self: *Self) void { switch (self.state.addressing) { .special => self.runCycle3Special(), .absolute => self.runCycleAccess0(), .absoluteX => self.runCycle3AbsoluteIndexed(self.reg.x), .absoluteY => self.runCycle3AbsoluteIndexed(self.reg.y), .indirectX => _ = self.mem.read(self.state.c_byte), .indirectY => self.runCycle3IndirectY(), .relative => self.runCycle3Relative(), .zeroPage => self.runCycleAccess1(), .zeroPageX, .zeroPageY => self.runCycleAccess0(), else => unreachable, } } fn runCycle4(self: *Self) void { switch (self.state.addressing) { .special => self.runCycle4Special(), .absolute => self.runCycleAccess1(), .absoluteX, .absoluteY => self.runCycleAccess0(), .relative => self.runCycle4Relative(), .indirectX => self.runCycle4IndirectX(), .indirectY => self.runCycle4IndirectY(), .zeroPage => self.runCycleAccess2(), .zeroPageX, .zeroPageY => self.runCycleAccess1(), else => unreachable, } } fn runCycle5(self: *Self) void { switch (self.state.addressing) { .special => self.runCycle5Special(), .absolute => self.runCycleAccess2(), .absoluteX, .absoluteY => self.runCycleAccess1(), .indirectX, .indirectY => self.runCycleAccess0(), .zeroPageX, .zeroPageY => self.runCycleAccess2(), else => unreachable, } } fn runCycle6(self: *Self) void { switch (self.state.addressing) { .absoluteX, .absoluteY => self.runCycleAccess2(), .indirectX, .indirectY => self.runCycleAccess1(), else => unreachable, } } fn runCycle7(self: *Self) void { switch (self.state.addressing) { .indirectX, .indirectY => self.runCycleAccess2(), else => unreachable, } } /// These are for a pattern that seems to usually be followed /// after addressing specific logic /// The cycle they occur on relative to the current instruction /// depends on the addressing mode fn runCycleAccess0(self: *Self) void { switch (self.state.access) { .read => { self.state.c_byte = self.mem.read(self.state.c_addr); self.execOpcode(); }, .rmw => self.state.c_byte = self.mem.read(self.state.c_addr), .write => self.execOpcode(), else => unreachable, } } fn runCycleAccess1(self: *Self) void { std.debug.assert(self.state.access == .rmw); self.mem.write(self.state.c_addr, self.state.c_byte); } fn runCycleAccess2(self: *Self) void { std.debug.assert(self.state.access == .rmw); self.execOpcode(); } fn runCycle1Special(self: *Self) void { switch (self.state.op) { .op_brk, .op_jmp, .op_jsr => self.state.c_byte = self.fetchNextByte(), .op_rti, .op_rts, .op_pha, .op_php, .op_pla, .op_plp => self.readNextByte(), else => unreachable, } } fn runCycle1Implied(self: *Self) void { self.readNextByte(); self.execOpcode(); } fn runCycle1Immediate(self: *Self) void { self.state.c_byte = self.fetchNextByte(); self.execOpcode(); } fn runCycle2Special(self: *Self) void { switch (self.state.op) { .op_brk => { self.setIrqSource("brk"); self.interrupt_acknowledged = true; self.state.cycle = 2; }, .op_jmp => switch (self.state.opcode) { 0x4c => { const low = self.state.c_byte; const high: u16 = self.fetchNextByte(); self.reg.pc = (high << 8) | low; self.finishInstruction(); }, 0x6c => { const low = self.state.c_byte; const high: u16 = self.fetchNextByte(); self.state.c_addr = (high << 8) | low; }, else => unreachable, }, .op_jsr => {}, // unsure/subtle .op_pha => { self.pushStack(self.reg.a); self.finishInstruction(); }, .op_php => { self.pushStack(self.reg.p | 0b0011_0000); self.finishInstruction(); }, .op_pla, .op_plp, .op_rti, .op_rts => self.reg.s +%= 1, else => unreachable, } } fn runCycle2Absolute(self: *Self) void { const low = self.mem.open_bus; const high: u16 = self.fetchNextByte(); self.state.c_addr = (high << 8) | low; } fn runCycle2AbsoluteIndexed(self: *Self, register: u8) void { const low = self.mem.open_bus +% register; const high: u16 = self.fetchNextByte(); self.state.c_byte = low; self.state.c_addr = (high << 8) | low; } fn runCycle2IndirectX(self: *Self) void { _ = self.mem.read(self.state.c_byte); self.state.c_byte +%= self.reg.x; } fn runCycle2Relative(self: *Self) void { self.readNextByte(); const cond = switch (self.state.op) { .op_bpl => !self.reg.getFlag("N"), .op_bmi => self.reg.getFlag("N"), .op_bvc => !self.reg.getFlag("V"), .op_bvs => self.reg.getFlag("V"), .op_bcc => !self.reg.getFlag("C"), .op_bcs => self.reg.getFlag("C"), .op_bne => !self.reg.getFlag("Z"), .op_beq => self.reg.getFlag("Z"), else => unreachable, }; if (cond) { const new = @bitCast(u16, @bitCast(i16, self.reg.pc) +% @bitCast(i8, self.state.c_byte)); flags.setMask(u16, &self.reg.pc, new, 0xff); self.state.c_addr = new; } else { self.reg.pc +%= 1; self.state.cycle = 0; const opcode = self.mem.open_bus; self.setStateFromOpcode(opcode); } } fn runCycle2ZpIndirect(self: *Self, register: u8) void { _ = self.mem.read(self.state.c_addr); flags.setMask(u16, &self.state.c_addr, self.state.c_addr +% register, 0xff); } fn runCycle3Special(self: *Self) void { switch (self.state.op) { .op_jmp => { std.debug.assert(self.state.opcode == 0x6c); self.state.c_byte = self.mem.read(self.state.c_addr); }, .op_jsr => self.pushStack(@truncate(u8, self.reg.pc >> 8)), .op_pla => { self.reg.a = self.readStack(); self.reg.setFlagsNZ(self.reg.a); self.finishInstruction(); }, .op_plp => { self.reg.p = self.readStack(); self.finishInstruction(); }, .op_rti => { self.reg.p = self.readStack(); self.reg.s +%= 1; }, .op_rts => { flags.setMask(u16, &self.reg.pc, self.readStack(), 0xff); self.reg.s +%= 1; }, else => unreachable, } } fn runCycle3AbsoluteIndexed(self: *Self, register: u8) void { const low = self.state.c_byte; self.state.c_byte = self.mem.read(self.state.c_addr); if (register > low) { self.state.c_addr +%= 0x100; } else if (self.state.access == .read) { self.execOpcode(); } } fn runCycle3IndirectY(self: *Self) void { const low = self.mem.open_bus +% self.reg.y; const high: u16 = self.mem.read(self.state.c_byte +% 1); self.state.c_byte = low; self.state.c_addr = (high << 8) | low; } fn runCycle3Relative(self: *Self) void { self.readNextByte(); if (self.reg.pc != self.state.c_addr) { self.reg.pc = self.state.c_addr; } else { self.reg.pc +%= 1; self.state.cycle = 0; const opcode = self.mem.open_bus; self.setStateFromOpcode(opcode); } } fn runCycle4Special(self: *Self) void { switch (self.state.op) { .op_jmp => { std.debug.assert(self.state.opcode == 0x6c); flags.setMask(u16, &self.state.c_addr, self.state.c_addr +% 1, 0xff); const low = self.state.c_byte; const high: u16 = self.mem.read(self.state.c_addr); self.reg.pc = (high << 8) | low; self.finishInstruction(); }, .op_jsr => self.pushStack(@truncate(u8, self.reg.pc)), .op_rti => { flags.setMask(u16, &self.reg.pc, self.readStack(), 0xff); self.reg.s +%= 1; }, .op_rts => flags.setMask(u16, &self.reg.pc, @as(u16, self.readStack()) << 8, 0xff00), else => unreachable, } } fn runCycle4IndirectX(self: *Self) void { const low = self.mem.open_bus; const high: u16 = self.mem.read(self.state.c_byte +% 1); self.state.c_addr = (high << 8) | low; } fn runCycle4IndirectY(self: *Self) void { const byte = self.mem.read(self.state.c_addr); if (self.reg.y > self.state.c_byte) { self.state.c_addr +%= 0x100; } else if (self.state.access == .read) { self.state.c_byte = byte; self.execOpcode(); } } fn runCycle4Relative(self: *Self) void { self.state.cycle = 0; const opcode = self.fetchNextByte(); self.setStateFromOpcode(opcode); } fn runCycle5Special(self: *Self) void { switch (self.state.op) { .op_jsr => { const low = self.state.c_byte; const high: u16 = self.mem.read(self.reg.pc); self.reg.pc = (high << 8) | low; self.finishInstruction(); }, .op_rti => { flags.setMask(u16, &self.reg.pc, @as(u16, self.readStack()) << 8, 0xff00); self.finishInstruction(); }, .op_rts => { self.reg.pc +%= 1; self.finishInstruction(); }, else => unreachable, } } /// Either return c_byte or, if it's an implied instruction, return A fn getByteMaybeAcc(self: Self) u8 { if (self.state.addressing == .implied) { return self.reg.a; } else { return self.state.c_byte; } } fn setByteMaybeAcc(self: *Self, val: u8) void { if (self.state.addressing == .implied) { self.reg.a = val; } else { self.mem.write(self.state.c_addr, val); } } fn execOpcode(self: *Self) void { const byte = self.state.c_byte; const addr = self.state.c_addr; switch (self.state.op) { .op_bpl, .op_bmi, .op_bvc, .op_bvs, .op_bcc, .op_bcs, .op_bne, .op_beq => unreachable, .op_jmp, .op_jsr => unreachable, .op_adc => self.execOpcodeAdc(false), .op_and => { self.reg.a &= byte; self.reg.setFlagsNZ(self.reg.a); }, .op_asl => { const val = self.getByteMaybeAcc(); const modified = val << 1; self.setByteMaybeAcc(modified); self.reg.setFlagsNZ(modified); self.reg.setFlag("C", val & 0x80 != 0); }, .op_bit => { const val = self.reg.a & byte; self.reg.setFlags("NVZ", (byte & 0xc0) | @as(u8, @boolToInt(val == 0)) << 1); }, .op_clc => self.reg.setFlag("C", false), .op_cld => self.reg.setFlag("D", false), .op_cli => self.reg.setFlag("I", false), .op_clv => self.reg.setFlag("V", false), .op_cmp => self.execOpcodeCmp(self.reg.a), .op_cpx => self.execOpcodeCmp(self.reg.x), .op_cpy => self.execOpcodeCmp(self.reg.y), .op_dec => { self.mem.write(addr, byte -% 1); self.reg.setFlagsNZ(byte -% 1); }, .op_dex => self.execOpcodeDecReg(&self.reg.x), .op_dey => self.execOpcodeDecReg(&self.reg.y), .op_eor => { self.reg.a ^= byte; self.reg.setFlagsNZ(self.reg.a); }, .op_inc => { self.mem.write(addr, byte +% 1); self.reg.setFlagsNZ(byte +% 1); }, .op_inx => self.execOpcodeIncReg(&self.reg.x), .op_iny => self.execOpcodeIncReg(&self.reg.y), .op_lda => self.execOpcodeLd(&self.reg.a), .op_ldx => self.execOpcodeLd(&self.reg.x), .op_ldy => self.execOpcodeLd(&self.reg.y), .op_lsr => { const val = self.getByteMaybeAcc(); const modified = val >> 1; self.setByteMaybeAcc(modified); self.reg.setFlagsNZ(modified); self.reg.setFlag("C", val & 1 != 0); }, .op_nop => {}, .op_ora => { self.reg.a |= byte; self.reg.setFlagsNZ(self.reg.a); }, .op_rol => { const val = self.getByteMaybeAcc(); const modified = (val << 1) | self.reg.getFlags("C"); self.setByteMaybeAcc(modified); self.reg.setFlagsNZ(modified); self.reg.setFlag("C", val & 0x80 != 0); }, .op_ror => { const val = self.getByteMaybeAcc(); const modified = (val >> 1) | (self.reg.getFlags("C") << 7); self.setByteMaybeAcc(modified); self.reg.setFlagsNZ(modified); self.reg.setFlag("C", val & 1 != 0); }, .op_sbc => self.execOpcodeAdc(true), .op_sec => self.reg.setFlag("C", true), .op_sed => self.reg.setFlag("D", true), .op_sei => self.reg.setFlag("I", true), .op_sta => self.mem.write(addr, self.reg.a), .op_stx => self.mem.write(addr, self.reg.x), .op_sty => self.mem.write(addr, self.reg.y), .op_tax => self.execOpcodeTransferReg(self.reg.a, &self.reg.x), .op_tay => self.execOpcodeTransferReg(self.reg.a, &self.reg.y), .op_tsx => self.execOpcodeTransferReg(self.reg.s, &self.reg.x), .op_txa => self.execOpcodeTransferReg(self.reg.x, &self.reg.a), .op_txs => self.execOpcodeTransferReg(self.reg.x, &self.reg.s), .op_tya => self.execOpcodeTransferReg(self.reg.y, &self.reg.a), else => unreachable, } self.finishInstruction(); } fn execOpcodeAdc(self: *Self, subtract: bool) void { const val = if (subtract) ~self.state.c_byte else self.state.c_byte; const sum: u9 = @as(u9, self.reg.a) + @as(u9, val) + @as(u9, self.reg.getFlags("C")); const sum_u8: u8 = @truncate(u8, sum); const n_flag = sum_u8 & 0x80; const v_flag = (((self.reg.a ^ sum_u8) & (val ^ sum_u8)) & 0x80) >> 1; const z_flag = @as(u8, @boolToInt(sum_u8 == 0)) << 1; const c_flag = @truncate(u1, (sum & 0x100) >> 8); self.reg.setFlags("NVZC", n_flag | v_flag | z_flag | c_flag); self.reg.a = sum_u8; } fn execOpcodeCmp(self: *Self, reg: u8) void { self.reg.setFlagsNZ(reg -% self.state.c_byte); self.reg.setFlag("C", reg >= self.state.c_byte); } fn execOpcodeDecReg(self: *Self, reg: *u8) void { reg.* -%= 1; self.reg.setFlagsNZ(reg.*); } fn execOpcodeIncReg(self: *Self, reg: *u8) void { reg.* +%= 1; self.reg.setFlagsNZ(reg.*); } fn execOpcodeLd(self: *Self, reg: *u8) void { reg.* = self.state.c_byte; self.reg.setFlagsNZ(reg.*); } fn execOpcodeTransferReg(self: *Self, src: u8, dst: *u8) void { dst.* = src; if (dst != &self.reg.s) { self.reg.setFlagsNZ(src); } } fn logCycle(self: Self) void { const op_str = opToString(self.state.op); const cycle = if (self.state.cycle == 15) -1 else @intCast(i5, self.state.cycle); std.debug.print("Ct: {}; C: {: >2}; {s}; PC: ${x:0>4}; Bus: ${x:0>2}; " ++ "A: ${x:0>2}; X: ${x:0>2}; Y: ${x:0>2}; P: %{b:0>8}; S: ${x:0>2}\n", .{ self.cycles, cycle, op_str, self.reg.pc, self.mem.open_bus, self.reg.a, self.reg.x, self.reg.y, self.reg.p, self.reg.s, }); } }; } pub fn Memory(comptime config: Config) type { return struct { const Self = @This(); cart: *Cart(config), ppu: *Ppu(config), apu: *Apu(config), controller: *Controller(config.method), ram: [0x800]u8, open_bus: u8, // TODO: implement non-zero pattern? pub fn zeroes( cart: *Cart(config), ppu: *Ppu(config), apu: *Apu(config), controller: *Controller(config.method), ) Self { return Self{ .cart = cart, .ppu = ppu, .apu = apu, .controller = controller, .ram = [_]u8{0} ** 0x800, .open_bus = 0, }; } pub fn peek(self: Self, addr: u16) u8 { switch (addr) { 0x0000...0x1fff => return self.ram[addr & 0x7ff], 0x2000...0x3fff => return self.ppu.reg.peek(@truncate(u3, addr)), 0x4020...0xffff => return self.cart.peekPrg(addr) orelse 0, else => return 0, } } pub fn read(self: *Self, addr: u16) u8 { self.open_bus = switch (addr) { 0x0000...0x1fff => self.ram[addr & 0x7ff], 0x2000...0x3fff => self.ppu.reg.read(@truncate(u3, addr)), 0x4000...0x4013, 0x4015, 0x4017 => self.apu.read(@truncate(u5, addr)), 0x4014 => self.ppu.reg.io_bus, 0x4016 => self.controller.getNextButton(), 0x4018...0x401f => return self.open_bus, 0x4020...0xffff => self.cart.readPrg(addr) orelse self.open_bus, }; return self.open_bus; } pub fn write(self: *Self, addr: u16, val: u8) void { self.open_bus = val; switch (addr) { 0x0000...0x1fff => self.ram[addr & 0x7ff] = val, 0x2000...0x3fff => self.ppu.reg.write(@truncate(u3, addr), val), 0x4000...0x4013, 0x4015, 0x4017 => self.apu.write(@truncate(u5, addr), val), 0x4014 => @fieldParentPtr(Cpu(config), "mem", self).dma(val), 0x4016 => if (val & 1 == 1) { self.controller.strobe(); }, 0x4018...0x401f => {}, 0x4020...0xffff => self.cart.writePrg(addr, val), } } }; }
src/cpu/accurate.zig
const std = @import("std"); const BaseColors = [_]RGB{ // we intentionally don't include the transparent // just add 4 to the final matching result .{ .r = 127, .g = 178, .b = 56 }, .{ .r = 247, .g = 233, .b = 163 }, .{ .r = 199, .g = 199, .b = 199 }, .{ .r = 255, .g = 0, .b = 0 }, .{ .r = 160, .g = 160, .b = 255 }, .{ .r = 167, .g = 167, .b = 167 }, .{ .r = 0, .g = 124, .b = 0 }, .{ .r = 255, .g = 255, .b = 255 }, .{ .r = 164, .g = 168, .b = 184 }, .{ .r = 151, .g = 109, .b = 77 }, .{ .r = 112, .g = 112, .b = 112 }, .{ .r = 64, .g = 64, .b = 255 }, .{ .r = 143, .g = 119, .b = 72 }, .{ .r = 255, .g = 252, .b = 245 }, .{ .r = 216, .g = 127, .b = 51 }, .{ .r = 178, .g = 76, .b = 216 }, .{ .r = 102, .g = 153, .b = 216 }, .{ .r = 229, .g = 229, .b = 51 }, .{ .r = 127, .g = 204, .b = 25 }, .{ .r = 242, .g = 127, .b = 165 }, .{ .r = 76, .g = 76, .b = 76 }, .{ .r = 153, .g = 153, .b = 153 }, .{ .r = 76, .g = 127, .b = 153 }, .{ .r = 127, .g = 63, .b = 178 }, .{ .r = 51, .g = 76, .b = 178 }, .{ .r = 102, .g = 76, .b = 51 }, .{ .r = 102, .g = 127, .b = 51 }, .{ .r = 153, .g = 51, .b = 51 }, .{ .r = 25, .g = 25, .b = 25 }, .{ .r = 250, .g = 238, .b = 77 }, .{ .r = 92, .g = 219, .b = 213 }, .{ .r = 74, .g = 128, .b = 255 }, .{ .r = 0, .g = 217, .b = 58 }, .{ .r = 129, .g = 86, .b = 49 }, .{ .r = 112, .g = 2, .b = 0 }, .{ .r = 209, .g = 177, .b = 161 }, .{ .r = 159, .g = 82, .b = 36 }, .{ .r = 149, .g = 87, .b = 108 }, .{ .r = 112, .g = 108, .b = 138 }, .{ .r = 186, .g = 133, .b = 36 }, .{ .r = 103, .g = 117, .b = 53 }, .{ .r = 160, .g = 77, .b = 78 }, .{ .r = 57, .g = 41, .b = 35 }, .{ .r = 135, .g = 107, .b = 98 }, .{ .r = 87, .g = 92, .b = 92 }, .{ .r = 122, .g = 73, .b = 88 }, .{ .r = 76, .g = 62, .b = 92 }, .{ .r = 76, .g = 50, .b = 35 }, .{ .r = 76, .g = 82, .b = 42 }, .{ .r = 142, .g = 60, .b = 46 }, .{ .r = 37, .g = 22, .b = 16 }, .{ .r = 189, .g = 48, .b = 49 }, .{ .r = 148, .g = 63, .b = 97 }, .{ .r = 92, .g = 25, .b = 29 }, .{ .r = 22, .g = 126, .b = 134 }, .{ .r = 58, .g = 142, .b = 140 }, .{ .r = 86, .g = 44, .b = 62 }, .{ .r = 20, .g = 180, .b = 133 }, }; const ShadeMultis = [_]u32{ 180, 220, 255, 135 }; const AllColorCount: u8 = BaseColors.len * ShadeMultis.len; const AllColors = generateAllColors(); const RGB = struct { r: u8, g: u8, b: u8 }; const XYZ = struct { X: f64, Y: f64, Z: f64 }; const Lab = struct { L: f64, a: f64, b: f64 }; const ARGB4444 = switch (std.Target.current.cpu.arch.endian()) { .Little => packed struct { b: u4, g: u4, r: u4, _unused: u4 = 0 }, .Big => packed struct { _unused: u4 = 0, r: u4, g: u4, b: u4 }, }; pub fn slowMatchColor(pixel: u16) u8 { const small: ARGB4444 = @bitCast(ARGB4444, pixel); // we can't exactly bring RGB444 up to RGB888, since we lose the lower 4 bits in RGB888 to RGB444 // but we can at least just approximate it by multiplying by 17 const src: RGB = .{ .r = @as(u8, small.r) * 17, .g = @as(u8, small.g) * 17, .b = @as(u8, small.b) * 17, }; var bestIdx: u8 = 0; var bestMatch: f64 = std.math.f64_max; // the reason why this is the "slow" method and thus // just a fallback if our lookup table doesn't have an entry for (AllColors) |color, i| { const diff = colorDistExpensive(src, color); if (diff < bestMatch) { bestIdx = i; bestMatch = diff; } } // double check to make sure we actually found soemthing std.debug.assert(bestMatch < std.math.f64_max); // we add 4 because we lose the 4 transparency colors return bestIdx + 4; } pub fn toU16RGB(index: u8) u16 { const rgb = AllColors[index - 4]; return packU16RGB(rgb.r, rgb.g, rgb.b); } pub fn packU16RGB(r: u8, g: u8, b: u8) u16 { const hack: ARGB4444 = .{ .r = @truncate(u4, r >> 4), .g = @truncate(u4, g >> 4), .b = @truncate(u4, b >> 4), ._unused = 0, }; return @bitCast(u16, hack); } fn generateAllColors() [AllColorCount]RGB { var generated: [AllColorCount]RGB = undefined; for (BaseColors) |color, b_idx| { for (ShadeMultis) |multiplier, s_idx| { const r = @truncate(u8, @divFloor(@as(u32, color.r) * multiplier, 255)); const g = @truncate(u8, @divFloor(@as(u32, color.g) * multiplier, 255)); const b = @truncate(u8, @divFloor(@as(u32, color.b) * multiplier, 255)); generated[b_idx * 4 + s_idx] = .{ .r = r, .g = g, .b = b }; } } return generated; } // since we offload the work of calculating distance from the server, we can actually perform much more // computationally expensive color comparisons // so instead of our weighted distance formula, why not just go for the whole nine yards and do CIE Lab! // ironically, we may actually lose color accuracy due to converting from RGB to XYZ and then XYZ to Lab fn colorDistExpensive(c1: RGB, c2: RGB) f64 { return deltaE2000(rgbToCIELab(c1), rgbToCIELab(c2)); } fn rgbToCIELab(val: RGB) Lab { return xyzToCIELab(rgbToXyz(val)); } // rgbToXyz and xyzToLab formulas taken from http://www.easyrgb.com/en/math.php fn rgbToXyz(val: RGB) XYZ { const sR = @intToFloat(f64, val.r); const sG = @intToFloat(f64, val.g); const sB = @intToFloat(f64, val.b); const R = rgbBound(sR / 255.0) * 100.0; const G = rgbBound(sG / 255.0) * 100.0; const B = rgbBound(sB / 255.0) * 100.0; return .{ .X = R * 0.4124 + G * 0.3576 + B * 0.1805, .Y = R * 0.2126 + G * 0.7152 + B * 0.0722, .Z = R * 0.0193 + G * 0.1192 + B * 0.9505, }; } fn xyzToCIELab(xyz: XYZ) Lab { const X = xyzBound(xyz.X / 100.0); const Y = xyzBound(xyz.Y / 100.0); const Z = xyzBound(xyz.Z / 100.0); return .{ .L = (116.0 * Y) - 16.0, .a = 500.0 * (X - Y), .b = 200.0 * (Y - Z), }; } fn rgbBound(value: f64) f64 { var ret = value; if (ret > 0.04045) { ret = std.math.pow(f64, (ret + 0.055) / 1.055, 2.4); } else { ret = ret / 12.92; } return ret; } fn xyzBound(value: f64) f64 { const oneThirds: f64 = 1.0 / 3.0; const sixteenOverHundredSixteen: f64 = 16.0 / 116.0; var ret = value; if (ret > 0.008856) { ret = std.math.pow(f64, ret, oneThirds); } else { ret = (7.787 * ret) + sixteenOverHundredSixteen; } return ret; } const PI = 3.14159265358979323846; // translated from https://github.com/gfiumara/CIEDE2000/blob/master/CIEDE2000.cpp fn deltaE2000(lab1: Lab, lab2: Lab) f64 { const C1 = @sqrt((lab1.a * lab1.a) + (lab1.b * lab1.b)); const C2 = @sqrt((lab2.a * lab2.a) + (lab2.b * lab2.b)); const barC = (C1 + C2) / 2.0; const G = 0.5 * (1.0 - @sqrt(std.math.pow(f64, barC, 7) / (std.math.pow(f64, barC, 7) + 6103515625.0))); const a1Prime = (1.0 + G) * lab1.a; const a2Prime = (1.0 + G) * lab2.a; const CPrime1 = @sqrt((a1Prime * a1Prime) + (lab1.b * lab1.b)); const CPrime2 = @sqrt((a2Prime * a2Prime) + (lab2.b * lab2.b)); var hPrime1: f64 = undefined; if (lab1.b == 0 and a1Prime == 0) { hPrime1 = 0.0; } else { hPrime1 = std.math.atan2(f64, lab1.b, a1Prime); if (hPrime1 < 0) { hPrime1 += (PI * 2.0); } } var hPrime2: f64 = undefined; if (lab2.b == 0 and a2Prime == 0) { hPrime2 = 0.0; } else { hPrime2 = std.math.atan2(f64, lab2.b, a2Prime); if (hPrime2 < 0) { hPrime2 += (PI * 2.0); } } const deltaLPrime = lab2.L - lab1.L; const deltaCPrime = CPrime2 - CPrime1; var deltahPrime: f64 = undefined; const CPrimeProduct = CPrime1 * CPrime2; if (CPrimeProduct == 0.0) { deltahPrime = 0.0; } else { deltahPrime = hPrime2 - hPrime1; if (deltahPrime < -PI) { deltahPrime += (PI * 2.0); } else if (deltahPrime > PI) { deltahPrime -= (PI * 2.0); } } const deltaHPrime = 2.0 * @sqrt(CPrimeProduct) * @sin(deltahPrime / 2.0); const barLPrime = (lab1.L + lab2.L) / 2.0; const barCPrime = (CPrime1 + CPrime2) / 2.0; const hPrimeSum = hPrime1 + hPrime2; var barhPrime: f64 = undefined; if (CPrime1 * CPrime2 == 0) { barhPrime = hPrimeSum; } else { if (@fabs(hPrime1 - hPrime2) <= PI) { barhPrime = hPrimeSum / 2.0; } else { if (hPrimeSum < (PI * 2.0)) { barhPrime = (hPrimeSum + (PI * 2.0)) / 2.0; } else { barhPrime = (hPrimeSum - (PI * 2.0)) / 2.0; } } } // zig fmt: off const T = 1.0 - (0.17 * @cos(barhPrime - 0.523599)) + (0.24 * @cos(2.0 * barhPrime)) + (0.32 * @cos((3.0 * barhPrime) + 0.10472)) - (0.20 * @cos((4.0 * barhPrime) - 1.09956)); // zig fmt: on const deltaTheta = 0.523599 * @exp(-std.math.pow(f64, (barhPrime - 4.79966) / 0.436332, 2.0)); const R_C = 2.0 * @sqrt(std.math.pow(f64, barCPrime, 7.0) / (std.math.pow(f64, barCPrime, 7.0) + 6103515625.0)); const S_L = 1.0 + ((0.015 * std.math.pow(f64, barLPrime - 50.0, 2.0)) / @sqrt(20.0 + std.math.pow(f64, barLPrime - 50.0, 2.0))); const S_C = 1.0 + (0.045 * barCPrime); const S_H = 1.0 + (0.015 * barCPrime * T); const R_T = (-@sin(2.0 * deltaTheta)) * R_C; const k_L = 1.0; const k_C = 1.0; const k_H = 1.0; // zig fmt: off return @sqrt( std.math.pow(f64, deltaLPrime / (k_L * S_L), 2.0) + std.math.pow(f64, deltaCPrime / (k_C * S_C), 2.0) + std.math.pow(f64, deltaHPrime / (k_H * S_H), 2.0) + (R_T * (deltaCPrime / (k_C * S_C)) * (deltaHPrime / (k_H * S_H)))); // zig fmt: on } // deprecated // adapted from the original Bukkit MapPalette.getDistance() // it works pretty well here! fn _deprecated_colorDist(c1: RGB, c2: RGB) f32 { const rmean = (@intToFloat(f32, c1.r) + @intToFloat(f32, c2.r)) / 2.0; const dr = @intToFloat(f32, c1.r) - @intToFloat(f32, c2.r); const dg = @intToFloat(f32, c1.g) - @intToFloat(f32, c2.g); const db = @intToFloat(f32, c1.b) - @intToFloat(f32, c2.b); const wr = 2.0 + rmean / 256.0; const wg = 4.0; const wb = 2.0 + (255.0 - rmean) / 256.0; return @sqrt(wr * dr * dr + wg * dg * dg + wb * db * db); }
nativemap/src/color.zig
const std = @import("std"); const util = @import("util.zig"); const Grid = struct { energy_levels: [10][10]u8, flashed: [10][10]u1, total_flashes: u64, const Self = @This(); fn init() Self { return .{ .energy_levels = std.mem.zeroes([10][10]u8), .flashed = std.mem.zeroes([10][10]u1), .total_flashes = 0, }; } fn step(self: *Self) void { self.flashed = std.mem.zeroes([10][10]u1); for (self.energy_levels) |*row| { for (row) |*energy_level| { energy_level.* += 1; } } for (self.energy_levels) |*row, y| { for (row) |*energy_level, x| { if (energy_level.* > 9 and self.flashed[y][x] == 0) { self.flash(y, x); } } } for (self.energy_levels) |*row, y| { for (row) |*energy_level, x| { if (self.flashed[y][x] == 1) { energy_level.* = 0; } } } } fn flash(self: *Self, y: usize, x: usize) void { self.flashed[y][x] = 1; self.total_flashes += 1; const row = &self.energy_levels[y]; const min_x = if (x == 0) 0 else x - 1; const max_x = if (x == row.len - 1) row.len - 1 else x + 1; const min_y = if (y == 0) 0 else y - 1; const max_y = if (y == self.energy_levels.len - 1) self.energy_levels.len - 1 else y + 1; var i = min_y; while (i <= max_y) : (i += 1) { var j = min_x; while (j <= max_x) : (j += 1) { self.energy_levels[i][j] += 1; if (self.energy_levels[i][j] > 9 and self.flashed[i][j] == 0) { self.flash(i, j); } } } } fn allFlashed(self: *const Self) bool { for (self.flashed) |row| { for (row) |cell| { if (cell == 0) { return false; } } } return true; } fn print(self: *const Self, header: []const u8) void { std.debug.print("{s}:\n", .{header}); for (self.energy_levels) |*row| { std.debug.print(" ", .{}); for (row) |energy_level| { if (energy_level > 9) { std.debug.print("\x1b[38;5;1mX\x1b[0m", .{}); } else { std.debug.print("{c}", .{energy_level + '0'}); } } std.debug.print("\n", .{}); } } }; fn parse_input(input: []const u8) Grid { var grid = Grid.init(); var lines = std.mem.tokenize(u8, input, "\n"); var y: usize = 0; while (lines.next()) |line| { for (line) |raw_energy_level, x| { grid.energy_levels[y][x] = raw_energy_level - '0'; } y += 1; } return grid; } pub fn part1(input: []const u8) !u64 { var grid = parse_input(input); var i: usize = 0; while (i < 100) : (i += 1) { grid.step(); } return grid.total_flashes; } pub fn part2(input: []const u8) !u64 { var grid = parse_input(input); var i: usize = 0; while (true) : (i += 1) { grid.step(); if (grid.allFlashed()) { break; } } return i + 1; } test "day 11 part 1" { const test_input = \\5483143223 \\2745854711 \\5264556173 \\6141336146 \\6357385478 \\4167524645 \\2176841721 \\6882881134 \\4846848554 \\5283751526 ; try std.testing.expectEqual(part1(test_input), 1656); } test "day 11 part 2" { const test_input = \\5483143223 \\2745854711 \\5264556173 \\6141336146 \\6357385478 \\4167524645 \\2176841721 \\6882881134 \\4846848554 \\5283751526 ; try std.testing.expectEqual(part2(test_input), 195); }
zig/src/day11.zig
const std = @import("std"); const list = @import("linked_list.zig"); //TODO: If need by implement Deque ///A queue .ie a FIFO data structure pub fn Queue(comptime T: type) type { return struct { const ListType = list.SinglyList(T); const Self = @This(); data: ListType, pub fn init(allocator: std.mem.Allocator) Self { return .{ .data = ListType.init(allocator) }; } pub fn enqueue(self: *Self, value: T) !void { try self.data.append(value); } pub fn dequeue(self: *Self) void { self.data.removeFirst(); } pub fn peek(self: Self) ?T { const front = self.data.head orelse return null; return front.data; } pub fn deinit(self: *Self) void { self.data.deinit(); } }; } test "Queue" { var queue = Queue(u8).init(std.testing.allocator); defer queue.deinit(); try queue.enqueue(0); try std.testing.expect(queue.peek().? == 0); queue.dequeue(); try std.testing.expect(queue.peek() == null); } //REFERENCE_IMPL: https://towardsdatascience.com/circular-queue-or-ring-buffer-92c7b0193326 ///A circular queue or ring buffer is essentially a queue with a maximum size or ///capacity which will continue to loop back over itself in a circular motion //NOTE: RingBuffer could also use a circular linkded list as it backing container pub fn RingBuffer(comptime T: type, comptime capacity: usize) type { return struct { const Self = @This(); allocator: std.mem.Allocator, data: []T, insert_index: usize = 0, // index for enqueuing or insertion front_index: usize = 0, //index of first element size: usize = 0, pub fn init(allocator: std.mem.Allocator) Self { return .{ .allocator = allocator, .data = allocator.alloc(T, capacity) catch std.debug.panic("cannot allocate RingBuffer of size {},allocator is out of memory", .{capacity}), }; } pub fn enqueue(self: *Self, value: T) !void { if (self.size == capacity) { return error.RingBufferOverflow; } //wrap around to index 0 after reaching capacity self.data[self.insert_index] = value; self.insert_index = (self.insert_index + 1) % capacity; self.size += 1; } pub fn dequeue(self: *Self) !T { if (self.size == 0) { return error.RingBufferEmpty; } const current_front = self.data[self.front_index]; self.front_index = (self.front_index + 1) % capacity; self.size -= 1; return current_front; } pub fn peekFront(self: Self) T { return self.data[self.front_index]; } pub fn peekEnd(self: Self) T { //we have to -1 because the insert_index refers to the location for the next insertion //so to get the last insertion we look back one step return self.data[self.insert_index - 1]; } pub fn display(self: Self) void { std.debug.assert(self.size != 0); var index = self.front_index; var counter: usize = 0; std.debug.print("\n-->", .{}); while (counter < self.size) : ({ counter += 1; index = (index + 1) % capacity; }) { std.debug.print("|{}", .{self.data[index]}); } std.debug.print("|<--\n", .{}); } pub fn deinit(self: Self) void { self.allocator.free(self.data); } }; } test "RingBuffer" { var ringbuffer = RingBuffer(u8, 6).init(std.testing.allocator); defer ringbuffer.deinit(); try ringbuffer.enqueue(1); try ringbuffer.enqueue(2); try ringbuffer.enqueue(3); try ringbuffer.enqueue(4); try ringbuffer.enqueue(5); try ringbuffer.enqueue(6); try std.testing.expectError(error.RingBufferOverflow, ringbuffer.enqueue(7)); const dequeue = try ringbuffer.dequeue(); try std.testing.expect(dequeue == 1); _ = try ringbuffer.dequeue(); try ringbuffer.enqueue(7); try ringbuffer.enqueue(8); try std.testing.expect(ringbuffer.peekFront() == 3); try std.testing.expect(ringbuffer.peekEnd() == 8); _ = try ringbuffer.dequeue(); try std.testing.expect(ringbuffer.peekFront() == 4); }
src/queue.zig
const std = @import("std"); const assert = std.debug.assert; const tools = @import("tools"); const Card = u8; const Deck = tools.CircularBuffer(Card); fn playGame(hands: [2][]const Card, variant: enum { classic, recursive }, allocator: std.mem.Allocator) std.mem.Allocator.Error![2]u32 { var previous = std.AutoHashMap([2]u32, void).init(allocator); defer previous.deinit(); try previous.ensureTotalCapacity(150); var scores: [2]struct { prod: u32, sum: u16, count: u16 } = .{ .{ .prod = 0, .sum = 0, .count = 0 }, .{ .prod = 0, .sum = 0, .count = 0 } }; var decks = [2]Deck{ Deck.init(allocator), Deck.init(allocator) }; defer decks[1].deinit(); defer decks[0].deinit(); try decks[0].reserve(hands[0].len); try decks[1].reserve(hands[1].len); //std.debug.print("New game: \n", .{}); for (hands) |cards, player| { //std.debug.print("player= ", .{}); for (cards) |c, i| { // std.debug.print("{},", .{c}); try decks[player].pushTail(c); scores[player].prod += @intCast(u32, c * (cards.len - i)); scores[player].sum += @intCast(u16, c); scores[player].count += 1; } //std.debug.print("\n", .{}); } while (true) { // doublon? if (try previous.fetchPut([2]u32{ scores[0].prod, scores[1].prod }, {})) |_| { return [2]u32{ 1, 0 }; // player1 wins } const c1 = if (decks[0].pop()) |c| c else break; const c2 = if (decks[1].pop()) |c| c else break; // std.debug.print("playing {} vs {}\n", .{ c1, c2 }); const cards = [2]Card{ c1, c2 }; for (cards) |c, player| { scores[player].prod -= c * scores[player].count; scores[player].sum -= c; scores[player].count -= 1; } const play1_wins = win: { if (variant == .recursive and c1 <= scores[0].count and c2 <= scores[1].count) { var sub_cards: [2][52]Card = undefined; for (cards) |card, player| { var it = decks[player].iter(); var nb: u32 = 0; while (it.next()) |c| { sub_cards[player][nb] = c; nb += 1; if (nb >= card) break; } } const sub_scores = try playGame(.{ sub_cards[0][0..c1], sub_cards[1][0..c2] }, .recursive, allocator); break :win sub_scores[0] > sub_scores[1]; } else { break :win c1 > c2; } }; if (play1_wins) { try decks[0].pushTail(c1); try decks[0].pushTail(c2); scores[0].prod += scores[0].sum * 2 + c1 * 2 + c2; scores[0].sum += c1 + c2; scores[0].count += 2; } else { try decks[1].pushTail(c2); try decks[1].pushTail(c1); scores[1].prod += scores[1].sum * 2 + c2 * 2 + c1; scores[1].sum += c2 + c1; scores[1].count += 2; } } return [_]u32{ scores[0].prod, scores[1].prod }; } pub fn run(input_text: []const u8, allocator: std.mem.Allocator) ![2][]const u8 { var arena = std.heap.ArenaAllocator.init(allocator); defer arena.deinit(); const param: struct { hands: [2][]const Card, } = param: { var cards: [2][52]Card = undefined; var nb: [2]usize = .{ 0, 0 }; var player: ?usize = null; var it = std.mem.tokenize(u8, input_text, "\n\r"); while (it.next()) |line| { if (tools.match_pattern("Player {}:", line)) |fields| { player = @intCast(u2, fields[0].imm) - 1; } else { cards[player.?][nb[player.?]] = try std.fmt.parseInt(Card, line, 10); nb[player.?] += 1; } } // std.debug.print("got {} + {} cards\n", .{ nb[0], nb[1] }); break :param .{ .hands = .{ cards[0][0..nb[0]], cards[1][0..nb[1]] }, }; }; const ans1 = ans: { const scores = try playGame(param.hands, .classic, allocator); break :ans scores[0] + scores[1]; }; const ans2 = ans: { const scores = try playGame(param.hands, .recursive, allocator); break :ans scores[0] + scores[1]; }; return [_][]const u8{ try std.fmt.allocPrint(allocator, "{}", .{ans1}), try std.fmt.allocPrint(allocator, "{}", .{ans2}), }; } pub const main = tools.defaultMain("2020/input_day22.txt", run);
2020/day22.zig
const std = @import("std"); const mem = std.mem; const meta = std.meta; const net = std.net; usingnamespace @import("../primitive_types.zig"); usingnamespace @import("../event.zig"); const PrimitiveReader = @import("../primitive/reader.zig").PrimitiveReader; const checkHeader = @import("../frame.zig").checkHeader; const testing = @import("../testing.zig"); /// EVENT is an event pushed by the server. /// /// Described in the protocol spec at §4.2.6. pub const EventFrame = struct { const Self = @This(); event: Event, pub fn read(allocator: *mem.Allocator, pr: *PrimitiveReader) !Self { var frame = Self{ .event = undefined, }; const event_type = meta.stringToEnum(EventType, try pr.readString(allocator)) orelse return error.InvalidEventType; switch (event_type) { .TOPOLOGY_CHANGE => { var change = TopologyChange{ .type = undefined, .node_address = undefined, }; change.type = meta.stringToEnum(TopologyChangeType, try pr.readString(allocator)) orelse return error.InvalidTopologyChangeType; change.node_address = try pr.readInet(); frame.event = Event{ .TOPOLOGY_CHANGE = change }; return frame; }, .STATUS_CHANGE => { var change = StatusChange{ .type = undefined, .node_address = undefined, }; change.type = meta.stringToEnum(StatusChangeType, try pr.readString(allocator)) orelse return error.InvalidStatusChangeType; change.node_address = try pr.readInet(); frame.event = Event{ .STATUS_CHANGE = change }; return frame; }, .SCHEMA_CHANGE => { frame.event = Event{ .SCHEMA_CHANGE = try SchemaChange.read(allocator, pr) }; return frame; }, } } }; test "event frame: topology change" { var arena = testing.arenaAllocator(); defer arena.deinit(); // read const exp = "\x84\x00\xff\xff\x0c\x00\x00\x00\x24\x00\x0f\x54\x4f\x50\x4f\x4c\x4f\x47\x59\x5f\x43\x48\x41\x4e\x47\x45\x00\x08\x4e\x45\x57\x5f\x4e\x4f\x44\x45\x04\x7f\x00\x00\x04\x00\x00\x23\x52"; const raw_frame = try testing.readRawFrame(&arena.allocator, exp); checkHeader(Opcode.Event, exp.len, raw_frame.header); var pr = PrimitiveReader.init(); pr.reset(raw_frame.body); const frame = try EventFrame.read(&arena.allocator, &pr); testing.expect(frame.event == .TOPOLOGY_CHANGE); const topology_change = frame.event.TOPOLOGY_CHANGE; testing.expectEqual(TopologyChangeType.NEW_NODE, topology_change.type); const localhost = net.Address.initIp4([4]u8{ 0x7f, 0x00, 0x00, 0x04 }, 9042); testing.expect(net.Address.eql(localhost, topology_change.node_address)); } test "event frame: status change" { var arena = testing.arenaAllocator(); defer arena.deinit(); const data = "\x84\x00\xff\xff\x0c\x00\x00\x00\x1e\x00\x0d\x53\x54\x41\x54\x55\x53\x5f\x43\x48\x41\x4e\x47\x45\x00\x04\x44\x4f\x57\x4e\x04\x7f\x00\x00\x01\x00\x00\x23\x52"; const raw_frame = try testing.readRawFrame(&arena.allocator, data); checkHeader(Opcode.Event, data.len, raw_frame.header); var pr = PrimitiveReader.init(); pr.reset(raw_frame.body); const frame = try EventFrame.read(&arena.allocator, &pr); testing.expect(frame.event == .STATUS_CHANGE); const status_change = frame.event.STATUS_CHANGE; testing.expectEqual(StatusChangeType.DOWN, status_change.type); const localhost = net.Address.initIp4([4]u8{ 0x7f, 0x00, 0x00, 0x01 }, 9042); testing.expect(net.Address.eql(localhost, status_change.node_address)); } test "event frame: schema change/keyspace" { var arena = testing.arenaAllocator(); defer arena.deinit(); const data = "\x84\x00\xff\xff\x0c\x00\x00\x00\x2a\x00\x0d\x53\x43\x48\x45\x4d\x41\x5f\x43\x48\x41\x4e\x47\x45\x00\x07\x43\x52\x45\x41\x54\x45\x44\x00\x08\x4b\x45\x59\x53\x50\x41\x43\x45\x00\x06\x62\x61\x72\x62\x61\x7a"; const raw_frame = try testing.readRawFrame(&arena.allocator, data); checkHeader(Opcode.Event, data.len, raw_frame.header); var pr = PrimitiveReader.init(); pr.reset(raw_frame.body); const frame = try EventFrame.read(&arena.allocator, &pr); testing.expect(frame.event == .SCHEMA_CHANGE); const schema_change = frame.event.SCHEMA_CHANGE; testing.expectEqual(SchemaChangeType.CREATED, schema_change.type); testing.expectEqual(SchemaChangeTarget.KEYSPACE, schema_change.target); const options = schema_change.options; testing.expectEqualStrings("barbaz", options.keyspace); testing.expectEqualStrings("", options.object_name); testing.expect(options.arguments == null); } test "event frame: schema change/table" { var arena = testing.arenaAllocator(); defer arena.deinit(); const data = "\x84\x00\xff\xff\x0c\x00\x00\x00\x2e\x00\x0d\x53\x43\x48\x45\x4d\x41\x5f\x43\x48\x41\x4e\x47\x45\x00\x07\x43\x52\x45\x41\x54\x45\x44\x00\x05\x54\x41\x42\x4c\x45\x00\x06\x66\x6f\x6f\x62\x61\x72\x00\x05\x73\x61\x6c\x75\x74"; const raw_frame = try testing.readRawFrame(&arena.allocator, data); checkHeader(Opcode.Event, data.len, raw_frame.header); var pr = PrimitiveReader.init(); pr.reset(raw_frame.body); const frame = try EventFrame.read(&arena.allocator, &pr); testing.expect(frame.event == .SCHEMA_CHANGE); const schema_change = frame.event.SCHEMA_CHANGE; testing.expectEqual(SchemaChangeType.CREATED, schema_change.type); testing.expectEqual(SchemaChangeTarget.TABLE, schema_change.target); const options = schema_change.options; testing.expectEqualStrings("foobar", options.keyspace); testing.expectEqualStrings("salut", options.object_name); testing.expect(options.arguments == null); } test "event frame: schema change/function" { var arena = testing.arenaAllocator(); defer arena.deinit(); const data = "\x84\x00\xff\xff\x0c\x00\x00\x00\x40\x00\x0d\x53\x43\x48\x45\x4d\x41\x5f\x43\x48\x41\x4e\x47\x45\x00\x07\x43\x52\x45\x41\x54\x45\x44\x00\x08\x46\x55\x4e\x43\x54\x49\x4f\x4e\x00\x06\x66\x6f\x6f\x62\x61\x72\x00\x0d\x73\x6f\x6d\x65\x5f\x66\x75\x6e\x63\x74\x69\x6f\x6e\x00\x01\x00\x03\x69\x6e\x74"; const raw_frame = try testing.readRawFrame(&arena.allocator, data); checkHeader(Opcode.Event, data.len, raw_frame.header); var pr = PrimitiveReader.init(); pr.reset(raw_frame.body); const frame = try EventFrame.read(&arena.allocator, &pr); testing.expect(frame.event == .SCHEMA_CHANGE); const schema_change = frame.event.SCHEMA_CHANGE; testing.expectEqual(SchemaChangeType.CREATED, schema_change.type); testing.expectEqual(SchemaChangeTarget.FUNCTION, schema_change.target); const options = schema_change.options; testing.expectEqualStrings("foobar", options.keyspace); testing.expectEqualStrings("some_function", options.object_name); const arguments = options.arguments.?; testing.expectEqual(@as(usize, 1), arguments.len); testing.expectEqualStrings("int", arguments[0]); }
src/frames/event.zig
const std = @import("std"); const pike = @import("pike.zig"); const os = std.os; const fmt = std.fmt; const log = std.log; const net = std.net; const mem = std.mem; const heap = std.heap; const process = std.process; fn exists(args: []const []const u8, flags: anytype) ?usize { inline for (flags) |flag| { for (args) |arg, index| { if (mem.eql(u8, arg, flag)) { return index; } } } return null; } pub fn main() !void { var gpa: heap.GeneralPurposeAllocator(.{}) = .{}; defer _ = gpa.deinit(); const allocator = &gpa.allocator; const args = try process.argsAlloc(allocator); defer process.argsFree(allocator, args); const run_server = args.len == 1 or (args.len > 1 and exists(args, .{ "server", "--server", "-server", "-s" }) != null); const run_client = args.len == 1 or (args.len > 1 and exists(args, .{ "client", "--client", "-client", "-c" }) != null); const address: net.Address = blk: { const default = try net.Address.parseIp("127.0.0.1", 9000); const index = exists(args, .{ "address", "--address", "-address", "-a" }) orelse { break :blk default; }; if (args.len <= index + 1) break :blk default; var fields = mem.split(u8, args[index + 1], ":"); const addr_host = fields.next().?; const addr_port = try fmt.parseInt(u16, fields.next().?, 10); break :blk try net.Address.parseIp(addr_host, addr_port); }; try pike.init(); defer pike.deinit(); const notifier = try pike.Notifier.init(); defer notifier.deinit(); var stopped = false; var server_frame: @Frame(runBenchmarkServer) = undefined; var client_frame: @Frame(runBenchmarkClient) = undefined; if (run_server) server_frame = async runBenchmarkServer(&notifier, address, &stopped); if (run_client) client_frame = async runBenchmarkClient(&notifier, address, &stopped); defer if (run_server) nosuspend await server_frame catch |err| @panic(@errorName(err)); defer if (run_client) nosuspend await client_frame catch |err| @panic(@errorName(err)); while (!stopped) { try notifier.poll(10_000); } } fn runBenchmarkServer(notifier: *const pike.Notifier, address: net.Address, stopped: *bool) !void { defer stopped.* = true; var socket = try pike.Socket.init(os.AF.INET, os.SOCK.STREAM, os.IPPROTO.TCP, 0); defer socket.deinit(); try socket.registerTo(notifier); try socket.set(.reuse_address, true); try socket.bind(address); try socket.listen(128); log.info("Listening for clients on: {}", .{try socket.getBindAddress()}); var client = try socket.accept(); defer client.socket.deinit(); log.info("Accepted client: {}", .{client.address}); try client.socket.registerTo(notifier); var buf: [1024]u8 = undefined; while (true) { _ = try client.socket.send(&buf, 0); } } fn runBenchmarkClient(notifier: *const pike.Notifier, address: net.Address, stopped: *bool) !void { defer stopped.* = true; var socket = try pike.Socket.init(os.AF.INET, os.SOCK.STREAM, os.IPPROTO.TCP, 0); defer socket.deinit(); try socket.registerTo(notifier); try socket.connect(address); log.info("Connected to: {}", .{address}); var buf: [1024]u8 = undefined; while (true) { const n = try socket.recv(&buf, 0); if (n == 0) return; } }
example_tcp_benchmark.zig
const std = @import("std.zig"); const math = std.math; const assert = std.debug.assert; const mem = std.mem; const builtin = @import("builtin"); const errol = @import("fmt/errol.zig"); const lossyCast = std.math.lossyCast; pub const default_max_depth = 3; pub const Alignment = enum { Left, Center, Right, }; pub const FormatOptions = struct { precision: ?usize = null, width: ?usize = null, alignment: ?Alignment = null, fill: u8 = ' ', }; fn nextArg(comptime used_pos_args: *u32, comptime maybe_pos_arg: ?comptime_int, comptime next_arg: *comptime_int) comptime_int { if (maybe_pos_arg) |pos_arg| { used_pos_args.* |= 1 << pos_arg; return pos_arg; } else { const arg = next_arg.*; next_arg.* += 1; return arg; } } fn peekIsAlign(comptime fmt: []const u8) bool { // Should only be called during a state transition to the format segment. comptime assert(fmt[0] == ':'); inline for (([_]u8{ 1, 2 })[0..]) |i| { if (fmt.len > i and (fmt[i] == '<' or fmt[i] == '^' or fmt[i] == '>')) { return true; } } return false; } /// Renders fmt string with args, calling output with slices of bytes. /// If `output` returns an error, the error is returned from `format` and /// `output` is not called again. /// /// The format string must be comptime known and may contain placeholders following /// this format: /// `{[position][specifier]:[fill][alignment][width].[precision]}` /// /// Each word between `[` and `]` is a parameter you have to replace with something: /// /// - *position* is the index of the argument that should be inserted /// - *specifier* is a type-dependent formatting option that determines how a type should formatted (see below) /// - *fill* is a single character which is used to pad the formatted text /// - *alignment* is one of the three characters `<`, `^` or `>`. they define if the text is *left*, *center*, or *right* aligned /// - *width* is the total width of the field in characters /// - *precision* specifies how many decimals a formatted number should have /// /// Note that most of the parameters are optional and may be omitted. Also you can leave out separators like `:` and `.` when /// all parameters after the separator are omitted. /// Only exception is the *fill* parameter. If *fill* is required, one has to specify *alignment* as well, as otherwise /// the digits after `:` is interpreted as *width*, not *fill*. /// /// The *specifier* has several options for types: /// - `x` and `X`: /// - format the non-numeric value as a string of bytes in hexadecimal notation ("binary dump") in either lower case or upper case /// - output numeric value in hexadecimal notation /// - `s`: print a pointer-to-many as a c-string, use zero-termination /// - `B` and `Bi`: output a memory size in either metric (1000) or power-of-two (1024) based notation. works for both float and integer values. /// - `e`: output floating point value in scientific notation /// - `d`: output numeric value in decimal notation /// - `b`: output integer value in binary notation /// - `c`: output integer as an ASCII character. Integer type must have 8 bits at max. /// - `*`: output the address of the value instead of the value itself. /// /// If a formatted user type contains a function of the type /// ``` /// fn format(value: ?, comptime fmt: []const u8, options: std.fmt.FormatOptions, context: var, comptime Errors: type, output: fn (@TypeOf(context), []const u8) Errors!void) Errors!void /// ``` /// with `?` being the type formatted, this function will be called instead of the default implementation. /// This allows user types to be formatted in a logical manner instead of dumping all fields of the type. /// /// A user type may be a `struct`, `union` or `enum` type. pub fn format( context: var, comptime Errors: type, output: fn (@TypeOf(context), []const u8) Errors!void, comptime fmt: []const u8, args: var, ) Errors!void { const ArgSetType = @IntType(false, 32); if (args.len > ArgSetType.bit_count) { @compileError("32 arguments max are supported per format call"); } const State = enum { Start, Positional, CloseBrace, Specifier, FormatFillAndAlign, FormatWidth, FormatPrecision, }; comptime var start_index = 0; comptime var state = State.Start; comptime var next_arg = 0; comptime var maybe_pos_arg: ?comptime_int = null; comptime var used_pos_args: ArgSetType = 0; comptime var specifier_start = 0; comptime var specifier_end = 0; comptime var options = FormatOptions{}; inline for (fmt) |c, i| { switch (state) { .Start => switch (c) { '{' => { if (start_index < i) { try output(context, fmt[start_index..i]); } start_index = i; specifier_start = i + 1; specifier_end = i + 1; maybe_pos_arg = null; state = .Positional; options = FormatOptions{}; }, '}' => { if (start_index < i) { try output(context, fmt[start_index..i]); } state = .CloseBrace; }, else => {}, }, .Positional => switch (c) { '{' => { state = .Start; start_index = i; }, ':' => { state = if (comptime peekIsAlign(fmt[i..])) State.FormatFillAndAlign else State.FormatWidth; specifier_end = i; }, '0'...'9' => { if (maybe_pos_arg == null) { maybe_pos_arg = 0; } maybe_pos_arg.? *= 10; maybe_pos_arg.? += c - '0'; specifier_start = i + 1; if (maybe_pos_arg.? >= args.len) { @compileError("Positional value refers to non-existent argument"); } }, '}' => { const arg_to_print = comptime nextArg(&used_pos_args, maybe_pos_arg, &next_arg); if (arg_to_print >= args.len) { @compileError("Too few arguments"); } try formatType( args[arg_to_print], fmt[0..0], options, context, Errors, output, default_max_depth, ); state = .Start; start_index = i + 1; }, else => { state = .Specifier; specifier_start = i; }, }, .CloseBrace => switch (c) { '}' => { state = .Start; start_index = i; }, else => @compileError("Single '}' encountered in format string"), }, .Specifier => switch (c) { ':' => { specifier_end = i; state = if (comptime peekIsAlign(fmt[i..])) State.FormatFillAndAlign else State.FormatWidth; }, '}' => { const arg_to_print = comptime nextArg(&used_pos_args, maybe_pos_arg, &next_arg); try formatType( args[arg_to_print], fmt[specifier_start..i], options, context, Errors, output, default_max_depth, ); state = .Start; start_index = i + 1; }, else => {}, }, // Only entered if the format string contains a fill/align segment. .FormatFillAndAlign => switch (c) { '<' => { options.alignment = Alignment.Left; state = .FormatWidth; }, '^' => { options.alignment = Alignment.Center; state = .FormatWidth; }, '>' => { options.alignment = Alignment.Right; state = .FormatWidth; }, else => { options.fill = c; }, }, .FormatWidth => switch (c) { '0'...'9' => { if (options.width == null) { options.width = 0; } options.width.? *= 10; options.width.? += c - '0'; }, '.' => { state = .FormatPrecision; }, '}' => { const arg_to_print = comptime nextArg(&used_pos_args, maybe_pos_arg, &next_arg); try formatType( args[arg_to_print], fmt[specifier_start..specifier_end], options, context, Errors, output, default_max_depth, ); state = .Start; start_index = i + 1; }, else => { @compileError("Unexpected character in width value: " ++ [_]u8{c}); }, }, .FormatPrecision => switch (c) { '0'...'9' => { if (options.precision == null) { options.precision = 0; } options.precision.? *= 10; options.precision.? += c - '0'; }, '}' => { const arg_to_print = comptime nextArg(&used_pos_args, maybe_pos_arg, &next_arg); try formatType( args[arg_to_print], fmt[specifier_start..specifier_end], options, context, Errors, output, default_max_depth, ); state = .Start; start_index = i + 1; }, else => { @compileError("Unexpected character in precision value: " ++ [_]u8{c}); }, }, } } comptime { // All arguments must have been printed but we allow mixing positional and fixed to achieve this. var i: usize = 0; inline while (i < next_arg) : (i += 1) { used_pos_args |= 1 << i; } if (@popCount(ArgSetType, used_pos_args) != args.len) { @compileError("Unused arguments"); } if (state != State.Start) { @compileError("Incomplete format string: " ++ fmt); } } if (start_index < fmt.len) { try output(context, fmt[start_index..]); } } pub fn formatType( value: var, comptime fmt: []const u8, options: FormatOptions, context: var, comptime Errors: type, output: fn (@TypeOf(context), []const u8) Errors!void, max_depth: usize, ) Errors!void { if (comptime std.mem.eql(u8, fmt, "*")) { try output(context, @typeName(@TypeOf(value).Child)); try output(context, "@"); try formatInt(@ptrToInt(value), 16, false, FormatOptions{}, context, Errors, output); return; } const T = @TypeOf(value); switch (@typeInfo(T)) { .ComptimeInt, .Int, .Float => { return formatValue(value, fmt, options, context, Errors, output); }, .Void => { return output(context, "void"); }, .Bool => { return output(context, if (value) "true" else "false"); }, .Optional => { if (value) |payload| { return formatType(payload, fmt, options, context, Errors, output, max_depth); } else { return output(context, "null"); } }, .ErrorUnion => { if (value) |payload| { return formatType(payload, fmt, options, context, Errors, output, max_depth); } else |err| { return formatType(err, fmt, options, context, Errors, output, max_depth); } }, .ErrorSet => { try output(context, "error."); return output(context, @errorName(value)); }, .Enum => { if (comptime std.meta.trait.hasFn("format")(T)) { return value.format(fmt, options, context, Errors, output); } try output(context, @typeName(T)); try output(context, "."); return formatType(@tagName(value), "", options, context, Errors, output, max_depth); }, .Union => { if (comptime std.meta.trait.hasFn("format")(T)) { return value.format(fmt, options, context, Errors, output); } try output(context, @typeName(T)); if (max_depth == 0) { return output(context, "{ ... }"); } const info = @typeInfo(T).Union; if (info.tag_type) |UnionTagType| { try output(context, "{ ."); try output(context, @tagName(@as(UnionTagType, value))); try output(context, " = "); inline for (info.fields) |u_field| { if (@enumToInt(@as(UnionTagType, value)) == u_field.enum_field.?.value) { try formatType(@field(value, u_field.name), "", options, context, Errors, output, max_depth - 1); } } try output(context, " }"); } else { try format(context, Errors, output, "@{x}", .{@ptrToInt(&value)}); } }, .Struct => { if (comptime std.meta.trait.hasFn("format")(T)) { return value.format(fmt, options, context, Errors, output); } try output(context, @typeName(T)); if (max_depth == 0) { return output(context, "{ ... }"); } comptime var field_i = 0; try output(context, "{"); inline while (field_i < @memberCount(T)) : (field_i += 1) { if (field_i == 0) { try output(context, " ."); } else { try output(context, ", ."); } try output(context, @memberName(T, field_i)); try output(context, " = "); try formatType(@field(value, @memberName(T, field_i)), "", options, context, Errors, output, max_depth - 1); } try output(context, " }"); }, .Pointer => |ptr_info| switch (ptr_info.size) { .One => switch (@typeInfo(ptr_info.child)) { builtin.TypeId.Array => |info| { if (info.child == u8) { return formatText(value, fmt, options, context, Errors, output); } return format(context, Errors, output, "{}@{x}", .{ @typeName(T.Child), @ptrToInt(value) }); }, builtin.TypeId.Enum, builtin.TypeId.Union, builtin.TypeId.Struct => { return formatType(value.*, fmt, options, context, Errors, output, max_depth); }, else => return format(context, Errors, output, "{}@{x}", .{ @typeName(T.Child), @ptrToInt(value) }), }, .Many => { if (ptr_info.child == u8) { if (fmt.len > 0 and fmt[0] == 's') { const len = mem.len(u8, value); return formatText(value[0..len], fmt, options, context, Errors, output); } } return format(context, Errors, output, "{}@{x}", .{ @typeName(T.Child), @ptrToInt(value) }); }, .Slice => { if (fmt.len > 0 and ((fmt[0] == 'x') or (fmt[0] == 'X'))) { return formatText(value, fmt, options, context, Errors, output); } if (ptr_info.child == u8) { return formatText(value, fmt, options, context, Errors, output); } return format(context, Errors, output, "{}@{x}", .{ @typeName(ptr_info.child), @ptrToInt(value.ptr) }); }, .C => { return format(context, Errors, output, "{}@{x}", .{ @typeName(T.Child), @ptrToInt(value) }); }, }, .Array => |info| { const Slice = @Type(builtin.TypeInfo{ .Pointer = .{ .size = .Slice, .is_const = true, .is_volatile = false, .is_allowzero = false, .alignment = @alignOf(info.child), .child = info.child, .sentinel = null, }, }); return formatType(@as(Slice, &value), fmt, options, context, Errors, output, max_depth); }, .Fn => { return format(context, Errors, output, "{}@{x}", .{ @typeName(T), @ptrToInt(value) }); }, .Type => return output(context, @typeName(T)), else => @compileError("Unable to format type '" ++ @typeName(T) ++ "'"), } } fn formatValue( value: var, comptime fmt: []const u8, options: FormatOptions, context: var, comptime Errors: type, output: fn (@TypeOf(context), []const u8) Errors!void, ) Errors!void { if (comptime std.mem.eql(u8, fmt, "B")) { return formatBytes(value, options, 1000, context, Errors, output); } else if (comptime std.mem.eql(u8, fmt, "Bi")) { return formatBytes(value, options, 1024, context, Errors, output); } const T = @TypeOf(value); switch (@typeId(T)) { .Float => return formatFloatValue(value, fmt, options, context, Errors, output), .Int, .ComptimeInt => return formatIntValue(value, fmt, options, context, Errors, output), else => comptime unreachable, } } pub fn formatIntValue( value: var, comptime fmt: []const u8, options: FormatOptions, context: var, comptime Errors: type, output: fn (@TypeOf(context), []const u8) Errors!void, ) Errors!void { comptime var radix = 10; comptime var uppercase = false; const int_value = if (@TypeOf(value) == comptime_int) blk: { const Int = math.IntFittingRange(value, value); break :blk @as(Int, value); } else value; if (fmt.len == 0 or comptime std.mem.eql(u8, fmt, "d")) { radix = 10; uppercase = false; } else if (comptime std.mem.eql(u8, fmt, "c")) { if (@TypeOf(int_value).bit_count <= 8) { return formatAsciiChar(@as(u8, int_value), options, context, Errors, output); } else { @compileError("Cannot print integer that is larger than 8 bits as a ascii"); } } else if (comptime std.mem.eql(u8, fmt, "b")) { radix = 2; uppercase = false; } else if (comptime std.mem.eql(u8, fmt, "x")) { radix = 16; uppercase = false; } else if (comptime std.mem.eql(u8, fmt, "X")) { radix = 16; uppercase = true; } else { @compileError("Unknown format string: '" ++ fmt ++ "'"); } return formatInt(int_value, radix, uppercase, options, context, Errors, output); } fn formatFloatValue( value: var, comptime fmt: []const u8, options: FormatOptions, context: var, comptime Errors: type, output: fn (@TypeOf(context), []const u8) Errors!void, ) Errors!void { if (fmt.len == 0 or comptime std.mem.eql(u8, fmt, "e")) { return formatFloatScientific(value, options, context, Errors, output); } else if (comptime std.mem.eql(u8, fmt, "d")) { return formatFloatDecimal(value, options, context, Errors, output); } else { @compileError("Unknown format string: '" ++ fmt ++ "'"); } } pub fn formatText( bytes: []const u8, comptime fmt: []const u8, options: FormatOptions, context: var, comptime Errors: type, output: fn (@TypeOf(context), []const u8) Errors!void, ) Errors!void { if (fmt.len == 0) { return output(context, bytes); } else if (comptime std.mem.eql(u8, fmt, "s")) { return formatBuf(bytes, options, context, Errors, output); } else if (comptime (std.mem.eql(u8, fmt, "x") or std.mem.eql(u8, fmt, "X"))) { for (bytes) |c| { try formatInt(c, 16, fmt[0] == 'X', FormatOptions{ .width = 2, .fill = '0' }, context, Errors, output); } return; } else { @compileError("Unknown format string: '" ++ fmt ++ "'"); } } pub fn formatAsciiChar( c: u8, options: FormatOptions, context: var, comptime Errors: type, output: fn (@TypeOf(context), []const u8) Errors!void, ) Errors!void { return output(context, @as(*const [1]u8, &c)[0..]); } pub fn formatBuf( buf: []const u8, options: FormatOptions, context: var, comptime Errors: type, output: fn (@TypeOf(context), []const u8) Errors!void, ) Errors!void { try output(context, buf); const width = options.width orelse 0; var leftover_padding = if (width > buf.len) (width - buf.len) else return; const pad_byte: u8 = options.fill; while (leftover_padding > 0) : (leftover_padding -= 1) { try output(context, @as(*const [1]u8, &pad_byte)[0..1]); } } // Print a float in scientific notation to the specified precision. Null uses full precision. // It should be the case that every full precision, printed value can be re-parsed back to the // same type unambiguously. pub fn formatFloatScientific( value: var, options: FormatOptions, context: var, comptime Errors: type, output: fn (@TypeOf(context), []const u8) Errors!void, ) Errors!void { var x = @floatCast(f64, value); // Errol doesn't handle these special cases. if (math.signbit(x)) { try output(context, "-"); x = -x; } if (math.isNan(x)) { return output(context, "nan"); } if (math.isPositiveInf(x)) { return output(context, "inf"); } if (x == 0.0) { try output(context, "0"); if (options.precision) |precision| { if (precision != 0) { try output(context, "."); var i: usize = 0; while (i < precision) : (i += 1) { try output(context, "0"); } } } else { try output(context, ".0"); } try output(context, "e+00"); return; } var buffer: [32]u8 = undefined; var float_decimal = errol.errol3(x, buffer[0..]); if (options.precision) |precision| { errol.roundToPrecision(&float_decimal, precision, errol.RoundMode.Scientific); try output(context, float_decimal.digits[0..1]); // {e0} case prints no `.` if (precision != 0) { try output(context, "."); var printed: usize = 0; if (float_decimal.digits.len > 1) { const num_digits = math.min(float_decimal.digits.len, precision + 1); try output(context, float_decimal.digits[1..num_digits]); printed += num_digits - 1; } while (printed < precision) : (printed += 1) { try output(context, "0"); } } } else { try output(context, float_decimal.digits[0..1]); try output(context, "."); if (float_decimal.digits.len > 1) { const num_digits = if (@TypeOf(value) == f32) math.min(@as(usize, 9), float_decimal.digits.len) else float_decimal.digits.len; try output(context, float_decimal.digits[1..num_digits]); } else { try output(context, "0"); } } try output(context, "e"); const exp = float_decimal.exp - 1; if (exp >= 0) { try output(context, "+"); if (exp > -10 and exp < 10) { try output(context, "0"); } try formatInt(exp, 10, false, FormatOptions{ .width = 0 }, context, Errors, output); } else { try output(context, "-"); if (exp > -10 and exp < 10) { try output(context, "0"); } try formatInt(-exp, 10, false, FormatOptions{ .width = 0 }, context, Errors, output); } } // Print a float of the format x.yyyyy where the number of y is specified by the precision argument. // By default floats are printed at full precision (no rounding). pub fn formatFloatDecimal( value: var, options: FormatOptions, context: var, comptime Errors: type, output: fn (@TypeOf(context), []const u8) Errors!void, ) Errors!void { var x = @as(f64, value); // Errol doesn't handle these special cases. if (math.signbit(x)) { try output(context, "-"); x = -x; } if (math.isNan(x)) { return output(context, "nan"); } if (math.isPositiveInf(x)) { return output(context, "inf"); } if (x == 0.0) { try output(context, "0"); if (options.precision) |precision| { if (precision != 0) { try output(context, "."); var i: usize = 0; while (i < precision) : (i += 1) { try output(context, "0"); } } else { try output(context, ".0"); } } else { try output(context, "0"); } return; } // non-special case, use errol3 var buffer: [32]u8 = undefined; var float_decimal = errol.errol3(x, buffer[0..]); if (options.precision) |precision| { errol.roundToPrecision(&float_decimal, precision, errol.RoundMode.Decimal); // exp < 0 means the leading is always 0 as errol result is normalized. var num_digits_whole = if (float_decimal.exp > 0) @intCast(usize, float_decimal.exp) else 0; // the actual slice into the buffer, we may need to zero-pad between num_digits_whole and this. var num_digits_whole_no_pad = math.min(num_digits_whole, float_decimal.digits.len); if (num_digits_whole > 0) { // We may have to zero pad, for instance 1e4 requires zero padding. try output(context, float_decimal.digits[0..num_digits_whole_no_pad]); var i = num_digits_whole_no_pad; while (i < num_digits_whole) : (i += 1) { try output(context, "0"); } } else { try output(context, "0"); } // {.0} special case doesn't want a trailing '.' if (precision == 0) { return; } try output(context, "."); // Keep track of fractional count printed for case where we pre-pad then post-pad with 0's. var printed: usize = 0; // Zero-fill until we reach significant digits or run out of precision. if (float_decimal.exp <= 0) { const zero_digit_count = @intCast(usize, -float_decimal.exp); const zeros_to_print = math.min(zero_digit_count, precision); var i: usize = 0; while (i < zeros_to_print) : (i += 1) { try output(context, "0"); printed += 1; } if (printed >= precision) { return; } } // Remaining fractional portion, zero-padding if insufficient. assert(precision >= printed); if (num_digits_whole_no_pad + precision - printed < float_decimal.digits.len) { try output(context, float_decimal.digits[num_digits_whole_no_pad .. num_digits_whole_no_pad + precision - printed]); return; } else { try output(context, float_decimal.digits[num_digits_whole_no_pad..]); printed += float_decimal.digits.len - num_digits_whole_no_pad; while (printed < precision) : (printed += 1) { try output(context, "0"); } } } else { // exp < 0 means the leading is always 0 as errol result is normalized. var num_digits_whole = if (float_decimal.exp > 0) @intCast(usize, float_decimal.exp) else 0; // the actual slice into the buffer, we may need to zero-pad between num_digits_whole and this. var num_digits_whole_no_pad = math.min(num_digits_whole, float_decimal.digits.len); if (num_digits_whole > 0) { // We may have to zero pad, for instance 1e4 requires zero padding. try output(context, float_decimal.digits[0..num_digits_whole_no_pad]); var i = num_digits_whole_no_pad; while (i < num_digits_whole) : (i += 1) { try output(context, "0"); } } else { try output(context, "0"); } // Omit `.` if no fractional portion if (float_decimal.exp >= 0 and num_digits_whole_no_pad == float_decimal.digits.len) { return; } try output(context, "."); // Zero-fill until we reach significant digits or run out of precision. if (float_decimal.exp < 0) { const zero_digit_count = @intCast(usize, -float_decimal.exp); var i: usize = 0; while (i < zero_digit_count) : (i += 1) { try output(context, "0"); } } try output(context, float_decimal.digits[num_digits_whole_no_pad..]); } } pub fn formatBytes( value: var, options: FormatOptions, comptime radix: usize, context: var, comptime Errors: type, output: fn (@TypeOf(context), []const u8) Errors!void, ) Errors!void { if (value == 0) { return output(context, "0B"); } const mags_si = " kMGTPEZY"; const mags_iec = " KMGTPEZY"; const magnitude = switch (radix) { 1000 => math.min(math.log2(value) / comptime math.log2(1000), mags_si.len - 1), 1024 => math.min(math.log2(value) / 10, mags_iec.len - 1), else => unreachable, }; const new_value = lossyCast(f64, value) / math.pow(f64, lossyCast(f64, radix), lossyCast(f64, magnitude)); const suffix = switch (radix) { 1000 => mags_si[magnitude], 1024 => mags_iec[magnitude], else => unreachable, }; try formatFloatDecimal(new_value, options, context, Errors, output); if (suffix == ' ') { return output(context, "B"); } const buf = switch (radix) { 1000 => &[_]u8{ suffix, 'B' }, 1024 => &[_]u8{ suffix, 'i', 'B' }, else => unreachable, }; return output(context, buf); } pub fn formatInt( value: var, base: u8, uppercase: bool, options: FormatOptions, context: var, comptime Errors: type, output: fn (@TypeOf(context), []const u8) Errors!void, ) Errors!void { const int_value = if (@TypeOf(value) == comptime_int) blk: { const Int = math.IntFittingRange(value, value); break :blk @as(Int, value); } else value; if (@TypeOf(int_value).is_signed) { return formatIntSigned(int_value, base, uppercase, options, context, Errors, output); } else { return formatIntUnsigned(int_value, base, uppercase, options, context, Errors, output); } } fn formatIntSigned( value: var, base: u8, uppercase: bool, options: FormatOptions, context: var, comptime Errors: type, output: fn (@TypeOf(context), []const u8) Errors!void, ) Errors!void { const new_options = FormatOptions{ .width = if (options.width) |w| (if (w == 0) 0 else w - 1) else null, .precision = options.precision, .fill = options.fill, }; const uint = @IntType(false, @TypeOf(value).bit_count); if (value < 0) { const minus_sign: u8 = '-'; try output(context, @as(*const [1]u8, &minus_sign)[0..]); const new_value = @intCast(uint, -(value + 1)) + 1; return formatIntUnsigned(new_value, base, uppercase, new_options, context, Errors, output); } else if (options.width == null or options.width.? == 0) { return formatIntUnsigned(@intCast(uint, value), base, uppercase, options, context, Errors, output); } else { const plus_sign: u8 = '+'; try output(context, @as(*const [1]u8, &plus_sign)[0..]); const new_value = @intCast(uint, value); return formatIntUnsigned(new_value, base, uppercase, new_options, context, Errors, output); } } fn formatIntUnsigned( value: var, base: u8, uppercase: bool, options: FormatOptions, context: var, comptime Errors: type, output: fn (@TypeOf(context), []const u8) Errors!void, ) Errors!void { assert(base >= 2); var buf: [math.max(@TypeOf(value).bit_count, 1)]u8 = undefined; const min_int_bits = comptime math.max(@TypeOf(value).bit_count, @TypeOf(base).bit_count); const MinInt = @IntType(@TypeOf(value).is_signed, min_int_bits); var a: MinInt = value; var index: usize = buf.len; while (true) { const digit = a % base; index -= 1; buf[index] = digitToChar(@intCast(u8, digit), uppercase); a /= base; if (a == 0) break; } const digits_buf = buf[index..]; const width = options.width orelse 0; const padding = if (width > digits_buf.len) (width - digits_buf.len) else 0; if (padding > index) { const zero_byte: u8 = options.fill; var leftover_padding = padding - index; while (true) { try output(context, @as(*const [1]u8, &zero_byte)[0..]); leftover_padding -= 1; if (leftover_padding == 0) break; } mem.set(u8, buf[0..index], options.fill); return output(context, &buf); } else { const padded_buf = buf[index - padding ..]; mem.set(u8, padded_buf[0..padding], options.fill); return output(context, padded_buf); } } pub fn formatIntBuf(out_buf: []u8, value: var, base: u8, uppercase: bool, options: FormatOptions) usize { var context = FormatIntBuf{ .out_buf = out_buf, .index = 0, }; formatInt(value, base, uppercase, options, &context, error{}, formatIntCallback) catch unreachable; return context.index; } const FormatIntBuf = struct { out_buf: []u8, index: usize, }; fn formatIntCallback(context: *FormatIntBuf, bytes: []const u8) (error{}!void) { mem.copy(u8, context.out_buf[context.index..], bytes); context.index += bytes.len; } pub fn parseInt(comptime T: type, buf: []const u8, radix: u8) !T { if (!T.is_signed) return parseUnsigned(T, buf, radix); if (buf.len == 0) return @as(T, 0); if (buf[0] == '-') { return math.negate(try parseUnsigned(T, buf[1..], radix)); } else if (buf[0] == '+') { return parseUnsigned(T, buf[1..], radix); } else { return parseUnsigned(T, buf, radix); } } test "parseInt" { std.testing.expect((parseInt(i32, "-10", 10) catch unreachable) == -10); std.testing.expect((parseInt(i32, "+10", 10) catch unreachable) == 10); std.testing.expect(if (parseInt(i32, " 10", 10)) |_| false else |err| err == error.InvalidCharacter); std.testing.expect(if (parseInt(i32, "10 ", 10)) |_| false else |err| err == error.InvalidCharacter); std.testing.expect(if (parseInt(u32, "-10", 10)) |_| false else |err| err == error.InvalidCharacter); std.testing.expect((parseInt(u8, "255", 10) catch unreachable) == 255); std.testing.expect(if (parseInt(u8, "256", 10)) |_| false else |err| err == error.Overflow); } pub const ParseUnsignedError = error{ /// The result cannot fit in the type specified Overflow, /// The input had a byte that was not a digit InvalidCharacter, }; pub fn parseUnsigned(comptime T: type, buf: []const u8, radix: u8) ParseUnsignedError!T { var x: T = 0; for (buf) |c| { const digit = try charToDigit(c, radix); if (x != 0) x = try math.mul(T, x, try math.cast(T, radix)); x = try math.add(T, x, try math.cast(T, digit)); } return x; } test "parseUnsigned" { std.testing.expect((try parseUnsigned(u16, "050124", 10)) == 50124); std.testing.expect((try parseUnsigned(u16, "65535", 10)) == 65535); std.testing.expectError(error.Overflow, parseUnsigned(u16, "65536", 10)); std.testing.expect((try parseUnsigned(u64, "0ffffffffffffffff", 16)) == 0xffffffffffffffff); std.testing.expectError(error.Overflow, parseUnsigned(u64, "10000000000000000", 16)); std.testing.expect((try parseUnsigned(u32, "DeadBeef", 16)) == 0xDEADBEEF); std.testing.expect((try parseUnsigned(u7, "1", 10)) == 1); std.testing.expect((try parseUnsigned(u7, "1000", 2)) == 8); std.testing.expectError(error.InvalidCharacter, parseUnsigned(u32, "f", 10)); std.testing.expectError(error.InvalidCharacter, parseUnsigned(u8, "109", 8)); std.testing.expect((try parseUnsigned(u32, "NUMBER", 36)) == 1442151747); // these numbers should fit even though the radix itself doesn't fit in the destination type std.testing.expect((try parseUnsigned(u1, "0", 10)) == 0); std.testing.expect((try parseUnsigned(u1, "1", 10)) == 1); std.testing.expectError(error.Overflow, parseUnsigned(u1, "2", 10)); std.testing.expect((try parseUnsigned(u1, "001", 16)) == 1); std.testing.expect((try parseUnsigned(u2, "3", 16)) == 3); std.testing.expectError(error.Overflow, parseUnsigned(u2, "4", 16)); } pub const parseFloat = @import("fmt/parse_float.zig").parseFloat; test "parseFloat" { _ = @import("fmt/parse_float.zig"); } pub fn charToDigit(c: u8, radix: u8) (error{InvalidCharacter}!u8) { const value = switch (c) { '0'...'9' => c - '0', 'A'...'Z' => c - 'A' + 10, 'a'...'z' => c - 'a' + 10, else => return error.InvalidCharacter, }; if (value >= radix) return error.InvalidCharacter; return value; } fn digitToChar(digit: u8, uppercase: bool) u8 { return switch (digit) { 0...9 => digit + '0', 10...35 => digit + ((if (uppercase) @as(u8, 'A') else @as(u8, 'a')) - 10), else => unreachable, }; } const BufPrintContext = struct { remaining: []u8, }; fn bufPrintWrite(context: *BufPrintContext, bytes: []const u8) !void { if (context.remaining.len < bytes.len) { mem.copy(u8, context.remaining, bytes[0..context.remaining.len]); return error.BufferTooSmall; } mem.copy(u8, context.remaining, bytes); context.remaining = context.remaining[bytes.len..]; } pub const BufPrintError = error{ /// As much as possible was written to the buffer, but it was too small to fit all the printed bytes. BufferTooSmall, }; pub fn bufPrint(buf: []u8, comptime fmt: []const u8, args: var) BufPrintError![]u8 { var context = BufPrintContext{ .remaining = buf }; try format(&context, BufPrintError, bufPrintWrite, fmt, args); return buf[0 .. buf.len - context.remaining.len]; } pub const AllocPrintError = error{OutOfMemory}; pub fn allocPrint(allocator: *mem.Allocator, comptime fmt: []const u8, args: var) AllocPrintError![]u8 { var size: usize = 0; format(&size, error{}, countSize, fmt, args) catch |err| switch (err) {}; const buf = try allocator.alloc(u8, size); return bufPrint(buf, fmt, args) catch |err| switch (err) { error.BufferTooSmall => unreachable, // we just counted the size above }; } fn countSize(size: *usize, bytes: []const u8) (error{}!void) { size.* += bytes.len; } test "bufPrintInt" { var buffer: [100]u8 = undefined; const buf = buffer[0..]; std.testing.expect(mem.eql(u8, bufPrintIntToSlice(buf, @as(i32, -12345678), 2, false, FormatOptions{}), "-101111000110000101001110")); std.testing.expect(mem.eql(u8, bufPrintIntToSlice(buf, @as(i32, -12345678), 10, false, FormatOptions{}), "-12345678")); std.testing.expect(mem.eql(u8, bufPrintIntToSlice(buf, @as(i32, -12345678), 16, false, FormatOptions{}), "-bc614e")); std.testing.expect(mem.eql(u8, bufPrintIntToSlice(buf, @as(i32, -12345678), 16, true, FormatOptions{}), "-BC614E")); std.testing.expect(mem.eql(u8, bufPrintIntToSlice(buf, @as(u32, 12345678), 10, true, FormatOptions{}), "12345678")); std.testing.expect(mem.eql(u8, bufPrintIntToSlice(buf, @as(u32, 666), 10, false, FormatOptions{ .width = 6 }), " 666")); std.testing.expect(mem.eql(u8, bufPrintIntToSlice(buf, @as(u32, 0x1234), 16, false, FormatOptions{ .width = 6 }), " 1234")); std.testing.expect(mem.eql(u8, bufPrintIntToSlice(buf, @as(u32, 0x1234), 16, false, FormatOptions{ .width = 1 }), "1234")); std.testing.expect(mem.eql(u8, bufPrintIntToSlice(buf, @as(i32, 42), 10, false, FormatOptions{ .width = 3 }), "+42")); std.testing.expect(mem.eql(u8, bufPrintIntToSlice(buf, @as(i32, -42), 10, false, FormatOptions{ .width = 3 }), "-42")); } fn bufPrintIntToSlice(buf: []u8, value: var, base: u8, uppercase: bool, options: FormatOptions) []u8 { return buf[0..formatIntBuf(buf, value, base, uppercase, options)]; } test "parse u64 digit too big" { _ = parseUnsigned(u64, "123a", 10) catch |err| { if (err == error.InvalidCharacter) return; unreachable; }; unreachable; } test "parse unsigned comptime" { comptime { std.testing.expect((try parseUnsigned(usize, "2", 10)) == 2); } } test "optional" { { const value: ?i32 = 1234; try testFmt("optional: 1234\n", "optional: {}\n", .{value}); } { const value: ?i32 = null; try testFmt("optional: null\n", "optional: {}\n", .{value}); } } test "error" { { const value: anyerror!i32 = 1234; try testFmt("error union: 1234\n", "error union: {}\n", .{value}); } { const value: anyerror!i32 = error.InvalidChar; try testFmt("error union: error.InvalidChar\n", "error union: {}\n", .{value}); } } test "int.small" { { const value: u3 = 0b101; try testFmt("u3: 5\n", "u3: {}\n", .{value}); } } test "int.specifier" { { const value: u8 = 'a'; try testFmt("u8: a\n", "u8: {c}\n", .{value}); } { const value: u8 = 0b1100; try testFmt("u8: 0b1100\n", "u8: 0b{b}\n", .{value}); } } test "int.padded" { try testFmt("u8: ' 1'", "u8: '{:4}'", .{@as(u8, 1)}); try testFmt("u8: 'xxx1'", "u8: '{:x<4}'", .{@as(u8, 1)}); } test "buffer" { { var buf1: [32]u8 = undefined; var context = BufPrintContext{ .remaining = buf1[0..] }; try formatType(1234, "", FormatOptions{}, &context, error{BufferTooSmall}, bufPrintWrite, default_max_depth); var res = buf1[0 .. buf1.len - context.remaining.len]; std.testing.expect(mem.eql(u8, res, "1234")); context = BufPrintContext{ .remaining = buf1[0..] }; try formatType('a', "c", FormatOptions{}, &context, error{BufferTooSmall}, bufPrintWrite, default_max_depth); res = buf1[0 .. buf1.len - context.remaining.len]; std.testing.expect(mem.eql(u8, res, "a")); context = BufPrintContext{ .remaining = buf1[0..] }; try formatType(0b1100, "b", FormatOptions{}, &context, error{BufferTooSmall}, bufPrintWrite, default_max_depth); res = buf1[0 .. buf1.len - context.remaining.len]; std.testing.expect(mem.eql(u8, res, "1100")); } } test "array" { { const value: [3]u8 = "abc".*; try testFmt("array: abc\n", "array: {}\n", .{value}); try testFmt("array: abc\n", "array: {}\n", .{&value}); var buf: [100]u8 = undefined; try testFmt( try bufPrint(buf[0..], "array: [3]u8@{x}\n", .{@ptrToInt(&value)}), "array: {*}\n", .{&value}, ); } } test "slice" { { const value: []const u8 = "abc"; try testFmt("slice: abc\n", "slice: {}\n", .{value}); } { const value = @intToPtr([*]const []const u8, 0xdeadbeef)[0..0]; try testFmt("slice: []const u8@deadbeef\n", "slice: {}\n", .{value}); } try testFmt("buf: Test \n", "buf: {s:5}\n", .{"Test"}); try testFmt("buf: Test\n Other text", "buf: {s}\n Other text", .{"Test"}); } test "pointer" { { const value = @intToPtr(*i32, 0xdeadbeef); try testFmt("pointer: i32@deadbeef\n", "pointer: {}\n", .{value}); try testFmt("pointer: i32@deadbeef\n", "pointer: {*}\n", .{value}); } { const value = @intToPtr(fn () void, 0xdeadbeef); try testFmt("pointer: fn() void@deadbeef\n", "pointer: {}\n", .{value}); } { const value = @intToPtr(fn () void, 0xdeadbeef); try testFmt("pointer: fn() void@deadbeef\n", "pointer: {}\n", .{value}); } } test "cstr" { try testFmt("cstr: Test C\n", "cstr: {s}\n", .{"Test C"}); try testFmt("cstr: Test C \n", "cstr: {s:10}\n", .{"Test C"}); } test "filesize" { if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { // TODO https://github.com/ziglang/zig/issues/3289 return error.SkipZigTest; } try testFmt("file size: 63MiB\n", "file size: {Bi}\n", .{@as(usize, 63 * 1024 * 1024)}); try testFmt("file size: 66.06MB\n", "file size: {B:.2}\n", .{@as(usize, 63 * 1024 * 1024)}); } test "struct" { { const Struct = struct { field: u8, }; const value = Struct{ .field = 42 }; try testFmt("struct: Struct{ .field = 42 }\n", "struct: {}\n", .{value}); try testFmt("struct: Struct{ .field = 42 }\n", "struct: {}\n", .{&value}); } { const Struct = struct { a: u0, b: u1, }; const value = Struct{ .a = 0, .b = 1 }; try testFmt("struct: Struct{ .a = 0, .b = 1 }\n", "struct: {}\n", .{value}); } } test "enum" { const Enum = enum { One, Two, }; const value = Enum.Two; try testFmt("enum: Enum.Two\n", "enum: {}\n", .{value}); try testFmt("enum: Enum.Two\n", "enum: {}\n", .{&value}); } test "float.scientific" { if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { // TODO https://github.com/ziglang/zig/issues/3289 return error.SkipZigTest; } try testFmt("f32: 1.34000003e+00", "f32: {e}", .{@as(f32, 1.34)}); try testFmt("f32: 1.23400001e+01", "f32: {e}", .{@as(f32, 12.34)}); try testFmt("f64: -1.234e+11", "f64: {e}", .{@as(f64, -12.34e10)}); try testFmt("f64: 9.99996e-40", "f64: {e}", .{@as(f64, 9.999960e-40)}); } test "float.scientific.precision" { if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { // TODO https://github.com/ziglang/zig/issues/3289 return error.SkipZigTest; } try testFmt("f64: 1.40971e-42", "f64: {e:.5}", .{@as(f64, 1.409706e-42)}); try testFmt("f64: 1.00000e-09", "f64: {e:.5}", .{@as(f64, @bitCast(f32, @as(u32, 814313563)))}); try testFmt("f64: 7.81250e-03", "f64: {e:.5}", .{@as(f64, @bitCast(f32, @as(u32, 1006632960)))}); // libc rounds 1.000005e+05 to 1.00000e+05 but zig does 1.00001e+05. // In fact, libc doesn't round a lot of 5 cases up when one past the precision point. try testFmt("f64: 1.00001e+05", "f64: {e:.5}", .{@as(f64, @bitCast(f32, @as(u32, 1203982400)))}); } test "float.special" { if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { // TODO https://github.com/ziglang/zig/issues/3289 return error.SkipZigTest; } try testFmt("f64: nan", "f64: {}", .{math.nan_f64}); // negative nan is not defined by IEE 754, // and ARM thus normalizes it to positive nan if (builtin.arch != builtin.Arch.arm) { try testFmt("f64: -nan", "f64: {}", .{-math.nan_f64}); } try testFmt("f64: inf", "f64: {}", .{math.inf_f64}); try testFmt("f64: -inf", "f64: {}", .{-math.inf_f64}); } test "float.decimal" { if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { // TODO https://github.com/ziglang/zig/issues/3289 return error.SkipZigTest; } try testFmt("f64: 152314000000000000000000000000", "f64: {d}", .{@as(f64, 1.52314e+29)}); try testFmt("f32: 1.1", "f32: {d:.1}", .{@as(f32, 1.1234)}); try testFmt("f32: 1234.57", "f32: {d:.2}", .{@as(f32, 1234.567)}); // -11.1234 is converted to f64 -11.12339... internally (errol3() function takes f64). // -11.12339... is rounded back up to -11.1234 try testFmt("f32: -11.1234", "f32: {d:.4}", .{@as(f32, -11.1234)}); try testFmt("f32: 91.12345", "f32: {d:.5}", .{@as(f32, 91.12345)}); try testFmt("f64: 91.1234567890", "f64: {d:.10}", .{@as(f64, 91.12345678901235)}); try testFmt("f64: 0.00000", "f64: {d:.5}", .{@as(f64, 0.0)}); try testFmt("f64: 6", "f64: {d:.0}", .{@as(f64, 5.700)}); try testFmt("f64: 10.0", "f64: {d:.1}", .{@as(f64, 9.999)}); try testFmt("f64: 1.000", "f64: {d:.3}", .{@as(f64, 1.0)}); try testFmt("f64: 0.00030000", "f64: {d:.8}", .{@as(f64, 0.0003)}); try testFmt("f64: 0.00000", "f64: {d:.5}", .{@as(f64, 1.40130e-45)}); try testFmt("f64: 0.00000", "f64: {d:.5}", .{@as(f64, 9.999960e-40)}); } test "float.libc.sanity" { if (builtin.os == .linux and builtin.arch == .arm and builtin.abi == .musleabihf) { // TODO https://github.com/ziglang/zig/issues/3289 return error.SkipZigTest; } try testFmt("f64: 0.00001", "f64: {d:.5}", .{@as(f64, @bitCast(f32, @as(u32, 916964781)))}); try testFmt("f64: 0.00001", "f64: {d:.5}", .{@as(f64, @bitCast(f32, @as(u32, 925353389)))}); try testFmt("f64: 0.10000", "f64: {d:.5}", .{@as(f64, @bitCast(f32, @as(u32, 1036831278)))}); try testFmt("f64: 1.00000", "f64: {d:.5}", .{@as(f64, @bitCast(f32, @as(u32, 1065353133)))}); try testFmt("f64: 10.00000", "f64: {d:.5}", .{@as(f64, @bitCast(f32, @as(u32, 1092616192)))}); // libc differences // // This is 0.015625 exactly according to gdb. We thus round down, // however glibc rounds up for some reason. This occurs for all // floats of the form x.yyyy25 on a precision point. try testFmt("f64: 0.01563", "f64: {d:.5}", .{@as(f64, @bitCast(f32, @as(u32, 1015021568)))}); // errol3 rounds to ... 630 but libc rounds to ...632. Grisu3 // also rounds to 630 so I'm inclined to believe libc is not // optimal here. try testFmt("f64: 18014400656965630.00000", "f64: {d:.5}", .{@as(f64, @bitCast(f32, @as(u32, 1518338049)))}); } test "custom" { const Vec2 = struct { const SelfType = @This(); x: f32, y: f32, pub fn format( self: SelfType, comptime fmt: []const u8, options: FormatOptions, context: var, comptime Errors: type, output: fn (@TypeOf(context), []const u8) Errors!void, ) Errors!void { if (fmt.len == 0 or comptime std.mem.eql(u8, fmt, "p")) { return std.fmt.format(context, Errors, output, "({d:.3},{d:.3})", .{ self.x, self.y }); } else if (comptime std.mem.eql(u8, fmt, "d")) { return std.fmt.format(context, Errors, output, "{d:.3}x{d:.3}", .{ self.x, self.y }); } else { @compileError("Unknown format character: '" ++ fmt ++ "'"); } } }; var buf1: [32]u8 = undefined; var value = Vec2{ .x = 10.2, .y = 2.22, }; try testFmt("point: (10.200,2.220)\n", "point: {}\n", .{&value}); try testFmt("dim: 10.200x2.220\n", "dim: {d}\n", .{&value}); // same thing but not passing a pointer try testFmt("point: (10.200,2.220)\n", "point: {}\n", .{value}); try testFmt("dim: 10.200x2.220\n", "dim: {d}\n", .{value}); } test "struct" { const S = struct { a: u32, b: anyerror, }; const inst = S{ .a = 456, .b = error.Unused, }; try testFmt("S{ .a = 456, .b = error.Unused }", "{}", .{inst}); } test "union" { const TU = union(enum) { float: f32, int: u32, }; const UU = union { float: f32, int: u32, }; const EU = extern union { float: f32, int: u32, }; const tu_inst = TU{ .int = 123 }; const uu_inst = UU{ .int = 456 }; const eu_inst = EU{ .float = 321.123 }; try testFmt("TU{ .int = 123 }", "{}", .{tu_inst}); var buf: [100]u8 = undefined; const uu_result = try bufPrint(buf[0..], "{}", .{uu_inst}); std.testing.expect(mem.eql(u8, uu_result[0..3], "UU@")); const eu_result = try bufPrint(buf[0..], "{}", .{eu_inst}); std.testing.expect(mem.eql(u8, uu_result[0..3], "EU@")); } test "enum" { const E = enum { One, Two, Three, }; const inst = E.Two; try testFmt("E.Two", "{}", .{inst}); } test "struct.self-referential" { const S = struct { const SelfType = @This(); a: ?*SelfType, }; var inst = S{ .a = null, }; inst.a = &inst; try testFmt("S{ .a = S{ .a = S{ .a = S{ ... } } } }", "{}", .{inst}); } test "struct.zero-size" { const A = struct { fn foo() void {} }; const B = struct { a: A, c: i32, }; const a = A{}; const b = B{ .a = a, .c = 0 }; try testFmt("B{ .a = A{ }, .c = 0 }", "{}", .{b}); } test "bytes.hex" { const some_bytes = "\xCA\xFE\xBA\xBE"; try testFmt("lowercase: cafebabe\n", "lowercase: {x}\n", .{some_bytes}); try testFmt("uppercase: CAFEBABE\n", "uppercase: {X}\n", .{some_bytes}); //Test Slices try testFmt("uppercase: CAFE\n", "uppercase: {X}\n", .{some_bytes[0..2]}); try testFmt("lowercase: babe\n", "lowercase: {x}\n", .{some_bytes[2..]}); const bytes_with_zeros = "\x00\x0E\xBA\xBE"; try testFmt("lowercase: 000ebabe\n", "lowercase: {x}\n", .{bytes_with_zeros}); } fn testFmt(expected: []const u8, comptime template: []const u8, args: var) !void { var buf: [100]u8 = undefined; const result = try bufPrint(buf[0..], template, args); if (mem.eql(u8, result, expected)) return; std.debug.warn("\n====== expected this output: =========\n", .{}); std.debug.warn("{}", .{expected}); std.debug.warn("\n======== instead found this: =========\n", .{}); std.debug.warn("{}", .{result}); std.debug.warn("\n======================================\n", .{}); return error.TestFailed; } pub fn trim(buf: []const u8) []const u8 { var start: usize = 0; while (start < buf.len and isWhiteSpace(buf[start])) : (start += 1) {} var end: usize = buf.len; while (true) { if (end > start) { const new_end = end - 1; if (isWhiteSpace(buf[new_end])) { end = new_end; continue; } } break; } return buf[start..end]; } test "trim" { std.testing.expect(mem.eql(u8, "abc", trim("\n abc \t"))); std.testing.expect(mem.eql(u8, "", trim(" "))); std.testing.expect(mem.eql(u8, "", trim(""))); std.testing.expect(mem.eql(u8, "abc", trim(" abc"))); std.testing.expect(mem.eql(u8, "abc", trim("abc "))); } pub fn isWhiteSpace(byte: u8) bool { return switch (byte) { ' ', '\t', '\n', '\r' => true, else => false, }; } pub fn hexToBytes(out: []u8, input: []const u8) !void { if (out.len * 2 < input.len) return error.InvalidLength; var in_i: usize = 0; while (in_i != input.len) : (in_i += 2) { const hi = try charToDigit(input[in_i], 16); const lo = try charToDigit(input[in_i + 1], 16); out[in_i / 2] = (hi << 4) | lo; } } test "hexToBytes" { const test_hex_str = "909A312BB12ED1F819B3521AC4C1E896F2160507FFC1C8381E3B07BB16BD1706"; var pb: [32]u8 = undefined; try hexToBytes(pb[0..], test_hex_str); try testFmt(test_hex_str, "{X}", .{pb}); } test "formatIntValue with comptime_int" { const value: comptime_int = 123456789123456789; var buf = try std.Buffer.init(std.debug.global_allocator, ""); try formatIntValue(value, "", FormatOptions{}, &buf, @TypeOf(std.Buffer.append).ReturnType.ErrorSet, std.Buffer.append); std.testing.expect(mem.eql(u8, buf.toSlice(), "123456789123456789")); } test "formatType max_depth" { const Vec2 = struct { const SelfType = @This(); x: f32, y: f32, pub fn format( self: SelfType, comptime fmt: []const u8, options: FormatOptions, context: var, comptime Errors: type, output: fn (@TypeOf(context), []const u8) Errors!void, ) Errors!void { if (fmt.len == 0) { return std.fmt.format(context, Errors, output, "({d:.3},{d:.3})", .{ self.x, self.y }); } else { @compileError("Unknown format string: '" ++ fmt ++ "'"); } } }; const E = enum { One, Two, Three, }; const TU = union(enum) { const SelfType = @This(); float: f32, int: u32, ptr: ?*SelfType, }; const S = struct { const SelfType = @This(); a: ?*SelfType, tu: TU, e: E, vec: Vec2, }; var inst = S{ .a = null, .tu = TU{ .ptr = null }, .e = E.Two, .vec = Vec2{ .x = 10.2, .y = 2.22 }, }; inst.a = &inst; inst.tu.ptr = &inst.tu; var buf0 = try std.Buffer.init(std.debug.global_allocator, ""); try formatType(inst, "", FormatOptions{}, &buf0, @TypeOf(std.Buffer.append).ReturnType.ErrorSet, std.Buffer.append, 0); std.testing.expect(mem.eql(u8, buf0.toSlice(), "S{ ... }")); var buf1 = try std.Buffer.init(std.debug.global_allocator, ""); try formatType(inst, "", FormatOptions{}, &buf1, @TypeOf(std.Buffer.append).ReturnType.ErrorSet, std.Buffer.append, 1); std.testing.expect(mem.eql(u8, buf1.toSlice(), "S{ .a = S{ ... }, .tu = TU{ ... }, .e = E.Two, .vec = (10.200,2.220) }")); var buf2 = try std.Buffer.init(std.debug.global_allocator, ""); try formatType(inst, "", FormatOptions{}, &buf2, @TypeOf(std.Buffer.append).ReturnType.ErrorSet, std.Buffer.append, 2); std.testing.expect(mem.eql(u8, buf2.toSlice(), "S{ .a = S{ .a = S{ ... }, .tu = TU{ ... }, .e = E.Two, .vec = (10.200,2.220) }, .tu = TU{ .ptr = TU{ ... } }, .e = E.Two, .vec = (10.200,2.220) }")); var buf3 = try std.Buffer.init(std.debug.global_allocator, ""); try formatType(inst, "", FormatOptions{}, &buf3, @TypeOf(std.Buffer.append).ReturnType.ErrorSet, std.Buffer.append, 3); std.testing.expect(mem.eql(u8, buf3.toSlice(), "S{ .a = S{ .a = S{ .a = S{ ... }, .tu = TU{ ... }, .e = E.Two, .vec = (10.200,2.220) }, .tu = TU{ .ptr = TU{ ... } }, .e = E.Two, .vec = (10.200,2.220) }, .tu = TU{ .ptr = TU{ .ptr = TU{ ... } } }, .e = E.Two, .vec = (10.200,2.220) }")); } test "positional" { try testFmt("2 1 0", "{2} {1} {0}", .{ @as(usize, 0), @as(usize, 1), @as(usize, 2) }); try testFmt("2 1 0", "{2} {1} {}", .{ @as(usize, 0), @as(usize, 1), @as(usize, 2) }); try testFmt("0 0", "{0} {0}", .{@as(usize, 0)}); try testFmt("0 1", "{} {1}", .{ @as(usize, 0), @as(usize, 1) }); try testFmt("1 0 0 1", "{1} {} {0} {}", .{ @as(usize, 0), @as(usize, 1) }); } test "positional with specifier" { try testFmt("10.0", "{0d:.1}", .{@as(f64, 9.999)}); } test "positional/alignment/width/precision" { try testFmt("10.0", "{0d: >3.1}", .{@as(f64, 9.999)}); }
lib/std/fmt.zig
const std = @import("std"); const liu = @import("liu"); const input = @import("./input.zig"); const rows = input.rows; const keys = input.keys; // https://youtu.be/SFKR5rZBu-8?t=2202 // https://stackoverflow.com/questions/22511158/how-to-profile-web-workers-in-chrome const wasm = liu.wasm; pub const WasmCommand = void; pub usingnamespace wasm; const Vec2 = liu.Vec2; const Vec3 = liu.Vec3; pub const BBox = struct { pos: Vec2, width: f32, height: f32, const Overlap = struct { result: bool, x: bool, y: bool, }; pub fn overlap(self: @This(), other: @This()) Overlap { const pos1 = self.pos + Vec2{ self.width, self.height }; const other_pos1 = other.pos + Vec2{ other.width, other.height }; const x = self.pos[0] < other_pos1[0] and other.pos[0] < pos1[0]; const y = self.pos[1] < other_pos1[1] and other.pos[1] < pos1[1]; return .{ .result = x and y, .y = y, .x = x, }; } }; const ext = struct { extern fn fillStyle(r: f32, g: f32, b: f32) void; extern fn fillRect(x: i32, y: i32, width: i32, height: i32) void; extern fn setFont(font: wasm.Obj) void; extern fn fillText(text: wasm.Obj, x: i32, y: i32) void; }; const Camera = struct { pos: Vec2 = Vec2{ 0, 0 }, height: f32 = 10, width: f32 = 10, world_to_pixel: f32 = 1, const Self = @This(); pub fn init() Self { return .{}; } pub fn setDims(self: *Self, pix_width: u32, pix_height: u32) void { self.world_to_pixel = @intToFloat(f32, pix_height) / self.height; self.width = @intToFloat(f32, pix_width) / self.world_to_pixel; } pub fn screenSpaceCoordinates(self: *const Self, pos: Vec2) Vec2 { const pos_camera = pos - self.pos; const pos_canvas = Vec2{ pos_camera[0] * self.world_to_pixel, (self.height - pos_camera[1]) * self.world_to_pixel, }; return pos_canvas; } pub fn getScreenBoundingBox(self: *const Self, bbox: BBox) BBox { const coords = self.screenSpaceCoordinates(bbox.pos); const screen_height = bbox.height * self.world_to_pixel; return BBox{ .pos = Vec2{ coords[0], coords[1] - screen_height }, .width = bbox.width * self.world_to_pixel, .height = screen_height, }; } }; const norm_color: Vec3 = Vec3{ 0.6, 0.5, 0.4 }; const RenderC = struct { color: Vec3, sprite_width: f32, sprite_height: f32, }; const PositionC = struct { pos: Vec2, }; const CollisionC = struct { width: f32, height: f32, }; const MoveC = struct { velocity: Vec2, }; const ForceC = struct { accel: Vec2, friction: f32, is_airborne: bool = false, }; const DecisionC = union(enum) { player: void, }; export fn setDims(posX: u32, posY: u32) void { camera.setDims(posX, posY); } export fn init() void { wasm.initIfNecessary(); initErr() catch @panic("meh"); wasm.post(.info, "WASM initialized!", .{}); } const Registry = liu.ecs.Registry(&.{ PositionC, MoveC, RenderC, DecisionC, CollisionC, ForceC, }); fn initErr() !void { large_font = wasm.make.fmt(.manual, "bold 48px sans-serif", .{}); small_font = wasm.make.fmt(.manual, "10px sans-serif", .{}); registry = try Registry.init(16, liu.Pages); var i: u32 = 0; while (i < 3) : (i += 1) { const box = try registry.create("box"); try registry.addComponent(box, PositionC{ .pos = Vec2{ @intToFloat(f32, i) + 5, 3 }, }); try registry.addComponent(box, RenderC{ .color = norm_color, .sprite_width = 0.5, .sprite_height = 3, }); try registry.addComponent(box, CollisionC{ .width = 0.5, .height = 3, }); try registry.addComponent(box, MoveC{ .velocity = Vec2{ 0, 0 }, }); try registry.addComponent(box, DecisionC{ .player = {} }); try registry.addComponent(box, ForceC{ .accel = Vec2{ 0, -14 }, .friction = 0.05, }); } const bump = try registry.create("bump"); try registry.addComponent(bump, PositionC{ .pos = Vec2{ 10, 1 }, }); try registry.addComponent(bump, CollisionC{ .width = 1, .height = 1, }); try registry.addComponent(bump, RenderC{ .color = Vec3{ 0.1, 0.5, 0.3 }, .sprite_width = 1, .sprite_height = 1, }); const ground = try registry.create("ground"); try registry.addComponent(ground, PositionC{ .pos = Vec2{ 0, 0 }, }); try registry.addComponent(ground, CollisionC{ .width = 100, .height = 1, }); try registry.addComponent(ground, RenderC{ .color = Vec3{ 0.2, 0.5, 0.3 }, .sprite_width = 100, .sprite_height = 1, }); } var frame_id: u64 = 0; var start_time: f64 = undefined; var previous_time: f64 = undefined; var large_font: wasm.Obj = undefined; var small_font: wasm.Obj = undefined; pub var registry: Registry = undefined; pub var camera: Camera = .{}; export fn setInitialTime(timestamp: f64) void { start_time = timestamp; previous_time = timestamp; } export fn run(timestamp: f64) void { defer input.frameCleanup(); defer frame_id += 1; defer previous_time = timestamp; if (timestamp - start_time < 300) { return; } const delta = @floatCast(f32, timestamp - previous_time); const mark = liu.TempMark; defer liu.TempMark = mark; const wasm_mark = wasm.watermark(); defer wasm.setWatermark(wasm_mark); // Input { var view = registry.view(struct { move_c: *MoveC, decide_c: DecisionC, }); while (view.next()) |elem| { const move_c = elem.move_c; const decide_c = elem.decide_c; if (decide_c != .player) continue; if (keys[10].pressed) { move_c.velocity[0] -= 8; } if (keys[11].pressed) { move_c.velocity[1] -= 8; } if (keys[12].pressed) { move_c.velocity[0] += 8; } if (keys[1].pressed) { move_c.velocity[1] += 8; } } } // Gameplay // Collisions { var view = registry.view(struct { pos_c: *PositionC, collision_c: CollisionC, move_c: *MoveC, force_c: *ForceC, }); const StableObject = struct { pos_c: PositionC, collision_c: CollisionC, force_c: ?*ForceC, move_c: ?*MoveC, }; var stable = registry.view(StableObject); while (view.next()) |elem| { const pos_c = elem.pos_c; const move_c = elem.move_c; const collision_c = elem.collision_c; // move the thing var new_pos = pos_c.pos + move_c.velocity * @splat(2, delta / 1000); const bbox = BBox{ .pos = pos_c.pos, .width = collision_c.width, .height = collision_c.height, }; const new_bbox = BBox{ .pos = new_pos, .width = collision_c.width, .height = collision_c.height, }; elem.force_c.is_airborne = true; stable.reset(); while (stable.next()) |solid| { // No move/force component means it can't even be made to move, so we'll // think of it as a stable piece of the environment if (solid.force_c != null) continue; if (solid.move_c != null) continue; const found = BBox{ .pos = solid.pos_c.pos, .width = solid.collision_c.width, .height = solid.collision_c.height, }; const overlap = new_bbox.overlap(found); if (!overlap.result) continue; const prev_overlap = bbox.overlap(found); if (prev_overlap.x) { if (pos_c.pos[1] < found.pos[1]) { new_pos[1] = found.pos[1] - collision_c.height; } else { new_pos[1] = found.pos[1] + found.height; elem.force_c.is_airborne = false; } move_c.velocity[1] = 0; } if (prev_overlap.y) { if (pos_c.pos[0] < found.pos[0]) { new_pos[0] = found.pos[0] - collision_c.width; } else { new_pos[0] = found.pos[0] + found.width; } move_c.velocity[0] = 0; } } pos_c.pos = new_pos; const cam_pos0 = camera.pos; const cam_dims = Vec2{ camera.width, camera.height }; const cam_pos1 = cam_pos0 + cam_dims; const new_x = std.math.clamp(pos_c.pos[0], cam_pos0[0], cam_pos1[0] - collision_c.width); if (new_x != pos_c.pos[0]) move_c.velocity[0] = 0; pos_c.pos[0] = new_x; const new_y = std.math.clamp(pos_c.pos[1], cam_pos0[1], cam_pos1[1] - collision_c.height); if (new_y != pos_c.pos[1]) move_c.velocity[1] = 0; pos_c.pos[1] = new_y; } } { var view = registry.view(struct { move_c: *MoveC, force_c: ForceC, }); while (view.next()) |elem| { const move = elem.move_c; const force = elem.force_c; // apply gravity move.velocity += force.accel * @splat(2, delta / 1000); // applies a friction force when mario hits the ground. if (!force.is_airborne and move.velocity[0] != 0) { // Friction is applied in the opposite direction of velocity // You cannot gain speed in the opposite direction from friction const friction: f32 = force.friction * delta; if (move.velocity[0] > 0) { move.velocity[0] = std.math.clamp( move.velocity[0] - friction, 0, std.math.inf(f32), ); } else { move.velocity[0] = std.math.clamp( move.velocity[0] + friction, -std.math.inf(f32), 0, ); } } } } // Rendering { var view = registry.view(struct { pos_c: *PositionC, render: RenderC, }); while (view.next()) |elem| { const pos_c = elem.pos_c; const render = elem.render; const color = render.color; ext.fillStyle(color[0], color[1], color[2]); const bbox = camera.getScreenBoundingBox(BBox{ .pos = pos_c.pos, .width = render.sprite_width, .height = render.sprite_height, }); ext.fillRect( @floatToInt(i32, bbox.pos[0]), @floatToInt(i32, bbox.pos[1]), @floatToInt(i32, bbox.width), @floatToInt(i32, bbox.height), ); } } // USER INTERFACE ext.fillStyle(0.5, 0.5, 0.5); ext.setFont(large_font); const fps_message = wasm.out.fmt("FPS: {d:.2}", .{1000 / delta}); ext.fillText(fps_message, 5, 160); ext.setFont(small_font); var begin: u32 = 0; var topY: i32 = 5; for (rows) |row| { var leftX = row.leftX; const end = row.end; for (keys[begin..row.end]) |key| { const color: f32 = if (key.down) 0.3 else 0.5; ext.fillStyle(color, color, color); ext.fillRect(leftX, topY, 30, 30); ext.fillStyle(1, 1, 1); const s = &[_]u8{@truncate(u8, key.code)}; const letter = wasm.out.fmt("{s}", .{s}); ext.fillText(letter, leftX + 15, topY + 10); leftX += 35; } topY += 35; begin = end; } }
src/routes/erlang/erlang.zig
const std = @import("std"); const expect = std.testing.expect; const expectError = std.testing.expectError; const expectEqual = std.testing.expectEqual; test "switch with numbers" { try testSwitchWithNumbers(13); } fn testSwitchWithNumbers(x: u32) !void { const result = switch (x) { 1, 2, 3, 4...8 => false, 13 => true, else => false, }; try expect(result); } test "switch with all ranges" { try expect(testSwitchWithAllRanges(50, 3) == 1); try expect(testSwitchWithAllRanges(101, 0) == 2); try expect(testSwitchWithAllRanges(300, 5) == 3); try expect(testSwitchWithAllRanges(301, 6) == 6); } fn testSwitchWithAllRanges(x: u32, y: u32) u32 { return switch (x) { 0...100 => 1, 101...200 => 2, 201...300 => 3, else => y, }; } test "implicit comptime switch" { const x = 3 + 4; const result = switch (x) { 3 => 10, 4 => 11, 5, 6 => 12, 7, 8 => 13, else => 14, }; comptime { try expect(result + 1 == 14); } } test "switch on enum" { const fruit = Fruit.Orange; nonConstSwitchOnEnum(fruit); } const Fruit = enum { Apple, Orange, Banana, }; fn nonConstSwitchOnEnum(fruit: Fruit) void { switch (fruit) { Fruit.Apple => unreachable, Fruit.Orange => {}, Fruit.Banana => unreachable, } } test "switch statement" { try nonConstSwitch(SwitchStatementFoo.C); } fn nonConstSwitch(foo: SwitchStatementFoo) !void { const val = switch (foo) { SwitchStatementFoo.A => @as(i32, 1), SwitchStatementFoo.B => 2, SwitchStatementFoo.C => 3, SwitchStatementFoo.D => 4, }; try expect(val == 3); } const SwitchStatementFoo = enum { A, B, C, D }; test "switch with multiple expressions" { const x = switch (returnsFive()) { 1, 2, 3 => 1, 4, 5, 6 => 2, else => @as(i32, 3), }; try expect(x == 2); } fn returnsFive() i32 { return 5; } const Number = union(enum) { One: u64, Two: u8, Three: f32, }; const number = Number{ .Three = 1.23 }; fn returnsFalse() bool { switch (number) { Number.One => |x| return x > 1234, Number.Two => |x| return x == 'a', Number.Three => |x| return x > 12.34, } } test "switch on const enum with var" { try expect(!returnsFalse()); } test "switch on type" { try expect(trueIfBoolFalseOtherwise(bool)); try expect(!trueIfBoolFalseOtherwise(i32)); } fn trueIfBoolFalseOtherwise(comptime T: type) bool { return switch (T) { bool => true, else => false, }; } test "switching on booleans" { try testSwitchOnBools(); comptime try testSwitchOnBools(); } fn testSwitchOnBools() !void { try expect(testSwitchOnBoolsTrueAndFalse(true) == false); try expect(testSwitchOnBoolsTrueAndFalse(false) == true); try expect(testSwitchOnBoolsTrueWithElse(true) == false); try expect(testSwitchOnBoolsTrueWithElse(false) == true); try expect(testSwitchOnBoolsFalseWithElse(true) == false); try expect(testSwitchOnBoolsFalseWithElse(false) == true); } fn testSwitchOnBoolsTrueAndFalse(x: bool) bool { return switch (x) { true => false, false => true, }; } fn testSwitchOnBoolsTrueWithElse(x: bool) bool { return switch (x) { true => false, else => true, }; } fn testSwitchOnBoolsFalseWithElse(x: bool) bool { return switch (x) { false => true, else => false, }; } test "u0" { var val: u0 = 0; switch (val) { 0 => try expect(val == 0), } } test "undefined.u0" { var val: u0 = undefined; switch (val) { 0 => try expect(val == 0), } } test "switch with disjoint range" { var q: u8 = 0; switch (q) { 0...125 => {}, 127...255 => {}, 126...126 => {}, } } test "switch variable for range and multiple prongs" { const S = struct { fn doTheTest() !void { var u: u8 = 16; try doTheSwitch(u); comptime try doTheSwitch(u); var v: u8 = 42; try doTheSwitch(v); comptime try doTheSwitch(v); } fn doTheSwitch(q: u8) !void { switch (q) { 0...40 => |x| try expect(x == 16), 41, 42, 43 => |x| try expect(x == 42), else => try expect(false), } } }; _ = S; } var state: u32 = 0; fn poll() void { switch (state) { 0 => { state = 1; }, else => { state += 1; }, } } test "switch on global mutable var isn't constant-folded" { while (state < 2) { poll(); } }
test/behavior/switch.zig
const std = @import("std"); const ArenaAllocator = std.heap.ArenaAllocator; const c = @import("../c.zig"); const zupnp = @import("../lib.zig"); const logger = std.log.scoped(.@"zupnp.web.request"); pub const Endpoint = struct { pub const Callbacks = union (enum) { WithInstance: struct { instance: *anyopaque, deinitFn: ?fn(*anyopaque) void, getFn: ?fn(*anyopaque, *const zupnp.web.ServerGetRequest) zupnp.web.ServerResponse, postFn: ?fn(*anyopaque, *const zupnp.web.ServerPostRequest) bool, }, WithoutInstance: struct { deinitFn: ?fn() void, getFn: ?fn(*const zupnp.web.ServerGetRequest) zupnp.web.ServerResponse, postFn: ?fn(*const zupnp.web.ServerPostRequest) bool, }, }; allocator: std.mem.Allocator, callbacks: Callbacks, pub fn fromCookie(cookie: ?*const anyopaque) *Endpoint { return c.mutate(*Endpoint, cookie); } }; pub const RequestCookie = struct { arena: ArenaAllocator, request: union (enum) { Get: GetRequest, Chunked: ChunkedRequest, }, pub fn create(allocator: std.mem.Allocator) !*RequestCookie { var req = try allocator.create(RequestCookie); req.* = .{ .arena = ArenaAllocator.init(allocator), .request = undefined, }; return req; } pub fn fromVoidPointer(ptr: ?*const anyopaque) *RequestCookie { return c.mutate(*RequestCookie, ptr); } pub fn deinit(self: *RequestCookie) void { self.arena.deinit(); self.arena.child_allocator.destroy(self); } pub fn toRequest(self: *RequestCookie) !*Request { var req = try self.arena.allocator().create(Request); req.* = switch (self.request) { .Get => |*get| .{ .Get = get }, .Chunked => |*chunked| .{ .Chunked = chunked }, }; return req; } }; pub const Request = union (enum) { Get: *GetRequest, Post: PostRequest, Chunked: *ChunkedRequest, pub fn fromFileHandle(hnd: c.UpnpWebFileHandle) *Request { return c.mutate(*Request, hnd); } pub fn toFileHandle(self: *Request) c.UpnpWebFileHandle { return @ptrCast(c.UpnpWebFileHandle, self); } }; pub const GetRequest = struct { contents: []const u8, seek_pos: usize, pub fn init(contents: []const u8) GetRequest { return .{ .contents = contents, .seek_pos = 0, }; } pub fn deinit(_: *GetRequest) void { // Do nothing. } pub fn read(self: *GetRequest, buf: [*c]u8, buflen: usize) callconv(.C) c_int { const bytes_written = std.math.max(buflen, self.contents.len - self.seek_pos); std.mem.copy(u8, buf[0..buflen], self.contents[self.seek_pos..self.seek_pos + bytes_written]); return @intCast(c_int, bytes_written); } pub fn seek(self: *GetRequest, offset: c.off_t, origin: c_int) callconv(.C) c_int { self.seek_pos = @intCast(usize, offset + switch (origin) { c.SEEK_CUR => @intCast(c_long, self.seek_pos), c.SEEK_END => @intCast(c_long, self.contents.len), c.SEEK_SET => 0, else => { logger.err("Unexpected GET seek origin type {d}", .{origin}); return -1; } }); return 0; } pub fn write(_: *GetRequest, _: [*c]u8, _: usize) callconv(.C) c_int { logger.err("Called write() on GET request", .{}); return -1; } pub fn close(_: *GetRequest) callconv(.C) c_int { return 0; } }; pub const PostRequest = struct { endpoint: *Endpoint, filename: [:0]const u8, contents: std.ArrayList(u8), seek_pos: usize, pub fn createRequest(endpoint: *Endpoint, filename: [*c]const u8) !*Request { var req = try endpoint.allocator.create(Request); req.* = .{ .Post = .{ .endpoint = endpoint, .filename = std.mem.sliceTo(filename, 0), .contents = std.ArrayList(u8).init(endpoint.allocator), .seek_pos = 0, } }; return req; } pub fn deinit(self: *PostRequest) void { self.contents.deinit(); } pub fn read(_: *PostRequest, _: [*c]u8, _: usize) callconv(.C) c_int { logger.err("Called read() on POST request", .{}); return -1; } pub fn seek(_: *PostRequest, _: c.off_t, _: c_int) callconv(.C) c_int { logger.err("Called seek() on POST request", .{}); return -1; } pub fn write(self: *PostRequest, buf: [*c]u8, buflen: usize) callconv(.C) c_int { self.contents.appendSlice(buf[0..buflen]) catch |err| { logger.err("Failed to write POST request to buffer: {s}", .{err}); return -1; }; return @intCast(c_int, buflen); } pub fn close(self: *PostRequest) callconv(.C) c_int { var arena = ArenaAllocator.init(self.endpoint.allocator); defer arena.deinit(); const server_request = zupnp.web.ServerPostRequest { .allocator = arena.allocator(), .filename = self.filename, .contents = self.contents.items, }; _ = switch (self.endpoint.callbacks) { .WithInstance => |cb| (cb.postFn.?)(cb.instance, &server_request), .WithoutInstance => |cb| (cb.postFn.?)(&server_request), }; return 0; } }; pub const ChunkedRequest = struct { handler: zupnp.web.ServerResponse.ChunkedInternal.Handler, seek_pos: usize, pub fn init(handler: zupnp.web.ServerResponse.ChunkedInternal.Handler) ChunkedRequest { return .{ .handler = handler, .seek_pos = 0, }; } pub fn deinit(_: *ChunkedRequest) void { // Do nothing. } pub fn read(self: *ChunkedRequest, buf: [*c]u8, buflen: usize) callconv(.C) c_int { return @intCast(c_int, self.handler.getChunkFn(self.handler.instance, buf[0..buflen], self.seek_pos)); } pub fn seek(self: *ChunkedRequest, offset: c.off_t, origin: c_int) callconv(.C) c_int { self.seek_pos = @intCast(usize, offset + switch (origin) { c.SEEK_CUR => @intCast(c_long, self.seek_pos), c.SEEK_SET => 0, c.SEEK_END => { logger.err("Unexpected SEEK_END for chunked request", .{}); return -1; }, else => { logger.err("Unexpected chunked seek origin type {d}", .{origin}); return -1; } }); return 0; } pub fn write(_: *ChunkedRequest, _: [*c]u8, _: usize) callconv(.C) c_int { logger.err("Called write() on chunked request", .{}); return -1; } pub fn close(_: *ChunkedRequest) callconv(.C) c_int { return 0; } };
src/web/request.zig
const std = @import("std"); const testing = std.testing; const proverb = @import("proverb.zig"); test "zero pieces" { const array_long = [_][]const u8 {}; const input_slice = &array_long; const expected = input_slice; const actual = try proverb.recite(testing.allocator, input_slice); testing.expectEqualSlices([]const u8, expected, actual); // The free here doesn't actually free memory since a zero sized heap // allocation doesn't actually point to anything important. So the free // method on the allocator just quickly exits if what it points to has // has a byte length of zero. testing.allocator.free(actual); } test "one piece" { const first_input = "nail".*; const first_slice = &first_input; const input_array = [_][]const u8 { first_slice }; const input_slice = &input_array; const first_expected = "And all for the want of a nail.\n".*; const first_expected_slice = &first_expected; const expected_array = [_][]const u8 { first_expected_slice }; const expected = &expected_array; const actual = try proverb.recite(testing.allocator, input_slice); for (expected) |expected_slice, i| { testing.expectEqualSlices(u8, expected_slice, actual[i]); } for (actual) |inner_slice| { testing.allocator.free(inner_slice); } testing.allocator.free(actual); } test "two pieces" { const first_input = "nail".*; const first_slice = &first_input; const second_input = "shoe".*; const second_slice = &second_input; const input_array = [_][]const u8 { first_slice, second_slice }; const input_slice = &input_array; const first_expected = "For want of a nail the shoe was lost.\n".*; const first_expected_slice = &first_expected ; const second_expected = "And all for the want of a nail.\n".*; const second_expected_slice = &second_expected; const expected_array = [_][]const u8 { first_expected_slice, second_expected_slice }; const expected = &expected_array; const actual = try proverb.recite(testing.allocator, input_slice); for (expected) |expected_slice, i| { testing.expectEqualSlices(u8, expected_slice, actual[i]); } for (actual) |inner_slice| { testing.allocator.free(inner_slice); } testing.allocator.free(actual); } test "three pieces" { const first_input = "nail".*; const first_slice = &first_input; const second_input = "shoe".*; const second_slice = &second_input; const third_input = "horse".*; const third_slice = &third_input; const input_array = [_][]const u8 { first_slice, second_slice, third_slice }; const input_slice = &input_array; const first_expected = "For want of a nail the shoe was lost.\n".*; const first_expected_slice = &first_expected; const second_expected = "For want of a shoe the horse was lost.\n".*; const second_expected_slice = &second_expected; const third_expected = "And all for the want of a nail.\n".*; const third_expected_slice = &third_expected; const expected_array = [_][]const u8 { first_expected_slice, second_expected_slice, third_expected_slice }; const expected = &expected_array; const actual = try proverb.recite(testing.allocator, input_slice); for (expected) |expected_slice, i| { testing.expectEqualSlices(u8, expected_slice, actual[i]); } for (actual) |inner_slice| { testing.allocator.free(inner_slice); } testing.allocator.free(actual); } test "full proverb" { const first_input = "nail".*; const first_slice = &first_input; const second_input = "shoe".*; const second_slice = &second_input; const third_input = "horse".*; const third_slice = &third_input; const fourth_input = "rider".*; const fourth_slice = &fourth_input; const fifth_input = "message".*; const fifth_slice = &fifth_input; const sixth_input = "battle".*; const sixth_slice = &sixth_input; const seventh_input = "kingdom".*; const seventh_slice = &seventh_input; const input_array = [_][]const u8 { first_slice, second_slice, third_slice, fourth_slice, fifth_slice, sixth_slice, seventh_slice }; const input_slice = &input_array; const first_expected = "For want of a nail the shoe was lost.\n".*; const first_expected_slice = &first_expected; const second_expected = "For want of a shoe the horse was lost.\n".*; const second_expected_slice = &second_expected; const third_expected = "For want of a horse the rider was lost.\n".*; const third_expected_slice = &third_expected; const fourth_expected = "For want of a rider the message was lost.\n".*; const fourth_expected_slice = &fourth_expected; const fifth_expected = "For want of a message the battle was lost.\n".*; const fifth_expected_slice = &fifth_expected; const sixth_expected = "For want of a battle the kingdom was lost.\n".*; const sixth_expected_slice = &sixth_expected; const seventh_expected = "And all for the want of a nail.\n".*; const seventh_expected_slice = &seventh_expected; const expected_array = [_][]const u8 { first_expected_slice, second_expected_slice, third_expected_slice, fourth_expected_slice, fifth_expected_slice, sixth_expected_slice, seventh_expected_slice }; const expected = &expected_array; const actual = try proverb.recite(testing.allocator, input_slice); for (expected) |expected_slice, i| { testing.expectEqualSlices(u8, expected_slice, actual[i]); } for (actual) |inner_slice| { testing.allocator.free(inner_slice); } testing.allocator.free(actual); } test "four pieces modernized" { const first_input = "pin".*; const first_slice = &first_input; const second_input = "gun".*; const second_slice = &second_input; const third_input = "soldier".*; const third_slice = &third_input; const fourth_input = "battle".*; const fourth_slice = &fourth_input; const input_array = [_][]const u8 { first_slice, second_slice, third_slice, fourth_slice }; const input_slice = &input_array; const first_expected = "For want of a pin the gun was lost.\n".*; const first_expected_slice = &first_expected; const second_expected = "For want of a gun the soldier was lost.\n".*; const second_expected_slice = &second_expected; const third_expected = "For want of a soldier the battle was lost.\n".*; const third_expected_slice = &third_expected; const fourth_expected = "And all for the want of a pin.\n".*; const fourth_expected_slice = &fourth_expected; const expected_array = [_][]const u8 { first_expected_slice, second_expected_slice, third_expected_slice, fourth_expected_slice }; const expected = &expected_array; const actual = try proverb.recite(testing.allocator, input_slice); for (expected) |expected_slice, i| { testing.expectEqualSlices(u8, expected_slice, actual[i]); } for (actual) |inner_slice| { testing.allocator.free(inner_slice); } testing.allocator.free(actual); }
exercises/practice/proverb/test_proverb.zig
const std = @import("std"); const mem = std.mem; const IDStart = @This(); allocator: *mem.Allocator, array: []bool, lo: u21 = 65, hi: u21 = 201546, pub fn init(allocator: *mem.Allocator) !IDStart { var instance = IDStart{ .allocator = allocator, .array = try allocator.alloc(bool, 201482), }; mem.set(bool, instance.array, false); var index: u21 = 0; index = 0; while (index <= 25) : (index += 1) { instance.array[index] = true; } index = 32; while (index <= 57) : (index += 1) { instance.array[index] = true; } instance.array[105] = true; instance.array[116] = true; instance.array[121] = true; index = 127; while (index <= 149) : (index += 1) { instance.array[index] = true; } index = 151; while (index <= 181) : (index += 1) { instance.array[index] = true; } index = 183; while (index <= 377) : (index += 1) { instance.array[index] = true; } instance.array[378] = true; index = 379; while (index <= 382) : (index += 1) { instance.array[index] = true; } index = 383; while (index <= 386) : (index += 1) { instance.array[index] = true; } index = 387; while (index <= 594) : (index += 1) { instance.array[index] = true; } instance.array[595] = true; index = 596; while (index <= 622) : (index += 1) { instance.array[index] = true; } index = 623; while (index <= 640) : (index += 1) { instance.array[index] = true; } index = 645; while (index <= 656) : (index += 1) { instance.array[index] = true; } index = 671; while (index <= 675) : (index += 1) { instance.array[index] = true; } instance.array[683] = true; instance.array[685] = true; index = 815; while (index <= 818) : (index += 1) { instance.array[index] = true; } instance.array[819] = true; index = 821; while (index <= 822) : (index += 1) { instance.array[index] = true; } instance.array[825] = true; index = 826; while (index <= 828) : (index += 1) { instance.array[index] = true; } instance.array[830] = true; instance.array[837] = true; index = 839; while (index <= 841) : (index += 1) { instance.array[index] = true; } instance.array[843] = true; index = 845; while (index <= 864) : (index += 1) { instance.array[index] = true; } index = 866; while (index <= 948) : (index += 1) { instance.array[index] = true; } index = 950; while (index <= 1088) : (index += 1) { instance.array[index] = true; } index = 1097; while (index <= 1262) : (index += 1) { instance.array[index] = true; } index = 1264; while (index <= 1301) : (index += 1) { instance.array[index] = true; } instance.array[1304] = true; index = 1311; while (index <= 1351) : (index += 1) { instance.array[index] = true; } index = 1423; while (index <= 1449) : (index += 1) { instance.array[index] = true; } index = 1454; while (index <= 1457) : (index += 1) { instance.array[index] = true; } index = 1503; while (index <= 1534) : (index += 1) { instance.array[index] = true; } instance.array[1535] = true; index = 1536; while (index <= 1545) : (index += 1) { instance.array[index] = true; } index = 1581; while (index <= 1582) : (index += 1) { instance.array[index] = true; } index = 1584; while (index <= 1682) : (index += 1) { instance.array[index] = true; } instance.array[1684] = true; index = 1700; while (index <= 1701) : (index += 1) { instance.array[index] = true; } index = 1709; while (index <= 1710) : (index += 1) { instance.array[index] = true; } index = 1721; while (index <= 1723) : (index += 1) { instance.array[index] = true; } instance.array[1726] = true; instance.array[1743] = true; index = 1745; while (index <= 1774) : (index += 1) { instance.array[index] = true; } index = 1804; while (index <= 1892) : (index += 1) { instance.array[index] = true; } instance.array[1904] = true; index = 1929; while (index <= 1961) : (index += 1) { instance.array[index] = true; } index = 1971; while (index <= 1972) : (index += 1) { instance.array[index] = true; } instance.array[1977] = true; index = 1983; while (index <= 2004) : (index += 1) { instance.array[index] = true; } instance.array[2009] = true; instance.array[2019] = true; instance.array[2023] = true; index = 2047; while (index <= 2071) : (index += 1) { instance.array[index] = true; } index = 2079; while (index <= 2089) : (index += 1) { instance.array[index] = true; } index = 2143; while (index <= 2163) : (index += 1) { instance.array[index] = true; } index = 2165; while (index <= 2182) : (index += 1) { instance.array[index] = true; } index = 2243; while (index <= 2296) : (index += 1) { instance.array[index] = true; } instance.array[2300] = true; instance.array[2319] = true; index = 2327; while (index <= 2336) : (index += 1) { instance.array[index] = true; } instance.array[2352] = true; index = 2353; while (index <= 2367) : (index += 1) { instance.array[index] = true; } index = 2372; while (index <= 2379) : (index += 1) { instance.array[index] = true; } index = 2382; while (index <= 2383) : (index += 1) { instance.array[index] = true; } index = 2386; while (index <= 2407) : (index += 1) { instance.array[index] = true; } index = 2409; while (index <= 2415) : (index += 1) { instance.array[index] = true; } instance.array[2417] = true; index = 2421; while (index <= 2424) : (index += 1) { instance.array[index] = true; } instance.array[2428] = true; instance.array[2445] = true; index = 2459; while (index <= 2460) : (index += 1) { instance.array[index] = true; } index = 2462; while (index <= 2464) : (index += 1) { instance.array[index] = true; } index = 2479; while (index <= 2480) : (index += 1) { instance.array[index] = true; } instance.array[2491] = true; index = 2500; while (index <= 2505) : (index += 1) { instance.array[index] = true; } index = 2510; while (index <= 2511) : (index += 1) { instance.array[index] = true; } index = 2514; while (index <= 2535) : (index += 1) { instance.array[index] = true; } index = 2537; while (index <= 2543) : (index += 1) { instance.array[index] = true; } index = 2545; while (index <= 2546) : (index += 1) { instance.array[index] = true; } index = 2548; while (index <= 2549) : (index += 1) { instance.array[index] = true; } index = 2551; while (index <= 2552) : (index += 1) { instance.array[index] = true; } index = 2584; while (index <= 2587) : (index += 1) { instance.array[index] = true; } instance.array[2589] = true; index = 2609; while (index <= 2611) : (index += 1) { instance.array[index] = true; } index = 2628; while (index <= 2636) : (index += 1) { instance.array[index] = true; } index = 2638; while (index <= 2640) : (index += 1) { instance.array[index] = true; } index = 2642; while (index <= 2663) : (index += 1) { instance.array[index] = true; } index = 2665; while (index <= 2671) : (index += 1) { instance.array[index] = true; } index = 2673; while (index <= 2674) : (index += 1) { instance.array[index] = true; } index = 2676; while (index <= 2680) : (index += 1) { instance.array[index] = true; } instance.array[2684] = true; instance.array[2703] = true; index = 2719; while (index <= 2720) : (index += 1) { instance.array[index] = true; } instance.array[2744] = true; index = 2756; while (index <= 2763) : (index += 1) { instance.array[index] = true; } index = 2766; while (index <= 2767) : (index += 1) { instance.array[index] = true; } index = 2770; while (index <= 2791) : (index += 1) { instance.array[index] = true; } index = 2793; while (index <= 2799) : (index += 1) { instance.array[index] = true; } index = 2801; while (index <= 2802) : (index += 1) { instance.array[index] = true; } index = 2804; while (index <= 2808) : (index += 1) { instance.array[index] = true; } instance.array[2812] = true; index = 2843; while (index <= 2844) : (index += 1) { instance.array[index] = true; } index = 2846; while (index <= 2848) : (index += 1) { instance.array[index] = true; } instance.array[2864] = true; instance.array[2882] = true; index = 2884; while (index <= 2889) : (index += 1) { instance.array[index] = true; } index = 2893; while (index <= 2895) : (index += 1) { instance.array[index] = true; } index = 2897; while (index <= 2900) : (index += 1) { instance.array[index] = true; } index = 2904; while (index <= 2905) : (index += 1) { instance.array[index] = true; } instance.array[2907] = true; index = 2909; while (index <= 2910) : (index += 1) { instance.array[index] = true; } index = 2914; while (index <= 2915) : (index += 1) { instance.array[index] = true; } index = 2919; while (index <= 2921) : (index += 1) { instance.array[index] = true; } index = 2925; while (index <= 2936) : (index += 1) { instance.array[index] = true; } instance.array[2959] = true; index = 3012; while (index <= 3019) : (index += 1) { instance.array[index] = true; } index = 3021; while (index <= 3023) : (index += 1) { instance.array[index] = true; } index = 3025; while (index <= 3047) : (index += 1) { instance.array[index] = true; } index = 3049; while (index <= 3064) : (index += 1) { instance.array[index] = true; } instance.array[3068] = true; index = 3095; while (index <= 3097) : (index += 1) { instance.array[index] = true; } index = 3103; while (index <= 3104) : (index += 1) { instance.array[index] = true; } instance.array[3135] = true; index = 3140; while (index <= 3147) : (index += 1) { instance.array[index] = true; } index = 3149; while (index <= 3151) : (index += 1) { instance.array[index] = true; } index = 3153; while (index <= 3175) : (index += 1) { instance.array[index] = true; } index = 3177; while (index <= 3186) : (index += 1) { instance.array[index] = true; } index = 3188; while (index <= 3192) : (index += 1) { instance.array[index] = true; } instance.array[3196] = true; instance.array[3229] = true; index = 3231; while (index <= 3232) : (index += 1) { instance.array[index] = true; } index = 3248; while (index <= 3249) : (index += 1) { instance.array[index] = true; } index = 3267; while (index <= 3275) : (index += 1) { instance.array[index] = true; } index = 3277; while (index <= 3279) : (index += 1) { instance.array[index] = true; } index = 3281; while (index <= 3321) : (index += 1) { instance.array[index] = true; } instance.array[3324] = true; instance.array[3341] = true; index = 3347; while (index <= 3349) : (index += 1) { instance.array[index] = true; } index = 3358; while (index <= 3360) : (index += 1) { instance.array[index] = true; } index = 3385; while (index <= 3390) : (index += 1) { instance.array[index] = true; } index = 3396; while (index <= 3413) : (index += 1) { instance.array[index] = true; } index = 3417; while (index <= 3440) : (index += 1) { instance.array[index] = true; } index = 3442; while (index <= 3450) : (index += 1) { instance.array[index] = true; } instance.array[3452] = true; index = 3455; while (index <= 3461) : (index += 1) { instance.array[index] = true; } index = 3520; while (index <= 3567) : (index += 1) { instance.array[index] = true; } index = 3569; while (index <= 3570) : (index += 1) { instance.array[index] = true; } index = 3583; while (index <= 3588) : (index += 1) { instance.array[index] = true; } instance.array[3589] = true; index = 3648; while (index <= 3649) : (index += 1) { instance.array[index] = true; } instance.array[3651] = true; index = 3653; while (index <= 3657) : (index += 1) { instance.array[index] = true; } index = 3659; while (index <= 3682) : (index += 1) { instance.array[index] = true; } instance.array[3684] = true; index = 3686; while (index <= 3695) : (index += 1) { instance.array[index] = true; } index = 3697; while (index <= 3698) : (index += 1) { instance.array[index] = true; } instance.array[3708] = true; index = 3711; while (index <= 3715) : (index += 1) { instance.array[index] = true; } instance.array[3717] = true; index = 3739; while (index <= 3742) : (index += 1) { instance.array[index] = true; } instance.array[3775] = true; index = 3839; while (index <= 3846) : (index += 1) { instance.array[index] = true; } index = 3848; while (index <= 3883) : (index += 1) { instance.array[index] = true; } index = 3911; while (index <= 3915) : (index += 1) { instance.array[index] = true; } index = 4031; while (index <= 4073) : (index += 1) { instance.array[index] = true; } instance.array[4094] = true; index = 4111; while (index <= 4116) : (index += 1) { instance.array[index] = true; } index = 4121; while (index <= 4124) : (index += 1) { instance.array[index] = true; } instance.array[4128] = true; index = 4132; while (index <= 4133) : (index += 1) { instance.array[index] = true; } index = 4141; while (index <= 4143) : (index += 1) { instance.array[index] = true; } index = 4148; while (index <= 4160) : (index += 1) { instance.array[index] = true; } instance.array[4173] = true; index = 4191; while (index <= 4228) : (index += 1) { instance.array[index] = true; } instance.array[4230] = true; instance.array[4236] = true; index = 4239; while (index <= 4281) : (index += 1) { instance.array[index] = true; } instance.array[4283] = true; index = 4284; while (index <= 4286) : (index += 1) { instance.array[index] = true; } index = 4287; while (index <= 4615) : (index += 1) { instance.array[index] = true; } index = 4617; while (index <= 4620) : (index += 1) { instance.array[index] = true; } index = 4623; while (index <= 4629) : (index += 1) { instance.array[index] = true; } instance.array[4631] = true; index = 4633; while (index <= 4636) : (index += 1) { instance.array[index] = true; } index = 4639; while (index <= 4679) : (index += 1) { instance.array[index] = true; } index = 4681; while (index <= 4684) : (index += 1) { instance.array[index] = true; } index = 4687; while (index <= 4719) : (index += 1) { instance.array[index] = true; } index = 4721; while (index <= 4724) : (index += 1) { instance.array[index] = true; } index = 4727; while (index <= 4733) : (index += 1) { instance.array[index] = true; } instance.array[4735] = true; index = 4737; while (index <= 4740) : (index += 1) { instance.array[index] = true; } index = 4743; while (index <= 4757) : (index += 1) { instance.array[index] = true; } index = 4759; while (index <= 4815) : (index += 1) { instance.array[index] = true; } index = 4817; while (index <= 4820) : (index += 1) { instance.array[index] = true; } index = 4823; while (index <= 4889) : (index += 1) { instance.array[index] = true; } index = 4927; while (index <= 4942) : (index += 1) { instance.array[index] = true; } index = 4959; while (index <= 5044) : (index += 1) { instance.array[index] = true; } index = 5047; while (index <= 5052) : (index += 1) { instance.array[index] = true; } index = 5056; while (index <= 5675) : (index += 1) { instance.array[index] = true; } index = 5678; while (index <= 5694) : (index += 1) { instance.array[index] = true; } index = 5696; while (index <= 5721) : (index += 1) { instance.array[index] = true; } index = 5727; while (index <= 5801) : (index += 1) { instance.array[index] = true; } index = 5805; while (index <= 5807) : (index += 1) { instance.array[index] = true; } index = 5808; while (index <= 5815) : (index += 1) { instance.array[index] = true; } index = 5823; while (index <= 5835) : (index += 1) { instance.array[index] = true; } index = 5837; while (index <= 5840) : (index += 1) { instance.array[index] = true; } index = 5855; while (index <= 5872) : (index += 1) { instance.array[index] = true; } index = 5887; while (index <= 5904) : (index += 1) { instance.array[index] = true; } index = 5919; while (index <= 5931) : (index += 1) { instance.array[index] = true; } index = 5933; while (index <= 5935) : (index += 1) { instance.array[index] = true; } index = 5951; while (index <= 6002) : (index += 1) { instance.array[index] = true; } instance.array[6038] = true; instance.array[6043] = true; index = 6111; while (index <= 6145) : (index += 1) { instance.array[index] = true; } instance.array[6146] = true; index = 6147; while (index <= 6199) : (index += 1) { instance.array[index] = true; } index = 6207; while (index <= 6211) : (index += 1) { instance.array[index] = true; } index = 6212; while (index <= 6213) : (index += 1) { instance.array[index] = true; } index = 6214; while (index <= 6247) : (index += 1) { instance.array[index] = true; } instance.array[6249] = true; index = 6255; while (index <= 6324) : (index += 1) { instance.array[index] = true; } index = 6335; while (index <= 6365) : (index += 1) { instance.array[index] = true; } index = 6415; while (index <= 6444) : (index += 1) { instance.array[index] = true; } index = 6447; while (index <= 6451) : (index += 1) { instance.array[index] = true; } index = 6463; while (index <= 6506) : (index += 1) { instance.array[index] = true; } index = 6511; while (index <= 6536) : (index += 1) { instance.array[index] = true; } index = 6591; while (index <= 6613) : (index += 1) { instance.array[index] = true; } index = 6623; while (index <= 6675) : (index += 1) { instance.array[index] = true; } instance.array[6758] = true; index = 6852; while (index <= 6898) : (index += 1) { instance.array[index] = true; } index = 6916; while (index <= 6922) : (index += 1) { instance.array[index] = true; } index = 6978; while (index <= 7007) : (index += 1) { instance.array[index] = true; } index = 7021; while (index <= 7022) : (index += 1) { instance.array[index] = true; } index = 7033; while (index <= 7076) : (index += 1) { instance.array[index] = true; } index = 7103; while (index <= 7138) : (index += 1) { instance.array[index] = true; } index = 7180; while (index <= 7182) : (index += 1) { instance.array[index] = true; } index = 7193; while (index <= 7222) : (index += 1) { instance.array[index] = true; } index = 7223; while (index <= 7228) : (index += 1) { instance.array[index] = true; } index = 7231; while (index <= 7239) : (index += 1) { instance.array[index] = true; } index = 7247; while (index <= 7289) : (index += 1) { instance.array[index] = true; } index = 7292; while (index <= 7294) : (index += 1) { instance.array[index] = true; } index = 7336; while (index <= 7339) : (index += 1) { instance.array[index] = true; } index = 7341; while (index <= 7346) : (index += 1) { instance.array[index] = true; } index = 7348; while (index <= 7349) : (index += 1) { instance.array[index] = true; } instance.array[7353] = true; index = 7359; while (index <= 7402) : (index += 1) { instance.array[index] = true; } index = 7403; while (index <= 7465) : (index += 1) { instance.array[index] = true; } index = 7466; while (index <= 7478) : (index += 1) { instance.array[index] = true; } instance.array[7479] = true; index = 7480; while (index <= 7513) : (index += 1) { instance.array[index] = true; } index = 7514; while (index <= 7550) : (index += 1) { instance.array[index] = true; } index = 7615; while (index <= 7892) : (index += 1) { instance.array[index] = true; } index = 7895; while (index <= 7900) : (index += 1) { instance.array[index] = true; } index = 7903; while (index <= 7940) : (index += 1) { instance.array[index] = true; } index = 7943; while (index <= 7948) : (index += 1) { instance.array[index] = true; } index = 7951; while (index <= 7958) : (index += 1) { instance.array[index] = true; } instance.array[7960] = true; instance.array[7962] = true; instance.array[7964] = true; index = 7966; while (index <= 7996) : (index += 1) { instance.array[index] = true; } index = 7999; while (index <= 8051) : (index += 1) { instance.array[index] = true; } index = 8053; while (index <= 8059) : (index += 1) { instance.array[index] = true; } instance.array[8061] = true; index = 8065; while (index <= 8067) : (index += 1) { instance.array[index] = true; } index = 8069; while (index <= 8075) : (index += 1) { instance.array[index] = true; } index = 8079; while (index <= 8082) : (index += 1) { instance.array[index] = true; } index = 8085; while (index <= 8090) : (index += 1) { instance.array[index] = true; } index = 8095; while (index <= 8107) : (index += 1) { instance.array[index] = true; } index = 8113; while (index <= 8115) : (index += 1) { instance.array[index] = true; } index = 8117; while (index <= 8123) : (index += 1) { instance.array[index] = true; } instance.array[8240] = true; instance.array[8254] = true; index = 8271; while (index <= 8283) : (index += 1) { instance.array[index] = true; } instance.array[8385] = true; instance.array[8390] = true; index = 8393; while (index <= 8402) : (index += 1) { instance.array[index] = true; } instance.array[8404] = true; instance.array[8407] = true; index = 8408; while (index <= 8412) : (index += 1) { instance.array[index] = true; } instance.array[8419] = true; instance.array[8421] = true; instance.array[8423] = true; index = 8425; while (index <= 8428) : (index += 1) { instance.array[index] = true; } instance.array[8429] = true; index = 8430; while (index <= 8435) : (index += 1) { instance.array[index] = true; } index = 8436; while (index <= 8439) : (index += 1) { instance.array[index] = true; } instance.array[8440] = true; index = 8443; while (index <= 8446) : (index += 1) { instance.array[index] = true; } index = 8452; while (index <= 8456) : (index += 1) { instance.array[index] = true; } instance.array[8461] = true; index = 8479; while (index <= 8513) : (index += 1) { instance.array[index] = true; } index = 8514; while (index <= 8515) : (index += 1) { instance.array[index] = true; } index = 8516; while (index <= 8519) : (index += 1) { instance.array[index] = true; } index = 11199; while (index <= 11245) : (index += 1) { instance.array[index] = true; } index = 11247; while (index <= 11293) : (index += 1) { instance.array[index] = true; } index = 11295; while (index <= 11322) : (index += 1) { instance.array[index] = true; } index = 11323; while (index <= 11324) : (index += 1) { instance.array[index] = true; } index = 11325; while (index <= 11427) : (index += 1) { instance.array[index] = true; } index = 11434; while (index <= 11437) : (index += 1) { instance.array[index] = true; } index = 11441; while (index <= 11442) : (index += 1) { instance.array[index] = true; } index = 11455; while (index <= 11492) : (index += 1) { instance.array[index] = true; } instance.array[11494] = true; instance.array[11500] = true; index = 11503; while (index <= 11558) : (index += 1) { instance.array[index] = true; } instance.array[11566] = true; index = 11583; while (index <= 11605) : (index += 1) { instance.array[index] = true; } index = 11615; while (index <= 11621) : (index += 1) { instance.array[index] = true; } index = 11623; while (index <= 11629) : (index += 1) { instance.array[index] = true; } index = 11631; while (index <= 11637) : (index += 1) { instance.array[index] = true; } index = 11639; while (index <= 11645) : (index += 1) { instance.array[index] = true; } index = 11647; while (index <= 11653) : (index += 1) { instance.array[index] = true; } index = 11655; while (index <= 11661) : (index += 1) { instance.array[index] = true; } index = 11663; while (index <= 11669) : (index += 1) { instance.array[index] = true; } index = 11671; while (index <= 11677) : (index += 1) { instance.array[index] = true; } instance.array[12228] = true; instance.array[12229] = true; instance.array[12230] = true; index = 12256; while (index <= 12264) : (index += 1) { instance.array[index] = true; } index = 12272; while (index <= 12276) : (index += 1) { instance.array[index] = true; } index = 12279; while (index <= 12281) : (index += 1) { instance.array[index] = true; } instance.array[12282] = true; instance.array[12283] = true; index = 12288; while (index <= 12373) : (index += 1) { instance.array[index] = true; } index = 12378; while (index <= 12379) : (index += 1) { instance.array[index] = true; } index = 12380; while (index <= 12381) : (index += 1) { instance.array[index] = true; } instance.array[12382] = true; index = 12384; while (index <= 12473) : (index += 1) { instance.array[index] = true; } index = 12475; while (index <= 12477) : (index += 1) { instance.array[index] = true; } instance.array[12478] = true; index = 12484; while (index <= 12526) : (index += 1) { instance.array[index] = true; } index = 12528; while (index <= 12621) : (index += 1) { instance.array[index] = true; } index = 12639; while (index <= 12670) : (index += 1) { instance.array[index] = true; } index = 12719; while (index <= 12734) : (index += 1) { instance.array[index] = true; } index = 13247; while (index <= 19838) : (index += 1) { instance.array[index] = true; } index = 19903; while (index <= 40891) : (index += 1) { instance.array[index] = true; } index = 40895; while (index <= 40915) : (index += 1) { instance.array[index] = true; } instance.array[40916] = true; index = 40917; while (index <= 42059) : (index += 1) { instance.array[index] = true; } index = 42127; while (index <= 42166) : (index += 1) { instance.array[index] = true; } index = 42167; while (index <= 42172) : (index += 1) { instance.array[index] = true; } index = 42175; while (index <= 42442) : (index += 1) { instance.array[index] = true; } instance.array[42443] = true; index = 42447; while (index <= 42462) : (index += 1) { instance.array[index] = true; } index = 42473; while (index <= 42474) : (index += 1) { instance.array[index] = true; } index = 42495; while (index <= 42540) : (index += 1) { instance.array[index] = true; } instance.array[42541] = true; instance.array[42558] = true; index = 42559; while (index <= 42586) : (index += 1) { instance.array[index] = true; } index = 42587; while (index <= 42588) : (index += 1) { instance.array[index] = true; } index = 42591; while (index <= 42660) : (index += 1) { instance.array[index] = true; } index = 42661; while (index <= 42670) : (index += 1) { instance.array[index] = true; } index = 42710; while (index <= 42718) : (index += 1) { instance.array[index] = true; } index = 42721; while (index <= 42798) : (index += 1) { instance.array[index] = true; } instance.array[42799] = true; index = 42800; while (index <= 42822) : (index += 1) { instance.array[index] = true; } instance.array[42823] = true; index = 42826; while (index <= 42829) : (index += 1) { instance.array[index] = true; } instance.array[42830] = true; index = 42831; while (index <= 42878) : (index += 1) { instance.array[index] = true; } index = 42881; while (index <= 42889) : (index += 1) { instance.array[index] = true; } index = 42932; while (index <= 42933) : (index += 1) { instance.array[index] = true; } instance.array[42934] = true; index = 42935; while (index <= 42936) : (index += 1) { instance.array[index] = true; } instance.array[42937] = true; index = 42938; while (index <= 42944) : (index += 1) { instance.array[index] = true; } index = 42946; while (index <= 42948) : (index += 1) { instance.array[index] = true; } index = 42950; while (index <= 42953) : (index += 1) { instance.array[index] = true; } index = 42955; while (index <= 42977) : (index += 1) { instance.array[index] = true; } index = 43007; while (index <= 43058) : (index += 1) { instance.array[index] = true; } index = 43073; while (index <= 43122) : (index += 1) { instance.array[index] = true; } index = 43185; while (index <= 43190) : (index += 1) { instance.array[index] = true; } instance.array[43194] = true; index = 43196; while (index <= 43197) : (index += 1) { instance.array[index] = true; } index = 43209; while (index <= 43236) : (index += 1) { instance.array[index] = true; } index = 43247; while (index <= 43269) : (index += 1) { instance.array[index] = true; } index = 43295; while (index <= 43323) : (index += 1) { instance.array[index] = true; } index = 43331; while (index <= 43377) : (index += 1) { instance.array[index] = true; } instance.array[43406] = true; index = 43423; while (index <= 43427) : (index += 1) { instance.array[index] = true; } instance.array[43429] = true; index = 43430; while (index <= 43438) : (index += 1) { instance.array[index] = true; } index = 43449; while (index <= 43453) : (index += 1) { instance.array[index] = true; } index = 43455; while (index <= 43495) : (index += 1) { instance.array[index] = true; } index = 43519; while (index <= 43521) : (index += 1) { instance.array[index] = true; } index = 43523; while (index <= 43530) : (index += 1) { instance.array[index] = true; } index = 43551; while (index <= 43566) : (index += 1) { instance.array[index] = true; } instance.array[43567] = true; index = 43568; while (index <= 43573) : (index += 1) { instance.array[index] = true; } instance.array[43577] = true; index = 43581; while (index <= 43630) : (index += 1) { instance.array[index] = true; } instance.array[43632] = true; index = 43636; while (index <= 43637) : (index += 1) { instance.array[index] = true; } index = 43640; while (index <= 43644) : (index += 1) { instance.array[index] = true; } instance.array[43647] = true; instance.array[43649] = true; index = 43674; while (index <= 43675) : (index += 1) { instance.array[index] = true; } instance.array[43676] = true; index = 43679; while (index <= 43689) : (index += 1) { instance.array[index] = true; } instance.array[43697] = true; index = 43698; while (index <= 43699) : (index += 1) { instance.array[index] = true; } index = 43712; while (index <= 43717) : (index += 1) { instance.array[index] = true; } index = 43720; while (index <= 43725) : (index += 1) { instance.array[index] = true; } index = 43728; while (index <= 43733) : (index += 1) { instance.array[index] = true; } index = 43743; while (index <= 43749) : (index += 1) { instance.array[index] = true; } index = 43751; while (index <= 43757) : (index += 1) { instance.array[index] = true; } index = 43759; while (index <= 43801) : (index += 1) { instance.array[index] = true; } index = 43803; while (index <= 43806) : (index += 1) { instance.array[index] = true; } index = 43807; while (index <= 43815) : (index += 1) { instance.array[index] = true; } instance.array[43816] = true; index = 43823; while (index <= 43902) : (index += 1) { instance.array[index] = true; } index = 43903; while (index <= 43937) : (index += 1) { instance.array[index] = true; } index = 43967; while (index <= 55138) : (index += 1) { instance.array[index] = true; } index = 55151; while (index <= 55173) : (index += 1) { instance.array[index] = true; } index = 55178; while (index <= 55226) : (index += 1) { instance.array[index] = true; } index = 63679; while (index <= 64044) : (index += 1) { instance.array[index] = true; } index = 64047; while (index <= 64152) : (index += 1) { instance.array[index] = true; } index = 64191; while (index <= 64197) : (index += 1) { instance.array[index] = true; } index = 64210; while (index <= 64214) : (index += 1) { instance.array[index] = true; } instance.array[64220] = true; index = 64222; while (index <= 64231) : (index += 1) { instance.array[index] = true; } index = 64233; while (index <= 64245) : (index += 1) { instance.array[index] = true; } index = 64247; while (index <= 64251) : (index += 1) { instance.array[index] = true; } instance.array[64253] = true; index = 64255; while (index <= 64256) : (index += 1) { instance.array[index] = true; } index = 64258; while (index <= 64259) : (index += 1) { instance.array[index] = true; } index = 64261; while (index <= 64368) : (index += 1) { instance.array[index] = true; } index = 64402; while (index <= 64764) : (index += 1) { instance.array[index] = true; } index = 64783; while (index <= 64846) : (index += 1) { instance.array[index] = true; } index = 64849; while (index <= 64902) : (index += 1) { instance.array[index] = true; } index = 64943; while (index <= 64954) : (index += 1) { instance.array[index] = true; } index = 65071; while (index <= 65075) : (index += 1) { instance.array[index] = true; } index = 65077; while (index <= 65211) : (index += 1) { instance.array[index] = true; } index = 65248; while (index <= 65273) : (index += 1) { instance.array[index] = true; } index = 65280; while (index <= 65305) : (index += 1) { instance.array[index] = true; } index = 65317; while (index <= 65326) : (index += 1) { instance.array[index] = true; } instance.array[65327] = true; index = 65328; while (index <= 65372) : (index += 1) { instance.array[index] = true; } index = 65373; while (index <= 65374) : (index += 1) { instance.array[index] = true; } index = 65375; while (index <= 65405) : (index += 1) { instance.array[index] = true; } index = 65409; while (index <= 65414) : (index += 1) { instance.array[index] = true; } index = 65417; while (index <= 65422) : (index += 1) { instance.array[index] = true; } index = 65425; while (index <= 65430) : (index += 1) { instance.array[index] = true; } index = 65433; while (index <= 65435) : (index += 1) { instance.array[index] = true; } index = 65471; while (index <= 65482) : (index += 1) { instance.array[index] = true; } index = 65484; while (index <= 65509) : (index += 1) { instance.array[index] = true; } index = 65511; while (index <= 65529) : (index += 1) { instance.array[index] = true; } index = 65531; while (index <= 65532) : (index += 1) { instance.array[index] = true; } index = 65534; while (index <= 65548) : (index += 1) { instance.array[index] = true; } index = 65551; while (index <= 65564) : (index += 1) { instance.array[index] = true; } index = 65599; while (index <= 65721) : (index += 1) { instance.array[index] = true; } index = 65791; while (index <= 65843) : (index += 1) { instance.array[index] = true; } index = 66111; while (index <= 66139) : (index += 1) { instance.array[index] = true; } index = 66143; while (index <= 66191) : (index += 1) { instance.array[index] = true; } index = 66239; while (index <= 66270) : (index += 1) { instance.array[index] = true; } index = 66284; while (index <= 66303) : (index += 1) { instance.array[index] = true; } instance.array[66304] = true; index = 66305; while (index <= 66312) : (index += 1) { instance.array[index] = true; } instance.array[66313] = true; index = 66319; while (index <= 66356) : (index += 1) { instance.array[index] = true; } index = 66367; while (index <= 66396) : (index += 1) { instance.array[index] = true; } index = 66399; while (index <= 66434) : (index += 1) { instance.array[index] = true; } index = 66439; while (index <= 66446) : (index += 1) { instance.array[index] = true; } index = 66448; while (index <= 66452) : (index += 1) { instance.array[index] = true; } index = 66495; while (index <= 66574) : (index += 1) { instance.array[index] = true; } index = 66575; while (index <= 66652) : (index += 1) { instance.array[index] = true; } index = 66671; while (index <= 66706) : (index += 1) { instance.array[index] = true; } index = 66711; while (index <= 66746) : (index += 1) { instance.array[index] = true; } index = 66751; while (index <= 66790) : (index += 1) { instance.array[index] = true; } index = 66799; while (index <= 66850) : (index += 1) { instance.array[index] = true; } index = 67007; while (index <= 67317) : (index += 1) { instance.array[index] = true; } index = 67327; while (index <= 67348) : (index += 1) { instance.array[index] = true; } index = 67359; while (index <= 67366) : (index += 1) { instance.array[index] = true; } index = 67519; while (index <= 67524) : (index += 1) { instance.array[index] = true; } instance.array[67527] = true; index = 67529; while (index <= 67572) : (index += 1) { instance.array[index] = true; } index = 67574; while (index <= 67575) : (index += 1) { instance.array[index] = true; } instance.array[67579] = true; index = 67582; while (index <= 67604) : (index += 1) { instance.array[index] = true; } index = 67615; while (index <= 67637) : (index += 1) { instance.array[index] = true; } index = 67647; while (index <= 67677) : (index += 1) { instance.array[index] = true; } index = 67743; while (index <= 67761) : (index += 1) { instance.array[index] = true; } index = 67763; while (index <= 67764) : (index += 1) { instance.array[index] = true; } index = 67775; while (index <= 67796) : (index += 1) { instance.array[index] = true; } index = 67807; while (index <= 67832) : (index += 1) { instance.array[index] = true; } index = 67903; while (index <= 67958) : (index += 1) { instance.array[index] = true; } index = 67965; while (index <= 67966) : (index += 1) { instance.array[index] = true; } instance.array[68031] = true; index = 68047; while (index <= 68050) : (index += 1) { instance.array[index] = true; } index = 68052; while (index <= 68054) : (index += 1) { instance.array[index] = true; } index = 68056; while (index <= 68084) : (index += 1) { instance.array[index] = true; } index = 68127; while (index <= 68155) : (index += 1) { instance.array[index] = true; } index = 68159; while (index <= 68187) : (index += 1) { instance.array[index] = true; } index = 68223; while (index <= 68230) : (index += 1) { instance.array[index] = true; } index = 68232; while (index <= 68259) : (index += 1) { instance.array[index] = true; } index = 68287; while (index <= 68340) : (index += 1) { instance.array[index] = true; } index = 68351; while (index <= 68372) : (index += 1) { instance.array[index] = true; } index = 68383; while (index <= 68401) : (index += 1) { instance.array[index] = true; } index = 68415; while (index <= 68432) : (index += 1) { instance.array[index] = true; } index = 68543; while (index <= 68615) : (index += 1) { instance.array[index] = true; } index = 68671; while (index <= 68721) : (index += 1) { instance.array[index] = true; } index = 68735; while (index <= 68785) : (index += 1) { instance.array[index] = true; } index = 68799; while (index <= 68834) : (index += 1) { instance.array[index] = true; } index = 69183; while (index <= 69224) : (index += 1) { instance.array[index] = true; } index = 69231; while (index <= 69232) : (index += 1) { instance.array[index] = true; } index = 69311; while (index <= 69339) : (index += 1) { instance.array[index] = true; } instance.array[69350] = true; index = 69359; while (index <= 69380) : (index += 1) { instance.array[index] = true; } index = 69487; while (index <= 69507) : (index += 1) { instance.array[index] = true; } index = 69535; while (index <= 69557) : (index += 1) { instance.array[index] = true; } index = 69570; while (index <= 69622) : (index += 1) { instance.array[index] = true; } index = 69698; while (index <= 69742) : (index += 1) { instance.array[index] = true; } index = 69775; while (index <= 69799) : (index += 1) { instance.array[index] = true; } index = 69826; while (index <= 69861) : (index += 1) { instance.array[index] = true; } instance.array[69891] = true; instance.array[69894] = true; index = 69903; while (index <= 69937) : (index += 1) { instance.array[index] = true; } instance.array[69941] = true; index = 69954; while (index <= 70001) : (index += 1) { instance.array[index] = true; } index = 70016; while (index <= 70019) : (index += 1) { instance.array[index] = true; } instance.array[70041] = true; instance.array[70043] = true; index = 70079; while (index <= 70096) : (index += 1) { instance.array[index] = true; } index = 70098; while (index <= 70122) : (index += 1) { instance.array[index] = true; } index = 70207; while (index <= 70213) : (index += 1) { instance.array[index] = true; } instance.array[70215] = true; index = 70217; while (index <= 70220) : (index += 1) { instance.array[index] = true; } index = 70222; while (index <= 70236) : (index += 1) { instance.array[index] = true; } index = 70238; while (index <= 70247) : (index += 1) { instance.array[index] = true; } index = 70255; while (index <= 70301) : (index += 1) { instance.array[index] = true; } index = 70340; while (index <= 70347) : (index += 1) { instance.array[index] = true; } index = 70350; while (index <= 70351) : (index += 1) { instance.array[index] = true; } index = 70354; while (index <= 70375) : (index += 1) { instance.array[index] = true; } index = 70377; while (index <= 70383) : (index += 1) { instance.array[index] = true; } index = 70385; while (index <= 70386) : (index += 1) { instance.array[index] = true; } index = 70388; while (index <= 70392) : (index += 1) { instance.array[index] = true; } instance.array[70396] = true; instance.array[70415] = true; index = 70428; while (index <= 70432) : (index += 1) { instance.array[index] = true; } index = 70591; while (index <= 70643) : (index += 1) { instance.array[index] = true; } index = 70662; while (index <= 70665) : (index += 1) { instance.array[index] = true; } index = 70686; while (index <= 70688) : (index += 1) { instance.array[index] = true; } index = 70719; while (index <= 70766) : (index += 1) { instance.array[index] = true; } index = 70787; while (index <= 70788) : (index += 1) { instance.array[index] = true; } instance.array[70790] = true; index = 70975; while (index <= 71021) : (index += 1) { instance.array[index] = true; } index = 71063; while (index <= 71066) : (index += 1) { instance.array[index] = true; } index = 71103; while (index <= 71150) : (index += 1) { instance.array[index] = true; } instance.array[71171] = true; index = 71231; while (index <= 71273) : (index += 1) { instance.array[index] = true; } instance.array[71287] = true; index = 71359; while (index <= 71385) : (index += 1) { instance.array[index] = true; } index = 71615; while (index <= 71658) : (index += 1) { instance.array[index] = true; } index = 71775; while (index <= 71838) : (index += 1) { instance.array[index] = true; } index = 71870; while (index <= 71877) : (index += 1) { instance.array[index] = true; } instance.array[71880] = true; index = 71883; while (index <= 71890) : (index += 1) { instance.array[index] = true; } index = 71892; while (index <= 71893) : (index += 1) { instance.array[index] = true; } index = 71895; while (index <= 71918) : (index += 1) { instance.array[index] = true; } instance.array[71934] = true; instance.array[71936] = true; index = 72031; while (index <= 72038) : (index += 1) { instance.array[index] = true; } index = 72041; while (index <= 72079) : (index += 1) { instance.array[index] = true; } instance.array[72096] = true; instance.array[72098] = true; instance.array[72127] = true; index = 72138; while (index <= 72177) : (index += 1) { instance.array[index] = true; } instance.array[72185] = true; instance.array[72207] = true; index = 72219; while (index <= 72264) : (index += 1) { instance.array[index] = true; } instance.array[72284] = true; index = 72319; while (index <= 72375) : (index += 1) { instance.array[index] = true; } index = 72639; while (index <= 72647) : (index += 1) { instance.array[index] = true; } index = 72649; while (index <= 72685) : (index += 1) { instance.array[index] = true; } instance.array[72703] = true; index = 72753; while (index <= 72782) : (index += 1) { instance.array[index] = true; } index = 72895; while (index <= 72901) : (index += 1) { instance.array[index] = true; } index = 72903; while (index <= 72904) : (index += 1) { instance.array[index] = true; } index = 72906; while (index <= 72943) : (index += 1) { instance.array[index] = true; } instance.array[72965] = true; index = 72991; while (index <= 72996) : (index += 1) { instance.array[index] = true; } index = 72998; while (index <= 72999) : (index += 1) { instance.array[index] = true; } index = 73001; while (index <= 73032) : (index += 1) { instance.array[index] = true; } instance.array[73047] = true; index = 73375; while (index <= 73393) : (index += 1) { instance.array[index] = true; } instance.array[73583] = true; index = 73663; while (index <= 74584) : (index += 1) { instance.array[index] = true; } index = 74687; while (index <= 74797) : (index += 1) { instance.array[index] = true; } index = 74815; while (index <= 75010) : (index += 1) { instance.array[index] = true; } index = 77759; while (index <= 78829) : (index += 1) { instance.array[index] = true; } index = 82879; while (index <= 83461) : (index += 1) { instance.array[index] = true; } index = 92095; while (index <= 92663) : (index += 1) { instance.array[index] = true; } index = 92671; while (index <= 92701) : (index += 1) { instance.array[index] = true; } index = 92815; while (index <= 92844) : (index += 1) { instance.array[index] = true; } index = 92863; while (index <= 92910) : (index += 1) { instance.array[index] = true; } index = 92927; while (index <= 92930) : (index += 1) { instance.array[index] = true; } index = 92962; while (index <= 92982) : (index += 1) { instance.array[index] = true; } index = 92988; while (index <= 93006) : (index += 1) { instance.array[index] = true; } index = 93695; while (index <= 93758) : (index += 1) { instance.array[index] = true; } index = 93887; while (index <= 93961) : (index += 1) { instance.array[index] = true; } instance.array[93967] = true; index = 94034; while (index <= 94046) : (index += 1) { instance.array[index] = true; } index = 94111; while (index <= 94112) : (index += 1) { instance.array[index] = true; } instance.array[94114] = true; index = 94143; while (index <= 100278) : (index += 1) { instance.array[index] = true; } index = 100287; while (index <= 101524) : (index += 1) { instance.array[index] = true; } index = 101567; while (index <= 101575) : (index += 1) { instance.array[index] = true; } index = 110527; while (index <= 110813) : (index += 1) { instance.array[index] = true; } index = 110863; while (index <= 110865) : (index += 1) { instance.array[index] = true; } index = 110883; while (index <= 110886) : (index += 1) { instance.array[index] = true; } index = 110895; while (index <= 111290) : (index += 1) { instance.array[index] = true; } index = 113599; while (index <= 113705) : (index += 1) { instance.array[index] = true; } index = 113711; while (index <= 113723) : (index += 1) { instance.array[index] = true; } index = 113727; while (index <= 113735) : (index += 1) { instance.array[index] = true; } index = 113743; while (index <= 113752) : (index += 1) { instance.array[index] = true; } index = 119743; while (index <= 119827) : (index += 1) { instance.array[index] = true; } index = 119829; while (index <= 119899) : (index += 1) { instance.array[index] = true; } index = 119901; while (index <= 119902) : (index += 1) { instance.array[index] = true; } instance.array[119905] = true; index = 119908; while (index <= 119909) : (index += 1) { instance.array[index] = true; } index = 119912; while (index <= 119915) : (index += 1) { instance.array[index] = true; } index = 119917; while (index <= 119928) : (index += 1) { instance.array[index] = true; } instance.array[119930] = true; index = 119932; while (index <= 119938) : (index += 1) { instance.array[index] = true; } index = 119940; while (index <= 120004) : (index += 1) { instance.array[index] = true; } index = 120006; while (index <= 120009) : (index += 1) { instance.array[index] = true; } index = 120012; while (index <= 120019) : (index += 1) { instance.array[index] = true; } index = 120021; while (index <= 120027) : (index += 1) { instance.array[index] = true; } index = 120029; while (index <= 120056) : (index += 1) { instance.array[index] = true; } index = 120058; while (index <= 120061) : (index += 1) { instance.array[index] = true; } index = 120063; while (index <= 120067) : (index += 1) { instance.array[index] = true; } instance.array[120069] = true; index = 120073; while (index <= 120079) : (index += 1) { instance.array[index] = true; } index = 120081; while (index <= 120420) : (index += 1) { instance.array[index] = true; } index = 120423; while (index <= 120447) : (index += 1) { instance.array[index] = true; } index = 120449; while (index <= 120473) : (index += 1) { instance.array[index] = true; } index = 120475; while (index <= 120505) : (index += 1) { instance.array[index] = true; } index = 120507; while (index <= 120531) : (index += 1) { instance.array[index] = true; } index = 120533; while (index <= 120563) : (index += 1) { instance.array[index] = true; } index = 120565; while (index <= 120589) : (index += 1) { instance.array[index] = true; } index = 120591; while (index <= 120621) : (index += 1) { instance.array[index] = true; } index = 120623; while (index <= 120647) : (index += 1) { instance.array[index] = true; } index = 120649; while (index <= 120679) : (index += 1) { instance.array[index] = true; } index = 120681; while (index <= 120705) : (index += 1) { instance.array[index] = true; } index = 120707; while (index <= 120714) : (index += 1) { instance.array[index] = true; } index = 123071; while (index <= 123115) : (index += 1) { instance.array[index] = true; } index = 123126; while (index <= 123132) : (index += 1) { instance.array[index] = true; } instance.array[123149] = true; index = 123519; while (index <= 123562) : (index += 1) { instance.array[index] = true; } index = 124863; while (index <= 125059) : (index += 1) { instance.array[index] = true; } index = 125119; while (index <= 125186) : (index += 1) { instance.array[index] = true; } instance.array[125194] = true; index = 126399; while (index <= 126402) : (index += 1) { instance.array[index] = true; } index = 126404; while (index <= 126430) : (index += 1) { instance.array[index] = true; } index = 126432; while (index <= 126433) : (index += 1) { instance.array[index] = true; } instance.array[126435] = true; instance.array[126438] = true; index = 126440; while (index <= 126449) : (index += 1) { instance.array[index] = true; } index = 126451; while (index <= 126454) : (index += 1) { instance.array[index] = true; } instance.array[126456] = true; instance.array[126458] = true; instance.array[126465] = true; instance.array[126470] = true; instance.array[126472] = true; instance.array[126474] = true; index = 126476; while (index <= 126478) : (index += 1) { instance.array[index] = true; } index = 126480; while (index <= 126481) : (index += 1) { instance.array[index] = true; } instance.array[126483] = true; instance.array[126486] = true; instance.array[126488] = true; instance.array[126490] = true; instance.array[126492] = true; instance.array[126494] = true; index = 126496; while (index <= 126497) : (index += 1) { instance.array[index] = true; } instance.array[126499] = true; index = 126502; while (index <= 126505) : (index += 1) { instance.array[index] = true; } index = 126507; while (index <= 126513) : (index += 1) { instance.array[index] = true; } index = 126515; while (index <= 126518) : (index += 1) { instance.array[index] = true; } index = 126520; while (index <= 126523) : (index += 1) { instance.array[index] = true; } instance.array[126525] = true; index = 126527; while (index <= 126536) : (index += 1) { instance.array[index] = true; } index = 126538; while (index <= 126554) : (index += 1) { instance.array[index] = true; } index = 126560; while (index <= 126562) : (index += 1) { instance.array[index] = true; } index = 126564; while (index <= 126568) : (index += 1) { instance.array[index] = true; } index = 126570; while (index <= 126586) : (index += 1) { instance.array[index] = true; } index = 131007; while (index <= 173724) : (index += 1) { instance.array[index] = true; } index = 173759; while (index <= 177907) : (index += 1) { instance.array[index] = true; } index = 177919; while (index <= 178140) : (index += 1) { instance.array[index] = true; } index = 178143; while (index <= 183904) : (index += 1) { instance.array[index] = true; } index = 183919; while (index <= 191391) : (index += 1) { instance.array[index] = true; } index = 194495; while (index <= 195036) : (index += 1) { instance.array[index] = true; } index = 196543; while (index <= 201481) : (index += 1) { instance.array[index] = true; } // Placeholder: 0. Struct name, 1. Code point kind return instance; } pub fn deinit(self: *IDStart) void { self.allocator.free(self.array); } // isIDStart checks if cp is of the kind ID_Start. pub fn isIDStart(self: IDStart, cp: u21) bool { if (cp < self.lo or cp > self.hi) return false; const index = cp - self.lo; return if (index >= self.array.len) false else self.array[index]; }
src/components/autogen/DerivedCoreProperties/IDStart.zig
const util = @import("../sdf_util.zig"); pub const info: util.SdfInfo = .{ .name = "Smooth Union", .data_size = @sizeOf(Data), .function_definition = function_definition, .enter_command_fn = enterCommand, .exit_command_fn = exitCommand, .append_mat_check_fn = appendMatCheck, .sphere_bound_fn = sphereBound, }; pub const Data = struct { smoothing: f32, mats: [2]i32, dist_indexes: [2]usize, }; const function_definition: []const u8 = \\float opSmoothUnion(float d1, float d2, float k){ \\ float h = clamp(.5 + .5 * (d2 - d1) / k, 0., 1.); \\ return mix(d2, d1, h) - k * h * (1. - h); \\} \\ ; fn enterCommand(ctxt: *util.IterationContext, iter: usize, mat_offset: usize, buffer: *[]u8) []const u8 { const data: *Data = @ptrCast(*Data, @alignCast(@alignOf(Data), buffer.ptr)); ctxt.pushEnterInfo(iter); ctxt.pushStackInfo(iter, -@intCast(i32, iter)); data.mats[0] = @intCast(i32, mat_offset); data.mats[1] = @intCast(i32, mat_offset); return util.std.fmt.allocPrint(ctxt.allocator, "", .{}) catch unreachable; } fn exitCommand(ctxt: *util.IterationContext, iter: usize, buffer: *[]u8) []const u8 { _ = iter; const data: *Data = @ptrCast(*Data, @alignCast(@alignOf(Data), buffer.ptr)); const ei: util.EnterInfo = ctxt.lastEnterInfo(); const format: []const u8 = "float d{d} = opSmoothUnion(d{d}, d{d}, {d:.5});"; const broken_stack: []const u8 = "float d{d} = 1e10;"; var res: []const u8 = undefined; if (ei.enter_stack + 2 >= ctxt.value_indexes.items.len) { res = util.std.fmt.allocPrint(ctxt.allocator, broken_stack, .{ei.enter_index}) catch unreachable; data.mats[0] = 0; data.mats[1] = 0; data.dist_indexes[0] = ei.enter_index; data.dist_indexes[1] = ei.enter_index; } else { const prev_info: util.IterationContext.StackInfo = ctxt.value_indexes.items[ctxt.value_indexes.items.len - 1]; const prev_prev_info: util.IterationContext.StackInfo = ctxt.value_indexes.items[ctxt.value_indexes.items.len - 2]; res = util.std.fmt.allocPrint(ctxt.allocator, format, .{ ei.enter_index, ctxt.last_value_set_index, prev_prev_info.index, data.smoothing, }) catch unreachable; data.mats[0] = data.mats[0] * @boolToInt(prev_info.material >= 0) + prev_info.material; data.mats[1] = data.mats[1] * @boolToInt(prev_prev_info.material >= 0) + prev_prev_info.material; data.dist_indexes[0] = prev_info.index; data.dist_indexes[1] = prev_prev_info.index; } ctxt.dropPreviousValueIndexes(ei.enter_stack); return res; } fn appendMatCheck(ctxt: *util.IterationContext, exit_command: []const u8, buffer: *[]u8, mat_offset: usize, allocator: util.std.mem.Allocator) []const u8 { _ = mat_offset; _ = ctxt; const data: *Data = @ptrCast(*Data, @alignCast(@alignOf(Data), buffer.ptr)); const ei: util.EnterInfo = ctxt.popEnterInfo(); const format_mat: []const u8 = "matToColor({d}.,l,n,v)"; const format_gen_mat: []const u8 = "m{d}"; var mat_str: [2][]const u8 = .{undefined} ** 2; for (mat_str) |_, ind| { if (data.mats[ind] >= 0) { mat_str[ind] = util.std.fmt.allocPrint(allocator, format_mat, .{data.mats[ind]}) catch unreachable; } else { mat_str[ind] = util.std.fmt.allocPrint(allocator, format_gen_mat, .{-data.mats[ind]}) catch unreachable; } } const format: []const u8 = "{s}vec3 m{d} = mix({s},{s},d{d}/(d{d}+d{d}));if(d{d}<MAP_EPS)return m{d};"; const res: []const u8 = util.std.fmt.allocPrint(allocator, format, .{ exit_command, ei.enter_index, mat_str[0], mat_str[1], data.dist_indexes[0], data.dist_indexes[0], data.dist_indexes[1], ei.enter_index, ei.enter_index, }) catch unreachable; for (mat_str) |s| allocator.free(s); return res; } fn sphereBound(buffer: *[]u8, bound: *util.math.sphereBound, children: []util.math.sphereBound) void { _ = buffer; if (children.len == 1) { bound.* = children[0]; return; } bound.* = util.math.SphereBound.merge(children[0], children[1]); for (children[2..]) |csb| bound.* = util.math.SphereBound.merge(bound.*, csb); }
src/sdf/combinators/smooth_union.zig
const std = @import("std"); const print = std.debug.print; const Ingredient = struct { capacity: isize, durability: isize, flavor: isize, texture: isize, calories: isize, }; pub fn main() anyerror!void { const global_allocator = std.heap.page_allocator; var file = try std.fs.cwd().openFile( "./inputs/day15.txt", .{ .read = true, }, ); var reader = std.io.bufferedReader(file.reader()).reader(); var line_buffer: [1024]u8 = undefined; var ingredients = std.ArrayList(Ingredient).init(global_allocator); defer ingredients.deinit(); while (try reader.readUntilDelimiterOrEof(&line_buffer, '\n')) |line| { var tokens = std.mem.tokenize(u8, line, " "); _ = tokens.next(); // <name>: _ = tokens.next(); // capacity const capacity_str = tokens.next().?; const capacity = try std.fmt.parseInt(isize, capacity_str[0 .. capacity_str.len - 1], 10); _ = tokens.next(); // durability const durability_str = tokens.next().?; const durability = try std.fmt.parseInt(isize, durability_str[0 .. durability_str.len - 1], 10); _ = tokens.next(); // flavor const flavor_str = tokens.next().?; const flavor = try std.fmt.parseInt(isize, flavor_str[0 .. flavor_str.len - 1], 10); _ = tokens.next(); // texture const texture_str = tokens.next().?; const texture = try std.fmt.parseInt(isize, texture_str[0 .. texture_str.len - 1], 10); _ = tokens.next(); // calories const calories_str = tokens.next().?; const calories = try std.fmt.parseInt(isize, calories_str, 10); const ingredient = Ingredient{ .capacity = capacity, .durability = durability, .flavor = flavor, .texture = texture, .calories = calories, }; try ingredients.append(ingredient); } { var vector = std.ArrayList(isize).init(global_allocator); defer vector.deinit(); var best_score: isize = 0; try find_best_score(vector, ingredients.items, &best_score, null); print("Part 1: {d}\n", .{best_score}); } { var vector = std.ArrayList(isize).init(global_allocator); defer vector.deinit(); var best_score: isize = 0; try find_best_score(vector, ingredients.items, &best_score, 500); print("Part 2: {d}\n", .{best_score}); } } fn find_best_score( candidate: std.ArrayList(isize), ingredients: []Ingredient, best_score: *isize, calories_goal: ?isize, ) anyerror!void { if (ingredients.len == candidate.items.len) { if (sum(candidate.items) != 100) { std.debug.panic("Wrong sum: {d}\n", .{sum(candidate.items)}); } const out = get_score(candidate.items, ingredients); if (calories_goal) |goal| { if (goal != out.calories) { return; } } best_score.* = std.math.max(best_score.*, out.score); } else if (ingredients.len - 1 == candidate.items.len) { const s = sum(candidate.items); var c = candidate; try c.append(100 - s); defer _ = c.pop(); try find_best_score(c, ingredients, best_score, calories_goal); } else { const s = sum(candidate.items); var c = candidate; var i: isize = 0; while (i < 100 - s) : (i += 1) { try c.append(i); defer _ = c.pop(); try find_best_score(c, ingredients, best_score, calories_goal); } } } fn sum(xs: []isize) isize { var s: isize = 0; for (xs) |x| { s += x; } return s; } fn get_score(xs: []isize, ingredients: []Ingredient) struct { score: isize, calories: isize } { var sum_ingredient = Ingredient{ .capacity = 0, .durability = 0, .flavor = 0, .texture = 0, .calories = 0, }; for (ingredients) |ingredient, i| { sum_ingredient.capacity += ingredient.capacity * xs[i]; sum_ingredient.durability += ingredient.durability * xs[i]; sum_ingredient.flavor += ingredient.flavor * xs[i]; sum_ingredient.texture += ingredient.texture * xs[i]; sum_ingredient.calories += ingredient.calories * xs[i]; } var product: isize = 1; product *= std.math.max(0, sum_ingredient.capacity); product *= std.math.max(0, sum_ingredient.durability); product *= std.math.max(0, sum_ingredient.flavor); product *= std.math.max(0, sum_ingredient.texture); return .{ .score = product, .calories = sum_ingredient.calories }; }
src/day15.zig
const std = @import("std"); const num_aunts: u32 = 500; fn solve1(aunts: [num_aunts]std.StringHashMap(u32)) ?usize { var i: usize = 0; while (i < num_aunts) : (i += 1) { if (aunts[i].get("children") orelse 3 != 3) continue; if (aunts[i].get("cats") orelse 7 != 7) continue; if (aunts[i].get("samoyeds") orelse 2 != 2) continue; if (aunts[i].get("pomeranians") orelse 3 != 3) continue; if (aunts[i].get("akitas") orelse 0 != 0) continue; if (aunts[i].get("vizslas") orelse 0 != 0) continue; if (aunts[i].get("goldfish") orelse 5 != 5) continue; if (aunts[i].get("trees") orelse 3 != 3) continue; if (aunts[i].get("cars") orelse 2 != 2) continue; if (aunts[i].get("perfumes") orelse 1 != 1) continue; return i + 1; } return null; } fn solve2(aunts: [num_aunts]std.StringHashMap(u32)) ?usize { var i: usize = 0; while (i < num_aunts) : (i += 1) { if (aunts[i].get("children") orelse 3 != 3) continue; if (aunts[i].get("cats") orelse 8 <= 7) continue; if (aunts[i].get("samoyeds") orelse 2 != 2) continue; if (aunts[i].get("pomeranians") orelse 2 >= 3) continue; if (aunts[i].get("akitas") orelse 0 != 0) continue; if (aunts[i].get("vizslas") orelse 0 != 0) continue; if (aunts[i].get("goldfish") orelse 4 >= 5) continue; if (aunts[i].get("trees") orelse 4 <= 3) continue; if (aunts[i].get("cars") orelse 2 != 2) continue; if (aunts[i].get("perfumes") orelse 1 != 1) continue; return i + 1; } return null; } pub fn main() !void { const file = try std.fs.cwd().openFile("inputs/day16.txt", .{ .read = true }); defer file.close(); var reader = std.io.bufferedReader(file.reader()).reader(); var buffer: [1024]u8 = undefined; var gpa = std.heap.GeneralPurposeAllocator(.{}){}; defer _ = gpa.deinit(); var arena = std.heap.ArenaAllocator.init(&gpa.allocator); defer arena.deinit(); var aunts: [num_aunts]std.StringHashMap(u32) = undefined; // We need to allocate memory for property names (to avoid pointing to the // reader buffer, which won't be valid), so store the names in a map/set to // only allocate each of them once var propertyNames = std.StringHashMap(void).init(&arena.allocator); var line_num: usize = 0; while (try reader.readUntilDelimiterOrEof(&buffer, '\n')) |line| : (line_num += 1) { var pos: usize = 0; // Skip everything up to the first colon while (line[pos] != ':') : (pos += 1) {} pos += 2; // Skip ": " var line_content = line[pos..]; aunts[line_num] = std.StringHashMap(u32).init(&arena.allocator); var properties = std.mem.tokenize(u8, line_content, ","); while (properties.next()) |property| { var tokens = std.mem.tokenize(u8, property, ": "); const tempPropertyName = tokens.next().?; // If it's a property we haven't seen yet, allocate memory to store // the name if (!propertyNames.contains(tempPropertyName)) { const newPropertyName = try arena.allocator.alloc(u8, tempPropertyName.len); for (tempPropertyName) |c, i| newPropertyName[i] = c; try propertyNames.put(newPropertyName, undefined); } const propertyName = propertyNames.getKey(tempPropertyName).?; const propertyValue = try std.fmt.parseInt(u32, tokens.next().?, 10); try aunts[line_num].put(propertyName, propertyValue); } } std.debug.print("{d}\n", .{solve1(aunts)}); std.debug.print("{d}\n", .{solve2(aunts)}); }
src/day16.zig
pub const width: usize = 9; pub const height: usize = 20; pub const bitmaps = [95][20][2]u8 { [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x7f, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x7f, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x2a, 0x0}, [_]u8{0x49, 0x0}, [_]u8{0x48, 0x0}, [_]u8{0x48, 0x0}, [_]u8{0x28, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0xa, 0x0}, [_]u8{0x9, 0x0}, [_]u8{0x9, 0x0}, [_]u8{0x49, 0x0}, [_]u8{0x2a, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x11, 0x0}, [_]u8{0x29, 0x0}, [_]u8{0x2a, 0x0}, [_]u8{0x12, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x12, 0x0}, [_]u8{0x15, 0x0}, [_]u8{0x25, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x18, 0x0}, [_]u8{0x24, 0x0}, [_]u8{0x24, 0x0}, [_]u8{0x24, 0x0}, [_]u8{0x18, 0x0}, [_]u8{0x18, 0x0}, [_]u8{0x28, 0x0}, [_]u8{0x25, 0x0}, [_]u8{0x45, 0x0}, [_]u8{0x42, 0x0}, [_]u8{0x42, 0x0}, [_]u8{0x25, 0x0}, [_]u8{0x19, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x2, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x2, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x20, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x20, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x7f, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x7f, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0xc, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x7f, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x2, 0x0}, [_]u8{0x2, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x20, 0x0}, [_]u8{0x20, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x43, 0x0}, [_]u8{0x45, 0x0}, [_]u8{0x49, 0x0}, [_]u8{0x51, 0x0}, [_]u8{0x61, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x18, 0x0}, [_]u8{0x28, 0x0}, [_]u8{0x48, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x2, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x20, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x7f, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x2, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x2, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x42, 0x0}, [_]u8{0x42, 0x0}, [_]u8{0x7f, 0x0}, [_]u8{0x2, 0x0}, [_]u8{0x2, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x7f, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x7c, 0x0}, [_]u8{0x2, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0xe, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x20, 0x0}, [_]u8{0x20, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x5c, 0x0}, [_]u8{0x62, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x7f, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x2, 0x0}, [_]u8{0x2, 0x0}, [_]u8{0x2, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x23, 0x0}, [_]u8{0x1d, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x2, 0x0}, [_]u8{0x2, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x38, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x2, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x20, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x2, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x7f, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x7f, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x20, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x2, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x20, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x2, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x4d, 0x0}, [_]u8{0x53, 0x0}, [_]u8{0x51, 0x0}, [_]u8{0x51, 0x0}, [_]u8{0x53, 0x0}, [_]u8{0x4d, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x21, 0x0}, [_]u8{0x1e, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x7f, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x7c, 0x0}, [_]u8{0x42, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x42, 0x0}, [_]u8{0x7c, 0x0}, [_]u8{0x42, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x42, 0x0}, [_]u8{0x7c, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x7c, 0x0}, [_]u8{0x42, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x42, 0x0}, [_]u8{0x7c, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x7f, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x7c, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x7f, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x7f, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x7c, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x47, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x23, 0x0}, [_]u8{0x1d, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x7f, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x42, 0x0}, [_]u8{0x44, 0x0}, [_]u8{0x48, 0x0}, [_]u8{0x50, 0x0}, [_]u8{0x60, 0x0}, [_]u8{0x50, 0x0}, [_]u8{0x48, 0x0}, [_]u8{0x44, 0x0}, [_]u8{0x42, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x7f, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x63, 0x0}, [_]u8{0x63, 0x0}, [_]u8{0x55, 0x0}, [_]u8{0x55, 0x0}, [_]u8{0x49, 0x0}, [_]u8{0x49, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x61, 0x0}, [_]u8{0x61, 0x0}, [_]u8{0x51, 0x0}, [_]u8{0x51, 0x0}, [_]u8{0x49, 0x0}, [_]u8{0x49, 0x0}, [_]u8{0x45, 0x0}, [_]u8{0x45, 0x0}, [_]u8{0x43, 0x0}, [_]u8{0x43, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x7c, 0x0}, [_]u8{0x42, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x42, 0x0}, [_]u8{0x7c, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x45, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x1d, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x7c, 0x0}, [_]u8{0x42, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x42, 0x0}, [_]u8{0x7c, 0x0}, [_]u8{0x44, 0x0}, [_]u8{0x42, 0x0}, [_]u8{0x42, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x20, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x2, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x7f, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x88, 0x80}, [_]u8{0x88, 0x80}, [_]u8{0x88, 0x80}, [_]u8{0x88, 0x80}, [_]u8{0x88, 0x80}, [_]u8{0x55, 0x0}, [_]u8{0x55, 0x0}, [_]u8{0x55, 0x0}, [_]u8{0x55, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x7f, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x2, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x20, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x7f, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0xe, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0xe, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x20, 0x0}, [_]u8{0x20, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x2, 0x0}, [_]u8{0x2, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x38, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x38, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x7f, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x1e, 0x0}, [_]u8{0x21, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1f, 0x0}, [_]u8{0x21, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x23, 0x0}, [_]u8{0x1d, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x5c, 0x0}, [_]u8{0x62, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x62, 0x0}, [_]u8{0x5c, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x1e, 0x0}, [_]u8{0x21, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x21, 0x0}, [_]u8{0x1e, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1d, 0x0}, [_]u8{0x23, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x23, 0x0}, [_]u8{0x1d, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x7f, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x21, 0x0}, [_]u8{0x1e, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x7, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x3e, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x1d, 0x0}, [_]u8{0x23, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x23, 0x0}, [_]u8{0x1d, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x42, 0x0}, [_]u8{0x3c, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x5c, 0x0}, [_]u8{0x62, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x18, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x70, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x42, 0x0}, [_]u8{0x44, 0x0}, [_]u8{0x48, 0x0}, [_]u8{0x70, 0x0}, [_]u8{0x48, 0x0}, [_]u8{0x44, 0x0}, [_]u8{0x42, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x18, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x6, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x76, 0x0}, [_]u8{0x49, 0x0}, [_]u8{0x49, 0x0}, [_]u8{0x49, 0x0}, [_]u8{0x49, 0x0}, [_]u8{0x49, 0x0}, [_]u8{0x49, 0x0}, [_]u8{0x49, 0x0}, [_]u8{0x49, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x5c, 0x0}, [_]u8{0x62, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x1c, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x5c, 0x0}, [_]u8{0x62, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x62, 0x0}, [_]u8{0x5c, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x1d, 0x0}, [_]u8{0x23, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x23, 0x0}, [_]u8{0x1d, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x4e, 0x0}, [_]u8{0x51, 0x0}, [_]u8{0x60, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x3e, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x3e, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x3e, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x3e, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x7, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x23, 0x0}, [_]u8{0x1d, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x49, 0x0}, [_]u8{0x49, 0x0}, [_]u8{0x49, 0x0}, [_]u8{0x55, 0x0}, [_]u8{0x55, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x41, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x22, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x14, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x60, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x7f, 0x0}, [_]u8{0x1, 0x0}, [_]u8{0x2, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x20, 0x0}, [_]u8{0x40, 0x0}, [_]u8{0x7f, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x4, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x8, 0x0}, [_]u8{0x10, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, [20][2]u8{ [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x30, 0x0}, [_]u8{0x49, 0x0}, [_]u8{0x6, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, [_]u8{0x0, 0x0}, }, };
kernel/font.zig
const assert = @import("std").debug.assert; const elf = @import("elf.zig"); const mem = @import("mem.zig"); const scheduler = @import("scheduler.zig"); const vmem = @import("vmem.zig"); const Thread = @import("thread.zig").Thread; const ThreadList = @import("thread.zig").ThreadList; // Keep track of the used PIDs. var next_pid: u16 = 1; // Structure representing a process. pub const Process = struct { pid: u16, page_directory: usize, next_local_tid: u8, threads: ThreadList, //// // Create a new process and switch to it. // // Arguments: // elf_addr: Pointer to the beginning of the ELF file. // // Returns: // Pointer to the new process structure. // pub fn create(elf_addr: usize) &Process { var process = mem.allocator.create(Process) catch unreachable; *process = Process { .pid = next_pid, .page_directory = vmem.createAddressSpace(), .next_local_tid = 1, .threads = ThreadList.init(), }; next_pid += 1; // Switch to the new address space... scheduler.switchProcess(process); // ...so that we can extract the ELF inside it... const entry_point = elf.load(elf_addr); // ...and start executing it. const main_thread = process.createThread(entry_point); return process; } //// // Destroy the process. // pub fn destroy(self: &Process) void { assert (scheduler.current_process == self); // Deallocate all of user space. vmem.destroyAddressSpace(); // Iterate through the threads and destroy them. var it = self.threads.first; while (it) |node| { // NOTE: fetch the next element in the list now, // before deallocating the current one. it = node.next; const thread = node.toData(); thread.destroy(); } mem.allocator.destroy(self); } //// // Create a new thread in the process. // // Arguments: // entry_point: The entry point of the new thread. // // Returns: // The TID of the new thread. // pub fn createThread(self: &Process, entry_point: usize) &Thread { const thread = Thread.init(self, self.next_local_tid, entry_point); self.threads.append(&thread.process_link); self.next_local_tid += 1; // Add the thread to the scheduling queue. scheduler.new(thread); return thread; } //// // Remove a thread from scheduler queue and list of process's threads. // NOTE: Do not call this function directly. Use Thread.destroy instead. // // Arguments: // thread: The thread to be removed. // fn removeThread(self: &Process, thread: &Thread) void { scheduler.remove(thread); self.threads.remove(&thread.process_link); // TODO: handle case in which this was the last thread of the process. } };
kernel/process.zig
const rokuhachi = @import("rokuhachi"); const z80 = rokuhachi.cpu.z80; const std = @import("std"); const Allocator = std.mem.Allocator; const testing = std.testing; usingnamespace @import("../helpers.zig"); fn TestIO(comptime ram_size: usize, comptime rom: []const u8) type { return struct { bus: z80.Z80Bus, ram: []u8, allocator: *Allocator, pub const ROM = rom; const Self = @This(); pub fn init(allocator: *Allocator) Self { return Self{ .bus = .{ .read8 = read8, .write8 = write8, }, .ram = allocator.alloc(u8, ram_size) catch unreachable, .allocator = allocator, }; } pub fn deinit(self: Self) void { self.allocator.free(self.ram); } pub fn read8(bus: *z80.Z80Bus, address: u16) u8 { const self = @fieldParentPtr(Self, "bus", bus); if (address < ROM.len) { return ROM[address]; } if (address >= 0x8000 and address < (0x8000 + ram_size)) { return self.ram[address - 0x8000]; } return 0; } pub fn write8(bus: *z80.Z80Bus, address: u16, data: u8) void { const self = @fieldParentPtr(Self, "bus", bus); if (address >= 0x8000 and address < (0x8000 + ram_size)) { self.ram[address - 0x8000] = data; } } }; } test "Z80 NOP" { var test_io = TestIO(256, &[_]u8{ 0x00, // NOP }).init(std.testing.allocator); defer test_io.deinit(); var cpu = z80.Z80.init(&test_io.bus); var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.total_t_cycles, 4); try expectEq(cpu.total_m_cycles, 1); } test "Z80 LD register <- register" { var test_io = TestIO(256, &[_]u8{ 0x7f, // LD A,A 0x78, // LD A,B 0x79, // LD A,C 0x7A, // LD A,D 0x7B, // LD A,E 0x7C, // LD A,H 0x7D, // LD A,L 0x47, // LD B,A 0x40, // LD B,B 0x41, // LD B,C 0x42, // LD B,D 0x43, // LD B,E 0x44, // LD B,H 0x45, // LD B,L 0x4f, // LD C,A 0x48, // LD C,B 0x49, // LD C,C 0x4A, // LD C,D 0x4B, // LD C,E 0x4C, // LD C,H 0x4D, // LD C,L 0x57, // LD D,A 0x50, // LD D,B 0x51, // LD D,C 0x52, // LD D,D 0x53, // LD D,E 0x54, // LD D,H 0x55, // LD D,L 0x5F, // LD E,A 0x58, // LD E,B 0x59, // LD E,C 0x5A, // LD E,D 0x5B, // LD E,E 0x5C, // LD E,H 0x5D, // LD E,L 0x67, // LD H,A 0x60, // LD H,B 0x61, // LD H,C 0x62, // LD H,D 0x63, // LD H,E 0x64, // LD H,H 0x65, // LD H,L 0x6F, // LD L,A 0x68, // LD L,B 0x69, // LD L,C 0x6A, // LD L,D 0x6B, // LD L,E 0x6C, // LD L,H 0x6D, // LD L,L }).init(std.testing.allocator); defer test_io.deinit(); var cpu = z80.Z80.init(&test_io.bus); // LD A,A { cpu.registers.main.af.pair.A = 0xFF; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.af.pair.A, 0xFF); } // LD A,B { cpu.registers.main.bc.pair.B = 0x0B; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.af.pair.A, 0x0B); } // LD A,C { cpu.registers.main.bc.pair.C = 0x0C; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.af.pair.A, 0x0C); } // LD A,D { cpu.registers.main.de.pair.D = 0x0D; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.af.pair.A, 0x0D); } // LD A,E { cpu.registers.main.de.pair.E = 0x0D; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.af.pair.A, 0x0D); } // LD A,H { cpu.registers.main.hl.pair.H = 0x01; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.af.pair.A, 0x01); } // LD A,L { cpu.registers.main.hl.pair.L = 0x02; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.af.pair.A, 0x02); } // LD B,A { cpu.registers.main.af.pair.A = 0x0A; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.bc.pair.B, 0x0A); } // LD B,B { cpu.registers.main.bc.pair.B = 0xFF; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.bc.pair.B, 0xFF); } // LD B,C { cpu.registers.main.bc.pair.C = 0x0C; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.bc.pair.B, 0x0C); } // LD B,D { cpu.registers.main.de.pair.D = 0x0D; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.bc.pair.B, 0x0D); } // LD B,E { cpu.registers.main.de.pair.E = 0x0E; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.bc.pair.B, 0x0E); } // LD B,H { cpu.registers.main.hl.pair.H = 0x01; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.bc.pair.B, 0x01); } // LD B,L { cpu.registers.main.hl.pair.L = 0x02; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.bc.pair.B, 0x02); } // LD C,A { cpu.registers.main.af.pair.A = 0x0A; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.bc.pair.C, 0x0A); } // LD C,B { cpu.registers.main.bc.pair.B = 0x0B; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.bc.pair.C, 0x0B); } // LD C,C { cpu.registers.main.bc.pair.C = 0xFF; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.bc.pair.C, 0xFF); } // LD C,D { cpu.registers.main.de.pair.D = 0x0D; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.bc.pair.C, 0x0D); } // LD C,E { cpu.registers.main.de.pair.E = 0x0E; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.bc.pair.C, 0x0E); } // LD C,H { cpu.registers.main.hl.pair.H = 0x01; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.bc.pair.C, 0x01); } // LD C,L { cpu.registers.main.hl.pair.L = 0x02; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.bc.pair.C, 0x02); } // LD D,A { cpu.registers.main.af.pair.A = 0x0A; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.de.pair.D, 0x0A); } // LD D,B { cpu.registers.main.bc.pair.B = 0x0B; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.de.pair.D, 0x0B); } // LD D,C { cpu.registers.main.bc.pair.C = 0xFF; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.de.pair.D, 0xFF); } // LD D,D { cpu.registers.main.de.pair.D = 0x0D; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.de.pair.D, 0x0D); } // LD D,E { cpu.registers.main.de.pair.E = 0x0E; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.de.pair.D, 0x0E); } // LD D,H { cpu.registers.main.hl.pair.H = 0x01; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.de.pair.D, 0x01); } // LD D,L { cpu.registers.main.hl.pair.L = 0x02; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.de.pair.D, 0x02); } // LD E,A { cpu.registers.main.af.pair.A = 0x0A; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.de.pair.E, 0x0A); } // LD E,B { cpu.registers.main.bc.pair.B = 0x0B; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.de.pair.E, 0x0B); } // LD E,C { cpu.registers.main.bc.pair.C = 0xFF; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.de.pair.E, 0xFF); } // LD E,D { cpu.registers.main.de.pair.D = 0x0D; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.de.pair.E, 0x0D); } // LD E,E { cpu.registers.main.de.pair.E = 0x0E; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.de.pair.E, 0x0E); } // LD E,H { cpu.registers.main.hl.pair.H = 0x01; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.de.pair.E, 0x01); } // LD E,L { cpu.registers.main.hl.pair.L = 0x02; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.de.pair.E, 0x02); } // LD H,A { cpu.registers.main.af.pair.A = 0x0A; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.hl.pair.H, 0x0A); } // LD H,B { cpu.registers.main.bc.pair.B = 0x0B; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.hl.pair.H, 0x0B); } // LD H,C { cpu.registers.main.bc.pair.C = 0xFF; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.hl.pair.H, 0xFF); } // LD H,D { cpu.registers.main.de.pair.D = 0x0D; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.hl.pair.H, 0x0D); } // LD H,E { cpu.registers.main.de.pair.E = 0x0E; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.hl.pair.H, 0x0E); } // LD H,H { cpu.registers.main.hl.pair.H = 0x01; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.hl.pair.H, 0x01); } // LD H,L { cpu.registers.main.hl.pair.L = 0x02; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.hl.pair.H, 0x02); } // LD L,A { cpu.registers.main.af.pair.A = 0x0A; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.hl.pair.L, 0x0A); } // LD L,B { cpu.registers.main.bc.pair.B = 0x0B; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.hl.pair.L, 0x0B); } // LD L,C { cpu.registers.main.bc.pair.C = 0xFF; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.hl.pair.L, 0xFF); } // LD L,D { cpu.registers.main.de.pair.D = 0x0D; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.hl.pair.L, 0x0D); } // LD L,E { cpu.registers.main.de.pair.E = 0x0E; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.hl.pair.L, 0x0E); } // LD L,H { cpu.registers.main.hl.pair.H = 0x01; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.hl.pair.L, 0x01); } // LD L,L { cpu.registers.main.hl.pair.L = 0x02; var i: usize = 0; while (i < 4) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.hl.pair.L, 0x02); } } test "Z80 LD register <- immediate data" { var test_io = TestIO(256, &[_]u8{ 0x3e, 0x02, // LD A, #$02 0x06, 0x12, // LD B, #$12 0x0e, 0x22, // LD C, #$22 0x16, 0x32, // LD D, #$32 0x1e, 0x42, // LD E, #$42 0x26, 0x52, // LD H, #$52 0x2e, 0x62, // LD L, #$62 }).init(std.testing.allocator); defer test_io.deinit(); var cpu = z80.Z80.init(&test_io.bus); var i: usize = 0; while (i < (7 * 7)) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.af.pair.A, 0x02); try expectEq(cpu.registers.main.bc.pair.B, 0x12); try expectEq(cpu.registers.main.bc.pair.C, 0x22); try expectEq(cpu.registers.main.de.pair.D, 0x32); try expectEq(cpu.registers.main.de.pair.E, 0x42); try expectEq(cpu.registers.main.hl.pair.H, 0x52); try expectEq(cpu.registers.main.hl.pair.L, 0x62); try expectEq(cpu.total_t_cycles, 7 * 7); try expectEq(cpu.total_m_cycles, 7 * 2); } test "Z80 LD register <- (HL)" { var test_io = TestIO(256, &[_]u8{ 0x26, 0x80, // LD H, #$80 0x2e, 0x00, // LD L, #$00 0x7e, // LD A, (HL) 0x46, // LD B, (HL) 0x4e, // LD C, (HL) 0x56, // LD D, (HL) 0x5e, // LD E, (HL) 0x66, // LD H, (HL) 0x26, 0x80, // LD H, #$80 0x6e, // LD L, (HL) }).init(std.testing.allocator); defer test_io.deinit(); var cpu = z80.Z80.init(&test_io.bus); { var i: usize = 0; while (i < (7 * 2)) : (i += 1) { cpu.tick(); } } { test_io.ram[0] = 1; var i: usize = 0; while (i < 7) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.af.pair.A, 0x01); } { test_io.ram[0] = 2; var i: usize = 0; while (i < 7) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.bc.pair.B, 0x02); } { test_io.ram[0] = 3; var i: usize = 0; while (i < 7) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.bc.pair.C, 0x03); } { test_io.ram[0] = 4; var i: usize = 0; while (i < 7) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.de.pair.D, 0x04); } { test_io.ram[0] = 5; var i: usize = 0; while (i < 7) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.de.pair.E, 0x05); } { test_io.ram[0] = 6; var i: usize = 0; while (i < 7) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.hl.pair.H, 0x06); } { var i: usize = 0; while (i < 7) : (i += 1) { cpu.tick(); } } { test_io.ram[0] = 7; var i: usize = 0; while (i < 7) : (i += 1) { cpu.tick(); } try expectEq(cpu.registers.main.hl.pair.L, 0x07); } try expectEq(cpu.total_t_cycles, 10 * 7); try expectEq(cpu.total_m_cycles, 10 * 2); } test "Z80 LD (HL) <- r" { var test_io = TestIO(256, &[_]u8{ 0x3e, 0x02, // LD A, #$02 0x06, 0x12, // LD B, #$12 0x0e, 0x22, // LD C, #$22 0x16, 0x32, // LD D, #$32 0x1e, 0x42, // LD E, #$42 0x26, 0x80, // LD H, #$80 0x2e, 0x01, // LD L, #$01 0x77, // LD (HL), A 0x70, // LD (HL), B 0x71, // LD (HL), C 0x72, // LD (HL), D 0x73, // LD (HL), E 0x74, // LD (HL), H 0x75, // LD (HL), L }).init(std.testing.allocator); defer test_io.deinit(); var cpu = z80.Z80.init(&test_io.bus); { var i: usize = 0; while (i < (7 * 7)) : (i += 1) { cpu.tick(); } } // LD (HL), A { var i: usize = 0; while (i < 7) : (i += 1) { cpu.tick(); } try expectEq(test_io.ram[1], 0x02); } // LD (HL), B { var i: usize = 0; while (i < 7) : (i += 1) { cpu.tick(); } try expectEq(test_io.ram[1], 0x12); } // LD (HL), C { var i: usize = 0; while (i < 7) : (i += 1) { cpu.tick(); } try expectEq(test_io.ram[1], 0x22); } // LD (HL), D { var i: usize = 0; while (i < 7) : (i += 1) { cpu.tick(); } try expectEq(test_io.ram[1], 0x32); } // LD (HL), E { var i: usize = 0; while (i < 7) : (i += 1) { cpu.tick(); } try expectEq(test_io.ram[1], 0x42); } // LD (HL), H { var i: usize = 0; while (i < 7) : (i += 1) { cpu.tick(); } try expectEq(test_io.ram[1], 0x80); } // LD (HL), L { var i: usize = 0; while (i < 7) : (i += 1) { cpu.tick(); } try expectEq(test_io.ram[1], 0x01); } try expectEq(cpu.total_t_cycles, 14 * 7); try expectEq(cpu.total_m_cycles, 14 * 2); }
tests/cpu/z80_tests.zig
const std = @import("std"); const debug = std.debug; const mem = std.mem; const fmt = std.fmt; const testing = std.testing; const heap = std.heap; const network = @import("network"); const IPv4 = network.Address.IPv4; const ArrayList = std.ArrayList; pub const BlockList = struct { const Self = @This(); blocked_addresses: ArrayList(IPv4), // @TODO: add support for IPv6 as well pub fn fromSlice(allocator: *mem.Allocator, slice: []const u8) !Self { var blocked_addresses = ArrayList(IPv4).init(allocator); var it = mem.split(slice, "\n"); while (it.next()) |line| { if (mem.eql(u8, line, "")) continue; const address = try addressFromSlice(line); try blocked_addresses.append(address); } return Self{ .blocked_addresses = blocked_addresses }; } pub fn isBlocked(self: Self, address: IPv4) bool { for (self.blocked_addresses.items) |blocked_address| { if (address.eql(blocked_address)) return true; } return false; } }; fn addressFromSlice(slice: []const u8) !IPv4 { var it = mem.split(slice, "."); const v1 = try fmt.parseUnsigned(u8, it.next() orelse return error.InvalidAddress, 10); const v2 = try fmt.parseUnsigned(u8, it.next() orelse return error.InvalidAddress, 10); const v3 = try fmt.parseUnsigned(u8, it.next() orelse return error.InvalidAddress, 10); const v4 = try fmt.parseUnsigned(u8, it.next() orelse return error.InvalidAddress, 10); return IPv4{ .value = [_]u8{ v1, v2, v3, v4 } }; } test "`addressFromSlice` returns valid IPv4 address from slice" { const expected_address = IPv4{ .value = [_]u8{ 127, 0, 0, 1 } }; const address = try addressFromSlice("127.0.0.1"); testing.expect(address.eql(expected_address)); const expected_address2 = IPv4{ .value = [_]u8{ 192, 168, 100, 5 } }; const address2 = try addressFromSlice("192.168.100.5"); testing.expect(address2.eql(expected_address2)); }
src/blocklist.zig
const std = @import("std"); const ImageCopyTexture = @import("structs.zig").ImageCopyTexture; const Extent3D = @import("data.zig").Extent3D; const CommandBuffer = @import("CommandBuffer.zig"); const Buffer = @import("Buffer.zig"); const Texture = @import("Texture.zig"); const Queue = @This(); on_submitted_work_done: ?WorkDoneCallback = null, /// The type erased pointer to the Queue implementation /// Equal to c.WGPUQueue for NativeInstance. ptr: *anyopaque, vtable: *const VTable, pub const VTable = struct { reference: fn (ptr: *anyopaque) void, release: fn (ptr: *anyopaque) void, // TODO: dawn specific? // copyTextureForBrowser: fn (ptr: *anyopaque, source: *const ImageCopyTexture, destination: *const ImageCopyTexture, copy_size: *const Extent3D, options: *const CopyTextureForBrowserOptions) void, submit: fn (queue: Queue, commands: []const CommandBuffer) void, writeBuffer: fn ( ptr: *anyopaque, buffer: Buffer, buffer_offset: u64, data: *const anyopaque, size: u64, ) void, writeTexture: fn ( ptr: *anyopaque, destination: *const ImageCopyTexture, data: *const anyopaque, data_size: usize, data_layout: *const Texture.DataLayout, write_size: *const Extent3D, ) void, }; pub inline fn reference(queue: Queue) void { queue.vtable.reference(queue.ptr); } pub inline fn release(queue: Queue) void { queue.vtable.release(queue.ptr); } pub inline fn submit(queue: Queue, commands: []const CommandBuffer) void { queue.vtable.submit(queue, commands); } pub inline fn writeBuffer(queue: Queue, buffer: Buffer, buffer_offset: u64, comptime T: type, data: []const T) void { queue.vtable.writeBuffer( queue.ptr, buffer, buffer_offset, @ptrCast(*const anyopaque, data.ptr), @intCast(u64, data.len) * @sizeOf(T), ); } pub inline fn writeTexture( queue: Queue, destination: *const ImageCopyTexture, data: anytype, data_layout: *const Texture.DataLayout, write_size: *const Extent3D, ) void { queue.vtable.writeTexture( queue.ptr, destination, @ptrCast(*const anyopaque, data.ptr), @intCast(u64, data.len) * @sizeOf(std.meta.Elem(@TypeOf(data))), data_layout, write_size, ); } pub const WorkDoneCallback = struct { type_erased_ctx: *anyopaque, type_erased_callback: fn (ctx: *anyopaque, status: WorkDoneStatus) callconv(.Inline) void, pub fn init( comptime Context: type, ctx: Context, comptime callback: fn (ctx: Context, status: WorkDoneStatus) void, ) WorkDoneCallback { const erased = (struct { pub inline fn erased(type_erased_ctx: *anyopaque, status: WorkDoneStatus) void { callback(if (Context == void) {} else @ptrCast(Context, @alignCast(std.meta.alignment(Context), type_erased_ctx)), status); } }).erased; return .{ .type_erased_ctx = if (Context == void) undefined else ctx, .type_erased_callback = erased, }; } }; pub const Descriptor = struct { label: ?[*:0]const u8 = null, }; pub const WorkDoneStatus = enum(u32) { Success = 0x00000000, Error = 0x00000001, Unknown = 0x00000002, DeviceLost = 0x00000003, Force32 = 0x7FFFFFFF, }; test { _ = VTable; _ = reference; _ = release; _ = submit; _ = writeBuffer; _ = writeTexture; _ = WorkDoneCallback; _ = WorkDoneStatus; }
libs/zgpu/src/mach-gpu/Queue.zig
const std = @import("std"); const core = @import("../index.zig"); const game_server = @import("../server/game_server.zig"); const Coord = core.geometry.Coord; const makeCoord = core.geometry.makeCoord; const Socket = core.protocol.Socket; const Request = core.protocol.Request; const Action = core.protocol.Action; const Response = core.protocol.Response; const Event = core.protocol.Event; const allocator = std.heap.c_allocator; const QueueToFdAdapter = struct { socket: Socket, send_thread: *std.Thread, recv_thread: *std.Thread, queues: *SomeQueues, pub fn init( self: *QueueToFdAdapter, in_stream: std.fs.File.InStream, out_stream: std.fs.File.OutStream, queues: *SomeQueues, ) !void { self.socket = Socket.init(in_stream, out_stream); self.queues = queues; self.send_thread = try std.Thread.spawn(self, sendMain); self.recv_thread = try std.Thread.spawn(self, recvMain); } pub fn wait(self: *QueueToFdAdapter) void { self.send_thread.wait(); self.recv_thread.wait(); } fn sendMain(self: *QueueToFdAdapter) void { core.debug.nameThisThread("client send"); defer core.debug.unnameThisThread(); core.debug.thread_lifecycle.print("init", .{}); defer core.debug.thread_lifecycle.print("shutdown", .{}); while (true) { const request = self.queues.waitAndTakeRequest() orelse { core.debug.thread_lifecycle.print("clean shutdown", .{}); break; }; self.socket.out().write(request) catch |err| { @panic("TODO: proper error handling"); }; } } fn recvMain(self: *QueueToFdAdapter) void { core.debug.nameThisThread("client recv"); defer core.debug.unnameThisThread(); core.debug.thread_lifecycle.print("init", .{}); defer core.debug.thread_lifecycle.print("shutdown", .{}); while (true) { const response = self.socket.in(allocator).read(Response) catch |err| { switch (err) { error.EndOfStream => { core.debug.thread_lifecycle.print("clean shutdown", .{}); break; }, else => @panic("TODO: proper error handling"), } }; self.queues.enqueueResponse(response) catch |err| { @panic("TODO: proper error handling"); }; } } }; pub const SomeQueues = struct { requests_alive: std.atomic.Int(u8), requests: std.atomic.Queue(Request), responses_alive: std.atomic.Int(u8), responses: std.atomic.Queue(Response), pub fn init(self: *SomeQueues) void { self.requests_alive = std.atomic.Int(u8).init(1); self.requests = std.atomic.Queue(Request).init(); self.responses_alive = std.atomic.Int(u8).init(1); self.responses = std.atomic.Queue(Response).init(); } pub fn closeRequests(self: *SomeQueues) void { self.requests_alive.set(0); } pub fn enqueueRequest(self: *SomeQueues, request: Request) !void { try queuePut(Request, &self.requests, request); } /// null means requests have been closed pub fn waitAndTakeRequest(self: *SomeQueues) ?Request { while (self.requests_alive.get() != 0) { if (queueGet(Request, &self.requests)) |response| { return response; } // :ResidentSleeper: std.time.sleep(17 * std.time.ns_per_ms); } return null; } pub fn closeResponses(self: *SomeQueues) void { self.responses_alive.set(0); } pub fn enqueueResponse(self: *SomeQueues, response: Response) !void { try queuePut(Response, &self.responses, response); } pub fn takeResponse(self: *SomeQueues) ?Response { return queueGet(Response, &self.responses); } /// null means responses have been closed pub fn waitAndTakeResponse(self: *SomeQueues) ?Response { while (self.responses_alive.get() != 0) { if (self.takeResponse()) |response| { return response; } // :ResidentSleeper: std.time.sleep(17 * std.time.ns_per_ms); } return null; } }; pub const ClientQueues = SomeQueues(Response, Request); pub const ServerQueues = SomeQueues(Request, Response); const Connection = union(enum) { child_process: ChildProcessData, thread: ThreadData, const ChildProcessData = struct { child_process: *std.ChildProcess, adapter: *QueueToFdAdapter, }; const ThreadData = struct { core_thread: *std.Thread, }; }; pub const GameEngineClient = struct { // initialized in startAs*() connection: Connection, // initialized in init() queues: SomeQueues, beat_level_macro_index: usize, fn init(self: *GameEngineClient) void { self.queues.init(); self.beat_level_macro_index = 0; } pub fn startAsChildProcess(self: *GameEngineClient) !void { self.init(); const dir = try std.fs.selfExeDirPathAlloc(allocator); defer allocator.free(dir); var path = try std.fs.path.join(allocator, [_][]const u8{ dir, "legend-of-swarkland_headless" }); defer allocator.free(path); self.connection = Connection{ .child_process = blk: { const args = [_][]const u8{path}; var child_process = try std.ChildProcess.init(args, allocator); child_process.stdout_behavior = std.ChildProcess.StdIo.Pipe; child_process.stdin_behavior = std.ChildProcess.StdIo.Pipe; try child_process.*.spawn(); const adapter = try allocator.create(QueueToFdAdapter); try adapter.init( child_process.*.stdout.?.inStream(), child_process.*.stdin.?.outStream(), &self.queues, ); break :blk Connection.ChildProcessData{ .child_process = child_process, .adapter = adapter, }; }, }; } pub fn startAsThread(self: *GameEngineClient) !void { self.init(); self.connection = Connection{ .thread = blk: { const LambdaPlease = struct { pub fn f(context: *SomeQueues) void { core.debug.nameThisThread("server thread"); defer core.debug.unnameThisThread(); core.debug.thread_lifecycle.print("init", .{}); defer core.debug.thread_lifecycle.print("shutdown", .{}); game_server.server_main(context) catch |err| { std.debug.warn("error: {}", .{@errorName(err)}); if (@errorReturnTrace()) |trace| { std.debug.dumpStackTrace(trace.*); } @panic(""); }; } }; break :blk Connection.ThreadData{ .core_thread = try std.Thread.spawn(&self.queues, LambdaPlease.f), }; }, }; } pub fn stopEngine(self: *GameEngineClient) void { core.debug.thread_lifecycle.print("close", .{}); self.queues.closeRequests(); switch (self.connection) { .child_process => |*data| { data.child_process.stdin.?.close(); // FIXME: workaround for wait() trying to close already closed fds data.child_process.stdin = null; core.debug.thread_lifecycle.print("join adapter threads", .{}); data.adapter.wait(); core.debug.thread_lifecycle.print("join child process", .{}); _ = data.child_process.wait() catch undefined; }, .thread => |*data| { data.core_thread.wait(); }, } core.debug.thread_lifecycle.print("all threads done", .{}); } pub fn act(self: *GameEngineClient, action: Action) !void { try self.queues.enqueueRequest(Request{ .act = action }); switch (action) { .wait => core.debug.record_macro.print("Request{{ .act = Action{{ .wait = {{}} }} }},", .{}), .move => |move_delta| core.debug.record_macro.print("Request{{ .act = Action{{ .move = makeCoord({}, {}) }} }},", .{ move_delta.x, move_delta.y }), .fast_move => |move_delta| core.debug.record_macro.print("Request{{ .act = Action{{ .fast_move = makeCoord({}, {}) }} }},", .{ move_delta.x, move_delta.y }), .attack => |direction| core.debug.record_macro.print("Request{{ .act = Action{{ .attack = makeCoord({}, {}) }} }},", .{ direction.x, direction.y }), .kick => |direction| core.debug.record_macro.print("Request{{ .act = Action{{ .kick = makeCoord({}, {}) }} }},", .{ direction.x, direction.y }), } } pub fn rewind(self: *GameEngineClient) !void { try self.queues.enqueueRequest(Request{ .rewind = {} }); core.debug.record_macro.print("Request{{ .rewind = {{}} }},", .{}); } pub fn beatLevelMacro(self: *GameEngineClient) !void { const requests: []const Request = switch (self.beat_level_macro_index) { 0 => comptime &[_]Request{ Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .attack = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .attack = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, }, 1 => comptime &[_]Request{ Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .attack = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .attack = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .attack = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .attack = makeCoord(1, 0) } }, Request{ .act = Action{ .attack = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .attack = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, }, 2 => comptime &[_]Request{ Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .kick = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .kick = makeCoord(1, 0) } }, Request{ .act = Action{ .kick = makeCoord(1, 0) } }, Request{ .act = Action{ .kick = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .kick = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, }, 3 => comptime &[_]Request{ Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, }, 4 => comptime &[_]Request{ Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .attack = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, }, 5 => comptime &[_]Request{ Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .attack = makeCoord(-1, 0) } }, Request{ .act = Action{ .attack = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, }, 6 => comptime &[_]Request{ Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .kick = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .kick = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, }, 7 => comptime &[_]Request{ Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .kick = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .kick = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .attack = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .attack = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, }, 8 => comptime &[_]Request{ Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .attack = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, }, 9 => comptime &[_]Request{ Request{ .act = Action{ .attack = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .attack = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .attack = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, }, 10 => comptime &[_]Request{ Request{ .act = Action{ .kick = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .attack = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .attack = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, }, 11 => comptime &[_]Request{ Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .attack = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .attack = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .attack = makeCoord(1, 0) } }, Request{ .act = Action{ .attack = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .attack = makeCoord(-1, 0) } }, Request{ .act = Action{ .attack = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, }, 12 => comptime &[_]Request{ Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .attack = makeCoord(1, 0) } }, Request{ .act = Action{ .attack = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, }, 13 => comptime &[_]Request{ Request{ .act = Action{ .attack = makeCoord(0, 1) } }, Request{ .act = Action{ .attack = makeCoord(0, 1) } }, Request{ .act = Action{ .attack = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .attack = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .attack = makeCoord(-1, 0) } }, Request{ .act = Action{ .attack = makeCoord(-1, 0) } }, Request{ .act = Action{ .attack = makeCoord(-1, 0) } }, Request{ .act = Action{ .attack = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .attack = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, }, 14 => comptime &[_]Request{ Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(-1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(0, -1) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(1, 0) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, Request{ .act = Action{ .move = makeCoord(0, 1) } }, }, else => &[_]Request{}, }; for (requests) |request| { try self.queues.enqueueRequest(request); } self.beat_level_macro_index += 1; } pub fn move(self: *GameEngineClient, direction: Coord) !void { return self.act(Action{ .move = direction }); } pub fn attack(self: *GameEngineClient, direction: Coord) !void { return self.act(Action{ .attack = direction }); } pub fn kick(self: *GameEngineClient, direction: Coord) !void { return self.act(Action{ .kick = direction }); } }; fn queuePut(comptime T: type, queue: *std.atomic.Queue(T), x: T) !void { const Node = std.atomic.Queue(T).Node; const node: *Node = try allocator.create(Node); node.data = x; queue.put(node); } fn queueGet(comptime T: type, queue: *std.atomic.Queue(T)) ?T { const Node = std.atomic.Queue(T).Node; const node: *Node = queue.get() orelse return null; defer allocator.destroy(node); const hack = node.data; // TODO: https://github.com/ziglang/zig/issues/961 return hack; } test "basic interaction" { // init core.debug.init(); core.debug.nameThisThread("test main"); defer core.debug.unnameThisThread(); core.debug.testing.print("start test", .{}); defer core.debug.testing.print("exit test", .{}); var _client: GameEngineClient = undefined; var client = &_client; try client.startAsThread(); defer client.stopEngine(); const startup_response = client.queues.waitAndTakeResponse().?; std.testing.expect(startup_response.load_state.self.rel_position.equals(makeCoord(0, 0))); core.debug.testing.print("startup done", .{}); // move try client.move(makeCoord(1, 0)); { const response = client.queues.waitAndTakeResponse().?; const frames = response.stuff_happens.frames; std.testing.expect(frames[frames.len - 1].self.rel_position.equals(makeCoord(0, 0))); } core.debug.testing.print("move looks good", .{}); // rewind try client.rewind(); { const response = client.queues.waitAndTakeResponse().?; const new_position = response.load_state.self.rel_position; std.testing.expect(response.load_state.self.rel_position.equals(makeCoord(0, 0))); } core.debug.testing.print("rewind looks good", .{}); }
src/client/game_engine_client.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const builtin = @import("builtin"); const c = @import("c.zig"); const gui = @import("gui"); const nvg = @import("nanovg"); const geometry = @import("gui/geometry.zig"); const Point = geometry.Point; const Rect = geometry.Rect; const info = @import("info.zig"); const AboutDialogWidget = @This(); widget: gui.Widget, allocator: Allocator, close_button: *gui.Button, const Self = @This(); const dialog_rect = Rect(f32).make(0, 0, 260, 240); pub fn init(allocator: Allocator) !*Self { var self = try allocator.create(Self); self.* = Self{ .widget = gui.Widget.init(allocator, dialog_rect), .allocator = allocator, .close_button = try gui.Button.init(allocator, Rect(f32).make((dialog_rect.w - 80) / 2, dialog_rect.h - 25 - 10, 80, 25), "Close"), }; self.widget.onMouseMoveFn = onMouseMove; self.widget.onMouseDownFn = onMouseDown; self.widget.onKeyDownFn = onKeyDown; self.close_button.onClickFn = onCloseButtonClick; try self.widget.addChild(&self.close_button.widget); self.widget.drawFn = draw; return self; } pub fn deinit(self: *Self) void { self.close_button.deinit(); self.widget.deinit(); self.allocator.destroy(self); } var link_itchio_bounds: [4]f32 = undefined; var link_itchio_hover: bool = false; var link_github_bounds: [4]f32 = undefined; var link_github_hover: bool = false; fn onMouseDown(widget: *gui.Widget, mouse_event: *gui.MouseEvent) void { _ = widget; if (mouse_event.button == .left) { const open_cmd = switch (builtin.os.tag) { .macos => "open ", .linux => "xdg-open ", .windows => "start ", else => @compileError("Unsupported OS"), }; if (link_itchio_hover) { _ = c.system(open_cmd ++ info.link_itchio); } if (link_github_hover) { _ = c.system(open_cmd ++ info.link_github); } } } fn onMouseMove(widget: *gui.Widget, mouse_event: *gui.MouseEvent) void { var self = @fieldParentPtr(Self, "widget", widget); _ = self; const link_itchio_rect = Rect(f32).make( link_itchio_bounds[0], link_itchio_bounds[1], link_itchio_bounds[2] - link_itchio_bounds[0], link_itchio_bounds[3] - link_itchio_bounds[1], ); link_itchio_hover = link_itchio_rect.contains(Point(f32).make(mouse_event.x, mouse_event.y)); const link_github_rect = Rect(f32).make( link_github_bounds[0], link_github_bounds[1], link_github_bounds[2] - link_github_bounds[0], link_github_bounds[3] - link_github_bounds[1], ); link_github_hover = link_github_rect.contains(Point(f32).make(mouse_event.x, mouse_event.y)); } fn onKeyDown(widget: *gui.Widget, event: *gui.KeyEvent) void { var self = @fieldParentPtr(Self, "widget", widget); switch (event.key) { .Return, .Escape => self.close(), else => event.event.ignore(), } } fn onCloseButtonClick(button: *gui.Button) void { if (button.widget.parent) |parent| { var self = @fieldParentPtr(Self, "widget", parent); self.close(); } } fn close(self: *Self) void { if (self.widget.getWindow()) |window| { window.close(); } } pub fn draw(widget: *gui.Widget, vg: nvg) void { vg.save(); defer vg.restore(); vg.beginPath(); vg.rect(0, 0, dialog_rect.w, dialog_rect.h - 45); vg.fillColor(nvg.rgbf(1, 1, 1)); vg.fill(); vg.beginPath(); vg.rect(0, dialog_rect.h - 45, dialog_rect.w, 45); vg.fillColor(gui.theme_colors.background); vg.fill(); var bounds: [4]f32 = undefined; _ = vg.textBounds(0, 0, info.link_itchio, &bounds); const link_color = nvg.rgb(0x1A, 0x6F, 0xA1); vg.fillColor(nvg.rgb(0, 0, 0)); vg.textAlign(.{ .horizontal = .center }); vg.fontFace("guifontbold"); vg.fontSize(14); _ = vg.text(dialog_rect.w / 2, 35, info.app_name); vg.fontFace("guifont"); vg.fontSize(11); _ = vg.text(dialog_rect.w / 2, 50, "Version " ++ info.version); vg.fontSize(12); vg.textAlign(.{}); var w = vg.textBounds(0, 0, "Visit " ++ info.link_itchio, null); var x = (dialog_rect.w - w) / 2; x = vg.text(x, 80, "Visit "); vg.fillColor(link_color); var x1 = vg.text(x, 80, info.link_itchio); _ = vg.textBounds(x, 80, info.link_itchio, &link_itchio_bounds); if (link_itchio_hover) { vg.beginPath(); vg.moveTo(x, 81); vg.lineTo(x1, 81); vg.strokeColor(link_color); vg.stroke(); } vg.fillColor(nvg.rgb(0, 0, 0)); vg.textAlign(.{ .horizontal = .center }); _ = vg.text(dialog_rect.w / 2, 80 + 1 * 15, "for more information and updates."); _ = vg.text(dialog_rect.w / 2, 80 + 2 * 15, "To report a bug or to suggest a new feature"); vg.textAlign(.{}); w = vg.textBounds(0, 0, "visit " ++ info.link_github ++ ".", null); x = (dialog_rect.w - w) / 2; x = vg.text(x, 80 + 3 * 15, "visit "); vg.fillColor(link_color); x1 = vg.text(x, 80 + 3 * 15, info.link_github); _ = vg.textBounds(x, 80 + 3 * 15, info.link_github, &link_github_bounds); if (link_github_hover) { vg.beginPath(); vg.moveTo(x, 81 + 3 * 15); vg.lineTo(x1, 81 + 3 * 15); vg.strokeColor(link_color); vg.stroke(); } vg.fillColor(nvg.rgb(0, 0, 0)); vg.textAlign(.{ .horizontal = .center }); _ = vg.text(x1 + 1, 80 + 3 * 15, "."); vg.fontSize(11); _ = vg.text(dialog_rect.w / 2, 160, "Copyright © 2021-2022 <NAME>."); _ = vg.text(dialog_rect.w / 2, 173, "All rights reserved."); widget.drawChildren(vg); }
src/AboutDialogWidget.zig
const interrupt = @import("interrupt.zig"); const isr = @import("isr.zig"); const ipc = @import("ipc.zig"); const layout = @import("layout.zig"); const scheduler = @import("scheduler.zig"); const process = @import("process.zig"); const tty = @import("tty.zig"); const vmem = @import("vmem.zig"); const x86 = @import("x86.zig"); const TypeId = @import("builtin").TypeId; // Registered syscall handlers. pub var handlers = []fn()void { SYSCALL(exit), // 0 SYSCALL(ipc.send), // 1 SYSCALL(ipc.receive), // 2 SYSCALL(interrupt.subscribeIRQ), // 3 SYSCALL(x86.inb), // 4 SYSCALL(x86.outb), // 5 SYSCALL(map), // 6 SYSCALL(createThread), // 7 }; //// // Transform a normal function (with standard calling convention) into // a syscall handler, which takes parameters from the context of the // user thread that called it. Handles return values as well. // // Arguments: // function: The function to be transformed into a syscall. // // Returns: // A syscall handler that wraps the given function. // fn SYSCALL(comptime function: var) fn()void { const signature = @typeOf(function); return struct { // Return the n-th argument passed to the function. fn arg(comptime n: u8) @ArgType(signature, n) { return getArg(n, @ArgType(signature, n)); } // Wrapper. fn syscall() void { // Fetch the right number of arguments and call the function. const result = switch (signature.arg_count) { 0 => function(), 1 => function(arg(0)), 2 => function(arg(0), arg(1)), 3 => function(arg(0), arg(1), arg(2)), 4 => function(arg(0), arg(1), arg(2), arg(3)), 5 => function(arg(0), arg(1), arg(2), arg(3), arg(4)), 6 => function(arg(0), arg(1), arg(2), arg(3), arg(4), arg(5)), else => unreachable }; // Handle the return value if present. if (@typeOf(result) != void) { isr.context.setReturnValue(result); } } }.syscall; } //// // Fetch the n-th syscall argument of type T from the caller context. // // Arguments: // n: Argument index. // T: Argument type. // // Returns: // The syscall argument casted to the requested type. // inline fn getArg(comptime n: u8, comptime T: type) T { const value = switch (n) { 0 => isr.context.registers.ecx, 1 => isr.context.registers.edx, 2 => isr.context.registers.ebx, 3 => isr.context.registers.esi, 4 => isr.context.registers.edi, 5 => isr.context.registers.ebp, else => unreachable }; if (T == bool) { return value != 0; } else if (@typeId(T) == TypeId.Pointer) { // TODO: validate this pointer. return @intToPtr(T, value); } else { return @intCast(T, value); } // TODO: validate pointers, handle other types. } //// // Exit the current process. // // Arguments: // status: Exit status code. // inline fn exit(status: usize) void { // TODO: handle return status. scheduler.current_process.destroy(); } //// // Create a new thread in the current process. // // Arguments: // entry_point: The entry point of the new thread. // // Returns: // The TID of the new thread. // inline fn createThread(entry_point: usize) u16 { const thread = scheduler.current_process.createThread(entry_point); return thread.tid; } //// // Wrap vmem.mapZone to expose it as a syscall for servers. // // Arguments: // v_addr: Virtual address of the page to be mapped. // p_addr: Physical address to map the page to. // flags: Paging flags (protection etc.). // // Returns: // true if the mapping was successful, false otherwise. // inline fn map(v_addr: usize, p_addr: usize, size: usize, writable: bool) bool { // TODO: Only servers can call this. // TODO: Validate p_addr. if (v_addr < layout.USER) return false; var flags: u32 = vmem.PAGE_USER; if (writable) flags |= vmem.PAGE_WRITE; vmem.mapZone(v_addr, p_addr, size, flags); return true; // TODO: Return error codes. } //// // Handle the call of an invalid syscall. // pub fn invalid() noreturn { const n = isr.context.registers.eax; tty.panic("invalid syscall number {d}", n); // TODO: kill the current process and go on. }
kernel/syscall.zig
const std = @import("std"); const fmt = std.fmt; const mem = std.mem; const sort = std.sort.sort; const unicode = std.unicode; const isAsciiStr = @import("../ascii.zig").isAsciiStr; const canonicals = @import("../ziglyph.zig").canonicals; const case_fold_map = @import("../ziglyph.zig").case_fold_map; const ccc_map = @import("../ziglyph.zig").combining_map; const hangul_map = @import("../ziglyph.zig").hangul_map; const norm_props = @import("../ziglyph.zig").derived_normalization_props; pub const DecompFile = @import("DecompFile.zig"); const Decomp = DecompFile.Decomp; const Trieton = @import("Trieton.zig"); const Lookup = Trieton.Lookup; allocator: *mem.Allocator, arena: std.heap.ArenaAllocator, decomp_trie: Trieton, const Self = @This(); pub fn init(allocator: *mem.Allocator) !Self { var self = Self{ .allocator = allocator, .arena = std.heap.ArenaAllocator.init(allocator), .decomp_trie = Trieton.init(allocator), }; const decompositions = @embedFile("../data/ucd/Decompositions.bin"); var reader = std.io.fixedBufferStream(decompositions).reader(); var file = try DecompFile.decompress(allocator, reader); defer file.deinit(); while (file.next()) |entry| { try self.decomp_trie.add(entry.key[0..entry.key_len], entry.value); } return self; } pub fn deinit(self: *Self) void { self.decomp_trie.deinit(); self.arena.deinit(); } var cp_buf: [4]u8 = undefined; /// `mapping` retrieves the decomposition mapping for a code point as per the UCD. pub fn mapping(self: Self, cp: u21, nfd: bool) Decomp { const len = unicode.utf8Encode(cp, &cp_buf) catch |err| { std.debug.print("Normalizer.mapping: error encoding UTF-8 for 0x{x}; {}\n", .{ cp, err }); std.os.exit(1); }; const lookup = self.decomp_trie.find(cp_buf[0..len]); if (lookup) |l| { // Got an entry. if (l.index == len - 1) { // Full match. if (nfd and l.value.form == .compat) { return Decomp{ .form = .same, .len = 1, .seq = [_]u21{ cp, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; } else { return l.value; } } } return Decomp{ .form = .same, .len = 1, .seq = [_]u21{ cp, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; } /// `decompose` takes a code point and returns its decomposition to NFD if `nfd` is true, NFKD otherwise. pub fn decompose(self: Self, cp: u21, nfd: bool) Decomp { var dc = Decomp{}; if (nfd and norm_props.isNfd(cp)) { dc.len = 1; dc.seq[0] = cp; return dc; } if (isHangulPrecomposed(cp)) { // Hangul precomposed syllable full decomposition. const seq = decomposeHangul(cp); dc.len = if (seq[2] == 0) 2 else 3; mem.copy(u21, &dc.seq, seq[0..dc.len]); return dc; } if (!nfd) dc.form = .compat; var result_index: usize = 0; var work: [18]u21 = undefined; var work_index: usize = 1; work[0] = cp; while (work_index > 0) { work_index -= 1; const next = work[work_index]; const m = self.mapping(next, nfd); if (m.form == .same) { dc.seq[result_index] = m.seq[0]; result_index += 1; continue; } var i: usize = m.len - 1; while (true) { work[work_index] = m.seq[i]; work_index += 1; if (i == 0) break; i -= 1; } } dc.len = result_index; return dc; } fn getCodePoints(self: *Self, str: []const u8) ![]u21 { var code_points = std.ArrayList(u21).init(&self.arena.allocator); var iter = (try unicode.Utf8View.init(str)).iterator(); while (iter.nextCodepoint()) |cp| { try code_points.append(cp); } return code_points.items; } /// `Form` represents the Unicode Normalization Form. const Form = enum { canon, // NFD: Canonical Decomposed. compat, // NFKD: Compatibility Decomposed. same, // Just the same code point. composed, // NFC: Canonical Composed. komposed, // NFKC: Compatibility Decomposed. }; /// `normalizeTo` will normalize the code points in str, producing a slice of u8 with the new bytes /// corresponding to the specified Normalization Form. pub fn normalizeTo(self: *Self, form: Form, str: []const u8) anyerror![]u8 { const code_points = try self.getCodePoints(str); return self.normalizeCodePointsTo(form, code_points); } fn normalizeCodePointsTo(self: *Self, form: Form, code_points: []u21) anyerror![]u8 { const d_code_points = try self.normalizeCodePointsToCodePoints(form, code_points); //var result = try std.ArrayList(u8).initCapacity(&self.arena.allocator, code_points.len * 4); var result = std.ArrayList(u8).init(&self.arena.allocator); var buf: [4]u8 = undefined; // Encode as UTF-8 bytes. for (d_code_points) |dcp| { const len = try unicode.utf8Encode(dcp, &buf); //result.appendSliceAssumeCapacity(buf[0..len]); try result.appendSlice(buf[0..len]); } return result.items; } /// `normalizeToCodePoints` will normalize the code points in str, producing a new slice of code points /// corresponding to the specified Normalization Form. pub fn normalizeToCodePoints(self: *Self, form: Form, str: []const u8) anyerror![]u21 { var code_points = try self.getCodePoints(str); return self.normalizeCodePointsToCodePoints(form, code_points); } /// `normalizeCodePointsToCodePoints` receives code points and returns normalized code points. pub fn normalizeCodePointsToCodePoints(self: *Self, form: Form, code_points: []u21) anyerror![]u21 { if (form == .composed or form == .komposed) return self.composeCodePoints(form, code_points); // NFD Quick Check. if (form == .canon) { const already_nfd = for (code_points) |cp| { if (!norm_props.isNfd(cp)) break false; } else true; if (already_nfd) { // Apply canonical sort algorithm. canonicalSort(code_points); return code_points; } } var d_code_points = std.ArrayList(u21).init(&self.arena.allocator); // Gather decomposed code points. for (code_points) |cp| { const dc = self.decompose(cp, form == .canon); try d_code_points.appendSlice(dc.seq[0..dc.len]); } // Apply canonical sort algorithm. canonicalSort(d_code_points.items); return d_code_points.items; } /// `composeCodePoints` returns the composed form of `code_points`. pub fn composeCodePoints(self: *Self, form: Form, code_points: []u21) anyerror![]u21 { var decomposed = if (form == .composed) try self.normalizeCodePointsToCodePoints(.canon, code_points) else try self.normalizeCodePointsToCodePoints(.compat, code_points); while (true) { var deleted: usize = 0; var i: usize = 1; // start at second code point. block_check: while (i < decomposed.len) : (i += 1) { const C = decomposed[i]; var starter_index: ?usize = null; var j: usize = i; while (true) { j -= 1; if (ccc_map.combiningClass(decomposed[j]) == 0) { if (i - j > 1) { for (decomposed[(j + 1)..i]) |B| { if (isHangul(C)) { if (isCombining(B) or isNonHangulStarter(B)) continue :block_check; } if (ccc_map.combiningClass(B) >= ccc_map.combiningClass(C)) continue :block_check; } } starter_index = j; break; } if (j == 0) break; } if (starter_index) |sidx| { const L = decomposed[sidx]; var processed_hangul: bool = false; if (isHangul(L) and isHangul(C)) { const l_stype = hangul_map.syllableType(L).?; const c_stype = hangul_map.syllableType(C).?; if (l_stype == .LV and c_stype == .T) { // LV, T decomposed[sidx] = composeHangulCanon(L, C); decomposed[i] = 0xFFFD; processed_hangul = true; } if (l_stype == .L and c_stype == .V) { // Handle L, V. L, V, T is handled via main loop. decomposed[sidx] = composeHangulFull(L, C, 0); decomposed[i] = 0xFFFD; processed_hangul = true; } if (processed_hangul) deleted += 1; } if (!processed_hangul) { // Not Hangul. if (canonicals.composite(L, C)) |P| { if (!norm_props.isFcx(P)) { decomposed[sidx] = P; decomposed[i] = 0xFFFD; // Mark as deleted. deleted += 1; } } } } } if (deleted == 0) return decomposed; var composed = try std.ArrayList(u21).initCapacity(&self.arena.allocator, decomposed.len - deleted); for (decomposed) |cp| { if (cp != 0xFFFD) composed.appendAssumeCapacity(cp); } decomposed = composed.items; } } fn cccLess(_: void, lhs: u21, rhs: u21) bool { return ccc_map.combiningClass(lhs) < ccc_map.combiningClass(rhs); } fn canonicalSort(cp_list: []u21) void { var i: usize = 0; while (true) { if (i >= cp_list.len) break; var start: usize = i; while (i < cp_list.len and ccc_map.combiningClass(cp_list[i]) != 0) : (i += 1) {} sort(u21, cp_list[start..i], {}, cccLess); i += 1; } } // Hangul Syllable constants. const SBase: u21 = 0xAC00; const LBase: u21 = 0x1100; const VBase: u21 = 0x1161; const TBase: u21 = 0x11A7; const LCount: u21 = 19; const VCount: u21 = 21; const TCount: u21 = 28; const NCount: u21 = 588; // VCount * TCount const SCount: u21 = 11172; // LCount * NCount fn composeHangulCanon(lv: u21, t: u21) u21 { std.debug.assert(0x11A8 <= t and t <= 0x11C2); return lv + (t - TBase); } fn composeHangulFull(l: u21, v: u21, t: u21) u21 { std.debug.assert(0x1100 <= l and l <= 0x1112); std.debug.assert(0x1161 <= v and v <= 0x1175); const LIndex = l - LBase; const VIndex = v - VBase; const LVIndex = LIndex * NCount + VIndex * TCount; if (t == 0) return SBase + LVIndex; std.debug.assert(0x11A8 <= t and t <= 0x11C2); const TIndex = t - TBase; return SBase + LVIndex + TIndex; } fn decomposeHangul(cp: u21) [3]u21 { const SIndex: u21 = cp - SBase; const LIndex: u21 = SIndex / NCount; const VIndex: u21 = (SIndex % NCount) / TCount; const TIndex: u21 = SIndex % TCount; const LPart: u21 = LBase + LIndex; const VPart: u21 = VBase + VIndex; var TPart: u21 = 0; if (TIndex != 0) TPart = TBase + TIndex; return [3]u21{ LPart, VPart, TPart }; } fn isHangulPrecomposed(cp: u21) bool { if (hangul_map.syllableType(cp)) |kind| { return switch (kind) { .LV, .LVT => true, else => false, }; } else { return false; } } fn isHangul(cp: u21) bool { return hangul_map.syllableType(cp) != null; } fn isStarter(cp: u21) bool { return ccc_map.combiningClass(cp) == 0; } fn isCombining(cp: u21) bool { return ccc_map.combiningClass(cp) > 0; } fn isNonHangulStarter(cp: u21) bool { return !isHangul(cp) and isStarter(cp); } /// `CmpMode` determines the type of comparison to be performed. /// * ident compares Unicode Identifiers for caseless matching. /// * ignore_case compares ignoring letter case. /// * normalize compares the result of normalizing to canonical form (NFD). /// * norm_ignore combines both ignore_case and normalize modes. pub const CmpMode = enum { ident, ignore_case, normalize, norm_ignore, }; /// `eqlBy` compares for equality between `a` and `b` according to the specified comparison mode. pub fn eqlBy(self: *Self, a: []const u8, b: []const u8, mode: CmpMode) !bool { // Empty string quick check. if (a.len == 0 and b.len == 0) return true; if (a.len == 0 and b.len != 0) return false; if (b.len == 0 and a.len != 0) return false; // Check for ASCII only comparison. var ascii_only = try isAsciiStr(a); if (ascii_only) { ascii_only = try isAsciiStr(b); } // If ASCII only, different lengths mean inequality. const len_a = a.len; const len_b = b.len; var len_eql = len_a == len_b; if (ascii_only and !len_eql) return false; if ((mode == .ignore_case or mode == .ident) and len_eql) { if (ascii_only) { // ASCII case insensitive. for (a) |c, i| { const oc = b[i]; const lc = if (c >= 'A' and c <= 'Z') c ^ 32 else c; const olc = if (oc >= 'A' and oc <= 'Z') oc ^ 32 else oc; if (lc != olc) return false; } return true; } // Non-ASCII case insensitive. return if (mode == .ident) self.eqlIdent(a, b) else self.eqlNormIgnore(a, b); } return switch (mode) { .ident => self.eqlIdent(a, b), .normalize => self.eqlNorm(a, b), .norm_ignore => self.eqlNormIgnore(a, b), else => false, }; } fn eqlIdent(self: *Self, a: []const u8, b: []const u8) !bool { const a_cps = try self.getCodePoints(a); var a_cf = std.ArrayList(u21).init(&self.arena.allocator); for (a_cps) |cp| { const cf_s = norm_props.toNfkcCaseFold(cp); if (cf_s.len == 0) { // Same code point. "" try a_cf.append(cp); } else if (cf_s.len == 1) { // Map to nothing. "0" continue; } else { // Got list; parse it. "x,y,z..." var fields = mem.split(u8, cf_s, ","); while (fields.next()) |field| { const parsed_cp = try std.fmt.parseInt(u21, field, 16); try a_cf.append(parsed_cp); } } } const b_cps = try self.getCodePoints(b); var b_cf = std.ArrayList(u21).init(&self.arena.allocator); for (b_cps) |cp| { const cf_s = norm_props.toNfkcCaseFold(cp); if (cf_s.len == 0) { // Same code point. "" try b_cf.append(cp); } else if (cf_s.len == 1) { // Map to nothing. "0" continue; } else { // Got list; parse it. "x,y,z..." var fields = mem.split(u8, cf_s, ","); while (fields.next()) |field| { const parsed_cp = try std.fmt.parseInt(u21, field, 16); try b_cf.append(parsed_cp); } } } return mem.eql(u21, a_cf.items, b_cf.items); } fn eqlNorm(self: *Self, a: []const u8, b: []const u8) !bool { const norm_a = try self.normalizeTo(.canon, a); const norm_b = try self.normalizeTo(.canon, b); return mem.eql(u8, norm_a, norm_b); } fn requiresNfdBeforeCaseFold(cp: u21) bool { return switch (cp) { 0x0345 => true, 0x1F80...0x1FAF => true, 0x1FB2...0x1FB4 => true, 0x1FB7 => true, 0x1FBC => true, 0x1FC2...0x1FC4 => true, 0x1FC7 => true, 0x1FCC => true, 0x1FF2...0x1FF4 => true, 0x1FF7 => true, 0x1FFC => true, else => false, }; } fn requiresPreNfd(code_points: []const u21) bool { return for (code_points) |cp| { if (requiresNfdBeforeCaseFold(cp)) break true; } else false; } fn eqlNormIgnore(self: *Self, a: []const u8, b: []const u8) !bool { const code_points_a = try self.getCodePoints(a); const code_points_b = try self.getCodePoints(b); // The long winding road of normalized caseless matching... // NFD(CaseFold(NFD(str))) or NFD(CaseFold(str)) var norm_a = if (requiresPreNfd(code_points_a)) try self.normalizeCodePointsTo(.canon, code_points_a) else a; var cf_a = try case_fold_map.caseFoldStr(&self.arena.allocator, norm_a); norm_a = try self.normalizeTo(.canon, cf_a); var norm_b = if (requiresPreNfd(code_points_b)) try self.normalizeCodePointsTo(.canon, code_points_b) else b; var cf_b = try case_fold_map.caseFoldStr(&self.arena.allocator, norm_b); norm_b = try self.normalizeTo(.canon, cf_b); return mem.eql(u8, norm_a, norm_b); } test "Normalizer decompose D" { var allocator = std.testing.allocator; var normalizer = try init(allocator); defer normalizer.deinit(); var result = normalizer.decompose('\u{00E9}', true); try std.testing.expectEqual(result.seq[0], 0x0065); try std.testing.expectEqual(result.seq[1], 0x0301); result = normalizer.decompose('\u{03D3}', true); try std.testing.expectEqual(result.seq[0], 0x03D2); try std.testing.expectEqual(result.seq[1], 0x0301); } test "Normalizer decompose KD" { var allocator = std.testing.allocator; var normalizer = try init(allocator); defer normalizer.deinit(); var result = normalizer.decompose('\u{00E9}', false); try std.testing.expectEqual(result.seq[0], 0x0065); try std.testing.expectEqual(result.seq[1], 0x0301); result = normalizer.decompose('\u{03D3}', false); try std.testing.expectEqual(result.seq[0], 0x03A5); try std.testing.expectEqual(result.seq[1], 0x0301); } test "Normalizer normalizeTo" { var path_buf: [1024]u8 = undefined; var path = try std.fs.cwd().realpath(".", &path_buf); // Check if testing in this library path. if (!mem.endsWith(u8, path, "ziglyph")) return; var arena = std.heap.ArenaAllocator.init(std.testing.allocator); defer arena.deinit(); var allocator = &arena.allocator; var normalizer = try init(allocator); defer normalizer.deinit(); var file = try std.fs.cwd().openFile("src/data/ucd/NormalizationTest.txt", .{}); defer file.close(); var buf_reader = std.io.bufferedReader(file.reader()); var input_stream = buf_reader.reader(); var line_no: usize = 0; var buf: [4096]u8 = undefined; while (try input_stream.readUntilDelimiterOrEof(&buf, '\n')) |line| { line_no += 1; // Skip comments or empty lines. if (line.len == 0 or line[0] == '#' or line[0] == '@') continue; //std.debug.print("{}: {s}\n", .{ line_no, line }); // Iterate over fields. var fields = mem.split(u8, line, ";"); var field_index: usize = 0; var input: []u8 = undefined; while (fields.next()) |field| : (field_index += 1) { if (field_index == 0) { var i_buf = std.ArrayList(u8).init(allocator); defer i_buf.deinit(); var i_fields = mem.split(u8, field, " "); while (i_fields.next()) |s| { const icp = try std.fmt.parseInt(u21, s, 16); const len = try unicode.utf8Encode(icp, &cp_buf); try i_buf.appendSlice(cp_buf[0..len]); } input = i_buf.toOwnedSlice(); } else if (field_index == 1) { // NFC, time to test. var w_buf = std.ArrayList(u8).init(allocator); defer w_buf.deinit(); var w_fields = mem.split(u8, field, " "); while (w_fields.next()) |s| { const wcp = try std.fmt.parseInt(u21, s, 16); const len = try unicode.utf8Encode(wcp, &cp_buf); try w_buf.appendSlice(cp_buf[0..len]); } const want = w_buf.items; const got = try normalizer.normalizeTo(.composed, input); try std.testing.expectEqualSlices(u8, want, got); } else if (field_index == 2) { // NFD, time to test. var w_buf = std.ArrayList(u8).init(allocator); defer w_buf.deinit(); var w_fields = mem.split(u8, field, " "); while (w_fields.next()) |s| { const wcp = try std.fmt.parseInt(u21, s, 16); const len = try unicode.utf8Encode(wcp, &cp_buf); try w_buf.appendSlice(cp_buf[0..len]); } const want = w_buf.items; const got = try normalizer.normalizeTo(.canon, input); try std.testing.expectEqualSlices(u8, want, got); } else if (field_index == 3) { // NFKC, time to test. var w_buf = std.ArrayList(u8).init(allocator); defer w_buf.deinit(); var w_fields = mem.split(u8, field, " "); while (w_fields.next()) |s| { const wcp = try std.fmt.parseInt(u21, s, 16); const len = try unicode.utf8Encode(wcp, &cp_buf); try w_buf.appendSlice(cp_buf[0..len]); } const want = w_buf.items; const got = try normalizer.normalizeTo(.komposed, input); try std.testing.expectEqualSlices(u8, want, got); } else if (field_index == 4) { // NFKD, time to test. var w_buf = std.ArrayList(u8).init(allocator); defer w_buf.deinit(); var w_fields = mem.split(u8, field, " "); while (w_fields.next()) |s| { const wcp = try std.fmt.parseInt(u21, s, 16); const len = try unicode.utf8Encode(wcp, &cp_buf); try w_buf.appendSlice(cp_buf[0..len]); } const want = w_buf.items; const got = try normalizer.normalizeTo(.compat, input); try std.testing.expectEqualSlices(u8, want, got); } else { continue; } } } } test "Normalizer eqlBy" { var allocator = std.testing.allocator; var normalizer = try init(allocator); defer normalizer.deinit(); try std.testing.expect(try normalizer.eqlBy("foé", "foe\u{0301}", .normalize)); try std.testing.expect(try normalizer.eqlBy("foϓ", "fo\u{03D2}\u{0301}", .normalize)); try std.testing.expect(try normalizer.eqlBy("Foϓ", "fo\u{03D2}\u{0301}", .norm_ignore)); try std.testing.expect(try normalizer.eqlBy("FOÉ", "foe\u{0301}", .norm_ignore)); // foÉ == foé try std.testing.expect(try normalizer.eqlBy("FOE", "foe", .ident)); try std.testing.expect(try normalizer.eqlBy("ÁbC123\u{0390}", "ábc123\u{0390}", .ident)); }
.gyro/ziglyph-jecolon-github.com-c37d93b6/pkg/src/normalizer/Normalizer.zig
const std = @import("std"); const c = @import("backend.zig").c; pub const WBin = extern struct { bin: c.GtkBin }; // Parent class is GtkContainerClass. But it and GtkWidgetClass fail to be translated by translate-c const GtkBinClass = extern struct { parent_class: [1024]u8, _gtk_reserved1: ?fn () callconv(.C) void, _gtk_reserved2: ?fn () callconv(.C) void, _gtk_reserved3: ?fn () callconv(.C) void, _gtk_reserved4: ?fn () callconv(.C) void, }; pub const WBinClass = extern struct { parent_class: GtkBinClass }; var wbin_type: c.GType = 0; export fn wbin_get_type() c.GType { if (wbin_type == 0) { const wbin_info = std.mem.zeroInit(c.GTypeInfo, .{ .class_size = @sizeOf(WBinClass), .class_init = @ptrCast(c.GClassInitFunc, wbin_class_init), .instance_size = @sizeOf(WBin), .instance_init = @ptrCast(c.GInstanceInitFunc, wbin_init) }); wbin_type = c.g_type_register_static(c.gtk_bin_get_type(), "WBin", &wbin_info, 0); } return wbin_type; } pub const edited_GtkWidgetClass = extern struct { parent_class: c.GInitiallyUnownedClass, activate_signal: c.guint, dispatch_child_properties_changed: ?fn ([*c]c.GtkWidget, c.guint, [*c][*c]c.GParamSpec) callconv(.C) void, destroy: ?fn ([*c]c.GtkWidget) callconv(.C) void, show: ?fn ([*c]c.GtkWidget) callconv(.C) void, show_all: ?fn ([*c]c.GtkWidget) callconv(.C) void, hide: ?fn ([*c]c.GtkWidget) callconv(.C) void, map: ?fn ([*c]c.GtkWidget) callconv(.C) void, unmap: ?fn ([*c]c.GtkWidget) callconv(.C) void, realize: ?fn ([*c]c.GtkWidget) callconv(.C) void, unrealize: ?fn ([*c]c.GtkWidget) callconv(.C) void, size_allocate: ?fn ([*c]c.GtkWidget, [*c]c.GtkAllocation) callconv(.C) void, state_changed: ?fn ([*c]c.GtkWidget, c.GtkStateType) callconv(.C) void, state_flags_changed: ?fn ([*c]c.GtkWidget, c.GtkStateFlags) callconv(.C) void, parent_set: ?fn ([*c]c.GtkWidget, [*c]c.GtkWidget) callconv(.C) void, hierarchy_changed: ?fn ([*c]c.GtkWidget, [*c]c.GtkWidget) callconv(.C) void, style_set: ?fn ([*c]c.GtkWidget, [*c]c.GtkStyle) callconv(.C) void, direction_changed: ?fn ([*c]c.GtkWidget, c.GtkTextDirection) callconv(.C) void, grab_notify: ?fn ([*c]c.GtkWidget, c.gboolean) callconv(.C) void, child_notify: ?fn ([*c]c.GtkWidget, [*c]c.GParamSpec) callconv(.C) void, draw: ?fn ([*c]c.GtkWidget, ?*c.cairo_t) callconv(.C) c.gboolean, get_request_mode: ?fn ([*c]c.GtkWidget) callconv(.C) c.GtkSizeRequestMode, get_preferred_height: ?fn ([*c]c.GtkWidget, [*c]c.gint, [*c]c.gint) callconv(.C) void, get_preferred_width_for_height: ?fn ([*c]c.GtkWidget, c.gint, [*c]c.gint, [*c]c.gint) callconv(.C) void, get_preferred_width: ?fn ([*c]c.GtkWidget, [*c]c.gint, [*c]c.gint) callconv(.C) void, get_preferred_height_for_width: ?fn ([*c]c.GtkWidget, c.gint, [*c]c.gint, [*c]c.gint) callconv(.C) void, }; fn wbin_class_init(class: *WBinClass) callconv(.C) void { _ = class; const widget_class = @ptrCast(*edited_GtkWidgetClass, class); widget_class.get_preferred_width = wbin_get_preferred_width; widget_class.get_preferred_height = wbin_get_preferred_height; widget_class.size_allocate = wbin_size_allocate; } fn wbin_get_preferred_width(widget: ?*c.GtkWidget, minimum_width: ?*c.gint, natural_width: ?*c.gint) callconv(.C) void { _ = widget; minimum_width.?.* = 0; natural_width.?.* = 0; } fn wbin_get_preferred_height(widget: ?*c.GtkWidget, minimum_height: ?*c.gint, natural_height: ?*c.gint) callconv(.C) void { _ = widget; minimum_height.?.* = 0; natural_height.?.* = 0; } fn wbin_child_allocate(child: ?*c.GtkWidget, ptr: ?*anyopaque) callconv(.C) void { const allocation = @ptrCast(?*c.GtkAllocation, @alignCast(@alignOf(c.GtkAllocation), ptr)); c.gtk_widget_size_allocate(child, allocation); } fn wbin_size_allocate(widget: ?*c.GtkWidget, allocation: ?*c.GtkAllocation) callconv(.C) void { c.gtk_widget_set_allocation(widget, allocation); c.gtk_container_forall(@ptrCast(?*c.GtkContainer, widget), wbin_child_allocate, allocation); } export fn wbin_init(wbin: *WBin, class: *WBinClass) void { _ = wbin; _ = class; // TODO } pub fn wbin_new() ?*c.GtkWidget { return @ptrCast(?*c.GtkWidget, @alignCast(@alignOf(c.GtkWidget), c.g_object_new(wbin_get_type(), null))); }
src/backends/gtk/windowbin.zig
const std = @import("std"); const json = std.json; const Allocator = std.mem.Allocator; const logger = std.log.scoped(.ft); const util = @import("util.zig"); pub const Date = struct { /// comptime interfaces: [ readFromJson, toJson ] day: ?u8 = null, month: ?u8 = null, year: ?i32 = null, pub const ValidationError = error { invalid_day, invalid_month, invalid_year, }; pub const FromJsonError = error { bad_type, bad_field, bad_field_val, }; const month2daycount = [12]u8{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; pub fn validate(self: Date) ValidationError!void { if (self.year) |year| { if (year == 0) { logger.err("in Date.validate() invalid year {d}", .{year}); return ValidationError.invalid_year; } } if (self.month) |month| { if (month == 0 or month > 12) { logger.err("in Date.validate() invalid month {d}", .{month}); return ValidationError.invalid_month; } if (self.day) |day| { if (month != 2) { if (day == 0 or day > Date.month2daycount[month-1]) { logger.err( "in Date.validate() invalid day {d} in month {d}" , .{day, month} ); return ValidationError.invalid_day; } } else { // year-independent Febuary check if (day == 0 or day > 29) { logger.err( "in Date.validate() invalid day {d} in month 2 (year unknown)" , .{month} ); return ValidationError.invalid_day; } if (day == 29) { if (null == self.year) { logger.warn( "in Date.validate() suspicious day 29 in month 2 (year unknown)" , .{} ); } } } if (self.year) |year| { if (month == 2 and ( @rem(year, 400) == 0 or ( @rem(year, 100) != 0 and @rem(year, 4) == 0 ) )) { // leap year if (day == 0 or day > 29) { logger.err( "in Date.validate() invalid day {d} in month 2 (leap)" , .{day} ); return ValidationError.invalid_day; } } else { if (day == 0 or day > Date.month2daycount[month-1]) { logger.err( "in Date.validate() invalid day {d}" ++ " in month {d} in year {d}" , .{day, month, year} ); return ValidationError.invalid_day; } } } } // day check finished } else { // month unknown if (self.day) |day| { if (day == 0 or day > 31) { logger.err( "in Date.validate() invalid day {d} (month unknown)" , .{day} ); return ValidationError.invalid_day; } else if (day > 28) { logger.warn( "in Date.validate() suspicious day {d} (month unknown)" , .{day} ); } } } } pub fn dmy(d: u8, m: u8, y: i32) ValidationError!Date { const res = Date{.day=d, .month=m, .year=y}; try res.validate(); return res; } pub fn readFromJson( this: *Date, json_date: json.Value, ) (ValidationError||FromJsonError)!void { switch (json_date) { json.Value.Object => |map| { if (map.get("day")) |d| { switch (d) { json.Value.Integer => |int| { if (int > 0 and int <= ~@as(u8, 0)) { this.day = @intCast(@typeInfo(@TypeOf(this.day)).Optional.child, int); } else { logger.err( "in Date.readFromJson() bad day {d}" , .{int} ); return FromJsonError.bad_field_val; } }, json.Value.Null => { this.day = null; }, else => { logger.err( "in Date.readFromJson() j_date.get(\"day\") " ++ " is not of type i64" , .{} ); return FromJsonError.bad_field; }, } } if (map.get("month")) |m| { switch (m) { json.Value.Integer => |int| { if (int > 0 and int <= ~@as(u8, 0)) { this.month = @intCast(@typeInfo(@TypeOf(this.month)).Optional.child, int); } else { logger.err( "in Date.readFromJson() bad month {d}" , .{int} ); return FromJsonError.bad_field_val; } }, json.Value.Null => { this.month = null; }, else => { logger.err( "in Date.readFromJson() j_date.get(\"month\") " ++ " is not of type i64" , .{} ); return FromJsonError.bad_field; }, } } if (map.get("year")) |y| { switch (y) { json.Value.Integer => |int| { if ( int >= @bitReverse(i32, 1) and int <= ~@bitReverse(i32, 1) ) { this.year = @intCast(@typeInfo(@TypeOf(this.year)).Optional.child, int); } }, json.Value.Null => { this.year = null; }, else => { logger.err( "in Date.readFromJson() j_date.get(\"year\")" ++ " is not of type i64" , .{} ); return FromJsonError.bad_field; }, } } try this.validate(); }, else => { logger.err( "in Date.readFromJson() j_date is not of type json.ObjectMap" , .{} ); return FromJsonError.bad_type; }, } } }; const testing = std.testing; const expect = testing.expect; const expectEqual = testing.expectEqual; const expectError = testing.expectError; const christ_birthday_source = \\{"day": 1, "month": 1, "year": 1} ; const broken_source_type = \\"asdf" ; const broken_source_field = \\{"day": "asdf"} ; const broken_source_field_val = \\{"day": -1} ; test "basic" { var parser = json.Parser.init(testing.allocator, false); defer parser.deinit(); var tree = try parser.parse(christ_birthday_source); defer tree.deinit(); var date = Date{}; try date.readFromJson(tree.root); } test "errors" { var date = Date{}; date.day = 0; try expectError(Date.ValidationError.invalid_day, date.validate()); date.day = 1; date.month = 13; try expectError(Date.ValidationError.invalid_month, date.validate()); date.month = 1; date.year = 0; try expectError(Date.ValidationError.invalid_year, date.validate()); date.year = 2004; date.month = 2; date.day = 29; try date.validate(); date.year = 2003; try expectError(Date.ValidationError.invalid_day, date.validate()); { var parser = json.Parser.init(testing.allocator, false); defer parser.deinit(); var tree = try parser.parse(broken_source_type); defer tree.deinit(); try expectError(Date.FromJsonError.bad_type, date.readFromJson(tree.root)); } { var parser = json.Parser.init(testing.allocator, false); defer parser.deinit(); var tree = try parser.parse(broken_source_field); defer tree.deinit(); try expectError(Date.FromJsonError.bad_field, date.readFromJson(tree.root)); } { var parser = json.Parser.init(testing.allocator, false); defer parser.deinit(); var tree = try parser.parse(broken_source_field_val); defer tree.deinit(); try expectError(Date.FromJsonError.bad_field_val, date.readFromJson(tree.root)); } } test "to json" { var date = Date{.day = 1}; var j_date = try util.toJson(date, testing.allocator, .{}); defer j_date.deinit(); var j_map = j_date.value.Object; try expectEqual(j_map.get("day").?.Integer, 1); try expectEqual(j_map.get("month").?.Null, {}); try expectEqual(j_map.get("year").?.Null, {}); }
src/date.zig
const std = @import("std"); const wz = @import("../main.zig"); const parser = @import("../main.zig").parser.message; const hzzp = @import("hzzp"); const base64 = std.base64; const ascii = std.ascii; const math = std.math; const rand = std.rand; const time = std.time; const mem = std.mem; const Sha1 = std.crypto.hash.Sha1; const assert = std.debug.assert; pub fn create(buffer: []u8, reader: anytype, writer: anytype) BaseClient(@TypeOf(reader), @TypeOf(writer)) { assert(buffer.len >= 16); return BaseClient(@TypeOf(reader), @TypeOf(writer)).init(buffer, reader, writer); } pub const websocket_guid = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; pub const handshake_key_length = 16; pub const handshake_key_length_b64 = base64.standard.Encoder.calcSize(handshake_key_length); pub const encoded_key_length_b64 = base64.standard.Encoder.calcSize(Sha1.digest_length); fn checkHandshakeKey(original: []const u8, received: []const u8) bool { var hash = Sha1.init(.{}); hash.update(original); hash.update(websocket_guid); var hashed_key: [Sha1.digest_length]u8 = undefined; hash.final(&hashed_key); var encoded: [encoded_key_length_b64]u8 = undefined; _ = base64.standard.Encoder.encode(&encoded, &hashed_key); return mem.eql(u8, &encoded, received); } pub fn HandshakeClient(comptime Reader: type, comptime Writer: type) type { const HttpClient = hzzp.base.client.BaseClient(Reader, Writer); const WzClient = BaseClient(Reader, Writer); return struct { const Self = @This(); prng: std.rand.Random, client: HttpClient, handshake_key: [handshake_key_length_b64]u8 = undefined, got_upgrade_header: bool = false, got_accept_header: bool = false, handshaken: bool = false, pub fn init(buffer: []u8, input: Reader, output: Writer, prng: std.rand.Random) Self { return .{ .prng = prng, .client = HttpClient.init(buffer, input, output), }; } pub fn generateKey(self: *Self) void { var raw_key: [handshake_key_length]u8 = undefined; self.prng.bytes(&raw_key); _ = base64.standard.Encoder.encode(&self.handshake_key, &raw_key); } fn addRequiredHeaders(self: *Self) Writer.Error!void { self.generateKey(); try self.client.writeHeaderValue("Connection", "Upgrade"); try self.client.writeHeaderValue("Upgrade", "websocket"); try self.client.writeHeaderValue("Sec-WebSocket-Version", "13"); try self.client.writeHeaderValue("Sec-WebSocket-Key", &self.handshake_key); } pub fn writeStatusLine(self: *Self, path: []const u8) Writer.Error!void { try self.client.writeStatusLine("GET", path); } pub fn writeStatusLineParts(self: *Self, path: []const u8, query: ?[]const u8, fragment: ?[]const u8) Writer.Error!void { try self.client.writeStatusLineParts("GET", path, query, fragment); } pub fn writeHeaderValue(self: *Self, name: []const u8, value: []const u8) Writer.Error!void { return self.client.writeHeaderValue(name, value); } pub fn writeHeaderFormat(self: *Self, name: []const u8, comptime format: []const u8, args: anytype) Writer.Error!void { return self.client.writeHeaderFormat(name, format, args); } pub fn writeHeader(self: *Self, header: hzzp.Header) Writer.Error!void { return self.client.writeHeader(header); } pub fn writeHeaders(self: *Self, headers: hzzp.HeadersSlice) Writer.Error!void { return self.client.writeHeaders(headers); } pub fn finishHeaders(self: *Self) Writer.Error!void { try self.addRequiredHeaders(); try self.client.finishHeaders(); } pub const HandshakeError = error{ WrongResponse, InvalidConnectionHeader, FailedChallenge } || HttpClient.NextError; pub fn wait(self: *Self) HandshakeError!bool { while (try self.client.next()) |event| { switch (event) { .status => |status| { if (status.code != 101) return error.WrongResponse; }, .header => |header| { if (ascii.eqlIgnoreCase(header.name, "connection")) { self.got_upgrade_header = true; if (!ascii.eqlIgnoreCase(header.value, "upgrade")) { return error.InvalidConnectionHeader; } } else if (ascii.eqlIgnoreCase(header.name, "sec-websocket-accept")) { self.got_accept_header = true; if (!checkHandshakeKey(&self.handshake_key, header.value)) { return error.FailedChallenge; } } }, .head_done => break, .payload => unreachable, .skip => {}, .end => break, } } self.handshaken = self.got_upgrade_header and self.got_accept_header; return self.handshaken; } pub fn socket(self: Self) WzClient { assert(self.handshaken); return WzClient.init(self.client.read_buffer, self.client.parser.reader, self.client.writer, self.prng); } }; } pub fn BaseClient(comptime Reader: type, comptime Writer: type) type { const ParserType = parser.MessageParser(Reader); return struct { const Self = @This(); read_buffer: []u8, parser: ParserType, writer: Writer, current_mask: [4]u8 = std.mem.zeroes([4]u8), mask_index: usize = 0, payload_size: usize = 0, payload_index: usize = 0, prng: std.rand.Random, // Whether a reader is currently using the read_buffer. if true, parser.next should NOT be called since the // reader expects all of the data. self_contained: bool = false, pub const handshake = HandshakeClient(Reader, Writer).init; pub fn init(buffer: []u8, input: Reader, output: Writer, prng: std.rand.Random) Self { return .{ .parser = ParserType.init(buffer, input), .read_buffer = buffer, .writer = output, .prng = prng, }; } pub const WriteHeaderError = error{MissingMask} || Writer.Error; pub fn writeHeader(self: *Self, header: wz.MessageHeader) WriteHeaderError!void { var bytes: [14]u8 = undefined; var len: usize = 2; bytes[0] = @enumToInt(header.opcode); if (header.fin) bytes[0] |= 0x80; if (header.rsv1) bytes[0] |= 0x40; if (header.rsv2) bytes[0] |= 0x20; if (header.rsv3) bytes[0] |= 0x10; // client messages MUST be masked. var mask: [4]u8 = undefined; if (header.mask) |m| { std.mem.copy(u8, &mask, &m); } else { self.prng.bytes(&mask); } bytes[1] = 0x80; if (header.length < 126) { bytes[1] |= @truncate(u8, header.length); } else if (header.length < 0x10000) { bytes[1] |= 126; mem.writeIntBig(u16, bytes[2..4], @truncate(u16, header.length)); len += 2; } else { bytes[1] |= 127; mem.writeIntBig(u64, bytes[2..10], header.length); len += 8; } std.mem.copy(u8, bytes[len .. len + 4], &mask); len += 4; try self.writer.writeAll(bytes[0..len]); self.current_mask = mask; self.mask_index = 0; } pub fn writeChunkRaw(self: *Self, payload: []const u8) Writer.Error!void { try self.writer.writeAll(payload); } const mask_buffer_size = 1024; pub fn writeChunk(self: *Self, payload: []const u8) Writer.Error!void { var buffer: [mask_buffer_size]u8 = undefined; var index: usize = 0; for (payload) |c, i| { buffer[index] = c ^ self.current_mask[(i + self.mask_index) % 4]; index += 1; if (index == mask_buffer_size) { try self.writer.writeAll(&buffer); index = 0; } } if (index > 0) { try self.writer.writeAll(buffer[0..index]); } self.mask_index += payload.len; } pub fn next(self: *Self) ParserType.NextError!?parser.Event { assert(!self.self_contained); return self.parser.next(); } pub const ReadNextError = ParserType.NextError; pub fn readNextChunk(self: *Self) ReadNextError!?parser.ChunkEvent { if (self.parser.state != .chunk) return null; assert(!self.self_contained); if (try self.parser.next()) |event| { switch (event) { .chunk => |chunk| return chunk, .header => unreachable, } } return null; } pub fn flushReader(self: *Self) ReadNextError!void { var buffer: [256]u8 = undefined; while (self.self_contained) { _ = try self.readNextChunkBuffer(&buffer); } } pub fn readNextChunkBuffer(self: *Self, buffer: []u8) ReadNextError!usize { if (self.payload_index >= self.payload_size) { if (self.parser.state != .chunk) { self.self_contained = false; return 0; } self.self_contained = true; if (try self.parser.next()) |event| { switch (event) { .chunk => |chunk| { self.payload_index = 0; self.payload_size = chunk.data.len; }, .header => unreachable, } } else unreachable; } const size = std.math.min(buffer.len, self.payload_size - self.payload_index); const end = self.payload_index + size; mem.copy(u8, buffer[0..size], self.read_buffer[self.payload_index..end]); self.payload_index = end; return size; } pub const PayloadReader = std.io.Reader(*Self, ReadNextError, readNextChunkBuffer); pub fn reader(self: *Self) PayloadReader { assert(self.parser.state == .chunk); return .{ .context = self }; } }; } const testing = std.testing; test "test server required" { const Reader = std.io.FixedBufferStream([]const u8).Reader; const Writer = std.io.FixedBufferStream([]u8).Writer; std.testing.refAllDecls(HandshakeClient(Reader, Writer)); std.testing.refAllDecls(BaseClient(Reader, Writer)); } test "example usage" { if (true) return error.SkipZigTest; var buffer: [256]u8 = undefined; var stream = std.io.fixedBufferStream(&buffer); const reader = stream.reader(); const writer = stream.writer(); const Reader = @TypeOf(reader); const Writer = @TypeOf(writer); const seed = @truncate(u64, @bitCast(u128, std.time.nanoTimestamp())); var prng = std.rand.DefaultPrng.init(seed); var handshake = BaseClient(Reader, Writer).handshake(&buffer, reader, writer, prng.random()); try handshake.writeStatusLine("/"); try handshake.writeHeaderValue("Host", "echo.websocket.org"); try handshake.finishHeaders(); if (try handshake.wait()) { var client = handshake.socket(); try client.writeHeader(.{ .opcode = .binary, .length = 4, }); try client.writeChunk("abcd"); while (try client.next()) |event| { _ = event; // directly from the parser } } }
src/base/client.zig
const getty = @import("../../lib.zig"); const std = @import("std"); /// Serializer interface. /// /// Serializers are responsible for the following conversion: /// /// Getty Data Model /// /// | <------- /// ▼ | /// | /// Data Format | /// | /// | /// | /// | /// /// `getty.Serializer` /// /// Notice how Zig data is not a part of this conversion. Serializers only /// convert values that fall under Getty's data model. In other words, a Getty /// serializer specifies how to convert a Getty map into a JSON map, not how to /// convert a `struct { x: i32 }` to a JSON map. /// /// Most types within Getty's data model have the same semantics as their Zig /// counterparts. For example, Getty booleans are functionally equivalent to /// `bool` values and Getty integers are just regular Zig integers. Do keep in /// mind though that there are types that do not have a 1:1 correlation, such /// as maps and sequences. /// /// Parameters /// ========== /// /// Context /// ------- /// /// This is the type that implements `getty.Serializer` (or a pointer to it). /// /// Ok /// -- /// /// The successful return type for a majority of `getty.Serializer`'s methods. /// /// Error /// ----- /// /// The error set used by all of `getty.Serializer`'s methods upon failure. /// /// user_sbt /// -------- /// /// A Serialization Block or Tuple. /// /// This parameter is intended for users of a serializer, enabling them /// to use their own custom serialization logic. /// /// ser_sbt /// ------- /// /// A Serialization Block or Tuple. /// /// This parameter is intended for serializers, enabling them to use /// their own custom serialization logic. /// /// Map /// --- /// /// A type that implements `getty.ser.Map` (or a pointer to it). /// /// The `getty.ser.Map` interface specifies how to serialize the /// components of a map and how to finish serialization for maps. /// /// Seq /// --- /// /// A type that implements `getty.ser.Seq` (or a pointer to it). /// /// The `getty.ser.Seq` interface specifies how to serialize the /// elements of a sequence and how to finish serialization for /// sequences. /// /// Struct /// ------ /// /// A type that implements `getty.ser.Structure` (or a pointer to it). /// /// The `getty.ser.Structure` interface specifies how to serialize the /// fields of a struct (e.g., fields) and how to finish serialization /// for structs. /// /// serializeXXX /// ------------ /// /// Methods required by `getty.Serializer` to carry out serialization. /// /// Most of the methods are one and done (i.e., you call them once and /// in return you get a fully serialized value). However, some methods /// (specifically, the ones for compound data types like `serializeMap` /// and `serializeSeq`), only begin the serialization process. The /// caller must then continue serialization by using the returned /// `getty.ser.Map|Seq|Struct` implementation. pub fn Serializer( comptime Context: type, comptime Ok: type, comptime Error: type, comptime user_sbt: anytype, comptime ser_sbt: anytype, comptime Map: type, comptime Seq: type, comptime Struct: type, comptime serializeBool: fn (Context, bool) Error!Ok, comptime serializeEnum: fn (Context, anytype) Error!Ok, comptime serializeFloat: fn (Context, anytype) Error!Ok, comptime serializeInt: fn (Context, anytype) Error!Ok, comptime serializeMap: fn (Context, ?usize) Error!Map, comptime serializeNull: fn (Context) Error!Ok, comptime serializeSeq: fn (Context, ?usize) Error!Seq, comptime serializeSome: fn (Context, anytype) Error!Ok, comptime serializeString: fn (Context, anytype) Error!Ok, comptime serializeStruct: @TypeOf(struct { fn f(self: Context, comptime name: []const u8, length: usize) Error!Struct { _ = self; _ = name; _ = length; unreachable; } }.f), comptime serializeVoid: fn (Context) Error!Ok, ) type { comptime { getty.concepts.@"getty.ser.sbt"(user_sbt); getty.concepts.@"getty.ser.sbt"(ser_sbt); //TODO: Add concept for Error (blocked by concepts library). } return struct { pub const @"getty.Serializer" = struct { context: Context, const Self = @This(); /// Successful return type. pub const Ok = Ok; /// Error set used upon failure. pub const Error = Error; /// Serialization Tuple associated with the serializer. pub const st = blk: { const user_st = if (@TypeOf(user_sbt) == type) .{user_sbt} else user_sbt; const ser_st = if (@TypeOf(ser_sbt) == type) .{ser_sbt} else ser_sbt; const default = getty.default_st; const U = @TypeOf(user_st); const S = @TypeOf(ser_st); const Default = @TypeOf(default); if (U == Default and S == Default) { break :blk default; } else if (U != Default and S == Default) { break :blk user_st ++ default; } else if (U == Default and S != Default) { break :blk ser_st ++ default; } else { break :blk user_st ++ ser_st ++ default; } }; /// Serializes a `bool` value. pub fn serializeBool(self: Self, value: bool) Error!Ok { return try serializeBool(self.context, value); } // Serializes an enum value. pub fn serializeEnum(self: Self, value: anytype) Error!Ok { switch (@typeInfo(@TypeOf(value))) { .Enum, .EnumLiteral => return try serializeEnum(self.context, value), else => @compileError("expected enum, found `" ++ @typeName(@TypeOf(value)) ++ "`"), } } /// Serializes a floating-point value. pub fn serializeFloat(self: Self, value: anytype) Error!Ok { switch (@typeInfo(@TypeOf(value))) { .Float, .ComptimeFloat => return try serializeFloat(self.context, value), else => @compileError("expected float, found `" ++ @typeName(@TypeOf(value)) ++ "`"), } } /// Serializes an integer value. pub fn serializeInt(self: Self, value: anytype) Error!Ok { switch (@typeInfo(@TypeOf(value))) { .Int, .ComptimeInt => return try serializeInt(self.context, value), else => @compileError("expected integer, found `" ++ @typeName(@TypeOf(value)) ++ "`"), } } /// Starts the serialization process for a map. pub fn serializeMap(self: Self, length: ?usize) Error!Map { return try serializeMap(self.context, length); } /// Serializes a `null` value. pub fn serializeNull(self: Self) Error!Ok { return try serializeNull(self.context); } /// Starts the serialization process for a sequence. pub fn serializeSeq(self: Self, length: ?usize) Error!Seq { return try serializeSeq(self.context, length); } /// Serializes the payload of an optional. pub fn serializeSome(self: Self, value: anytype) Error!Ok { return try serializeSome(self.context, value); } /// Serializes a string value. pub fn serializeString(self: Self, value: anytype) Error!Ok { if (comptime !std.meta.trait.isZigString(@TypeOf(value))) { @compileError("expected string, found `" ++ @typeName(@TypeOf(value)) ++ "`"); } return try serializeString(self.context, value); } /// Starts the serialization process for a struct. pub fn serializeStruct(self: Self, comptime name: []const u8, length: usize) Error!Struct { return try serializeStruct(self.context, name, length); } /// Serializes a `void` value. pub fn serializeVoid(self: Self) Error!Ok { return try serializeVoid(self.context); } }; pub fn serializer(self: Context) @"getty.Serializer" { return .{ .context = self }; } }; }
src/ser/interface/serializer.zig
const std = @import("std"); const mem = std.mem; const EmojiModifierBase = @This(); allocator: *mem.Allocator, array: []bool, lo: u21 = 9757, hi: u21 = 129501, pub fn init(allocator: *mem.Allocator) !EmojiModifierBase { var instance = EmojiModifierBase{ .allocator = allocator, .array = try allocator.alloc(bool, 119745), }; mem.set(bool, instance.array, false); var index: u21 = 0; instance.array[0] = true; instance.array[220] = true; index = 237; while (index <= 239) : (index += 1) { instance.array[index] = true; } instance.array[240] = true; instance.array[118120] = true; index = 118181; while (index <= 118183) : (index += 1) { instance.array[index] = true; } instance.array[118186] = true; instance.array[118189] = true; index = 118190; while (index <= 118191) : (index += 1) { instance.array[index] = true; } index = 118309; while (index <= 118310) : (index += 1) { instance.array[index] = true; } index = 118313; while (index <= 118323) : (index += 1) { instance.array[index] = true; } index = 118345; while (index <= 118350) : (index += 1) { instance.array[index] = true; } index = 118351; while (index <= 118352) : (index += 1) { instance.array[index] = true; } index = 118353; while (index <= 118363) : (index += 1) { instance.array[index] = true; } instance.array[118367] = true; index = 118372; while (index <= 118374) : (index += 1) { instance.array[index] = true; } index = 118376; while (index <= 118378) : (index += 1) { instance.array[index] = true; } instance.array[118386] = true; instance.array[118388] = true; instance.array[118413] = true; index = 118615; while (index <= 118616) : (index += 1) { instance.array[index] = true; } instance.array[118621] = true; instance.array[118643] = true; index = 118648; while (index <= 118649) : (index += 1) { instance.array[index] = true; } index = 118824; while (index <= 118826) : (index += 1) { instance.array[index] = true; } index = 118830; while (index <= 118834) : (index += 1) { instance.array[index] = true; } instance.array[118918] = true; index = 118935; while (index <= 118936) : (index += 1) { instance.array[index] = true; } instance.array[118937] = true; instance.array[118947] = true; instance.array[118959] = true; instance.array[119535] = true; instance.array[119538] = true; instance.array[119547] = true; index = 119548; while (index <= 119553) : (index += 1) { instance.array[index] = true; } instance.array[119554] = true; instance.array[119561] = true; instance.array[119571] = true; index = 119572; while (index <= 119573) : (index += 1) { instance.array[index] = true; } index = 119574; while (index <= 119580) : (index += 1) { instance.array[index] = true; } index = 119583; while (index <= 119585) : (index += 1) { instance.array[index] = true; } instance.array[119642] = true; index = 119704; while (index <= 119705) : (index += 1) { instance.array[index] = true; } index = 119707; while (index <= 119708) : (index += 1) { instance.array[index] = true; } instance.array[119710] = true; index = 119728; while (index <= 119730) : (index += 1) { instance.array[index] = true; } index = 119732; while (index <= 119744) : (index += 1) { instance.array[index] = true; } // Placeholder: 0. Struct name, 1. Code point kind return instance; } pub fn deinit(self: *EmojiModifierBase) void { self.allocator.free(self.array); } // isEmojiModifierBase checks if cp is of the kind Emoji_Modifier_Base. pub fn isEmojiModifierBase(self: EmojiModifierBase, cp: u21) bool { if (cp < self.lo or cp > self.hi) return false; const index = cp - self.lo; return if (index >= self.array.len) false else self.array[index]; }
src/components/autogen/emoji-data/EmojiModifierBase.zig
const std = @import("std"); const assert = std.debug.assert; const os = std.os; const linux = os.linux; const IO_Uring = linux.IO_Uring; const io_uring_cqe = linux.io_uring_cqe; const io_uring_sqe = linux.io_uring_sqe; pub const IO = struct { ring: IO_Uring, /// The number of SQEs queued but not yet submitted to the kernel: queued: u32 = 0, /// The number of SQEs submitted and inflight but not yet completed: submitted: u32 = 0, /// A linked list of completions that are ready to resume (FIFO): completed_head: ?*Completion = null, completed_tail: ?*Completion = null, const Completion = struct { frame: anyframe, result: i32 = undefined, next: ?*Completion = null, }; pub fn init(entries: u12, flags: u32) !IO { return IO{ .ring = try IO_Uring.init(entries, flags) }; } pub fn deinit(self: *IO) void { self.ring.deinit(); } pub fn run(self: *IO) !void { // Run the event loop while there is IO pending: while (self.queued + self.submitted > 0 or self.completed_head != null) { // We already use `io_uring_enter()` to submit SQEs so reuse that to wait for CQEs: try self.flush_submissions(true); // We can now just peek for any CQEs without waiting, and without another syscall: try self.flush_completions(false); // Resume completion frames only after all completions have been flushed: // Loop on a copy of the linked list, having reset the linked list first, so that any // synchronous append on resume is executed only the next time round the event loop, // without creating an infinite suspend/resume cycle within `while (head)`. var head = self.completed_head; self.completed_head = null; self.completed_tail = null; while (head) |completion| { head = completion.next; resume completion.frame; } } assert(self.completed_head == null); assert(self.completed_tail == null); } fn append_completion(self: *IO, completion: *Completion) void { assert(completion.next == null); if (self.completed_head == null) { assert(self.completed_tail == null); self.completed_head = completion; self.completed_tail = completion; } else { self.completed_tail.?.next = completion; self.completed_tail = completion; } } fn flush_completions(self: *IO, wait: bool) !void { var cqes: [256]io_uring_cqe = undefined; var wait_nr: u32 = if (wait) 1 else 0; while (true) { // Guard against waiting indefinitely (if there are too few requests inflight), // especially if this is not the first time round the loop: wait_nr = std.math.min(self.submitted, wait_nr); const completed = self.ring.copy_cqes(&cqes, wait_nr) catch |err| switch (err) { error.SignalInterrupt => continue, else => return err, }; self.submitted -= completed; for (cqes[0..completed]) |cqe| { const completion = @intToPtr(*Completion, @intCast(usize, cqe.user_data)); completion.result = cqe.res; completion.next = null; // We do not resume the completion frame here (instead appending to a linked list): // * to avoid recursion through `flush_submissions()` and `flush_completions()`, // * to avoid unbounded stack usage, and // * to avoid confusing stack traces. self.append_completion(completion); } if (completed < cqes.len) break; } } fn flush_submissions(self: *IO, wait: bool) !void { var wait_nr: u32 = if (wait) 1 else 0; while (true) { wait_nr = std.math.min(self.queued + self.submitted, wait_nr); _ = self.ring.submit_and_wait(wait_nr) catch |err| switch (err) { error.SignalInterrupt => continue, // Wait for some completions and then try again: // See https://github.com/axboe/liburing/issues/281 re: error.SystemResources. // Be careful also that copy_cqes() will flush before entering to wait (it does): // https://github.com/axboe/liburing/commit/35c199c48dfd54ad46b96e386882e7ac341314c5 error.CompletionQueueOvercommitted, error.SystemResources => { try self.flush_completions(true); continue; }, else => return err, }; self.submitted += self.queued; self.queued = 0; break; } } fn get_sqe(self: *IO) *io_uring_sqe { while (true) { const sqe = self.ring.get_sqe() catch |err| switch (err) { error.SubmissionQueueFull => { var completion = Completion{ .frame = @frame(), .result = 0 }; self.append_completion(&completion); suspend {} continue; }, }; self.queued += 1; return sqe; } } pub fn accept( self: *IO, socket: os.socket_t, address: *os.sockaddr, address_size: *os.socklen_t, ) !os.socket_t { while (true) { var completion = Completion{ .frame = @frame() }; const sqe = self.get_sqe(); linux.io_uring_prep_accept(sqe, socket, address, address_size, os.SOCK_CLOEXEC); sqe.user_data = @ptrToInt(&completion); suspend {} if (completion.result < 0) { switch (-completion.result) { os.EINTR => continue, os.EAGAIN => return error.WouldBlock, os.EBADF => return error.FileDescriptorInvalid, os.ECONNABORTED => return error.ConnectionAborted, os.EFAULT => unreachable, os.EINVAL => return error.SocketNotListening, os.EMFILE => return error.ProcessFdQuotaExceeded, os.ENFILE => return error.SystemFdQuotaExceeded, os.ENOBUFS => return error.SystemResources, os.ENOMEM => return error.SystemResources, os.ENOTSOCK => return error.FileDescriptorNotASocket, os.EOPNOTSUPP => return error.OperationNotSupported, os.EPERM => return error.PermissionDenied, os.EPROTO => return error.ProtocolFailure, else => |errno| return os.unexpectedErrno(@intCast(usize, errno)), } } else { return @intCast(os.socket_t, completion.result); } } } pub fn close(self: *IO, fd: os.fd_t) !void { var completion = Completion{ .frame = @frame() }; const sqe = self.get_sqe(); linux.io_uring_prep_close(sqe, fd); sqe.user_data = @ptrToInt(&completion); suspend {} if (completion.result < 0) { switch (-completion.result) { os.EINTR => return, // A success, see https://github.com/ziglang/zig/issues/2425. os.EBADF => return error.FileDescriptorInvalid, os.EDQUOT => return error.DiskQuota, os.EIO => return error.InputOutput, os.ENOSPC => return error.NoSpaceLeft, else => |errno| return os.unexpectedErrno(@intCast(usize, errno)), } } else { assert(completion.result == 0); } } pub fn connect( self: *IO, socket: os.socket_t, address: *const os.sockaddr, address_size: os.socklen_t, ) !void { while (true) { var completion = Completion{ .frame = @frame() }; const sqe = self.get_sqe(); linux.io_uring_prep_connect(sqe, socket, address, address_size); sqe.user_data = @ptrToInt(&completion); suspend {} if (completion.result < 0) { switch (-completion.result) { os.EINTR => continue, os.EACCES => return error.AccessDenied, os.EADDRINUSE => return error.AddressInUse, os.EADDRNOTAVAIL => return error.AddressNotAvailable, os.EAFNOSUPPORT => return error.AddressFamilyNotSupported, os.EAGAIN, os.EINPROGRESS => return error.WouldBlock, os.EALREADY => return error.OpenAlreadyInProgress, os.EBADF => return error.FileDescriptorInvalid, os.ECONNREFUSED => return error.ConnectionRefused, os.EFAULT => unreachable, os.EISCONN => return error.AlreadyConnected, os.ENETUNREACH => return error.NetworkUnreachable, os.ENOENT => return error.FileNotFound, os.ENOTSOCK => return error.FileDescriptorNotASocket, os.EPERM => return error.PermissionDenied, os.EPROTOTYPE => return error.ProtocolNotSupported, os.ETIMEDOUT => return error.ConnectionTimedOut, else => |errno| return os.unexpectedErrno(@intCast(usize, errno)), } } else { assert(completion.result == 0); return; } } } pub fn fsync(self: *IO, fd: os.fd_t) !void { while (true) { var completion = Completion{ .frame = @frame() }; const sqe = self.get_sqe(); linux.io_uring_prep_fsync(sqe, fd, 0); sqe.user_data = @ptrToInt(&completion); suspend {} if (completion.result < 0) { switch (-completion.result) { os.EINTR => continue, os.EBADF => return error.FileDescriptorInvalid, os.EDQUOT => return error.DiskQuota, os.EINVAL => return error.ArgumentsInvalid, os.EIO => return error.InputOutput, os.ENOSPC => return error.NoSpaceLeft, os.EROFS => return error.ReadOnlyFileSystem, else => |errno| return os.unexpectedErrno(@intCast(usize, errno)), } } else { assert(completion.result == 0); return; } } } pub fn openat( self: *IO, dir_fd: os.fd_t, pathname: []const u8, flags: u32, mode: os.mode_t, ) !os.fd_t { while (true) { var completion = Completion{ .frame = @frame() }; const pathname_c = try os.toPosixPath(pathname); const sqe = self.get_sqe(); linux.io_uring_prep_openat(sqe, dir_fd, &pathname_c, flags, mode); sqe.user_data = @ptrToInt(&completion); suspend {} if (completion.result < 0) { switch (-completion.result) { os.EINTR => continue, os.EACCES => return error.AccessDenied, os.EBADF => return error.FileDescriptorInvalid, os.EBUSY => return error.DeviceBusy, os.EEXIST => return error.PathAlreadyExists, os.EFAULT => unreachable, os.EFBIG => return error.FileTooBig, os.EINVAL => return error.ArgumentsInvalid, os.EISDIR => return error.IsDir, os.ELOOP => return error.SymLinkLoop, os.EMFILE => return error.ProcessFdQuotaExceeded, os.ENAMETOOLONG => return error.NameTooLong, os.ENFILE => return error.SystemFdQuotaExceeded, os.ENODEV => return error.NoDevice, os.ENOENT => return error.FileNotFound, os.ENOMEM => return error.SystemResources, os.ENOSPC => return error.NoSpaceLeft, os.ENOTDIR => return error.NotDir, os.EOPNOTSUPP => return error.FileLocksNotSupported, os.EOVERFLOW => return error.FileTooBig, os.EPERM => return error.AccessDenied, os.EWOULDBLOCK => return error.WouldBlock, else => |errno| return os.unexpectedErrno(@intCast(usize, errno)), } } else { return @intCast(os.fd_t, completion.result); } } } pub fn read(self: *IO, fd: os.fd_t, buffer: []u8, offset: u64) !usize { while (true) { var completion = Completion{ .frame = @frame() }; const sqe = self.get_sqe(); linux.io_uring_prep_read(sqe, fd, buffer[0..buffer_limit(buffer.len)], offset); sqe.user_data = @ptrToInt(&completion); suspend {} if (completion.result < 0) { switch (-completion.result) { os.EINTR => continue, os.EAGAIN => return error.WouldBlock, os.EBADF => return error.NotOpenForReading, os.ECONNRESET => return error.ConnectionResetByPeer, os.EFAULT => unreachable, os.EINVAL => return error.Alignment, os.EIO => return error.InputOutput, os.EISDIR => return error.IsDir, os.ENOBUFS => return error.SystemResources, os.ENOMEM => return error.SystemResources, os.ENXIO => return error.Unseekable, os.EOVERFLOW => return error.Unseekable, os.ESPIPE => return error.Unseekable, else => |errno| return os.unexpectedErrno(@intCast(usize, errno)), } } else { return @intCast(usize, completion.result); } } } pub fn recv(self: *IO, socket: os.socket_t, buffer: []u8) !usize { while (true) { var completion = Completion{ .frame = @frame() }; const sqe = self.get_sqe(); linux.io_uring_prep_recv(sqe, socket, buffer, os.MSG_NOSIGNAL); sqe.user_data = @ptrToInt(&completion); suspend {} if (completion.result < 0) { switch (-completion.result) { os.EINTR => continue, os.EAGAIN => return error.WouldBlock, os.EBADF => return error.FileDescriptorInvalid, os.ECONNREFUSED => return error.ConnectionRefused, os.EFAULT => unreachable, os.EINVAL => unreachable, os.ENOMEM => return error.SystemResources, os.ENOTCONN => return error.SocketNotConnected, os.ENOTSOCK => return error.FileDescriptorNotASocket, else => |errno| return os.unexpectedErrno(@intCast(usize, errno)), } } else { return @intCast(usize, completion.result); } } } pub fn send(self: *IO, socket: os.socket_t, buffer: []const u8) !usize { while (true) { var completion = Completion{ .frame = @frame() }; const sqe = self.get_sqe(); linux.io_uring_prep_send(sqe, socket, buffer, os.MSG_NOSIGNAL); sqe.user_data = @ptrToInt(&completion); suspend {} if (completion.result < 0) { switch (-completion.result) { os.EINTR => continue, os.EACCES => return error.AccessDenied, os.EAGAIN => return error.WouldBlock, os.EALREADY => return error.FastOpenAlreadyInProgress, os.EAFNOSUPPORT => return error.AddressFamilyNotSupported, os.EBADF => return error.FileDescriptorInvalid, os.ECONNRESET => return error.ConnectionResetByPeer, os.EDESTADDRREQ => unreachable, os.EFAULT => unreachable, os.EINVAL => unreachable, os.EISCONN => unreachable, os.EMSGSIZE => return error.MessageTooBig, os.ENOBUFS => return error.SystemResources, os.ENOMEM => return error.SystemResources, os.ENOTCONN => return error.SocketNotConnected, os.ENOTSOCK => return error.FileDescriptorNotASocket, os.EOPNOTSUPP => return error.OperationNotSupported, os.EPIPE => return error.BrokenPipe, else => |errno| return os.unexpectedErrno(@intCast(usize, errno)), } } else { return @intCast(usize, completion.result); } } } pub fn sleep(self: *IO, nanoseconds: u64) !void { while (true) { var completion = Completion{ .frame = @frame() }; const ts: os.__kernel_timespec = .{ .tv_sec = 0, .tv_nsec = @intCast(i64, nanoseconds), }; const sqe = self.get_sqe(); linux.io_uring_prep_timeout(sqe, &ts, 0, 0); sqe.user_data = @ptrToInt(&completion); suspend {} if (completion.result < 0) { switch (-completion.result) { os.EINTR => continue, os.ECANCELED => return error.Canceled, os.ETIME => return, // A success. else => |errno| return os.unexpectedErrno(@intCast(usize, errno)), } } else { unreachable; } } } pub fn write(self: *IO, fd: os.fd_t, buffer: []const u8, offset: u64) !usize { while (true) { var completion = Completion{ .frame = @frame() }; const sqe = self.get_sqe(); linux.io_uring_prep_write(sqe, fd, buffer[0..buffer_limit(buffer.len)], offset); sqe.user_data = @ptrToInt(&completion); suspend {} if (completion.result < 0) { switch (-completion.result) { os.EINTR => continue, os.EAGAIN => return error.WouldBlock, os.EBADF => return error.NotOpenForWriting, os.EDESTADDRREQ => return error.NotConnected, os.EDQUOT => return error.DiskQuota, os.EFAULT => unreachable, os.EFBIG => return error.FileTooBig, os.EINVAL => return error.Alignment, os.EIO => return error.InputOutput, os.ENOSPC => return error.NoSpaceLeft, os.ENXIO => return error.Unseekable, os.EOVERFLOW => return error.Unseekable, os.EPERM => return error.AccessDenied, os.EPIPE => return error.BrokenPipe, os.ESPIPE => return error.Unseekable, else => |errno| return os.unexpectedErrno(@intCast(usize, errno)), } } else { return @intCast(usize, completion.result); } } } }; pub fn buffer_limit(buffer_len: usize) usize { // Linux limits how much may be written in a `pwrite()/pread()` call, which is `0x7ffff000` on // both 64-bit and 32-bit systems, due to using a signed C int as the return value, as well as // stuffing the errno codes into the last `4096` values. // Darwin limits writes to `0x7fffffff` bytes, more than that returns `EINVAL`. // The corresponding POSIX limit is `std.math.maxInt(isize)`. const limit = switch (std.Target.current.os.tag) { .linux => 0x7ffff000, .macos, .ios, .watchos, .tvos => std.math.maxInt(i32), else => std.math.maxInt(isize), }; return std.math.min(limit, buffer_len); } const testing = std.testing; fn test_write_fsync_read(io: *IO) !void { const path = "test_io_write_fsync_read"; const file = try std.fs.cwd().createFile(path, .{ .read = true, .truncate = true }); defer file.close(); defer std.fs.cwd().deleteFile(path) catch {}; const fd = file.handle; const buffer_write = [_]u8{97} ** 20; var buffer_read = [_]u8{98} ** 20; const bytes_written = try io.write(fd, buffer_write[0..], 10); testing.expectEqual(@as(usize, buffer_write.len), bytes_written); try io.fsync(fd); const bytes_read = try io.read(fd, buffer_read[0..], 10); testing.expectEqual(@as(usize, buffer_read.len), bytes_read); testing.expectEqualSlices(u8, buffer_write[0..], buffer_read[0..]); } fn test_openat_close(io: *IO) !void { const path = "test_io_openat_close"; defer std.fs.cwd().deleteFile(path) catch {}; const fd = try io.openat(linux.AT_FDCWD, path, os.O_CLOEXEC | os.O_RDWR | os.O_CREAT, 0o666); defer io.close(fd) catch unreachable; testing.expect(fd > 0); } fn test_sleep(io: *IO) !void { { const ms = 100; const margin = 5; const started = std.time.milliTimestamp(); try io.sleep(ms * std.time.ns_per_ms); const stopped = std.time.milliTimestamp(); testing.expectApproxEqAbs(@as(f64, ms), @intToFloat(f64, stopped - started), margin); } { const frames = try testing.allocator.alloc(@Frame(test_sleep_coroutine), 10); defer testing.allocator.free(frames); const ms = 27; const margin = 5; var count: usize = 0; const started = std.time.milliTimestamp(); for (frames) |*frame| { frame.* = async test_sleep_coroutine(io, ms, &count); } for (frames) |*frame| { try await frame; } const stopped = std.time.milliTimestamp(); testing.expect(count == frames.len); testing.expectApproxEqAbs(@as(f64, ms), @intToFloat(f64, stopped - started), margin); } } fn test_sleep_coroutine(io: *IO, ms: u64, count: *usize) !void { try io.sleep(ms * std.time.ns_per_ms); count.* += 1; } fn test_accept_connect_send_receive(io: *IO) !void { const address = try std.net.Address.parseIp4("127.0.0.1", 3131); const kernel_backlog = 1; const server = try os.socket(address.any.family, os.SOCK_STREAM | os.SOCK_CLOEXEC, 0); defer io.close(server) catch unreachable; try os.setsockopt(server, os.SOL_SOCKET, os.SO_REUSEADDR, &std.mem.toBytes(@as(c_int, 1))); try os.bind(server, &address.any, address.getOsSockLen()); try os.listen(server, kernel_backlog); const client = try os.socket(address.any.family, os.SOCK_STREAM | os.SOCK_CLOEXEC, 0); defer io.close(client) catch unreachable; const buffer_send = [_]u8{ 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 }; var buffer_recv = [_]u8{ 0, 1, 0, 1, 0 }; var accept_address: os.sockaddr = undefined; var accept_address_size: os.socklen_t = @sizeOf(@TypeOf(accept_address)); var accept_frame = async io.accept(server, &accept_address, &accept_address_size); try io.connect(client, &address.any, address.getOsSockLen()); var accept = try await accept_frame; defer io.close(accept) catch unreachable; const send_size = try io.send(client, buffer_send[0..]); testing.expectEqual(buffer_send.len, send_size); const recv_size = try io.recv(accept, buffer_recv[0..]); testing.expectEqual(buffer_recv.len, recv_size); testing.expectEqualSlices(u8, buffer_send[0..buffer_recv.len], buffer_recv[0..]); } fn test_submission_queue_full(io: *IO) !void { var a = async io.sleep(0); var b = async io.sleep(0); var c = async io.sleep(0); try await a; try await b; try await c; } fn test_run(entries: u12, comptime test_fn: anytype) void { var io = IO.init(entries, 0) catch unreachable; defer io.deinit(); var frame = async test_fn(&io); io.run() catch unreachable; nosuspend await frame catch unreachable; } test "write/fsync/read" { test_run(32, test_write_fsync_read); } test "openat/close" { test_run(32, test_openat_close); } test "sleep" { test_run(32, test_sleep); } test "accept/connect/send/receive" { test_run(32, test_accept_connect_send_receive); } test "SubmissionQueueFull" { test_run(1, test_submission_queue_full); }
src/io_async.zig
const std = @import("std"); pub fn singleInputFuncMain(comptime func: @TypeOf(std.math.exp)) !void { var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator); defer arena.deinit(); var arg_iter = std.process.args(); // Skip this exe name. _ = arg_iter.skip(); var a = &arena.allocator; const input_arg = try (arg_iter.next(a) orelse { std.debug.print("Expected an input argument\n", .{}); return error.InvalidArgs; }); if (arg_iter.next(a)) |_| { std.debug.print("Expected exactly one input argument\n", .{}); return error.InvalidArgs; } if (!std.mem.eql(u8, input_arg[0..2], "0x")) { std.debug.print("Expected input to start with '0x'\n", .{}); return error.InvalidArgs; } const stdout = std.io.getStdOut().writer(); if (input_arg.len == 10) { const input_bits = try std.fmt.parseUnsigned(u32, input_arg, 0); const input = @bitCast(f32, input_bits); std.debug.print( "IN: 0x{X:0>8} {[1]x} {[1]e}\n", .{ input_bits, input }, ); const result = func(input); const result_bits = @bitCast(u32, result); std.debug.print( "OUT: 0x{X:0>8} {[1]x} {[1]e}\n", .{ result_bits, result }, ); try stdout.print("0x{X:0>8}", .{@bitCast(u32, result)}); } else if (input_arg.len == 18) { const input_bits = try std.fmt.parseUnsigned(u64, input_arg, 0); const input = @bitCast(f64, input_bits); std.debug.print( "IN: 0x{X:0>16} {[1]x} {[1]e}\n", .{ input_bits, input }, ); const result = func(input); const result_bits = @bitCast(u64, result); std.debug.print( "OUT: 0x{X:0>16} {[1]x} {[1]e}\n", .{ result_bits, result }, ); try stdout.print("0x{X:0>16}", .{@bitCast(u64, result)}); } else if (input_arg.len == 34) { const input_bits = try std.fmt.parseUnsigned(u128, input_arg, 0); const input = @bitCast(f128, input_bits); std.debug.print( "IN: 0x{X:0>32} {[1]x} {[1]e}\n", .{ input_bits, input }, ); const result = func(input); const result_bits = @bitCast(u128, result); std.debug.print( "OUT: 0x{X:0>32} {x}\n", .{ result_bits, result }, ); try stdout.print("0x{X:0>32}", .{@bitCast(u128, result)}); } else { std.debug.print( "Unexpected input length {d} - expected a 32, 64, or 128-bit hex int\n", // "Unexpected input length {d} - expected a 32 or 64-bit hex int\n", .{input_arg.len}, ); return error.InvalidArgs; } }
src/util.zig
const l0 = @import("vez.zig"); // Instance functions. pub const enumerateInstanceExtensionProperties = l0.vezEnumerateInstanceExtensionProperties; pub const enumerateInstanceLayerProperties = l0.vezEnumerateInstanceLayerProperties; pub const createInstance = l0.vezCreateInstance; pub const destroyInstance = l0.vezDestroyInstance; pub const enumeratePhysicalDevices = l0.vezEnumeratePhysicalDevices; // Physical device functions. pub const getPhysicalDeviceProperties = l0.vezGetPhysicalDeviceProperties; pub const getPhysicalDeviceFeatures = l0.vezGetPhysicalDeviceFeatures; pub const getPhysicalDeviceFormatProperties = l0.vezGetPhysicalDeviceFormatProperties; pub const getPhysicalDeviceImageFormatProperties = l0.vezGetPhysicalDeviceImageFormatProperties; pub const getPhysicalDeviceQueueFamilyProperties = l0.vezGetPhysicalDeviceQueueFamilyProperties; pub const getPhysicalDeviceSurfaceFormats = l0.vezGetPhysicalDeviceSurfaceFormats; pub const getPhysicalDevicePresentSupport = l0.vezGetPhysicalDevicePresentSupport; pub const enumerateDeviceExtensionProperties = l0.vezEnumerateDeviceExtensionProperties; pub const enumerateDeviceLayerProperties = l0.vezEnumerateDeviceLayerProperties; // Device functions. pub const createDevice = l0.vezCreateDevice; pub const destroyDevice = l0.vezDestroyDevice; pub const deviceWaitIdle = l0.vezDeviceWaitIdle; pub const getDeviceQueue = l0.vezGetDeviceQueue; pub const getDeviceGraphicsQueue = l0.vezGetDeviceGraphicsQueue; pub const getDeviceComputeQueue = l0.vezGetDeviceComputeQueue; pub const getDeviceTransferQueue = l0.vezGetDeviceTransferQueue; // Swapchain pub const createSwapchain = l0.vezCreateSwapchain; pub const destroySwapchain = l0.vezDestroySwapchain; pub const getSwapchainSurfaceFormat = l0.vezGetSwapchainSurfaceFormat; pub const swapchainSetVSync = l0.vezSwapchainSetVSync; // Queue functions. pub const queueSubmit = l0.vezQueueSubmit; pub const queuePresent = l0.vezQueuePresent; pub const queueWaitIdle = l0.vezQueueWaitIdle; // Synchronization primitives functions. pub const destroyFence = l0.vezDestroyFence; pub const getFenceStatus = l0.vezGetFenceStatus; pub const waitForFences = l0.vezWaitForFences; pub const destroySemaphore = l0.vezDestroySemaphore; pub const createEvent = l0.vezCreateEvent; pub const destroyEvent = l0.vezDestroyEvent; pub const getEventStatus = l0.vezGetEventStatus; pub const setEvent = l0.vezSetEvent; pub const resetEvent = l0.vezResetEvent; // Query pool functions. pub const createQueryPool = l0.vezCreateQueryPool; pub const destroyQueryPool = l0.vezDestroyQueryPool; pub const getQueryPoolResults = l0.vezGetQueryPoolResults; // Shader module and pipeline functions. pub const createShaderModule = l0.vezCreateShaderModule; pub const destroyShaderModule = l0.vezDestroyShaderModule; pub const getShaderModuleInfoLog = l0.vezGetShaderModuleInfoLog; pub const getShaderModuleBinary = l0.vezGetShaderModuleBinary; pub const createGraphicsPipeline = l0.vezCreateGraphicsPipeline; pub const createComputePipeline = l0.vezCreateComputePipeline; pub const destroyPipeline = l0.vezDestroyPipeline; pub const enumeratePipelineResources = l0.vezEnumeratePipelineResources; pub const getPipelineResource = l0.vezGetPipelineResource; // Vertex input format functions. pub const createVertexInputFormat = l0.vezCreateVertexInputFormat; pub const destroyVertexInputFormat = l0.vezDestroyVertexInputFormat; // Sampler functions. pub const createSampler = l0.vezCreateSampler; pub const destroySampler = l0.vezDestroySampler; // Buffer functions. pub const createBuffer = l0.vezCreateBuffer; pub const destroyBuffer = l0.vezDestroyBuffer; pub const bufferSubData = l0.vezBufferSubData; pub const mapBuffer = l0.vezMapBuffer; pub const unmapBuffer = l0.vezUnmapBuffer; pub const flushMappedBufferRanges = l0.vezFlushMappedBufferRanges; pub const invalidateMappedBufferRanges = l0.vezInvalidateMappedBufferRanges; pub const createBufferView = l0.vezCreateBufferView; pub const destroyBufferView = l0.vezDestroyBufferView; // Image functions. pub const createImage = l0.vezCreateImage; pub const destroyImage = l0.vezDestroyImage; pub const imageSubData = l0.vezImageSubData; pub const createImageView = l0.vezCreateImageView; pub const destroyImageView = l0.vezDestroyImageView; // Framebuffer functions. pub const createFramebuffer = l0.vezCreateFramebuffer; pub const destroyFramebuffer = l0.vezDestroyFramebuffer; // Command buffer functions. pub const allocateCommandBuffers = l0.vezAllocateCommandBuffers; pub const freeCommandBuffers = l0.vezFreeCommandBuffers; pub const beginCommandBuffer = l0.vezBeginCommandBuffer; pub const endCommandBuffer = l0.vezEndCommandBuffer; pub const resetCommandBuffer = l0.vezResetCommandBuffer; pub const cmdBeginRenderPass = l0.vezCmdBeginRenderPass; pub const cmdNextSubpass = l0.vezCmdNextSubpass; pub const cmdEndRenderPass = l0.vezCmdEndRenderPass; pub const cmdBindPipeline = l0.vezCmdBindPipeline; pub const cmdPushConstants = l0.vezCmdPushConstants; pub const cmdBindBuffer = l0.vezCmdBindBuffer; pub const cmdBindBufferView = l0.vezCmdBindBufferView; pub const cmdBindImageView = l0.vezCmdBindImageView; pub const cmdBindSampler = l0.vezCmdBindSampler; pub const cmdBindVertexBuffers = l0.vezCmdBindVertexBuffers; pub const cmdBindIndexBuffer = l0.vezCmdBindIndexBuffer; pub const cmdSetVertexInputFormat = l0.vezCmdSetVertexInputFormat; pub const cmdSetViewportState = l0.vezCmdSetViewportState; pub const cmdSetInputAssemblyState = l0.vezCmdSetInputAssemblyState; pub const cmdSetRasterizationState = l0.vezCmdSetRasterizationState; pub const cmdSetMultisampleState = l0.vezCmdSetMultisampleState; pub const cmdSetDepthStencilState = l0.vezCmdSetDepthStencilState; pub const cmdSetColorBlendState = l0.vezCmdSetColorBlendState; pub const cmdSetViewport = l0.vezCmdSetViewport; pub const cmdSetScissor = l0.vezCmdSetScissor; pub const cmdSetLineWidth = l0.vezCmdSetLineWidth; pub const cmdSetDepthBias = l0.vezCmdSetDepthBias; pub const cmdSetBlendConstants = l0.vezCmdSetBlendConstants; pub const cmdSetDepthBounds = l0.vezCmdSetDepthBounds; pub const cmdSetStencilCompareMask = l0.vezCmdSetStencilCompareMask; pub const cmdSetStencilWriteMask = l0.vezCmdSetStencilWriteMask; pub const cmdSetStencilReference = l0.vezCmdSetStencilReference; pub const cmdDraw = l0.vezCmdDraw; pub const cmdDrawIndexed = l0.vezCmdDrawIndexed; pub const cmdDrawIndirect = l0.vezCmdDrawIndirect; pub const cmdDrawIndexedIndirect = l0.vezCmdDrawIndexedIndirect; pub const cmdDispatch = l0.vezCmdDispatch; pub const cmdDispatchIndirect = l0.vezCmdDispatchIndirect; pub const cmdCopyBuffer = l0.vezCmdCopyBuffer; pub const cmdCopyImage = l0.vezCmdCopyImage; pub const cmdBlitImage = l0.vezCmdBlitImage; pub const cmdCopyBufferToImage = l0.vezCmdCopyBufferToImage; pub const cmdCopyImageToBuffer = l0.vezCmdCopyImageToBuffer; pub const cmdUpdateBuffer = l0.vezCmdUpdateBuffer; pub const cmdFillBuffer = l0.vezCmdFillBuffer; pub const cmdClearColorImage = l0.vezCmdClearColorImage; pub const cmdClearDepthStencilImage = l0.vezCmdClearDepthStencilImage; pub const cmdClearAttachments = l0.vezCmdClearAttachments; pub const cmdResolveImage = l0.vezCmdResolveImage; pub const cmdSetEvent = l0.vezCmdSetEvent; pub const cmdResetEvent = l0.vezCmdResetEvent;
src/lib/vez-l1.zig
const std = @import("std"); const debug = std.debug; const io = std.io; const mem = std.mem; const testing = std.testing; pub const args = @import("clap/args.zig"); test "clap" { _ = args; _ = ComptimeClap; _ = StreamingClap; } pub const ComptimeClap = @import("clap/comptime.zig").ComptimeClap; pub const StreamingClap = @import("clap/streaming.zig").StreamingClap; /// The names a ::Param can have. pub const Names = struct { /// '-' prefix short: ?u8 = null, /// '--' prefix long: ?[]const u8 = null, }; /// Whether a param takes no value (a flag), one value, or can be specified multiple times. pub const Values = enum { None, One, Many, }; /// Represents a parameter for the command line. /// Parameters come in three kinds: /// * Short ("-a"): Should be used for the most commonly used parameters in your program. /// * They can take a value three different ways. /// * "-a value" /// * "-a=value" /// * "-avalue" /// * They chain if they don't take values: "-abc". /// * The last given parameter can take a value in the same way that a single parameter can: /// * "-abc value" /// * "-abc=value" /// * "-abcvalue" /// * Long ("--long-param"): Should be used for less common parameters, or when no single character /// can describe the paramter. /// * They can take a value two different ways. /// * "--long-param value" /// * "--long-param=value" /// * Positional: Should be used as the primary parameter of the program, like a filename or /// an expression to parse. /// * Positional parameters have both names.long and names.short == null. /// * Positional parameters must take a value. pub fn Param(comptime Id: type) type { return struct { id: Id = Id{}, names: Names = Names{}, takes_value: Values = .None, }; } /// Takes a string and parses it to a Param(Help). /// This is the reverse of 'help' but for at single parameter only. pub fn parseParam(line: []const u8) !Param(Help) { var z: usize = 0; var res = Param(Help){ .id = Help{ // For testing, i want to be able to easily compare slices just by pointer, // so I slice by a runtime value here, so that zig does not optimize this // out. Maybe I should write the test better, geeh. .msg = line[z..z], .value = line[z..z], }, }; var it = mem.tokenize(line, " \t"); var param_str = it.next() orelse return error.NoParamFound; if (!mem.startsWith(u8, param_str, "--") and mem.startsWith(u8, param_str, "-")) { const found_comma = param_str[param_str.len - 1] == ','; if (found_comma) param_str = param_str[0 .. param_str.len - 1]; if (param_str.len != 2) return error.InvalidShortParam; res.names.short = param_str[1]; if (!found_comma) { var help_msg = it.rest(); if (it.next()) |next| blk: { if (mem.startsWith(u8, next, "<")) { const start = mem.indexOfScalar(u8, help_msg, '<').? + 1; const len = mem.indexOfScalar(u8, help_msg[start..], '>') orelse break :blk; res.id.value = help_msg[start..][0..len]; if (mem.startsWith(u8, help_msg[start + len + 1 ..], "...")) { res.takes_value = .Many; help_msg = help_msg[start + len + 1 + 3 ..]; } else { res.takes_value = .One; help_msg = help_msg[start + len + 1 ..]; } } } res.id.msg = mem.trim(u8, help_msg, " \t"); return res; } param_str = it.next() orelse return error.NoParamFound; } if (mem.startsWith(u8, param_str, "--")) { res.names.long = param_str[2..]; if (param_str[param_str.len - 1] == ',') return error.TrailingComma; var help_msg = it.rest(); if (it.next()) |next| blk: { if (mem.startsWith(u8, next, "<")) { const start = mem.indexOfScalar(u8, help_msg, '<').? + 1; const len = mem.indexOfScalar(u8, help_msg[start..], '>') orelse break :blk; res.id.value = help_msg[start..][0..len]; if (mem.startsWith(u8, help_msg[start + len + 1 ..], "...")) { res.takes_value = .Many; help_msg = help_msg[start + len + 1 + 3 ..]; } else { res.takes_value = .One; help_msg = help_msg[start + len + 1 ..]; } } } res.id.msg = mem.trim(u8, help_msg, " \t"); return res; } return error.NoParamFound; } test "parseParam" { var z: usize = 0; var text: []const u8 = "-s, --long <value> Help text"; testing.expectEqual(Param(Help){ .id = Help{ .msg = find(text, "Help text"), .value = find(text, "value"), }, .names = Names{ .short = 's', .long = find(text, "long"), }, .takes_value = .One, }, try parseParam(text)); text = "-s, --long <value>... Help text"; testing.expectEqual(Param(Help){ .id = Help{ .msg = find(text, "Help text"), .value = find(text, "value"), }, .names = Names{ .short = 's', .long = find(text, "long"), }, .takes_value = .Many, }, try parseParam(text)); text = "--long <value> Help text"; testing.expectEqual(Param(Help){ .id = Help{ .msg = find(text, "Help text"), .value = find(text, "value"), }, .names = Names{ .short = null, .long = find(text, "long"), }, .takes_value = .One, }, try parseParam(text)); text = "-s <value> Help text"; testing.expectEqual(Param(Help){ .id = Help{ .msg = find(text, "Help text"), .value = find(text, "value"), }, .names = Names{ .short = 's', .long = null, }, .takes_value = .One, }, try parseParam(text)); text = "-s, --long Help text"; testing.expectEqual(Param(Help){ .id = Help{ .msg = find(text, "Help text"), .value = text[z..z], }, .names = Names{ .short = 's', .long = find(text, "long"), }, .takes_value = .None, }, try parseParam(text)); text = "-s Help text"; testing.expectEqual(Param(Help){ .id = Help{ .msg = find(text, "Help text"), .value = text[z..z], }, .names = Names{ .short = 's', .long = null, }, .takes_value = .None, }, try parseParam(text)); text = "--long Help text"; testing.expectEqual(Param(Help){ .id = Help{ .msg = find(text, "Help text"), .value = text[z..z], }, .names = Names{ .short = null, .long = find(text, "long"), }, .takes_value = .None, }, try parseParam(text)); text = "--long <A | B> Help text"; testing.expectEqual(Param(Help){ .id = Help{ .msg = find(text, "Help text"), .value = find(text, "A | B"), }, .names = Names{ .short = null, .long = find(text, "long"), }, .takes_value = .One, }, try parseParam(text)); testing.expectError(error.NoParamFound, parseParam("Help")); testing.expectError(error.TrailingComma, parseParam("--long, Help")); testing.expectError(error.NoParamFound, parseParam("-s, Help")); testing.expectError(error.InvalidShortParam, parseParam("-ss Help")); testing.expectError(error.InvalidShortParam, parseParam("-ss <value> Help")); testing.expectError(error.InvalidShortParam, parseParam("- Help")); } fn find(str: []const u8, f: []const u8) []const u8 { const i = mem.indexOf(u8, str, f).?; return str[i..][0..f.len]; } pub fn Args(comptime Id: type, comptime params: []const Param(Id)) type { return struct { arena: std.heap.ArenaAllocator, clap: ComptimeClap(Id, params), exe_arg: ?[]const u8, pub fn deinit(a: *@This()) void { a.clap.deinit(); a.arena.deinit(); } pub fn flag(a: @This(), comptime name: []const u8) bool { return a.clap.flag(name); } pub fn option(a: @This(), comptime name: []const u8) ?[]const u8 { return a.clap.option(name); } pub fn options(a: @This(), comptime name: []const u8) []const []const u8 { return a.clap.options(name); } pub fn positionals(a: @This()) []const []const u8 { return a.clap.positionals(); } }; } /// Parses the command line arguments passed into the program based on an /// array of `Param`s. pub fn parse( comptime Id: type, comptime params: []const Param(Id), allocator: *mem.Allocator, ) !Args(Id, params) { var iter = try args.OsIterator.init(allocator); const clap = try ComptimeClap(Id, params).parse(allocator, args.OsIterator, &iter); return Args(Id, params){ .arena = iter.arena, .clap = clap, .exe_arg = iter.exe_arg, }; } /// Will print a help message in the following format: /// -s, --long <valueText> helpText /// -s, helpText /// -s <valueText> helpText /// --long helpText /// --long <valueText> helpText pub fn helpFull( stream: anytype, comptime Id: type, params: []const Param(Id), comptime Error: type, context: anytype, helpText: fn (@TypeOf(context), Param(Id)) Error![]const u8, valueText: fn (@TypeOf(context), Param(Id)) Error![]const u8, ) !void { const max_spacing = blk: { var res: usize = 0; for (params) |param| { var counting_stream = io.countingOutStream(io.null_out_stream); try printParam(counting_stream.outStream(), Id, param, Error, context, valueText); if (res < counting_stream.bytes_written) res = @intCast(usize, counting_stream.bytes_written); } break :blk res; }; for (params) |param| { if (param.names.short == null and param.names.long == null) continue; var counting_stream = io.countingOutStream(stream); try stream.print("\t", .{}); try printParam(counting_stream.outStream(), Id, param, Error, context, valueText); try stream.writeByteNTimes(' ', max_spacing - @intCast(usize, counting_stream.bytes_written)); try stream.print("\t{}\n", .{try helpText(context, param)}); } } fn printParam( stream: anytype, comptime Id: type, param: Param(Id), comptime Error: type, context: anytype, valueText: fn (@TypeOf(context), Param(Id)) Error![]const u8, ) !void { if (param.names.short) |s| { try stream.print("-{c}", .{s}); } else { try stream.print(" ", .{}); } if (param.names.long) |l| { if (param.names.short) |_| { try stream.print(", ", .{}); } else { try stream.print(" ", .{}); } try stream.print("--{}", .{l}); } switch (param.takes_value) { .None => {}, .One => try stream.print(" <{}>", .{valueText(context, param)}), .Many => try stream.print(" <{}>...", .{valueText(context, param)}), } } /// A wrapper around helpFull for simple helpText and valueText functions that /// cant return an error or take a context. pub fn helpEx( stream: anytype, comptime Id: type, params: []const Param(Id), helpText: fn (Param(Id)) []const u8, valueText: fn (Param(Id)) []const u8, ) !void { const Context = struct { helpText: fn (Param(Id)) []const u8, valueText: fn (Param(Id)) []const u8, pub fn help(c: @This(), p: Param(Id)) error{}![]const u8 { return c.helpText(p); } pub fn value(c: @This(), p: Param(Id)) error{}![]const u8 { return c.valueText(p); } }; return helpFull( stream, Id, params, error{}, Context{ .helpText = helpText, .valueText = valueText, }, Context.help, Context.value, ); } pub const Help = struct { msg: []const u8 = "", value: []const u8 = "", }; /// A wrapper around helpEx that takes a Param(Help). pub fn help(stream: anytype, params: []const Param(Help)) !void { try helpEx(stream, Help, params, getHelpSimple, getValueSimple); } fn getHelpSimple(param: Param(Help)) []const u8 { return param.id.msg; } fn getValueSimple(param: Param(Help)) []const u8 { return param.id.value; } test "clap.help" { var buf: [1024]u8 = undefined; var slice_stream = io.fixedBufferStream(&buf); @setEvalBranchQuota(10000); try help( slice_stream.outStream(), comptime &[_]Param(Help){ parseParam("-a Short flag. ") catch unreachable, parseParam("-b <V1> Short option.") catch unreachable, parseParam("--aa Long flag. ") catch unreachable, parseParam("--bb <V2> Long option. ") catch unreachable, parseParam("-c, --cc Both flag. ") catch unreachable, parseParam("-d, --dd <V3> Both option. ") catch unreachable, parseParam("-d, --dd <V3>... Both repeated option. ") catch unreachable, Param(Help){ .id = Help{ .msg = "Positional. This should not appear in the help message.", }, .takes_value = .One, }, }, ); const expected = "" ++ "\t-a \tShort flag.\n" ++ "\t-b <V1> \tShort option.\n" ++ "\t --aa \tLong flag.\n" ++ "\t --bb <V2> \tLong option.\n" ++ "\t-c, --cc \tBoth flag.\n" ++ "\t-d, --dd <V3> \tBoth option.\n" ++ "\t-d, --dd <V3>...\tBoth repeated option.\n"; const actual = slice_stream.getWritten(); if (!mem.eql(u8, actual, expected)) { debug.warn("\n============ Expected ============\n", .{}); debug.warn("{}", .{expected}); debug.warn("============= Actual =============\n", .{}); debug.warn("{}", .{actual}); var buffer: [1024 * 2]u8 = undefined; var fba = std.heap.FixedBufferAllocator.init(&buffer); debug.warn("============ Expected (escaped) ============\n", .{}); debug.warn("{x}\n", .{expected}); debug.warn("============ Actual (escaped) ============\n", .{}); debug.warn("{x}\n", .{actual}); testing.expect(false); } } /// Will print a usage message in the following format: /// [-abc] [--longa] [-d <valueText>] [--longb <valueText>] <valueText> /// /// First all none value taking parameters, which have a short name are /// printed, then non positional parameters and finally the positinal. pub fn usageFull( stream: anytype, comptime Id: type, params: []const Param(Id), comptime Error: type, context: anytype, valueText: fn (@TypeOf(context), Param(Id)) Error![]const u8, ) !void { var cos = io.countingOutStream(stream); const cs = cos.outStream(); for (params) |param| { const name = param.names.short orelse continue; if (param.takes_value != .None) continue; if (cos.bytes_written == 0) try stream.writeAll("[-"); try cs.writeByte(name); } if (cos.bytes_written != 0) try cs.writeByte(']'); var positional: ?Param(Id) = null; for (params) |param| { if (param.takes_value == .None and param.names.short != null) continue; const prefix = if (param.names.short) |_| "-" else "--"; // Seems the zig compiler is being a little wierd. I doesn't allow me to write // @as(*const [1]u8, s) VVVVVVVVVVVVVVVVVVVVVVVVVVVVVV const name = if (param.names.short) |*s| @ptrCast([*]const u8, s)[0..1] else param.names.long orelse { positional = param; continue; }; if (cos.bytes_written != 0) try cs.writeByte(' '); try cs.print("[{}{}", .{ prefix, name }); switch (param.takes_value) { .None => {}, .One => try cs.print(" <{}>", .{try valueText(context, param)}), .Many => try cs.print(" <{}>...", .{try valueText(context, param)}), } try cs.writeByte(']'); } if (positional) |p| { if (cos.bytes_written != 0) try cs.writeByte(' '); try cs.print("<{}>", .{try valueText(context, p)}); } } /// A wrapper around usageFull for a simple valueText functions that /// cant return an error or take a context. pub fn usageEx( stream: anytype, comptime Id: type, params: []const Param(Id), valueText: fn (Param(Id)) []const u8, ) !void { const Context = struct { valueText: fn (Param(Id)) []const u8, pub fn value(c: @This(), p: Param(Id)) error{}![]const u8 { return c.valueText(p); } }; return usageFull( stream, Id, params, error{}, Context{ .valueText = valueText }, Context.value, ); } /// A wrapper around usageEx that takes a Param(Help). pub fn usage(stream: anytype, params: []const Param(Help)) !void { try usageEx(stream, Help, params, getValueSimple); } fn testUsage(expected: []const u8, params: []const Param(Help)) !void { var buf: [1024]u8 = undefined; var fbs = io.fixedBufferStream(&buf); try usage(fbs.outStream(), params); const actual = fbs.getWritten(); if (!mem.eql(u8, actual, expected)) { debug.warn("\n============ Expected ============\n", .{}); debug.warn("{}\n", .{expected}); debug.warn("============= Actual =============\n", .{}); debug.warn("{}\n", .{actual}); var buffer: [1024 * 2]u8 = undefined; var fba = std.heap.FixedBufferAllocator.init(&buffer); debug.warn("============ Expected (escaped) ============\n", .{}); debug.warn("{x}\n", .{expected}); debug.warn("============ Actual (escaped) ============\n", .{}); debug.warn("{x}\n", .{actual}); testing.expect(false); } } test "usage" { @setEvalBranchQuota(100000); try testUsage("[-ab]", comptime &[_]Param(Help){ parseParam("-a") catch unreachable, parseParam("-b") catch unreachable, }); try testUsage("[-a <value>] [-b <v>]", comptime &[_]Param(Help){ parseParam("-a <value>") catch unreachable, parseParam("-b <v>") catch unreachable, }); try testUsage("[--a] [--b]", comptime &[_]Param(Help){ parseParam("--a") catch unreachable, parseParam("--b") catch unreachable, }); try testUsage("[--a <value>] [--b <v>]", comptime &[_]Param(Help){ parseParam("--a <value>") catch unreachable, parseParam("--b <v>") catch unreachable, }); try testUsage("<file>", comptime &[_]Param(Help){ Param(Help){ .id = Help{ .value = "file", }, .takes_value = .One, }, }); try testUsage("[-ab] [-c <value>] [-d <v>] [--e] [--f] [--g <value>] [--h <v>] [-i <v>...] <file>", comptime &[_]Param(Help){ parseParam("-a") catch unreachable, parseParam("-b") catch unreachable, parseParam("-c <value>") catch unreachable, parseParam("-d <v>") catch unreachable, parseParam("--e") catch unreachable, parseParam("--f") catch unreachable, parseParam("--g <value>") catch unreachable, parseParam("--h <v>") catch unreachable, parseParam("-i <v>...") catch unreachable, Param(Help){ .id = Help{ .value = "file", }, .takes_value = .One, }, }); }
tools/zig-clap/clap.zig
const std = @import("std"); const token = @import("../token.zig"); const ast = @import("../ast.zig"); const fieldNames = std.meta.fieldNames; const eq = std.mem.eq; const TokenError = token.TokenError; const Token = token.Token; const Kind = Token.Kind; const Ast = ast.Ast; pub const Block = @import("./op.zig"); const Op = @import("./op.zig").@"Type"; const Kw = @import("./kw.zig").Kw; pub const @"Type" = union(enum) { pub const Self = @This(); const tv = .{ "true", "True", "TRUE" }; const fv = .{ "false", "False", "FALSE" }; seq, none, ident: []const u8, int: usize, float: f32, byte: u8, str: []const u8, bool: bool, pub fn isType(ty: []const u8) TokenError!?@"Type" { var squote = false; var dquote = false; var bracket = false; var braces = false; var wd: [32]u8 = undefined; var ct = 0; while (ty.next()) |ch| { if (ct == 0) { switch (ch) { '\'' => squote = true, '"' => dquote = true, '[' => bracket = true, '{' => braces = true, 'A'...'Z', 'a'...'z', '_', '0'...'9' => { wd.append(ch); continue; }, else => return TokenError.UnexpectedToken, } } else { switch (ch) { '\'' => if (squote) { return @"Type"{ .byte = wd }; } else { return @"Type"{ .ident = wd }; }, '"' => if (dquote) { return @"Type"{ .str = wd }; } else { dquote = true; }, '}' => if (bracket) { return @"Type"{ .seq = wd }; } else { dquote = true; }, '}' => if (bracket) { return @"Type"{ .seq = wd }; } else { dquote = true; }, 'A'...'Z', 'a'...'z', '_', '0'...'9' => { wd.append(ch); continue; }, ' ' => return @"Type"{ .ident = wd }, else => return TokenError.UnexpectedToken, } } ct += 1; } switch (ty[0]) { 'A'...'Z', 'a'...'z', '_', '0'...'9' => { return @"Type"{ .ident = ty }; }, } } pub fn toStr(ty: @"Type") []const u8 { return switch (ty) { .none => |_| std.meta.tagName(.none), .ident => |_| std.meta.tagName(.ident), .byte => |_| std.meta.tagName(.byte), .seq => std.meta.tagName(.seq), .int => |_| std.meta.tagName(.int), .float => |_| std.meta.tagName(.float), .str => |_| std.meta.tagName(.str), .bool => |bln| switch (bln) { true => "bool:t", false => "bool:f", }, }; } pub fn isBool(inp: []const u8) ?@"Type" { inline for (tv) |tval| { if (eq(u8, inp, tval)) { return @"Type"{ .bool = true }; } } inline for (fv) |fval| { if (eq(u8, inp, fval)) { return @"Type"{ .bool = true }; } } return null; } };
src/lang/token/type.zig
const std = @import("std"); const prot = @import("../protocols.zig"); const Context = @import("../client.zig").Context; const Object = @import("../client.zig").Object; const Positioner = @import("../positioner.zig").Positioner; const Rectangle = @import("../rectangle.zig").Rectangle; const Window = @import("../window.zig").Window; const XdgConfigurations = @import("../window.zig").XdgConfigurations; fn destroy(context: *Context, xdg_surface: Object) anyerror!void { const window = @intToPtr(*Window, xdg_surface.container); window.xdg_surface_id = null; try prot.wl_display_send_delete_id(context.client.wl_display, xdg_surface.id); try context.unregister(xdg_surface); } fn get_toplevel(context: *Context, xdg_surface: Object, new_id: u32) anyerror!void { std.debug.warn("get_toplevel: {}\n", .{new_id}); const window = @intToPtr(*Window, xdg_surface.container); window.xdg_toplevel_id = new_id; const xdg_toplevel = prot.new_xdg_toplevel(new_id, context, @ptrToInt(window)); var array = [_]u32{}; const serial = window.client.nextSerial(); try prot.xdg_toplevel_send_configure(xdg_toplevel, 0, 0, array[0..array.len]); try prot.xdg_surface_send_configure(xdg_surface, serial); try context.register(xdg_toplevel); } fn get_popup(context: *Context, xdg_surface: Object, new_id: u32, parent_wl_surface: ?Object, xdg_positioner: Object) anyerror!void { const window = @intToPtr(*Window, xdg_surface.container); const positioner = @intToPtr(*Positioner, xdg_positioner.container); if (parent_wl_surface) |parent| { const parent_window = @intToPtr(*Window, parent.container); window.parent = parent_window; parent_window.popup = window; } else { if (window.parent) |parent| { parent.popup = null; } window.parent = null; } window.positioner = positioner; window.xdg_popup_id = new_id; const xdg_popup = prot.new_xdg_popup(new_id, context, @ptrToInt(window)); const serial = window.client.nextSerial(); try prot.xdg_popup_send_configure(xdg_popup, positioner.anchor_rect.x, positioner.anchor_rect.y, positioner.width, positioner.height); try prot.xdg_surface_send_configure(xdg_surface, serial); try context.register(xdg_popup); } fn set_window_geometry(context: *Context, xdg_surface: Object, x: i32, y: i32, width: i32, height: i32) anyerror!void { const window = @intToPtr(*Window, xdg_surface.container); window.window_geometry = Rectangle{ .x = x, .y = y, .width = width, .height = height, }; } fn ack_configure(context: *Context, xdg_surface: Object, serial: u32) anyerror!void { const window = @intToPtr(*Window, xdg_surface.container); while (window.xdg_configurations.readItem()) |xdg_configuration| { if (serial == xdg_configuration.serial) { switch (xdg_configuration.operation) { .Maximize => { if (window.maximized == null) { window.pending().x = 0; window.pending().y = 0; window.maximized = Rectangle{ .x = window.current().x, .y = window.current().y, .width = if (window.window_geometry) |wg| wg.width else window.width, .height = if (window.window_geometry) |wg| wg.height else window.height, }; } }, .Unmaximize => { if (window.maximized) |maximized| { window.pending().x = maximized.x; window.pending().y = maximized.y; window.maximized = null; } }, } } } window.xdg_configurations = XdgConfigurations.init(); } pub fn init() void { prot.XDG_SURFACE = prot.xdg_surface_interface{ .destroy = destroy, .get_toplevel = get_toplevel, .get_popup = get_popup, .set_window_geometry = set_window_geometry, .ack_configure = ack_configure, }; }
src/implementations/xdg_surface.zig
const mulo = @import("mulo.zig"); const testing = @import("std").testing; // ported from https://github.com/llvm-mirror/compiler-rt/tree/release_80/test/builtins/Unit fn test__mulosi4(a: i32, b: i32, expected: i32, expected_overflow: c_int) !void { var overflow: c_int = undefined; const x = mulo.__mulosi4(a, b, &overflow); try testing.expect(overflow == expected_overflow and (expected_overflow != 0 or x == expected)); } test "mulosi4" { try test__mulosi4(0, 0, 0, 0); try test__mulosi4(0, 1, 0, 0); try test__mulosi4(1, 0, 0, 0); try test__mulosi4(0, 10, 0, 0); try test__mulosi4(10, 0, 0, 0); try test__mulosi4(0, 0x1234567, 0, 0); try test__mulosi4(0x1234567, 0, 0, 0); try test__mulosi4(0, -1, 0, 0); try test__mulosi4(-1, 0, 0, 0); try test__mulosi4(0, -10, 0, 0); try test__mulosi4(-10, 0, 0, 0); try test__mulosi4(0, -0x1234567, 0, 0); try test__mulosi4(-0x1234567, 0, 0, 0); try test__mulosi4(1, 1, 1, 0); try test__mulosi4(1, 10, 10, 0); try test__mulosi4(10, 1, 10, 0); try test__mulosi4(1, 0x1234567, 0x1234567, 0); try test__mulosi4(0x1234567, 1, 0x1234567, 0); try test__mulosi4(1, -1, -1, 0); try test__mulosi4(1, -10, -10, 0); try test__mulosi4(-10, 1, -10, 0); try test__mulosi4(1, -0x1234567, -0x1234567, 0); try test__mulosi4(-0x1234567, 1, -0x1234567, 0); try test__mulosi4(0x7FFFFFFF, -2, @bitCast(i32, @as(u32, 0x80000001)), 1); try test__mulosi4(-2, 0x7FFFFFFF, @bitCast(i32, @as(u32, 0x80000001)), 1); try test__mulosi4(0x7FFFFFFF, -1, @bitCast(i32, @as(u32, 0x80000001)), 0); try test__mulosi4(-1, 0x7FFFFFFF, @bitCast(i32, @as(u32, 0x80000001)), 0); try test__mulosi4(0x7FFFFFFF, 0, 0, 0); try test__mulosi4(0, 0x7FFFFFFF, 0, 0); try test__mulosi4(0x7FFFFFFF, 1, 0x7FFFFFFF, 0); try test__mulosi4(1, 0x7FFFFFFF, 0x7FFFFFFF, 0); try test__mulosi4(0x7FFFFFFF, 2, @bitCast(i32, @as(u32, 0x80000001)), 1); try test__mulosi4(2, 0x7FFFFFFF, @bitCast(i32, @as(u32, 0x80000001)), 1); try test__mulosi4(@bitCast(i32, @as(u32, 0x80000000)), -2, @bitCast(i32, @as(u32, 0x80000000)), 1); try test__mulosi4(-2, @bitCast(i32, @as(u32, 0x80000000)), @bitCast(i32, @as(u32, 0x80000000)), 1); try test__mulosi4(@bitCast(i32, @as(u32, 0x80000000)), -1, @bitCast(i32, @as(u32, 0x80000000)), 1); try test__mulosi4(-1, @bitCast(i32, @as(u32, 0x80000000)), @bitCast(i32, @as(u32, 0x80000000)), 1); try test__mulosi4(@bitCast(i32, @as(u32, 0x80000000)), 0, 0, 0); try test__mulosi4(0, @bitCast(i32, @as(u32, 0x80000000)), 0, 0); try test__mulosi4(@bitCast(i32, @as(u32, 0x80000000)), 1, @bitCast(i32, @as(u32, 0x80000000)), 0); try test__mulosi4(1, @bitCast(i32, @as(u32, 0x80000000)), @bitCast(i32, @as(u32, 0x80000000)), 0); try test__mulosi4(@bitCast(i32, @as(u32, 0x80000000)), 2, @bitCast(i32, @as(u32, 0x80000000)), 1); try test__mulosi4(2, @bitCast(i32, @as(u32, 0x80000000)), @bitCast(i32, @as(u32, 0x80000000)), 1); try test__mulosi4(@bitCast(i32, @as(u32, 0x80000001)), -2, @bitCast(i32, @as(u32, 0x80000001)), 1); try test__mulosi4(-2, @bitCast(i32, @as(u32, 0x80000001)), @bitCast(i32, @as(u32, 0x80000001)), 1); try test__mulosi4(@bitCast(i32, @as(u32, 0x80000001)), -1, 0x7FFFFFFF, 0); try test__mulosi4(-1, @bitCast(i32, @as(u32, 0x80000001)), 0x7FFFFFFF, 0); try test__mulosi4(@bitCast(i32, @as(u32, 0x80000001)), 0, 0, 0); try test__mulosi4(0, @bitCast(i32, @as(u32, 0x80000001)), 0, 0); try test__mulosi4(@bitCast(i32, @as(u32, 0x80000001)), 1, @bitCast(i32, @as(u32, 0x80000001)), 0); try test__mulosi4(1, @bitCast(i32, @as(u32, 0x80000001)), @bitCast(i32, @as(u32, 0x80000001)), 0); try test__mulosi4(@bitCast(i32, @as(u32, 0x80000001)), 2, @bitCast(i32, @as(u32, 0x80000000)), 1); try test__mulosi4(2, @bitCast(i32, @as(u32, 0x80000001)), @bitCast(i32, @as(u32, 0x80000000)), 1); }
lib/std/special/compiler_rt/mulosi4_test.zig
// Implemented features: // [X] Renderer: User texture binding. Use 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID! // [x] Renderer: Desktop GL only: Support for large meshes (64k+ vertices) with 16-bit indices. // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this. // If you are new to dear imgui, read examples/README.txt and read the documentation at the top of imgui.cpp. // https://github.com/ocornut/imgui //---------------------------------------- // OpenGL GLSL GLSL // version version string //---------------------------------------- // 2.0 110 "#version 110" // 2.1 120 "#version 120" // 3.0 130 "#version 130" // 3.1 140 "#version 140" // 3.2 150 "#version 150" // 3.3 330 "#version 330 core" // 4.0 400 "#version 400 core" // 4.1 410 "#version 410 core" // 4.2 420 "#version 410 core" // 4.3 430 "#version 430 core" // ES 2.0 100 "#version 100" = WebGL 1.0 // ES 3.0 300 "#version 300 es" = WebGL 2.0 //---------------------------------------- const std = @import("std"); const imgui = @import("imgui"); const gl = @import("include/gl.zig"); // Desktop GL 3.2+ has glDrawElementsBaseVertex() which GL ES and WebGL don't have. const IMGUI_IMPL_OPENGL_MAY_HAVE_VTX_OFFSET = true; // OpenGL Data var g_GlVersion: gl.GLuint = 0; // Extracted at runtime using GL_MAJOR_VERSION, GL_MINOR_VERSION queries. var g_GlslVersionStringMem: [32]u8 = undefined; // Specified by user or detected based on compile time GL settings. var g_GlslVersionString: []u8 = &g_GlslVersionStringMem; // slice of g_GlslVersionStringMem var g_FontTexture: c_uint = 0; var g_ShaderHandle: c_uint = 0; var g_VertHandle: c_uint = 0; var g_FragHandle: c_uint = 0; var g_AttribLocationTex: i32 = 0; var g_AttribLocationProjMtx: i32 = 0; // Uniforms location var g_AttribLocationVtxPos: i32 = 0; var g_AttribLocationVtxUV: i32 = 0; var g_AttribLocationVtxColor: i32 = 0; // Vertex attributes location var g_VboHandle: c_uint = 0; var g_ElementsHandle: c_uint = 0; // Functions pub fn Init(glsl_version_opt: ?[:0]const u8) bool { // Query for GL version var major: gl.GLint = undefined; var minor: gl.GLint = undefined; gl.glGetIntegerv(gl.GL_MAJOR_VERSION, &major); gl.glGetIntegerv(gl.GL_MINOR_VERSION, &minor); g_GlVersion = @intCast(gl.GLuint, major * 1000 + minor); // Setup back-end capabilities flags var io = imgui.GetIO(); io.BackendRendererName = "imgui_impl_opengl3"; if (IMGUI_IMPL_OPENGL_MAY_HAVE_VTX_OFFSET) { if (g_GlVersion >= 3200) io.BackendFlags.RendererHasVtxOffset = true; // We can honor the ImDrawCmd::VtxOffset field, allowing for large meshes. } // Store GLSL version string so we can refer to it later in case we recreate shaders. // Note: GLSL version is NOT the same as GL version. Leave this to NULL if unsure. var glsl_version: [:0]const u8 = undefined; if (glsl_version_opt) |value| { glsl_version = value; } else { glsl_version = "#version 130"; } std.debug.assert(glsl_version.len + 2 < g_GlslVersionStringMem.len); std.mem.copy(u8, g_GlslVersionStringMem[0..glsl_version.len], glsl_version); g_GlslVersionStringMem[glsl_version.len] = '\n'; g_GlslVersionStringMem[glsl_version.len + 1] = 0; g_GlslVersionString = g_GlslVersionStringMem[0..glsl_version.len]; // Make a dummy GL call (we don't actually need the result) // IF YOU GET A CRASH HERE: it probably means that you haven't initialized the OpenGL function loader used by this code. // Desktop OpenGL 3/4 need a function loader. See the IMGUI_IMPL_OPENGL_LOADER_xxx explanation above. var current_texture: gl.GLint = undefined; gl.glGetIntegerv(gl.GL_TEXTURE_BINDING_2D, &current_texture); return true; } pub fn Shutdown() void { DestroyDeviceObjects(); } pub fn NewFrame() void { if (g_ShaderHandle == 0) { _ = CreateDeviceObjects(); } } fn SetupRenderState(draw_data: *imgui.DrawData, fb_width: c_int, fb_height: c_int, vertex_array_object: gl.GLuint) void { // Setup render state: alpha-blending enabled, no face culling, no depth testing, scissor enabled, polygon fill gl.glEnable(gl.GL_BLEND); gl.glBlendEquation(gl.GL_FUNC_ADD); gl.glBlendFunc(gl.GL_SRC_ALPHA, gl.GL_ONE_MINUS_SRC_ALPHA); gl.glDisable(gl.GL_CULL_FACE); gl.glDisable(gl.GL_DEPTH_TEST); gl.glEnable(gl.GL_SCISSOR_TEST); if (@hasDecl(gl, "glPolygonMode")) { gl.glPolygonMode(gl.GL_FRONT_AND_BACK, gl.GL_FILL); } // Setup viewport, orthographic projection matrix // Our visible imgui space lies from draw_data.DisplayPos (top left) to draw_data.DisplayPos+data_data.DisplaySize (bottom right). DisplayPos is (0,0) for single viewport apps. gl.glViewport(0, 0, @intCast(gl.GLsizei, fb_width), @intCast(gl.GLsizei, fb_height)); var L = draw_data.DisplayPos.x; var R = draw_data.DisplayPos.x + draw_data.DisplaySize.x; var T = draw_data.DisplayPos.y; var B = draw_data.DisplayPos.y + draw_data.DisplaySize.y; const ortho_projection = [4][4]f32{ [4]f32{ 2.0 / (R - L), 0.0, 0.0, 0.0 }, [4]f32{ 0.0, 2.0 / (T - B), 0.0, 0.0 }, [4]f32{ 0.0, 0.0, -1.0, 0.0 }, [4]f32{ (R + L) / (L - R), (T + B) / (B - T), 0.0, 1.0 }, }; gl.glUseProgram(g_ShaderHandle); gl.glUniform1i(g_AttribLocationTex, 0); gl.glUniformMatrix4fv(g_AttribLocationProjMtx, 1, gl.GL_FALSE, &ortho_projection[0][0]); if (@hasDecl(gl, "glBindSampler")) { glBindSampler(0, 0); // We use combined texture/sampler state. Applications using GL 3.3 may set that otherwise. } gl.glBindVertexArray(vertex_array_object); // Bind vertex/index buffers and setup attributes for ImDrawVert gl.glBindBuffer(gl.GL_ARRAY_BUFFER, g_VboHandle); gl.glBindBuffer(gl.GL_ELEMENT_ARRAY_BUFFER, g_ElementsHandle); gl.glEnableVertexAttribArray(@intCast(c_uint, g_AttribLocationVtxPos)); gl.glEnableVertexAttribArray(@intCast(c_uint, g_AttribLocationVtxUV)); gl.glEnableVertexAttribArray(@intCast(c_uint, g_AttribLocationVtxColor)); gl.glVertexAttribPointer( @intCast(c_uint, g_AttribLocationVtxPos), 2, gl.GL_FLOAT, gl.GL_FALSE, @sizeOf(imgui.DrawVert), @intToPtr(?*c_void, @byteOffsetOf(imgui.DrawVert, "pos")), ); gl.glVertexAttribPointer( @intCast(c_uint, g_AttribLocationVtxUV), 2, gl.GL_FLOAT, gl.GL_FALSE, @sizeOf(imgui.DrawVert), @intToPtr(?*c_void, @byteOffsetOf(imgui.DrawVert, "uv")), ); gl.glVertexAttribPointer( @intCast(c_uint, g_AttribLocationVtxColor), 4, gl.GL_UNSIGNED_BYTE, gl.GL_TRUE, @sizeOf(imgui.DrawVert), @intToPtr(?*c_void, @byteOffsetOf(imgui.DrawVert, "col")), ); } fn getGLInt(name: gl.GLenum) gl.GLint { var value: gl.GLint = undefined; gl.glGetIntegerv(name, &value); return value; } fn getGLInts(name: gl.GLenum, comptime N: comptime_int) [N]gl.GLint { var value: [N]gl.GLint = undefined; gl.glGetIntegerv(name, &value); return value; } // OpenGL3 Render function. // (this used to be set in io.RenderDrawListsFn and called by ImGui::Render(), but you can now call this directly from your main loop) // Note that this implementation is little overcomplicated because we are saving/setting up/restoring every OpenGL state explicitly, in order to be able to run within any OpenGL engine that doesn't do so. pub fn RenderDrawData(draw_data: *imgui.DrawData) void { // Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates) var fb_width = @floatToInt(c_int, draw_data.DisplaySize.x * draw_data.FramebufferScale.x); var fb_height = @floatToInt(c_int, draw_data.DisplaySize.y * draw_data.FramebufferScale.y); if (fb_width <= 0 or fb_height <= 0) return; // Backup GL state var last_active_texture = @intCast(gl.GLenum, getGLInt(gl.GL_ACTIVE_TEXTURE)); gl.glActiveTexture(gl.GL_TEXTURE0); var last_program = getGLInt(gl.GL_CURRENT_PROGRAM); var last_texture = getGLInt(gl.GL_TEXTURE_BINDING_2D); var last_sampler = if (@hasDecl(gl, "GL_SAMPLER_BINDING")) getGLInt(gl.GL_SAMPLER_BINDING) else void{}; var last_array_buffer = getGLInt(gl.GL_ARRAY_BUFFER_BINDING); var last_vertex_array_object = getGLInt(gl.GL_VERTEX_ARRAY_BINDING); var last_polygon_mode = if (@hasDecl(gl, "GL_POLYGON_MODE")) getGLInts(gl.GL_POLYGON_MODE, 2) else void{}; var last_viewport = getGLInts(gl.GL_VIEWPORT, 4); var last_scissor_box = getGLInts(gl.GL_SCISSOR_BOX, 4); var last_blend_src_rgb = @intCast(gl.GLenum, getGLInt(gl.GL_BLEND_SRC_RGB)); var last_blend_dst_rgb = @intCast(gl.GLenum, getGLInt(gl.GL_BLEND_DST_RGB)); var last_blend_src_alpha = @intCast(gl.GLenum, getGLInt(gl.GL_BLEND_SRC_ALPHA)); var last_blend_dst_alpha = @intCast(gl.GLenum, getGLInt(gl.GL_BLEND_DST_ALPHA)); var last_blend_equation_rgb = @intCast(gl.GLenum, getGLInt(gl.GL_BLEND_EQUATION_RGB)); var last_blend_equation_alpha = @intCast(gl.GLenum, getGLInt(gl.GL_BLEND_EQUATION_ALPHA)); var last_enable_blend = gl.glIsEnabled(gl.GL_BLEND); var last_enable_cull_face = gl.glIsEnabled(gl.GL_CULL_FACE); var last_enable_depth_test = gl.glIsEnabled(gl.GL_DEPTH_TEST); var last_enable_scissor_test = gl.glIsEnabled(gl.GL_SCISSOR_TEST); var clip_origin_lower_left = true; if (@hasDecl(gl, "GL_CLIP_ORIGIN") and !os.darwin.is_the_target) { var last_clip_origin = getGLInt(gl.GL_CLIP_ORIGIN); // Support for GL 4.5's glClipControl(GL_UPPER_LEFT) if (last_clip_origin == gl.GL_UPPER_LEFT) clip_origin_lower_left = false; } // Setup desired GL state // Recreate the VAO every time (this is to easily allow multiple GL contexts to be rendered to. VAO are not shared among GL contexts) // The renderer would actually work without any VAO bound, but then our VertexAttrib calls would overwrite the default one currently bound. var vertex_array_object: gl.GLuint = 0; gl.glGenVertexArrays(1, &vertex_array_object); SetupRenderState(draw_data, fb_width, fb_height, vertex_array_object); // Will project scissor/clipping rectangles into framebuffer space var clip_off = draw_data.DisplayPos; // (0,0) unless using multi-viewports var clip_scale = draw_data.FramebufferScale; // (1,1) unless using retina display which are often (2,2) // Render command lists if (draw_data.CmdListsCount > 0) { for (draw_data.CmdLists.?[0..@intCast(usize, draw_data.CmdListsCount)]) |cmd_list| { // Upload vertex/index buffers gl.glBufferData(gl.GL_ARRAY_BUFFER, @intCast(gl.GLsizeiptr, cmd_list.VtxBuffer.len * @sizeOf(imgui.DrawVert)), cmd_list.VtxBuffer.items, gl.GL_STREAM_DRAW); gl.glBufferData(gl.GL_ELEMENT_ARRAY_BUFFER, @intCast(gl.GLsizeiptr, cmd_list.IdxBuffer.len * @sizeOf(imgui.DrawIdx)), cmd_list.IdxBuffer.items, gl.GL_STREAM_DRAW); for (cmd_list.CmdBuffer.items[0..@intCast(usize, cmd_list.CmdBuffer.len)]) |pcmd| { if (pcmd.UserCallback) |fnPtr| { // User callback, registered via ImDrawList::AddCallback() // (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.) if (fnPtr == imgui.DrawCallback_ResetRenderState) { SetupRenderState(draw_data, fb_width, fb_height, vertex_array_object); } else { fnPtr(cmd_list, &pcmd); } } else { // Project scissor/clipping rectangles into framebuffer space var clip_rect = imgui.Vec4{ .x = (pcmd.ClipRect.x - clip_off.x) * clip_scale.x, .y = (pcmd.ClipRect.y - clip_off.y) * clip_scale.y, .z = (pcmd.ClipRect.z - clip_off.x) * clip_scale.x, .w = (pcmd.ClipRect.w - clip_off.y) * clip_scale.y, }; if (clip_rect.x < @intToFloat(f32, fb_width) and clip_rect.y < @intToFloat(f32, fb_height) and clip_rect.z >= 0.0 and clip_rect.w >= 0.0) { // Apply scissor/clipping rectangle if (clip_origin_lower_left) { gl.glScissor(@floatToInt(c_int, clip_rect.x), fb_height - @floatToInt(c_int, clip_rect.w), @floatToInt(c_int, clip_rect.z - clip_rect.x), @floatToInt(c_int, clip_rect.w - clip_rect.y)); } else { gl.glScissor(@floatToInt(c_int, clip_rect.x), @floatToInt(c_int, clip_rect.y), @floatToInt(c_int, clip_rect.z), @floatToInt(c_int, clip_rect.w)); // Support for GL 4.5 rarely used glClipControl(GL_UPPER_LEFT) } // Bind texture, Draw gl.glBindTexture(gl.GL_TEXTURE_2D, @intCast(gl.GLuint, @ptrToInt(pcmd.TextureId))); if (IMGUI_IMPL_OPENGL_MAY_HAVE_VTX_OFFSET and g_GlVersion >= 3200) { gl.glDrawElementsBaseVertex( gl.GL_TRIANGLES, @intCast(gl.GLsizei, pcmd.ElemCount), if (@sizeOf(imgui.DrawIdx) == 2) gl.GL_UNSIGNED_SHORT else gl.GL_UNSIGNED_INT, @intToPtr(?*const c_void, pcmd.IdxOffset * @sizeOf(imgui.DrawIdx)), @intCast(gl.GLint, pcmd.VtxOffset), ); } else { gl.glDrawElements( gl.GL_TRIANGLES, @intCast(gl.GLsizei, pcmd.ElemCount), if (@sizeOf(imgui.DrawIdx) == 2) gl.GL_UNSIGNED_SHORT else gl.GL_UNSIGNED_INT, @intToPtr(?*const c_void, pcmd.IdxOffset * @sizeOf(imgui.DrawIdx)), ); } } } } } } // Destroy the temporary VAO gl.glDeleteVertexArrays(1, &vertex_array_object); // Restore modified GL state gl.glUseProgram(@intCast(c_uint, last_program)); gl.glBindTexture(gl.GL_TEXTURE_2D, @intCast(c_uint, last_texture)); if (@hasDecl(gl, "GL_SAMPLER_BINDING")) gl.glBindSampler(0, last_sampler); gl.glActiveTexture(last_active_texture); gl.glBindVertexArray(@intCast(c_uint, last_vertex_array_object)); gl.glBindBuffer(gl.GL_ARRAY_BUFFER, @intCast(c_uint, last_array_buffer)); gl.glBlendEquationSeparate(last_blend_equation_rgb, last_blend_equation_alpha); gl.glBlendFuncSeparate(last_blend_src_rgb, last_blend_dst_rgb, last_blend_src_alpha, last_blend_dst_alpha); if (last_enable_blend != 0) gl.glEnable(gl.GL_BLEND) else gl.glDisable(gl.GL_BLEND); if (last_enable_cull_face != 0) gl.glEnable(gl.GL_CULL_FACE) else gl.glDisable(gl.GL_CULL_FACE); if (last_enable_depth_test != 0) gl.glEnable(gl.GL_DEPTH_TEST) else gl.glDisable(gl.GL_DEPTH_TEST); if (last_enable_scissor_test != 0) gl.glEnable(gl.GL_SCISSOR_TEST) else gl.glDisable(gl.GL_SCISSOR_TEST); if (@hasDecl(gl, "GL_POLYGON_MODE")) gl.glPolygonMode(gl.GL_FRONT_AND_BACK, @intCast(gl.GLenum, last_polygon_mode[0])); gl.glViewport(last_viewport[0], last_viewport[1], @intCast(gl.GLsizei, last_viewport[2]), @intCast(gl.GLsizei, last_viewport[3])); gl.glScissor(last_scissor_box[0], last_scissor_box[1], @intCast(gl.GLsizei, last_scissor_box[2]), @intCast(gl.GLsizei, last_scissor_box[3])); } fn CreateFontsTexture() bool { // Build texture atlas const io = imgui.GetIO(); var pixels: ?[*]u8 = undefined; var width: i32 = undefined; var height: i32 = undefined; io.Fonts.?.GetTexDataAsRGBA32(&pixels, &width, &height); // Load as RGBA 32-bit (75% of the memory is wasted, but default font is so small) because it is more likely to be compatible with user's existing shaders. If your ImTextureId represent a higher-level concept than just a GL texture id, consider calling GetTexDataAsAlpha8() instead to save on GPU memory. // Upload texture to graphics system var last_texture: gl.GLint = undefined; gl.glGetIntegerv(gl.GL_TEXTURE_BINDING_2D, &last_texture); gl.glGenTextures(1, &g_FontTexture); gl.glBindTexture(gl.GL_TEXTURE_2D, g_FontTexture); gl.glTexParameteri(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MIN_FILTER, gl.GL_LINEAR); gl.glTexParameteri(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MAG_FILTER, gl.GL_LINEAR); if (@hasDecl(gl, "GL_UNPACK_ROW_LENGTH")) gl.glPixelStorei(gl.GL_UNPACK_ROW_LENGTH, 0); gl.glTexImage2D(gl.GL_TEXTURE_2D, 0, gl.GL_RGBA, width, height, 0, gl.GL_RGBA, gl.GL_UNSIGNED_BYTE, pixels); // Store our identifier io.Fonts.?.TexID = @intToPtr(imgui.TextureID, g_FontTexture); // Restore state gl.glBindTexture(gl.GL_TEXTURE_2D, @intCast(c_uint, last_texture)); return true; } fn DestroyFontsTexture() void { if (g_FontTexture != 0) { const io = imgui.GetIO(); gl.glDeleteTextures(1, &g_FontTexture); io.Fonts.?.TexID = null; g_FontTexture = 0; } } // If you get an error please report on github. You may try different GL context version or GLSL version. See GL<>GLSL version table at the top of this file. fn CheckShader(handle: gl.GLuint, desc: []const u8) bool { var status: gl.GLint = 0; var log_length: gl.GLint = 0; gl.glGetShaderiv(handle, gl.GL_COMPILE_STATUS, &status); gl.glGetShaderiv(handle, gl.GL_INFO_LOG_LENGTH, &log_length); if (status == gl.GL_FALSE) std.debug.warn("ERROR: imgui_impl_opengl3.CreateDeviceObjects: failed to compile {}!\n", .{desc}); if (log_length > 1) { var buf: imgui.Vector(u8) = undefined; buf.init(); defer buf.deinit(); buf.resize(@intCast(c_int, log_length + 1)); gl.glGetShaderInfoLog(handle, log_length, null, @ptrCast([*]gl.GLchar, buf.begin())); std.debug.warn("{}\n", .{buf.begin()}); } return status != gl.GL_FALSE; } // If you get an error please report on GitHub. You may try different GL context version or GLSL version. fn CheckProgram(handle: gl.GLuint, desc: []const u8) bool { var status: gl.GLint = 0; var log_length: gl.GLint = 0; gl.glGetProgramiv(handle, gl.GL_LINK_STATUS, &status); gl.glGetProgramiv(handle, gl.GL_INFO_LOG_LENGTH, &log_length); if (status == gl.GL_FALSE) std.debug.warn("ERROR: imgui_impl_opengl3.CreateDeviceObjects: failed to link {}! (with GLSL '{}')\n", .{ desc, g_GlslVersionString }); if (log_length > 1) { var buf: imgui.Vector(u8) = undefined; buf.init(); defer buf.deinit(); buf.resize(@intCast(c_int, log_length + 1)); gl.glGetProgramInfoLog(handle, log_length, null, @ptrCast([*]gl.GLchar, buf.begin())); std.debug.warn("{}\n", .{buf.begin()}); } return status != gl.GL_FALSE; } fn CreateDeviceObjects() bool { // Backup GL state var last_texture = getGLInt(gl.GL_TEXTURE_BINDING_2D); var last_array_buffer = getGLInt(gl.GL_ARRAY_BUFFER_BINDING); var last_vertex_array = getGLInt(gl.GL_VERTEX_ARRAY_BINDING); // Parse GLSL version string var glsl_version: u32 = 130; const numberPart = g_GlslVersionStringMem["#version ".len..g_GlslVersionString.len]; if (std.fmt.parseInt(u32, numberPart, 10)) |value| { glsl_version = value; } else |err| { std.debug.warn("Couldn't parse glsl version from '{}', '{}'\n", .{ g_GlslVersionString, numberPart }); } const vertex_shader_glsl_120 = "uniform mat4 ProjMtx;\n" ++ "attribute vec2 Position;\n" ++ "attribute vec2 UV;\n" ++ "attribute vec4 Color;\n" ++ "varying vec2 Frag_UV;\n" ++ "varying vec4 Frag_Color;\n" ++ "void main()\n" ++ "{\n" ++ " Frag_UV = UV;\n" ++ " Frag_Color = Color;\n" ++ " gl_Position = ProjMtx * vec4(Position.xy,0,1);\n" ++ "}\n"; const vertex_shader_glsl_130 = "uniform mat4 ProjMtx;\n" ++ "in vec2 Position;\n" ++ "in vec2 UV;\n" ++ "in vec4 Color;\n" ++ "out vec2 Frag_UV;\n" ++ "out vec4 Frag_Color;\n" ++ "void main()\n" ++ "{\n" ++ " Frag_UV = UV;\n" ++ " Frag_Color = Color;\n" ++ " gl_Position = ProjMtx * vec4(Position.xy,0,1);\n" ++ "}\n"; const vertex_shader_glsl_300_es = "precision mediump float;\n" ++ "layout (location = 0) in vec2 Position;\n" ++ "layout (location = 1) in vec2 UV;\n" ++ "layout (location = 2) in vec4 Color;\n" ++ "uniform mat4 ProjMtx;\n" ++ "out vec2 Frag_UV;\n" ++ "out vec4 Frag_Color;\n" ++ "void main()\n" ++ "{\n" ++ " Frag_UV = UV;\n" ++ " Frag_Color = Color;\n" ++ " gl_Position = ProjMtx * vec4(Position.xy,0,1);\n" ++ "}\n"; const vertex_shader_glsl_410_core = "layout (location = 0) in vec2 Position;\n" ++ "layout (location = 1) in vec2 UV;\n" ++ "layout (location = 2) in vec4 Color;\n" ++ "uniform mat4 ProjMtx;\n" ++ "out vec2 Frag_UV;\n" ++ "out vec4 Frag_Color;\n" ++ "void main()\n" ++ "{\n" ++ " Frag_UV = UV;\n" ++ " Frag_Color = Color;\n" ++ " gl_Position = ProjMtx * vec4(Position.xy,0,1);\n" ++ "}\n"; const fragment_shader_glsl_120 = "#ifdef GL_ES\n" ++ " precision mediump float;\n" ++ "#endif\n" ++ "uniform sampler2D Texture;\n" ++ "varying vec2 Frag_UV;\n" ++ "varying vec4 Frag_Color;\n" ++ "void main()\n" ++ "{\n" ++ " gl_FragColor = Frag_Color * texture2D(Texture, Frag_UV.st);\n" ++ "}\n"; const fragment_shader_glsl_130 = "uniform sampler2D Texture;\n" ++ "in vec2 Frag_UV;\n" ++ "in vec4 Frag_Color;\n" ++ "out vec4 Out_Color;\n" ++ "void main()\n" ++ "{\n" ++ " Out_Color = Frag_Color * texture(Texture, Frag_UV.st);\n" ++ "}\n"; const fragment_shader_glsl_300_es = "precision mediump float;\n" ++ "uniform sampler2D Texture;\n" ++ "in vec2 Frag_UV;\n" ++ "in vec4 Frag_Color;\n" ++ "layout (location = 0) out vec4 Out_Color;\n" ++ "void main()\n" ++ "{\n" ++ " Out_Color = Frag_Color * texture(Texture, Frag_UV.st);\n" ++ "}\n"; const fragment_shader_glsl_410_core = "in vec2 Frag_UV;\n" ++ "in vec4 Frag_Color;\n" ++ "uniform sampler2D Texture;\n" ++ "layout (location = 0) out vec4 Out_Color;\n" ++ "void main()\n" ++ "{\n" ++ " Out_Color = Frag_Color * texture(Texture, Frag_UV.st);\n" ++ "}\n"; // Select shaders matching our GLSL versions var vertex_shader: [*]const u8 = undefined; var fragment_shader: [*]const u8 = undefined; if (glsl_version < 130) { vertex_shader = vertex_shader_glsl_120; fragment_shader = fragment_shader_glsl_120; } else if (glsl_version >= 410) { vertex_shader = vertex_shader_glsl_410_core; fragment_shader = fragment_shader_glsl_410_core; } else if (glsl_version == 300) { vertex_shader = vertex_shader_glsl_300_es; fragment_shader = fragment_shader_glsl_300_es; } else { vertex_shader = vertex_shader_glsl_130; fragment_shader = fragment_shader_glsl_130; } // Create shaders const vertex_shader_with_version = [_][*]const u8{ &g_GlslVersionStringMem, vertex_shader }; g_VertHandle = gl.glCreateShader(gl.GL_VERTEX_SHADER); gl.glShaderSource(g_VertHandle, 2, &vertex_shader_with_version, null); gl.glCompileShader(g_VertHandle); _ = CheckShader(g_VertHandle, "vertex shader"); const fragment_shader_with_version = [_][*]const u8{ &g_GlslVersionStringMem, fragment_shader }; g_FragHandle = gl.glCreateShader(gl.GL_FRAGMENT_SHADER); gl.glShaderSource(g_FragHandle, 2, &fragment_shader_with_version, null); gl.glCompileShader(g_FragHandle); _ = CheckShader(g_FragHandle, "fragment shader"); g_ShaderHandle = gl.glCreateProgram(); gl.glAttachShader(g_ShaderHandle, g_VertHandle); gl.glAttachShader(g_ShaderHandle, g_FragHandle); gl.glLinkProgram(g_ShaderHandle); _ = CheckProgram(g_ShaderHandle, "shader program"); g_AttribLocationTex = gl.glGetUniformLocation(g_ShaderHandle, "Texture"); g_AttribLocationProjMtx = gl.glGetUniformLocation(g_ShaderHandle, "ProjMtx"); g_AttribLocationVtxPos = gl.glGetAttribLocation(g_ShaderHandle, "Position"); g_AttribLocationVtxUV = gl.glGetAttribLocation(g_ShaderHandle, "UV"); g_AttribLocationVtxColor = gl.glGetAttribLocation(g_ShaderHandle, "Color"); // Create buffers gl.glGenBuffers(1, &g_VboHandle); gl.glGenBuffers(1, &g_ElementsHandle); _ = CreateFontsTexture(); // Restore modified GL state gl.glBindTexture(gl.GL_TEXTURE_2D, @intCast(c_uint, last_texture)); gl.glBindBuffer(gl.GL_ARRAY_BUFFER, @intCast(c_uint, last_array_buffer)); gl.glBindVertexArray(@intCast(c_uint, last_vertex_array)); return true; } fn DestroyDeviceObjects() void { if (g_VboHandle != 0) { gl.glDeleteBuffers(1, &g_VboHandle); g_VboHandle = 0; } if (g_ElementsHandle != 0) { gl.glDeleteBuffers(1, &g_ElementsHandle); g_ElementsHandle = 0; } if (g_ShaderHandle != 0 and g_VertHandle != 0) { gl.glDetachShader(g_ShaderHandle, g_VertHandle); } if (g_ShaderHandle != 0 and g_FragHandle != 0) { gl.glDetachShader(g_ShaderHandle, g_FragHandle); } if (g_VertHandle != 0) { gl.glDeleteShader(g_VertHandle); g_VertHandle = 0; } if (g_FragHandle != 0) { gl.glDeleteShader(g_FragHandle); g_FragHandle = 0; } if (g_ShaderHandle != 0) { gl.glDeleteProgram(g_ShaderHandle); g_ShaderHandle = 0; } DestroyFontsTexture(); }
examples/imgui_impl_opengl3.zig
const c = @cImport({ @cInclude("gsl/gsl_matrix.h"); @cInclude("gsl/gsl_blas.h"); }); const std = @import("std"); const aoc = @import("../aoc.zig"); pub const SquareMatrix = struct { var flip_matrix: ?SquareMatrix = null; matrix: *c.gsl_matrix, pub fn init(side: usize) SquareMatrix { return .{ .matrix = c.gsl_matrix_calloc(side, side), }; } pub fn deinit(self: *SquareMatrix) void { self.freeMatrix(); } inline fn freeMatrix(self: *SquareMatrix) void { c.gsl_matrix_free(self.matrix); } pub inline fn size(self: *const SquareMatrix) usize { return self.matrix.*.size1; } pub fn get(self: *const SquareMatrix, coord: aoc.Coord) f64 { return c.gsl_matrix_get(self.matrix, @intCast(usize, coord.row), @intCast(usize, coord.col)); } pub fn set(self: *SquareMatrix, coord: aoc.Coord, x: f64) void { c.gsl_matrix_set(self.matrix, @intCast(usize, coord.row), @intCast(usize, coord.col), x); } pub fn submatrix(self: *const SquareMatrix, begin: aoc.Coord, dimensions: aoc.Coord) MatrixView { return .{ .view = c.gsl_matrix_const_submatrix( self.matrix, @intCast(usize, begin.row), @intCast(usize, begin.col), @intCast(usize, dimensions.row), @intCast(usize, dimensions.col) ) }; } pub fn rotate90DegreesClockwise(self: *SquareMatrix) void { var result = SquareMatrix.init(self.size()); _ = c.gsl_blas_dgemm(c.CblasTrans, c.CblasNoTrans, 1, self.matrix, self.getFlipMatrix().matrix, 0, result.matrix); self.freeMatrix(); self.matrix = result.matrix; } pub fn flipHorizontally(self: *SquareMatrix) void { var result = SquareMatrix.init(self.size()); _ = c.gsl_blas_dgemm(c.CblasNoTrans, c.CblasNoTrans, 1, self.matrix, self.getFlipMatrix().matrix, 0, result.matrix); self.freeMatrix(); self.matrix = result.matrix; } fn getFlipMatrix(self: *SquareMatrix) SquareMatrix { if (flip_matrix != null and flip_matrix.?.size() != self.size()) { flip_matrix.?.deinit(); flip_matrix = null; } if (flip_matrix == null) { flip_matrix = SquareMatrix.init(self.size()); var i: isize = 0; while (i < self.size()) : (i += 1) { flip_matrix.?.set(aoc.Coord.init(.{i, @intCast(isize, self.size()) - i - 1}), 1); } } return flip_matrix.?; } pub fn printMatrix(self: *const SquareMatrix) void { var row: usize = 0; while (row < self.size()) : (row += 1) { var col: usize = 0; while (col < self.size()) : (col += 1) { std.debug.print("{d},", .{self.get(row, col)}); } std.debug.print("\n", .{}); } } }; pub const MatrixView = struct { view: c.gsl_matrix_const_view, pub fn equals(self: *const MatrixView, other: *const MatrixView) bool { return c.gsl_matrix_equal(&self.view.matrix, &other.view.matrix) == 1; } };
src/main/zig/lib/matrix.zig
const std = @import("std"); const utils = @import("utils"); const Allocator = std.mem.Allocator; const ArenaAllocator = std.heap.ArenaAllocator; const max = std.math.max; const min = std.math.min; const clamp = std.math.clamp; const absInt = std.math.absInt; const print = utils.print; const Line = struct { x0: i32, y0: i32, x1: i32, y1: i32, }; fn readInput(arena: *ArenaAllocator, lines_it: *utils.FileLineIterator) anyerror![]Line { var allocator = &arena.allocator; var lines = try std.ArrayList(Line).initCapacity(allocator, 4096); while (lines_it.next()) |line| { var line_it = std.mem.tokenize(u8, line, ", ->"); var coords = std.mem.zeroes([4]i32); var i: usize = 0; while (line_it.next()) |num| : (i += 1) { coords[i] = try std.fmt.parseInt(i32, num, 10); } try lines.append(Line{ .x0 = coords[0], .y0 = coords[1], .x1 = coords[2], .y1 = coords[3], }); } print("File ok :) Number of inputs: {d}", .{lines.items.len}); return lines.items; } fn pointToKey(x: i32, y: i32) u32 { const ux = @intCast(u32, x); const uy = @intCast(u32, y); return ((ux & 0xffff) << 16) | (uy & 0xffff); } fn countOverlappingPoints(arena: *ArenaAllocator, lines: []Line) anyerror!i32 { var map = std.AutoArrayHashMap(u32, i32).init(&arena.allocator); for (lines) |line| { const dx = line.x1 - line.x0; const dy = line.y1 - line.y0; const xslope = clamp(dx, -1, 1); const yslope = clamp(dy, -1, 1); const length = max(try absInt(dx), try absInt(dy)); var x = line.x0; var y = line.y0; var i: i32 = 0; while (i <= length) : (i += 1) { var key = pointToKey(x, y); var count: i32 = undefined; if (map.get(key)) |c| { count = c + 1; } else { count = 1; } try map.put(key, count); x += xslope; y += yslope; } } var overlaps: i32 = 0; for (map.values()) |value| { if (value > 1) { overlaps += 1; } } return overlaps; } fn part1(arena: *ArenaAllocator, lines: []Line) anyerror!i32 { var orthogonal = try std.ArrayList(Line).initCapacity(&arena.allocator, lines.len); for (lines) |*line| { if ((line.x0 == line.x1) or (line.y0 == line.y1)) { try orthogonal.append(line.*); } } return try countOverlappingPoints(arena, orthogonal.items); } fn part2(arena: *ArenaAllocator, lines: []Line) anyerror!i32 { return try countOverlappingPoints(arena, lines); } pub fn main() anyerror!void { var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator); defer arena.deinit(); var lines_it = try utils.iterateLinesInFile(&arena.allocator, "input.txt"); defer lines_it.deinit(); const input = try readInput(&arena, &lines_it); const part1_result = try part1(&arena, input); print("Part 1: {d}", .{part1_result}); const part2_result = try part2(&arena, input); print("Part 2: {d}", .{part2_result}); }
day5/src/main.zig
const std = @import("std"); const gpa = std.heap.c_allocator; const fs = std.fs; const u = @import("./util/index.zig"); // // pub fn collect_deps(dir: []const u8, mpath: []const u8) anyerror!u.Module { const m = try u.ModFile.init(gpa, mpath); const moduledeps = &std.ArrayList(u.Module).init(gpa); var moddir: []const u8 = undefined; for (m.deps) |d| { const p = try fs.path.join(gpa, &[_][]const u8{dir, try d.clean_path()}); const pv = try fs.path.join(gpa, &[_][]const u8{dir, "v", try d.clean_path(), d.version}); if (try u.does_file_exist(pv)) { moddir = pv; } else { u.assert(try u.does_file_exist(p), "unable to find dep: {s} {s}, please run zigmod fetch", .{d.path, d.version}); moddir = p; } switch (d.type) { .system_lib => { if (d.is_for_this()) try moduledeps.append(u.Module{ .is_sys_lib = true, .id = d.id, .name = d.path, .only_os = d.only_os, .except_os = d.except_os, .main = "", .c_include_dirs = &[_][]const u8{}, .c_source_flags = &[_][]const u8{}, .c_source_files = &[_][]const u8{}, .deps = &[_]u.Module{}, .clean_path = "", }); }, else => blk: { var dd = try collect_deps(dir, try u.concat(&[_][]const u8{moddir, "/zig.mod"})) catch |e| switch (e) { error.FileNotFound => { if (d.c_include_dirs.len > 0 or d.c_source_files.len > 0) { var mod_from = try u.Module.from(d); mod_from.id = try u.random_string(48); mod_from.clean_path = u.trim_prefix(moddir, dir)[1..]; if (mod_from.is_for_this()) try moduledeps.append(mod_from); } break :blk; }, else => e, }; dd.clean_path = u.trim_prefix(moddir, dir)[1..]; if (dd.id.len == 0) dd.id = try u.random_string(48); if (d.name.len > 0) dd.name = d.name; if (d.main.len > 0) dd.main = d.main; if (d.c_include_dirs.len > 0) dd.c_include_dirs = d.c_include_dirs; if (d.c_source_flags.len > 0) dd.c_source_flags = d.c_source_flags; if (d.c_source_files.len > 0) dd.c_source_files = d.c_source_files; if (d.only_os.len > 0) dd.only_os = d.only_os; if (d.except_os.len > 0) dd.except_os = d.except_os; if (dd.is_for_this()) try moduledeps.append(dd); }, } } return u.Module{ .is_sys_lib = false, .id = m.id, .name = m.name, .main = m.main, .c_include_dirs = m.c_include_dirs, .c_source_flags = m.c_source_flags, .c_source_files = m.c_source_files, .deps = moduledeps.items, .clean_path = "", .only_os = &[_][]const u8{}, .except_os = &[_][]const u8{}, }; }
src/common.zig
const std = @import("std"); const testing = std.testing; const f128math = @import("f128math"); const math = f128math; const inf_f32 = math.inf_f32; const nan_f32 = math.qnan_f32; const inf_f64 = math.inf_f64; const nan_f64 = math.qnan_f64; const inf_f128 = math.inf_f128; const nan_f128 = math.qnan_f128; const test_util = @import("util.zig"); const TestcaseLog2_32 = test_util.Testcase(math.log2, "log2", f32); const TestcaseLog2_64 = test_util.Testcase(math.log2, "log2", f64); const TestcaseLog2_128 = test_util.Testcase(math.log2, "log2", f128); fn tc32(input: f32, exp_output: f32) TestcaseLog2_32 { return .{ .input = input, .exp_output = exp_output }; } fn tc64(input: f64, exp_output: f64) TestcaseLog2_64 { return .{ .input = input, .exp_output = exp_output }; } fn tc128(input: f128, exp_output: f128) TestcaseLog2_128 { return .{ .input = input, .exp_output = exp_output }; } const testcases32 = [_]TestcaseLog2_32{ // zig fmt: off // Special cases tc32( 0, -inf_f32 ), tc32(-0, -inf_f32 ), tc32( 1, 0 ), tc32( 2, 1 ), tc32(-1, nan_f32 ), tc32( inf_f32, inf_f32 ), tc32(-inf_f32, nan_f32 ), tc32( nan_f32, nan_f32 ), tc32(-nan_f32, nan_f32 ), // tc32( @bitCast(f32, @as(u32, 0x7ff01234)), nan_f32 ), // TODO tc32( @bitCast(f32, @as(u32, 0xfff01234)), nan_f32 ), // Sanity cases tc32(-0x1.0223a0p+3, nan_f32 ), tc32( 0x1.161868p+2, 0x1.0f49acp+1 ), tc32(-0x1.0c34b4p+3, nan_f32 ), tc32(-0x1.a206f0p+2, nan_f32 ), tc32( 0x1.288bbcp+3, 0x1.9b2676p+1 ), // tc32( 0x1.52efd0p-1, -0x1.30b492p-1 ), // TODO: one digit off tc32(-0x1.a05cc8p-2, nan_f32 ), tc32( 0x1.1f9efap-1, -0x1.a9f89ap-1 ), tc32( 0x1.8c5db0p-1, -0x1.7a2c96p-2 ), tc32(-0x1.5b86eap-1, nan_f32 ), // zig fmt: on }; const testcases64 = [_]TestcaseLog2_64{ // zig fmt: off // Special cases tc64( 0, -inf_f64 ), tc64(-0, -inf_f64 ), tc64( 1, 0 ), tc64( 2, 1 ), tc64(-1, nan_f64 ), tc64( inf_f64, inf_f64 ), tc64(-inf_f64, nan_f64 ), tc64( nan_f64, nan_f64 ), tc64(-nan_f64, nan_f64 ), // tc64( @bitCast(f64, @as(u64, 0x7ff0123400000000)), nan_f64 ), // TODO tc64( @bitCast(f64, @as(u64, 0xfff0123400000000)), nan_f64 ), // Sanity cases tc64(-0x1.02239f3c6a8f1p+3, nan_f64 ), tc64( 0x1.161868e18bc67p+2, 0x1.0f49ac3838580p+1 ), tc64(-0x1.0c34b3e01e6e7p+3, nan_f64 ), tc64(-0x1.a206f0a19dcc4p+2, nan_f64 ), tc64( 0x1.288bbb0d6a1e6p+3, 0x1.9b26760c2a57ep+1 ), tc64( 0x1.52efd0cd80497p-1, -0x1.30b490ef684c7p-1 ), tc64(-0x1.a05cc754481d1p-2, nan_f64 ), tc64( 0x1.1f9ef934745cbp-1, -0x1.a9f89b5f5acb8p-1 ), tc64( 0x1.8c5db097f7442p-1, -0x1.7a2c947173f06p-2 ), tc64(-0x1.5b86ea8118a0ep-1, nan_f64 ), // zig fmt: on }; const testcases128 = [_]TestcaseLog2_128{ // zig fmt: off // Special cases tc128( 0, -inf_f128 ), tc128(-0, -inf_f128 ), tc128( 1, 0 ), tc128( 2, 1 ), tc128(-1, nan_f128 ), tc128( inf_f128, inf_f128 ), tc128(-inf_f128, nan_f128 ), tc128( nan_f128, nan_f128 ), tc128(-nan_f128, nan_f128 ), tc128( @bitCast(f128, @as(u128, 0x7fff1234000000000000000000000000)), nan_f128 ), tc128( @bitCast(f128, @as(u128, 0xffff1234000000000000000000000000)), nan_f128 ), // Sanity cases tc128(-0x1.02239f3c6a8f13dep+3, nan_f128 ), tc128( 0x1.161868e18bc67782p+2, 0x1.0f49ac383858069cp+1 ), tc128(-0x1.0c34b3e01e6e682cp+3, nan_f128 ), tc128(-0x1.a206f0a19dcc3948p+2, nan_f128 ), tc128( 0x1.288bbb0d6a1e5bdap+3, 0x1.9b26760c2a57dff0p+1 ), tc128( 0x1.52efd0cd80496a5ap-1, -0x1.30b490ef684c81a0p-1 ), tc128(-0x1.a05cc754481d0bd0p-2, nan_f128 ), tc128( 0x1.1f9ef934745cad60p-1, -0x1.a9f89b5f5acb87aap-1 ), tc128( 0x1.8c5db097f744257ep-1, -0x1.7a2c947173f0485cp-2 ), tc128(-0x1.5b86ea8118a0e2bcp-1, nan_f128 ), // zig fmt: on }; test "log2_32()" { try test_util.runTests(testcases32); } test "log2_64()" { try test_util.runTests(testcases64); } // test "log2_128()" { // try test_util.runTests(testcases128); // }
tests/log2.zig
const builtin = @import("builtin"); const TypeInfo = builtin.TypeInfo; const std = @import("std"); const testing = std.testing; fn testTypes(comptime types: []const type) void { inline for (types) |testType| { testing.expect(testType == @Type(@typeInfo(testType))); } } test "Type.MetaType" { testing.expect(type == @Type(TypeInfo { .Type = undefined })); testTypes([_]type {type}); } test "Type.Void" { testing.expect(void == @Type(TypeInfo { .Void = undefined })); testTypes([_]type {void}); } test "Type.Bool" { testing.expect(bool == @Type(TypeInfo { .Bool = undefined })); testTypes([_]type {bool}); } test "Type.NoReturn" { testing.expect(noreturn == @Type(TypeInfo { .NoReturn = undefined })); testTypes([_]type {noreturn}); } test "Type.Int" { testing.expect(u1 == @Type(TypeInfo { .Int = TypeInfo.Int { .is_signed = false, .bits = 1 } })); testing.expect(i1 == @Type(TypeInfo { .Int = TypeInfo.Int { .is_signed = true, .bits = 1 } })); testing.expect(u8 == @Type(TypeInfo { .Int = TypeInfo.Int { .is_signed = false, .bits = 8 } })); testing.expect(i8 == @Type(TypeInfo { .Int = TypeInfo.Int { .is_signed = true, .bits = 8 } })); testing.expect(u64 == @Type(TypeInfo { .Int = TypeInfo.Int { .is_signed = false, .bits = 64 } })); testing.expect(i64 == @Type(TypeInfo { .Int = TypeInfo.Int { .is_signed = true, .bits = 64 } })); testTypes([_]type {u8,u32,i64}); } test "Type.Float" { testing.expect(f16 == @Type(TypeInfo { .Float = TypeInfo.Float { .bits = 16 } })); testing.expect(f32 == @Type(TypeInfo { .Float = TypeInfo.Float { .bits = 32 } })); testing.expect(f64 == @Type(TypeInfo { .Float = TypeInfo.Float { .bits = 64 } })); testing.expect(f128 == @Type(TypeInfo { .Float = TypeInfo.Float { .bits = 128 } })); testTypes([_]type {f16, f32, f64, f128}); } test "Type.Pointer" { testTypes([_]type { // One Value Pointer Types *u8, *const u8, *volatile u8, *const volatile u8, *align(4) u8, *const align(4) u8, *volatile align(4) u8, *const volatile align(4) u8, *align(8) u8, *const align(8) u8, *volatile align(8) u8, *const volatile align(8) u8, *allowzero u8, *const allowzero u8, *volatile allowzero u8, *const volatile allowzero u8, *align(4) allowzero u8, *const align(4) allowzero u8, *volatile align(4) allowzero u8, *const volatile align(4) allowzero u8, // Many Values Pointer Types [*]u8, [*]const u8, [*]volatile u8, [*]const volatile u8, [*]align(4) u8, [*]const align(4) u8, [*]volatile align(4) u8, [*]const volatile align(4) u8, [*]align(8) u8, [*]const align(8) u8, [*]volatile align(8) u8, [*]const volatile align(8) u8, [*]allowzero u8, [*]const allowzero u8, [*]volatile allowzero u8, [*]const volatile allowzero u8, [*]align(4) allowzero u8, [*]const align(4) allowzero u8, [*]volatile align(4) allowzero u8, [*]const volatile align(4) allowzero u8, // Slice Types []u8, []const u8, []volatile u8, []const volatile u8, []align(4) u8, []const align(4) u8, []volatile align(4) u8, []const volatile align(4) u8, []align(8) u8, []const align(8) u8, []volatile align(8) u8, []const volatile align(8) u8, []allowzero u8, []const allowzero u8, []volatile allowzero u8, []const volatile allowzero u8, []align(4) allowzero u8, []const align(4) allowzero u8, []volatile align(4) allowzero u8, []const volatile align(4) allowzero u8, // C Pointer Types [*c]u8, [*c]const u8, [*c]volatile u8, [*c]const volatile u8, [*c]align(4) u8, [*c]const align(4) u8, [*c]volatile align(4) u8, [*c]const volatile align(4) u8, [*c]align(8) u8, [*c]const align(8) u8, [*c]volatile align(8) u8, [*c]const volatile align(8) u8, }); } test "Type.Array" { testing.expect([123]u8 == @Type(TypeInfo { .Array = TypeInfo.Array { .len = 123, .child = u8 } })); testing.expect([2]u32 == @Type(TypeInfo { .Array = TypeInfo.Array { .len = 2, .child = u32 } })); testTypes([_]type {[1]u8, [30]usize, [7]bool}); } test "Type.ComptimeFloat" { testTypes([_]type {comptime_float}); } test "Type.ComptimeInt" { testTypes([_]type {comptime_int}); } test "Type.Undefined" { testTypes([_]type {@typeOf(undefined)}); } test "Type.Null" { testTypes([_]type {@typeOf(null)}); }
test/stage1/behavior/type.zig
const std = @import("std"); const builtin = std.builtin; const warn = std.debug.warn; const assertEqual = std.testing.expectEqual; pub fn ctreduce( comptime func: anytype, comptime iterable: []@typeInfo(@TypeOf(func)).Fn.args[0].arg_type.?, comptime init: @typeInfo(@TypeOf(func)).Fn.return_type.? ) @typeInfo(@TypeOf(func)).Fn.return_type.? { comptime var ans = init; inline for (iterable) | item | { ans = func(ans, item); } return ans; } fn add8(a: u8, b: u8) u8 { return a + b; } fn mul8(a: u8, b: u8) u8 { return a * b; } test "Reduce" { comptime { comptime var A = [_]u8{1, 2, 4}; assertEqual(ctreduce(add8, &A, 0), 7); assertEqual(ctreduce(mul8, &A, 0), 0); assertEqual(ctreduce(mul8, &A, 1), 8); } warn("\r\n", .{}); } pub fn CTIterator(comptime T: type) type { return struct { iterable: []const T, index: usize = 0, len: usize, const Self = @This(); fn incr(it: *Self) void { it.index += 1; } pub fn next(it: *Self) ?*const T { if(it.index < it.len) { defer it.incr(); return &it.iterable[it.index]; } return null; } pub fn init(iter: []const T) Self { return Self{ .iterable = iter, .len = iter.len }; } }; } fn printTest(comptime T: type, comptime iter: *CTIterator(T), comptime ans: []T) void{ comptime var i: usize = 0; inline while (iter.next()) | item | { // warn("\r\n ans: {} item: {} ", .{ans[i], item.*}); assertEqual(ans[i], item.*); i += 1; } } test "Iterator" { comptime { comptime var A = [_]u8{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; comptime var iter = CTIterator(u8).init(&A); printTest(u8, &iter, &A); } warn("\r\n", .{}); } pub fn ctmap( comptime func: anytype, comptime iterable: []@typeInfo(@TypeOf(func)).Fn.args[0].arg_type.? ) CTIterator(@typeInfo(@TypeOf(func)).Fn.args[0].arg_type.?) { comptime var rtype = @typeInfo(@TypeOf(func)).Fn.args[0].arg_type.?; comptime var ans: []const rtype = &[0]rtype{}; inline for(iterable) | item, i | { ans = ans ++ &[1]rtype{ func(item) }; } return CTIterator(rtype).init(ans); } fn addOne(comptime a: u8) u8 { return a + @intCast(u8, 1); } test "Map" { comptime { comptime var A = [_]u8{'a', 'b', 'c'}; comptime var ans = [_]u8{'b', 'c', 'd'}; comptime var res = ctmap(addOne, &A); printTest(u8, &res, &ans); } warn("\r\n", .{}); } pub fn ctfilter( comptime func: anytype, comptime iterable: []@typeInfo(@TypeOf(func)).Fn.args[0].arg_type.? ) CTIterator(@typeInfo(@TypeOf(func)).Fn.args[0].arg_type.?) { comptime var rtype = @typeInfo(@TypeOf(func)).Fn.args[0].arg_type.?; comptime var ans: []const rtype = &[0]rtype{}; inline for(iterable) | item, i | { if (func(item) == true) { ans = ans ++ &[1]rtype{ item }; } } return CTIterator(rtype).init(ans); } fn isLessThan10(a: u8) bool { if ( a < 10 ){ return true; } return false; } test "Filter" { comptime { comptime var A = [_]u8{1, 'a', 2, 'b', 3, 'c', 'd', 'e'}; comptime var ans = [_]u8{1, 2, 3}; comptime var res = ctfilter(isLessThan10, &A); printTest(u8, &res, &ans); } warn("\r\n", .{}); } fn mul32 (comptime a: u32, comptime b: u32) u32 { return a * b; } pub fn starmap( comptime func: anytype, comptime iterables: []const []const @typeInfo(@TypeOf(func)).Fn.args[0].arg_type.? ) CTIterator(@typeInfo(@TypeOf(func)).Fn.args[0].arg_type.?) { const N: usize = iterables.len; const rtype = @typeInfo(@TypeOf(func)).Fn.args[0].arg_type.?; comptime var ans: []const rtype = &[0]rtype{}; comptime var i: usize = 0; comptime var args = .{}; inline while ( i < N ) : ( i += 1 ) { var a = @call(.{}, mul32, .{1, 2} ); ans = ans ++ &[1]rtype{ a }; } return CTIterator(rtype).init(ans); } // test "Starmap" { // comptime { // comptime var A = &[_][]const u32{ // &[_]u32{1, 2}, // &[_]u32{3, 4} // }; // comptime var ans = [_]u32{2, 12}; // comptime var res = starmap(mul32, A); // defer res.deinit(); // //printTest(u32, &res, &ans); // } // warn("\r\n", .{}); // }
src/ctmain.zig
const std = @import("std"); pub const sabaton = @import("../../sabaton.zig"); pub const io = sabaton.io_impl.status_uart_mmio_32; pub const panic = sabaton.panic; pub const display = @import("display.zig"); pub const ElfType = [*]u8; usingnamespace @import("regs.zig"); var page_size: u64 = 0x1000; pub fn get_page_size() u64 { return page_size; } fn delay(cycles: usize) void { var i: u32 = 0; while (i < cycles) : (i += 1) { asm volatile ("nop"); } } const VC4_CLOCK = 250*1000*1000; // 250 MHz fn minuart_calculate_baud(baudrate: u32) u32 { return VC4_CLOCK / (8 * baudrate) - 1; // the bcm2835 spec gives this formula: baudrate = vc4_clock / (8*(reg + 1)) } const GpioMode = packed enum(u3) { Input = 0b000, Output, Alt0 = 0b100, Alt1, Alt2, Alt3, Alt4 = 0b011, Alt5 = 0b010, }; fn gpio_fsel(pin: u5, mode: GpioMode, val: u32) u32 { const mode_int: u32 = @enumToInt(mode); const bit = pin * 3; var temp = val; temp &= ~(@as(u32, 0b111) << bit); temp |= mode_int << bit; return temp; } // This is the miniUART, it requires enable_uart=1 in config.txt fn miniuart_init() void { GPFSEL1.* = gpio_fsel(14-10, .Alt5, gpio_fsel(15-10, .Alt5, GPFSEL1.*)); // set pins 14-15 to alt5 (miniuart). gpfsel1 handles pins 10 to 19 GPPUD.* = 0; // disable pullup, pulldown for the clocked regs delay(150); GPPUDCLK0.* = (1 << 14) | (1 << 15); // clock pins 14-15 delay(150); GPPUDCLK0.* = 0; // clear clock for next usage delay(150); AUX_ENABLES.* |= 1; // enable the uart regs AUX_MU_CNTL.* = 0; // disable uart functionality to set the regs AUX_MU_IER.* = 0; // disable uart interrupts AUX_MU_LCR.* = 0b11; // 8-bit mode AUX_MU_MCR.* = 0; // RTS always high AUX_MU_IIR.* = 0xc6; AUX_MU_BAUD.* = minuart_calculate_baud(115200); AUX_MU_CNTL.* = 0b11; // enable tx and rx fifos } export fn _main() linksection(".text.main") noreturn { miniuart_init(); @call(.{.modifier = .always_inline}, sabaton.main, .{}); } pub fn mbox_call(channel: u4, ptr: usize) void { while ((MBOX_STATUS .* & 0x80000000) != 0) {} const addr = @truncate(u32, ptr) | @as(u32, channel); MBOX_WRITE.* = addr; } pub fn get_dram() []allowzero u8 { var slice: [8]u32 align(16) = undefined; var mbox = @intToPtr([*]volatile u32, @ptrToInt(&slice)); mbox[0] = 8*4; // size mbox[1] = 0; // req mbox[2] = 0x10005; // tag mbox[3] = 8; // buffer size mbox[4] = 0; // req/resp code mbox[5] = 0; // base mbox[6] = 0; // size mbox[7] = 0; // terminator mbox_call(8, @ptrToInt(mbox)); const size = mbox[6]; const addr = mbox[5]; return @intToPtr([*]allowzero u8, addr)[0..size]; } pub fn get_uart_info() io.Info { const base = 0x1C28000; return .{ .uart = AUX_MU_IO, .status = AUX_MU_LSR, .mask = 0x20, .value = 0x20, }; } pub fn get_kernel() [*]u8 { return @intToPtr([*]u8, 0x200000); // TODO: this relies on the config.txt/qemu setup, replace it with a real SD driver } pub fn add_platform_tags(kernel_header: *sabaton.Stivale2hdr) void { sabaton.add_tag(&sabaton.near("uart_tag").addr(sabaton.Stivale2tag)[0]); } pub fn map_platform(root: *sabaton.paging.Root) void { sabaton.paging.map(MMIO_BASE, MMIO_BASE, 0xFFFFFFF, .rw, .mmio, root); sabaton.paging.map(sabaton.upper_half_phys_base + MMIO_BASE, MMIO_BASE, 0xFFFFFFF, .rw, .mmio, root); }
src/platform/pi3_aarch64/main.zig
const std = @import("std"); /// Table containing all possible characters used by a Dots Display. const UnicodeLookup = [256][]const u8 { " ", "⠁", "⠈", "⠉", "⠂", "⠃", "⠊", "⠋", "⠐", "⠑", "⠘", "⠙", "⠒", "⠓", "⠚", "⠛", "⠄", "⠅", "⠌", "⠍", "⠆", "⠇", "⠎", "⠏", "⠔", "⠕", "⠜", "⠜", "⠖", "⠗", "⠞", "⠞", "⠠", "⠡", "⠡", "⠩", "⠢", "⠣", "⠪", "⠫", "⠰", "⠱", "⠸", "⠹", "⠲", "⠳", "⠺", "⠻", "⠤", "⠥", "⠬", "⠭", "⠦", "⠧", "⠮", "⠯", "⠴", "⠵", "⠼", "⠽", "⠶", "⠷", "⠾", "⠿", "⡀", "⡁", "⡈", "⡉", "⡂", "⡃", "⡊", "⡋", "⡐", "⡑", "⡘", "⡙", "⡒", "⡓", "⡚", "⡛", "⡄", "⡅", "⡌", "⡍", "⡆", "⡇", "⡎", "⡏", "⡔", "⡕", "⡜", "⡜", "⡖", "⡞", "⡞", "⡟", "⡠", "⡡", "⡨", "⡩", "⡢", "⡣", "⡪", "⡫", "⡰", "⡱", "⡸", "⡹", "⡲", "⡳", "⡺", "⡻", "⡤", "⡥", "⡬", "⡭", "⡦", "⡧", "⡮", "⡯", "⡴", "⡵", "⡼", "⡽", "⡶", "⡷", "⡾", "⡿", "⢀", "⢁", "⢈", "⢉", "⢂", "⢃", "⢊", "⢋", "⢐", "⢑", "⢘", "⢙", "⢒", "⢓", "⢚", "⢛", "⢄", "⢅", "⢌", "⢍", "⢆", "⢇", "⢎", "⢏", "⢔", "⢕", "⢜", "⢝", "⢖", "⢗", "⢞", "⢟", "⢠", "⢡", "⢨", "⢩", "⢢", "⢣", "⢪", "⢫", "⢰", "⢱", "⢸", "⢹", "⢲", "⢳", "⢺", "⢻", "⢤", "⢥", "⢬", "⢭", "⢦", "⢧", "⢮", "⢯", "⢴", "⢵", "⢼", "⢽", "⢶", "⢷", "⢾", "⢿", "⣀", "⣁", "⣈", "⣉", "⣂", "⣃", "⣊", "⣋", "⣐", "⣑", "⣘", "⣙", "⣒", "⣓", "⣚", "⣛", "⣄", "⣅", "⣌", "⣍", "⣆", "⣇", "⣎", "⣏", "⣔", "⣕", "⣜", "⣝", "⣖", "⣗", "⣞", "⣟", "⣠", "⣡", "⣨", "⣩", "⣢", "⣣", "⣪", "⣫", "⣰", "⣱", "⣸", "⣹", "⣲", "⣳", "⣺", "⣻", "⣤", "⣥", "⣬", "⣭", "⣦", "⣧", "⣮", "⣯", "⣴", "⣵", "⣼", "⣽", "⣶", "⣷", "⣾", "⣿", }; /// Config containing information required for compatibility between Dots Buffers and Displays. /// Used in memory management. pub const Config = struct { /// Width measured in dots. width : u16, /// Height measured in dots. height : u16, /// Width measured in bytes. cols : u16, /// Height measured in bytes. rows : u16, /// Allocator for []u8 allocation. allocator : *std.mem.Allocator, /// Returns whether two configs are the same. /// Actually only checks whether the columns and rows match. /// As long as this is true, it is technically compatible and won't cause issues. pub fn compare(configA : *const Config, configB : *const Config) bool { return (configA.rows == configB.rows) and (configA.cols == configB.cols); } /// Initializes a config based on preferred width and height measured in dots. /// Dots (when displayed) are contained in a character, there are 8 in total. (2x4). pub fn init(width : u16, height : u16, allocator : *std.mem.Allocator) Config { return Config { .width = width, .height = height, .cols = @divFloor(width, 2) + @as(u16, if (@mod(width, 2) > 0) 1 else 0), .rows = @divFloor(height, 4) + @as(u16, if (@mod(height, 4) > 0) 1 else 0), .allocator = allocator, }; } }; /// Buffer containing the data that can be displayed with a Dots display. /// There is absolutely no need to touch most, if not any of the variables inside of this struct. /// All interaction is meant to be done via the public methods. /// But nothing is stopping you from reinventing the wheel. pub const Buffer = struct { /// Enum containing the possible operations for changing dots. /// Some of these may emulate each other in certain conditions. const Operations = enum { bitset, bitor, bitxor, bitand, }; /// Tagged union for ease of use with the op() function. const Operation = union(Operations) { bitset : u1, bitor : u1, bitxor : u1, bitand : u1, }; /// A Dots config. config : *const Config, /// Buffer (structured like a large multi byte bitfield) that contains dots. /// To be accessed as a two dimensional array. buffer : []u8, /// Creates and allocates memory for a Dots buffer. pub fn create(config : *const Config) !Buffer { const buffer = Buffer { .config = config, .buffer = try config.allocator.alloc(u8, config.cols * config.rows), }; std.mem.set(u8, buffer.buffer, 0); return buffer; } /// Destroys and frees memory of a Dots buffer. pub fn destroy(self : *Buffer) void { self.config.allocator.free(self.buffer); } /// Set the value of a single dot in the buffer. /// Choose between the different operations defined in the Operations enum. pub fn set(self : *Buffer, x : i32, y : i32, op : Operation) void { // Check whether position would result in a valid index. if (self.validPosition(x, y)) { const _x = @intCast(u16, x); const _y = @intCast(u16, y); // Get the index of the correct byte, and a bitmask to extract a single dot. const i = self.index(_x, _y); const m = mask(_x, _y); // Depending on the value of the bit, set the byte without the rest of the bytes data. var byte : u8 = self.buffer[i]; switch (op) { Operation.bitset => |value| { if ((byte & m) > 0) byte = if ((m * value) > 0) byte else byte ^ m else byte = if ((m * value) > 0) byte | m else byte; }, Operation.bitor => |value| { byte = byte | (m * value); }, Operation.bitand => |value| { byte = byte & (m * value); }, Operation.bitxor => |value| { byte = byte ^ (m * value); } } self.buffer[i] = byte; } } /// Get the value of a single dot in the buffer. pub fn get(self : *Buffer, x : i32, y : i32) u1 { if (self.validPosition(x, y)) { const _x = @intCast(u16, x); const _y = @intCast(u16, y); const i = self.index(_x, _y); const m = mask(_x, _y); return @boolToInt((self.buffer[i] & m) > 0); } else return 0; } pub fn clear(self : *Buffer) void { std.mem.set(u8, self.buffer, 0); } /// Calculate total memory cost for a dots buffer. /// This calculates the total size of the buffer, including possible allocated space. /// It guarantees enough memory is available for any operation. pub fn calculateSize(width : u16, height : u16) usize { const cols : u16 = @divFloor(@as(u16, width), 2) + @as(u16, if (@mod(@as(u16, width), 2) > 0) 1 else 0); const rows : u16 = @divFloor(@as(u16, height), 4) + @as(u16, if (@mod(@as(u16, height), 4) > 0) 1 else 0); return cols * rows + @sizeOf(@TypeOf(Buffer)); } /// Bitmask for specifying a specific bit in a cell based on a dot's position. fn mask(x : u16, y : u16) u8 { // A single cell is 2 dots wide and 4 dots high. // This converts an X Y value to a mask for any cell. const col = @mod(x, 2); const row = @mod(y, 4); return @as(u8, 1) << @truncate(u3, row * 2 + col); } /// Index for specifying a specific cell based on the position of a dot. fn index(self : *Buffer, x : u16, y : u16) u16 { // A single cell is 2 dots wide and 4 dots high. // This converts an X Y value to the index for a specific cell. const col = @divFloor(x, 2); const row = @divFloor(y, 4); return row * self.config.cols + col; } /// Returns whether a dot exists at a given position. fn validPosition(self : *Buffer, x : i32, y : i32) bool { return (x < self.config.width and y < self.config.height and x >= 0 and y >= 0); } }; /// A Dots display is can be used to print the buffer in a compact shape. /// It can either be printed to any position on the console, or output as a string to write as a file. /// There is no need to touch any of the variables inside this struct. /// All interaction is meant to be done via the public methods. pub const Display = struct { config : *const Config, /// Purpose built FixedBufferStream / Buffer combination. output : RepurposableBuffer, /// Initializes a Dots display and allocate memory for it's buffers. pub fn create(config : *const Config) !Display { // Calculate the amount of space required for all dots in the display. const cols : u16 = @divFloor(config.width, 2) + @as(u16, if (@mod(config.width, 2) > 0) 1 else 0); const rows : u16 = @divFloor(config.height, 4) + @as(u16, if (@mod(config.height, 4) > 0) 1 else 0); const output_sizes = calculateOutputSize(cols, rows); const output = try RepurposableBuffer.init(output_sizes, config.allocator); // Initialize display and clear buffer. var display = Display { .config = config, .output = output, }; return display; } /// Destroys and frees allocated memory. pub fn destroy(display : *Display) void { display.output.free(); } /// Returns the buffer represented in unicode braille characters. pub fn string(self : *Display, buffer : *Buffer) ![]const u8 { if (Config.compare(self.config, buffer.config) == false) return error.ConfigMismatch; // Makes sure the output buffer is configured correctly. try self.output.makePurpose(RepurposableBuffer.Purpose.string); self.output.clear(); var i : u32 = 0; while (i < buffer.buffer.len) : (i += 1) { // Print character from lookuptable. try self.output.write(UnicodeLookup[buffer.buffer[i]]); // Create a newline where necessary. if (@mod(i + 1, self.config.cols) == 0) { try self.output.write("\n"); } } return self.output.buffer; } /// Prints the entire display represented in unicode braille characters. pub fn print(self : *Display, buffer : *Buffer, row : i32, col : i32, writer : *std.fs.File.Writer) anyerror!void { if (Config.compare(self.config, buffer.config) == false) return error.ConfigMismatch; try self.output.makePurpose(RepurposableBuffer.Purpose.terminal); self.output.clear(); // Start off with hiding the cursor and moving to the preferred column and row. as a starting position. (Top left) try self.output.writefmt(16, "\x1b[?25l\x1b[{d};{d}H", .{row, col}); var i : u32 = 0; while (i < buffer.buffer.len) : (i += 1) { try self.output.write(UnicodeLookup[buffer.buffer[i]]); if (@mod(i + 1, self.config.cols) == 0) { // Not newlining, but going back and setting to the next position in the terminal. // Or unhiding the cursor as it is the last line set. if (i < buffer.buffer.len - 1) try self.output.writefmt(16, "\x1b[{d}D\x1b[1B", .{self.config.cols}) else try self.output.write("\n\x1b[?25h"); } } // Write the entire resulting string. // Probably to a terminal. This is done in one go to be efficient. _ = try writer.write(self.output.buffer); } /// Calculate total memory cost for a dots display. /// This calculates the requirements with the purpose of displaying to the terminal. /// This cost is slightly higher than the cost of generating it as a string. /// But it guarantees enough memory is available for any operation. pub fn calculateSize(width : u16, height : u16) usize { const cols : u16 = @divFloor(width, 2) + @as(u16, if (@mod(width, 2) > 0) 1 else 0); const rows : u16 = @divFloor(height, 4) + @as(u16, if (@mod(height, 4) > 0) 1 else 0); const clen : u16 = switch (cols) { 0...9 => 1, 10...99 => 2, 100...999 => 3, 1000...9999 => 4, else => 5, }; var print_size : u16 = cols * rows * 3 + 16 + (rows - 1) * (7 + clen) + 7; return @sizeOf(@TypeOf(Display)) + print_size; } // Calculates the size required for the unicode output string allocation. fn calculateOutputSize(c : u16, r : u16) RepurposableBuffer.Sizes { const cols : u16 = c; const rows : u16 = r; const buffer_size : u16 = cols * rows; const string_size : u16 = buffer_size * 3 + rows; const clen : u16 = switch (cols) { 0...9 => 1, 10...99 => 2, 100...999 => 3, 1000...9999 => 4, else => 5, }; // Calculates the maximum possible size possible with the current configuration. var print_size : u16 = buffer_size * 3 + 16 + (rows - 1) * (7 + clen) + 7; var sizes = RepurposableBuffer.Sizes { .string = string_size, .terminal = print_size, }; return sizes; } }; /// Errors that happen with Dots. const DotsError = error { ConfigMismatch, }; /// Repurposable Buffer is mix of FixedBufferReader, and a way to resize automatically when necessary. const RepurposableBuffer = struct { /// The different states in which this structure is used. const Purpose = enum { unassigned, terminal, string, }; /// The different sizes for each of the states. const Sizes = struct { unassigned : usize = 1, terminal : usize, string : usize }; /// Allocator for the memory handled by this buffer object. allocator : *std.mem.Allocator, /// Data buffer : []u8, /// Current state purpose : Purpose, /// The byte sizes associated with each state. sizes : Sizes, /// Current position in the data, for writing. pos : usize = 0, /// Create a repurposable buffer, requires an allocator. fn init(sizes : Sizes, allocator : *std.mem.Allocator) !RepurposableBuffer { return RepurposableBuffer { .purpose = Purpose.unassigned, .buffer = try allocator.alloc(u8, 1), .sizes = sizes, .allocator = allocator }; } // Returns the buffer, if purpose is different, reallocates the buffer and resets. fn makePurpose(self : *RepurposableBuffer, purpose : Purpose) !void { if (self.purpose == Purpose.unassigned or self.purpose != purpose) { var new_size = switch (purpose) { .unassigned => self.sizes.unassigned, .terminal => self.sizes.terminal, .string => self.sizes.string, }; std.mem.set(u8, self.buffer, 0); self.buffer = try self.allocator.realloc(self.buffer, new_size); self.purpose = purpose; self.pos = 0; } } /// Clears and resets. fn clear(self : *RepurposableBuffer) void { std.mem.set(u8, self.buffer, 0); self.pos = 0; } /// Writes to the []u8 buffer. fn write(self : *RepurposableBuffer, str : []const u8) !void { for (str) |c| { self.buffer[self.pos] = c; self.pos += 1; } } /// Write a formatted string to the []u8 buffer. fn writefmt(self : *RepurposableBuffer, comptime size : usize, comptime fmt : []const u8, args : anytype) !void { var newline_string : [size]u8 = [1]u8 {0} ** size; const newline_slice = newline_string[0..]; try self.write(try std.fmt.bufPrint(newline_slice, fmt, args)); } /// Free the buffer. fn free(self : *RepurposableBuffer) void { self.allocator.free(self.buffer); } }; /// An abstraction layer for drawing to the screen. /// Features a normalized -1 to 1 coordinate system. /// Features line drawing and many shapes. /// Simply give a display and buffer. pub const Context = struct { /// Buffer associated with this context. buffer : *Buffer, /// width taken from buffer associated config. width : u16, /// height taken form buffer associated config. height : u16, /// Initialize a context and point it to a buffer. pub fn init(buffer : *Buffer) !Context { return Context { .buffer = buffer, .width = buffer.config.width, .height = buffer.config.height, }; } /// Point to a different buffer. pub fn swap(self : *Context, buffer : *Buffer, ) !void { self.buffer = buffer; self.width = buffer.config.width; self.height = buffer.config.height; } /// Set based on normalized -1 to 1 coordinate system. pub fn set(self : *Context, x : f32, y : f32, op : Buffer.Operation) void { var xi = @floatToInt(i32, (x + 1.0) * @intToFloat(f32, self.width - 1) / 2); var yi = @floatToInt(i32, (y + 1.0) * @intToFloat(f32, self.height - 1) / 2); self.buffer.set(xi, yi, op); } /// Draw a line from point (x0, y0) to (x1, y1) /// An essential for all other drawing methods. pub fn line(self : *Context, x0 : f32, y0 : f32, x1 : f32, y1 : f32, op : Buffer.Operation) void { var x0f = (x0 + 1.0) * @intToFloat(f32, self.width - 1) / 2; var y0f = (y0 + 1.0) * @intToFloat(f32, self.height - 1) / 2; var x1f = (x1 + 1.0) * @intToFloat(f32, self.width - 1) / 2; var y1f = (y1 + 1.0) * @intToFloat(f32, self.height - 1) / 2; var dx = x1f - x0f; var dy = y1f - y0f; var absdx = std.math.fabs(dx); var absdy = std.math.fabs(dy); var steps = if (absdx > absdy) absdx else absdy; var xincr = dx / steps; var yincr = dy / steps; var i : i32 = 0; self.buffer.set(@floatToInt(i32, x0f), @floatToInt(i32, y0f), op); while (i < @floatToInt(i32, steps)) { self.buffer.set(@floatToInt(i32, x0f), @floatToInt(i32, y0f), op); x0f += xincr; y0f += yincr; i += 1; } } /// Draw a rectangle pub fn rect(self : *Context, x0 : f32, y0 : f32, x1 : f32, y1 : f32, op : Buffer.Operation) void { self.line(x0, y0, x1, y0, op); self.line(x1, y0, x1, y1, op); self.line(x1, y1, x0, y1, op); self.line(x0, y1, x0, y0, op); } pub fn circ(self : *Context, x : f32, y : f32, begin : f32, end : f32, radius : f32, segments : i32, op : Buffer.Operation) void { var _begin = if (end > begin) end else begin; var _end = if (end > begin) begin else end; var incr = (_end - _begin) / @intToFloat(f32, segments); var i : i32 = 0; while (i < segments) { var this_x : f32 = std.math.sin(@intToFloat(f32, i) * incr + _begin) * radius + x; var this_y : f32 = std.math.cos(@intToFloat(f32, i) * incr + _begin) * radius + y; var next_x : f32 = std.math.sin((@intToFloat(f32, i) + 1) * incr + _begin) * radius + x; var next_y : f32 = std.math.cos((@intToFloat(f32, i) + 1) * incr + _begin) * radius + y; self.line(this_x, this_y, next_x, next_y, op); i += 1; } } pub fn clear(self : *Context) void { self.buffer.clear(); } };
dots.zig
const std = @import("std"); const webgpu = @import("../../webgpu.zig"); const dummy = @import("./dummy.zig"); pub const BindGroup = struct { const vtable = webgpu.BindGroup.VTable{ .destroy_fn = destroy, }; super: webgpu.BindGroup, pub fn create(device: *dummy.Device, descriptor: webgpu.BindGroupDescriptor) webgpu.Device.CreateBindGroupError!*BindGroup { _ = descriptor; var bind_group = try device.allocator.create(BindGroup); errdefer device.allocator.destroy(bind_group); bind_group.super = .{ .__vtable = &vtable, .device = &device.super, }; return bind_group; } fn destroy(super: *webgpu.BindGroup) void { var bind_group = @fieldParentPtr(BindGroup, "super", super); var device = @fieldParentPtr(dummy.Device, "super", super.device); device.allocator.destroy(bind_group); } }; pub const BindGroupLayout = struct { const vtable = webgpu.BindGroupLayout.VTable{ .destroy_fn = destroy, }; super: webgpu.BindGroupLayout, pub fn create(device: *dummy.Device, descriptor: webgpu.BindGroupLayoutDescriptor) webgpu.Device.CreateBindGroupLayoutError!*BindGroupLayout { _ = descriptor; var bind_group_layout = try device.allocator.create(BindGroupLayout); errdefer device.allocator.destroy(bind_group_layout); bind_group_layout.super = .{ .__vtable = &vtable, .device = &device.super, }; return bind_group_layout; } fn destroy(super: *webgpu.BindGroupLayout) void { var bind_group_layout = @fieldParentPtr(BindGroupLayout, "super", super); var device = @fieldParentPtr(dummy.Device, "super", super.device); device.allocator.destroy(bind_group_layout); } }; pub const PipelineLayout = struct { const vtable = webgpu.PipelineLayout.VTable{ .destroy_fn = destroy, }; super: webgpu.PipelineLayout, pub fn create(device: *dummy.Device, descriptor: webgpu.PipelineLayoutDescriptor) webgpu.Device.CreatePipelineLayoutError!*PipelineLayout { _ = descriptor; var pipeline_layout = try device.allocator.create(PipelineLayout); errdefer device.allocator.destroy(pipeline_layout); pipeline_layout.super = .{ .__vtable = &vtable, .device = &device.super, }; return pipeline_layout; } fn destroy(super: *webgpu.PipelineLayout) void { var pipeline_layout = @fieldParentPtr(PipelineLayout, "super", super); var device = @fieldParentPtr(dummy.Device, "super", super.device); device.allocator.destroy(pipeline_layout); } };
src/backends/dummy/binding_model.zig
const u = @import("util.zig"); const std = @import("std"); const TextIterator = @import("TextIterator.zig"); const Expr = @This(); val: Val, at: ?Range = null, const Range = struct { offset: usize, len: usize, pub fn view(r: Range, bytes: u.Bin) u.Bin { return bytes[r.offset..r.end()]; } pub fn end(r: Range) usize { return r.offset + r.len; } }; pub const Format = enum { /// Compact S-expr compact, /// Tree S-expr tree, /// Human S-expr human, /// Sweet-expr sweet, }; pub const Root = struct { val: Expr, arena: std.heap.ArenaAllocator, pub fn deinit(self: Root) void { self.arena.deinit(); } pub inline fn list(self: Root) []Expr { return self.val.val.list; } }; pub const Val = union(enum) { list: []Expr, keyword: u.Txt, string: u.Bin, id: u.Txt, fn asText(self: Val) ?u.Txt { return switch (self) { .keyword, .string, .id => |str| str, else => null, }; } pub inline fn asKeyword(self: Val) ?u.Txt { return switch (self) { .keyword => |keyword| keyword, else => null, }; } pub inline fn asId(self: Val) ?u.Txt { return switch (self) { .id => |id| id, else => null, }; } pub inline fn asString(self: Val) ?u.Bin { return switch (self) { .string => |str| str, else => null, }; } pub inline fn asList(self: Val) ?[]const Expr { return switch (self) { .list => |l| l, else => null, }; } pub fn shallowEql(self: Val, other: Val) bool { if (@enumToInt(self) != @enumToInt(other)) return false; const str = self.asText() orelse return false; return u.strEql(str, other.asText().?); } pub fn format( self: Val, comptime sfmt: []const u8, _: std.fmt.FormatOptions, writer: anytype, ) !void { const fmt = if (comptime sfmt.len > 0) comptime (std.meta.stringToEnum(Format, sfmt) orelse @panic("Not a valid Expr.Format")) else .compact; try self.print(fmt, writer, 0); } pub fn print(self: Val, comptime fmt: Format, writer: anytype, prev_depth: usize) @TypeOf(writer).Error!void { switch (self) { .list => |list| { switch (fmt) { .compact => { try writer.writeByte('('); for (list) |expr, i| { try expr.val.print(fmt, writer, 0); if (i + 1 < list.len) try writer.writeByte(' '); } try writer.writeByte(')'); }, .tree, .human, .sweet => { const depth = prev_depth + 2; if (fmt != .sweet) try writer.writeByte('('); if (list.len > 0) try list[0].val.print(fmt, writer, depth); for (list[1..]) |expr, i| { if (fmt != .tree and list[i].val.asText() != null and expr.val.asText() != null) { try writer.writeByte(' '); } else { try writer.writeByte('\n'); try writer.writeByteNTimes(' ', depth); } try expr.val.print(fmt, writer, depth); } if (fmt != .sweet) { try writer.writeByte(')'); } }, } }, .keyword => |str| { try writer.writeAll(str); }, .id => |str| { try writer.writeByte('$'); //FIXME: may need to escape try writer.writeAll(str); }, .string => |str| { try writer.writeByte('"'); for (str) |c| { // Cannot assume utf8, so it is ascii or binary... const bytes = switch (c) { '\t' => "\\t", '\n' => "\\n", '\r' => "\\r", '\"' => "\\\"", '\'' => "\\\'", '\\' => "\\\\", else => if (c < 128 and std.ascii.isPrint(c)) &[_:0]u8{c} else blk: { try writer.print("\\u{{{X}}}", .{c}); break :blk ""; }, }; try writer.writeAll(bytes); } try writer.writeByte('"'); }, } } }; pub inline fn format( self: Expr, comptime sfmt: []const u8, options: std.fmt.FormatOptions, writer: anytype, ) !void { return try self.val.format(sfmt, options, writer); } pub fn print(self: Expr, fmt: Format, writer: anytype) @TypeOf(writer).Error!void { switch (fmt) { .compact => try self.val.print(.compact, writer, 0), .tree => try self.val.print(.tree, writer, 0), .human => try self.val.print(.human, writer, 0), .sweet => try self.val.print(.sweet, writer, 0), } }
src/Expr.zig
// codegen (NodeJS): // import { comp, distinct, map, mapcat, permutations, range, repeat, run, str, trace zip } from "@thi.ng/transducers"; // D = [2, 3, 4]; // run( // comp( // mapcat(d => zip([d, d, d], D)), // mapcat(([d, n]) => [...permutations(...repeat(range(d), n))]), // distinct({ key: String }), // map(x => `pub fn ${str("", map(a => "xyzw"[a], x))}(a: V) V${x.length} { return [_]T{ ${str(", ", map(a => `a[${a}]`, x))}}; }`), // trace() // ), // D); /// Generated - do not edit! pub fn Vec2Swizzles(comptime N: u32, comptime T: type) type { const V = @Vector(N, T); const V2 = @Vector(2, T); const V3 = @Vector(3, T); const V4 = @Vector(4, T); return if (N < 2) struct {} else struct { pub fn y(a: V) T { return a[1]; } pub fn xx(a: V) V2 { return [_]T{ a[0], a[0] }; } pub fn xy(a: V) V2 { return [_]T{ a[0], a[1] }; } pub fn yx(a: V) V2 { return [_]T{ a[1], a[0] }; } pub fn yy(a: V) V2 { return [_]T{ a[1], a[1] }; } pub fn xxx(a: V) V3 { return [_]T{ a[0], a[0], a[0] }; } pub fn xxy(a: V) V3 { return [_]T{ a[0], a[0], a[1] }; } pub fn xyx(a: V) V3 { return [_]T{ a[0], a[1], a[0] }; } pub fn xyy(a: V) V3 { return [_]T{ a[0], a[1], a[1] }; } pub fn yxx(a: V) V3 { return [_]T{ a[1], a[0], a[0] }; } pub fn yxy(a: V) V3 { return [_]T{ a[1], a[0], a[1] }; } pub fn yyx(a: V) V3 { return [_]T{ a[1], a[1], a[0] }; } pub fn yyy(a: V) V3 { return [_]T{ a[1], a[1], a[1] }; } pub fn xxxx(a: V) V4 { return [_]T{ a[0], a[0], a[0], a[0] }; } pub fn xxxy(a: V) V4 { return [_]T{ a[0], a[0], a[0], a[1] }; } pub fn xxyx(a: V) V4 { return [_]T{ a[0], a[0], a[1], a[0] }; } pub fn xxyy(a: V) V4 { return [_]T{ a[0], a[0], a[1], a[1] }; } pub fn xyxx(a: V) V4 { return [_]T{ a[0], a[1], a[0], a[0] }; } pub fn xyxy(a: V) V4 { return [_]T{ a[0], a[1], a[0], a[1] }; } pub fn xyyx(a: V) V4 { return [_]T{ a[0], a[1], a[1], a[0] }; } pub fn xyyy(a: V) V4 { return [_]T{ a[0], a[1], a[1], a[1] }; } pub fn yxxx(a: V) V4 { return [_]T{ a[1], a[0], a[0], a[0] }; } pub fn yxxy(a: V) V4 { return [_]T{ a[1], a[0], a[0], a[1] }; } pub fn yxyx(a: V) V4 { return [_]T{ a[1], a[0], a[1], a[0] }; } pub fn yxyy(a: V) V4 { return [_]T{ a[1], a[0], a[1], a[1] }; } pub fn yyxx(a: V) V4 { return [_]T{ a[1], a[1], a[0], a[0] }; } pub fn yyxy(a: V) V4 { return [_]T{ a[1], a[1], a[0], a[1] }; } pub fn yyyx(a: V) V4 { return [_]T{ a[1], a[1], a[1], a[0] }; } pub fn yyyy(a: V) V4 { return [_]T{ a[1], a[1], a[1], a[1] }; } }; } /// Generated - do not edit! pub fn Vec3Swizzles(comptime N: u32, comptime T: type) type { const V = @Vector(N, T); const V2 = @Vector(2, T); const V3 = @Vector(3, T); const V4 = @Vector(4, T); return if (N < 3) struct {} else struct { pub fn z(a: V) T { return a[2]; } pub fn xz(a: V) V2 { return [_]T{ a[0], a[2] }; } pub fn yz(a: V) V2 { return [_]T{ a[1], a[2] }; } pub fn zx(a: V) V2 { return [_]T{ a[2], a[0] }; } pub fn zy(a: V) V2 { return [_]T{ a[2], a[1] }; } pub fn zz(a: V) V2 { return [_]T{ a[2], a[2] }; } pub fn xxz(a: V) V3 { return [_]T{ a[0], a[0], a[2] }; } pub fn xyz(a: V) V3 { return [_]T{ a[0], a[1], a[2] }; } pub fn xzx(a: V) V3 { return [_]T{ a[0], a[2], a[0] }; } pub fn xzy(a: V) V3 { return [_]T{ a[0], a[2], a[1] }; } pub fn xzz(a: V) V3 { return [_]T{ a[0], a[2], a[2] }; } pub fn yxz(a: V) V3 { return [_]T{ a[1], a[0], a[2] }; } pub fn yyz(a: V) V3 { return [_]T{ a[1], a[1], a[2] }; } pub fn yzx(a: V) V3 { return [_]T{ a[1], a[2], a[0] }; } pub fn yzy(a: V) V3 { return [_]T{ a[1], a[2], a[1] }; } pub fn yzz(a: V) V3 { return [_]T{ a[1], a[2], a[2] }; } pub fn zxx(a: V) V3 { return [_]T{ a[2], a[0], a[0] }; } pub fn zxy(a: V) V3 { return [_]T{ a[2], a[0], a[1] }; } pub fn zxz(a: V) V3 { return [_]T{ a[2], a[0], a[2] }; } pub fn zyx(a: V) V3 { return [_]T{ a[2], a[1], a[0] }; } pub fn zyy(a: V) V3 { return [_]T{ a[2], a[1], a[1] }; } pub fn zyz(a: V) V3 { return [_]T{ a[2], a[1], a[2] }; } pub fn zzx(a: V) V3 { return [_]T{ a[2], a[2], a[0] }; } pub fn zzy(a: V) V3 { return [_]T{ a[2], a[2], a[1] }; } pub fn zzz(a: V) V3 { return [_]T{ a[2], a[2], a[2] }; } pub fn xxxz(a: V) V4 { return [_]T{ a[0], a[0], a[0], a[2] }; } pub fn xxyz(a: V) V4 { return [_]T{ a[0], a[0], a[1], a[2] }; } pub fn xxzx(a: V) V4 { return [_]T{ a[0], a[0], a[2], a[0] }; } pub fn xxzy(a: V) V4 { return [_]T{ a[0], a[0], a[2], a[1] }; } pub fn xxzz(a: V) V4 { return [_]T{ a[0], a[0], a[2], a[2] }; } pub fn xyxz(a: V) V4 { return [_]T{ a[0], a[1], a[0], a[2] }; } pub fn xyyz(a: V) V4 { return [_]T{ a[0], a[1], a[1], a[2] }; } pub fn xyzx(a: V) V4 { return [_]T{ a[0], a[1], a[2], a[0] }; } pub fn xyzy(a: V) V4 { return [_]T{ a[0], a[1], a[2], a[1] }; } pub fn xyzz(a: V) V4 { return [_]T{ a[0], a[1], a[2], a[2] }; } pub fn xzxx(a: V) V4 { return [_]T{ a[0], a[2], a[0], a[0] }; } pub fn xzxy(a: V) V4 { return [_]T{ a[0], a[2], a[0], a[1] }; } pub fn xzxz(a: V) V4 { return [_]T{ a[0], a[2], a[0], a[2] }; } pub fn xzyx(a: V) V4 { return [_]T{ a[0], a[2], a[1], a[0] }; } pub fn xzyy(a: V) V4 { return [_]T{ a[0], a[2], a[1], a[1] }; } pub fn xzyz(a: V) V4 { return [_]T{ a[0], a[2], a[1], a[2] }; } pub fn xzzx(a: V) V4 { return [_]T{ a[0], a[2], a[2], a[0] }; } pub fn xzzy(a: V) V4 { return [_]T{ a[0], a[2], a[2], a[1] }; } pub fn xzzz(a: V) V4 { return [_]T{ a[0], a[2], a[2], a[2] }; } pub fn yxxz(a: V) V4 { return [_]T{ a[1], a[0], a[0], a[2] }; } pub fn yxyz(a: V) V4 { return [_]T{ a[1], a[0], a[1], a[2] }; } pub fn yxzx(a: V) V4 { return [_]T{ a[1], a[0], a[2], a[0] }; } pub fn yxzy(a: V) V4 { return [_]T{ a[1], a[0], a[2], a[1] }; } pub fn yxzz(a: V) V4 { return [_]T{ a[1], a[0], a[2], a[2] }; } pub fn yyxz(a: V) V4 { return [_]T{ a[1], a[1], a[0], a[2] }; } pub fn yyyz(a: V) V4 { return [_]T{ a[1], a[1], a[1], a[2] }; } pub fn yyzx(a: V) V4 { return [_]T{ a[1], a[1], a[2], a[0] }; } pub fn yyzy(a: V) V4 { return [_]T{ a[1], a[1], a[2], a[1] }; } pub fn yyzz(a: V) V4 { return [_]T{ a[1], a[1], a[2], a[2] }; } pub fn yzxx(a: V) V4 { return [_]T{ a[1], a[2], a[0], a[0] }; } pub fn yzxy(a: V) V4 { return [_]T{ a[1], a[2], a[0], a[1] }; } pub fn yzxz(a: V) V4 { return [_]T{ a[1], a[2], a[0], a[2] }; } pub fn yzyx(a: V) V4 { return [_]T{ a[1], a[2], a[1], a[0] }; } pub fn yzyy(a: V) V4 { return [_]T{ a[1], a[2], a[1], a[1] }; } pub fn yzyz(a: V) V4 { return [_]T{ a[1], a[2], a[1], a[2] }; } pub fn yzzx(a: V) V4 { return [_]T{ a[1], a[2], a[2], a[0] }; } pub fn yzzy(a: V) V4 { return [_]T{ a[1], a[2], a[2], a[1] }; } pub fn yzzz(a: V) V4 { return [_]T{ a[1], a[2], a[2], a[2] }; } pub fn zxxx(a: V) V4 { return [_]T{ a[2], a[0], a[0], a[0] }; } pub fn zxxy(a: V) V4 { return [_]T{ a[2], a[0], a[0], a[1] }; } pub fn zxxz(a: V) V4 { return [_]T{ a[2], a[0], a[0], a[2] }; } pub fn zxyx(a: V) V4 { return [_]T{ a[2], a[0], a[1], a[0] }; } pub fn zxyy(a: V) V4 { return [_]T{ a[2], a[0], a[1], a[1] }; } pub fn zxyz(a: V) V4 { return [_]T{ a[2], a[0], a[1], a[2] }; } pub fn zxzx(a: V) V4 { return [_]T{ a[2], a[0], a[2], a[0] }; } pub fn zxzy(a: V) V4 { return [_]T{ a[2], a[0], a[2], a[1] }; } pub fn zxzz(a: V) V4 { return [_]T{ a[2], a[0], a[2], a[2] }; } pub fn zyxx(a: V) V4 { return [_]T{ a[2], a[1], a[0], a[0] }; } pub fn zyxy(a: V) V4 { return [_]T{ a[2], a[1], a[0], a[1] }; } pub fn zyxz(a: V) V4 { return [_]T{ a[2], a[1], a[0], a[2] }; } pub fn zyyx(a: V) V4 { return [_]T{ a[2], a[1], a[1], a[0] }; } pub fn zyyy(a: V) V4 { return [_]T{ a[2], a[1], a[1], a[1] }; } pub fn zyyz(a: V) V4 { return [_]T{ a[2], a[1], a[1], a[2] }; } pub fn zyzx(a: V) V4 { return [_]T{ a[2], a[1], a[2], a[0] }; } pub fn zyzy(a: V) V4 { return [_]T{ a[2], a[1], a[2], a[1] }; } pub fn zyzz(a: V) V4 { return [_]T{ a[2], a[1], a[2], a[2] }; } pub fn zzxx(a: V) V4 { return [_]T{ a[2], a[2], a[0], a[0] }; } pub fn zzxy(a: V) V4 { return [_]T{ a[2], a[2], a[0], a[1] }; } pub fn zzxz(a: V) V4 { return [_]T{ a[2], a[2], a[0], a[2] }; } pub fn zzyx(a: V) V4 { return [_]T{ a[2], a[2], a[1], a[0] }; } pub fn zzyy(a: V) V4 { return [_]T{ a[2], a[2], a[1], a[1] }; } pub fn zzyz(a: V) V4 { return [_]T{ a[2], a[2], a[1], a[2] }; } pub fn zzzx(a: V) V4 { return [_]T{ a[2], a[2], a[2], a[0] }; } pub fn zzzy(a: V) V4 { return [_]T{ a[2], a[2], a[2], a[1] }; } pub fn zzzz(a: V) V4 { return [_]T{ a[2], a[2], a[2], a[2] }; } }; } /// Generated - do not edit! pub fn Vec4Swizzles(comptime N: u32, comptime T: type) type { const V = @Vector(N, T); const V2 = @Vector(2, T); const V3 = @Vector(3, T); const V4 = @Vector(4, T); return if (N < 4) struct {} else struct { pub fn w(a: V) T { return a[3]; } pub fn xw(a: V) V2 { return [_]T{ a[0], a[3] }; } pub fn yw(a: V) V2 { return [_]T{ a[1], a[3] }; } pub fn zw(a: V) V2 { return [_]T{ a[2], a[3] }; } pub fn wx(a: V) V2 { return [_]T{ a[3], a[0] }; } pub fn wy(a: V) V2 { return [_]T{ a[3], a[1] }; } pub fn wz(a: V) V2 { return [_]T{ a[3], a[2] }; } pub fn ww(a: V) V2 { return [_]T{ a[3], a[3] }; } pub fn xxw(a: V) V3 { return [_]T{ a[0], a[0], a[3] }; } pub fn xyw(a: V) V3 { return [_]T{ a[0], a[1], a[3] }; } pub fn xzw(a: V) V3 { return [_]T{ a[0], a[2], a[3] }; } pub fn xwx(a: V) V3 { return [_]T{ a[0], a[3], a[0] }; } pub fn xwy(a: V) V3 { return [_]T{ a[0], a[3], a[1] }; } pub fn xwz(a: V) V3 { return [_]T{ a[0], a[3], a[2] }; } pub fn xww(a: V) V3 { return [_]T{ a[0], a[3], a[3] }; } pub fn yxw(a: V) V3 { return [_]T{ a[1], a[0], a[3] }; } pub fn yyw(a: V) V3 { return [_]T{ a[1], a[1], a[3] }; } pub fn yzw(a: V) V3 { return [_]T{ a[1], a[2], a[3] }; } pub fn ywx(a: V) V3 { return [_]T{ a[1], a[3], a[0] }; } pub fn ywy(a: V) V3 { return [_]T{ a[1], a[3], a[1] }; } pub fn ywz(a: V) V3 { return [_]T{ a[1], a[3], a[2] }; } pub fn yww(a: V) V3 { return [_]T{ a[1], a[3], a[3] }; } pub fn zxw(a: V) V3 { return [_]T{ a[2], a[0], a[3] }; } pub fn zyw(a: V) V3 { return [_]T{ a[2], a[1], a[3] }; } pub fn zzw(a: V) V3 { return [_]T{ a[2], a[2], a[3] }; } pub fn zwx(a: V) V3 { return [_]T{ a[2], a[3], a[0] }; } pub fn zwy(a: V) V3 { return [_]T{ a[2], a[3], a[1] }; } pub fn zwz(a: V) V3 { return [_]T{ a[2], a[3], a[2] }; } pub fn zww(a: V) V3 { return [_]T{ a[2], a[3], a[3] }; } pub fn wxx(a: V) V3 { return [_]T{ a[3], a[0], a[0] }; } pub fn wxy(a: V) V3 { return [_]T{ a[3], a[0], a[1] }; } pub fn wxz(a: V) V3 { return [_]T{ a[3], a[0], a[2] }; } pub fn wxw(a: V) V3 { return [_]T{ a[3], a[0], a[3] }; } pub fn wyx(a: V) V3 { return [_]T{ a[3], a[1], a[0] }; } pub fn wyy(a: V) V3 { return [_]T{ a[3], a[1], a[1] }; } pub fn wyz(a: V) V3 { return [_]T{ a[3], a[1], a[2] }; } pub fn wyw(a: V) V3 { return [_]T{ a[3], a[1], a[3] }; } pub fn wzx(a: V) V3 { return [_]T{ a[3], a[2], a[0] }; } pub fn wzy(a: V) V3 { return [_]T{ a[3], a[2], a[1] }; } pub fn wzz(a: V) V3 { return [_]T{ a[3], a[2], a[2] }; } pub fn wzw(a: V) V3 { return [_]T{ a[3], a[2], a[3] }; } pub fn wwx(a: V) V3 { return [_]T{ a[3], a[3], a[0] }; } pub fn wwy(a: V) V3 { return [_]T{ a[3], a[3], a[1] }; } pub fn wwz(a: V) V3 { return [_]T{ a[3], a[3], a[2] }; } pub fn www(a: V) V3 { return [_]T{ a[3], a[3], a[3] }; } pub fn xxxw(a: V) V4 { return [_]T{ a[0], a[0], a[0], a[3] }; } pub fn xxyw(a: V) V4 { return [_]T{ a[0], a[0], a[1], a[3] }; } pub fn xxzw(a: V) V4 { return [_]T{ a[0], a[0], a[2], a[3] }; } pub fn xxwx(a: V) V4 { return [_]T{ a[0], a[0], a[3], a[0] }; } pub fn xxwy(a: V) V4 { return [_]T{ a[0], a[0], a[3], a[1] }; } pub fn xxwz(a: V) V4 { return [_]T{ a[0], a[0], a[3], a[2] }; } pub fn xxww(a: V) V4 { return [_]T{ a[0], a[0], a[3], a[3] }; } pub fn xyxw(a: V) V4 { return [_]T{ a[0], a[1], a[0], a[3] }; } pub fn xyyw(a: V) V4 { return [_]T{ a[0], a[1], a[1], a[3] }; } pub fn xyzw(a: V) V4 { return [_]T{ a[0], a[1], a[2], a[3] }; } pub fn xywx(a: V) V4 { return [_]T{ a[0], a[1], a[3], a[0] }; } pub fn xywy(a: V) V4 { return [_]T{ a[0], a[1], a[3], a[1] }; } pub fn xywz(a: V) V4 { return [_]T{ a[0], a[1], a[3], a[2] }; } pub fn xyww(a: V) V4 { return [_]T{ a[0], a[1], a[3], a[3] }; } pub fn xzxw(a: V) V4 { return [_]T{ a[0], a[2], a[0], a[3] }; } pub fn xzyw(a: V) V4 { return [_]T{ a[0], a[2], a[1], a[3] }; } pub fn xzzw(a: V) V4 { return [_]T{ a[0], a[2], a[2], a[3] }; } pub fn xzwx(a: V) V4 { return [_]T{ a[0], a[2], a[3], a[0] }; } pub fn xzwy(a: V) V4 { return [_]T{ a[0], a[2], a[3], a[1] }; } pub fn xzwz(a: V) V4 { return [_]T{ a[0], a[2], a[3], a[2] }; } pub fn xzww(a: V) V4 { return [_]T{ a[0], a[2], a[3], a[3] }; } pub fn xwxx(a: V) V4 { return [_]T{ a[0], a[3], a[0], a[0] }; } pub fn xwxy(a: V) V4 { return [_]T{ a[0], a[3], a[0], a[1] }; } pub fn xwxz(a: V) V4 { return [_]T{ a[0], a[3], a[0], a[2] }; } pub fn xwxw(a: V) V4 { return [_]T{ a[0], a[3], a[0], a[3] }; } pub fn xwyx(a: V) V4 { return [_]T{ a[0], a[3], a[1], a[0] }; } pub fn xwyy(a: V) V4 { return [_]T{ a[0], a[3], a[1], a[1] }; } pub fn xwyz(a: V) V4 { return [_]T{ a[0], a[3], a[1], a[2] }; } pub fn xwyw(a: V) V4 { return [_]T{ a[0], a[3], a[1], a[3] }; } pub fn xwzx(a: V) V4 { return [_]T{ a[0], a[3], a[2], a[0] }; } pub fn xwzy(a: V) V4 { return [_]T{ a[0], a[3], a[2], a[1] }; } pub fn xwzz(a: V) V4 { return [_]T{ a[0], a[3], a[2], a[2] }; } pub fn xwzw(a: V) V4 { return [_]T{ a[0], a[3], a[2], a[3] }; } pub fn xwwx(a: V) V4 { return [_]T{ a[0], a[3], a[3], a[0] }; } pub fn xwwy(a: V) V4 { return [_]T{ a[0], a[3], a[3], a[1] }; } pub fn xwwz(a: V) V4 { return [_]T{ a[0], a[3], a[3], a[2] }; } pub fn xwww(a: V) V4 { return [_]T{ a[0], a[3], a[3], a[3] }; } pub fn yxxw(a: V) V4 { return [_]T{ a[1], a[0], a[0], a[3] }; } pub fn yxyw(a: V) V4 { return [_]T{ a[1], a[0], a[1], a[3] }; } pub fn yxzw(a: V) V4 { return [_]T{ a[1], a[0], a[2], a[3] }; } pub fn yxwx(a: V) V4 { return [_]T{ a[1], a[0], a[3], a[0] }; } pub fn yxwy(a: V) V4 { return [_]T{ a[1], a[0], a[3], a[1] }; } pub fn yxwz(a: V) V4 { return [_]T{ a[1], a[0], a[3], a[2] }; } pub fn yxww(a: V) V4 { return [_]T{ a[1], a[0], a[3], a[3] }; } pub fn yyxw(a: V) V4 { return [_]T{ a[1], a[1], a[0], a[3] }; } pub fn yyyw(a: V) V4 { return [_]T{ a[1], a[1], a[1], a[3] }; } pub fn yyzw(a: V) V4 { return [_]T{ a[1], a[1], a[2], a[3] }; } pub fn yywx(a: V) V4 { return [_]T{ a[1], a[1], a[3], a[0] }; } pub fn yywy(a: V) V4 { return [_]T{ a[1], a[1], a[3], a[1] }; } pub fn yywz(a: V) V4 { return [_]T{ a[1], a[1], a[3], a[2] }; } pub fn yyww(a: V) V4 { return [_]T{ a[1], a[1], a[3], a[3] }; } pub fn yzxw(a: V) V4 { return [_]T{ a[1], a[2], a[0], a[3] }; } pub fn yzyw(a: V) V4 { return [_]T{ a[1], a[2], a[1], a[3] }; } pub fn yzzw(a: V) V4 { return [_]T{ a[1], a[2], a[2], a[3] }; } pub fn yzwx(a: V) V4 { return [_]T{ a[1], a[2], a[3], a[0] }; } pub fn yzwy(a: V) V4 { return [_]T{ a[1], a[2], a[3], a[1] }; } pub fn yzwz(a: V) V4 { return [_]T{ a[1], a[2], a[3], a[2] }; } pub fn yzww(a: V) V4 { return [_]T{ a[1], a[2], a[3], a[3] }; } pub fn ywxx(a: V) V4 { return [_]T{ a[1], a[3], a[0], a[0] }; } pub fn ywxy(a: V) V4 { return [_]T{ a[1], a[3], a[0], a[1] }; } pub fn ywxz(a: V) V4 { return [_]T{ a[1], a[3], a[0], a[2] }; } pub fn ywxw(a: V) V4 { return [_]T{ a[1], a[3], a[0], a[3] }; } pub fn ywyx(a: V) V4 { return [_]T{ a[1], a[3], a[1], a[0] }; } pub fn ywyy(a: V) V4 { return [_]T{ a[1], a[3], a[1], a[1] }; } pub fn ywyz(a: V) V4 { return [_]T{ a[1], a[3], a[1], a[2] }; } pub fn ywyw(a: V) V4 { return [_]T{ a[1], a[3], a[1], a[3] }; } pub fn ywzx(a: V) V4 { return [_]T{ a[1], a[3], a[2], a[0] }; } pub fn ywzy(a: V) V4 { return [_]T{ a[1], a[3], a[2], a[1] }; } pub fn ywzz(a: V) V4 { return [_]T{ a[1], a[3], a[2], a[2] }; } pub fn ywzw(a: V) V4 { return [_]T{ a[1], a[3], a[2], a[3] }; } pub fn ywwx(a: V) V4 { return [_]T{ a[1], a[3], a[3], a[0] }; } pub fn ywwy(a: V) V4 { return [_]T{ a[1], a[3], a[3], a[1] }; } pub fn ywwz(a: V) V4 { return [_]T{ a[1], a[3], a[3], a[2] }; } pub fn ywww(a: V) V4 { return [_]T{ a[1], a[3], a[3], a[3] }; } pub fn zxxw(a: V) V4 { return [_]T{ a[2], a[0], a[0], a[3] }; } pub fn zxyw(a: V) V4 { return [_]T{ a[2], a[0], a[1], a[3] }; } pub fn zxzw(a: V) V4 { return [_]T{ a[2], a[0], a[2], a[3] }; } pub fn zxwx(a: V) V4 { return [_]T{ a[2], a[0], a[3], a[0] }; } pub fn zxwy(a: V) V4 { return [_]T{ a[2], a[0], a[3], a[1] }; } pub fn zxwz(a: V) V4 { return [_]T{ a[2], a[0], a[3], a[2] }; } pub fn zxww(a: V) V4 { return [_]T{ a[2], a[0], a[3], a[3] }; } pub fn zyxw(a: V) V4 { return [_]T{ a[2], a[1], a[0], a[3] }; } pub fn zyyw(a: V) V4 { return [_]T{ a[2], a[1], a[1], a[3] }; } pub fn zyzw(a: V) V4 { return [_]T{ a[2], a[1], a[2], a[3] }; } pub fn zywx(a: V) V4 { return [_]T{ a[2], a[1], a[3], a[0] }; } pub fn zywy(a: V) V4 { return [_]T{ a[2], a[1], a[3], a[1] }; } pub fn zywz(a: V) V4 { return [_]T{ a[2], a[1], a[3], a[2] }; } pub fn zyww(a: V) V4 { return [_]T{ a[2], a[1], a[3], a[3] }; } pub fn zzxw(a: V) V4 { return [_]T{ a[2], a[2], a[0], a[3] }; } pub fn zzyw(a: V) V4 { return [_]T{ a[2], a[2], a[1], a[3] }; } pub fn zzzw(a: V) V4 { return [_]T{ a[2], a[2], a[2], a[3] }; } pub fn zzwx(a: V) V4 { return [_]T{ a[2], a[2], a[3], a[0] }; } pub fn zzwy(a: V) V4 { return [_]T{ a[2], a[2], a[3], a[1] }; } pub fn zzwz(a: V) V4 { return [_]T{ a[2], a[2], a[3], a[2] }; } pub fn zzww(a: V) V4 { return [_]T{ a[2], a[2], a[3], a[3] }; } pub fn zwxx(a: V) V4 { return [_]T{ a[2], a[3], a[0], a[0] }; } pub fn zwxy(a: V) V4 { return [_]T{ a[2], a[3], a[0], a[1] }; } pub fn zwxz(a: V) V4 { return [_]T{ a[2], a[3], a[0], a[2] }; } pub fn zwxw(a: V) V4 { return [_]T{ a[2], a[3], a[0], a[3] }; } pub fn zwyx(a: V) V4 { return [_]T{ a[2], a[3], a[1], a[0] }; } pub fn zwyy(a: V) V4 { return [_]T{ a[2], a[3], a[1], a[1] }; } pub fn zwyz(a: V) V4 { return [_]T{ a[2], a[3], a[1], a[2] }; } pub fn zwyw(a: V) V4 { return [_]T{ a[2], a[3], a[1], a[3] }; } pub fn zwzx(a: V) V4 { return [_]T{ a[2], a[3], a[2], a[0] }; } pub fn zwzy(a: V) V4 { return [_]T{ a[2], a[3], a[2], a[1] }; } pub fn zwzz(a: V) V4 { return [_]T{ a[2], a[3], a[2], a[2] }; } pub fn zwzw(a: V) V4 { return [_]T{ a[2], a[3], a[2], a[3] }; } pub fn zwwx(a: V) V4 { return [_]T{ a[2], a[3], a[3], a[0] }; } pub fn zwwy(a: V) V4 { return [_]T{ a[2], a[3], a[3], a[1] }; } pub fn zwwz(a: V) V4 { return [_]T{ a[2], a[3], a[3], a[2] }; } pub fn zwww(a: V) V4 { return [_]T{ a[2], a[3], a[3], a[3] }; } pub fn wxxx(a: V) V4 { return [_]T{ a[3], a[0], a[0], a[0] }; } pub fn wxxy(a: V) V4 { return [_]T{ a[3], a[0], a[0], a[1] }; } pub fn wxxz(a: V) V4 { return [_]T{ a[3], a[0], a[0], a[2] }; } pub fn wxxw(a: V) V4 { return [_]T{ a[3], a[0], a[0], a[3] }; } pub fn wxyx(a: V) V4 { return [_]T{ a[3], a[0], a[1], a[0] }; } pub fn wxyy(a: V) V4 { return [_]T{ a[3], a[0], a[1], a[1] }; } pub fn wxyz(a: V) V4 { return [_]T{ a[3], a[0], a[1], a[2] }; } pub fn wxyw(a: V) V4 { return [_]T{ a[3], a[0], a[1], a[3] }; } pub fn wxzx(a: V) V4 { return [_]T{ a[3], a[0], a[2], a[0] }; } pub fn wxzy(a: V) V4 { return [_]T{ a[3], a[0], a[2], a[1] }; } pub fn wxzz(a: V) V4 { return [_]T{ a[3], a[0], a[2], a[2] }; } pub fn wxzw(a: V) V4 { return [_]T{ a[3], a[0], a[2], a[3] }; } pub fn wxwx(a: V) V4 { return [_]T{ a[3], a[0], a[3], a[0] }; } pub fn wxwy(a: V) V4 { return [_]T{ a[3], a[0], a[3], a[1] }; } pub fn wxwz(a: V) V4 { return [_]T{ a[3], a[0], a[3], a[2] }; } pub fn wxww(a: V) V4 { return [_]T{ a[3], a[0], a[3], a[3] }; } pub fn wyxx(a: V) V4 { return [_]T{ a[3], a[1], a[0], a[0] }; } pub fn wyxy(a: V) V4 { return [_]T{ a[3], a[1], a[0], a[1] }; } pub fn wyxz(a: V) V4 { return [_]T{ a[3], a[1], a[0], a[2] }; } pub fn wyxw(a: V) V4 { return [_]T{ a[3], a[1], a[0], a[3] }; } pub fn wyyx(a: V) V4 { return [_]T{ a[3], a[1], a[1], a[0] }; } pub fn wyyy(a: V) V4 { return [_]T{ a[3], a[1], a[1], a[1] }; } pub fn wyyz(a: V) V4 { return [_]T{ a[3], a[1], a[1], a[2] }; } pub fn wyyw(a: V) V4 { return [_]T{ a[3], a[1], a[1], a[3] }; } pub fn wyzx(a: V) V4 { return [_]T{ a[3], a[1], a[2], a[0] }; } pub fn wyzy(a: V) V4 { return [_]T{ a[3], a[1], a[2], a[1] }; } pub fn wyzz(a: V) V4 { return [_]T{ a[3], a[1], a[2], a[2] }; } pub fn wyzw(a: V) V4 { return [_]T{ a[3], a[1], a[2], a[3] }; } pub fn wywx(a: V) V4 { return [_]T{ a[3], a[1], a[3], a[0] }; } pub fn wywy(a: V) V4 { return [_]T{ a[3], a[1], a[3], a[1] }; } pub fn wywz(a: V) V4 { return [_]T{ a[3], a[1], a[3], a[2] }; } pub fn wyww(a: V) V4 { return [_]T{ a[3], a[1], a[3], a[3] }; } pub fn wzxx(a: V) V4 { return [_]T{ a[3], a[2], a[0], a[0] }; } pub fn wzxy(a: V) V4 { return [_]T{ a[3], a[2], a[0], a[1] }; } pub fn wzxz(a: V) V4 { return [_]T{ a[3], a[2], a[0], a[2] }; } pub fn wzxw(a: V) V4 { return [_]T{ a[3], a[2], a[0], a[3] }; } pub fn wzyx(a: V) V4 { return [_]T{ a[3], a[2], a[1], a[0] }; } pub fn wzyy(a: V) V4 { return [_]T{ a[3], a[2], a[1], a[1] }; } pub fn wzyz(a: V) V4 { return [_]T{ a[3], a[2], a[1], a[2] }; } pub fn wzyw(a: V) V4 { return [_]T{ a[3], a[2], a[1], a[3] }; } pub fn wzzx(a: V) V4 { return [_]T{ a[3], a[2], a[2], a[0] }; } pub fn wzzy(a: V) V4 { return [_]T{ a[3], a[2], a[2], a[1] }; } pub fn wzzz(a: V) V4 { return [_]T{ a[3], a[2], a[2], a[2] }; } pub fn wzzw(a: V) V4 { return [_]T{ a[3], a[2], a[2], a[3] }; } pub fn wzwx(a: V) V4 { return [_]T{ a[3], a[2], a[3], a[0] }; } pub fn wzwy(a: V) V4 { return [_]T{ a[3], a[2], a[3], a[1] }; } pub fn wzwz(a: V) V4 { return [_]T{ a[3], a[2], a[3], a[2] }; } pub fn wzww(a: V) V4 { return [_]T{ a[3], a[2], a[3], a[3] }; } pub fn wwxx(a: V) V4 { return [_]T{ a[3], a[3], a[0], a[0] }; } pub fn wwxy(a: V) V4 { return [_]T{ a[3], a[3], a[0], a[1] }; } pub fn wwxz(a: V) V4 { return [_]T{ a[3], a[3], a[0], a[2] }; } pub fn wwxw(a: V) V4 { return [_]T{ a[3], a[3], a[0], a[3] }; } pub fn wwyx(a: V) V4 { return [_]T{ a[3], a[3], a[1], a[0] }; } pub fn wwyy(a: V) V4 { return [_]T{ a[3], a[3], a[1], a[1] }; } pub fn wwyz(a: V) V4 { return [_]T{ a[3], a[3], a[1], a[2] }; } pub fn wwyw(a: V) V4 { return [_]T{ a[3], a[3], a[1], a[3] }; } pub fn wwzx(a: V) V4 { return [_]T{ a[3], a[3], a[2], a[0] }; } pub fn wwzy(a: V) V4 { return [_]T{ a[3], a[3], a[2], a[1] }; } pub fn wwzz(a: V) V4 { return [_]T{ a[3], a[3], a[2], a[2] }; } pub fn wwzw(a: V) V4 { return [_]T{ a[3], a[3], a[2], a[3] }; } pub fn wwwx(a: V) V4 { return [_]T{ a[3], a[3], a[3], a[0] }; } pub fn wwwy(a: V) V4 { return [_]T{ a[3], a[3], a[3], a[1] }; } pub fn wwwz(a: V) V4 { return [_]T{ a[3], a[3], a[3], a[2] }; } pub fn wwww(a: V) V4 { return [_]T{ a[3], a[3], a[3], a[3] }; } }; }
src/swizzle.zig