| ... | ... | @@ -371,21 +371,21 @@ pub const Elf = struct { |
| 371 | 371 | prealloc_file: File, |
| 372 | 372 | |
| 373 | 373 | /// Call close when done. |
| 374 | | pub fn openPath(elf: *Elf, allocator: *mem.Allocator, path: []const u8) !void { |
| 374 | pub fn openPath(allocator: *mem.Allocator, path: []const u8) !Elf { |
| 375 | 375 | @compileError("TODO implement"); |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | /// Call close when done. |
| 379 | | pub fn openFile(elf: *Elf, allocator: *mem.Allocator, file: File) !void { |
| 379 | pub fn openFile(allocator: *mem.Allocator, file: File) !Elf { |
| 380 | 380 | @compileError("TODO implement"); |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | pub fn openStream( |
| 384 | | elf: *Elf, |
| 385 | 384 | allocator: *mem.Allocator, |
| 386 | 385 | seekable_stream: *io.SeekableStream(anyerror, anyerror), |
| 387 | 386 | in: *io.InStream(anyerror), |
| 388 | | ) !void { |
| 387 | ) !Elf { |
| 388 | var elf: Elf = undefined; |
| 389 | 389 | elf.auto_close_stream = false; |
| 390 | 390 | elf.allocator = allocator; |
| 391 | 391 | elf.seekable_stream = seekable_stream; |
| ... | ... | @@ -523,6 +523,8 @@ pub const Elf = struct { |
| 523 | 523 | // not a string table |
| 524 | 524 | return error.InvalidFormat; |
| 525 | 525 | } |
| 526 | |
| 527 | return elf; |
| 526 | 528 | } |
| 527 | 529 | |
| 528 | 530 | pub fn close(elf: *Elf) void { |