|
|
|
@ -2,14 +2,24 @@
|
|
|
|
|
module Kernel
|
|
|
|
|
def puts(*a)
|
|
|
|
|
a.flatten.each { |l|
|
|
|
|
|
DFHack.print_str(l.to_s.chomp + "\n")
|
|
|
|
|
# XXX looks like print_str crashes with strings longer than 4096... maybe not nullterminated ?
|
|
|
|
|
# this workaround fixes it
|
|
|
|
|
s = l.to_s.chomp + "\n"
|
|
|
|
|
while s.length > 0
|
|
|
|
|
DFHack.print_str(s[0, 4000])
|
|
|
|
|
s[0, 4000] = ''
|
|
|
|
|
end
|
|
|
|
|
}
|
|
|
|
|
nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def puts_err(*a)
|
|
|
|
|
a.flatten.each { |l|
|
|
|
|
|
DFHack.print_err(l.to_s.chomp + "\n")
|
|
|
|
|
s = l.to_s.chomp + "\n"
|
|
|
|
|
while s.length > 0
|
|
|
|
|
DFHack.print_err(s[0, 4000])
|
|
|
|
|
s[0, 4000] = ''
|
|
|
|
|
end
|
|
|
|
|
}
|
|
|
|
|
nil
|
|
|
|
|
end
|
|
|
|
|