diff options
author | bptato <nincsnevem662@gmail.com> | 2023-10-22 00:03:59 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-10-22 00:03:59 +0200 |
commit | 3ad5bb50b0c419062ae0eb019e6f104c6aea2bb8 (patch) | |
tree | a099b9d4aaf18ef31c18ee436adaeb7bd32c021e /src/io | |
parent | e4bcec7dce3924236039aafab56dc609ddf4e6a6 (diff) | |
download | chawan-3ad5bb50b0c419062ae0eb019e6f104c6aea2bb8.tar.gz |
Remove runestream
unused
Diffstat (limited to 'src/io')
-rw-r--r-- | src/io/runestream.nim | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/io/runestream.nim b/src/io/runestream.nim deleted file mode 100644 index 6facda91..00000000 --- a/src/io/runestream.nim +++ /dev/null @@ -1,31 +0,0 @@ -import streams - -type RuneStream* = ref object of Stream - at: int # index in u32 (i.e. position * 4) - source: seq[uint32] - -proc runeClose(s: Stream) = - let s = cast[RuneStream](s) - s.source.setLen(0) - -proc runeReadData(s: Stream, buffer: pointer, bufLen: int): int = - let s = cast[RuneStream](s) - let L = min(bufLen, s.source.len - s.at) - if s.source.len == s.at: - return - copyMem(buffer, addr s.source[s.at], L * sizeof(uint32)) - s.at += L - assert s.at <= s.source.len - return L * sizeof(uint32) - -proc runeAtEnd(s: Stream): bool = - let s = cast[RuneStream](s) - return s.at == s.source.len - -proc newRuneStream*(source: openarray[uint32]): RuneStream = - return RuneStream( - source: @source, - closeImpl: runeClose, - readDataImpl: runeReadData, - atEndImpl: runeAtEnd - ) |