perl.cvs.parrot
[Top] [All Lists]

[svn:parrot] r29517 - in branches/remove_getfd: src/pmc t/pmc

Subject: [svn:parrot] r29517 - in branches/remove_getfd: src/pmc t/pmc
From:
Date: Wed, 16 Jul 2008 06:53:40 -0700 PDT
Newsgroups: perl.cvs.parrot

Author: bernhard
Date: Wed Jul 16 06:53:36 2008
New Revision: 29517

Modified:
   branches/remove_getfd/src/pmc/parrotio.pmc
   branches/remove_getfd/t/pmc/io.t

Log:
#48312: [TODO] add get_fd method to ParrotIO
Add the method get_fd(), take code from the implemention 
of the removed opcode 'getfd'.


Modified: branches/remove_getfd/src/pmc/parrotio.pmc
==============================================================================
--- branches/remove_getfd/src/pmc/parrotio.pmc  (original)
+++ branches/remove_getfd/src/pmc/parrotio.pmc  Wed Jul 16 06:53:36 2008
@@ -8,7 +8,7 @@
 
 =head1 DESCRIPTION
 
-These are the vtable functions for Parrot IO.
+These are the vtable functions and methods for Parrot IO.
 
 =head2 Methods
 
@@ -323,10 +323,6 @@
 
 /*
 
-=item C<void class_init()>
-
-Class initialization.
-
 =item C<METHOD eof()>
 
 Returns true or false according to the end of file state of the object.
@@ -343,7 +339,7 @@
 
 RT#46089 TBD
 
-=item C<METHOD get_fd()>
+=item C<METHOD INTVAL get_fd()>
 
 Get the file descriptor out of the ParrotIO object.
 
@@ -351,12 +347,20 @@
 RT#42373: integral file descriptors might not exist outside of the UNIX
      platform.
 
-The removed opcode getfd has following implementation:
+=cut
 
-    inline op getfd(out INT, invar PMC) :advanced_io :deprecated {
-      $1 = (INTVAL)PIO_getfd(interp, $2);
+*/
 
-This might help in implementing the method get_fd().
+    METHOD get_fd() {  
+         const INTVAL r = PIO_getfd(INTERP, SELF);
+         RETURN(INTVAL r); 
+    }
+
+/*
+
+=item C<void class_init()>
+
+Class initialization.
 
 =cut
 

Modified: branches/remove_getfd/t/pmc/io.t
==============================================================================
--- branches/remove_getfd/t/pmc/io.t    (original)
+++ branches/remove_getfd/t/pmc/io.t    Wed Jul 16 06:53:36 2008
@@ -113,7 +113,7 @@
 OUTPUT
 
 # RT#46843
-pir_output_is( <<'CODE', <<'OUTPUT', "get_fd()/fdopen", todo => 'get_fd() not 
implemented yet' );
+pir_output_is( <<'CODE', <<'OUTPUT', "get_fd()/fdopen" );
 .sub main :main
     getstdout P0
     I0 = P0.get_fd()
@@ -131,7 +131,7 @@
 OUTPUT
 
 # RT#46843
-pir_output_is( <<'CODE', <<'OUTPUT', 'fdopen - no close', todo => 'get_fd() 
not implemented yet' );
+pir_output_is( <<'CODE', <<'OUTPUT', 'fdopen - no close' );
 .sub main :main
     getstdout P0
     I0 = P0.get_fd()
@@ -460,7 +460,7 @@
 unlink("temp.file");
 
 # RT#46843
-pir_output_is( <<'CODE', <<'OUT', 'standard file descriptors', todo => 
'get_fd() not implemented yet' );
+pir_output_is( <<'CODE', <<'OUT', 'standard file descriptors' );
 .sub main :main
        getstdin P0
        I0 = P0.get_fd()

<Prev in Thread] Current Thread [Next in Thread>
  • [svn:parrot] r29517 - in branches/remove_getfd: src/pmc t/pmc, bernhard <=