[svn:parrot] r39224 - in trunk: docs/book src/ops

NotFound at svn.parrot.org NotFound at svn.parrot.org
Thu May 28 18:29:45 UTC 2009


Author: NotFound
Date: Thu May 28 18:29:44 2009
New Revision: 39224
URL: https://trac.parrot.org/parrot/changeset/39224

Log:
[io] implement setstdin opcode, TT #680, flh++

Modified:
   trunk/docs/book/ch10_opcode_reference.pod
   trunk/src/ops/io.ops
   trunk/src/ops/ops.num

Modified: trunk/docs/book/ch10_opcode_reference.pod
==============================================================================
--- trunk/docs/book/ch10_opcode_reference.pod	Thu May 28 17:33:38 2009	(r39223)
+++ trunk/docs/book/ch10_opcode_reference.pod	Thu May 28 18:29:44 2009	(r39224)
@@ -2234,12 +2234,12 @@
 =head3 setstd*
 
 X<setstderr opcode (PASM)>
-X<setstdout opcode (PASM)>
 X<setstdin  opcode (PASM)>
+X<setstdout opcode (PASM)>
 
   setstderr R<DEST>
-  setstdout R<DEST>
   setstdin  R<DEST>
+  setstdout R<DEST>
 
 Set a FileHandle object for the given standard handle.
 

Modified: trunk/src/ops/io.ops
==============================================================================
--- trunk/src/ops/io.ops	Thu May 28 17:33:38 2009	(r39223)
+++ trunk/src/ops/io.ops	Thu May 28 18:29:44 2009	(r39224)
@@ -90,19 +90,27 @@
 
 #########################################
 
+=item B<setstdin>(invar PMC) 
+
+Sets the standard input for a bare C<read> op to go to the supplied PMC.
+Call C<getstdin> first if you care about retaining the previous PMC.
+
 =item B<setstdout>(invar PMC)
 
-Sets the standard output for a bare C<print> op to go to the supplied ParrotIO
-PMC.  Call C<getstdout> first if you care about retaining the previous PMC.
+Sets the standard output for a bare C<print> op to go to the supplied PMC.
+Call C<getstdout> first if you care about retaining the previous PMC.
 
 =item B<setstderr>(invar PMC)
 
-Sets the standard error for a bare C<printerr> op to go to the supplied
-ParrotIO PMC.  Call C<getstderr> first if you care about retaining the previous
-PMC.
+Sets the standard error for a bare C<printerr> op to go to the supplied PMC.
+Call C<getstderr> first if you care about retaining the previous PMC.
 
 =cut
 
+inline op setstdin(invar PMC) :base_io {
+        _PIO_STDIN(interp) = $1;
+}
+
 inline op setstdout(invar PMC) :base_io {
         _PIO_STDOUT(interp) = $1;
 }

Modified: trunk/src/ops/ops.num
==============================================================================
--- trunk/src/ops/ops.num	Thu May 28 17:33:38 2009	(r39223)
+++ trunk/src/ops/ops.num	Thu May 28 18:29:44 2009	(r39224)
@@ -1276,3 +1276,4 @@
 find_name_p_sc                 1252
 find_sub_not_null_p_s          1253
 find_sub_not_null_p_sc         1254
+setstdin_p                     1255


More information about the parrot-commits mailing list