about summary refs log tree commit diff stats
path: root/src/io
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-10-22 00:03:59 +0200
committerbptato <nincsnevem662@gmail.com>2023-10-22 00:03:59 +0200
commit3ad5bb50b0c419062ae0eb019e6f104c6aea2bb8 (patch)
treea099b9d4aaf18ef31c18ee436adaeb7bd32c021e /src/io
parente4bcec7dce3924236039aafab56dc609ddf4e6a6 (diff)
downloadchawan-3ad5bb50b0c419062ae0eb019e6f104c6aea2bb8.tar.gz
Remove runestream
unused
Diffstat (limited to 'src/io')
-rw-r--r--src/io/runestream.nim31
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
-  )