Permalink
Browse files

stdhandle is gone

  • Loading branch information...
1 parent 0c13a6d commit ccfbd58a93573d41841b6339bbdba844b099aa05 @fperrad committed Nov 10, 2010
Showing with 6 additions and 15 deletions.
  1. +1 −3 lua/lib/luaaux.pir
  2. +2 −5 lua/lib/luadebug.pir
  3. +3 −7 lua/lib/luaio.pir
View
4 lua/lib/luaaux.pir
@@ -673,7 +673,6 @@ This function only loads the chunk; it does not run it.
=cut
.include 'stat.pasm'
-.include 'stdio.pasm'
.sub 'lua_loadfile'
.param string filename
@@ -683,8 +682,7 @@ This function only loads the chunk; it does not run it.
.local pmc f
unless filename == '' goto L1
chunkname = '=stdin'
- $P0 = getinterp
- f = $P0.'stdhandle'(.PIO_STDIN_FILENO)
+ f = getstdin
goto L2
L1:
chunkname = filename
View
7 lua/lib/luadebug.pir
@@ -75,15 +75,12 @@ function, and so have no direct access to local variables.
=cut
-.include 'stdio.pasm'
-
.sub 'debug'
.param pmc extra :slurpy
.local string buffer
.local pmc stdin, stderr
- $P0 = getinterp
- stdin = $P0.'stdhandle'(.PIO_STDIN_FILENO)
- stderr = $P0.'stdhandle'(.PIO_STDERR_FILENO)
+ stdin = getstdin
+ stderr = getstderr
L1:
print stderr, 'lua_debug> '
buffer = readline stdin
View
10 lua/lib/luaio.pir
@@ -98,7 +98,6 @@ LIST
.const int IO_INPUT = 1
.const int IO_OUTPUT = 2
-.include 'stdio.pasm'
.sub 'createstdfiles' :anon
.param pmc mt
@@ -110,27 +109,24 @@ LIST
new $P1, 'LuaString'
new $P3, 'LuaNumber'
- .local pmc interp
- interp = getinterp
-
set $P1, 'stdin'
- $P2 = interp.'stdhandle'(.PIO_STDIN_FILENO)
+ $P2 = getstdin
$P0 = lua_newuserdata($P2, mt)
$P0.'setfenv'(env)
io[$P1] = $P0
set $P3, IO_INPUT
io_env[$P3] = $P0
set $P1, 'stdout'
- $P2 = interp.'stdhandle'(.PIO_STDOUT_FILENO)
+ $P2 = getstdout
$P0 = lua_newuserdata($P2, mt)
$P0.'setfenv'(env)
io[$P1] = $P0
set $P3, IO_OUTPUT
io_env[$P3] = $P0
set $P1, 'stderr'
- $P2 = interp.'stdhandle'(.PIO_STDERR_FILENO)
+ $P2 = getstderr
$P0 = lua_newuserdata($P2, mt)
$P0.'setfenv'(env)
io[$P1] = $P0

0 comments on commit ccfbd58

Please sign in to comment.