about summary refs log tree commit diff stats
path: root/400.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-05-19 23:14:27 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-05-19 23:14:27 -0700
commit4b57c101b71727aa718216b90f7a255bab2427c6 (patch)
tree594f24a2cdcd9d9a2c012bdaa704093e92453c43 /400.mu
parente2ab1b30b1a669425cb86ffa7def9529e7fa4fb1 (diff)
downloadmu-4b57c101b71727aa718216b90f7a255bab2427c6.tar.gz
more robust print-cell
It is used to print to the trace, and we shouldn't crash the whole computer
just because the trace ran out of space.
Diffstat (limited to '400.mu')
-rw-r--r--400.mu4
1 files changed, 4 insertions, 0 deletions
diff --git a/400.mu b/400.mu
index 94e517f8..3b81d44a 100644
--- a/400.mu
+++ b/400.mu
@@ -43,6 +43,10 @@ sig check-stream-equal f: (addr stream byte), s: (addr array byte), msg: (addr a
 sig next-stream-line-equal? f: (addr stream byte), s: (addr array byte) -> _/eax: boolean
 sig check-next-stream-line-equal f: (addr stream byte), s: (addr array byte), msg: (addr array byte)
 sig write f: (addr stream byte), s: (addr array byte)
+sig try-write f: (addr stream byte), s: (addr array byte) -> _/eax: boolean
+# probably a bad idea; I definitely want to discourage its use for streams of non-bytes
+sig stream-size f: (addr stream byte) -> _/eax: int
+sig space-remaining-in-stream f: (addr stream byte) -> _/eax: int
 sig write-stream f: (addr stream byte), s: (addr stream byte)
 sig read-byte s: (addr stream byte) -> _/eax: byte
 sig append-byte f: (addr stream byte), n: int  # really just a byte, but I want to pass in literal numbers