diff options
| author | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2024-08-18 23:39:14 -0400 |
|---|---|---|
| committer | Laytan <laytanlaats@hotmail.com> | 2024-08-28 19:53:20 +0200 |
| commit | d66486c17e55261d33b2a3ee9e7c6b68656a9ef2 (patch) | |
| tree | f79e907318e413f3d1f1f6724ba68141a0588e40 /core | |
| parent | 981a2e1a0097ebd2e3237f5693cf8d929c6a8ca9 (diff) | |
Make `io.Section_Reader` set `base` too
This should fix seeking from `.Start`, getting the `size`, and
`read_at`.
Also make the API consistent with the other `*_init` procs in
`util.odin` by returning the `io.Reader`.
Diffstat (limited to 'core')
| -rw-r--r-- | core/io/util.odin | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/io/util.odin b/core/io/util.odin index c24eb99c5..27c344890 100644 --- a/core/io/util.odin +++ b/core/io/util.odin @@ -376,11 +376,12 @@ Section_Reader :: struct { limit: i64, } -section_reader_init :: proc(s: ^Section_Reader, r: Reader_At, off: i64, n: i64) { +section_reader_init :: proc(s: ^Section_Reader, r: Reader_At, off: i64, n: i64) -> Reader { s.r = r + s.base = off s.off = off s.limit = off + n - return + return section_reader_to_stream(s) } section_reader_to_stream :: proc(s: ^Section_Reader) -> (out: Stream) { out.data = s |