blob: 86dac7bd7551163ac0e4d7af443bd91b71a6edbd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
fn read-lines in: (addr buffered-file), out: (addr handle array (handle array byte)) {
var stream: (stream (handle array byte) 0x10)
var stream-a/edi: (addr stream (handle array byte)) <- address stream
var line: (stream byte 0x10)
var line-a/esi: (addr stream byte) <- address line
{
clear-stream line-a
read-line-buffered in, line-a
var done?/eax: boolean <- stream-empty? line-a
compare done?, 0/false
break-if-!=
#? print-string 0, "AAA\n"
var h: (handle array byte)
var ah/eax: (addr handle array byte) <- address h
stream-to-array line-a, ah
write-to-stream stream-a, ah
loop
}
stream-to-array stream-a, out
}
|