| author | |
| committer | |
| log | 295451dfe5f22e0bea63e737554326889af1fb13 |
| tree | 83c41fac51088b6375fac16338bf8d3eb609bbfc |
| parent | 9c99a88796cb00a220b4d093f5f1a84339167ace |
| signature |
55 files changed, 296 insertions(+), 450 deletions(-)
lib/std/base64.zig+1-4| ... | ... | @@ -9,10 +9,7 @@ pub const Error = error{ |
| 9 | 9 | NoSpaceLeft, |
| 10 | 10 | }; |
| 11 | 11 | |
| 12 | const decoderWithIgnoreProto = switch (@import("builtin").zig_backend) { | |
| 13 | .stage1 => fn (ignore: []const u8) Base64DecoderWithIgnore, | |
| 14 | else => *const fn (ignore: []const u8) Base64DecoderWithIgnore, | |
| 15 | }; | |
| 12 | const decoderWithIgnoreProto = std.meta.FnPtr(fn (ignore: []const u8) Base64DecoderWithIgnore); | |
| 16 | 13 | |
| 17 | 14 | /// Base64 codecs |
| 18 | 15 | pub const Codecs = struct { |
lib/std/build.zig+1-4| ... | ... | @@ -3593,10 +3593,7 @@ pub const Step = struct { |
| 3593 | 3593 | loop_flag: bool, |
| 3594 | 3594 | done_flag: bool, |
| 3595 | 3595 | |
| 3596 | const MakeFn = switch (builtin.zig_backend) { | |
| 3597 | .stage1 => fn (self: *Step) anyerror!void, | |
| 3598 | else => *const fn (self: *Step) anyerror!void, | |
| 3599 | }; | |
| 3596 | const MakeFn = std.meta.FnPtr(fn (self: *Step) anyerror!void); | |
| 3600 | 3597 | |
| 3601 | 3598 | pub const Id = enum { |
| 3602 | 3599 | top_level, |
lib/std/builtin.zig+1-7| ... | ... | @@ -736,16 +736,10 @@ pub const CompilerBackend = enum(u64) { |
| 736 | 736 | /// therefore must be kept in sync with the compiler implementation. |
| 737 | 737 | pub const TestFn = struct { |
| 738 | 738 | name: []const u8, |
| 739 | func: testFnProto, | |
| 739 | func: std.meta.FnPtr(fn () anyerror!void), | |
| 740 | 740 | async_frame_size: ?usize, |
| 741 | 741 | }; |
| 742 | 742 | |
| 743 | /// stage1 is *wrong*. It is not yet updated to support the new function type semantics. | |
| 744 | const testFnProto = switch (builtin.zig_backend) { | |
| 745 | .stage1 => fn () anyerror!void, // wrong! | |
| 746 | else => *const fn () anyerror!void, | |
| 747 | }; | |
| 748 | ||
| 749 | 743 | /// This function type is used by the Zig language code generation and |
| 750 | 744 | /// therefore must be kept in sync with the compiler implementation. |
| 751 | 745 | pub const PanicFn = fn ([]const u8, ?*StackTrace, ?usize) noreturn; |
lib/std/c.zig+3-12| ... | ... | @@ -241,11 +241,8 @@ pub extern "c" fn utimes(path: [*:0]const u8, times: *[2]c.timeval) c_int; |
| 241 | 241 | pub extern "c" fn utimensat(dirfd: c.fd_t, pathname: [*:0]const u8, times: *[2]c.timespec, flags: u32) c_int; |
| 242 | 242 | pub extern "c" fn futimens(fd: c.fd_t, times: *const [2]c.timespec) c_int; |
| 243 | 243 | |
| 244 | const PThreadStartFn = std.meta.FnPtr(fn (?*anyopaque) callconv(.C) ?*anyopaque); | |
| 244 | 245 | pub extern "c" fn pthread_create(noalias newthread: *pthread_t, noalias attr: ?*const c.pthread_attr_t, start_routine: PThreadStartFn, noalias arg: ?*anyopaque) c.E; |
| 245 | const PThreadStartFn = if (builtin.zig_backend == .stage1) | |
| 246 | fn (?*anyopaque) callconv(.C) ?*anyopaque | |
| 247 | else | |
| 248 | *const fn (?*anyopaque) callconv(.C) ?*anyopaque; | |
| 249 | 246 | pub extern "c" fn pthread_attr_init(attr: *c.pthread_attr_t) c.E; |
| 250 | 247 | pub extern "c" fn pthread_attr_setstack(attr: *c.pthread_attr_t, stackaddr: *anyopaque, stacksize: usize) c.E; |
| 251 | 248 | pub extern "c" fn pthread_attr_setstacksize(attr: *c.pthread_attr_t, stacksize: usize) c.E; |
| ... | ... | @@ -254,20 +251,14 @@ pub extern "c" fn pthread_attr_destroy(attr: *c.pthread_attr_t) c.E; |
| 254 | 251 | pub extern "c" fn pthread_self() pthread_t; |
| 255 | 252 | pub extern "c" fn pthread_join(thread: pthread_t, arg_return: ?*?*anyopaque) c.E; |
| 256 | 253 | pub extern "c" fn pthread_detach(thread: pthread_t) c.E; |
| 254 | const PThreadForkFn = std.meta.FnPtr(fn () callconv(.C) void); | |
| 257 | 255 | pub extern "c" fn pthread_atfork( |
| 258 | 256 | prepare: ?PThreadForkFn, |
| 259 | 257 | parent: ?PThreadForkFn, |
| 260 | 258 | child: ?PThreadForkFn, |
| 261 | 259 | ) c_int; |
| 262 | const PThreadForkFn = if (builtin.zig_backend == .stage1) | |
| 263 | fn () callconv(.C) void | |
| 264 | else | |
| 265 | *const fn () callconv(.C) void; | |
| 260 | const PThreadKeyCreateFn = std.meta.FnPtr(fn (value: *anyopaque) callconv(.C) void); | |
| 266 | 261 | pub extern "c" fn pthread_key_create(key: *c.pthread_key_t, destructor: ?PThreadKeyCreateFn) c.E; |
| 267 | const PThreadKeyCreateFn = if (builtin.zig_backend == .stage1) | |
| 268 | fn (value: *anyopaque) callconv(.C) void | |
| 269 | else | |
| 270 | *const fn (value: *anyopaque) callconv(.C) void; | |
| 271 | 262 | pub extern "c" fn pthread_key_delete(key: c.pthread_key_t) c.E; |
| 272 | 263 | pub extern "c" fn pthread_getspecific(key: c.pthread_key_t) ?*anyopaque; |
| 273 | 264 | pub extern "c" fn pthread_setspecific(key: c.pthread_key_t, value: ?*anyopaque) c_int; |
lib/std/c/darwin.zig+2-8| ... | ... | @@ -918,14 +918,8 @@ pub const siginfo_t = extern struct { |
| 918 | 918 | |
| 919 | 919 | /// Renamed from `sigaction` to `Sigaction` to avoid conflict with function name. |
| 920 | 920 | pub const Sigaction = extern struct { |
| 921 | pub const handler_fn = switch (builtin.zig_backend) { | |
| 922 | .stage1 => fn (c_int) callconv(.C) void, | |
| 923 | else => *const fn (c_int) callconv(.C) void, | |
| 924 | }; | |
| 925 | pub const sigaction_fn = switch (builtin.zig_backend) { | |
| 926 | .stage1 => fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void, | |
| 927 | else => *const fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void, | |
| 928 | }; | |
| 921 | pub const handler_fn = std.meta.FnPtr(fn (c_int) callconv(.C) void); | |
| 922 | pub const sigaction_fn = std.meta.FnPtr(fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void); | |
| 929 | 923 | |
| 930 | 924 | handler: extern union { |
| 931 | 925 | handler: ?handler_fn, |
lib/std/c/dragonfly.zig+3-12| ... | ... | @@ -13,10 +13,7 @@ pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int; |
| 13 | 13 | pub extern "c" fn getrandom(buf_ptr: [*]u8, buf_len: usize, flags: c_uint) isize; |
| 14 | 14 | pub extern "c" fn pipe2(fds: *[2]fd_t, flags: u32) c_int; |
| 15 | 15 | |
| 16 | pub const dl_iterate_phdr_callback = switch (builtin.zig_backend) { | |
| 17 | .stage1 => fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int, | |
| 18 | else => *const fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int, | |
| 19 | }; | |
| 16 | pub const dl_iterate_phdr_callback = std.meta.FnPtr(fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int); | |
| 20 | 17 | pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int; |
| 21 | 18 | |
| 22 | 19 | pub extern "c" fn lwp_gettid() c_int; |
| ... | ... | @@ -683,14 +680,8 @@ pub const empty_sigset = sigset_t{ .__bits = [_]c_uint{0} ** _SIG_WORDS }; |
| 683 | 680 | pub const sig_atomic_t = c_int; |
| 684 | 681 | |
| 685 | 682 | pub const Sigaction = extern struct { |
| 686 | pub const handler_fn = switch (builtin.zig_backend) { | |
| 687 | .stage1 => fn (c_int) callconv(.C) void, | |
| 688 | else => *const fn (c_int) callconv(.C) void, | |
| 689 | }; | |
| 690 | pub const sigaction_fn = switch (builtin.zig_backend) { | |
| 691 | .stage1 => fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void, | |
| 692 | else => *const fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void, | |
| 693 | }; | |
| 683 | pub const handler_fn = std.meta.FnPtr(fn (c_int) callconv(.C) void); | |
| 684 | pub const sigaction_fn = std.meta.FnPtr(fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void); | |
| 694 | 685 | |
| 695 | 686 | /// signal handler |
| 696 | 687 | handler: extern union { |
lib/std/c/freebsd.zig+3-12| ... | ... | @@ -37,10 +37,7 @@ pub extern "c" fn sendfile( |
| 37 | 37 | flags: u32, |
| 38 | 38 | ) c_int; |
| 39 | 39 | |
| 40 | pub const dl_iterate_phdr_callback = switch (builtin.zig_backend) { | |
| 41 | .stage1 => fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int, | |
| 42 | else => *const fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int, | |
| 43 | }; | |
| 40 | pub const dl_iterate_phdr_callback = std.meta.FnPtr(fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int); | |
| 44 | 41 | pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int; |
| 45 | 42 | |
| 46 | 43 | pub const pthread_mutex_t = extern struct { |
| ... | ... | @@ -1200,14 +1197,8 @@ const NSIG = 32; |
| 1200 | 1197 | |
| 1201 | 1198 | /// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall. |
| 1202 | 1199 | pub const Sigaction = extern struct { |
| 1203 | pub const handler_fn = switch (builtin.zig_backend) { | |
| 1204 | .stage1 => fn (c_int) callconv(.C) void, | |
| 1205 | else => *const fn (c_int) callconv(.C) void, | |
| 1206 | }; | |
| 1207 | pub const sigaction_fn = switch (builtin.zig_backend) { | |
| 1208 | .stage1 => fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void, | |
| 1209 | else => *const fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void, | |
| 1210 | }; | |
| 1200 | pub const handler_fn = std.meta.FnPtr(fn (c_int) callconv(.C) void); | |
| 1201 | pub const sigaction_fn = std.meta.FnPtr(fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void); | |
| 1211 | 1202 | |
| 1212 | 1203 | /// signal handler |
| 1213 | 1204 | handler: extern union { |
lib/std/c/haiku.zig+1-4| ... | ... | @@ -738,10 +738,7 @@ const NSIG = 32; |
| 738 | 738 | |
| 739 | 739 | /// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall. |
| 740 | 740 | pub const Sigaction = extern struct { |
| 741 | pub const handler_fn = switch (builtin.zig_backend) { | |
| 742 | .stage1 => fn (i32) callconv(.C) void, | |
| 743 | else => *const fn (i32) callconv(.C) void, | |
| 744 | }; | |
| 741 | pub const handler_fn = std.meta.FnPtr(fn (i32) callconv(.C) void); | |
| 745 | 742 | |
| 746 | 743 | /// signal handler |
| 747 | 744 | __sigaction_u: extern union { |
lib/std/c/linux.zig+1-4| ... | ... | @@ -263,10 +263,7 @@ pub extern "c" fn inotify_rm_watch(fd: fd_t, wd: c_int) c_int; |
| 263 | 263 | /// See std.elf for constants for this |
| 264 | 264 | pub extern "c" fn getauxval(__type: c_ulong) c_ulong; |
| 265 | 265 | |
| 266 | pub const dl_iterate_phdr_callback = switch (builtin.zig_backend) { | |
| 267 | .stage1 => fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int, | |
| 268 | else => *const fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int, | |
| 269 | }; | |
| 266 | pub const dl_iterate_phdr_callback = std.meta.FnPtr(fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int); | |
| 270 | 267 | |
| 271 | 268 | pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int; |
| 272 | 269 |
lib/std/c/netbsd.zig+3-12| ... | ... | @@ -9,10 +9,7 @@ const rusage = std.c.rusage; |
| 9 | 9 | extern "c" fn __errno() *c_int; |
| 10 | 10 | pub const _errno = __errno; |
| 11 | 11 | |
| 12 | pub const dl_iterate_phdr_callback = switch (builtin.zig_backend) { | |
| 13 | .stage1 => fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int, | |
| 14 | else => *const fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int, | |
| 15 | }; | |
| 12 | pub const dl_iterate_phdr_callback = std.meta.FnPtr(fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int); | |
| 16 | 13 | pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int; |
| 17 | 14 | |
| 18 | 15 | pub extern "c" fn _lwp_self() lwpid_t; |
| ... | ... | @@ -974,14 +971,8 @@ pub const SIG = struct { |
| 974 | 971 | |
| 975 | 972 | /// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall. |
| 976 | 973 | pub const Sigaction = extern struct { |
| 977 | pub const handler_fn = switch (builtin.zig_backend) { | |
| 978 | .stage1 => fn (c_int) callconv(.C) void, | |
| 979 | else => *const fn (c_int) callconv(.C) void, | |
| 980 | }; | |
| 981 | pub const sigaction_fn = switch (builtin.zig_backend) { | |
| 982 | .stage1 => fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void, | |
| 983 | else => *const fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void, | |
| 984 | }; | |
| 974 | pub const handler_fn = std.meta.FnPtr(fn (c_int) callconv(.C) void); | |
| 975 | pub const sigaction_fn = std.meta.FnPtr(fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void); | |
| 985 | 976 | |
| 986 | 977 | /// signal handler |
| 987 | 978 | handler: extern union { |
lib/std/c/openbsd.zig+3-12| ... | ... | @@ -7,10 +7,7 @@ const iovec_const = std.os.iovec_const; |
| 7 | 7 | extern "c" fn __errno() *c_int; |
| 8 | 8 | pub const _errno = __errno; |
| 9 | 9 | |
| 10 | pub const dl_iterate_phdr_callback = switch (builtin.zig_backend) { | |
| 11 | .stage1 => fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int, | |
| 12 | else => *const fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int, | |
| 13 | }; | |
| 10 | pub const dl_iterate_phdr_callback = std.meta.FnPtr(fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int); | |
| 14 | 11 | pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int; |
| 15 | 12 | |
| 16 | 13 | pub extern "c" fn arc4random_buf(buf: [*]u8, len: usize) void; |
| ... | ... | @@ -1029,14 +1026,8 @@ pub const SIG = struct { |
| 1029 | 1026 | |
| 1030 | 1027 | /// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall. |
| 1031 | 1028 | pub const Sigaction = extern struct { |
| 1032 | pub const handler_fn = switch (builtin.zig_backend) { | |
| 1033 | .stage1 => fn (c_int) callconv(.C) void, | |
| 1034 | else => *const fn (c_int) callconv(.C) void, | |
| 1035 | }; | |
| 1036 | pub const sigaction_fn = switch (builtin.zig_backend) { | |
| 1037 | .stage1 => fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void, | |
| 1038 | else => *const fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void, | |
| 1039 | }; | |
| 1029 | pub const handler_fn = std.meta.FnPtr(fn (c_int) callconv(.C) void); | |
| 1030 | pub const sigaction_fn = std.meta.FnPtr(fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void); | |
| 1040 | 1031 | |
| 1041 | 1032 | /// signal handler |
| 1042 | 1033 | handler: extern union { |
lib/std/c/solaris.zig+3-12| ... | ... | @@ -8,10 +8,7 @@ const timezone = std.c.timezone; |
| 8 | 8 | extern "c" fn ___errno() *c_int; |
| 9 | 9 | pub const _errno = ___errno; |
| 10 | 10 | |
| 11 | pub const dl_iterate_phdr_callback = switch (builtin.zig_backend) { | |
| 12 | .stage1 => fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int, | |
| 13 | else => *const fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int, | |
| 14 | }; | |
| 11 | pub const dl_iterate_phdr_callback = std.meta.FnPtr(fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int); | |
| 15 | 12 | pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int; |
| 16 | 13 | |
| 17 | 14 | pub extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) usize; |
| ... | ... | @@ -955,14 +952,8 @@ pub const SIG = struct { |
| 955 | 952 | |
| 956 | 953 | /// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall. |
| 957 | 954 | pub const Sigaction = extern struct { |
| 958 | pub const handler_fn = switch (builtin.zig_backend) { | |
| 959 | .stage1 => fn (c_int) callconv(.C) void, | |
| 960 | else => *const fn (c_int) callconv(.C) void, | |
| 961 | }; | |
| 962 | pub const sigaction_fn = switch (builtin.zig_backend) { | |
| 963 | .stage1 => fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void, | |
| 964 | else => *const fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void, | |
| 965 | }; | |
| 955 | pub const handler_fn = std.meta.FnPtr(fn (c_int) callconv(.C) void); | |
| 956 | pub const sigaction_fn = std.meta.FnPtr(fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void); | |
| 966 | 957 | |
| 967 | 958 | /// signal options |
| 968 | 959 | flags: c_uint, |
lib/std/compress/deflate/compressor.zig+1-4| ... | ... | @@ -254,10 +254,7 @@ pub fn Compressor(comptime WriterType: anytype) type { |
| 254 | 254 | |
| 255 | 255 | // Inner writer wrapped in a HuffmanBitWriter |
| 256 | 256 | hm_bw: hm_bw.HuffmanBitWriter(WriterType) = undefined, |
| 257 | bulk_hasher: if (@import("builtin").zig_backend == .stage1) | |
| 258 | fn ([]u8, []u32) u32 | |
| 259 | else | |
| 260 | *const fn ([]u8, []u32) u32, | |
| 257 | bulk_hasher: std.meta.FnPtr(fn ([]u8, []u32) u32), | |
| 261 | 258 | |
| 262 | 259 | sync: bool, // requesting flush |
| 263 | 260 | best_speed_enc: *fast.DeflateFast, // Encoder for best_speed |
lib/std/compress/deflate/decompressor.zig+1-4| ... | ... | @@ -334,10 +334,7 @@ pub fn Decompressor(comptime ReaderType: type) type { |
| 334 | 334 | |
| 335 | 335 | // Next step in the decompression, |
| 336 | 336 | // and decompression state. |
| 337 | step: if (@import("builtin").zig_backend == .stage1) | |
| 338 | fn (*Self) Error!void | |
| 339 | else | |
| 340 | *const fn (*Self) Error!void, | |
| 337 | step: std.meta.FnPtr(fn (*Self) Error!void), | |
| 341 | 338 | step_state: DecompressorState, |
| 342 | 339 | final: bool, |
| 343 | 340 | err: ?Error, |
lib/std/fmt.zig+3-3| ... | ... | @@ -2173,18 +2173,18 @@ test "escape non-printable" { |
| 2173 | 2173 | } |
| 2174 | 2174 | |
| 2175 | 2175 | test "pointer" { |
| 2176 | if (builtin.zig_backend == .stage1) return error.SkipZigTest; | |
| 2177 | 2176 | { |
| 2178 | 2177 | const value = @intToPtr(*align(1) i32, 0xdeadbeef); |
| 2179 | 2178 | try expectFmt("pointer: i32@deadbeef\n", "pointer: {}\n", .{value}); |
| 2180 | 2179 | try expectFmt("pointer: i32@deadbeef\n", "pointer: {*}\n", .{value}); |
| 2181 | 2180 | } |
| 2181 | const FnPtr = if (builtin.zig_backend == .stage1) fn () void else *align(1) const fn () void; | |
| 2182 | 2182 | { |
| 2183 | const value = @intToPtr(*align(1) const fn () void, 0xdeadbeef); | |
| 2183 | const value = @intToPtr(FnPtr, 0xdeadbeef); | |
| 2184 | 2184 | try expectFmt("pointer: fn() void@deadbeef\n", "pointer: {}\n", .{value}); |
| 2185 | 2185 | } |
| 2186 | 2186 | { |
| 2187 | const value = @intToPtr(*align(1) const fn () void, 0xdeadbeef); | |
| 2187 | const value = @intToPtr(FnPtr, 0xdeadbeef); | |
| 2188 | 2188 | try expectFmt("pointer: fn() void@deadbeef\n", "pointer: {}\n", .{value}); |
| 2189 | 2189 | } |
| 2190 | 2190 | } |
lib/std/mem/Allocator.zig+3-16| ... | ... | @@ -23,10 +23,7 @@ pub const VTable = struct { |
| 23 | 23 | /// |
| 24 | 24 | /// `ret_addr` is optionally provided as the first return address of the allocation call stack. |
| 25 | 25 | /// If the value is `0` it means no return address has been provided. |
| 26 | alloc: switch (builtin.zig_backend) { | |
| 27 | .stage1 => allocProto, // temporary workaround until we replace stage1 with stage2 | |
| 28 | else => *const allocProto, | |
| 29 | }, | |
| 26 | alloc: std.meta.FnPtr(fn (ptr: *anyopaque, len: usize, ptr_align: u29, len_align: u29, ret_addr: usize) Error![]u8), | |
| 30 | 27 | |
| 31 | 28 | /// Attempt to expand or shrink memory in place. `buf.len` must equal the most recent |
| 32 | 29 | /// length returned by `alloc` or `resize`. `buf_align` must equal the same value |
| ... | ... | @@ -45,26 +42,16 @@ pub const VTable = struct { |
| 45 | 42 | /// |
| 46 | 43 | /// `ret_addr` is optionally provided as the first return address of the allocation call stack. |
| 47 | 44 | /// If the value is `0` it means no return address has been provided. |
| 48 | resize: switch (builtin.zig_backend) { | |
| 49 | .stage1 => resizeProto, // temporary workaround until we replace stage1 with stage2 | |
| 50 | else => *const resizeProto, | |
| 51 | }, | |
| 45 | resize: std.meta.FnPtr(fn (ptr: *anyopaque, buf: []u8, buf_align: u29, new_len: usize, len_align: u29, ret_addr: usize) ?usize), | |
| 52 | 46 | |
| 53 | 47 | /// Free and invalidate a buffer. `buf.len` must equal the most recent length returned by `alloc` or `resize`. |
| 54 | 48 | /// `buf_align` must equal the same value that was passed as the `ptr_align` parameter to the original `alloc` call. |
| 55 | 49 | /// |
| 56 | 50 | /// `ret_addr` is optionally provided as the first return address of the allocation call stack. |
| 57 | 51 | /// If the value is `0` it means no return address has been provided. |
| 58 | free: switch (builtin.zig_backend) { | |
| 59 | .stage1 => freeProto, // temporary workaround until we replace stage1 with stage2 | |
| 60 | else => *const freeProto, | |
| 61 | }, | |
| 52 | free: std.meta.FnPtr(fn (ptr: *anyopaque, buf: []u8, buf_align: u29, ret_addr: usize) void), | |
| 62 | 53 | }; |
| 63 | 54 | |
| 64 | const allocProto = fn (ptr: *anyopaque, len: usize, ptr_align: u29, len_align: u29, ret_addr: usize) Error![]u8; | |
| 65 | const resizeProto = fn (ptr: *anyopaque, buf: []u8, buf_align: u29, new_len: usize, len_align: u29, ret_addr: usize) ?usize; | |
| 66 | const freeProto = fn (ptr: *anyopaque, buf: []u8, buf_align: u29, ret_addr: usize) void; | |
| 67 | ||
| 68 | 55 | pub fn init( |
| 69 | 56 | pointer: anytype, |
| 70 | 57 | comptime allocFn: fn (ptr: @TypeOf(pointer), len: usize, ptr_align: u29, len_align: u29, ret_addr: usize) Error![]u8, |
lib/std/os/linux.zig+8-19| ... | ... | @@ -3068,12 +3068,9 @@ pub const sigset_t = [1024 / 32]u32; |
| 3068 | 3068 | pub const all_mask: sigset_t = [_]u32{0xffffffff} ** @typeInfo(sigset_t).Array.len; |
| 3069 | 3069 | pub const app_mask: sigset_t = [2]u32{ 0xfffffffc, 0x7fffffff } ++ [_]u32{0xffffffff} ** 30; |
| 3070 | 3070 | |
| 3071 | const k_sigaction_funcs = if (builtin.zig_backend == .stage1) struct { | |
| 3072 | const handler = ?fn (c_int) callconv(.C) void; | |
| 3073 | const restorer = fn () callconv(.C) void; | |
| 3074 | } else struct { | |
| 3075 | const handler = ?*const fn (c_int) callconv(.C) void; | |
| 3076 | const restorer = *const fn () callconv(.C) void; | |
| 3071 | const k_sigaction_funcs = struct { | |
| 3072 | const handler = ?std.meta.FnPtr(fn (c_int) callconv(.C) void); | |
| 3073 | const restorer = std.meta.FnPtr(fn () callconv(.C) void); | |
| 3077 | 3074 | }; |
| 3078 | 3075 | |
| 3079 | 3076 | pub const k_sigaction = switch (native_arch) { |
| ... | ... | @@ -3099,24 +3096,16 @@ pub const k_sigaction = switch (native_arch) { |
| 3099 | 3096 | |
| 3100 | 3097 | /// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall. |
| 3101 | 3098 | pub const Sigaction = extern struct { |
| 3102 | pub usingnamespace if (builtin.zig_backend == .stage1) struct { | |
| 3103 | pub const handler_fn = fn (c_int) callconv(.C) void; | |
| 3104 | pub const sigaction_fn = fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void; | |
| 3105 | } else struct { | |
| 3106 | pub const handler_fn = *const fn (c_int) callconv(.C) void; | |
| 3107 | pub const sigaction_fn = *const fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void; | |
| 3108 | }; | |
| 3099 | pub const handler_fn = std.meta.FnPtr(fn (c_int) callconv(.C) void); | |
| 3100 | pub const sigaction_fn = std.meta.FnPtr(fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void); | |
| 3109 | 3101 | |
| 3110 | 3102 | handler: extern union { |
| 3111 | handler: ?Sigaction.handler_fn, | |
| 3112 | sigaction: ?Sigaction.sigaction_fn, | |
| 3103 | handler: ?handler_fn, | |
| 3104 | sigaction: ?sigaction_fn, | |
| 3113 | 3105 | }, |
| 3114 | 3106 | mask: sigset_t, |
| 3115 | 3107 | flags: c_uint, |
| 3116 | restorer: ?if (builtin.zig_backend == .stage1) | |
| 3117 | fn () callconv(.C) void | |
| 3118 | else | |
| 3119 | *const fn () callconv(.C) void = null, | |
| 3108 | restorer: ?std.meta.FnPtr(fn () callconv(.C) void) = null, | |
| 3120 | 3109 | }; |
| 3121 | 3110 | |
| 3122 | 3111 | pub const empty_sigset = [_]u32{0} ** @typeInfo(sigset_t).Array.len; |
lib/std/os/linux/arm-eabi.zig+3-12| ... | ... | @@ -98,19 +98,10 @@ pub fn syscall6( |
| 98 | 98 | ); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8); | |
| 102 | ||
| 101 | 103 | /// This matches the libc clone function. |
| 102 | pub extern fn clone( | |
| 103 | func: switch (@import("builtin").zig_backend) { | |
| 104 | .stage1 => fn (arg: usize) callconv(.C) u8, | |
| 105 | else => *const fn (arg: usize) callconv(.C) u8, | |
| 106 | }, | |
| 107 | stack: usize, | |
| 108 | flags: u32, | |
| 109 | arg: usize, | |
| 110 | ptid: *i32, | |
| 111 | tls: usize, | |
| 112 | ctid: *i32, | |
| 113 | ) usize; | |
| 104 | pub extern fn clone(func: CloneFn, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; | |
| 114 | 105 | |
| 115 | 106 | pub fn restore() callconv(.Naked) void { |
| 116 | 107 | return asm volatile ("svc #0" |
lib/std/os/linux/arm64.zig+1-4| ... | ... | @@ -98,10 +98,7 @@ pub fn syscall6( |
| 98 | 98 | ); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | const CloneFn = switch (@import("builtin").zig_backend) { | |
| 102 | .stage1 => fn (arg: usize) callconv(.C) u8, | |
| 103 | else => *const fn (arg: usize) callconv(.C) u8, | |
| 104 | }; | |
| 101 | const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8); | |
| 105 | 102 | |
| 106 | 103 | /// This matches the libc clone function. |
| 107 | 104 | pub extern fn clone(func: CloneFn, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; |
lib/std/os/linux/i386.zig+1-4| ... | ... | @@ -118,10 +118,7 @@ pub fn socketcall(call: usize, args: [*]usize) usize { |
| 118 | 118 | ); |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | const CloneFn = switch (@import("builtin").zig_backend) { | |
| 122 | .stage1 => fn (arg: usize) callconv(.C) u8, | |
| 123 | else => *const fn (arg: usize) callconv(.C) u8, | |
| 124 | }; | |
| 121 | const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8); | |
| 125 | 122 | |
| 126 | 123 | /// This matches the libc clone function. |
| 127 | 124 | pub extern fn clone(func: CloneFn, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; |
lib/std/os/linux/mips.zig+1-4| ... | ... | @@ -190,10 +190,7 @@ pub fn syscall7( |
| 190 | 190 | ); |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | const CloneFn = switch (@import("builtin").zig_backend) { | |
| 194 | .stage1 => fn (arg: usize) callconv(.C) u8, | |
| 195 | else => *const fn (arg: usize) callconv(.C) u8, | |
| 196 | }; | |
| 193 | const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8); | |
| 197 | 194 | |
| 198 | 195 | /// This matches the libc clone function. |
| 199 | 196 | pub extern fn clone(func: CloneFn, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; |
lib/std/os/linux/powerpc.zig+1-4| ... | ... | @@ -126,10 +126,7 @@ pub fn syscall6( |
| 126 | 126 | ); |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | const CloneFn = switch (@import("builtin").zig_backend) { | |
| 130 | .stage1 => fn (arg: usize) callconv(.C) u8, | |
| 131 | else => *const fn (arg: usize) callconv(.C) u8, | |
| 132 | }; | |
| 129 | const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8); | |
| 133 | 130 | |
| 134 | 131 | /// This matches the libc clone function. |
| 135 | 132 | pub extern fn clone(func: CloneFn, stack: usize, flags: usize, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; |
lib/std/os/linux/powerpc64.zig+1-4| ... | ... | @@ -126,10 +126,7 @@ pub fn syscall6( |
| 126 | 126 | ); |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | const CloneFn = switch (@import("builtin").zig_backend) { | |
| 130 | .stage1 => fn (arg: usize) callconv(.C) u8, | |
| 131 | else => *const fn (arg: usize) callconv(.C) u8, | |
| 132 | }; | |
| 129 | const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8); | |
| 133 | 130 | |
| 134 | 131 | /// This matches the libc clone function. |
| 135 | 132 | pub extern fn clone(func: CloneFn, stack: usize, flags: usize, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; |
lib/std/os/linux/riscv64.zig+1-4| ... | ... | @@ -95,10 +95,7 @@ pub fn syscall6( |
| 95 | 95 | ); |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | const CloneFn = switch (@import("builtin").zig_backend) { | |
| 99 | .stage1 => fn (arg: usize) callconv(.C) u8, | |
| 100 | else => *const fn (arg: usize) callconv(.C) u8, | |
| 101 | }; | |
| 98 | const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8); | |
| 102 | 99 | |
| 103 | 100 | pub extern fn clone(func: CloneFn, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; |
| 104 | 101 |
lib/std/os/linux/sparc64.zig+1-4| ... | ... | @@ -178,10 +178,7 @@ pub fn syscall6( |
| 178 | 178 | ); |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | const CloneFn = switch (@import("builtin").zig_backend) { | |
| 182 | .stage1 => fn (arg: usize) callconv(.C) u8, | |
| 183 | else => *const fn (arg: usize) callconv(.C) u8, | |
| 184 | }; | |
| 181 | const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8); | |
| 185 | 182 | |
| 186 | 183 | /// This matches the libc clone function. |
| 187 | 184 | pub extern fn clone(func: CloneFn, stack: usize, flags: usize, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; |
lib/std/os/linux/x86_64.zig+2-5| ... | ... | @@ -100,14 +100,11 @@ pub fn syscall6( |
| 100 | 100 | ); |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | const CloneFn = std.meta.FnPtr(fn (arg: usize) callconv(.C) u8); | |
| 104 | ||
| 103 | 105 | /// This matches the libc clone function. |
| 104 | 106 | pub extern fn clone(func: CloneFn, stack: usize, flags: usize, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; |
| 105 | 107 | |
| 106 | const CloneFn = switch (@import("builtin").zig_backend) { | |
| 107 | .stage1 => fn (arg: usize) callconv(.C) u8, | |
| 108 | else => *const fn (arg: usize) callconv(.C) u8, | |
| 109 | }; | |
| 110 | ||
| 111 | 108 | pub const restore = restore_rt; |
| 112 | 109 | |
| 113 | 110 | pub fn restore_rt() callconv(.Naked) void { |
lib/std/os/uefi/protocols/absolute_pointer_protocol.zig+4-3| ... | ... | @@ -1,12 +1,13 @@ |
| 1 | const uefi = @import("std").os.uefi; | |
| 1 | const std = @import("std"); | |
| 2 | const uefi = std.os.uefi; | |
| 2 | 3 | const Event = uefi.Event; |
| 3 | 4 | const Guid = uefi.Guid; |
| 4 | 5 | const Status = uefi.Status; |
| 5 | 6 | |
| 6 | 7 | /// Protocol for touchscreens |
| 7 | 8 | pub const AbsolutePointerProtocol = extern struct { |
| 8 | _reset: fn (*const AbsolutePointerProtocol, bool) callconv(.C) Status, | |
| 9 | _get_state: fn (*const AbsolutePointerProtocol, *AbsolutePointerState) callconv(.C) Status, | |
| 9 | _reset: std.meta.FnPtr(fn (*const AbsolutePointerProtocol, bool) callconv(.C) Status), | |
| 10 | _get_state: std.meta.FnPtr(fn (*const AbsolutePointerProtocol, *AbsolutePointerState) callconv(.C) Status), | |
| 10 | 11 | wait_for_input: Event, |
| 11 | 12 | mode: *AbsolutePointerMode, |
| 12 | 13 |
lib/std/os/uefi/protocols/block_io_protocol.zig+4-4| ... | ... | @@ -44,10 +44,10 @@ pub const BlockIoProtocol = extern struct { |
| 44 | 44 | revision: u64, |
| 45 | 45 | media: *EfiBlockMedia, |
| 46 | 46 | |
| 47 | _reset: fn (*BlockIoProtocol, extended_verification: bool) callconv(.C) Status, | |
| 48 | _read_blocks: fn (*BlockIoProtocol, media_id: u32, lba: u64, buffer_size: usize, buf: [*]u8) callconv(.C) Status, | |
| 49 | _write_blocks: fn (*BlockIoProtocol, media_id: u32, lba: u64, buffer_size: usize, buf: [*]u8) callconv(.C) Status, | |
| 50 | _flush_blocks: fn (*BlockIoProtocol) callconv(.C) Status, | |
| 47 | _reset: std.meta.FnPtr(fn (*BlockIoProtocol, extended_verification: bool) callconv(.C) Status), | |
| 48 | _read_blocks: std.meta.FnPtr(fn (*BlockIoProtocol, media_id: u32, lba: u64, buffer_size: usize, buf: [*]u8) callconv(.C) Status), | |
| 49 | _write_blocks: std.meta.FnPtr(fn (*BlockIoProtocol, media_id: u32, lba: u64, buffer_size: usize, buf: [*]u8) callconv(.C) Status), | |
| 50 | _flush_blocks: std.meta.FnPtr(fn (*BlockIoProtocol) callconv(.C) Status), | |
| 51 | 51 | |
| 52 | 52 | /// Resets the block device hardware. |
| 53 | 53 | pub fn reset(self: *Self, extended_verification: bool) Status { |
lib/std/os/uefi/protocols/edid_override_protocol.zig+3-2| ... | ... | @@ -1,11 +1,12 @@ |
| 1 | const uefi = @import("std").os.uefi; | |
| 1 | const std = @import("std"); | |
| 2 | const uefi = std.os.uefi; | |
| 2 | 3 | const Guid = uefi.Guid; |
| 3 | 4 | const Handle = uefi.Handle; |
| 4 | 5 | const Status = uefi.Status; |
| 5 | 6 | |
| 6 | 7 | /// Override EDID information |
| 7 | 8 | pub const EdidOverrideProtocol = extern struct { |
| 8 | _get_edid: fn (*const EdidOverrideProtocol, Handle, *u32, *usize, *?[*]u8) callconv(.C) Status, | |
| 9 | _get_edid: std.meta.FnPtr(fn (*const EdidOverrideProtocol, Handle, *u32, *usize, *?[*]u8) callconv(.C) Status), | |
| 9 | 10 | |
| 10 | 11 | /// Returns policy information and potentially a replacement EDID for the specified video output device. |
| 11 | 12 | pub fn getEdid( |
lib/std/os/uefi/protocols/file_protocol.zig+10-10| ... | ... | @@ -7,16 +7,16 @@ const Status = uefi.Status; |
| 7 | 7 | |
| 8 | 8 | pub const FileProtocol = extern struct { |
| 9 | 9 | revision: u64, |
| 10 | _open: fn (*const FileProtocol, **const FileProtocol, [*:0]const u16, u64, u64) callconv(.C) Status, | |
| 11 | _close: fn (*const FileProtocol) callconv(.C) Status, | |
| 12 | _delete: fn (*const FileProtocol) callconv(.C) Status, | |
| 13 | _read: fn (*const FileProtocol, *usize, [*]u8) callconv(.C) Status, | |
| 14 | _write: fn (*const FileProtocol, *usize, [*]const u8) callconv(.C) Status, | |
| 15 | _get_position: fn (*const FileProtocol, *u64) callconv(.C) Status, | |
| 16 | _set_position: fn (*const FileProtocol, u64) callconv(.C) Status, | |
| 17 | _get_info: fn (*const FileProtocol, *align(8) const Guid, *const usize, [*]u8) callconv(.C) Status, | |
| 18 | _set_info: fn (*const FileProtocol, *align(8) const Guid, usize, [*]const u8) callconv(.C) Status, | |
| 19 | _flush: fn (*const FileProtocol) callconv(.C) Status, | |
| 10 | _open: std.meta.FnPtr(fn (*const FileProtocol, **const FileProtocol, [*:0]const u16, u64, u64) callconv(.C) Status), | |
| 11 | _close: std.meta.FnPtr(fn (*const FileProtocol) callconv(.C) Status), | |
| 12 | _delete: std.meta.FnPtr(fn (*const FileProtocol) callconv(.C) Status), | |
| 13 | _read: std.meta.FnPtr(fn (*const FileProtocol, *usize, [*]u8) callconv(.C) Status), | |
| 14 | _write: std.meta.FnPtr(fn (*const FileProtocol, *usize, [*]const u8) callconv(.C) Status), | |
| 15 | _get_position: std.meta.FnPtr(fn (*const FileProtocol, *u64) callconv(.C) Status), | |
| 16 | _set_position: std.meta.FnPtr(fn (*const FileProtocol, u64) callconv(.C) Status), | |
| 17 | _get_info: std.meta.FnPtr(fn (*const FileProtocol, *align(8) const Guid, *const usize, [*]u8) callconv(.C) Status), | |
| 18 | _set_info: std.meta.FnPtr(fn (*const FileProtocol, *align(8) const Guid, usize, [*]const u8) callconv(.C) Status), | |
| 19 | _flush: std.meta.FnPtr(fn (*const FileProtocol) callconv(.C) Status), | |
| 20 | 20 | |
| 21 | 21 | pub const SeekError = error{SeekError}; |
| 22 | 22 | pub const GetSeekPosError = error{GetSeekPosError}; |
lib/std/os/uefi/protocols/graphics_output_protocol.zig+5-4| ... | ... | @@ -1,12 +1,13 @@ |
| 1 | const uefi = @import("std").os.uefi; | |
| 1 | const std = @import("std"); | |
| 2 | const uefi = std.os.uefi; | |
| 2 | 3 | const Guid = uefi.Guid; |
| 3 | 4 | const Status = uefi.Status; |
| 4 | 5 | |
| 5 | 6 | /// Graphics output |
| 6 | 7 | pub const GraphicsOutputProtocol = extern struct { |
| 7 | _query_mode: fn (*const GraphicsOutputProtocol, u32, *usize, **GraphicsOutputModeInformation) callconv(.C) Status, | |
| 8 | _set_mode: fn (*const GraphicsOutputProtocol, u32) callconv(.C) Status, | |
| 9 | _blt: fn (*const GraphicsOutputProtocol, ?[*]GraphicsOutputBltPixel, GraphicsOutputBltOperation, usize, usize, usize, usize, usize, usize, usize) callconv(.C) Status, | |
| 8 | _query_mode: std.meta.FnPtr(fn (*const GraphicsOutputProtocol, u32, *usize, **GraphicsOutputModeInformation) callconv(.C) Status), | |
| 9 | _set_mode: std.meta.FnPtr(fn (*const GraphicsOutputProtocol, u32) callconv(.C) Status), | |
| 10 | _blt: std.meta.FnPtr(fn (*const GraphicsOutputProtocol, ?[*]GraphicsOutputBltPixel, GraphicsOutputBltOperation, usize, usize, usize, usize, usize, usize, usize) callconv(.C) Status), | |
| 10 | 11 | mode: *GraphicsOutputProtocolMode, |
| 11 | 12 | |
| 12 | 13 | /// Returns information for an available graphics mode that the graphics device and the set of active video output devices supports. |
lib/std/os/uefi/protocols/hii_database_protocol.zig+6-5| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | const uefi = @import("std").os.uefi; | |
| 1 | const std = @import("std"); | |
| 2 | const uefi = std.os.uefi; | |
| 2 | 3 | const Guid = uefi.Guid; |
| 3 | 4 | const Status = uefi.Status; |
| 4 | 5 | const hii = uefi.protocols.hii; |
| ... | ... | @@ -6,10 +7,10 @@ const hii = uefi.protocols.hii; |
| 6 | 7 | /// Database manager for HII-related data structures. |
| 7 | 8 | pub const HIIDatabaseProtocol = extern struct { |
| 8 | 9 | _new_package_list: Status, // TODO |
| 9 | _remove_package_list: fn (*const HIIDatabaseProtocol, hii.HIIHandle) callconv(.C) Status, | |
| 10 | _update_package_list: fn (*const HIIDatabaseProtocol, hii.HIIHandle, *const hii.HIIPackageList) callconv(.C) Status, | |
| 11 | _list_package_lists: fn (*const HIIDatabaseProtocol, u8, ?*const Guid, *usize, [*]hii.HIIHandle) callconv(.C) Status, | |
| 12 | _export_package_lists: fn (*const HIIDatabaseProtocol, ?hii.HIIHandle, *usize, *hii.HIIPackageList) callconv(.C) Status, | |
| 10 | _remove_package_list: std.meta.FnPtr(fn (*const HIIDatabaseProtocol, hii.HIIHandle) callconv(.C) Status), | |
| 11 | _update_package_list: std.meta.FnPtr(fn (*const HIIDatabaseProtocol, hii.HIIHandle, *const hii.HIIPackageList) callconv(.C) Status), | |
| 12 | _list_package_lists: std.meta.FnPtr(fn (*const HIIDatabaseProtocol, u8, ?*const Guid, *usize, [*]hii.HIIHandle) callconv(.C) Status), | |
| 13 | _export_package_lists: std.meta.FnPtr(fn (*const HIIDatabaseProtocol, ?hii.HIIHandle, *usize, *hii.HIIPackageList) callconv(.C) Status), | |
| 13 | 14 | _register_package_notify: Status, // TODO |
| 14 | 15 | _unregister_package_notify: Status, // TODO |
| 15 | 16 | _find_keyboard_layouts: Status, // TODO |
lib/std/os/uefi/protocols/hii_popup_protocol.zig+3-2| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | const uefi = @import("std").os.uefi; | |
| 1 | const std = @import("std"); | |
| 2 | const uefi = std.os.uefi; | |
| 2 | 3 | const Guid = uefi.Guid; |
| 3 | 4 | const Status = uefi.Status; |
| 4 | 5 | const hii = uefi.protocols.hii; |
| ... | ... | @@ -6,7 +7,7 @@ const hii = uefi.protocols.hii; |
| 6 | 7 | /// Display a popup window |
| 7 | 8 | pub const HIIPopupProtocol = extern struct { |
| 8 | 9 | revision: u64, |
| 9 | _create_popup: fn (*const HIIPopupProtocol, HIIPopupStyle, HIIPopupType, hii.HIIHandle, u16, ?*HIIPopupSelection) callconv(.C) Status, | |
| 10 | _create_popup: std.meta.FnPtr(fn (*const HIIPopupProtocol, HIIPopupStyle, HIIPopupType, hii.HIIHandle, u16, ?*HIIPopupSelection) callconv(.C) Status), | |
| 10 | 11 | |
| 11 | 12 | /// Displays a popup window. |
| 12 | 13 | pub fn createPopup(self: *const HIIPopupProtocol, style: HIIPopupStyle, popup_type: HIIPopupType, handle: hii.HIIHandle, msg: u16, user_selection: ?*HIIPopupSelection) Status { |
lib/std/os/uefi/protocols/ip6_config_protocol.zig+6-5| ... | ... | @@ -1,13 +1,14 @@ |
| 1 | const uefi = @import("std").os.uefi; | |
| 1 | const std = @import("std"); | |
| 2 | const uefi = std.os.uefi; | |
| 2 | 3 | const Guid = uefi.Guid; |
| 3 | 4 | const Event = uefi.Event; |
| 4 | 5 | const Status = uefi.Status; |
| 5 | 6 | |
| 6 | 7 | pub const Ip6ConfigProtocol = extern struct { |
| 7 | _set_data: fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, usize, *const anyopaque) callconv(.C) Status, | |
| 8 | _get_data: fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, *usize, ?*const anyopaque) callconv(.C) Status, | |
| 9 | _register_data_notify: fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, Event) callconv(.C) Status, | |
| 10 | _unregister_data_notify: fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, Event) callconv(.C) Status, | |
| 8 | _set_data: std.meta.FnPtr(fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, usize, *const anyopaque) callconv(.C) Status), | |
| 9 | _get_data: std.meta.FnPtr(fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, *usize, ?*const anyopaque) callconv(.C) Status), | |
| 10 | _register_data_notify: std.meta.FnPtr(fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, Event) callconv(.C) Status), | |
| 11 | _unregister_data_notify: std.meta.FnPtr(fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, Event) callconv(.C) Status), | |
| 11 | 12 | |
| 12 | 13 | pub fn setData(self: *const Ip6ConfigProtocol, data_type: Ip6ConfigDataType, data_size: usize, data: *const anyopaque) Status { |
| 13 | 14 | return self._set_data(self, data_type, data_size, data); |
lib/std/os/uefi/protocols/ip6_protocol.zig+11-10| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | const uefi = @import("std").os.uefi; | |
| 1 | const std = @import("std"); | |
| 2 | const uefi = std.os.uefi; | |
| 2 | 3 | const Guid = uefi.Guid; |
| 3 | 4 | const Event = uefi.Event; |
| 4 | 5 | const Status = uefi.Status; |
| ... | ... | @@ -7,15 +8,15 @@ const ManagedNetworkConfigData = uefi.protocols.ManagedNetworkConfigData; |
| 7 | 8 | const SimpleNetworkMode = uefi.protocols.SimpleNetworkMode; |
| 8 | 9 | |
| 9 | 10 | pub const Ip6Protocol = extern struct { |
| 10 | _get_mode_data: fn (*const Ip6Protocol, ?*Ip6ModeData, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) callconv(.C) Status, | |
| 11 | _configure: fn (*const Ip6Protocol, ?*const Ip6ConfigData) callconv(.C) Status, | |
| 12 | _groups: fn (*const Ip6Protocol, bool, ?*const Ip6Address) callconv(.C) Status, | |
| 13 | _routes: fn (*const Ip6Protocol, bool, ?*const Ip6Address, u8, ?*const Ip6Address) callconv(.C) Status, | |
| 14 | _neighbors: fn (*const Ip6Protocol, bool, *const Ip6Address, ?*const MacAddress, u32, bool) callconv(.C) Status, | |
| 15 | _transmit: fn (*const Ip6Protocol, *Ip6CompletionToken) callconv(.C) Status, | |
| 16 | _receive: fn (*const Ip6Protocol, *Ip6CompletionToken) callconv(.C) Status, | |
| 17 | _cancel: fn (*const Ip6Protocol, ?*Ip6CompletionToken) callconv(.C) Status, | |
| 18 | _poll: fn (*const Ip6Protocol) callconv(.C) Status, | |
| 11 | _get_mode_data: std.meta.FnPtr(fn (*const Ip6Protocol, ?*Ip6ModeData, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) callconv(.C) Status), | |
| 12 | _configure: std.meta.FnPtr(fn (*const Ip6Protocol, ?*const Ip6ConfigData) callconv(.C) Status), | |
| 13 | _groups: std.meta.FnPtr(fn (*const Ip6Protocol, bool, ?*const Ip6Address) callconv(.C) Status), | |
| 14 | _routes: std.meta.FnPtr(fn (*const Ip6Protocol, bool, ?*const Ip6Address, u8, ?*const Ip6Address) callconv(.C) Status), | |
| 15 | _neighbors: std.meta.FnPtr(fn (*const Ip6Protocol, bool, *const Ip6Address, ?*const MacAddress, u32, bool) callconv(.C) Status), | |
| 16 | _transmit: std.meta.FnPtr(fn (*const Ip6Protocol, *Ip6CompletionToken) callconv(.C) Status), | |
| 17 | _receive: std.meta.FnPtr(fn (*const Ip6Protocol, *Ip6CompletionToken) callconv(.C) Status), | |
| 18 | _cancel: std.meta.FnPtr(fn (*const Ip6Protocol, ?*Ip6CompletionToken) callconv(.C) Status), | |
| 19 | _poll: std.meta.FnPtr(fn (*const Ip6Protocol) callconv(.C) Status), | |
| 19 | 20 | |
| 20 | 21 | /// Gets the current operational settings for this instance of the EFI IPv6 Protocol driver. |
| 21 | 22 | pub fn getModeData(self: *const Ip6Protocol, ip6_mode_data: ?*Ip6ModeData, mnp_config_data: ?*ManagedNetworkConfigData, snp_mode_data: ?*SimpleNetworkMode) Status { |
lib/std/os/uefi/protocols/ip6_service_binding_protocol.zig+4-3| ... | ... | @@ -1,11 +1,12 @@ |
| 1 | const uefi = @import("std").os.uefi; | |
| 1 | const std = @import("std"); | |
| 2 | const uefi = std.os.uefi; | |
| 2 | 3 | const Handle = uefi.Handle; |
| 3 | 4 | const Guid = uefi.Guid; |
| 4 | 5 | const Status = uefi.Status; |
| 5 | 6 | |
| 6 | 7 | pub const Ip6ServiceBindingProtocol = extern struct { |
| 7 | _create_child: fn (*const Ip6ServiceBindingProtocol, *?Handle) callconv(.C) Status, | |
| 8 | _destroy_child: fn (*const Ip6ServiceBindingProtocol, Handle) callconv(.C) Status, | |
| 8 | _create_child: std.meta.FnPtr(fn (*const Ip6ServiceBindingProtocol, *?Handle) callconv(.C) Status), | |
| 9 | _destroy_child: std.meta.FnPtr(fn (*const Ip6ServiceBindingProtocol, Handle) callconv(.C) Status), | |
| 9 | 10 | |
| 10 | 11 | pub fn createChild(self: *const Ip6ServiceBindingProtocol, handle: *?Handle) Status { |
| 11 | 12 | return self._create_child(self, handle); |
lib/std/os/uefi/protocols/loaded_image_protocol.zig+3-2| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | const uefi = @import("std").os.uefi; | |
| 1 | const std = @import("std"); | |
| 2 | const uefi = std.os.uefi; | |
| 2 | 3 | const Guid = uefi.Guid; |
| 3 | 4 | const Handle = uefi.Handle; |
| 4 | 5 | const Status = uefi.Status; |
| ... | ... | @@ -19,7 +20,7 @@ pub const LoadedImageProtocol = extern struct { |
| 19 | 20 | image_size: u64, |
| 20 | 21 | image_code_type: MemoryType, |
| 21 | 22 | image_data_type: MemoryType, |
| 22 | _unload: fn (*const LoadedImageProtocol, Handle) callconv(.C) Status, | |
| 23 | _unload: std.meta.FnPtr(fn (*const LoadedImageProtocol, Handle) callconv(.C) Status), | |
| 23 | 24 | |
| 24 | 25 | /// Unloads an image from memory. |
| 25 | 26 | pub fn unload(self: *const LoadedImageProtocol, handle: Handle) Status { |
lib/std/os/uefi/protocols/managed_network_protocol.zig+10-9| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | const uefi = @import("std").os.uefi; | |
| 1 | const std = @import("std"); | |
| 2 | const uefi = std.os.uefi; | |
| 2 | 3 | const Guid = uefi.Guid; |
| 3 | 4 | const Event = uefi.Event; |
| 4 | 5 | const Status = uefi.Status; |
| ... | ... | @@ -7,14 +8,14 @@ const SimpleNetworkMode = uefi.protocols.SimpleNetworkMode; |
| 7 | 8 | const MacAddress = uefi.protocols.MacAddress; |
| 8 | 9 | |
| 9 | 10 | pub const ManagedNetworkProtocol = extern struct { |
| 10 | _get_mode_data: fn (*const ManagedNetworkProtocol, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) callconv(.C) Status, | |
| 11 | _configure: fn (*const ManagedNetworkProtocol, ?*const ManagedNetworkConfigData) callconv(.C) Status, | |
| 12 | _mcast_ip_to_mac: fn (*const ManagedNetworkProtocol, bool, *const anyopaque, *MacAddress) callconv(.C) Status, | |
| 13 | _groups: fn (*const ManagedNetworkProtocol, bool, ?*const MacAddress) callconv(.C) Status, | |
| 14 | _transmit: fn (*const ManagedNetworkProtocol, *const ManagedNetworkCompletionToken) callconv(.C) Status, | |
| 15 | _receive: fn (*const ManagedNetworkProtocol, *const ManagedNetworkCompletionToken) callconv(.C) Status, | |
| 16 | _cancel: fn (*const ManagedNetworkProtocol, ?*const ManagedNetworkCompletionToken) callconv(.C) Status, | |
| 17 | _poll: fn (*const ManagedNetworkProtocol) callconv(.C) usize, | |
| 11 | _get_mode_data: std.meta.FnPtr(fn (*const ManagedNetworkProtocol, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) callconv(.C) Status), | |
| 12 | _configure: std.meta.FnPtr(fn (*const ManagedNetworkProtocol, ?*const ManagedNetworkConfigData) callconv(.C) Status), | |
| 13 | _mcast_ip_to_mac: std.meta.FnPtr(fn (*const ManagedNetworkProtocol, bool, *const anyopaque, *MacAddress) callconv(.C) Status), | |
| 14 | _groups: std.meta.FnPtr(fn (*const ManagedNetworkProtocol, bool, ?*const MacAddress) callconv(.C) Status), | |
| 15 | _transmit: std.meta.FnPtr(fn (*const ManagedNetworkProtocol, *const ManagedNetworkCompletionToken) callconv(.C) Status), | |
| 16 | _receive: std.meta.FnPtr(fn (*const ManagedNetworkProtocol, *const ManagedNetworkCompletionToken) callconv(.C) Status), | |
| 17 | _cancel: std.meta.FnPtr(fn (*const ManagedNetworkProtocol, ?*const ManagedNetworkCompletionToken) callconv(.C) Status), | |
| 18 | _poll: std.meta.FnPtr(fn (*const ManagedNetworkProtocol) callconv(.C) usize), | |
| 18 | 19 | |
| 19 | 20 | /// Returns the operational parameters for the current MNP child driver. |
| 20 | 21 | /// May also support returning the underlying SNP driver mode data. |
lib/std/os/uefi/protocols/managed_network_service_binding_protocol.zig+4-3| ... | ... | @@ -1,11 +1,12 @@ |
| 1 | const uefi = @import("std").os.uefi; | |
| 1 | const std = @import("std"); | |
| 2 | const uefi = std.os.uefi; | |
| 2 | 3 | const Handle = uefi.Handle; |
| 3 | 4 | const Guid = uefi.Guid; |
| 4 | 5 | const Status = uefi.Status; |
| 5 | 6 | |
| 6 | 7 | pub const ManagedNetworkServiceBindingProtocol = extern struct { |
| 7 | _create_child: fn (*const ManagedNetworkServiceBindingProtocol, *?Handle) callconv(.C) Status, | |
| 8 | _destroy_child: fn (*const ManagedNetworkServiceBindingProtocol, Handle) callconv(.C) Status, | |
| 8 | _create_child: std.meta.FnPtr(fn (*const ManagedNetworkServiceBindingProtocol, *?Handle) callconv(.C) Status), | |
| 9 | _destroy_child: std.meta.FnPtr(fn (*const ManagedNetworkServiceBindingProtocol, Handle) callconv(.C) Status), | |
| 9 | 10 | |
| 10 | 11 | pub fn createChild(self: *const ManagedNetworkServiceBindingProtocol, handle: *?Handle) Status { |
| 11 | 12 | return self._create_child(self, handle); |
lib/std/os/uefi/protocols/rng_protocol.zig+4-3| ... | ... | @@ -1,11 +1,12 @@ |
| 1 | const uefi = @import("std").os.uefi; | |
| 1 | const std = @import("std"); | |
| 2 | const uefi = std.os.uefi; | |
| 2 | 3 | const Guid = uefi.Guid; |
| 3 | 4 | const Status = uefi.Status; |
| 4 | 5 | |
| 5 | 6 | /// Random Number Generator protocol |
| 6 | 7 | pub const RNGProtocol = extern struct { |
| 7 | _get_info: fn (*const RNGProtocol, *usize, [*]align(8) Guid) callconv(.C) Status, | |
| 8 | _get_rng: fn (*const RNGProtocol, ?*align(8) const Guid, usize, [*]u8) callconv(.C) Status, | |
| 8 | _get_info: std.meta.FnPtr(fn (*const RNGProtocol, *usize, [*]align(8) Guid) callconv(.C) Status), | |
| 9 | _get_rng: std.meta.FnPtr(fn (*const RNGProtocol, ?*align(8) const Guid, usize, [*]u8) callconv(.C) Status), | |
| 9 | 10 | |
| 10 | 11 | /// Returns information about the random number generation implementation. |
| 11 | 12 | pub fn getInfo(self: *const RNGProtocol, list_size: *usize, list: [*]align(8) Guid) Status { |
lib/std/os/uefi/protocols/simple_file_system_protocol.zig+3-2| ... | ... | @@ -1,11 +1,12 @@ |
| 1 | const uefi = @import("std").os.uefi; | |
| 1 | const std = @import("std"); | |
| 2 | const uefi = std.os.uefi; | |
| 2 | 3 | const Guid = uefi.Guid; |
| 3 | 4 | const FileProtocol = uefi.protocols.FileProtocol; |
| 4 | 5 | const Status = uefi.Status; |
| 5 | 6 | |
| 6 | 7 | pub const SimpleFileSystemProtocol = extern struct { |
| 7 | 8 | revision: u64, |
| 8 | _open_volume: fn (*const SimpleFileSystemProtocol, **const FileProtocol) callconv(.C) Status, | |
| 9 | _open_volume: std.meta.FnPtr(fn (*const SimpleFileSystemProtocol, **const FileProtocol) callconv(.C) Status), | |
| 9 | 10 | |
| 10 | 11 | pub fn openVolume(self: *const SimpleFileSystemProtocol, root: **const FileProtocol) Status { |
| 11 | 12 | return self._open_volume(self, root); |
lib/std/os/uefi/protocols/simple_network_protocol.zig+15-14| ... | ... | @@ -1,23 +1,24 @@ |
| 1 | const uefi = @import("std").os.uefi; | |
| 1 | const std = @import("std"); | |
| 2 | const uefi = std.os.uefi; | |
| 2 | 3 | const Event = uefi.Event; |
| 3 | 4 | const Guid = uefi.Guid; |
| 4 | 5 | const Status = uefi.Status; |
| 5 | 6 | |
| 6 | 7 | pub const SimpleNetworkProtocol = extern struct { |
| 7 | 8 | revision: u64, |
| 8 | _start: fn (*const SimpleNetworkProtocol) callconv(.C) Status, | |
| 9 | _stop: fn (*const SimpleNetworkProtocol) callconv(.C) Status, | |
| 10 | _initialize: fn (*const SimpleNetworkProtocol, usize, usize) callconv(.C) Status, | |
| 11 | _reset: fn (*const SimpleNetworkProtocol, bool) callconv(.C) Status, | |
| 12 | _shutdown: fn (*const SimpleNetworkProtocol) callconv(.C) Status, | |
| 13 | _receive_filters: fn (*const SimpleNetworkProtocol, SimpleNetworkReceiveFilter, SimpleNetworkReceiveFilter, bool, usize, ?[*]const MacAddress) callconv(.C) Status, | |
| 14 | _station_address: fn (*const SimpleNetworkProtocol, bool, ?*const MacAddress) callconv(.C) Status, | |
| 15 | _statistics: fn (*const SimpleNetworkProtocol, bool, ?*usize, ?*NetworkStatistics) callconv(.C) Status, | |
| 16 | _mcast_ip_to_mac: fn (*const SimpleNetworkProtocol, bool, *const anyopaque, *MacAddress) callconv(.C) Status, | |
| 17 | _nvdata: fn (*const SimpleNetworkProtocol, bool, usize, usize, [*]u8) callconv(.C) Status, | |
| 18 | _get_status: fn (*const SimpleNetworkProtocol, *SimpleNetworkInterruptStatus, ?*?[*]u8) callconv(.C) Status, | |
| 19 | _transmit: fn (*const SimpleNetworkProtocol, usize, usize, [*]const u8, ?*const MacAddress, ?*const MacAddress, ?*const u16) callconv(.C) Status, | |
| 20 | _receive: fn (*const SimpleNetworkProtocol, ?*usize, *usize, [*]u8, ?*MacAddress, ?*MacAddress, ?*u16) callconv(.C) Status, | |
| 9 | _start: std.meta.FnPtr(fn (*const SimpleNetworkProtocol) callconv(.C) Status), | |
| 10 | _stop: std.meta.FnPtr(fn (*const SimpleNetworkProtocol) callconv(.C) Status), | |
| 11 | _initialize: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, usize, usize) callconv(.C) Status), | |
| 12 | _reset: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, bool) callconv(.C) Status), | |
| 13 | _shutdown: std.meta.FnPtr(fn (*const SimpleNetworkProtocol) callconv(.C) Status), | |
| 14 | _receive_filters: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, SimpleNetworkReceiveFilter, SimpleNetworkReceiveFilter, bool, usize, ?[*]const MacAddress) callconv(.C) Status), | |
| 15 | _station_address: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, bool, ?*const MacAddress) callconv(.C) Status), | |
| 16 | _statistics: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, bool, ?*usize, ?*NetworkStatistics) callconv(.C) Status), | |
| 17 | _mcast_ip_to_mac: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, bool, *const anyopaque, *MacAddress) callconv(.C) Status), | |
| 18 | _nvdata: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, bool, usize, usize, [*]u8) callconv(.C) Status), | |
| 19 | _get_status: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, *SimpleNetworkInterruptStatus, ?*?[*]u8) callconv(.C) Status), | |
| 20 | _transmit: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, usize, usize, [*]const u8, ?*const MacAddress, ?*const MacAddress, ?*const u16) callconv(.C) Status), | |
| 21 | _receive: std.meta.FnPtr(fn (*const SimpleNetworkProtocol, ?*usize, *usize, [*]u8, ?*MacAddress, ?*MacAddress, ?*u16) callconv(.C) Status), | |
| 21 | 22 | wait_for_packet: Event, |
| 22 | 23 | mode: *SimpleNetworkMode, |
| 23 | 24 |
lib/std/os/uefi/protocols/simple_pointer_protocol.zig+4-3| ... | ... | @@ -1,12 +1,13 @@ |
| 1 | const uefi = @import("std").os.uefi; | |
| 1 | const std = @import("std"); | |
| 2 | const uefi = std.os.uefi; | |
| 2 | 3 | const Event = uefi.Event; |
| 3 | 4 | const Guid = uefi.Guid; |
| 4 | 5 | const Status = uefi.Status; |
| 5 | 6 | |
| 6 | 7 | /// Protocol for mice |
| 7 | 8 | pub const SimplePointerProtocol = struct { |
| 8 | _reset: fn (*const SimplePointerProtocol, bool) callconv(.C) Status, | |
| 9 | _get_state: fn (*const SimplePointerProtocol, *SimplePointerState) callconv(.C) Status, | |
| 9 | _reset: std.meta.FnPtr(fn (*const SimplePointerProtocol, bool) callconv(.C) Status), | |
| 10 | _get_state: std.meta.FnPtr(fn (*const SimplePointerProtocol, *SimplePointerState) callconv(.C) Status), | |
| 10 | 11 | wait_for_input: Event, |
| 11 | 12 | mode: *SimplePointerMode, |
| 12 | 13 |
lib/std/os/uefi/protocols/simple_text_input_ex_protocol.zig+7-6| ... | ... | @@ -1,16 +1,17 @@ |
| 1 | const uefi = @import("std").os.uefi; | |
| 1 | const std = @import("std"); | |
| 2 | const uefi = std.os.uefi; | |
| 2 | 3 | const Event = uefi.Event; |
| 3 | 4 | const Guid = uefi.Guid; |
| 4 | 5 | const Status = uefi.Status; |
| 5 | 6 | |
| 6 | 7 | /// Character input devices, e.g. Keyboard |
| 7 | 8 | pub const SimpleTextInputExProtocol = extern struct { |
| 8 | _reset: fn (*const SimpleTextInputExProtocol, bool) callconv(.C) Status, | |
| 9 | _read_key_stroke_ex: fn (*const SimpleTextInputExProtocol, *KeyData) callconv(.C) Status, | |
| 9 | _reset: std.meta.FnPtr(fn (*const SimpleTextInputExProtocol, bool) callconv(.C) Status), | |
| 10 | _read_key_stroke_ex: std.meta.FnPtr(fn (*const SimpleTextInputExProtocol, *KeyData) callconv(.C) Status), | |
| 10 | 11 | wait_for_key_ex: Event, |
| 11 | _set_state: fn (*const SimpleTextInputExProtocol, *const u8) callconv(.C) Status, | |
| 12 | _register_key_notify: fn (*const SimpleTextInputExProtocol, *const KeyData, fn (*const KeyData) callconv(.C) usize, **anyopaque) callconv(.C) Status, | |
| 13 | _unregister_key_notify: fn (*const SimpleTextInputExProtocol, *const anyopaque) callconv(.C) Status, | |
| 12 | _set_state: std.meta.FnPtr(fn (*const SimpleTextInputExProtocol, *const u8) callconv(.C) Status), | |
| 13 | _register_key_notify: std.meta.FnPtr(fn (*const SimpleTextInputExProtocol, *const KeyData, fn (*const KeyData) callconv(.C) usize, **anyopaque) callconv(.C) Status), | |
| 14 | _unregister_key_notify: std.meta.FnPtr(fn (*const SimpleTextInputExProtocol, *const anyopaque) callconv(.C) Status), | |
| 14 | 15 | |
| 15 | 16 | /// Resets the input device hardware. |
| 16 | 17 | pub fn reset(self: *const SimpleTextInputExProtocol, verify: bool) Status { |
lib/std/os/uefi/protocols/simple_text_input_protocol.zig+4-3| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | const uefi = @import("std").os.uefi; | |
| 1 | const std = @import("std"); | |
| 2 | const uefi = std.os.uefi; | |
| 2 | 3 | const Event = uefi.Event; |
| 3 | 4 | const Guid = uefi.Guid; |
| 4 | 5 | const InputKey = uefi.protocols.InputKey; |
| ... | ... | @@ -6,8 +7,8 @@ const Status = uefi.Status; |
| 6 | 7 | |
| 7 | 8 | /// Character input devices, e.g. Keyboard |
| 8 | 9 | pub const SimpleTextInputProtocol = extern struct { |
| 9 | _reset: fn (*const SimpleTextInputProtocol, bool) callconv(.C) Status, | |
| 10 | _read_key_stroke: fn (*const SimpleTextInputProtocol, *InputKey) callconv(.C) Status, | |
| 10 | _reset: std.meta.FnPtr(fn (*const SimpleTextInputProtocol, bool) callconv(.C) Status), | |
| 11 | _read_key_stroke: std.meta.FnPtr(fn (*const SimpleTextInputProtocol, *InputKey) callconv(.C) Status), | |
| 11 | 12 | wait_for_key: Event, |
| 12 | 13 | |
| 13 | 14 | /// Resets the input device hardware. |
lib/std/os/uefi/protocols/simple_text_output_protocol.zig+11-10| ... | ... | @@ -1,18 +1,19 @@ |
| 1 | const uefi = @import("std").os.uefi; | |
| 1 | const std = @import("std"); | |
| 2 | const uefi = std.os.uefi; | |
| 2 | 3 | const Guid = uefi.Guid; |
| 3 | 4 | const Status = uefi.Status; |
| 4 | 5 | |
| 5 | 6 | /// Character output devices |
| 6 | 7 | pub const SimpleTextOutputProtocol = extern struct { |
| 7 | _reset: fn (*const SimpleTextOutputProtocol, bool) callconv(.C) Status, | |
| 8 | _output_string: fn (*const SimpleTextOutputProtocol, [*:0]const u16) callconv(.C) Status, | |
| 9 | _test_string: fn (*const SimpleTextOutputProtocol, [*:0]const u16) callconv(.C) Status, | |
| 10 | _query_mode: fn (*const SimpleTextOutputProtocol, usize, *usize, *usize) callconv(.C) Status, | |
| 11 | _set_mode: fn (*const SimpleTextOutputProtocol, usize) callconv(.C) Status, | |
| 12 | _set_attribute: fn (*const SimpleTextOutputProtocol, usize) callconv(.C) Status, | |
| 13 | _clear_screen: fn (*const SimpleTextOutputProtocol) callconv(.C) Status, | |
| 14 | _set_cursor_position: fn (*const SimpleTextOutputProtocol, usize, usize) callconv(.C) Status, | |
| 15 | _enable_cursor: fn (*const SimpleTextOutputProtocol, bool) callconv(.C) Status, | |
| 8 | _reset: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol, bool) callconv(.C) Status), | |
| 9 | _output_string: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol, [*:0]const u16) callconv(.C) Status), | |
| 10 | _test_string: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol, [*:0]const u16) callconv(.C) Status), | |
| 11 | _query_mode: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol, usize, *usize, *usize) callconv(.C) Status), | |
| 12 | _set_mode: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol, usize) callconv(.C) Status), | |
| 13 | _set_attribute: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol, usize) callconv(.C) Status), | |
| 14 | _clear_screen: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol) callconv(.C) Status), | |
| 15 | _set_cursor_position: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol, usize, usize) callconv(.C) Status), | |
| 16 | _enable_cursor: std.meta.FnPtr(fn (*const SimpleTextOutputProtocol, bool) callconv(.C) Status), | |
| 16 | 17 | mode: *SimpleTextOutputMode, |
| 17 | 18 | |
| 18 | 19 | /// Resets the text output device hardware. |
lib/std/os/uefi/protocols/udp6_protocol.zig+9-8| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | const uefi = @import("std").os.uefi; | |
| 1 | const std = @import("std"); | |
| 2 | const uefi = std.os.uefi; | |
| 2 | 3 | const Guid = uefi.Guid; |
| 3 | 4 | const Event = uefi.Event; |
| 4 | 5 | const Status = uefi.Status; |
| ... | ... | @@ -9,13 +10,13 @@ const ManagedNetworkConfigData = uefi.protocols.ManagedNetworkConfigData; |
| 9 | 10 | const SimpleNetworkMode = uefi.protocols.SimpleNetworkMode; |
| 10 | 11 | |
| 11 | 12 | pub const Udp6Protocol = extern struct { |
| 12 | _get_mode_data: fn (*const Udp6Protocol, ?*Udp6ConfigData, ?*Ip6ModeData, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) callconv(.C) Status, | |
| 13 | _configure: fn (*const Udp6Protocol, ?*const Udp6ConfigData) callconv(.C) Status, | |
| 14 | _groups: fn (*const Udp6Protocol, bool, ?*const Ip6Address) callconv(.C) Status, | |
| 15 | _transmit: fn (*const Udp6Protocol, *Udp6CompletionToken) callconv(.C) Status, | |
| 16 | _receive: fn (*const Udp6Protocol, *Udp6CompletionToken) callconv(.C) Status, | |
| 17 | _cancel: fn (*const Udp6Protocol, ?*Udp6CompletionToken) callconv(.C) Status, | |
| 18 | _poll: fn (*const Udp6Protocol) callconv(.C) Status, | |
| 13 | _get_mode_data: std.meta.FnPtr(fn (*const Udp6Protocol, ?*Udp6ConfigData, ?*Ip6ModeData, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) callconv(.C) Status), | |
| 14 | _configure: std.meta.FnPtr(fn (*const Udp6Protocol, ?*const Udp6ConfigData) callconv(.C) Status), | |
| 15 | _groups: std.meta.FnPtr(fn (*const Udp6Protocol, bool, ?*const Ip6Address) callconv(.C) Status), | |
| 16 | _transmit: std.meta.FnPtr(fn (*const Udp6Protocol, *Udp6CompletionToken) callconv(.C) Status), | |
| 17 | _receive: std.meta.FnPtr(fn (*const Udp6Protocol, *Udp6CompletionToken) callconv(.C) Status), | |
| 18 | _cancel: std.meta.FnPtr(fn (*const Udp6Protocol, ?*Udp6CompletionToken) callconv(.C) Status), | |
| 19 | _poll: std.meta.FnPtr(fn (*const Udp6Protocol) callconv(.C) Status), | |
| 19 | 20 | |
| 20 | 21 | pub fn getModeData(self: *const Udp6Protocol, udp6_config_data: ?*Udp6ConfigData, ip6_mode_data: ?*Ip6ModeData, mnp_config_data: ?*ManagedNetworkConfigData, snp_mode_data: ?*SimpleNetworkMode) Status { |
| 21 | 22 | return self._get_mode_data(self, udp6_config_data, ip6_mode_data, mnp_config_data, snp_mode_data); |
lib/std/os/uefi/protocols/udp6_service_binding_protocol.zig+4-3| ... | ... | @@ -1,11 +1,12 @@ |
| 1 | const uefi = @import("std").os.uefi; | |
| 1 | const std = @import("std"); | |
| 2 | const uefi = std.os.uefi; | |
| 2 | 3 | const Handle = uefi.Handle; |
| 3 | 4 | const Guid = uefi.Guid; |
| 4 | 5 | const Status = uefi.Status; |
| 5 | 6 | |
| 6 | 7 | pub const Udp6ServiceBindingProtocol = extern struct { |
| 7 | _create_child: fn (*const Udp6ServiceBindingProtocol, *?Handle) callconv(.C) Status, | |
| 8 | _destroy_child: fn (*const Udp6ServiceBindingProtocol, Handle) callconv(.C) Status, | |
| 8 | _create_child: std.meta.FnPtr(fn (*const Udp6ServiceBindingProtocol, *?Handle) callconv(.C) Status), | |
| 9 | _destroy_child: std.meta.FnPtr(fn (*const Udp6ServiceBindingProtocol, Handle) callconv(.C) Status), | |
| 9 | 10 | |
| 10 | 11 | pub fn createChild(self: *const Udp6ServiceBindingProtocol, handle: *?Handle) Status { |
| 11 | 12 | return self._create_child(self, handle); |
lib/std/os/uefi/tables/boot_services.zig+45-44| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | const uefi = @import("std").os.uefi; | |
| 1 | const std = @import("std"); | |
| 2 | const uefi = std.os.uefi; | |
| 2 | 3 | const Event = uefi.Event; |
| 3 | 4 | const Guid = uefi.Guid; |
| 4 | 5 | const Handle = uefi.Handle; |
| ... | ... | @@ -21,138 +22,138 @@ pub const BootServices = extern struct { |
| 21 | 22 | hdr: TableHeader, |
| 22 | 23 | |
| 23 | 24 | /// Raises a task's priority level and returns its previous level. |
| 24 | raiseTpl: fn (new_tpl: usize) callconv(.C) usize, | |
| 25 | raiseTpl: std.meta.FnPtr(fn (new_tpl: usize) callconv(.C) usize), | |
| 25 | 26 | |
| 26 | 27 | /// Restores a task's priority level to its previous value. |
| 27 | restoreTpl: fn (old_tpl: usize) callconv(.C) void, | |
| 28 | restoreTpl: std.meta.FnPtr(fn (old_tpl: usize) callconv(.C) void), | |
| 28 | 29 | |
| 29 | 30 | /// Allocates memory pages from the system. |
| 30 | allocatePages: fn (alloc_type: AllocateType, mem_type: MemoryType, pages: usize, memory: *[*]align(4096) u8) callconv(.C) Status, | |
| 31 | allocatePages: std.meta.FnPtr(fn (alloc_type: AllocateType, mem_type: MemoryType, pages: usize, memory: *[*]align(4096) u8) callconv(.C) Status), | |
| 31 | 32 | |
| 32 | 33 | /// Frees memory pages. |
| 33 | freePages: fn (memory: [*]align(4096) u8, pages: usize) callconv(.C) Status, | |
| 34 | freePages: std.meta.FnPtr(fn (memory: [*]align(4096) u8, pages: usize) callconv(.C) Status), | |
| 34 | 35 | |
| 35 | 36 | /// Returns the current memory map. |
| 36 | getMemoryMap: fn (mmap_size: *usize, mmap: [*]MemoryDescriptor, mapKey: *usize, descriptor_size: *usize, descriptor_version: *u32) callconv(.C) Status, | |
| 37 | getMemoryMap: std.meta.FnPtr(fn (mmap_size: *usize, mmap: [*]MemoryDescriptor, mapKey: *usize, descriptor_size: *usize, descriptor_version: *u32) callconv(.C) Status), | |
| 37 | 38 | |
| 38 | 39 | /// Allocates pool memory. |
| 39 | allocatePool: fn (pool_type: MemoryType, size: usize, buffer: *[*]align(8) u8) callconv(.C) Status, | |
| 40 | allocatePool: std.meta.FnPtr(fn (pool_type: MemoryType, size: usize, buffer: *[*]align(8) u8) callconv(.C) Status), | |
| 40 | 41 | |
| 41 | 42 | /// Returns pool memory to the system. |
| 42 | freePool: fn (buffer: [*]align(8) u8) callconv(.C) Status, | |
| 43 | freePool: std.meta.FnPtr(fn (buffer: [*]align(8) u8) callconv(.C) Status), | |
| 43 | 44 | |
| 44 | 45 | /// Creates an event. |
| 45 | createEvent: fn (type: u32, notify_tpl: usize, notify_func: ?fn (Event, ?*anyopaque) callconv(.C) void, notifyCtx: ?*const anyopaque, event: *Event) callconv(.C) Status, | |
| 46 | createEvent: std.meta.FnPtr(fn (type: u32, notify_tpl: usize, notify_func: ?std.meta.FnPtr(fn (Event, ?*anyopaque) callconv(.C) void), notifyCtx: ?*const anyopaque, event: *Event) callconv(.C) Status), | |
| 46 | 47 | |
| 47 | 48 | /// Sets the type of timer and the trigger time for a timer event. |
| 48 | setTimer: fn (event: Event, type: TimerDelay, triggerTime: u64) callconv(.C) Status, | |
| 49 | setTimer: std.meta.FnPtr(fn (event: Event, type: TimerDelay, triggerTime: u64) callconv(.C) Status), | |
| 49 | 50 | |
| 50 | 51 | /// Stops execution until an event is signaled. |
| 51 | waitForEvent: fn (event_len: usize, events: [*]const Event, index: *usize) callconv(.C) Status, | |
| 52 | waitForEvent: std.meta.FnPtr(fn (event_len: usize, events: [*]const Event, index: *usize) callconv(.C) Status), | |
| 52 | 53 | |
| 53 | 54 | /// Signals an event. |
| 54 | signalEvent: fn (event: Event) callconv(.C) Status, | |
| 55 | signalEvent: std.meta.FnPtr(fn (event: Event) callconv(.C) Status), | |
| 55 | 56 | |
| 56 | 57 | /// Closes an event. |
| 57 | closeEvent: fn (event: Event) callconv(.C) Status, | |
| 58 | closeEvent: std.meta.FnPtr(fn (event: Event) callconv(.C) Status), | |
| 58 | 59 | |
| 59 | 60 | /// Checks whether an event is in the signaled state. |
| 60 | checkEvent: fn (event: Event) callconv(.C) Status, | |
| 61 | checkEvent: std.meta.FnPtr(fn (event: Event) callconv(.C) Status), | |
| 61 | 62 | |
| 62 | 63 | /// Installs a protocol interface on a device handle. If the handle does not exist, it is created |
| 63 | 64 | /// and added to the list of handles in the system. installMultipleProtocolInterfaces() |
| 64 | 65 | /// performs more error checking than installProtocolInterface(), so its use is recommended over this. |
| 65 | installProtocolInterface: fn (handle: Handle, protocol: *align(8) const Guid, interface_type: EfiInterfaceType, interface: *anyopaque) callconv(.C) Status, | |
| 66 | installProtocolInterface: std.meta.FnPtr(fn (handle: Handle, protocol: *align(8) const Guid, interface_type: EfiInterfaceType, interface: *anyopaque) callconv(.C) Status), | |
| 66 | 67 | |
| 67 | 68 | /// Reinstalls a protocol interface on a device handle |
| 68 | reinstallProtocolInterface: fn (handle: Handle, protocol: *align(8) const Guid, old_interface: *anyopaque, new_interface: *anyopaque) callconv(.C) Status, | |
| 69 | reinstallProtocolInterface: std.meta.FnPtr(fn (handle: Handle, protocol: *align(8) const Guid, old_interface: *anyopaque, new_interface: *anyopaque) callconv(.C) Status), | |
| 69 | 70 | |
| 70 | 71 | /// Removes a protocol interface from a device handle. Usage of |
| 71 | 72 | /// uninstallMultipleProtocolInterfaces is recommended over this. |
| 72 | uninstallProtocolInterface: fn (handle: Handle, protocol: *align(8) const Guid, interface: *anyopaque) callconv(.C) Status, | |
| 73 | uninstallProtocolInterface: std.meta.FnPtr(fn (handle: Handle, protocol: *align(8) const Guid, interface: *anyopaque) callconv(.C) Status), | |
| 73 | 74 | |
| 74 | 75 | /// Queries a handle to determine if it supports a specified protocol. |
| 75 | handleProtocol: fn (handle: Handle, protocol: *align(8) const Guid, interface: *?*anyopaque) callconv(.C) Status, | |
| 76 | handleProtocol: std.meta.FnPtr(fn (handle: Handle, protocol: *align(8) const Guid, interface: *?*anyopaque) callconv(.C) Status), | |
| 76 | 77 | |
| 77 | 78 | reserved: *anyopaque, |
| 78 | 79 | |
| 79 | 80 | /// Creates an event that is to be signaled whenever an interface is installed for a specified protocol. |
| 80 | registerProtocolNotify: fn (protocol: *align(8) const Guid, event: Event, registration: **anyopaque) callconv(.C) Status, | |
| 81 | registerProtocolNotify: std.meta.FnPtr(fn (protocol: *align(8) const Guid, event: Event, registration: **anyopaque) callconv(.C) Status), | |
| 81 | 82 | |
| 82 | 83 | /// Returns an array of handles that support a specified protocol. |
| 83 | locateHandle: fn (search_type: LocateSearchType, protocol: ?*align(8) const Guid, search_key: ?*const anyopaque, bufferSize: *usize, buffer: [*]Handle) callconv(.C) Status, | |
| 84 | locateHandle: std.meta.FnPtr(fn (search_type: LocateSearchType, protocol: ?*align(8) const Guid, search_key: ?*const anyopaque, bufferSize: *usize, buffer: [*]Handle) callconv(.C) Status), | |
| 84 | 85 | |
| 85 | 86 | /// Locates the handle to a device on the device path that supports the specified protocol |
| 86 | locateDevicePath: fn (protocols: *align(8) const Guid, device_path: **const DevicePathProtocol, device: *?Handle) callconv(.C) Status, | |
| 87 | locateDevicePath: std.meta.FnPtr(fn (protocols: *align(8) const Guid, device_path: **const DevicePathProtocol, device: *?Handle) callconv(.C) Status), | |
| 87 | 88 | |
| 88 | 89 | /// Adds, updates, or removes a configuration table entry from the EFI System Table. |
| 89 | installConfigurationTable: fn (guid: *align(8) const Guid, table: ?*anyopaque) callconv(.C) Status, | |
| 90 | installConfigurationTable: std.meta.FnPtr(fn (guid: *align(8) const Guid, table: ?*anyopaque) callconv(.C) Status), | |
| 90 | 91 | |
| 91 | 92 | /// Loads an EFI image into memory. |
| 92 | loadImage: fn (boot_policy: bool, parent_image_handle: Handle, device_path: ?*const DevicePathProtocol, source_buffer: ?[*]const u8, source_size: usize, imageHandle: *?Handle) callconv(.C) Status, | |
| 93 | loadImage: std.meta.FnPtr(fn (boot_policy: bool, parent_image_handle: Handle, device_path: ?*const DevicePathProtocol, source_buffer: ?[*]const u8, source_size: usize, imageHandle: *?Handle) callconv(.C) Status), | |
| 93 | 94 | |
| 94 | 95 | /// Transfers control to a loaded image's entry point. |
| 95 | startImage: fn (image_handle: Handle, exit_data_size: ?*usize, exit_data: ?*[*]u16) callconv(.C) Status, | |
| 96 | startImage: std.meta.FnPtr(fn (image_handle: Handle, exit_data_size: ?*usize, exit_data: ?*[*]u16) callconv(.C) Status), | |
| 96 | 97 | |
| 97 | 98 | /// Terminates a loaded EFI image and returns control to boot services. |
| 98 | exit: fn (image_handle: Handle, exit_status: Status, exit_data_size: usize, exit_data: ?*const anyopaque) callconv(.C) Status, | |
| 99 | exit: std.meta.FnPtr(fn (image_handle: Handle, exit_status: Status, exit_data_size: usize, exit_data: ?*const anyopaque) callconv(.C) Status), | |
| 99 | 100 | |
| 100 | 101 | /// Unloads an image. |
| 101 | unloadImage: fn (image_handle: Handle) callconv(.C) Status, | |
| 102 | unloadImage: std.meta.FnPtr(fn (image_handle: Handle) callconv(.C) Status), | |
| 102 | 103 | |
| 103 | 104 | /// Terminates all boot services. |
| 104 | exitBootServices: fn (image_handle: Handle, map_key: usize) callconv(.C) Status, | |
| 105 | exitBootServices: std.meta.FnPtr(fn (image_handle: Handle, map_key: usize) callconv(.C) Status), | |
| 105 | 106 | |
| 106 | 107 | /// Returns a monotonically increasing count for the platform. |
| 107 | getNextMonotonicCount: fn (count: *u64) callconv(.C) Status, | |
| 108 | getNextMonotonicCount: std.meta.FnPtr(fn (count: *u64) callconv(.C) Status), | |
| 108 | 109 | |
| 109 | 110 | /// Induces a fine-grained stall. |
| 110 | stall: fn (microseconds: usize) callconv(.C) Status, | |
| 111 | stall: std.meta.FnPtr(fn (microseconds: usize) callconv(.C) Status), | |
| 111 | 112 | |
| 112 | 113 | /// Sets the system's watchdog timer. |
| 113 | setWatchdogTimer: fn (timeout: usize, watchdogCode: u64, data_size: usize, watchdog_data: ?[*]const u16) callconv(.C) Status, | |
| 114 | setWatchdogTimer: std.meta.FnPtr(fn (timeout: usize, watchdogCode: u64, data_size: usize, watchdog_data: ?[*]const u16) callconv(.C) Status), | |
| 114 | 115 | |
| 115 | 116 | /// Connects one or more drives to a controller. |
| 116 | connectController: fn (controller_handle: Handle, driver_image_handle: ?Handle, remaining_device_path: ?*DevicePathProtocol, recursive: bool) callconv(.C) Status, | |
| 117 | connectController: std.meta.FnPtr(fn (controller_handle: Handle, driver_image_handle: ?Handle, remaining_device_path: ?*DevicePathProtocol, recursive: bool) callconv(.C) Status), | |
| 117 | 118 | |
| 118 | 119 | // Disconnects one or more drivers from a controller |
| 119 | disconnectController: fn (controller_handle: Handle, driver_image_handle: ?Handle, child_handle: ?Handle) callconv(.C) Status, | |
| 120 | disconnectController: std.meta.FnPtr(fn (controller_handle: Handle, driver_image_handle: ?Handle, child_handle: ?Handle) callconv(.C) Status), | |
| 120 | 121 | |
| 121 | 122 | /// Queries a handle to determine if it supports a specified protocol. |
| 122 | openProtocol: fn (handle: Handle, protocol: *align(8) const Guid, interface: *?*anyopaque, agent_handle: ?Handle, controller_handle: ?Handle, attributes: OpenProtocolAttributes) callconv(.C) Status, | |
| 123 | openProtocol: std.meta.FnPtr(fn (handle: Handle, protocol: *align(8) const Guid, interface: *?*anyopaque, agent_handle: ?Handle, controller_handle: ?Handle, attributes: OpenProtocolAttributes) callconv(.C) Status), | |
| 123 | 124 | |
| 124 | 125 | /// Closes a protocol on a handle that was opened using openProtocol(). |
| 125 | closeProtocol: fn (handle: Handle, protocol: *align(8) const Guid, agentHandle: Handle, controller_handle: ?Handle) callconv(.C) Status, | |
| 126 | closeProtocol: std.meta.FnPtr(fn (handle: Handle, protocol: *align(8) const Guid, agentHandle: Handle, controller_handle: ?Handle) callconv(.C) Status), | |
| 126 | 127 | |
| 127 | 128 | /// Retrieves the list of agents that currently have a protocol interface opened. |
| 128 | openProtocolInformation: fn (handle: Handle, protocol: *align(8) const Guid, entry_buffer: *[*]ProtocolInformationEntry, entry_count: *usize) callconv(.C) Status, | |
| 129 | openProtocolInformation: std.meta.FnPtr(fn (handle: Handle, protocol: *align(8) const Guid, entry_buffer: *[*]ProtocolInformationEntry, entry_count: *usize) callconv(.C) Status), | |
| 129 | 130 | |
| 130 | 131 | /// Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated from pool. |
| 131 | protocolsPerHandle: fn (handle: Handle, protocol_buffer: *[*]*align(8) const Guid, protocol_buffer_count: *usize) callconv(.C) Status, | |
| 132 | protocolsPerHandle: std.meta.FnPtr(fn (handle: Handle, protocol_buffer: *[*]*align(8) const Guid, protocol_buffer_count: *usize) callconv(.C) Status), | |
| 132 | 133 | |
| 133 | 134 | /// Returns an array of handles that support the requested protocol in a buffer allocated from pool. |
| 134 | locateHandleBuffer: fn (search_type: LocateSearchType, protocol: ?*align(8) const Guid, search_key: ?*const anyopaque, num_handles: *usize, buffer: *[*]Handle) callconv(.C) Status, | |
| 135 | locateHandleBuffer: std.meta.FnPtr(fn (search_type: LocateSearchType, protocol: ?*align(8) const Guid, search_key: ?*const anyopaque, num_handles: *usize, buffer: *[*]Handle) callconv(.C) Status), | |
| 135 | 136 | |
| 136 | 137 | /// Returns the first protocol instance that matches the given protocol. |
| 137 | locateProtocol: fn (protocol: *align(8) const Guid, registration: ?*const anyopaque, interface: *?*anyopaque) callconv(.C) Status, | |
| 138 | locateProtocol: std.meta.FnPtr(fn (protocol: *align(8) const Guid, registration: ?*const anyopaque, interface: *?*anyopaque) callconv(.C) Status), | |
| 138 | 139 | |
| 139 | 140 | /// Installs one or more protocol interfaces into the boot services environment |
| 140 | installMultipleProtocolInterfaces: fn (handle: *Handle, ...) callconv(.C) Status, | |
| 141 | installMultipleProtocolInterfaces: std.meta.FnPtr(fn (handle: *Handle, ...) callconv(.C) Status), | |
| 141 | 142 | |
| 142 | 143 | /// Removes one or more protocol interfaces into the boot services environment |
| 143 | uninstallMultipleProtocolInterfaces: fn (handle: *Handle, ...) callconv(.C) Status, | |
| 144 | uninstallMultipleProtocolInterfaces: std.meta.FnPtr(fn (handle: *Handle, ...) callconv(.C) Status), | |
| 144 | 145 | |
| 145 | 146 | /// Computes and returns a 32-bit CRC for a data buffer. |
| 146 | calculateCrc32: fn (data: [*]const u8, data_size: usize, *u32) callconv(.C) Status, | |
| 147 | calculateCrc32: std.meta.FnPtr(fn (data: [*]const u8, data_size: usize, *u32) callconv(.C) Status), | |
| 147 | 148 | |
| 148 | 149 | /// Copies the contents of one buffer to another buffer |
| 149 | copyMem: fn (dest: [*]u8, src: [*]const u8, len: usize) callconv(.C) void, | |
| 150 | copyMem: std.meta.FnPtr(fn (dest: [*]u8, src: [*]const u8, len: usize) callconv(.C) void), | |
| 150 | 151 | |
| 151 | 152 | /// Fills a buffer with a specified value |
| 152 | setMem: fn (buffer: [*]u8, size: usize, value: u8) callconv(.C) void, | |
| 153 | setMem: std.meta.FnPtr(fn (buffer: [*]u8, size: usize, value: u8) callconv(.C) void), | |
| 153 | 154 | |
| 154 | 155 | /// Creates an event in a group. |
| 155 | createEventEx: fn (type: u32, notify_tpl: usize, notify_func: EfiEventNotify, notify_ctx: *const anyopaque, event_group: *align(8) const Guid, event: *Event) callconv(.C) Status, | |
| 156 | createEventEx: std.meta.FnPtr(fn (type: u32, notify_tpl: usize, notify_func: EfiEventNotify, notify_ctx: *const anyopaque, event_group: *align(8) const Guid, event: *Event) callconv(.C) Status), | |
| 156 | 157 | |
| 157 | 158 | /// Opens a protocol with a structure as the loaded image for a UEFI application |
| 158 | 159 | pub fn openProtocolSt(self: *BootServices, comptime protocol: type, handle: Handle) !*protocol { |
lib/std/os/uefi/tables/runtime_services.zig+16-15| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | const uefi = @import("std").os.uefi; | |
| 1 | const std = @import("std"); | |
| 2 | const uefi = std.os.uefi; | |
| 2 | 3 | const Guid = uefi.Guid; |
| 3 | 4 | const TableHeader = uefi.tables.TableHeader; |
| 4 | 5 | const Time = uefi.Time; |
| ... | ... | @@ -18,50 +19,50 @@ pub const RuntimeServices = extern struct { |
| 18 | 19 | hdr: TableHeader, |
| 19 | 20 | |
| 20 | 21 | /// Returns the current time and date information, and the time-keeping capabilities of the hardware platform. |
| 21 | getTime: fn (time: *uefi.Time, capabilities: ?*TimeCapabilities) callconv(.C) Status, | |
| 22 | getTime: std.meta.FnPtr(fn (time: *uefi.Time, capabilities: ?*TimeCapabilities) callconv(.C) Status), | |
| 22 | 23 | |
| 23 | 24 | /// Sets the current local time and date information |
| 24 | setTime: fn (time: *uefi.Time) callconv(.C) Status, | |
| 25 | setTime: std.meta.FnPtr(fn (time: *uefi.Time) callconv(.C) Status), | |
| 25 | 26 | |
| 26 | 27 | /// Returns the current wakeup alarm clock setting |
| 27 | getWakeupTime: fn (enabled: *bool, pending: *bool, time: *uefi.Time) callconv(.C) Status, | |
| 28 | getWakeupTime: std.meta.FnPtr(fn (enabled: *bool, pending: *bool, time: *uefi.Time) callconv(.C) Status), | |
| 28 | 29 | |
| 29 | 30 | /// Sets the system wakeup alarm clock time |
| 30 | setWakeupTime: fn (enable: *bool, time: ?*uefi.Time) callconv(.C) Status, | |
| 31 | setWakeupTime: std.meta.FnPtr(fn (enable: *bool, time: ?*uefi.Time) callconv(.C) Status), | |
| 31 | 32 | |
| 32 | 33 | /// Changes the runtime addressing mode of EFI firmware from physical to virtual. |
| 33 | setVirtualAddressMap: fn (mmap_size: usize, descriptor_size: usize, descriptor_version: u32, virtual_map: [*]MemoryDescriptor) callconv(.C) Status, | |
| 34 | setVirtualAddressMap: std.meta.FnPtr(fn (mmap_size: usize, descriptor_size: usize, descriptor_version: u32, virtual_map: [*]MemoryDescriptor) callconv(.C) Status), | |
| 34 | 35 | |
| 35 | 36 | /// Determines the new virtual address that is to be used on subsequent memory accesses. |
| 36 | convertPointer: fn (debug_disposition: usize, address: **anyopaque) callconv(.C) Status, | |
| 37 | convertPointer: std.meta.FnPtr(fn (debug_disposition: usize, address: **anyopaque) callconv(.C) Status), | |
| 37 | 38 | |
| 38 | 39 | /// Returns the value of a variable. |
| 39 | getVariable: fn (var_name: [*:0]const u16, vendor_guid: *align(8) const Guid, attributes: ?*u32, data_size: *usize, data: ?*anyopaque) callconv(.C) Status, | |
| 40 | getVariable: std.meta.FnPtr(fn (var_name: [*:0]const u16, vendor_guid: *align(8) const Guid, attributes: ?*u32, data_size: *usize, data: ?*anyopaque) callconv(.C) Status), | |
| 40 | 41 | |
| 41 | 42 | /// Enumerates the current variable names. |
| 42 | getNextVariableName: fn (var_name_size: *usize, var_name: [*:0]u16, vendor_guid: *align(8) Guid) callconv(.C) Status, | |
| 43 | getNextVariableName: std.meta.FnPtr(fn (var_name_size: *usize, var_name: [*:0]u16, vendor_guid: *align(8) Guid) callconv(.C) Status), | |
| 43 | 44 | |
| 44 | 45 | /// Sets the value of a variable. |
| 45 | setVariable: fn (var_name: [*:0]const u16, vendor_guid: *align(8) const Guid, attributes: u32, data_size: usize, data: *anyopaque) callconv(.C) Status, | |
| 46 | setVariable: std.meta.FnPtr(fn (var_name: [*:0]const u16, vendor_guid: *align(8) const Guid, attributes: u32, data_size: usize, data: *anyopaque) callconv(.C) Status), | |
| 46 | 47 | |
| 47 | 48 | /// Return the next high 32 bits of the platform's monotonic counter |
| 48 | getNextHighMonotonicCount: fn (high_count: *u32) callconv(.C) Status, | |
| 49 | getNextHighMonotonicCount: std.meta.FnPtr(fn (high_count: *u32) callconv(.C) Status), | |
| 49 | 50 | |
| 50 | 51 | /// Resets the entire platform. |
| 51 | resetSystem: fn (reset_type: ResetType, reset_status: Status, data_size: usize, reset_data: ?*const anyopaque) callconv(.C) noreturn, | |
| 52 | resetSystem: std.meta.FnPtr(fn (reset_type: ResetType, reset_status: Status, data_size: usize, reset_data: ?*const anyopaque) callconv(.C) noreturn), | |
| 52 | 53 | |
| 53 | 54 | /// Passes capsules to the firmware with both virtual and physical mapping. |
| 54 | 55 | /// Depending on the intended consumption, the firmware may process the capsule immediately. |
| 55 | 56 | /// If the payload should persist across a system reset, the reset value returned from |
| 56 | 57 | /// `queryCapsuleCapabilities` must be passed into resetSystem and will cause the capsule |
| 57 | 58 | /// to be processed by the firmware as part of the reset process. |
| 58 | updateCapsule: fn (capsule_header_array: **CapsuleHeader, capsule_count: usize, scatter_gather_list: EfiPhysicalAddress) callconv(.C) Status, | |
| 59 | updateCapsule: std.meta.FnPtr(fn (capsule_header_array: **CapsuleHeader, capsule_count: usize, scatter_gather_list: EfiPhysicalAddress) callconv(.C) Status), | |
| 59 | 60 | |
| 60 | 61 | /// Returns if the capsule can be supported via `updateCapsule` |
| 61 | queryCapsuleCapabilities: fn (capsule_header_array: **CapsuleHeader, capsule_count: usize, maximum_capsule_size: *usize, resetType: ResetType) callconv(.C) Status, | |
| 62 | queryCapsuleCapabilities: std.meta.FnPtr(fn (capsule_header_array: **CapsuleHeader, capsule_count: usize, maximum_capsule_size: *usize, resetType: ResetType) callconv(.C) Status), | |
| 62 | 63 | |
| 63 | 64 | /// Returns information about the EFI variables |
| 64 | queryVariableInfo: fn (attributes: *u32, maximum_variable_storage_size: *u64, remaining_variable_storage_size: *u64, maximum_variable_size: *u64) callconv(.C) Status, | |
| 65 | queryVariableInfo: std.meta.FnPtr(fn (attributes: *u32, maximum_variable_storage_size: *u64, remaining_variable_storage_size: *u64, maximum_variable_size: *u64) callconv(.C) Status), | |
| 65 | 66 | |
| 66 | 67 | pub const signature: u64 = 0x56524553544e5552; |
| 67 | 68 | }; |
lib/std/os/windows.zig+10-40| ... | ... | @@ -2689,10 +2689,7 @@ pub const MEM_RESERVE_PLACEHOLDERS = 0x2; |
| 2689 | 2689 | pub const MEM_DECOMMIT = 0x4000; |
| 2690 | 2690 | pub const MEM_RELEASE = 0x8000; |
| 2691 | 2691 | |
| 2692 | pub const PTHREAD_START_ROUTINE = switch (builtin.zig_backend) { | |
| 2693 | .stage1 => fn (LPVOID) callconv(.C) DWORD, | |
| 2694 | else => *const fn (LPVOID) callconv(.C) DWORD, | |
| 2695 | }; | |
| 2692 | pub const PTHREAD_START_ROUTINE = std.meta.FnPtr(fn (LPVOID) callconv(.C) DWORD); | |
| 2696 | 2693 | pub const LPTHREAD_START_ROUTINE = PTHREAD_START_ROUTINE; |
| 2697 | 2694 | |
| 2698 | 2695 | pub const WIN32_FIND_DATAW = extern struct { |
| ... | ... | @@ -2865,10 +2862,7 @@ pub const IMAGE_TLS_DIRECTORY = extern struct { |
| 2865 | 2862 | pub const IMAGE_TLS_DIRECTORY64 = IMAGE_TLS_DIRECTORY; |
| 2866 | 2863 | pub const IMAGE_TLS_DIRECTORY32 = IMAGE_TLS_DIRECTORY; |
| 2867 | 2864 | |
| 2868 | pub const PIMAGE_TLS_CALLBACK = switch (builtin.zig_backend) { | |
| 2869 | .stage1 => ?fn (PVOID, DWORD, PVOID) callconv(.C) void, | |
| 2870 | else => ?*const fn (PVOID, DWORD, PVOID) callconv(.C) void, | |
| 2871 | }; | |
| 2865 | pub const PIMAGE_TLS_CALLBACK = ?std.meta.FnPtr(fn (PVOID, DWORD, PVOID) callconv(.C) void); | |
| 2872 | 2866 | |
| 2873 | 2867 | pub const PROV_RSA_FULL = 1; |
| 2874 | 2868 | |
| ... | ... | @@ -2894,10 +2888,7 @@ pub const FILE_ACTION_MODIFIED = 0x00000003; |
| 2894 | 2888 | pub const FILE_ACTION_RENAMED_OLD_NAME = 0x00000004; |
| 2895 | 2889 | pub const FILE_ACTION_RENAMED_NEW_NAME = 0x00000005; |
| 2896 | 2890 | |
| 2897 | pub const LPOVERLAPPED_COMPLETION_ROUTINE = switch (builtin.zig_backend) { | |
| 2898 | .stage1 => ?fn (DWORD, DWORD, *OVERLAPPED) callconv(.C) void, | |
| 2899 | else => ?*const fn (DWORD, DWORD, *OVERLAPPED) callconv(.C) void, | |
| 2900 | }; | |
| 2891 | pub const LPOVERLAPPED_COMPLETION_ROUTINE = ?std.meta.FnPtr(fn (DWORD, DWORD, *OVERLAPPED) callconv(.C) void); | |
| 2901 | 2892 | |
| 2902 | 2893 | pub const FILE_NOTIFY_CHANGE_CREATION = 64; |
| 2903 | 2894 | pub const FILE_NOTIFY_CHANGE_SIZE = 8; |
| ... | ... | @@ -2950,10 +2941,7 @@ pub const RTL_CRITICAL_SECTION = extern struct { |
| 2950 | 2941 | pub const CRITICAL_SECTION = RTL_CRITICAL_SECTION; |
| 2951 | 2942 | pub const INIT_ONCE = RTL_RUN_ONCE; |
| 2952 | 2943 | pub const INIT_ONCE_STATIC_INIT = RTL_RUN_ONCE_INIT; |
| 2953 | pub const INIT_ONCE_FN = switch (builtin.zig_backend) { | |
| 2954 | .stage1 => fn (InitOnce: *INIT_ONCE, Parameter: ?*anyopaque, Context: ?*anyopaque) callconv(.C) BOOL, | |
| 2955 | else => *const fn (InitOnce: *INIT_ONCE, Parameter: ?*anyopaque, Context: ?*anyopaque) callconv(.C) BOOL, | |
| 2956 | }; | |
| 2944 | pub const INIT_ONCE_FN = std.meta.FnPtr(fn (InitOnce: *INIT_ONCE, Parameter: ?*anyopaque, Context: ?*anyopaque) callconv(.C) BOOL); | |
| 2957 | 2945 | |
| 2958 | 2946 | pub const RTL_RUN_ONCE = extern struct { |
| 2959 | 2947 | Ptr: ?*anyopaque, |
| ... | ... | @@ -3238,10 +3226,7 @@ pub const EXCEPTION_POINTERS = extern struct { |
| 3238 | 3226 | ContextRecord: *std.os.windows.CONTEXT, |
| 3239 | 3227 | }; |
| 3240 | 3228 | |
| 3241 | pub const VECTORED_EXCEPTION_HANDLER = switch (builtin.zig_backend) { | |
| 3242 | .stage1 => fn (ExceptionInfo: *EXCEPTION_POINTERS) callconv(WINAPI) c_long, | |
| 3243 | else => *const fn (ExceptionInfo: *EXCEPTION_POINTERS) callconv(WINAPI) c_long, | |
| 3244 | }; | |
| 3229 | pub const VECTORED_EXCEPTION_HANDLER = std.meta.FnPtr(fn (ExceptionInfo: *EXCEPTION_POINTERS) callconv(WINAPI) c_long); | |
| 3245 | 3230 | |
| 3246 | 3231 | pub const OBJECT_ATTRIBUTES = extern struct { |
| 3247 | 3232 | Length: ULONG, |
| ... | ... | @@ -3517,10 +3502,7 @@ pub const RTL_DRIVE_LETTER_CURDIR = extern struct { |
| 3517 | 3502 | DosPath: UNICODE_STRING, |
| 3518 | 3503 | }; |
| 3519 | 3504 | |
| 3520 | pub const PPS_POST_PROCESS_INIT_ROUTINE = switch (builtin.zig_backend) { | |
| 3521 | .stage1 => ?fn () callconv(.C) void, | |
| 3522 | else => ?*const fn () callconv(.C) void, | |
| 3523 | }; | |
| 3505 | pub const PPS_POST_PROCESS_INIT_ROUTINE = ?std.meta.FnPtr(fn () callconv(.C) void); | |
| 3524 | 3506 | |
| 3525 | 3507 | pub const FILE_BOTH_DIR_INFORMATION = extern struct { |
| 3526 | 3508 | NextEntryOffset: ULONG, |
| ... | ... | @@ -3540,10 +3522,7 @@ pub const FILE_BOTH_DIR_INFORMATION = extern struct { |
| 3540 | 3522 | }; |
| 3541 | 3523 | pub const FILE_BOTH_DIRECTORY_INFORMATION = FILE_BOTH_DIR_INFORMATION; |
| 3542 | 3524 | |
| 3543 | pub const IO_APC_ROUTINE = switch (builtin.zig_backend) { | |
| 3544 | .stage1 => fn (PVOID, *IO_STATUS_BLOCK, ULONG) callconv(.C) void, | |
| 3545 | else => *const fn (PVOID, *IO_STATUS_BLOCK, ULONG) callconv(.C) void, | |
| 3546 | }; | |
| 3525 | pub const IO_APC_ROUTINE = std.meta.FnPtr(fn (PVOID, *IO_STATUS_BLOCK, ULONG) callconv(.C) void); | |
| 3547 | 3526 | |
| 3548 | 3527 | pub const CURDIR = extern struct { |
| 3549 | 3528 | DosPath: UNICODE_STRING, |
| ... | ... | @@ -3615,14 +3594,8 @@ pub const ENUM_PAGE_FILE_INFORMATION = extern struct { |
| 3615 | 3594 | PeakUsage: SIZE_T, |
| 3616 | 3595 | }; |
| 3617 | 3596 | |
| 3618 | pub const PENUM_PAGE_FILE_CALLBACKW = switch (builtin.zig_backend) { | |
| 3619 | .stage1 => ?fn (?LPVOID, *ENUM_PAGE_FILE_INFORMATION, LPCWSTR) callconv(.C) BOOL, | |
| 3620 | else => ?*const fn (?LPVOID, *ENUM_PAGE_FILE_INFORMATION, LPCWSTR) callconv(.C) BOOL, | |
| 3621 | }; | |
| 3622 | pub const PENUM_PAGE_FILE_CALLBACKA = switch (builtin.zig_backend) { | |
| 3623 | .stage1 => ?fn (?LPVOID, *ENUM_PAGE_FILE_INFORMATION, LPCSTR) callconv(.C) BOOL, | |
| 3624 | else => ?*const fn (?LPVOID, *ENUM_PAGE_FILE_INFORMATION, LPCSTR) callconv(.C) BOOL, | |
| 3625 | }; | |
| 3597 | pub const PENUM_PAGE_FILE_CALLBACKW = ?std.meta.FnPtr(fn (?LPVOID, *ENUM_PAGE_FILE_INFORMATION, LPCWSTR) callconv(.C) BOOL); | |
| 3598 | pub const PENUM_PAGE_FILE_CALLBACKA = ?std.meta.FnPtr(fn (?LPVOID, *ENUM_PAGE_FILE_INFORMATION, LPCSTR) callconv(.C) BOOL); | |
| 3626 | 3599 | |
| 3627 | 3600 | pub const PSAPI_WS_WATCH_INFORMATION_EX = extern struct { |
| 3628 | 3601 | BasicInfo: PSAPI_WS_WATCH_INFORMATION, |
| ... | ... | @@ -3722,7 +3695,4 @@ pub const CTRL_CLOSE_EVENT: DWORD = 2; |
| 3722 | 3695 | pub const CTRL_LOGOFF_EVENT: DWORD = 5; |
| 3723 | 3696 | pub const CTRL_SHUTDOWN_EVENT: DWORD = 6; |
| 3724 | 3697 | |
| 3725 | pub const HANDLER_ROUTINE = switch (builtin.zig_backend) { | |
| 3726 | .stage1 => fn (dwCtrlType: DWORD) callconv(.C) BOOL, | |
| 3727 | else => *const fn (dwCtrlType: DWORD) callconv(.C) BOOL, | |
| 3728 | }; | |
| 3698 | pub const HANDLER_ROUTINE = std.meta.FnPtr(fn (dwCtrlType: DWORD) callconv(.C) BOOL); |
lib/std/os/windows/user32.zig+13-13| ... | ... | @@ -39,7 +39,7 @@ fn selectSymbol(comptime function_static: anytype, function_dynamic: @TypeOf(fun |
| 39 | 39 | |
| 40 | 40 | // === Messages === |
| 41 | 41 | |
| 42 | pub const WNDPROC = fn (hwnd: HWND, uMsg: UINT, wParam: WPARAM, lParam: LPARAM) callconv(WINAPI) LRESULT; | |
| 42 | pub const WNDPROC = std.meta.FnPtr(fn (hwnd: HWND, uMsg: UINT, wParam: WPARAM, lParam: LPARAM) callconv(WINAPI) LRESULT); | |
| 43 | 43 | |
| 44 | 44 | pub const MSG = extern struct { |
| 45 | 45 | hWnd: ?HWND, |
| ... | ... | @@ -1056,7 +1056,7 @@ pub fn getMessageA(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: u32, wMsgFilterMax: |
| 1056 | 1056 | } |
| 1057 | 1057 | |
| 1058 | 1058 | pub extern "user32" fn GetMessageW(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT) callconv(WINAPI) BOOL; |
| 1059 | pub var pfnGetMessageW: @TypeOf(GetMessageW) = undefined; | |
| 1059 | pub var pfnGetMessageW: std.meta.FnPtr(@TypeOf(GetMessageW)) = undefined; | |
| 1060 | 1060 | pub fn getMessageW(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: u32, wMsgFilterMax: u32) !void { |
| 1061 | 1061 | const function = selectSymbol(GetMessageW, pfnGetMessageW, .win2k); |
| 1062 | 1062 | |
| ... | ... | @@ -1087,7 +1087,7 @@ pub fn peekMessageA(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: u32, wMsgFilterMax: |
| 1087 | 1087 | } |
| 1088 | 1088 | |
| 1089 | 1089 | pub extern "user32" fn PeekMessageW(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT, wRemoveMsg: UINT) callconv(WINAPI) BOOL; |
| 1090 | pub var pfnPeekMessageW: @TypeOf(PeekMessageW) = undefined; | |
| 1090 | pub var pfnPeekMessageW: std.meta.FnPtr(@TypeOf(PeekMessageW)) = undefined; | |
| 1091 | 1091 | pub fn peekMessageW(lpMsg: *MSG, hWnd: ?HWND, wMsgFilterMin: u32, wMsgFilterMax: u32, wRemoveMsg: u32) !bool { |
| 1092 | 1092 | const function = selectSymbol(PeekMessageW, pfnPeekMessageW, .win2k); |
| 1093 | 1093 | |
| ... | ... | @@ -1112,7 +1112,7 @@ pub fn dispatchMessageA(lpMsg: *const MSG) LRESULT { |
| 1112 | 1112 | } |
| 1113 | 1113 | |
| 1114 | 1114 | pub extern "user32" fn DispatchMessageW(lpMsg: *const MSG) callconv(WINAPI) LRESULT; |
| 1115 | pub var pfnDispatchMessageW: @TypeOf(DispatchMessageW) = undefined; | |
| 1115 | pub var pfnDispatchMessageW: std.meta.FnPtr(@TypeOf(DispatchMessageW)) = undefined; | |
| 1116 | 1116 | pub fn dispatchMessageW(lpMsg: *const MSG) LRESULT { |
| 1117 | 1117 | const function = selectSymbol(DispatchMessageW, pfnDispatchMessageW, .win2k); |
| 1118 | 1118 | return function(lpMsg); |
| ... | ... | @@ -1129,7 +1129,7 @@ pub fn defWindowProcA(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) LRE |
| 1129 | 1129 | } |
| 1130 | 1130 | |
| 1131 | 1131 | pub extern "user32" fn DefWindowProcW(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) callconv(WINAPI) LRESULT; |
| 1132 | pub var pfnDefWindowProcW: @TypeOf(DefWindowProcW) = undefined; | |
| 1132 | pub var pfnDefWindowProcW: std.meta.FnPtr(@TypeOf(DefWindowProcW)) = undefined; | |
| 1133 | 1133 | pub fn defWindowProcW(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) LRESULT { |
| 1134 | 1134 | const function = selectSymbol(DefWindowProcW, pfnDefWindowProcW, .win2k); |
| 1135 | 1135 | return function(hWnd, Msg, wParam, lParam); |
| ... | ... | @@ -1191,7 +1191,7 @@ pub fn registerClassExA(window_class: *const WNDCLASSEXA) !ATOM { |
| 1191 | 1191 | } |
| 1192 | 1192 | |
| 1193 | 1193 | pub extern "user32" fn RegisterClassExW(*const WNDCLASSEXW) callconv(WINAPI) ATOM; |
| 1194 | pub var pfnRegisterClassExW: @TypeOf(RegisterClassExW) = undefined; | |
| 1194 | pub var pfnRegisterClassExW: std.meta.FnPtr(@TypeOf(RegisterClassExW)) = undefined; | |
| 1195 | 1195 | pub fn registerClassExW(window_class: *const WNDCLASSEXW) !ATOM { |
| 1196 | 1196 | const function = selectSymbol(RegisterClassExW, pfnRegisterClassExW, .win2k); |
| 1197 | 1197 | const atom = function(window_class); |
| ... | ... | @@ -1215,7 +1215,7 @@ pub fn unregisterClassA(lpClassName: [*:0]const u8, hInstance: HINSTANCE) !void |
| 1215 | 1215 | } |
| 1216 | 1216 | |
| 1217 | 1217 | pub extern "user32" fn UnregisterClassW(lpClassName: [*:0]const u16, hInstance: HINSTANCE) callconv(WINAPI) BOOL; |
| 1218 | pub var pfnUnregisterClassW: @TypeOf(UnregisterClassW) = undefined; | |
| 1218 | pub var pfnUnregisterClassW: std.meta.FnPtr(@TypeOf(UnregisterClassW)) = undefined; | |
| 1219 | 1219 | pub fn unregisterClassW(lpClassName: [*:0]const u16, hInstance: HINSTANCE) !void { |
| 1220 | 1220 | const function = selectSymbol(UnregisterClassW, pfnUnregisterClassW, .win2k); |
| 1221 | 1221 | if (function(lpClassName, hInstance) == 0) { |
| ... | ... | @@ -1292,7 +1292,7 @@ pub fn createWindowExA(dwExStyle: u32, lpClassName: [*:0]const u8, lpWindowName: |
| 1292 | 1292 | } |
| 1293 | 1293 | |
| 1294 | 1294 | pub extern "user32" fn CreateWindowExW(dwExStyle: DWORD, lpClassName: [*:0]const u16, lpWindowName: [*:0]const u16, dwStyle: DWORD, X: i32, Y: i32, nWidth: i32, nHeight: i32, hWindParent: ?HWND, hMenu: ?HMENU, hInstance: HINSTANCE, lpParam: ?LPVOID) callconv(WINAPI) ?HWND; |
| 1295 | pub var pfnCreateWindowExW: @TypeOf(CreateWindowExW) = undefined; | |
| 1295 | pub var pfnCreateWindowExW: std.meta.FnPtr(@TypeOf(CreateWindowExW)) = undefined; | |
| 1296 | 1296 | pub fn createWindowExW(dwExStyle: u32, lpClassName: [*:0]const u16, lpWindowName: [*:0]const u16, dwStyle: u32, X: i32, Y: i32, nWidth: i32, nHeight: i32, hWindParent: ?HWND, hMenu: ?HMENU, hInstance: HINSTANCE, lpParam: ?*anyopaque) !HWND { |
| 1297 | 1297 | const function = selectSymbol(CreateWindowExW, pfnCreateWindowExW, .win2k); |
| 1298 | 1298 | const window = function(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWindParent, hMenu, hInstance, lpParam); |
| ... | ... | @@ -1382,7 +1382,7 @@ pub fn getWindowLongA(hWnd: HWND, nIndex: i32) !i32 { |
| 1382 | 1382 | } |
| 1383 | 1383 | |
| 1384 | 1384 | pub extern "user32" fn GetWindowLongW(hWnd: HWND, nIndex: i32) callconv(WINAPI) LONG; |
| 1385 | pub var pfnGetWindowLongW: @TypeOf(GetWindowLongW) = undefined; | |
| 1385 | pub var pfnGetWindowLongW: std.meta.FnPtr(@TypeOf(GetWindowLongW)) = undefined; | |
| 1386 | 1386 | pub fn getWindowLongW(hWnd: HWND, nIndex: i32) !i32 { |
| 1387 | 1387 | const function = selectSymbol(GetWindowLongW, pfnGetWindowLongW, .win2k); |
| 1388 | 1388 | |
| ... | ... | @@ -1415,7 +1415,7 @@ pub fn getWindowLongPtrA(hWnd: HWND, nIndex: i32) !isize { |
| 1415 | 1415 | } |
| 1416 | 1416 | |
| 1417 | 1417 | pub extern "user32" fn GetWindowLongPtrW(hWnd: HWND, nIndex: i32) callconv(WINAPI) LONG_PTR; |
| 1418 | pub var pfnGetWindowLongPtrW: @TypeOf(GetWindowLongPtrW) = undefined; | |
| 1418 | pub var pfnGetWindowLongPtrW: std.meta.FnPtr(@TypeOf(GetWindowLongPtrW)) = undefined; | |
| 1419 | 1419 | pub fn getWindowLongPtrW(hWnd: HWND, nIndex: i32) !isize { |
| 1420 | 1420 | if (@sizeOf(LONG_PTR) == 4) return getWindowLongW(hWnd, nIndex); |
| 1421 | 1421 | const function = selectSymbol(GetWindowLongPtrW, pfnGetWindowLongPtrW, .win2k); |
| ... | ... | @@ -1449,7 +1449,7 @@ pub fn setWindowLongA(hWnd: HWND, nIndex: i32, dwNewLong: i32) !i32 { |
| 1449 | 1449 | } |
| 1450 | 1450 | |
| 1451 | 1451 | pub extern "user32" fn SetWindowLongW(hWnd: HWND, nIndex: i32, dwNewLong: LONG) callconv(WINAPI) LONG; |
| 1452 | pub var pfnSetWindowLongW: @TypeOf(SetWindowLongW) = undefined; | |
| 1452 | pub var pfnSetWindowLongW: std.meta.FnPtr(@TypeOf(SetWindowLongW)) = undefined; | |
| 1453 | 1453 | pub fn setWindowLongW(hWnd: HWND, nIndex: i32, dwNewLong: i32) !i32 { |
| 1454 | 1454 | const function = selectSymbol(SetWindowLongW, pfnSetWindowLongW, .win2k); |
| 1455 | 1455 | |
| ... | ... | @@ -1484,7 +1484,7 @@ pub fn setWindowLongPtrA(hWnd: HWND, nIndex: i32, dwNewLong: isize) !isize { |
| 1484 | 1484 | } |
| 1485 | 1485 | |
| 1486 | 1486 | pub extern "user32" fn SetWindowLongPtrW(hWnd: HWND, nIndex: i32, dwNewLong: LONG_PTR) callconv(WINAPI) LONG_PTR; |
| 1487 | pub var pfnSetWindowLongPtrW: @TypeOf(SetWindowLongPtrW) = undefined; | |
| 1487 | pub var pfnSetWindowLongPtrW: std.meta.FnPtr(@TypeOf(SetWindowLongPtrW)) = undefined; | |
| 1488 | 1488 | pub fn setWindowLongPtrW(hWnd: HWND, nIndex: i32, dwNewLong: isize) !isize { |
| 1489 | 1489 | if (@sizeOf(LONG_PTR) == 4) return setWindowLongW(hWnd, nIndex, dwNewLong); |
| 1490 | 1490 | const function = selectSymbol(SetWindowLongPtrW, pfnSetWindowLongPtrW, .win2k); |
| ... | ... | @@ -1580,7 +1580,7 @@ pub fn messageBoxA(hWnd: ?HWND, lpText: [*:0]const u8, lpCaption: [*:0]const u8, |
| 1580 | 1580 | } |
| 1581 | 1581 | |
| 1582 | 1582 | pub extern "user32" fn MessageBoxW(hWnd: ?HWND, lpText: [*:0]const u16, lpCaption: ?[*:0]const u16, uType: UINT) callconv(WINAPI) i32; |
| 1583 | pub var pfnMessageBoxW: @TypeOf(MessageBoxW) = undefined; | |
| 1583 | pub var pfnMessageBoxW: std.meta.FnPtr(@TypeOf(MessageBoxW)) = undefined; | |
| 1584 | 1584 | pub fn messageBoxW(hWnd: ?HWND, lpText: [*:0]const u16, lpCaption: [*:0]const u16, uType: u32) !i32 { |
| 1585 | 1585 | const function = selectSymbol(MessageBoxW, pfnMessageBoxW, .win2k); |
| 1586 | 1586 | const value = function(hWnd, lpText, lpCaption, uType); |
lib/std/os/windows/ws2_32.zig+18-18| ... | ... | @@ -942,7 +942,7 @@ pub const UDP_NOCHECKSUM = 1; |
| 942 | 942 | pub const UDP_CHECKSUM_COVERAGE = 20; |
| 943 | 943 | pub const GAI_STRERROR_BUFFER_SIZE = 1024; |
| 944 | 944 | |
| 945 | pub const LPCONDITIONPROC = fn ( | |
| 945 | pub const LPCONDITIONPROC = std.meta.FnPtr(fn ( | |
| 946 | 946 | lpCallerId: *WSABUF, |
| 947 | 947 | lpCallerData: *WSABUF, |
| 948 | 948 | lpSQOS: *QOS, |
| ... | ... | @@ -951,14 +951,14 @@ pub const LPCONDITIONPROC = fn ( |
| 951 | 951 | lpCalleeData: *WSABUF, |
| 952 | 952 | g: *u32, |
| 953 | 953 | dwCallbackData: usize, |
| 954 | ) callconv(WINAPI) i32; | |
| 954 | ) callconv(WINAPI) i32); | |
| 955 | 955 | |
| 956 | pub const LPWSAOVERLAPPED_COMPLETION_ROUTINE = fn ( | |
| 956 | pub const LPWSAOVERLAPPED_COMPLETION_ROUTINE = std.meta.FnPtr(fn ( | |
| 957 | 957 | dwError: u32, |
| 958 | 958 | cbTransferred: u32, |
| 959 | 959 | lpOverlapped: *OVERLAPPED, |
| 960 | 960 | dwFlags: u32, |
| 961 | ) callconv(WINAPI) void; | |
| 961 | ) callconv(WINAPI) void); | |
| 962 | 962 | |
| 963 | 963 | pub const FLOWSPEC = extern struct { |
| 964 | 964 | TokenRate: u32, |
| ... | ... | @@ -1173,7 +1173,7 @@ pub const TRANSMIT_FILE_BUFFERS = extern struct { |
| 1173 | 1173 | TailLength: u32, |
| 1174 | 1174 | }; |
| 1175 | 1175 | |
| 1176 | pub const LPFN_TRANSMITFILE = fn ( | |
| 1176 | pub const LPFN_TRANSMITFILE = std.meta.FnPtr(fn ( | |
| 1177 | 1177 | hSocket: SOCKET, |
| 1178 | 1178 | hFile: HANDLE, |
| 1179 | 1179 | nNumberOfBytesToWrite: u32, |
| ... | ... | @@ -1181,9 +1181,9 @@ pub const LPFN_TRANSMITFILE = fn ( |
| 1181 | 1181 | lpOverlapped: ?*OVERLAPPED, |
| 1182 | 1182 | lpTransmitBuffers: ?*TRANSMIT_FILE_BUFFERS, |
| 1183 | 1183 | dwReserved: u32, |
| 1184 | ) callconv(WINAPI) BOOL; | |
| 1184 | ) callconv(WINAPI) BOOL); | |
| 1185 | 1185 | |
| 1186 | pub const LPFN_ACCEPTEX = fn ( | |
| 1186 | pub const LPFN_ACCEPTEX = std.meta.FnPtr(fn ( | |
| 1187 | 1187 | sListenSocket: SOCKET, |
| 1188 | 1188 | sAcceptSocket: SOCKET, |
| 1189 | 1189 | lpOutputBuffer: *anyopaque, |
| ... | ... | @@ -1192,9 +1192,9 @@ pub const LPFN_ACCEPTEX = fn ( |
| 1192 | 1192 | dwRemoteAddressLength: u32, |
| 1193 | 1193 | lpdwBytesReceived: *u32, |
| 1194 | 1194 | lpOverlapped: *OVERLAPPED, |
| 1195 | ) callconv(WINAPI) BOOL; | |
| 1195 | ) callconv(WINAPI) BOOL); | |
| 1196 | 1196 | |
| 1197 | pub const LPFN_GETACCEPTEXSOCKADDRS = fn ( | |
| 1197 | pub const LPFN_GETACCEPTEXSOCKADDRS = std.meta.FnPtr(fn ( | |
| 1198 | 1198 | lpOutputBuffer: *anyopaque, |
| 1199 | 1199 | dwReceiveDataLength: u32, |
| 1200 | 1200 | dwLocalAddressLength: u32, |
| ... | ... | @@ -1203,29 +1203,29 @@ pub const LPFN_GETACCEPTEXSOCKADDRS = fn ( |
| 1203 | 1203 | LocalSockaddrLength: *i32, |
| 1204 | 1204 | RemoteSockaddr: **sockaddr, |
| 1205 | 1205 | RemoteSockaddrLength: *i32, |
| 1206 | ) callconv(WINAPI) void; | |
| 1206 | ) callconv(WINAPI) void); | |
| 1207 | 1207 | |
| 1208 | pub const LPFN_WSASENDMSG = fn ( | |
| 1208 | pub const LPFN_WSASENDMSG = std.meta.FnPtr(fn ( | |
| 1209 | 1209 | s: SOCKET, |
| 1210 | 1210 | lpMsg: *const std.x.os.Socket.Message, |
| 1211 | 1211 | dwFlags: u32, |
| 1212 | 1212 | lpNumberOfBytesSent: ?*u32, |
| 1213 | 1213 | lpOverlapped: ?*OVERLAPPED, |
| 1214 | 1214 | lpCompletionRoutine: ?LPWSAOVERLAPPED_COMPLETION_ROUTINE, |
| 1215 | ) callconv(WINAPI) i32; | |
| 1215 | ) callconv(WINAPI) i32); | |
| 1216 | 1216 | |
| 1217 | pub const LPFN_WSARECVMSG = fn ( | |
| 1217 | pub const LPFN_WSARECVMSG = std.meta.FnPtr(fn ( | |
| 1218 | 1218 | s: SOCKET, |
| 1219 | 1219 | lpMsg: *std.x.os.Socket.Message, |
| 1220 | 1220 | lpdwNumberOfBytesRecv: ?*u32, |
| 1221 | 1221 | lpOverlapped: ?*OVERLAPPED, |
| 1222 | 1222 | lpCompletionRoutine: ?LPWSAOVERLAPPED_COMPLETION_ROUTINE, |
| 1223 | ) callconv(WINAPI) i32; | |
| 1223 | ) callconv(WINAPI) i32); | |
| 1224 | 1224 | |
| 1225 | pub const LPSERVICE_CALLBACK_PROC = fn ( | |
| 1225 | pub const LPSERVICE_CALLBACK_PROC = std.meta.FnPtr(fn ( | |
| 1226 | 1226 | lParam: LPARAM, |
| 1227 | 1227 | hAsyncTaskHandle: HANDLE, |
| 1228 | ) callconv(WINAPI) void; | |
| 1228 | ) callconv(WINAPI) void); | |
| 1229 | 1229 | |
| 1230 | 1230 | pub const SERVICE_ASYNC_INFO = extern struct { |
| 1231 | 1231 | lpServiceCallbackProc: LPSERVICE_CALLBACK_PROC, |
| ... | ... | @@ -1233,11 +1233,11 @@ pub const SERVICE_ASYNC_INFO = extern struct { |
| 1233 | 1233 | hAsyncTaskHandle: HANDLE, |
| 1234 | 1234 | }; |
| 1235 | 1235 | |
| 1236 | pub const LPLOOKUPSERVICE_COMPLETION_ROUTINE = fn ( | |
| 1236 | pub const LPLOOKUPSERVICE_COMPLETION_ROUTINE = std.meta.FnPtr(fn ( | |
| 1237 | 1237 | dwError: u32, |
| 1238 | 1238 | dwBytes: u32, |
| 1239 | 1239 | lpOverlapped: *OVERLAPPED, |
| 1240 | ) callconv(WINAPI) void; | |
| 1240 | ) callconv(WINAPI) void); | |
| 1241 | 1241 | |
| 1242 | 1242 | pub const fd_set = extern struct { |
| 1243 | 1243 | fd_count: u32, |
lib/std/rand.zig+1-4| ... | ... | @@ -30,10 +30,7 @@ pub const RomuTrio = @import("rand/RomuTrio.zig"); |
| 30 | 30 | |
| 31 | 31 | pub const Random = struct { |
| 32 | 32 | ptr: *anyopaque, |
| 33 | fillFn: if (builtin.zig_backend == .stage1) | |
| 34 | fn (ptr: *anyopaque, buf: []u8) void | |
| 35 | else | |
| 36 | *const fn (ptr: *anyopaque, buf: []u8) void, | |
| 33 | fillFn: std.meta.FnPtr(fn (ptr: *anyopaque, buf: []u8) void), | |
| 37 | 34 | |
| 38 | 35 | pub fn init(pointer: anytype, comptime fillFn: fn (ptr: @TypeOf(pointer), buf: []u8) void) Random { |
| 39 | 36 | const Ptr = @TypeOf(pointer); |
lib/std/zig/c_translation.zig+6-8| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | const builtin = @import("builtin"); | |
| 2 | 3 | const testing = std.testing; |
| 3 | 4 | const math = std.math; |
| 4 | 5 | const mem = std.mem; |
| ... | ... | @@ -8,7 +9,7 @@ pub fn cast(comptime DestType: type, target: anytype) DestType { |
| 8 | 9 | // this function should behave like transCCast in translate-c, except it's for macros |
| 9 | 10 | const SourceType = @TypeOf(target); |
| 10 | 11 | switch (@typeInfo(DestType)) { |
| 11 | .Fn => if (@import("builtin").zig_backend == .stage1) | |
| 12 | .Fn => if (builtin.zig_backend == .stage1) | |
| 12 | 13 | return castToPtr(DestType, SourceType, target) |
| 13 | 14 | else |
| 14 | 15 | return castToPtr(*const DestType, SourceType, target), |
| ... | ... | @@ -17,7 +18,7 @@ pub fn cast(comptime DestType: type, target: anytype) DestType { |
| 17 | 18 | if (@typeInfo(dest_opt.child) == .Pointer) { |
| 18 | 19 | return castToPtr(DestType, SourceType, target); |
| 19 | 20 | } else if (@typeInfo(dest_opt.child) == .Fn) { |
| 20 | if (@import("builtin").zig_backend == .stage1) | |
| 21 | if (builtin.zig_backend == .stage1) | |
| 21 | 22 | return castToPtr(DestType, SourceType, target) |
| 22 | 23 | else |
| 23 | 24 | return castToPtr(?*const dest_opt.child, SourceType, target); |
| ... | ... | @@ -137,10 +138,7 @@ test "cast" { |
| 137 | 138 | try testing.expect(cast(?*anyopaque, -1) == @intToPtr(?*anyopaque, @bitCast(usize, @as(isize, -1)))); |
| 138 | 139 | try testing.expect(cast(?*anyopaque, foo) == @intToPtr(?*anyopaque, @bitCast(usize, @as(isize, -1)))); |
| 139 | 140 | |
| 140 | const FnPtr = if (@import("builtin").zig_backend == .stage1) | |
| 141 | ?fn (*anyopaque) void | |
| 142 | else | |
| 143 | ?*align(1) const fn (*anyopaque) void; | |
| 141 | const FnPtr = ?if (builtin.zig_backend == .stage1) fn (*anyopaque) void else *align(1) const fn (*anyopaque) void; | |
| 144 | 142 | try testing.expect(cast(FnPtr, 0) == @intToPtr(FnPtr, @as(usize, 0))); |
| 145 | 143 | try testing.expect(cast(FnPtr, foo) == @intToPtr(FnPtr, @bitCast(usize, @as(isize, -1)))); |
| 146 | 144 | } |
| ... | ... | @@ -151,7 +149,7 @@ pub fn sizeof(target: anytype) usize { |
| 151 | 149 | switch (@typeInfo(T)) { |
| 152 | 150 | .Float, .Int, .Struct, .Union, .Array, .Bool, .Vector => return @sizeOf(T), |
| 153 | 151 | .Fn => { |
| 154 | if (@import("builtin").zig_backend == .stage1) { | |
| 152 | if (builtin.zig_backend == .stage1) { | |
| 155 | 153 | // sizeof(main) returns 1, sizeof(&main) returns pointer size. |
| 156 | 154 | // We cannot distinguish those types in Zig, so use pointer size. |
| 157 | 155 | return @sizeOf(T); |
| ... | ... | @@ -254,7 +252,7 @@ test "sizeof" { |
| 254 | 252 | try testing.expect(sizeof(*const *const [4:0]u8) == ptr_size); |
| 255 | 253 | try testing.expect(sizeof(*const [4]u8) == ptr_size); |
| 256 | 254 | |
| 257 | if (@import("builtin").zig_backend == .stage1) { | |
| 255 | if (builtin.zig_backend == .stage1) { | |
| 258 | 256 | try testing.expect(sizeof(sizeof) == @sizeOf(@TypeOf(sizeof))); |
| 259 | 257 | } else if (false) { // TODO |
| 260 | 258 | try testing.expect(sizeof(&sizeof) == @sizeOf(@TypeOf(&sizeof))); |