| author | |
| committer | |
| log | bdf3680be1b39f4a92370817ef0a7e8a9fdaa373 |
| tree | af5df2c88b930db263f3b20ce5f4fdae42f0a10c |
| parent | 8a4c2d3b07751507830416e29d6f7d6a023cd483 |
| signature |
15 files changed, 58 insertions(+), 22 deletions(-)
lib/std/array_list.zig+1-1| ... | @@ -58,7 +58,7 @@ pub fn AlignedArrayList(comptime T: type, comptime alignment: ?u29) type { | ... | @@ -58,7 +58,7 @@ pub fn AlignedArrayList(comptime T: type, comptime alignment: ?u29) type { |
| 58 | return self.items[0..self.len]; | 58 | return self.items[0..self.len]; |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | /// Safely access index i of the list. | 61 | /// Safely access index i of the list. |
| 62 | pub fn at(self: Self, i: usize) T { | 62 | pub fn at(self: Self, i: usize) T { |
| 63 | return self.toSliceConst()[i]; | 63 | return self.toSliceConst()[i]; |
| 64 | } | 64 | } |
lib/std/builtin.zig+2| ... | @@ -144,6 +144,7 @@ pub const TypeInfo = union(enum) { | ... | @@ -144,6 +144,7 @@ pub const TypeInfo = union(enum) { |
| 144 | alignment: comptime_int, | 144 | alignment: comptime_int, |
| 145 | child: type, | 145 | child: type, |
| 146 | is_allowzero: bool, | 146 | is_allowzero: bool, |
| 147 | |||
| 147 | /// The type of the sentinel is the element type of the pointer, which is | 148 | /// The type of the sentinel is the element type of the pointer, which is |
| 148 | /// the value of the `child` field in this struct. However there is no way | 149 | /// the value of the `child` field in this struct. However there is no way |
| 149 | /// to refer to that type here, so we use `var`. | 150 | /// to refer to that type here, so we use `var`. |
| ... | @@ -164,6 +165,7 @@ pub const TypeInfo = union(enum) { | ... | @@ -164,6 +165,7 @@ pub const TypeInfo = union(enum) { |
| 164 | pub const Array = struct { | 165 | pub const Array = struct { |
| 165 | len: comptime_int, | 166 | len: comptime_int, |
| 166 | child: type, | 167 | child: type, |
| 168 | |||
| 167 | /// The type of the sentinel is the element type of the array, which is | 169 | /// The type of the sentinel is the element type of the array, which is |
| 168 | /// the value of the `child` field in this struct. However there is no way | 170 | /// the value of the `child` field in this struct. However there is no way |
| 169 | /// to refer to that type here, so we use `var`. | 171 | /// to refer to that type here, so we use `var`. |
lib/std/child_process.zig+1-1| ... | @@ -259,7 +259,7 @@ pub const ChildProcess = struct { | ... | @@ -259,7 +259,7 @@ pub const ChildProcess = struct { |
| 259 | } | 259 | } |
| 260 | 260 | ||
| 261 | fn handleWaitResult(self: *ChildProcess, status: u32) void { | 261 | fn handleWaitResult(self: *ChildProcess, status: u32) void { |
| 262 | // TODO https://github.com/ziglang/zig/issues/3190 | 262 | // TODO https://github.com/ziglang/zig/issues/3190 |
| 263 | var term = self.cleanupAfterWait(status); | 263 | var term = self.cleanupAfterWait(status); |
| 264 | self.term = term; | 264 | self.term = term; |
| 265 | } | 265 | } |
lib/std/debug/failing_allocator.zig+2-2| ... | @@ -5,10 +5,10 @@ const mem = std.mem; | ... | @@ -5,10 +5,10 @@ const mem = std.mem; |
| 5 | /// memory conditions are handled correctly. | 5 | /// memory conditions are handled correctly. |
| 6 | /// | 6 | /// |
| 7 | /// To use this, first initialize it and get an allocator with | 7 | /// To use this, first initialize it and get an allocator with |
| 8 | /// | 8 | /// |
| 9 | /// `const failing_allocator = &FailingAllocator.init(<allocator>, | 9 | /// `const failing_allocator = &FailingAllocator.init(<allocator>, |
| 10 | /// <fail_index>).allocator;` | 10 | /// <fail_index>).allocator;` |
| 11 | /// | 11 | /// |
| 12 | /// Then use `failing_allocator` anywhere you would have used a | 12 | /// Then use `failing_allocator` anywhere you would have used a |
| 13 | /// different allocator. | 13 | /// different allocator. |
| 14 | pub const FailingAllocator = struct { | 14 | pub const FailingAllocator = struct { |
lib/std/event/fs.zig+1-1| ... | @@ -1266,7 +1266,7 @@ pub fn Watch(comptime V: type) type { | ... | @@ -1266,7 +1266,7 @@ pub fn Watch(comptime V: type) type { |
| 1266 | if (ev.mask & os.linux.IN_CLOSE_WRITE == os.linux.IN_CLOSE_WRITE) { | 1266 | if (ev.mask & os.linux.IN_CLOSE_WRITE == os.linux.IN_CLOSE_WRITE) { |
| 1267 | const basename_ptr = ptr + @sizeOf(os.linux.inotify_event); | 1267 | const basename_ptr = ptr + @sizeOf(os.linux.inotify_event); |
| 1268 | // `ev.len` counts all bytes in `ev.name` including terminating null byte. | 1268 | // `ev.len` counts all bytes in `ev.name` including terminating null byte. |
| 1269 | const basename_with_null = basename_ptr[0 .. ev.len]; | 1269 | const basename_with_null = basename_ptr[0..ev.len]; |
| 1270 | const user_value = blk: { | 1270 | const user_value = blk: { |
| 1271 | const held = self.os_data.table_lock.acquire(); | 1271 | const held = self.os_data.table_lock.acquire(); |
| 1272 | defer held.release(); | 1272 | defer held.release(); |
lib/std/fifo.zig+1-1| ... | @@ -148,7 +148,7 @@ pub fn LinearFifo( | ... | @@ -148,7 +148,7 @@ pub fn LinearFifo( |
| 148 | var start = self.head + offset; | 148 | var start = self.head + offset; |
| 149 | if (start >= self.buf.len) { | 149 | if (start >= self.buf.len) { |
| 150 | start -= self.buf.len; | 150 | start -= self.buf.len; |
| 151 | return self.buf[start..self.count - offset]; | 151 | return self.buf[start .. self.count - offset]; |
| 152 | } else { | 152 | } else { |
| 153 | const end = math.min(self.head + self.count, self.buf.len); | 153 | const end = math.min(self.head + self.count, self.buf.len); |
| 154 | return self.buf[start..end]; | 154 | return self.buf[start..end]; |
lib/std/mutex.zig+2-2| ... | @@ -74,7 +74,7 @@ else | ... | @@ -74,7 +74,7 @@ else |
| 74 | pub fn release(self: Held) void { | 74 | pub fn release(self: Held) void { |
| 75 | switch (@atomicRmw(State, &self.mutex.state, .Xchg, .Unlocked, .Release)) { | 75 | switch (@atomicRmw(State, &self.mutex.state, .Xchg, .Unlocked, .Release)) { |
| 76 | .Locked => {}, | 76 | .Locked => {}, |
| 77 | .Sleeping => self.mutex.parker.unpark(@ptrCast(*const u32, &self.mutex.state)), | 77 | .Sleeping => self.mutex.parker.unpark(@ptrCast(*const u32, &self.mutex.state)), |
| 78 | .Unlocked => unreachable, // unlocking an unlocked mutex | 78 | .Unlocked => unreachable, // unlocking an unlocked mutex |
| 79 | else => unreachable, // should never be anything else | 79 | else => unreachable, // should never be anything else |
| 80 | } | 80 | } |
| ... | @@ -112,7 +112,7 @@ else | ... | @@ -112,7 +112,7 @@ else |
| 112 | if (@atomicRmw(State, &self.state, .Xchg, .Sleeping, .Acquire) == .Unlocked) | 112 | if (@atomicRmw(State, &self.state, .Xchg, .Sleeping, .Acquire) == .Unlocked) |
| 113 | return Held{ .mutex = self }; | 113 | return Held{ .mutex = self }; |
| 114 | state = .Sleeping; | 114 | state = .Sleeping; |
| 115 | self.parker.park(@ptrCast(*const u32, &self.state), @enumToInt(State.Sleeping)); | 115 | self.parker.park(@ptrCast(*const u32, &self.state), @enumToInt(State.Sleeping)); |
| 116 | } | 116 | } |
| 117 | } | 117 | } |
| 118 | }; | 118 | }; |
lib/std/net.zig+1-1| ... | @@ -1362,7 +1362,7 @@ pub const StreamServer = struct { | ... | @@ -1362,7 +1362,7 @@ pub const StreamServer = struct { |
| 1362 | 1362 | ||
| 1363 | pub const Connection = struct { | 1363 | pub const Connection = struct { |
| 1364 | file: fs.File, | 1364 | file: fs.File, |
| 1365 | address: Address | 1365 | address: Address, |
| 1366 | }; | 1366 | }; |
| 1367 | 1367 | ||
| 1368 | /// If this function succeeds, the returned `Connection` is a caller-managed resource. | 1368 | /// If this function succeeds, the returned `Connection` is a caller-managed resource. |
lib/std/os.zig+2-2| ... | @@ -2753,8 +2753,8 @@ pub fn sched_getaffinity(pid: pid_t) SchedGetAffinityError!cpu_set_t { | ... | @@ -2753,8 +2753,8 @@ pub fn sched_getaffinity(pid: pid_t) SchedGetAffinityError!cpu_set_t { |
| 2753 | 2753 | ||
| 2754 | /// Used to convert a slice to a null terminated slice on the stack. | 2754 | /// Used to convert a slice to a null terminated slice on the stack. |
| 2755 | /// TODO https://github.com/ziglang/zig/issues/287 | 2755 | /// TODO https://github.com/ziglang/zig/issues/287 |
| 2756 | pub fn toPosixPath(file_path: []const u8) ![PATH_MAX-1:0]u8 { | 2756 | pub fn toPosixPath(file_path: []const u8) ![PATH_MAX - 1:0]u8 { |
| 2757 | var path_with_null: [PATH_MAX-1:0]u8 = undefined; | 2757 | var path_with_null: [PATH_MAX - 1:0]u8 = undefined; |
| 2758 | // >= rather than > to make room for the null byte | 2758 | // >= rather than > to make room for the null byte |
| 2759 | if (file_path.len >= PATH_MAX) return error.NameTooLong; | 2759 | if (file_path.len >= PATH_MAX) return error.NameTooLong; |
| 2760 | mem.copy(u8, &path_with_null, file_path); | 2760 | mem.copy(u8, &path_with_null, file_path); |
lib/std/os/bits/linux.zig-1| ... | @@ -1124,7 +1124,6 @@ pub const io_uring_params = extern struct { | ... | @@ -1124,7 +1124,6 @@ pub const io_uring_params = extern struct { |
| 1124 | 1124 | ||
| 1125 | pub const IORING_FEAT_SINGLE_MMAP = 1 << 0; | 1125 | pub const IORING_FEAT_SINGLE_MMAP = 1 << 0; |
| 1126 | 1126 | ||
| 1127 | |||
| 1128 | // io_uring_params.flags | 1127 | // io_uring_params.flags |
| 1129 | 1128 | ||
| 1130 | /// io_context is polled | 1129 | /// io_context is polled |
lib/std/os/uefi/protocols/hii.zig+1| ... | @@ -26,6 +26,7 @@ pub const HIIPackageHeader = packed struct { | ... | @@ -26,6 +26,7 @@ pub const HIIPackageHeader = packed struct { |
| 26 | /// The header found at the start of each package list. | 26 | /// The header found at the start of each package list. |
| 27 | pub const HIIPackageList = extern struct { | 27 | pub const HIIPackageList = extern struct { |
| 28 | package_list_guid: Guid, | 28 | package_list_guid: Guid, |
| 29 | |||
| 29 | /// The size of the package list (in bytes), including the header. | 30 | /// The size of the package list (in bytes), including the header. |
| 30 | package_list_length: u32, | 31 | package_list_length: u32, |
| 31 | 32 |
lib/std/os/uefi/status.zig+38| ... | @@ -5,82 +5,120 @@ pub const success: usize = 0; | ... | @@ -5,82 +5,120 @@ pub const success: usize = 0; |
| 5 | 5 | ||
| 6 | /// The image failed to load. | 6 | /// The image failed to load. |
| 7 | pub const load_error: usize = high_bit | 1; | 7 | pub const load_error: usize = high_bit | 1; |
| 8 | |||
| 8 | /// A parameter was incorrect. | 9 | /// A parameter was incorrect. |
| 9 | pub const invalid_parameter: usize = high_bit | 2; | 10 | pub const invalid_parameter: usize = high_bit | 2; |
| 11 | |||
| 10 | /// The operation is not supported. | 12 | /// The operation is not supported. |
| 11 | pub const unsupported: usize = high_bit | 3; | 13 | pub const unsupported: usize = high_bit | 3; |
| 14 | |||
| 12 | /// The buffer was not the proper size for the request. | 15 | /// The buffer was not the proper size for the request. |
| 13 | pub const bad_buffer_size: usize = high_bit | 4; | 16 | pub const bad_buffer_size: usize = high_bit | 4; |
| 17 | |||
| 14 | /// The buffer is not large enough to hold the requested data. The required buffer size is returned in the appropriate parameter when this error occurs. | 18 | /// The buffer is not large enough to hold the requested data. The required buffer size is returned in the appropriate parameter when this error occurs. |
| 15 | pub const buffer_too_small: usize = high_bit | 5; | 19 | pub const buffer_too_small: usize = high_bit | 5; |
| 20 | |||
| 16 | /// There is no data pending upon return. | 21 | /// There is no data pending upon return. |
| 17 | pub const not_ready: usize = high_bit | 6; | 22 | pub const not_ready: usize = high_bit | 6; |
| 23 | |||
| 18 | /// The physical device reported an error while attempting the operation. | 24 | /// The physical device reported an error while attempting the operation. |
| 19 | pub const device_error: usize = high_bit | 7; | 25 | pub const device_error: usize = high_bit | 7; |
| 26 | |||
| 20 | /// The device cannot be written to. | 27 | /// The device cannot be written to. |
| 21 | pub const write_protected: usize = high_bit | 8; | 28 | pub const write_protected: usize = high_bit | 8; |
| 29 | |||
| 22 | /// A resource has run out. | 30 | /// A resource has run out. |
| 23 | pub const out_of_resources: usize = high_bit | 9; | 31 | pub const out_of_resources: usize = high_bit | 9; |
| 32 | |||
| 24 | /// An inconstancy was detected on the file system causing the operating to fail. | 33 | /// An inconstancy was detected on the file system causing the operating to fail. |
| 25 | pub const volume_corrupted: usize = high_bit | 10; | 34 | pub const volume_corrupted: usize = high_bit | 10; |
| 35 | |||
| 26 | /// There is no more space on the file system. | 36 | /// There is no more space on the file system. |
| 27 | pub const volume_full: usize = high_bit | 11; | 37 | pub const volume_full: usize = high_bit | 11; |
| 38 | |||
| 28 | /// The device does not contain any medium to perform the operation. | 39 | /// The device does not contain any medium to perform the operation. |
| 29 | pub const no_media: usize = high_bit | 12; | 40 | pub const no_media: usize = high_bit | 12; |
| 41 | |||
| 30 | /// The medium in the device has changed since the last access. | 42 | /// The medium in the device has changed since the last access. |
| 31 | pub const media_changed: usize = high_bit | 13; | 43 | pub const media_changed: usize = high_bit | 13; |
| 44 | |||
| 32 | /// The item was not found. | 45 | /// The item was not found. |
| 33 | pub const not_found: usize = high_bit | 14; | 46 | pub const not_found: usize = high_bit | 14; |
| 47 | |||
| 34 | /// Access was denied. | 48 | /// Access was denied. |
| 35 | pub const access_denied: usize = high_bit | 15; | 49 | pub const access_denied: usize = high_bit | 15; |
| 50 | |||
| 36 | /// The server was not found or did not respond to the request. | 51 | /// The server was not found or did not respond to the request. |
| 37 | pub const no_response: usize = high_bit | 16; | 52 | pub const no_response: usize = high_bit | 16; |
| 53 | |||
| 38 | /// A mapping to a device does not exist. | 54 | /// A mapping to a device does not exist. |
| 39 | pub const no_mapping: usize = high_bit | 17; | 55 | pub const no_mapping: usize = high_bit | 17; |
| 56 | |||
| 40 | /// The timeout time expired. | 57 | /// The timeout time expired. |
| 41 | pub const timeout: usize = high_bit | 18; | 58 | pub const timeout: usize = high_bit | 18; |
| 59 | |||
| 42 | /// The protocol has not been started. | 60 | /// The protocol has not been started. |
| 43 | pub const not_started: usize = high_bit | 19; | 61 | pub const not_started: usize = high_bit | 19; |
| 62 | |||
| 44 | /// The protocol has already been started. | 63 | /// The protocol has already been started. |
| 45 | pub const already_started: usize = high_bit | 20; | 64 | pub const already_started: usize = high_bit | 20; |
| 65 | |||
| 46 | /// The operation was aborted. | 66 | /// The operation was aborted. |
| 47 | pub const aborted: usize = high_bit | 21; | 67 | pub const aborted: usize = high_bit | 21; |
| 68 | |||
| 48 | /// An ICMP error occurred during the network operation. | 69 | /// An ICMP error occurred during the network operation. |
| 49 | pub const icmp_error: usize = high_bit | 22; | 70 | pub const icmp_error: usize = high_bit | 22; |
| 71 | |||
| 50 | /// A TFTP error occurred during the network operation. | 72 | /// A TFTP error occurred during the network operation. |
| 51 | pub const tftp_error: usize = high_bit | 23; | 73 | pub const tftp_error: usize = high_bit | 23; |
| 74 | |||
| 52 | /// A protocol error occurred during the network operation. | 75 | /// A protocol error occurred during the network operation. |
| 53 | pub const protocol_error: usize = high_bit | 24; | 76 | pub const protocol_error: usize = high_bit | 24; |
| 77 | |||
| 54 | /// The function encountered an internal version that was incompatible with a version requested by the caller. | 78 | /// The function encountered an internal version that was incompatible with a version requested by the caller. |
| 55 | pub const incompatible_version: usize = high_bit | 25; | 79 | pub const incompatible_version: usize = high_bit | 25; |
| 80 | |||
| 56 | /// The function was not performed due to a security violation. | 81 | /// The function was not performed due to a security violation. |
| 57 | pub const security_violation: usize = high_bit | 26; | 82 | pub const security_violation: usize = high_bit | 26; |
| 83 | |||
| 58 | /// A CRC error was detected. | 84 | /// A CRC error was detected. |
| 59 | pub const crc_error: usize = high_bit | 27; | 85 | pub const crc_error: usize = high_bit | 27; |
| 86 | |||
| 60 | /// Beginning or end of media was reached | 87 | /// Beginning or end of media was reached |
| 61 | pub const end_of_media: usize = high_bit | 28; | 88 | pub const end_of_media: usize = high_bit | 28; |
| 89 | |||
| 62 | /// The end of the file was reached. | 90 | /// The end of the file was reached. |
| 63 | pub const end_of_file: usize = high_bit | 31; | 91 | pub const end_of_file: usize = high_bit | 31; |
| 92 | |||
| 64 | /// The language specified was invalid. | 93 | /// The language specified was invalid. |
| 65 | pub const invalid_language: usize = high_bit | 32; | 94 | pub const invalid_language: usize = high_bit | 32; |
| 95 | |||
| 66 | /// The security status of the data is unknown or compromised and the data must be updated or replaced to restore a valid security status. | 96 | /// The security status of the data is unknown or compromised and the data must be updated or replaced to restore a valid security status. |
| 67 | pub const compromised_data: usize = high_bit | 33; | 97 | pub const compromised_data: usize = high_bit | 33; |
| 98 | |||
| 68 | /// There is an address conflict address allocation | 99 | /// There is an address conflict address allocation |
| 69 | pub const ip_address_conflict: usize = high_bit | 34; | 100 | pub const ip_address_conflict: usize = high_bit | 34; |
| 101 | |||
| 70 | /// A HTTP error occurred during the network operation. | 102 | /// A HTTP error occurred during the network operation. |
| 71 | pub const http_error: usize = high_bit | 35; | 103 | pub const http_error: usize = high_bit | 35; |
| 72 | 104 | ||
| 73 | /// The string contained one or more characters that the device could not render and were skipped. | 105 | /// The string contained one or more characters that the device could not render and were skipped. |
| 74 | pub const warn_unknown_glyph: usize = 1; | 106 | pub const warn_unknown_glyph: usize = 1; |
| 107 | |||
| 75 | /// The handle was closed, but the file was not deleted. | 108 | /// The handle was closed, but the file was not deleted. |
| 76 | pub const warn_delete_failure: usize = 2; | 109 | pub const warn_delete_failure: usize = 2; |
| 110 | |||
| 77 | /// The handle was closed, but the data to the file was not flushed properly. | 111 | /// The handle was closed, but the data to the file was not flushed properly. |
| 78 | pub const warn_write_failure: usize = 3; | 112 | pub const warn_write_failure: usize = 3; |
| 113 | |||
| 79 | /// The resulting buffer was too small, and the data was truncated to the buffer size. | 114 | /// The resulting buffer was too small, and the data was truncated to the buffer size. |
| 80 | pub const warn_buffer_too_small: usize = 4; | 115 | pub const warn_buffer_too_small: usize = 4; |
| 116 | |||
| 81 | /// The data has not been updated within the timeframe set by localpolicy for this type of data. | 117 | /// The data has not been updated within the timeframe set by localpolicy for this type of data. |
| 82 | pub const warn_stale_data: usize = 5; | 118 | pub const warn_stale_data: usize = 5; |
| 119 | |||
| 83 | /// The resulting buffer contains UEFI-compliant file system. | 120 | /// The resulting buffer contains UEFI-compliant file system. |
| 84 | pub const warn_file_system: usize = 6; | 121 | pub const warn_file_system: usize = 6; |
| 122 | |||
| 85 | /// The operation will be processed across a system reset. | 123 | /// The operation will be processed across a system reset. |
| 86 | pub const warn_reset_required: usize = 7; | 124 | pub const warn_reset_required: usize = 7; |
lib/std/os/uefi/tables/table_header.zig+1| ... | @@ -1,6 +1,7 @@ | ... | @@ -1,6 +1,7 @@ |
| 1 | pub const TableHeader = extern struct { | 1 | pub const TableHeader = extern struct { |
| 2 | signature: u64, | 2 | signature: u64, |
| 3 | revision: u32, | 3 | revision: u32, |
| 4 | |||
| 4 | /// The size, in bytes, of the entire table including the TableHeader | 5 | /// The size, in bytes, of the entire table including the TableHeader |
| 5 | header_size: u32, | 6 | header_size: u32, |
| 6 | crc32: u32, | 7 | crc32: u32, |
lib/std/os/windows.zig+2-3| ... | @@ -192,7 +192,7 @@ pub const FindFirstFileError = error{ | ... | @@ -192,7 +192,7 @@ pub const FindFirstFileError = error{ |
| 192 | }; | 192 | }; |
| 193 | 193 | ||
| 194 | pub fn FindFirstFile(dir_path: []const u8, find_file_data: *WIN32_FIND_DATAW) FindFirstFileError!HANDLE { | 194 | pub fn FindFirstFile(dir_path: []const u8, find_file_data: *WIN32_FIND_DATAW) FindFirstFileError!HANDLE { |
| 195 | const dir_path_w = try sliceToPrefixedSuffixedFileW(dir_path, [_]u16{ '\\', '*'}); | 195 | const dir_path_w = try sliceToPrefixedSuffixedFileW(dir_path, [_]u16{ '\\', '*' }); |
| 196 | const handle = kernel32.FindFirstFileW(&dir_path_w, find_file_data); | 196 | const handle = kernel32.FindFirstFileW(&dir_path_w, find_file_data); |
| 197 | 197 | ||
| 198 | if (handle == INVALID_HANDLE_VALUE) { | 198 | if (handle == INVALID_HANDLE_VALUE) { |
| ... | @@ -932,7 +932,7 @@ pub fn wToPrefixedFileW(s: []const u16) ![PATH_MAX_WIDE:0]u16 { | ... | @@ -932,7 +932,7 @@ pub fn wToPrefixedFileW(s: []const u16) ![PATH_MAX_WIDE:0]u16 { |
| 932 | // TODO https://github.com/ziglang/zig/issues/2765 | 932 | // TODO https://github.com/ziglang/zig/issues/2765 |
| 933 | var result: [PATH_MAX_WIDE:0]u16 = undefined; | 933 | var result: [PATH_MAX_WIDE:0]u16 = undefined; |
| 934 | 934 | ||
| 935 | const start_index = if (mem.startsWith(u16, s, [_]u16{'\\', '?'})) 0 else blk: { | 935 | const start_index = if (mem.startsWith(u16, s, [_]u16{ '\\', '?' })) 0 else blk: { |
| 936 | const prefix = [_]u16{ '\\', '?', '?', '\\' }; | 936 | const prefix = [_]u16{ '\\', '?', '?', '\\' }; |
| 937 | mem.copy(u16, result[0..], prefix); | 937 | mem.copy(u16, result[0..], prefix); |
| 938 | break :blk prefix.len; | 938 | break :blk prefix.len; |
| ... | @@ -942,7 +942,6 @@ pub fn wToPrefixedFileW(s: []const u16) ![PATH_MAX_WIDE:0]u16 { | ... | @@ -942,7 +942,6 @@ pub fn wToPrefixedFileW(s: []const u16) ![PATH_MAX_WIDE:0]u16 { |
| 942 | mem.copy(u16, result[start_index..], s); | 942 | mem.copy(u16, result[start_index..], s); |
| 943 | result[end_index] = 0; | 943 | result[end_index] = 0; |
| 944 | return result; | 944 | return result; |
| 945 | |||
| 946 | } | 945 | } |
| 947 | 946 | ||
| 948 | pub fn sliceToPrefixedSuffixedFileW(s: []const u8, comptime suffix: []const u16) ![PATH_MAX_WIDE + suffix.len:0]u16 { | 947 | pub fn sliceToPrefixedSuffixedFileW(s: []const u8, comptime suffix: []const u16) ![PATH_MAX_WIDE + suffix.len:0]u16 { |
lib/std/os/windows/ws2_32.zig+3-7| ... | @@ -106,12 +106,7 @@ pub const WSAOVERLAPPED = extern struct { | ... | @@ -106,12 +106,7 @@ pub const WSAOVERLAPPED = extern struct { |
| 106 | hEvent: ?WSAEVENT, | 106 | hEvent: ?WSAEVENT, |
| 107 | }; | 107 | }; |
| 108 | 108 | ||
| 109 | pub const WSAOVERLAPPED_COMPLETION_ROUTINE = extern fn ( | 109 | pub const WSAOVERLAPPED_COMPLETION_ROUTINE = extern fn (dwError: DWORD, cbTransferred: DWORD, lpOverlapped: *WSAOVERLAPPED, dwFlags: DWORD) void; |
| 110 | dwError: DWORD, | ||
| 111 | cbTransferred: DWORD, | ||
| 112 | lpOverlapped: *WSAOVERLAPPED, | ||
| 113 | dwFlags: DWORD | ||
| 114 | ) void; | ||
| 115 | 110 | ||
| 116 | pub const WSA_INVALID_HANDLE = 6; | 111 | pub const WSA_INVALID_HANDLE = 6; |
| 117 | pub const WSA_NOT_ENOUGH_MEMORY = 8; | 112 | pub const WSA_NOT_ENOUGH_MEMORY = 8; |
| ... | @@ -209,11 +204,12 @@ pub const WSA_QOS_ESDMODEOBJ = 11029; | ... | @@ -209,11 +204,12 @@ pub const WSA_QOS_ESDMODEOBJ = 11029; |
| 209 | pub const WSA_QOS_ESHAPERATEOBJ = 11030; | 204 | pub const WSA_QOS_ESHAPERATEOBJ = 11030; |
| 210 | pub const WSA_QOS_RESERVED_PETYPE = 11031; | 205 | pub const WSA_QOS_RESERVED_PETYPE = 11031; |
| 211 | 206 | ||
| 212 | |||
| 213 | /// no parameters | 207 | /// no parameters |
| 214 | const IOC_VOID = 0x80000000; | 208 | const IOC_VOID = 0x80000000; |
| 209 | |||
| 215 | /// copy out parameters | 210 | /// copy out parameters |
| 216 | const IOC_OUT = 0x40000000; | 211 | const IOC_OUT = 0x40000000; |
| 212 | |||
| 217 | /// copy in parameters | 213 | /// copy in parameters |
| 218 | const IOC_IN = 0x80000000; | 214 | const IOC_IN = 0x80000000; |
| 219 | 215 |