| ... | ... | @@ -11,7 +11,7 @@ const linux = std.os.linux; |
| 11 | 11 | const windows = std.os.windows; |
| 12 | 12 | |
| 13 | 13 | io: Io, |
| 14 | | file: std.Io.File, |
| 14 | file: Io.File, |
| 15 | 15 | flags: packed struct { |
| 16 | 16 | block_size: std.mem.Alignment, |
| 17 | 17 | copy_file_range_unsupported: bool, |
| ... | ... | @@ -29,7 +29,7 @@ writers: std.SinglyLinkedList, |
| 29 | 29 | |
| 30 | 30 | pub const growth_factor = 4; |
| 31 | 31 | |
| 32 | | pub const Error = std.posix.MMapError || std.posix.MRemapError || Io.File.LengthError || error{ |
| 32 | pub const Error = Io.File.MemoryMap.CreateError || Io.File.LengthError || error{ |
| 33 | 33 | NotFile, |
| 34 | 34 | SystemResources, |
| 35 | 35 | IsDir, |
| ... | ... | @@ -42,7 +42,7 @@ pub const Error = std.posix.MMapError || std.posix.MRemapError || Io.File.Length |
| 42 | 42 | NonResizable, |
| 43 | 43 | }; |
| 44 | 44 | |
| 45 | | pub fn init(file: std.Io.File, gpa: std.mem.Allocator, io: Io) !MappedFile { |
| 45 | pub fn init(file: Io.File, gpa: std.mem.Allocator, io: Io) !MappedFile { |
| 46 | 46 | var mf: MappedFile = .{ |
| 47 | 47 | .io = io, |
| 48 | 48 | .file = file, |
| ... | ... | @@ -396,7 +396,7 @@ pub const Node = extern struct { |
| 396 | 396 | mf: *MappedFile, |
| 397 | 397 | writer_node: std.SinglyLinkedList.Node, |
| 398 | 398 | ni: Node.Index, |
| 399 | | interface: std.Io.Writer, |
| 399 | interface: Io.Writer, |
| 400 | 400 | err: ?Error, |
| 401 | 401 | |
| 402 | 402 | pub fn deinit(w: *Writer) void { |
| ... | ... | @@ -404,18 +404,18 @@ pub const Node = extern struct { |
| 404 | 404 | w.* = undefined; |
| 405 | 405 | } |
| 406 | 406 | |
| 407 | | const vtable: std.Io.Writer.VTable = .{ |
| 407 | const vtable: Io.Writer.VTable = .{ |
| 408 | 408 | .drain = drain, |
| 409 | 409 | .sendFile = sendFile, |
| 410 | | .flush = std.Io.Writer.noopFlush, |
| 410 | .flush = Io.Writer.noopFlush, |
| 411 | 411 | .rebase = growingRebase, |
| 412 | 412 | }; |
| 413 | 413 | |
| 414 | 414 | fn drain( |
| 415 | | interface: *std.Io.Writer, |
| 415 | interface: *Io.Writer, |
| 416 | 416 | data: []const []const u8, |
| 417 | 417 | splat: usize, |
| 418 | | ) std.Io.Writer.Error!usize { |
| 418 | ) Io.Writer.Error!usize { |
| 419 | 419 | const pattern = data[data.len - 1]; |
| 420 | 420 | const splat_len = pattern.len * splat; |
| 421 | 421 | const start_len = interface.end; |
| ... | ... | @@ -442,10 +442,10 @@ pub const Node = extern struct { |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | 444 | fn sendFile( |
| 445 | | interface: *std.Io.Writer, |
| 446 | | file_reader: *std.Io.File.Reader, |
| 447 | | limit: std.Io.Limit, |
| 448 | | ) std.Io.Writer.FileError!usize { |
| 445 | interface: *Io.Writer, |
| 446 | file_reader: *Io.File.Reader, |
| 447 | limit: Io.Limit, |
| 448 | ) Io.Writer.FileError!usize { |
| 449 | 449 | if (limit == .nothing) return 0; |
| 450 | 450 | const pos = file_reader.logicalPos(); |
| 451 | 451 | const additional = if (file_reader.getSize()) |size| size - pos else |_| std.atomic.cache_line; |
| ... | ... | @@ -489,10 +489,10 @@ pub const Node = extern struct { |
| 489 | 489 | } |
| 490 | 490 | |
| 491 | 491 | fn growingRebase( |
| 492 | | interface: *std.Io.Writer, |
| 492 | interface: *Io.Writer, |
| 493 | 493 | preserve: usize, |
| 494 | 494 | unused_capacity: usize, |
| 495 | | ) std.Io.Writer.Error!void { |
| 495 | ) Io.Writer.Error!void { |
| 496 | 496 | _ = preserve; |
| 497 | 497 | const total_capacity = interface.end + unused_capacity; |
| 498 | 498 | if (interface.buffer.len >= total_capacity) return; |
| ... | ... | @@ -941,7 +941,7 @@ fn copyRange(mf: *MappedFile, old_file_offset: u64, new_file_offset: u64, size: |
| 941 | 941 | |
| 942 | 942 | fn copyFileRange( |
| 943 | 943 | mf: *MappedFile, |
| 944 | | old_file: std.Io.File, |
| 944 | old_file: Io.File, |
| 945 | 945 | old_file_offset: u64, |
| 946 | 946 | new_file_offset: u64, |
| 947 | 947 | size: u64, |