develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r33695 - in trunk: . compilers/imcc compilers/pct/src/PCT config/gen/makefiles docs docs/pdds include/parrot languages/WMLScript/src languages/lua languages/lua/src/lib languages/perl6/src/classes src src/dynoplibs src/gc src/io src/ops src/p

From:
allison
Date:
December 8, 2008 21:17
Subject:
[svn:parrot] r33695 - in trunk: . compilers/imcc compilers/pct/src/PCT config/gen/makefiles docs docs/pdds include/parrot languages/WMLScript/src languages/lua languages/lua/src/lib languages/perl6/src/classes src src/dynoplibs src/gc src/io src/ops src/p
Message ID:
20081209051639.00020CBA89@x12.develooper.com
Author: allison
Date: Mon Dec  8 21:16:33 2008
New Revision: 33695

Added:
   trunk/src/io/core.c
      - copied unchanged from r33691, /branches/pdd22io_part2/src/io/core.c
   trunk/src/io/socket_api.c
      - copied unchanged from r33691, /branches/pdd22io_part2/src/io/socket_api.c
   trunk/src/io/socket_unix.c
      - copied unchanged from r33691, /branches/pdd22io_part2/src/io/socket_unix.c
   trunk/src/io/socket_win32.c
      - copied unchanged from r33691, /branches/pdd22io_part2/src/io/socket_win32.c
   trunk/src/io/utf8.c
      - copied unchanged from r33691, /branches/pdd22io_part2/src/io/utf8.c
Removed:
   trunk/src/io/io.c
   trunk/src/io/io_buf.c
   trunk/src/io/io_layers.c
   trunk/src/io/io_passdown.c
   trunk/src/io/io_stdio.c
   trunk/src/io/io_unix.c
   trunk/src/io/io_utf8.c
   trunk/src/io/io_win32.c
   trunk/src/io/unix_socket.c
   trunk/src/io/win32_socket.c
   trunk/src/pmc/parrotio.pmc
Modified:
   trunk/MANIFEST
   trunk/compilers/imcc/instructions.c
   trunk/compilers/imcc/main.c
   trunk/compilers/imcc/parser_util.c
   trunk/compilers/imcc/pbc.c
   trunk/compilers/pct/src/PCT/HLLCompiler.pir
   trunk/config/gen/makefiles/root.in
   trunk/docs/tests.pod
   trunk/include/parrot/io.h
   trunk/include/parrot/string_funcs.h
   trunk/languages/WMLScript/src/wmlsstdlibs.pir
   trunk/languages/lua/luac2pir.pir
   trunk/languages/lua/luad.pir
   trunk/languages/lua/src/lib/luaaux.pir
   trunk/languages/lua/src/lib/luaperl.pir
   trunk/languages/perl6/src/classes/Object.pir
   trunk/src/debug.c
   trunk/src/dynoplibs/myops.ops
   trunk/src/embed.c
   trunk/src/events.c
   trunk/src/exceptions.c
   trunk/src/extend.c
   trunk/src/gc/dod.c
   trunk/src/gc/register.c
   trunk/src/global.c
   trunk/src/inter_create.c
   trunk/src/interpreter.c
   trunk/src/io.c
   trunk/src/io/api.c
   trunk/src/io/buffer.c
   trunk/src/io/io_private.h
   trunk/src/io/unix.c
   trunk/src/io/win32.c
   trunk/src/jit.c
   trunk/src/malloc.c
   trunk/src/multidispatch.c
   trunk/src/oo.c
   trunk/src/ops/io.ops
   trunk/src/ops/ops.num
   trunk/src/packdump.c
   trunk/src/packfile.c
   trunk/src/packfile/pf_items.c
   trunk/src/packout.c
   trunk/src/pbc_merge.c
   trunk/src/pdump.c
   trunk/src/pmc/coroutine.pmc
   trunk/src/pmc/filehandle.pmc
   trunk/src/pmc/pccmethod_test.pmc
   trunk/src/pmc/sub.pmc
   trunk/src/pmc/unmanagedstruct.pmc
   trunk/src/runops_cores.c
   trunk/src/spf_vtable.c
   trunk/src/stacks.c
   trunk/src/stm/backend.c
   trunk/src/string.c
   trunk/src/sub.c
   trunk/src/thread.c
   trunk/src/trace.c
   trunk/src/warnings.c
   trunk/t/compilers/imcc/syn/op.t
   trunk/t/op/interp.t
   trunk/t/op/string_cs.t
   trunk/t/op/stringu.t
   trunk/t/pmc/filehandle.t
   trunk/t/pmc/io.t
   trunk/t/pmc/parrotio.t
   trunk/t/src/basic.t
   trunk/t/src/compiler.t
   trunk/t/src/exit.t
   trunk/t/src/extend.t
   trunk/t/src/warnings.t
   trunk/t/steps/auto_pmc-01.t

Changes in other areas also in this revision:
Modified:
   trunk/docs/pdds/pdd22_io.pod

Log:
[pdd22io] Merging the pdd22io_part2 branch into trunk for r32922 to r33687.


Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST	(original)
+++ trunk/MANIFEST	Mon Dec  8 21:16:33 2008
@@ -2984,22 +2984,17 @@
 src/io.c                                                    []
 src/io/api.c                                                []
 src/io/buffer.c                                             []
-src/io/io.c                                                 []
-src/io/io_buf.c                                             []
-src/io/io_layers.c                                          []
+src/io/core.c                                               []
 src/io/io_mmap.c                                            []
-src/io/io_passdown.c                                        []
 src/io/io_private.h                                         []
-src/io/io_stdio.c                                           []
 src/io/io_string.c                                          []
-src/io/io_unix.c                                            []
-src/io/io_utf8.c                                            []
-src/io/io_win32.c                                           []
 src/io/portable.c                                           []
+src/io/socket_api.c                                         []
+src/io/socket_unix.c                                        []
+src/io/socket_win32.c                                       []
 src/io/unix.c                                               []
-src/io/unix_socket.c                                        []
+src/io/utf8.c                                               []
 src/io/win32.c                                              []
-src/io/win32_socket.c                                       []
 src/jit.c                                                   []
 src/jit.h                                                   []
 src/jit/alpha/core.jit                                      []
@@ -3133,7 +3128,6 @@
 src/pmc/packfilesegment.pmc                                 []
 src/pmc/pair.pmc                                            []
 src/pmc/parrotinterpreter.pmc                               []
-src/pmc/parrotio.pmc                                        []
 src/pmc/parrotlibrary.pmc                                   []
 src/pmc/parrotrunningthread.pmc                             []
 src/pmc/parrotthread.pmc                                    []

Modified: trunk/compilers/imcc/instructions.c
==============================================================================
--- trunk/compilers/imcc/instructions.c	(original)
+++ trunk/compilers/imcc/instructions.c	Mon Dec  8 21:16:33 2008
@@ -648,7 +648,7 @@
     int len;
 
 #if IMC_TRACE
-    PIO_eprintf(NULL, "ins_print\n");
+    Parrot_io_eprintf(NULL, "ins_print\n");
 #endif
 
     /* comments, labels and such */
@@ -811,7 +811,7 @@
         ARGIN(const Instruction *ins))
 {
 #if IMC_TRACE
-    PIO_eprintf(NULL, "e_file_emit\n");
+    Parrot_io_eprintf(NULL, "e_file_emit\n");
 #endif
     if ((ins->type & ITLABEL) || ! *ins->opname)
         ins_print(interp, stdout, ins);

Modified: trunk/compilers/imcc/main.c
==============================================================================
--- trunk/compilers/imcc/main.c	(original)
+++ trunk/compilers/imcc/main.c	Mon Dec  8 21:16:33 2008
@@ -445,7 +445,7 @@
                 exit(EX_USAGE);
                 break;
             case OPT_RUNTIME_PREFIX:
-                PIO_printf(interp, "%Ss\n",
+                Parrot_io_printf(interp, "%Ss\n",
                     Parrot_get_runtime_path(interp));
                 exit(EXIT_SUCCESS);
             case 'V':

Modified: trunk/compilers/imcc/parser_util.c
==============================================================================
--- trunk/compilers/imcc/parser_util.c	(original)
+++ trunk/compilers/imcc/parser_util.c	Mon Dec  8 21:16:33 2008
@@ -187,7 +187,7 @@
 
 #if IMC_TRACE_HIGH
     char *full = dest;
-    PIO_eprintf(NULL, "op %s", name);
+    Parrot_io_eprintf(NULL, "op %s", name);
 #endif
 
     strcpy(dest, name);
@@ -198,7 +198,7 @@
         *dest++ = '_';
         if (args[i]->type == VTADDRESS) {
 #if IMC_TRACE_HIGH
-            PIO_eprintf(NULL, " (address)%s", args[i]->name);
+            Parrot_io_eprintf(NULL, " (address)%s", args[i]->name);
 #endif
             *dest++ = 'i';
             *dest++ = 'c';
@@ -207,7 +207,7 @@
         /* if one ever wants num keys, they go with 'S' */
         if (keyvec & KEY_BIT(i)) {
 #if IMC_TRACE_HIGH
-            PIO_eprintf(NULL, " (key)%s", args[i]->name);
+            Parrot_io_eprintf(NULL, " (key)%s", args[i]->name);
 #endif
             *dest++ = 'k';
             if (args[i]->set=='S' || args[i]->set=='N' || args[i]->set=='K') {
@@ -225,18 +225,20 @@
 
         if (args[i]->type & (VTCONST|VT_CONSTP)) {
 #if IMC_TRACE_HIGH
-            PIO_eprintf(NULL, " (%cc)%s", tolower((unsigned char)args[i]->set), args[i]->name);
+            Parrot_io_eprintf(NULL, " (%cc)%s",
+                    tolower((unsigned char)args[i]->set), args[i]->name);
 #endif
             *dest++ = 'c';
         }
 #if IMC_TRACE_HIGH
         else
-            PIO_eprintf(NULL, " (%c)%s", tolower((unsigned char)args[i]->set), args[i]->name);
+            Parrot_io_eprintf(NULL, " (%c)%s",
+                    tolower((unsigned char)args[i]->set), args[i]->name);
 #endif
     }
     *dest = '\0';
 #if IMC_TRACE_HIGH
-    PIO_eprintf(NULL, " -> %s\n", full);
+    Parrot_io_eprintf(NULL, " -> %s\n", full);
 #endif
 }
 

Modified: trunk/compilers/imcc/pbc.c
==============================================================================
--- trunk/compilers/imcc/pbc.c	(original)
+++ trunk/compilers/imcc/pbc.c	Mon Dec  8 21:16:33 2008
@@ -1923,7 +1923,7 @@
     int        op, i;
 
 #if IMC_TRACE_HIGH
-    PIO_eprintf(NULL, "e_pbc_emit\n");
+    Parrot_io_eprintf(NULL, "e_pbc_emit\n");
 #endif
 
     /* first instruction, do initialisation ... */
@@ -1980,7 +1980,7 @@
         if (ins->symregs[0] && ins->symregs[0]->pcc_sub) {
 
 #if IMC_TRACE
-            PIO_eprintf(NULL, "pbc.c: e_pbc_emit (pcc_sub=%s)\n",
+            Parrot_io_eprintf(NULL, "pbc.c: e_pbc_emit (pcc_sub=%s)\n",
                         ins->symregs[0]->name);
 #endif
 
@@ -2010,7 +2010,7 @@
         opcode_t last_label = 1;
 
 #if IMC_TRACE_HIGH
-        PIO_eprintf(NULL, "emit_pbc: op [%d %s]\n", ins->opnum, ins->opname);
+        Parrot_io_eprintf(NULL, "emit_pbc: op [%d %s]\n", ins->opnum, ins->opname);
 #endif
 
         if ((ins->type & ITBRANCH)

Modified: trunk/compilers/pct/src/PCT/HLLCompiler.pir
==============================================================================
--- trunk/compilers/pct/src/PCT/HLLCompiler.pir	(original)
+++ trunk/compilers/pct/src/PCT/HLLCompiler.pir	Mon Dec  8 21:16:33 2008
@@ -537,7 +537,7 @@
     encoding = adverbs['encoding']
     if encoding == 'fixed_8' goto interactive_loop
     unless encoding goto interactive_loop
-    push stdin, encoding
+    stdin.'encoding'(encoding)
   interactive_loop:
     .local pmc code
     unless stdin goto interactive_end
@@ -660,13 +660,11 @@
     .local string iname
     .local pmc ifh
     iname = shift iter
-    ifh = open iname, '<'
-    unless ifh goto err_infile
-    if encoding == 'fixed_8' goto iter_loop_1
-    unless encoding goto iter_loop_1
-    push ifh, encoding
+    ifh = new 'FileHandle'
+    unless encoding == 'utf8' goto iter_loop_1
+    ifh.'encoding'(encoding)
   iter_loop_1:
-    $S0 = ifh.'slurp'('')
+    $S0 = ifh.'readall'(iname)
     code .= $S0
     close ifh
     goto iter_loop
@@ -783,7 +781,7 @@
     output = adverbs['output']
     if output == '' goto save_output_1
     if output == '-' goto save_output_1
-    ofh = open output, '>'
+    ofh = open output, 'w'
     unless ofh goto err_output
   save_output_1:
     print ofh, result

Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in	(original)
+++ trunk/config/gen/makefiles/root.in	Mon Dec  8 21:16:33 2008
@@ -354,22 +354,14 @@
 
 
 IO_O_FILES = \
-    $(IO_DIR)/io$(O) \
+    $(IO_DIR)/core$(O) \
     $(IO_DIR)/api$(O) \
+    $(IO_DIR)/utf8$(O) \
     $(IO_DIR)/buffer$(O) \
     $(IO_DIR)/unix$(O) \
     $(IO_DIR)/win32$(O) \
     $(IO_DIR)/portable$(O) \
-    $(SRC_DIR)/io$(O) \
-    $(IO_DIR)/io_buf$(O) \
-    $(IO_DIR)/io_layers$(O) \
-    $(IO_DIR)/io_unix$(O) \
-    $(IO_DIR)/io_utf8$(O) \
-    $(IO_DIR)/io_mmap$(O) \
-    $(IO_DIR)/io_win32$(O) \
-    $(IO_DIR)/io_stdio$(O) \
-    $(IO_DIR)/io_string$(O) \
-    $(IO_DIR)/io_passdown$(O)
+    $(SRC_DIR)/io$(O)
 
 INTERP_O_FILES = \
     $(SRC_DIR)/string$(O) \
@@ -590,7 +582,6 @@
     $(SRC_DIR)/inter_cb.str \
     $(SRC_DIR)/inter_create.str \
     $(SRC_DIR)/inter_misc.str \
-    $(SRC_DIR)/io/io.str \
     $(SRC_DIR)/io/api.str \
     $(SRC_DIR)/key.str \
     $(SRC_DIR)/library.str \

Modified: trunk/docs/tests.pod
==============================================================================
--- trunk/docs/tests.pod	(original)
+++ trunk/docs/tests.pod	Mon Dec  8 21:16:33 2008
@@ -134,7 +134,7 @@
     OUTPUT
 
 Note that it's always a good idea to output "done" to confirm that the compiled
-code executed completely. When mixing C<printf> and C<PIO_printf> always append
+code executed completely. When mixing C<printf> and C<Parrot_io_printf> always append
 a C<fflush(stdout);> after the former.
 
 =head2 Testing Perl5 components

Modified: trunk/include/parrot/io.h
==============================================================================
--- trunk/include/parrot/io.h	(original)
+++ trunk/include/parrot/io.h	Mon Dec  8 21:16:33 2008
@@ -79,15 +79,6 @@
 
 #define PIO_NR_OPEN 256         /* Size of an "IO handle table" */
 
-/* &gen_from_enum(iotypes.pasm) */
-enum {
-    PIO_TYPE_FILE,
-    PIO_TYPE_PIPE,
-    PIO_TYPE_SOCKET,
-    PIO_TYPE_MAX
-};
-/* &end_gen */
-
 /* This is temporary until subs/code refs are done..*/
 typedef void *DummyCodeRef;
 
@@ -110,24 +101,10 @@
 
 extern PIOOFF_T piooffsetzero;
 
-typedef struct _ParrotIOLayerAPI ParrotIOLayerAPI;
-typedef struct _ParrotIOLayer ParrotIOLayer;
 typedef struct _ParrotIOFilter ParrotIOFilter;
 typedef struct _ParrotIO ParrotIO;
 typedef struct _ParrotIOData ParrotIOData;
 
-struct _ParrotIOLayer {
-    void *self;                 /* Instance specific data       */
-    const char *name;
-    INTVAL flags;
-    const ParrotIOLayerAPI *api;
-    ParrotIOLayer *up;
-    ParrotIOLayer *down;
-};
-
-#define PIO_DOWNLAYER(x)   (x)->down
-#define PIO_UPLAYER(x)     (x)->up
-
 #ifdef _MSC_VER
 /* Win32/MSVC has a deprecation warning about dup() in favor of _dup(). */
 #  define Parrot_dup(x) (PIOHANDLE)_dup((int)(x))
@@ -135,392 +112,27 @@
 #  define Parrot_dup(x) (PIOHANDLE)dup((int)(x))
 #endif /* _MSC_VER */
 
-/* Others to come */
-#ifdef PIO_OS_UNIX
-extern ParrotIOLayer pio_unix_layer;
-#endif
-#ifdef PIO_OS_WIN32
-extern ParrotIOLayer pio_win32_layer;
-#endif
-#ifdef PIO_OS_STDIO
-extern ParrotIOLayer pio_stdio_layer;
-#endif
-extern ParrotIOLayer pio_buf_layer;
-extern ParrotIOLayer pio_mmap_layer;
-extern ParrotIOLayer pio_string_layer;
-
-
-
-
 extern INTVAL pio_errno;
 
-/* HEADERIZER BEGIN: src/io/io.c */
+/* io/core.c - interpreter initialization/destruction functions */
+/* HEADERIZER BEGIN: src/io/core.c */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
 PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-PMC * new_io_pmc(PARROT_INTERP, ARGIN_NULLOK(ParrotIO *io))
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
-void Parrot_IOData_mark(PARROT_INTERP, ARGIN(ParrotIOData *piodata))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-PMC * PIO_accept(PARROT_INTERP, ARGMOD(PMC *pmc))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pmc);
-
-PARROT_EXPORT
-INTVAL PIO_base_init(SHIM_INTERP, SHIM(ParrotIOLayer *l));
-
-PARROT_EXPORT
-INTVAL PIO_bind(PARROT_INTERP, ARGMOD(PMC *pmc), ARGMOD(STRING *address))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*pmc)
-        FUNC_MODIFIES(*address);
-
-PARROT_EXPORT
-INTVAL PIO_close(PARROT_INTERP, ARGMOD(PMC *pmc))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pmc);
-
-PARROT_EXPORT
-INTVAL PIO_connect(PARROT_INTERP, ARGMOD(PMC *pmc), ARGMOD(STRING *address))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*pmc)
-        FUNC_MODIFIES(*address);
-
-PARROT_EXPORT
-void PIO_destroy(SHIM_INTERP, ARGMOD(PMC * pmc))
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(* pmc);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-PMC * PIO_dup(PARROT_INTERP, ARGIN(PMC *pmc))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-INTVAL PIO_eof(SHIM_INTERP, ARGMOD(PMC *pmc))
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pmc);
-
-PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-INTVAL PIO_eprintf(NULLOK(PARROT_INTERP), ARGIN(const char *s), ...)
-        __attribute__nonnull__(2);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-PMC * PIO_fdopen(PARROT_INTERP,
-    ARGIN_NULLOK(ParrotIOLayer *layer),
-    PIOHANDLE fd,
-    ARGIN(const char *sflags))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(4);
-
-PARROT_EXPORT
-void PIO_finish(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
-void PIO_flush(PARROT_INTERP, ARGMOD(PMC *pmc))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pmc);
-
-PARROT_EXPORT
-INTVAL PIO_fprintf(PARROT_INTERP,
-    ARGMOD(PMC *pmc),
-    ARGIN(const char *s),
-    ...)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*pmc);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PIOHANDLE PIO_getfd(SHIM_INTERP, ARGMOD(PMC *pmc))
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pmc);
-
-PARROT_EXPORT
-void PIO_init(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
-INTVAL PIO_init_stacks(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
-void PIO_internal_shutdown(PARROT_INTERP)
+void Parrot_io_finish(PARROT_INTERP)
         __attribute__nonnull__(1);
 
 PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-INTVAL PIO_isatty(SHIM_INTERP, ARGMOD(PMC *pmc))
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pmc);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-INTVAL PIO_listen(PARROT_INTERP, ARGMOD(PMC *pmc), INTVAL backlog)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pmc);
-
-PARROT_EXPORT
-PIOOFF_T PIO_make_offset(INTVAL offset);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-ParrotIO * PIO_new(PARROT_INTERP,
-    NULLOK(INTVAL iotype),
-    INTVAL flags,
-    INTVAL mode)
+void Parrot_io_init(PARROT_INTERP)
         __attribute__nonnull__(1);
 
 PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-PMC * PIO_open(PARROT_INTERP,
-    ARGIN_NULLOK(ParrotIOLayer *layer),
-    ARGIN(const char *spath),
-    ARGIN(const char *sflags))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-INTVAL PIO_parse_open_flags(ARGIN_NULLOK(const char *flagstr));
-
-PARROT_EXPORT
-INTVAL PIO_peek(PARROT_INTERP, ARGMOD(PMC *pmc), ARGOUT(STRING **buffer))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*pmc)
-        FUNC_MODIFIES(*buffer);
-
-PARROT_EXPORT
-INTVAL PIO_pioctl(PARROT_INTERP, ARGMOD(PMC *pmc), INTVAL cmd, INTVAL arg)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pmc);
-
-PARROT_EXPORT
-INTVAL PIO_poll(PARROT_INTERP,
-    ARGMOD(PMC *pmc),
-    INTVAL which,
-    INTVAL sec,
-    INTVAL usec)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pmc);
-
-PARROT_EXPORT
-INTVAL PIO_printf(PARROT_INTERP, ARGIN(const char *s), ...)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-PARROT_EXPORT
-INTVAL PIO_putps(PARROT_INTERP, ARGMOD(PMC *pmc), ARGMOD_NULLOK(STRING *s))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pmc);
-
-PARROT_EXPORT
-INTVAL PIO_puts(PARROT_INTERP, ARGMOD(PMC *pmc), ARGIN(const char *s))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*pmc);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-INTVAL PIO_read(PARROT_INTERP,
-    ARGMOD(PMC *pmc),
-    ARGIN(char *buffer),
-    size_t len)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*pmc);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-STRING * PIO_reads(PARROT_INTERP, ARGMOD(PMC *pmc), size_t len)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pmc);
-
-PARROT_EXPORT
-INTVAL PIO_recv(PARROT_INTERP, ARGMOD(PMC *pmc), ARGOUT(STRING **buf))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*pmc)
-        FUNC_MODIFIES(*buf);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PIOOFF_T PIO_seek(PARROT_INTERP,
-    ARGMOD(PMC *pmc),
-    PIOOFF_T offset,
-    INTVAL w)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pmc);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-INTVAL PIO_send(PARROT_INTERP, ARGMOD(PMC *pmc), ARGMOD(STRING *buf))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*pmc)
-        FUNC_MODIFIES(*buf);
-
-PARROT_EXPORT
-INTVAL PIO_setbuf(PARROT_INTERP, ARGMOD(PMC *pmc), size_t bufsize)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pmc);
-
-PARROT_EXPORT
-INTVAL PIO_setlinebuf(PARROT_INTERP, ARGMOD(PMC *pmc))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pmc);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-PMC * PIO_socket(PARROT_INTERP, INTVAL fam, INTVAL type, INTVAL proto)
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-PMC * PIO_STDERR(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-PMC * PIO_STDIN(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-PMC * PIO_STDOUT(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PIOOFF_T PIO_tell(PARROT_INTERP, ARGMOD(PMC *pmc))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pmc);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-INTVAL PIO_write(PARROT_INTERP,
-    ARGMOD(PMC *pmc),
-    ARGIN(const void *buffer),
-    size_t len)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*pmc);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-STRING * PIO_make_io_string(PARROT_INTERP, ARGMOD(STRING **buf), size_t len)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*buf);
-
-PIOOFF_T PIO_make_offset32(INTVAL hi, INTVAL lo);
-PIOOFF_T PIO_make_offset_pmc(PARROT_INTERP, ARGMOD(PMC *pmc))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pmc);
-
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: src/io/io.c */
-
-/* io_layers.c - If you add new layers, register them in init_layers() */
-/* HEADERIZER BEGIN: src/io/io_layers.c */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-PARROT_EXPORT
-void PIO_base_delete_layer(ARGMOD_NULLOK(ParrotIOLayer *layer));
-
-PARROT_EXPORT
-PARROT_MALLOC
-PARROT_CANNOT_RETURN_NULL
-ParrotIOLayer * PIO_base_new_layer(ARGIN_NULLOK(const ParrotIOLayer *proto));
-
-PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-PARROT_CANNOT_RETURN_NULL
-ParrotIOLayer * PIO_copy_stack(ARGIN_NULLOK(ParrotIOLayer *stack));
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-ParrotIOLayer * PIO_get_layer(PARROT_INTERP, ARGIN(const char *name))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-PARROT_CAN_RETURN_NULL
-ParrotIOLayer * PIO_pop_layer(PARROT_INTERP, ARGIN_NULLOK(PMC *pmc))
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
-INTVAL PIO_push_layer(PARROT_INTERP,
-    ARGMOD(PMC *pmc),
-    ARGMOD_NULLOK(ParrotIOLayer *layer))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pmc);
-
-PARROT_IGNORABLE_RESULT
-PARROT_CANNOT_RETURN_NULL
-STRING * PIO_pop_layer_str(PARROT_INTERP, ARGIN_NULLOK(PMC *pmc))
-        __attribute__nonnull__(1);
-
-void PIO_push_layer_str(PARROT_INTERP,
-    ARGIN(PMC *pmc),
-    ARGIN_NULLOK(const STRING *ls))
+void Parrot_IOData_mark(PARROT_INTERP, ARGIN(ParrotIOData *piodata))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: src/io/io_layers.c */
+/* HEADERIZER END: src/io/core.c */
 
 /* io/api.c - Public API functions */
 /* HEADERIZER BEGIN: src/io/api.c */
@@ -787,6 +399,31 @@
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/io/buffer.c */
 
+/* io/utf8.c - UTF-8 functions */
+/* HEADERIZER BEGIN: src/io/utf8.c */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+
+size_t Parrot_io_read_utf8(PARROT_INTERP,
+    ARGMOD(PMC *filehandle),
+    ARGMOD(STRING **buf))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        FUNC_MODIFIES(*filehandle)
+        FUNC_MODIFIES(*buf);
+
+size_t Parrot_io_write_utf8(PARROT_INTERP,
+    ARGMOD(PMC *filehandle),
+    ARGMOD(STRING *s))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        FUNC_MODIFIES(*filehandle)
+        FUNC_MODIFIES(*s);
+
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+/* HEADERIZER END: src/io/utf8.c */
+
 /* io.c - utility functions shared between all platforms */
 /* HEADERIZER BEGIN: src/io.c */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
@@ -839,6 +476,15 @@
 
 PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
+INTVAL Parrot_io_is_encoding(PARROT_INTERP,
+    ARGIN(PMC *filehandle),
+    ARGIN(STRING *value))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
+PARROT_EXPORT
+PARROT_WARN_UNUSED_RESULT
 INTVAL Parrot_io_parse_open_flags(PARROT_INTERP,
     ARGIN_NULLOK(STRING *mode_str))
         __attribute__nonnull__(1);
@@ -947,20 +593,6 @@
 #  define PIO_getblksize(x)   PIO_stdio_getblksize(x)
 #endif
 
-
-/*
- * pioctl definitions -- These are mostly for reference
- * or C-API writers.
- */
-/* pioctl command constants */
-#define PIOCTL_CMDRESERVED         0
-#define PIOCTL_CMDSETRECSEP        1
-#define PIOCTL_CMDGETRECSEP        2
-#define PIOCTL_CMDSETBUFTYPE       3
-#define PIOCTL_CMDGETBUFTYPE       4
-#define PIOCTL_CMDSETBUFSIZE       5
-#define PIOCTL_CMDGETBUFSIZE       6
-
 /*
  * pioctl argument constants. These don't have to
  * be unique across io commands.

Modified: trunk/include/parrot/string_funcs.h
==============================================================================
--- trunk/include/parrot/string_funcs.h	(original)
+++ trunk/include/parrot/string_funcs.h	Mon Dec  8 21:16:33 2008
@@ -523,6 +523,7 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*tc);
 
+PARROT_INLINE
 void string_free(PARROT_INTERP, ARGIN(STRING *s))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);

Modified: trunk/languages/WMLScript/src/wmlsstdlibs.pir
==============================================================================
--- trunk/languages/WMLScript/src/wmlsstdlibs.pir	(original)
+++ trunk/languages/WMLScript/src/wmlsstdlibs.pir	Mon Dec  8 21:16:33 2008
@@ -133,11 +133,12 @@
 
 .sub 'load_script'
     .param string filename
-    .local pmc pio
+    .local pmc fh
     .local string content
-    pio = new 'ParrotIO'
-    push_eh _handler
-    content = pio.'slurp'(filename)
+    fh = new 'FileHandle'
+#    push_eh _handler
+    content = fh.'readall'(filename)
+#    pop_eh
     if content goto L1
     $S0 = err
     print "Can't slurp '"
@@ -147,7 +148,7 @@
     print ")\n"
   L1:
   _handler:
-    .return (content)
+    .return(content)
 .end
 
 .sub 'save_pbc'
@@ -155,21 +156,23 @@
     .param string filename
     .local string output
     .local pmc fh
+    fh = new 'FileHandle'
     output = concat filename, '.pbc'
-    fh = open output, '>'
-    if fh goto L1
-    $S0 = err
+    push_eh _handler
+    fh.'open'(output, 'w')
+    pop_eh
+    fh.'print'(pbc_out)
+    fh.'close'()
+    .return (output)
+  _handler:
+    .local pmc e
+    .get_results (e)
+    $S0 = e
     print "Can't open '"
     print output
     print "' ("
     print $S0
     print ")\n"
-    goto L2
-  L1:
-    print fh, pbc_out
-    close fh
-  L2:
-    .return (output)
 .end
 
 .sub 'save_pir'
@@ -177,20 +180,23 @@
     .param string filename
     .local string output
     .local pmc fh
+    fh = new 'FileHandle'
     output = concat filename, '.pir'
-    fh = open output, '>'
-    if fh goto L1
-    $S0 = err
+    push_eh _handler
+    fh.'open'(output, 'w')
+    pop_eh
+    fh.'print'(gen_pir)
+    fh.'close'()
+    .return ()
+  _handler:
+    .local pmc e
+    .get_results (e)
+    $S0 = e
     print "Can't open '"
     print output
     print "' ("
     print $S0
     print ")\n"
-    goto L2
-  L1:
-    print fh, gen_pir
-    close fh
-  L2:
 .end
 
 =back

Modified: trunk/languages/lua/luac2pir.pir
==============================================================================
--- trunk/languages/lua/luac2pir.pir	(original)
+++ trunk/languages/lua/luac2pir.pir	Mon Dec  8 21:16:33 2008
@@ -62,11 +62,11 @@
 
 .sub 'load_file' :anon
     .param string filename
-    .local pmc pio
+    .local pmc fh
     .local string content
-    pio = new 'ParrotIO'
+    fh = new 'FileHandle'
     push_eh _handler
-    content = pio.'slurp'(filename)
+    content = fh.'readall'(filename)
     pop_eh
     if content goto L1
     $S0 = err

Modified: trunk/languages/lua/luad.pir
==============================================================================
--- trunk/languages/lua/luad.pir	(original)
+++ trunk/languages/lua/luad.pir	Mon Dec  8 21:16:33 2008
@@ -65,11 +65,11 @@
 
 .sub 'load_file'
     .param string filename
-    .local pmc pio
+    .local pmc fh
     .local string content
-    pio = new 'ParrotIO'
+    fh = new 'FileHandle'
     push_eh _handler
-    content = pio.'slurp'(filename)
+    content = fh.'readall'(filename)
     pop_eh
     if content goto L1
     $S0 = err

Modified: trunk/languages/lua/src/lib/luaaux.pir
==============================================================================
--- trunk/languages/lua/src/lib/luaaux.pir	(original)
+++ trunk/languages/lua/src/lib/luaaux.pir	Mon Dec  8 21:16:33 2008
@@ -654,7 +654,7 @@
     f = open filename, '<'
     unless f goto L3
   L2:
-    $S0 = f.'slurp'('')
+    $S0 = f.'readall'()
     if filename == '' goto L4
     close f
   L4:

Modified: trunk/languages/lua/src/lib/luaperl.pir
==============================================================================
--- trunk/languages/lua/src/lib/luaperl.pir	(original)
+++ trunk/languages/lua/src/lib/luaperl.pir	Mon Dec  8 21:16:33 2008
@@ -75,7 +75,7 @@
     .local string content
     pio = new 'ParrotIO'
     push_eh _handler
-    content = pio.'slurp'(filename)
+    content = pio.'readall'(filename)
     pop_eh
     if content goto L1
     $S0 = err
@@ -108,7 +108,7 @@
     pir = load_script($S1)
     if pir goto L1
     $P0 = new 'ParrotIO'
-    $S0 = $P0.'slurp'(out)
+    $S0 = $P0.'readall'(out)
     unlink(out)  # cleaning up the temporary file
     die $S0
   L1:

Modified: trunk/languages/perl6/src/classes/Object.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Object.pir	(original)
+++ trunk/languages/perl6/src/classes/Object.pir	Mon Dec  8 21:16:33 2008
@@ -509,7 +509,7 @@
     # Get all possible methods.
     .local pmc methods
     methods = self.'!MANY_DISPATCH_HELPER'(method_name, pos_args, named_args)
-    
+
     # Do we have any?
     $I0 = elements methods
     if $I0 goto invoke
@@ -619,7 +619,7 @@
     # If we're here, found a method. But is it a multi?
     $I0 = isa cur_meth, "Perl6MultiSub"
     if $I0 goto multi_dispatch
-    
+
     # Single dispatch - add to the result list.
     push result_list, cur_meth
     goto mro_loop

Modified: trunk/src/debug.c
==============================================================================
--- trunk/src/debug.c	(original)
+++ trunk/src/debug.c	Mon Dec  8 21:16:33 2008
@@ -1116,7 +1116,7 @@
 
         c = pdb->cur_command;
 
-        PIO_eprintf(pdb->debugger, "\n(pdb) ");
+        Parrot_io_eprintf(pdb->debugger, "\n(pdb) ");
 
         /* skip leading whitespace */
         do {
@@ -1212,11 +1212,11 @@
             return 0;
         }
         else {
-            PIO_eprintf(pdb->debugger,
+            Parrot_io_eprintf(pdb->debugger,
                         "Undefined command: \"%s\"", command);
             if (pdb->script_file)
-                PIO_eprintf(pdb->debugger, " in line %lu", pdb->script_line);
-            PIO_eprintf(pdb->debugger, ".  Try \"help\".");
+                Parrot_io_eprintf(pdb->debugger, " in line %lu", pdb->script_line);
+            Parrot_io_eprintf(pdb->debugger, ".  Try \"help\".");
 #if TRACE_DEBUGGER
             fprintf(stderr, " (parse_command result: %li)", c);
 #endif
@@ -1391,7 +1391,7 @@
 
     /* Return if no more arguments */
     if (!(command && *command)) {
-        PIO_eprintf(interp->pdb->debugger, "No condition specified\n");
+        Parrot_io_eprintf(interp->pdb->debugger, "No condition specified\n");
         return NULL;
     }
 
@@ -1406,7 +1406,7 @@
     auxcmd = ++command;
     regleft = (unsigned char)get_uint(&command, 0);
     if (auxcmd == command) {
-        PIO_eprintf(interp->pdb->debugger, "Invalid register\n");
+        Parrot_io_eprintf(interp->pdb->debugger, "Invalid register\n");
             return NULL;
     }
 
@@ -1439,13 +1439,13 @@
             break;
         case '\0':
             if (cond_argleft != PDB_cond_str && cond_argleft != PDB_cond_pmc) {
-                PIO_eprintf(interp->pdb->debugger, "Invalid null condition\n");
+                Parrot_io_eprintf(interp->pdb->debugger, "Invalid null condition\n");
                 return NULL;
             }
             cond_type = PDB_cond_notnull;
             break;
         default:
-INV_COND:   PIO_eprintf(interp->pdb->debugger, "Invalid condition\n");
+INV_COND:   Parrot_io_eprintf(interp->pdb->debugger, "Invalid condition\n");
             return NULL;
     }
 
@@ -1459,7 +1459,7 @@
 
     /* return if no notnull condition and no more arguments */
     if (!(command && *command) && (cond_type != PDB_cond_notnull)) {
-        PIO_eprintf(interp->pdb->debugger, "Can't compare a register with nothing\n");
+        Parrot_io_eprintf(interp->pdb->debugger, "Can't compare a register with nothing\n");
         return NULL;
     }
 
@@ -1476,7 +1476,7 @@
             unsigned short cond_argright = condition_regtype(command);
 
             if (cond_argright != cond_argleft) {
-                PIO_eprintf(interp->pdb->debugger, "Register types don't agree\n");
+                Parrot_io_eprintf(interp->pdb->debugger, "Register types don't agree\n");
                 mem_sys_free(condition);
                 return NULL;
             }
@@ -1485,13 +1485,13 @@
             auxcmd = ++command;
             reg_number = (int)get_uint(&command, 0);
             if (auxcmd == command) {
-                PIO_eprintf(interp->pdb->debugger, "Invalid register\n");
+                Parrot_io_eprintf(interp->pdb->debugger, "Invalid register\n");
                     mem_sys_free(condition);
                     return NULL;
             }
 
             if (reg_number < 0) {
-                PIO_eprintf(interp->pdb->debugger, "Out-of-bounds register\n");
+                Parrot_io_eprintf(interp->pdb->debugger, "Out-of-bounds register\n");
                 mem_sys_free(condition);
                 return NULL;
             }
@@ -1526,7 +1526,7 @@
         else if (condition->type & PDB_cond_pmc) {
             /* RT #46123 Need to figure out what to do in this case.
              * For the time being, we just bail. */
-            PIO_eprintf(interp->pdb->debugger, "Can't compare PMC with constant\n");
+            Parrot_io_eprintf(interp->pdb->debugger, "Can't compare PMC with constant\n");
             mem_sys_free(condition);
             return NULL;
         }
@@ -1602,7 +1602,7 @@
 
             /* Abort if the line number provided doesn't exist */
             if (!line->next) {
-                PIO_eprintf(pdb->debugger,
+                Parrot_io_eprintf(pdb->debugger,
                     "Can't set a breakpoint at line number %li\n", ln);
                 return;
             }
@@ -1614,7 +1614,7 @@
             while (line->opcode != pdb->cur_opcode) {
                 line = line->next;
                 if (!line) {
-                    PIO_eprintf(pdb->debugger,
+                    Parrot_io_eprintf(pdb->debugger,
                        "No current line found and no line number specified\n");
                     return;
                 }
@@ -1625,7 +1625,7 @@
             line = line->next;
         /* Abort if the line number provided doesn't exist */
         if (!line) {
-            PIO_eprintf(pdb->debugger,
+            Parrot_io_eprintf(pdb->debugger,
                 "Can't set a breakpoint at line number %li\n", ln);
             return;
         }
@@ -1679,10 +1679,10 @@
 
     /* Show breakpoint position */
 
-    PIO_eprintf(pdb->debugger, "Breakpoint %li at", newbreak->id);
+    Parrot_io_eprintf(pdb->debugger, "Breakpoint %li at", newbreak->id);
     if (line)
-        PIO_eprintf(pdb->debugger, " line %li", line->number);
-    PIO_eprintf(pdb->debugger, " pos %li\n", newbreak->pc - interp->code->base.data);
+        Parrot_io_eprintf(pdb->debugger, " line %li", line->number);
+    Parrot_io_eprintf(pdb->debugger, " pos %li\n", newbreak->pc - interp->code->base.data);
 }
 
 /*
@@ -1702,7 +1702,7 @@
 
     /* Restart if we are already running */
     if (pdb->state & PDB_RUNNING)
-        PIO_eprintf(pdb->debugger, "Restarting\n");
+        Parrot_io_eprintf(pdb->debugger, "Restarting\n");
 
     /* Add the RUNNING state */
     pdb->state |= PDB_RUNNING;
@@ -1733,7 +1733,7 @@
 
     if (ln != 0) {
         if (!pdb->breakpoint) {
-            PIO_eprintf(pdb->debugger, "No breakpoints to skip\n");
+            Parrot_io_eprintf(pdb->debugger, "No breakpoints to skip\n");
             return;
         }
 
@@ -1789,7 +1789,7 @@
             breakpoint = breakpoint->next;
 
         if (!breakpoint) {
-            PIO_eprintf(interp->pdb->debugger, "No breakpoint number %ld", n);
+            Parrot_io_eprintf(interp->pdb->debugger, "No breakpoint number %ld", n);
             return NULL;
         }
 
@@ -1798,9 +1798,9 @@
     else {
         /* Report an appropriate error */
         if (*command)
-            PIO_eprintf(interp->pdb->debugger, "Not a valid breakpoint");
+            Parrot_io_eprintf(interp->pdb->debugger, "Not a valid breakpoint");
         else
-            PIO_eprintf(interp->pdb->debugger, "No breakpoint specified");
+            Parrot_io_eprintf(interp->pdb->debugger, "No breakpoint specified");
 
         return NULL;
     }
@@ -1967,7 +1967,7 @@
     /* Remove the RUNNING state */
     pdb->state &= ~PDB_RUNNING;
 
-    PIO_eprintf(pdb->debugger, "Program exited.\n");
+    Parrot_io_eprintf(pdb->debugger, "Program exited.\n");
     return 1;
 }
 
@@ -2676,7 +2676,7 @@
             pline = pline->next;
 
         if (!pline) {
-            PIO_eprintf(pdb->debugger,
+            Parrot_io_eprintf(pdb->debugger,
                         "Label number %li out of bounds.\n", label->number);
 
             PDB_free_file(interp, pfile);
@@ -2831,7 +2831,7 @@
 
     /* abort if fopen failed */
     if (!file) {
-        PIO_eprintf(pdb->debugger, "Unable to load '%s'\n", f);
+        Parrot_io_eprintf(pdb->debugger, "Unable to load '%s'\n", f);
         return;
     }
 
@@ -2954,7 +2954,7 @@
     unsigned long  n   = 10;
 
     if (!pdb->file) {
-        PIO_eprintf(pdb->debugger, "No source file loaded\n");
+        Parrot_io_eprintf(pdb->debugger, "No source file loaded\n");
         return;
     }
 
@@ -2976,17 +2976,17 @@
 
     i = 1;
     while (line->next) {
-        PIO_eprintf(pdb->debugger, "%li  ", pdb->file->list_line + i);
+        Parrot_io_eprintf(pdb->debugger, "%li  ", pdb->file->list_line + i);
         /* If it has a label print it */
         if (line->label)
-            PIO_eprintf(pdb->debugger, "L%li:\t", line->label->number);
+            Parrot_io_eprintf(pdb->debugger, "L%li:\t", line->label->number);
 
         c = pdb->file->source + line->source_offset;
 
         while (*c != '\n')
-            PIO_eprintf(pdb->debugger, "%c", *(c++));
+            Parrot_io_eprintf(pdb->debugger, "%c", *(c++));
 
-        PIO_eprintf(pdb->debugger, "\n");
+        Parrot_io_eprintf(pdb->debugger, "\n");
 
         line = line->next;
 
@@ -3073,13 +3073,13 @@
     if (!s)
         return;
 
-    PIO_eprintf(interp, "\tBuflen  =\t%12ld\n", PObj_buflen(s));
-    PIO_eprintf(interp, "\tFlags   =\t%12ld\n", PObj_get_FLAGS(s));
-    PIO_eprintf(interp, "\tBufused =\t%12ld\n", s->bufused);
-    PIO_eprintf(interp, "\tStrlen  =\t%12ld\n", s->strlen);
-    PIO_eprintf(interp, "\tOffset  =\t%12ld\n",
+    Parrot_io_eprintf(interp, "\tBuflen  =\t%12ld\n", PObj_buflen(s));
+    Parrot_io_eprintf(interp, "\tFlags   =\t%12ld\n", PObj_get_FLAGS(s));
+    Parrot_io_eprintf(interp, "\tBufused =\t%12ld\n", s->bufused);
+    Parrot_io_eprintf(interp, "\tStrlen  =\t%12ld\n", s->strlen);
+    Parrot_io_eprintf(interp, "\tOffset  =\t%12ld\n",
                     (char*) s->strstart - (char*) PObj_bufstart(s));
-    PIO_eprintf(interp, "\tString  =\t%S\n", s);
+    Parrot_io_eprintf(interp, "\tString  =\t%S\n", s);
 }
 
 /*
@@ -3096,7 +3096,7 @@
 PDB_print(PARROT_INTERP, ARGIN(const char *command))
 {
     const char * const s = GDB_P(interp->pdb->debugee, command);
-    PIO_eprintf(interp, "%s\n", s);
+    Parrot_io_eprintf(interp, "%s\n", s);
 }
 
 
@@ -3113,31 +3113,31 @@
 void
 PDB_info(PARROT_INTERP)
 {
-    PIO_eprintf(interp, "Total memory allocated = %ld\n",
+    Parrot_io_eprintf(interp, "Total memory allocated = %ld\n",
             interpinfo(interp, TOTAL_MEM_ALLOC));
-    PIO_eprintf(interp, "DOD runs = %ld\n",
+    Parrot_io_eprintf(interp, "DOD runs = %ld\n",
             interpinfo(interp, DOD_RUNS));
-    PIO_eprintf(interp, "Lazy DOD runs = %ld\n",
+    Parrot_io_eprintf(interp, "Lazy DOD runs = %ld\n",
             interpinfo(interp, LAZY_DOD_RUNS));
-    PIO_eprintf(interp, "Collect runs = %ld\n",
+    Parrot_io_eprintf(interp, "Collect runs = %ld\n",
             interpinfo(interp, COLLECT_RUNS));
-    PIO_eprintf(interp, "Collect memory = %ld\n",
+    Parrot_io_eprintf(interp, "Collect memory = %ld\n",
             interpinfo(interp, TOTAL_COPIED));
-    PIO_eprintf(interp, "Active PMCs = %ld\n",
+    Parrot_io_eprintf(interp, "Active PMCs = %ld\n",
             interpinfo(interp, ACTIVE_PMCS));
-    PIO_eprintf(interp, "Extended PMCs = %ld\n",
+    Parrot_io_eprintf(interp, "Extended PMCs = %ld\n",
             interpinfo(interp, EXTENDED_PMCS));
-    PIO_eprintf(interp, "Timely DOD PMCs = %ld\n",
+    Parrot_io_eprintf(interp, "Timely DOD PMCs = %ld\n",
             interpinfo(interp, IMPATIENT_PMCS));
-    PIO_eprintf(interp, "Total PMCs = %ld\n",
+    Parrot_io_eprintf(interp, "Total PMCs = %ld\n",
             interpinfo(interp, TOTAL_PMCS));
-    PIO_eprintf(interp, "Active buffers = %ld\n",
+    Parrot_io_eprintf(interp, "Active buffers = %ld\n",
             interpinfo(interp, ACTIVE_BUFFERS));
-    PIO_eprintf(interp, "Total buffers = %ld\n",
+    Parrot_io_eprintf(interp, "Total buffers = %ld\n",
             interpinfo(interp, TOTAL_BUFFERS));
-    PIO_eprintf(interp, "Header allocations since last collect = %ld\n",
+    Parrot_io_eprintf(interp, "Header allocations since last collect = %ld\n",
             interpinfo(interp, HEADER_ALLOCS_SINCE_COLLECT));
-    PIO_eprintf(interp, "Memory allocations since last collect = %ld\n",
+    Parrot_io_eprintf(interp, "Memory allocations since last collect = %ld\n",
             interpinfo(interp, MEM_ALLOCS_SINCE_COLLECT));
 }
 
@@ -3165,12 +3165,12 @@
     cmd = get_command(c);
 
     if (cmd) {
-        PIO_eprintf(interp->pdb->debugger, "%s\n", cmd->help);
+        Parrot_io_eprintf(interp->pdb->debugger, "%s\n", cmd->help);
     }
     else {
         if (c == 0) {
             /* C89: strings need to be 509 chars or less */
-            PIO_eprintf(interp->pdb->debugger, "\
+            Parrot_io_eprintf(interp->pdb->debugger, "\
 List of commands:\n\
     disassemble  -- disassemble the bytecode\n\
     load         -- load a source code file\n\
@@ -3184,7 +3184,7 @@
     disable      -- disable a breakpoint\n\
     enable       -- reenable a disabled breakpoint\n\
     continue (c) -- continue the program execution\n");
-            PIO_eprintf(interp->pdb->debugger, "\
+            Parrot_io_eprintf(interp->pdb->debugger, "\
     next     (n) -- run the next instruction\n\
     eval     (e) -- run an instruction\n\
     trace    (t) -- trace the next instruction\n\
@@ -3197,7 +3197,7 @@
 Type \"help\" followed by a command name for full documentation.\n\n");
         }
         else {
-            PIO_eprintf(interp->pdb->debugger, "Unknown command: %s\n", command);
+            Parrot_io_eprintf(interp->pdb->debugger, "Unknown command: %s\n", command);
         }
     }
 }
@@ -3226,7 +3226,7 @@
     if (!PMC_IS_NULL(sub)) {
         str = Parrot_Context_infostr(interp, ctx);
         if (str)
-            PIO_eprintf(interp, "%Ss\n", str);
+            Parrot_io_eprintf(interp, "%Ss\n", str);
     }
 
     /* backtrace: follow the continuation chain */
@@ -3256,13 +3256,13 @@
                 ++rec_level;
         }
         else if (rec_level != 0) {
-            PIO_eprintf(interp, "... call repeated %d times\n", rec_level);
+            Parrot_io_eprintf(interp, "... call repeated %d times\n", rec_level);
             rec_level = 0;
         }
 
         /* print the context description */
         if (rec_level == 0)
-            PIO_eprintf(interp, "%Ss\n", str);
+            Parrot_io_eprintf(interp, "%Ss\n", str);
 
         /* get the next Continuation */
         ctx = PMC_cont(sub)->to_ctx;
@@ -3273,7 +3273,7 @@
     }
 
     if (rec_level != 0)
-        PIO_eprintf(interp, "... call repeated %d times\n", rec_level);
+        Parrot_io_eprintf(interp, "... call repeated %d times\n", rec_level);
 }
 
 /*
@@ -3363,8 +3363,8 @@
 
         for (n = 0; n < max_reg; n++) {
             /* this must be done in two chunks because PMC's print directly. */
-            PIO_eprintf(interp, "\n  %c%d = ", reg_type, n);
-            PIO_eprintf(interp, "%s", GDB_print_reg(interp, t, n));
+            Parrot_io_eprintf(interp, "\n  %c%d = ", reg_type, n);
+            Parrot_io_eprintf(interp, "%s", GDB_print_reg(interp, t, n));
         }
         return "";
     }

Modified: trunk/src/dynoplibs/myops.ops
==============================================================================
--- trunk/src/dynoplibs/myops.ops	(original)
+++ trunk/src/dynoplibs/myops.ops	Mon Dec  8 21:16:33 2008
@@ -61,7 +61,7 @@
 =cut
 
 op q() :flow {
-    PIO_printf(interp, ".loadlib \"myops_ops\"\nq\n");
+    Parrot_io_printf(interp, ".loadlib \"myops_ops\"\nq\n");
     HALT();
 }
 

Modified: trunk/src/embed.c
==============================================================================
--- trunk/src/embed.c	(original)
+++ trunk/src/embed.c	Mon Dec  8 21:16:33 2008
@@ -394,14 +394,14 @@
 
         /* can't read a file that doesn't exist */
         if (!Parrot_stat_info_intval(interp, fs, STAT_EXISTS)) {
-            PIO_eprintf(interp, "Parrot VM: Can't stat %s, code %i.\n",
+            Parrot_io_eprintf(interp, "Parrot VM: Can't stat %s, code %i.\n",
                     fullname, errno);
             return NULL;
         }
 
         /* we may need to relax this if we want to read bytecode from pipes */
         if (!Parrot_stat_info_intval(interp, fs, STAT_ISREG)) {
-            PIO_eprintf(interp, "Parrot VM: '%s', is not a regular file %i.\n",
+            Parrot_io_eprintf(interp, "Parrot VM: '%s', is not a regular file %i.\n",
                     fullname, errno);
             return NULL;
         }
@@ -412,7 +412,7 @@
         io = fopen(fullname, "rb");
 
         if (!io) {
-            PIO_eprintf(interp, "Parrot VM: Can't open %s, code %i.\n",
+            Parrot_io_eprintf(interp, "Parrot VM: Can't open %s, code %i.\n",
                     fullname, errno);
             return NULL;
         }
@@ -442,7 +442,7 @@
                 (char *)mem_sys_realloc(program_code, program_size + chunk_size);
 
             if (!program_code) {
-                PIO_eprintf(interp,
+                Parrot_io_eprintf(interp,
                             "Parrot VM: Could not reallocate buffer "
                             "while reading packfile from PIO.\n");
                 return NULL;
@@ -452,7 +452,7 @@
         }
 
         if (ferror(io)) {
-            PIO_eprintf(interp, "Parrot VM: Problem reading packfile from PIO:  code %d.\n",
+            Parrot_io_eprintf(interp, "Parrot VM: Problem reading packfile from PIO:  code %d.\n",
                         ferror(io));
             return NULL;
         }
@@ -472,7 +472,7 @@
         fd = open(fullname, O_RDONLY | O_BINARY);
 
         if (!fd) {
-            PIO_eprintf(interp, "Parrot VM: Can't open %s, code %i.\n",
+            Parrot_io_eprintf(interp, "Parrot VM: Can't open %s, code %i.\n",
                     fullname, errno);
             return NULL;
         }
@@ -488,7 +488,7 @@
             /* try again, now with IO reading the file */
             io = fopen(fullname, "rb");
             if (!io) {
-                PIO_eprintf(interp, "Parrot VM: Can't open %s, code %i.\n",
+                Parrot_io_eprintf(interp, "Parrot VM: Can't open %s, code %i.\n",
                         fullname, errno);
                 return NULL;
             }
@@ -498,7 +498,7 @@
 
 #else   /* PARROT_HAS_HEADER_SYSMMAN */
 
-        PIO_eprintf(interp, "Parrot VM: uncaught error occurred reading "
+        Parrot_io_eprintf(interp, "Parrot VM: uncaught error occurred reading "
                     "file or mmap not available.\n");
         return NULL;
 
@@ -512,7 +512,7 @@
 
     if (!PackFile_unpack(interp, pf, (opcode_t *)program_code,
             (size_t)program_size)) {
-        PIO_eprintf(interp, "Parrot VM: Can't unpack packfile %s.\n",
+        Parrot_io_eprintf(interp, "Parrot VM: Can't unpack packfile %s.\n",
                 fullname);
         return NULL;
     }
@@ -551,7 +551,7 @@
 Parrot_loadbc(PARROT_INTERP, NOTNULL(PackFile *pf))
 {
     if (pf == NULL) {
-        PIO_eprintf(interp, "Invalid packfile\n");
+        Parrot_io_eprintf(interp, "Invalid packfile\n");
         return;
     }
 
@@ -578,7 +578,7 @@
     PMC   *userargv;
 
     if (Interp_debug_TEST(interp, PARROT_START_DEBUG_FLAG)) {
-        PIO_eprintf(interp,
+        Parrot_io_eprintf(interp,
             "*** Parrot VM: Setting up ARGV array.  Current argc: %d ***\n",
             argc);
     }
@@ -598,7 +598,7 @@
                 PObj_external_FLAG);
 
         if (Interp_debug_TEST(interp, PARROT_START_DEBUG_FLAG))
-            PIO_eprintf(interp, "\t%vd: %s\n", i, argv[i]);
+            Parrot_io_eprintf(interp, "\t%vd: %s\n", i, argv[i]);
 
         VTABLE_push_string(interp, userargv, arg);
     }
@@ -722,10 +722,10 @@
         FLOATVAL       sum_time   = 0.0;
         const FLOATVAL empty      = calibrate(interp);
 
-        PIO_printf(interp,
+        Parrot_io_printf(interp,
                    "Calibration: overhead = %.6f ms/op\n", 1000.0 * empty);
 
-        PIO_printf(interp,
+        Parrot_io_printf(interp,
                    " Code J Name                         "
                    "Calls  Total/s       Avg/ms\n");
 
@@ -762,7 +762,7 @@
                     op_jit[k - PARROT_PROF_EXTRA].extcall != 1)
                     jit = 'j';
 #endif
-                PIO_printf(interp, " %4d %c %-25s %8vu  %10vf  %10.6vf\n",
+                Parrot_io_printf(interp, " %4d %c %-25s %8vu  %10vf  %10.6vf\n",
                         k - PARROT_PROF_EXTRA,
                         jit,
                         op_name(interp, k),
@@ -772,7 +772,7 @@
             }
         }
 
-        PIO_printf(interp, " %4vu - %-25s %8vu  %10vf  %10.6vf\n",
+        Parrot_io_printf(interp, " %4vu - %-25s %8vu  %10vf  %10.6vf\n",
                 op_count,
                 "-",
                 call_count,
@@ -798,7 +798,7 @@
     if (Interp_debug_TEST(interp, PARROT_MEM_STAT_DEBUG_FLAG)) {
         /* Give souls brave enough to activate debugging an earful about GC. */
 
-        PIO_eprintf(interp, "*** Parrot VM: Dumping GC info ***\n");
+        Parrot_io_eprintf(interp, "*** Parrot VM: Dumping GC info ***\n");
         PDB_info(interp);
     }
 }
@@ -881,50 +881,50 @@
     PMC *userargv, *main_sub;
 
     if (Interp_debug_TEST(interp, PARROT_START_DEBUG_FLAG))
-        PIO_eprintf(interp,
+        Parrot_io_eprintf(interp,
                 "*** Parrot VM: Setting stack top. ***\n");
 
     /* Debugging mode nonsense. */
     if (Interp_debug_TEST(interp, PARROT_START_DEBUG_FLAG)) {
         if (Interp_flags_TEST(interp, PARROT_BOUNDS_FLAG)) {
-            PIO_eprintf(interp,
+            Parrot_io_eprintf(interp,
                     "*** Parrot VM: Bounds checking enabled. ***\n");
         }
 
         if (Interp_trace_TEST(interp, PARROT_TRACE_OPS_FLAG))
-            PIO_eprintf(interp, "*** Parrot VM: Tracing enabled. ***\n");
+            Parrot_io_eprintf(interp, "*** Parrot VM: Tracing enabled. ***\n");
 
-        PIO_eprintf(interp, "*** Parrot VM: ");
+        Parrot_io_eprintf(interp, "*** Parrot VM: ");
 
         switch (interp->run_core) {
             case PARROT_SLOW_CORE:
-                PIO_eprintf(interp, "Slow core");
+                Parrot_io_eprintf(interp, "Slow core");
                 break;
             case PARROT_FAST_CORE:
-                PIO_eprintf(interp, "Fast core");
+                Parrot_io_eprintf(interp, "Fast core");
                 break;
             case PARROT_SWITCH_CORE:
             case PARROT_SWITCH_JIT_CORE:
-                PIO_eprintf(interp, "Switch core");
+                Parrot_io_eprintf(interp, "Switch core");
                 break;
             case PARROT_CGP_CORE:
             case PARROT_CGP_JIT_CORE:
-                PIO_eprintf(interp, "CGP core");
+                Parrot_io_eprintf(interp, "CGP core");
                 break;
             case PARROT_CGOTO_CORE:
-                PIO_eprintf(interp, "CGoto core");
+                Parrot_io_eprintf(interp, "CGoto core");
                 break;
             case PARROT_JIT_CORE:
-                PIO_eprintf(interp, "JIT core");
+                Parrot_io_eprintf(interp, "JIT core");
                 break;
             case PARROT_EXEC_CORE:
-                PIO_eprintf(interp, "EXEC core");
+                Parrot_io_eprintf(interp, "EXEC core");
                 break;
             default:
                 Parrot_ex_throw_from_c_args(interp, NULL, 1, "Unknown run core");
         }
 
-        PIO_eprintf(interp, " ***\n");
+        Parrot_io_eprintf(interp, " ***\n");
     }
 
     /* Set up @ARGS (or whatever this language calls it) in userargv. */
@@ -1032,20 +1032,20 @@
     line   = pdb->file->line;
     debugs = (interp->code->debugs != NULL);
 
-    PIO_printf(interp, "%12s-%12s", "Seq_Op_Num", "Relative-PC");
+    Parrot_io_printf(interp, "%12s-%12s", "Seq_Op_Num", "Relative-PC");
 
     if (debugs) {
-        PIO_printf(interp, " %6s:\n", "SrcLn#");
+        Parrot_io_printf(interp, " %6s:\n", "SrcLn#");
         num_mappings = interp->code->debugs->num_mappings;
     }
     else {
-        PIO_printf(interp, "\n");
+        Parrot_io_printf(interp, "\n");
     }
 
     while (line->next) {
         const char *c;
 
-        /* PIO_printf(interp, "%i < %i %i == %i \n", curr_mapping,
+        /* Parrot_io_printf(interp, "%i < %i %i == %i \n", curr_mapping,
          * num_mappings, op_code_seq_num,
          * interp->code->debugs->mappings[curr_mapping]->offset); */
 
@@ -1053,29 +1053,31 @@
             if (op_code_seq_num == interp->code->debugs->mappings[curr_mapping]->offset) {
                 const int filename_const_offset =
                     interp->code->debugs->mappings[curr_mapping]->u.filename;
-                PIO_printf(interp, "Current Source Filename %Ss\n",
+                Parrot_io_printf(interp, "Current Source Filename %Ss\n",
                         interp->code->const_table->constants[filename_const_offset]->u.string);
                 curr_mapping++;
             }
         }
 
-        PIO_printf(interp, "%012i-%012i", op_code_seq_num, line->opcode - interp->code->base.data);
+        Parrot_io_printf(interp, "%012i-%012i",
+                op_code_seq_num, line->opcode - interp->code->base.data);
 
         if (debugs)
-            PIO_printf(interp, " %06i: ", interp->code->debugs->base.data[op_code_seq_num]);
+            Parrot_io_printf(interp, " %06i: ",
+                    interp->code->debugs->base.data[op_code_seq_num]);
 
         /* If it has a label print it */
         if (line->label)
-            PIO_printf(interp, "L%li:\t", line->label->number);
+            Parrot_io_printf(interp, "L%li:\t", line->label->number);
         else
-            PIO_printf(interp, "\t");
+            Parrot_io_printf(interp, "\t");
 
         c = pdb->file->source + line->source_offset;
 
         while (c && *c != '\n')
-            PIO_printf(interp, "%c", *(c++));
+            Parrot_io_printf(interp, "%c", *(c++));
 
-        PIO_printf(interp, "\n");
+        Parrot_io_printf(interp, "\n");
         line = line->next;
         op_code_seq_num++;
     }

Modified: trunk/src/events.c
==============================================================================
--- trunk/src/events.c	(original)
+++ trunk/src/events.c	Mon Dec  8 21:16:33 2008
@@ -805,7 +805,7 @@
     for (i = 0; i < ios->n; ++i) {
         parrot_event * const ev  = ios->events[i];
         PMC          * const pio = ev->u.io_event.pio;
-        const int            fd  = PIO_getfd(NULL, pio);
+        const int            fd  = Parrot_io_getfd(NULL, pio);
 
         if (fd == ready_rd) {
             /* remove from event list */
@@ -909,7 +909,7 @@
                                 case IO_THR_MSG_ADD_SELECT_RD:
                                     {
                                         PMC * const pio = buf.ev->u.io_event.pio;
-                                        const int fd = PIO_getfd(NULL, pio);
+                                        const int fd = Parrot_io_getfd(NULL, pio);
                                         if (FD_ISSET(fd, &act_rfds)) {
                                             mem_sys_free(buf.ev);
                                             break;

Modified: trunk/src/exceptions.c
==============================================================================
--- trunk/src/exceptions.c	(original)
+++ trunk/src/exceptions.c	Mon Dec  8 21:16:33 2008
@@ -112,16 +112,16 @@
         const INTVAL   severity    = VTABLE_get_integer_keyed_str(interp, exception, CONST_STRING(interp, "severity"));
 
         /* flush interpreter output to get things printed in order */
-        PIO_flush(interp, PIO_STDOUT(interp));
-        PIO_flush(interp, PIO_STDERR(interp));
+        Parrot_io_flush(interp, Parrot_io_STDOUT(interp));
+        Parrot_io_flush(interp, Parrot_io_STDERR(interp));
 
         if (interp->debugger) {
-            PIO_flush(interp->debugger, PIO_STDOUT(interp->debugger));
-            PIO_flush(interp->debugger, PIO_STDERR(interp->debugger));
+            Parrot_io_flush(interp->debugger, Parrot_io_STDOUT(interp->debugger));
+            Parrot_io_flush(interp->debugger, Parrot_io_STDERR(interp->debugger));
         }
 
         if (string_equal(interp, message, CONST_STRING(interp, "")) == 1) {
-            PIO_eprintf(interp, "%S\n", message);
+            Parrot_io_eprintf(interp, "%S\n", message);
 
             /* caution against output swap (with PDB_backtrace) */
             fflush(stderr);
@@ -132,7 +132,7 @@
             exit_status = VTABLE_get_integer_keyed_str(interp, exception, CONST_STRING(interp, "exit_code"));
         }
         else {
-            PIO_eprintf(interp, "No exception handler and no message\n");
+            Parrot_io_eprintf(interp, "No exception handler and no message\n");
             /* caution against output swap (with PDB_backtrace) */
             fflush(stderr);
             PDB_backtrace(interp);
@@ -294,7 +294,7 @@
         STRING *msg      = VTABLE_get_string(interp, exception);
         int     exitcode = VTABLE_get_integer_keyed_str(interp, exception, CONST_STRING(interp, "exit_code"));
 
-        PIO_eprintf(interp,
+        Parrot_io_eprintf(interp,
             "Parrot_ex_throw_from_c (severity:%d error:%d): %Ss\n",
             EXCEPT_error, exitcode, msg);
         PDB_backtrace(interp);

Modified: trunk/src/extend.c
==============================================================================
--- trunk/src/extend.c	(original)
+++ trunk/src/extend.c	Mon Dec  8 21:16:33 2008
@@ -95,7 +95,7 @@
 
     PARROT_CALLIN_START(interp);
     str = Parrot_vsprintf_c(interp, s, args);
-    retval = PIO_putps(interp, pio, str);
+    retval = Parrot_io_putps(interp, pio, str);
     PARROT_CALLIN_END(interp);
 
     return retval;
@@ -125,11 +125,11 @@
     va_start(args, s);
 
     if (interp) {
-        retval = Parrot_vfprintf(interp, PIO_STDOUT(interp), s, args);
+        retval = Parrot_vfprintf(interp, Parrot_io_STDOUT(interp), s, args);
     }
     else {
         /* Be nice about this...
-         **   XXX BD Should this use the default PIO_STDOUT or something?
+         **   XXX BD Should this use the default Parrot_io_STDOUT or something?
          */
         retval = vfprintf(stdout, s, args);
     }
@@ -148,11 +148,11 @@
     va_start(args, s);
 
     if (interp) {
-        retval = Parrot_vfprintf(interp, PIO_STDERR(interp), s, args);
+        retval = Parrot_vfprintf(interp, Parrot_io_STDERR(interp), s, args);
     }
     else {
         /* Be nice about this...
-         **   XXX BD Should this use the default PIO_STDOUT or something?
+         **   XXX BD Should this use the default Parrot_io_STDOUT or something?
          */
         retval=vfprintf(stderr, s, args);
     }

Modified: trunk/src/gc/dod.c
==============================================================================
--- trunk/src/gc/dod.c	(original)
+++ trunk/src/gc/dod.c	Mon Dec  8 21:16:33 2008
@@ -598,13 +598,13 @@
 #if GC_VERBOSE
     if (Interp_trace_TEST(interp, 1)) {
         Interp * const tracer = interp->debugger;
-        PMC *pio       = PIO_STDERR(interp);
+        PMC *pio       = Parrot_io_STDERR(interp);
 
-        PIO_flush(interp, pio);
+        Parrot_io_flush(interp, pio);
 
         if (tracer) {
-            pio = PIO_STDERR(tracer);
-            PIO_flush(tracer, pio);
+            pio = Parrot_io_STDERR(tracer);
+            Parrot_io_flush(tracer, pio);
         }
     }
 #endif

Modified: trunk/src/gc/register.c
==============================================================================
--- trunk/src/gc/register.c	(original)
+++ trunk/src/gc/register.c	Mon Dec  8 21:16:33 2008
@@ -560,7 +560,7 @@
 #ifndef NDEBUG
         if (Interp_debug_TEST(interp, PARROT_CTX_DESTROY_DEBUG_FLAG)
             && ctx->current_sub) {
-            /* can't probably PIO_eprintf here */
+            /* can't probably Parrot_io_eprintf here */
             const Parrot_sub * const doomed = PMC_sub(ctx->current_sub);
 
             if (doomed) {

Modified: trunk/src/global.c
==============================================================================
--- trunk/src/global.c	(original)
+++ trunk/src/global.c	Mon Dec  8 21:16:33 2008
@@ -488,7 +488,7 @@
 
 #if DEBUG_GLOBAL
     if (globalname)
-        PIO_printf(interp, "find_global name '%Ss'\n", globalname);
+        Parrot_io_printf(interp, "find_global name '%Ss'\n", globalname);
 #endif
 
     if (PMC_IS_NULL(ns))
@@ -601,7 +601,7 @@
 {
 #if DEBUG_GLOBAL
     if (globalname)
-        PIO_printf(interp, "store_global name '%Ss'\n", globalname);
+        Parrot_io_printf(interp, "store_global name '%Ss'\n", globalname);
 #endif
 
     if (PMC_IS_NULL(ns))

Modified: trunk/src/inter_create.c
==============================================================================
--- trunk/src/inter_create.c	(original)
+++ trunk/src/inter_create.c	Mon Dec  8 21:16:33 2008
@@ -148,7 +148,7 @@
 
     /* PANIC will fail until this is done */
     interp->piodata = NULL;
-    PIO_init(interp);
+    Parrot_io_init(interp);
 
     if (is_env_var_set("PARROT_GC_DEBUG")) {
 #if ! DISABLE_GC_DEBUG
@@ -237,7 +237,7 @@
     setup_default_compreg(interp);
 
     /* setup stdio PMCs */
-    PIO_init(interp);
+    Parrot_io_init(interp);
 
     /* init IMCC compiler */
     imcc_init(interp);
@@ -331,12 +331,12 @@
         interp->arena_base->GC_block_level = 0;
 
     if (Interp_trace_TEST(interp, ~0)) {
-        PIO_eprintf(interp, "ParrotIO objects (like stdout and stderr)"
+        Parrot_io_eprintf(interp, "FileHandle objects (like stdout and stderr)"
             "are about to be closed, so clearing trace flags.\n");
         Interp_trace_CLEAR(interp, ~0);
     }
 
-    /* Destroys all PMCs, even constants and the ParrotIO objects for
+    /* Destroys all PMCs, even constants and the FileHandle objects for
      * std{in, out, err}, so don't be verbose about DOD'ing. */
     if (interp->thread_data)
         interp->thread_data->state |= THREAD_STATE_SUSPENDED_GC;
@@ -362,16 +362,17 @@
     imcc_destroy(interp);
 
     /* Now the PIOData gets also cleared */
-    PIO_finish(interp);
+    Parrot_io_finish(interp);
 
     /*
      * now all objects that need timely destruction should be finalized
      * so terminate the event loop
      */
-    if (!interp->parent_interpreter) {
+ /*   if (!interp->parent_interpreter) {
         PIO_internal_shutdown(interp);
-/*        Parrot_kill_event_loop(interp); */
+        Parrot_kill_event_loop(interp);
     }
+  */
 
     /* we destroy all child interpreters and the last one too,
      * if the --leak-test commandline was given

Modified: trunk/src/interpreter.c
==============================================================================
--- trunk/src/interpreter.c	(original)
+++ trunk/src/interpreter.c	Mon Dec  8 21:16:33 2008
@@ -794,7 +794,7 @@
 
 #else
     UNUSED(pc);
-    PIO_eprintf(interp,
+    Parrot_io_eprintf(interp,
             "Computed goto unavailable in this configuration.\n");
     Parrot_exit(interp, 1);
 #endif

Modified: trunk/src/io.c
==============================================================================
--- trunk/src/io.c	(original)
+++ trunk/src/io.c	Mon Dec  8 21:16:33 2008
@@ -41,25 +41,29 @@
 INTVAL
 Parrot_io_parse_open_flags(PARROT_INTERP, ARGIN_NULLOK(STRING *mode_str))
 {
-    char *mode_cstr;
-    const char *s;
+    INTVAL i, mode_len;
     INTVAL flags = 0;
 
     if (STRING_IS_NULL(mode_str))
         return PIO_F_READ;
 
-    mode_cstr = string_to_cstring(interp, mode_str);
+    mode_len = string_length(interp, mode_str);
 
-    for (s = mode_cstr; *s != '\0'; s++) {
-        switch (*s) {
+    for (i = 0; i < mode_len; ++i) {
+        INTVAL s = string_index(interp, mode_str, i);
+        switch (s) {
             case 'r':
                 flags |= PIO_F_READ;
                 break;
             case 'w':
                 flags |= PIO_F_WRITE;
+                if (!(flags & PIO_F_APPEND)) /* don't truncate if appending */
+                    flags |= PIO_F_TRUNC;
                 break;
             case 'a':
                 flags |= PIO_F_APPEND;
+                if ((flags & PIO_F_TRUNC)) /* don't truncate if appending */
+                    flags &= ~PIO_F_TRUNC;
                 break;
             case 'p':
                 flags |= PIO_F_PIPE;
@@ -69,7 +73,50 @@
         }
     }
 
-    string_cstring_free(mode_cstr);
+    /* These comparisons are put in place for backward compatibility, and will
+     * be removed after a deprecation cycle. */
+    if (flags == 0) {
+        INTVAL first = string_index(interp, mode_str, 0);
+        INTVAL second = string_index(interp, mode_str, 1);
+        switch (first) {
+            case '+':
+                flags |= (PIO_F_WRITE | PIO_F_READ);
+                switch (second) {
+                    case '<':
+                        break;
+                    case '>':
+                        flags |= PIO_F_TRUNC;
+                        break;
+                    default:
+                        return 0;
+                }
+                break;
+            case '<':
+                flags |= PIO_F_READ;
+                break;
+            case '>':
+                flags |= PIO_F_WRITE;
+                if (second == '>') {
+                    flags |= PIO_F_APPEND;
+                }
+                else {
+                    flags |= PIO_F_TRUNC;
+                }
+                break;
+            case '-':       /* -| read from pipe */
+                if (second == '|') {
+                    flags |= PIO_F_PIPE | PIO_F_READ;
+                }
+                break;
+            case '|':       /* |- write to pipe */
+                if (second == '-') {
+                    flags |= PIO_F_PIPE | PIO_F_WRITE;
+                }
+                break;
+            default:
+                return 0;
+        }
+    }
 
     return flags;
 }
@@ -602,6 +649,37 @@
     handle_struct->file_pos = file_pos;
 }
 
+/*
+
+=item C<INTVAL Parrot_io_is_encoding>
+
+Check whether the encoding attribute of the filehandle matches a passed in
+string.
+
+Currently, this pokes directly into the C struct of the FileHandle PMC. This
+needs to change to a general interface that can be used by all subclasses and
+polymorphic equivalents of FileHandle. For now, hiding it behind a function, so
+it can be cleanly changed later.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_WARN_UNUSED_RESULT
+INTVAL
+Parrot_io_is_encoding(PARROT_INTERP, ARGIN(PMC *filehandle), ARGIN(STRING *value))
+{
+    Parrot_FileHandle_attributes *handle_struct = PARROT_FILEHANDLE(filehandle);
+    if (STRING_IS_NULL(handle_struct->encoding))
+        return 0;
+
+    if (string_equal(interp, value, handle_struct->encoding) == 0)
+        return 1;
+
+    return 0;
+}
+
 
 /*
 

Modified: trunk/src/io/api.c
==============================================================================
--- trunk/src/io/api.c	(original)
+++ trunk/src/io/api.c	Mon Dec  8 21:16:33 2008
@@ -32,20 +32,10 @@
 /* HEADERIZER HFILE: include/parrot/io.h */
 
 /*
-        The standard streams are:
-
-                interp->piodata->table[PIO_STD*_FILENO].
-*/
-
-
-/* PIOOFF_T piooffsetzero; */
-
-
-/*
 
 =back
 
-=head2 Generic top-level I/O interface
+=head2 Generic I/O interface
 
 =over 4
 
@@ -234,7 +224,8 @@
     INTVAL                ignored;
 
     if (Parrot_io_is_closed(interp, pmc))
-        return new_string_header(interp, 0);
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
+            "Cannot read from a closed filehandle");
 
     if (Parrot_io_get_buffer_flags(interp, pmc) & PIO_BF_MMAP) {
         res           = new_string_header(interp, 0);
@@ -247,7 +238,11 @@
     }
 
     res->bufused = len;
-    ignored      = Parrot_io_read_buffer(interp, pmc, &res);
+
+    if (Parrot_io_is_encoding(interp, pmc, CONST_STRING(interp, "utf8")))
+        ignored = Parrot_io_read_utf8(interp, pmc, &res);
+    else
+        ignored = Parrot_io_read_buffer(interp, pmc, &res);
     UNUSED(ignored);
 
     return res;
@@ -275,6 +270,10 @@
 
     res->strstart = buffer;
     res->bufused = len;
+
+    if (Parrot_io_is_encoding(interp, pmc, CONST_STRING(interp, "utf8")))
+        return Parrot_io_read_utf8(interp, pmc, &res);
+
     return Parrot_io_read_buffer(interp, pmc, &res);
 }
 
@@ -305,6 +304,10 @@
         fake.strlen = fake.bufused = len;
         fake.charset = Parrot_default_charset_ptr;
         fake.encoding = Parrot_default_encoding_ptr;
+
+        if (Parrot_io_is_encoding(interp, pmc, CONST_STRING(interp, "utf8")))
+            return Parrot_io_write_utf8(interp, pmc, &fake);
+
         return Parrot_io_write_buffer(interp, pmc, &fake);
     }
     else
@@ -438,11 +441,15 @@
     if (PMC_IS_NULL(pmc)
     || !VTABLE_isa(interp, pmc, CONST_STRING(interp, "FileHandle")))
         Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
-            "Cannot put to non-IO PMC");
+            "Cannot write to non-IO PMC");
 
     if (Parrot_io_is_closed(interp, pmc))
         Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
-            "Cannot put to a closed I/O handle");
+            "Cannot write to a closed filehandle");
+
+    if (!(Parrot_io_get_flags(interp, pmc) & PIO_F_WRITE))
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
+            "Cannot write to a filehandle not opened for write");
 
     if (STRING_IS_NULL(s))
         return 0;
@@ -453,6 +460,9 @@
         Parrot_do_dod_run(interp, GC_trace_stack_FLAG);
 #endif
 
+    if (Parrot_io_is_encoding(interp, pmc, CONST_STRING(interp, "utf8")))
+        return Parrot_io_write_utf8(interp, pmc, s);
+
     return Parrot_io_write_buffer(interp, pmc, s);
 }
 
@@ -540,7 +550,7 @@
     if (interp) {
         STRING * const str = Parrot_vsprintf_c(interp, s, args);
 
-        ret = PIO_putps(interp, _PIO_STDERR(interp), str);
+        ret = Parrot_io_putps(interp, _PIO_STDERR(interp), str);
     }
     else {
         /* Be nice about this...
@@ -574,7 +584,7 @@
 
 /*
 
-=item C<INTVAL Parrot_io_isatty>
+=item C<INTVAL Parrot_io_is_tty>
 
 Returns a boolean value indicating whether C<*pmc> is a console/tty.
 

Modified: trunk/src/io/buffer.c
==============================================================================
--- trunk/src/io/buffer.c	(original)
+++ trunk/src/io/buffer.c	Mon Dec  8 21:16:33 2008
@@ -75,7 +75,7 @@
 
     /* If there is already a buffer, make sure we flush before modifying it. */
     if (buffer_start)
-        Parrot_io_flush_buffer(interp, filehandle);
+        Parrot_io_flush(interp, filehandle);
 
     /* Choose an appropriate buffer size for caller */
     switch (bufsize) {
@@ -273,15 +273,18 @@
     size_t len;
     size_t current = 0;
     INTVAL buffer_flags = Parrot_io_get_buffer_flags(interp, filehandle);
-    unsigned char *buffer_start = Parrot_io_get_buffer_start(interp, filehandle);
-    unsigned char *buffer_next  = Parrot_io_get_buffer_next(interp, filehandle);
-    unsigned char *buffer_end   = Parrot_io_get_buffer_end(interp, filehandle);
+    unsigned char *buffer_start, *buffer_next, *buffer_end;
 
     /* write buffer flush */
     if (buffer_flags & PIO_BF_WRITEBUF) {
-        Parrot_io_flush_buffer(interp, filehandle);
+        Parrot_io_flush(interp, filehandle);
+        buffer_flags = Parrot_io_get_buffer_flags(interp, filehandle);
     }
 
+    buffer_start = Parrot_io_get_buffer_start(interp, filehandle);
+    buffer_next  = Parrot_io_get_buffer_next(interp, filehandle);
+    buffer_end   = Parrot_io_get_buffer_end(interp, filehandle);
+
     /* line buffered read */
     if (Parrot_io_get_flags(interp, filehandle) & PIO_F_LINEBUF) {
         return Parrot_io_readline_buffer(interp, filehandle, buf);
@@ -310,19 +313,20 @@
 
         /* buffer completed */
         if (current == avail) {
-            Parrot_io_set_buffer_flags(interp, filehandle,
-                    (buffer_flags & ~PIO_BF_READBUF));
+            buffer_flags &= ~PIO_BF_READBUF;
+            Parrot_io_set_buffer_flags(interp, filehandle, buffer_flags);
             /* Reset next and end */
             Parrot_io_set_buffer_end(interp, filehandle, NULL);
             Parrot_io_set_buffer_next(interp, filehandle, buffer_start);
         }
 
+        /* requested length satisfied */
         if (len == current) {
             s->strlen = s->bufused = len;
             return current;
         }
         else {
-            /* more data needed from downlayer */
+            /* more data needed */
             out_buf += current;
             len -= current;
         }
@@ -347,10 +351,15 @@
         }
 
         got = Parrot_io_fill_readbuf(interp, filehandle);
-        len = len < got ? len : got;
+        len = (len < got)
+            ? len
+            : (got > 0) ? got : 0;
     }
 
     /* read from the read_buffer */
+    buffer_start = Parrot_io_get_buffer_start(interp, filehandle);
+    buffer_next  = Parrot_io_get_buffer_next(interp, filehandle);
+    buffer_end   = Parrot_io_get_buffer_end(interp, filehandle);
 
     memcpy(out_buf, buffer_next, len);
     s->strlen    = s->bufused = current + len;
@@ -390,16 +399,19 @@
     size_t  avail = 0;
 
     INTVAL         buffer_flags = Parrot_io_get_buffer_flags(interp, filehandle);
-    unsigned char *buffer_next  = Parrot_io_get_buffer_next(interp, filehandle);
-    unsigned char *buffer_end   = Parrot_io_get_buffer_end(interp, filehandle);
+    unsigned char *buffer_next, *buffer_end;
 
     STRING * const s = Parrot_io_make_string(interp, buf, 1);
 
     /* write buffer flush */
     if (buffer_flags & PIO_BF_WRITEBUF) {
-        Parrot_io_flush_buffer(interp, filehandle);
+        Parrot_io_flush(interp, filehandle);
+        buffer_flags = Parrot_io_get_buffer_flags(interp, filehandle);
     }
 
+    buffer_next  = Parrot_io_get_buffer_next(interp, filehandle);
+    buffer_end   = Parrot_io_get_buffer_end(interp, filehandle);
+
     /* read Data from buffer */
     if (buffer_flags & PIO_BF_READBUF) {
         avail = buffer_end - buffer_next;
@@ -508,6 +520,9 @@
             s->strlen = s->bufused = l;
             if (Parrot_io_fill_readbuf(interp, filehandle) == 0)
                 return l;
+
+            buffer_next = Parrot_io_get_buffer_next(interp, filehandle);
+            buffer_end  = Parrot_io_get_buffer_end(interp, filehandle);
             buf_start = Parrot_io_get_buffer_start(interp, filehandle);
         }
     }
@@ -527,7 +542,7 @@
     /* check if buffer is finished */
     if (buffer_next == buffer_end) {
         Parrot_io_set_buffer_flags(interp, filehandle,
-                (buffer_flags & ~PIO_BF_READBUF));
+                (Parrot_io_get_buffer_flags(interp, filehandle) & ~PIO_BF_READBUF));
         Parrot_io_set_buffer_next(interp, filehandle,
                 Parrot_io_get_buffer_start(interp, filehandle));
         Parrot_io_set_buffer_end(interp, filehandle, NULL);
@@ -567,7 +582,8 @@
     else if (buffer_flags & PIO_BF_READBUF) {
         buffer_flags &= ~PIO_BF_READBUF;
         Parrot_io_set_buffer_flags(interp, filehandle, buffer_flags);
-        Parrot_io_set_buffer_next(interp, filehandle, buffer_start);
+        buffer_next = buffer_start;
+        Parrot_io_set_buffer_next(interp, filehandle, buffer_next);
         avail = buffer_size;
     }
     else {
@@ -597,7 +613,7 @@
     if (need_flush || len >= buffer_size) {
         long wrote;
         /* Write through, skip buffer. */
-        Parrot_io_flush_buffer(interp, filehandle);
+        Parrot_io_flush(interp, filehandle);
         wrote = PIO_WRITE(interp, filehandle, s);
         if (wrote == (long)len) {
             Parrot_io_set_file_position(interp, filehandle, (wrote +
@@ -625,13 +641,16 @@
         Parrot_io_set_buffer_flags(interp, filehandle, buffer_flags);
         /* Fill remainder, flush, then try to buffer more */
         memcpy(buffer_next, buffer, avail);
-        Parrot_io_set_buffer_next(interp, filehandle, buffer_next);
         buffer_next += avail;
+        Parrot_io_set_buffer_next(interp, filehandle, buffer_next);
         Parrot_io_set_file_position(interp, filehandle, (avail +
                     Parrot_io_get_file_position(interp, filehandle)));
-        Parrot_io_flush_buffer(interp, filehandle);
+        Parrot_io_flush(interp, filehandle);
+        buffer_next = Parrot_io_get_buffer_next(interp, filehandle);
         memcpy(buffer_start, ((const char *)buffer + avail), diff);
+        Parrot_io_set_buffer_start(interp, filehandle, buffer_start);
         buffer_next += diff;
+        Parrot_io_set_buffer_next(interp, filehandle, buffer_next);
         Parrot_io_set_file_position(interp, filehandle, (diff +
                     Parrot_io_get_file_position(interp, filehandle)));
         return len;
@@ -679,7 +698,7 @@
 
     if ((newpos < file_pos - (buffer_next - buffer_start))
         || (newpos >= file_pos + (buffer_end - buffer_next))) {
-        Parrot_io_flush_buffer(interp, filehandle);
+        Parrot_io_flush(interp, filehandle);
         newpos = PIO_SEEK(interp, filehandle, newpos, SEEK_SET);
     }
     else {

Modified: trunk/src/io/io_private.h
==============================================================================
--- trunk/src/io/io_private.h	(original)
+++ trunk/src/io/io_private.h	Mon Dec  8 21:16:33 2008
@@ -68,402 +68,22 @@
 #define PIO_BF_WRITEBUF 00000004        /* Buffer is write-buffer       */
 #define PIO_BF_MMAP     00000010        /* Buffer mmap()ed              */
 
-/*
- * Layer flags
- *
- * Terminal layer can't be pushed on top of other layers;
- * vice-versa, non-terminal layers be pushed on an empty io stack
- * An OS layer would be a terminal layer, non-terminals might be
- * buffering, translation, compression or encryption layers.
- */
-#define PIO_L_TERMINAL          0x0001
-#define PIO_L_FASTGETS          0x0002  /* ??? */
-#define PIO_L_LAYER_COPIED      0x0004  /* PMC has private layer */
-
 
 #define PIO_ACCMODE     0000003
 #define PIO_DEFAULTMODE DEFAULT_OPEN_MODE
 #define PIO_UNBOUND     (size_t)-1
 
-typedef struct _ParrotIOBuf ParrotIOBuf;
 typedef PMC **ParrotIOTable;
 
-struct _ParrotIOBuf {
-    INTVAL flags;               /* Buffer specific flags        */
-    size_t size;
-    unsigned char *startb;      /* Start of buffer              */
-    unsigned char *endb;        /* End of buffer                */
-    unsigned char *next;        /* Current read/write pointer   */
-};
-
-struct _ParrotIO {
-    PIOHANDLE fd;               /* Low level OS descriptor      */
-    PIOHANDLE fd2;              /* For pipes we need 2nd handle */
-    INTVAL mode;                /* Read/Write/etc.              */
-    INTVAL flags;               /* Da flags                     */
-    PIOOFF_T fsize;             /* Current file size            */
-    PIOOFF_T fpos;              /* Current real file pointer    */
-    PIOOFF_T lpos;              /* Last file position           */
-    ParrotIOBuf b;              /* Buffer structure             */
-    ParrotIOLayer *stack;
-    INTVAL recsep;              /* Record Separator             */
-#if PARROT_NET_DEVEL
-    struct sockaddr_in local;
-    struct sockaddr_in remote;
-#endif /* PARROT_NET_DEVEL */
-    /* ParrotIOFilter * filters; */
-};
-
 struct _ParrotIOData {
     ParrotIOTable table;
-    ParrotIOLayer *default_stack;
 };
 
-/* functions internal to the subsystem */
-
 /* redefine PIO_STD* for internal use */
 #define _PIO_STDIN(i)   (((ParrotIOData*)(i)->piodata)->table[PIO_STDIN_FILENO])
 #define _PIO_STDOUT(i)  (((ParrotIOData*)(i)->piodata)->table[PIO_STDOUT_FILENO])
 #define _PIO_STDERR(i)  (((ParrotIOData*)(i)->piodata)->table[PIO_STDERR_FILENO])
 
-/*
- * These function walk down the layerstack starting at l
- * and calling the first non-null function it finds.
- */
-
-/* HEADERIZER BEGIN: src/io/io_layers.c */
-/* HEADERIZER END: src/io/io_layers.c */
-
-/* HEADERIZER BEGIN: src/io/io_passdown.c */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-ParrotIO * PIO_accept_down(PARROT_INTERP,
-    ARGIN_NULLOK(ParrotIOLayer *layer),
-    ARGMOD(ParrotIO *io))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*io);
-
-PARROT_WARN_UNUSED_RESULT
-INTVAL PIO_bind_down(PARROT_INTERP,
-    ARGIN_NULLOK(ParrotIOLayer *layer),
-    ARGMOD(ParrotIO *io),
-    ARGMOD(STRING *address))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        FUNC_MODIFIES(*io)
-        FUNC_MODIFIES(*address);
-
-PARROT_WARN_UNUSED_RESULT
-INTVAL PIO_close_down(PARROT_INTERP,
-    ARGIN_NULLOK(ParrotIOLayer *layer),
-    ARGMOD(ParrotIO *io))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*io);
-
-PARROT_WARN_UNUSED_RESULT
-INTVAL PIO_connect_down(PARROT_INTERP,
-    ARGIN_NULLOK(ParrotIOLayer *layer),
-    ARGMOD(ParrotIO *io),
-    ARGMOD(STRING *address))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        FUNC_MODIFIES(*io)
-        FUNC_MODIFIES(*address);
-
-PARROT_WARN_UNUSED_RESULT
-INTVAL PIO_eof_down(PARROT_INTERP,
-    ARGIN_NULLOK(ParrotIOLayer *layer),
-    ARGMOD(ParrotIO *io))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*io);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-ParrotIO * PIO_fdopen_down(PARROT_INTERP,
-    ARGIN_NULLOK(ParrotIOLayer *layer),
-    PIOHANDLE fd,
-    INTVAL flags)
-        __attribute__nonnull__(1);
-
-PARROT_WARN_UNUSED_RESULT
-INTVAL PIO_flush_down(PARROT_INTERP,
-    ARGMOD_NULLOK(ParrotIOLayer *layer),
-    ARGMOD(ParrotIO *io))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*io);
-
-PARROT_WARN_UNUSED_RESULT
-INTVAL PIO_listen_down(PARROT_INTERP,
-    ARGIN_NULLOK(ParrotIOLayer *layer),
-    ARGMOD(ParrotIO *io),
-    INTVAL backlog)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*io);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-ParrotIO * PIO_open_async_down(PARROT_INTERP,
-    ARGIN_NULLOK(ParrotIOLayer *layer),
-    ARGIN(const char *name),
-    ARGIN(const char *mode),
-    ARGIN(DummyCodeRef *dummy))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        __attribute__nonnull__(5);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-ParrotIO * PIO_open_down(PARROT_INTERP,
-    ARGIN_NULLOK(ParrotIOLayer *layer),
-    ARGIN(const char *name),
-    INTVAL flags)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3);
-
-PARROT_WARN_UNUSED_RESULT
-size_t PIO_peek_down(PARROT_INTERP,
-    ARGIN_NULLOK(ParrotIOLayer *layer),
-    ARGMOD(ParrotIO *io),
-    ARGOUT(STRING **buf))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        FUNC_MODIFIES(*io)
-        FUNC_MODIFIES(*buf);
-
-PARROT_WARN_UNUSED_RESULT
-INTVAL PIO_poll_down(PARROT_INTERP,
-    ARGIN_NULLOK(ParrotIOLayer *layer),
-    ARGMOD(ParrotIO *io),
-    INTVAL which,
-    INTVAL sec,
-    INTVAL usec)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*io);
-
-PARROT_WARN_UNUSED_RESULT
-size_t PIO_read_async_down(PARROT_INTERP,
-    ARGIN_NULLOK(ParrotIOLayer *layer),
-    ARGMOD(ParrotIO *io),
-    ARGOUT(STRING **buf),
-    ARGIN(DummyCodeRef *dummy))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        __attribute__nonnull__(5)
-        FUNC_MODIFIES(*io)
-        FUNC_MODIFIES(*buf);
-
-PARROT_WARN_UNUSED_RESULT
-size_t PIO_read_down(PARROT_INTERP,
-    ARGIN_NULLOK(ParrotIOLayer *layer),
-    ARGMOD(ParrotIO *io),
-    ARGOUT(STRING **buf))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        FUNC_MODIFIES(*io)
-        FUNC_MODIFIES(*buf);
-
-PARROT_WARN_UNUSED_RESULT
-INTVAL PIO_recv_down(PARROT_INTERP,
-    ARGIN_NULLOK(ParrotIOLayer *layer),
-    ARGMOD(ParrotIO *io),
-    ARGOUT(STRING **buf))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        FUNC_MODIFIES(*io)
-        FUNC_MODIFIES(*buf);
-
-PARROT_WARN_UNUSED_RESULT
-PIOOFF_T PIO_seek_down(PARROT_INTERP,
-    ARGIN_NULLOK(ParrotIOLayer *layer),
-    ARGMOD(ParrotIO *io),
-    PIOOFF_T offset,
-    INTVAL whence)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*io);
-
-PARROT_WARN_UNUSED_RESULT
-INTVAL PIO_send_down(PARROT_INTERP,
-    ARGIN_NULLOK(ParrotIOLayer *layer),
-    ARGMOD(ParrotIO *io),
-    ARGMOD(STRING *buf))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        FUNC_MODIFIES(*io)
-        FUNC_MODIFIES(*buf);
-
-PARROT_WARN_UNUSED_RESULT
-INTVAL PIO_setbuf_down(PARROT_INTERP,
-    ARGIN_NULLOK(ParrotIOLayer *layer),
-    ARGMOD(ParrotIO *io),
-    size_t bufsize)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*io);
-
-PARROT_WARN_UNUSED_RESULT
-INTVAL PIO_setlinebuf_down(PARROT_INTERP,
-    ARGIN_NULLOK(ParrotIOLayer *layer),
-    ARGMOD(ParrotIO *io))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*io);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-ParrotIO * PIO_socket_down(PARROT_INTERP,
-    ARGIN_NULLOK(ParrotIOLayer *layer),
-    INTVAL fam,
-    INTVAL type,
-    INTVAL proto)
-        __attribute__nonnull__(1);
-
-PARROT_WARN_UNUSED_RESULT
-PIOOFF_T PIO_tell_down(PARROT_INTERP,
-    ARGIN_NULLOK(ParrotIOLayer *layer),
-    ARGMOD(ParrotIO *io))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*io);
-
-PARROT_WARN_UNUSED_RESULT
-size_t PIO_write_async_down(PARROT_INTERP,
-    ARGIN_NULLOK(ParrotIOLayer *layer),
-    ARGMOD(ParrotIO *io),
-    ARGMOD(STRING *s),
-    ARGIN(DummyCodeRef *dummy))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        __attribute__nonnull__(5)
-        FUNC_MODIFIES(*io)
-        FUNC_MODIFIES(*s);
-
-PARROT_WARN_UNUSED_RESULT
-size_t PIO_write_down(PARROT_INTERP,
-    ARGIN_NULLOK(ParrotIOLayer *layer),
-    ARGMOD(ParrotIO *io),
-    ARGMOD(STRING *s))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        FUNC_MODIFIES(*io)
-        FUNC_MODIFIES(*s);
-
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: src/io/io_passdown.c */
-
-/*
- * By default, any layer not implementing an interface (ie. leaving
- * null value for a function) implicitly passes calls to the
- * next layer. To override or shadow an API the layer must implement
- * the specific call.
- */
-struct _ParrotIOLayerAPI {
-    INTVAL (*Init)(PARROT_INTERP, ParrotIOLayer * l);
-    ParrotIOLayer * (*New)(const ParrotIOLayer * proto);
-    void (*Delete)(ParrotIOLayer * l);
-    INTVAL (*Pushed)(ParrotIOLayer * l, ParrotIO * io);
-    INTVAL (*Popped)(ParrotIOLayer * l, ParrotIO * io);
-    ParrotIO *      (*Open)(PARROT_INTERP, ParrotIOLayer * l,
-                            const char * name, INTVAL flags);
-    ParrotIO *      (*Open2_Unused)(PARROT_INTERP);
-    ParrotIO *      (*Open3_Unused)(PARROT_INTERP);
-    ParrotIO *      (*Open_ASync)(PARROT_INTERP, ParrotIOLayer * l,
-                                  const char * name, const char * mode,
-                                  DummyCodeRef *);
-    ParrotIO *      (*FDOpen)(PARROT_INTERP, ParrotIOLayer * l,
-                              PIOHANDLE fd, INTVAL flags);
-    INTVAL (*Close)(PARROT_INTERP, ParrotIOLayer * l,
-                                ParrotIO * io);
-    size_t (*Write)(PARROT_INTERP, ParrotIOLayer * l,
-                             ParrotIO * io, STRING *);
-    size_t (*Write_ASync)(PARROT_INTERP, ParrotIOLayer * layer,
-                                   ParrotIO * io, STRING *, DummyCodeRef *);
-    size_t (*Read)(PARROT_INTERP, ParrotIOLayer * layer,
-                            ParrotIO * io, STRING **);
-    size_t (*Read_ASync)(PARROT_INTERP, ParrotIOLayer * layer,
-                                  ParrotIO * io, STRING **, DummyCodeRef *);
-    INTVAL (*Flush)(PARROT_INTERP, ParrotIOLayer * layer,
-                             ParrotIO * io);
-    size_t (*Peek)(PARROT_INTERP, ParrotIOLayer * layer,
-                            ParrotIO * io, STRING ** buf);
-    PIOOFF_T (*Seek)(PARROT_INTERP, ParrotIOLayer * layer,
-                            ParrotIO * io, PIOOFF_T offset, INTVAL whence);
-    PIOOFF_T (*Tell)(PARROT_INTERP, ParrotIOLayer * layer,
-                            ParrotIO * io);
-    INTVAL (*SetBuf)(PARROT_INTERP, ParrotIOLayer * layer,
-                              ParrotIO * io, size_t bufsize);
-    INTVAL (*SetLineBuf)(PARROT_INTERP, ParrotIOLayer * layer,
-                                  ParrotIO * io);
-    INTVAL (*GetCount)(PARROT_INTERP, ParrotIOLayer * layer);
-    INTVAL (*Fill)(PARROT_INTERP, ParrotIOLayer * layer);
-    INTVAL (*Eof)(PARROT_INTERP, ParrotIOLayer * l,
-                           ParrotIO * io);
-    /* Network API */
-    INTVAL (*Poll)(PARROT_INTERP, ParrotIOLayer *l, ParrotIO *io,
-                            int which, int sec, int usec);
-    ParrotIO *      (*Socket)(PARROT_INTERP, ParrotIOLayer *,
-                            int dom, int type, int proto);
-    INTVAL (*Connect)(PARROT_INTERP, ParrotIOLayer *, ParrotIO *,
-                            STRING *);
-    INTVAL (*Send)(PARROT_INTERP, ParrotIOLayer *, ParrotIO *, STRING *);
-    INTVAL (*Recv)(PARROT_INTERP, ParrotIOLayer *, ParrotIO *, STRING **);
-    INTVAL (*Bind)(PARROT_INTERP, ParrotIOLayer *, ParrotIO *, STRING *);
-    INTVAL (*Listen)(PARROT_INTERP, ParrotIOLayer *, ParrotIO *, INTVAL);
-    ParrotIO *      (*Accept)(PARROT_INTERP, ParrotIOLayer *, ParrotIO *);
-};
-
-/* these are defined rather than using NULL because strictly-speaking, ANSI C
- * doesn't like conversions between function and non-function pointers. */
-#define PIO_null_init (INTVAL (*)(PARROT_INTERP, ParrotIOLayer *))0
-#define PIO_null_push_layer (INTVAL (*)(ParrotIOLayer *, ParrotIO *))0
-#define PIO_null_pop_layer (INTVAL (*)(ParrotIOLayer *, ParrotIO *))0
-#define PIO_null_open (ParrotIO * (*)(PARROT_INTERP, ParrotIOLayer *, const char*, INTVAL))0
-#define PIO_null_open2 (ParrotIO * (*)(PARROT_INTERP))0
-#define PIO_null_open3 (ParrotIO * (*)(PARROT_INTERP))0
-#define PIO_null_open_async (ParrotIO * (*)(PARROT_INTERP, ParrotIOLayer *, const char *, const char *, DummyCodeRef *))0
-#define PIO_null_fdopen (ParrotIO * (*)(PARROT_INTERP, ParrotIOLayer *, PIOHANDLE, INTVAL))0
-#define PIO_null_close (INTVAL (*)(PARROT_INTERP, ParrotIOLayer *, ParrotIO *))0
-#define PIO_null_write (size_t (*)(PARROT_INTERP, ParrotIOLayer *, ParrotIO *, STRING*))0
-#define PIO_null_write_async (size_t (*)(PARROT_INTERP, ParrotIOLayer *, ParrotIO *, STRING *, DummyCodeRef *))0
-#define PIO_null_read (size_t (*)(PARROT_INTERP, ParrotIOLayer *, ParrotIO *, STRING**))0
-#define PIO_null_read_async (size_t (*)(PARROT_INTERP, ParrotIOLayer *, ParrotIO *, STRING **, DummyCodeRef *))0
-#define PIO_null_flush (INTVAL (*)(PARROT_INTERP, ParrotIOLayer *, ParrotIO *))0
-#define PIO_null_peek (size_t (*)(PARROT_INTERP, ParrotIOLayer *, ParrotIO *, STRING**))0
-#define PIO_null_seek (PIOOFF_T (*)(PARROT_INTERP, ParrotIOLayer *, ParrotIO *, PIOOFF_T, INTVAL))0
-#define PIO_null_tell (PIOOFF_T (*)(PARROT_INTERP, ParrotIOLayer *, ParrotIO *))0
-#define PIO_null_setbuf (INTVAL (*)(PARROT_INTERP, ParrotIOLayer *, ParrotIO *, size_t))0
-#define PIO_null_setlinebuf (INTVAL (*)(PARROT_INTERP, ParrotIOLayer *, ParrotIO *))0
-#define PIO_null_getcount (INTVAL (*)(PARROT_INTERP, ParrotIOLayer *))0
-#define PIO_null_fill (INTVAL (*)(PARROT_INTERP, ParrotIOLayer *))0
-#define PIO_null_eof (INTVAL (*)(PARROT_INTERP, ParrotIOLayer *, ParrotIO *))0
-#define PIO_null_socket (ParrotIO * (*)(PARROT_INTERP, ParrotIOLayer *, int, int, int))0
-
-/*
- * more API XXX should be in io.h when things settle
- */
-
-ParrotIOLayer * PIO_utf8_register_layer(void);
-ParrotIOLayer * PIO_mmap_register_layer(void);
-ParrotIOLayer * PIO_string_register_layer(void);
-
 /* Parrot_Socklen_t is used in POSIX accept call */
 #if PARROT_HAS_SOCKLEN_T
 typedef socklen_t Parrot_Socklen_t;
@@ -477,26 +97,12 @@
 
 =head1 SEE ALSO
 
-F<src/io/io_buf.c>,
-F<src/io/io_layers.c>,
-F<src/io/io_passdown.c>,
-F<src/io/io_stdio.c>,
-F<src/io/io_unix.c>,
-F<src/io/io_utf8.c>,
-F<src/io/io_win32.c>,
-F<src/io/io.c>.
-
-=head1 HISTORY
-
-Originally written by Melvin Smith.
-
-Refactored by Juergen Boemmels.
-
-Internal Definitions moved from F<include/parrot/io.h>.
-
-=head1 TODO
-
-Move the Layer structure to here also.
+F<src/io/api.c>,
+F<src/io/buffer.c>,
+F<src/io/portable.c>,
+F<src/io/unix.c>,
+F<src/io/utf8.c>,
+F<src/io/io_win32.c>.
 
 =cut
 

Modified: trunk/src/io/unix.c
==============================================================================
--- trunk/src/io/unix.c	(original)
+++ trunk/src/io/unix.c	Mon Dec  8 21:16:33 2008
@@ -13,8 +13,8 @@
 functions for UNIX flavors.
 
 These functions are not part of Parrot's API. Don't call them directly, call
-the C<PIO_*> macros instead. Each platform defines the standard set of macros,
-which call the correct functions for that platform.
+the C<Parrot_io_*> functions in F<src/io/api.c> instead. Each platform defines
+the standard set of macros, which call the correct functions for that platform.
 
 =head2 References:
 
@@ -474,7 +474,7 @@
         }
         else {
             /* Read returned 0, EOF if len requested > 0 */
-            if (len > 0)
+            if (len > 0 || (file_flags & PIO_F_LINEBUF))
                 Parrot_io_set_flags(interp, filehandle, (file_flags | PIO_F_EOF));
             s->bufused = s->strlen = 0;
             return bytes;

Modified: trunk/src/io/win32.c
==============================================================================
--- trunk/src/io/win32.c	(original)
+++ trunk/src/io/win32.c	Mon Dec  8 21:16:33 2008
@@ -224,8 +224,10 @@
         PMC *io;
         if (PMC_IS_NULL(filehandle))
             io = Parrot_io_new_pmc(interp, flags);
-        else
+        else {
             io = filehandle;
+            Parrot_io_set_flags(interp, io, flags);
+        }
 
         Parrot_io_set_os_handle(interp, io, fd);
         return io;
@@ -266,8 +268,10 @@
 
     if (PMC_IS_NULL(filehandle))
         io = Parrot_io_new_pmc(interp, flags);
-    else
+    else {
         io = filehandle;
+        Parrot_io_set_flags(interp, io, flags);
+    }
 
     Parrot_io_set_os_handle(interp, io, fd);
     return io;

Modified: trunk/src/jit.c
==============================================================================
--- trunk/src/jit.c	(original)
+++ trunk/src/jit.c	Mon Dec  8 21:16:33 2008
@@ -873,8 +873,8 @@
     while (cur_section) {
         Parrot_jit_register_usage_t *ru = cur_section->ru;
 
-        PIO_eprintf(interp, "\nSection:\n");
-        PIO_eprintf(interp, "%s block %d\n",
+        Parrot_io_eprintf(interp, "\nSection:\n");
+        Parrot_io_eprintf(interp, "%s block %d\n",
                 (cur_section->isjit) ? "JITTED" : "NOT JITTED",
                 cur_section->block);
         for (cur_op = cur_section->begin; cur_op <= cur_section->end;) {
@@ -883,48 +883,48 @@
             op_info = &interp->op_info_table[op];
             PDB_disassemble_op(interp, instr, sizeof (instr),
                     op_info, cur_op, NULL, code_start, 0);
-            PIO_eprintf(interp, "\t\tOP%vu: ext %3d\t%s\n",
+            Parrot_io_eprintf(interp, "\t\tOP%vu: ext %3d\t%s\n",
                     cur_op - code_start, op_jit[*cur_op].extcall, instr);
             n = op_info->op_count;
             ADD_OP_VAR_PART(interp, interp->code, cur_op, n);
 #  if JIT_DEBUG > 1
-            PIO_eprintf(interp, "\t\t\tmap_branch: ");
+            Parrot_io_eprintf(interp, "\t\t\tmap_branch: ");
             for (i = 0; i < n; i++)
-                PIO_eprintf(interp, "%02x ", map[cur_op-code_start+i]);
-            PIO_eprintf(interp, "\n");
+                Parrot_io_eprintf(interp, "%02x ", map[cur_op-code_start+i]);
+            Parrot_io_eprintf(interp, "\n");
 #  endif
             cur_op += n;
         }
-        PIO_eprintf(interp, "\tbegin:\t%#p\t(%Ou)\n",
+        Parrot_io_eprintf(interp, "\tbegin:\t%#p\t(%Ou)\n",
                 cur_section->begin, *cur_section->begin);
-        PIO_eprintf(interp, "\tend:\t%#p\t(%Ou)\n",
+        Parrot_io_eprintf(interp, "\tend:\t%#p\t(%Ou)\n",
                 cur_section->end, *cur_section->end);
 
         for (j = 0; j < sizeof (types_to_list)/sizeof (int); j++) {
             char t;
             typ = types_to_list[j];
             t = types[typ];
-            PIO_eprintf(interp, "\t%c registers used:\t%i\n",
+            Parrot_io_eprintf(interp, "\t%c registers used:\t%i\n",
                     t, ru[typ].registers_used);
             if (ru[typ].registers_used) {
-                PIO_eprintf(interp, "\t%c register count:\t", t);
+                Parrot_io_eprintf(interp, "\t%c register count:\t", t);
                 for (i = 0; i < NUM_REGISTERS; i++)
-                    PIO_eprintf(interp, "%i ", ru[typ].reg_count[i]);
-                PIO_eprintf(interp, "\n\t%c register usage:\t", t);
+                    Parrot_io_eprintf(interp, "%i ", ru[typ].reg_count[i]);
+                Parrot_io_eprintf(interp, "\n\t%c register usage:\t", t);
                 for (i = 0; i < NUM_REGISTERS; i++)
-                    PIO_eprintf(interp, "%i ", ru[typ].reg_usage[i]);
-                PIO_eprintf(interp, "\n\t%c register direction:\t", t);
+                    Parrot_io_eprintf(interp, "%i ", ru[typ].reg_usage[i]);
+                Parrot_io_eprintf(interp, "\n\t%c register direction:\t", t);
                 for (i = 0; i < NUM_REGISTERS; i++)
-                    PIO_eprintf(interp, "%i ", (int)ru[typ].reg_dir[i]);
-                PIO_eprintf(interp, "\n");
+                    Parrot_io_eprintf(interp, "%i ", (int)ru[typ].reg_dir[i]);
+                Parrot_io_eprintf(interp, "\n");
             }
         }
-        PIO_eprintf(interp, "\tJit opcodes:\t%u\n",
+        Parrot_io_eprintf(interp, "\tJit opcodes:\t%u\n",
                 cur_section->jit_op_count);
-        PIO_eprintf(interp, "\tTotal opcodes:\t%u\n",
+        Parrot_io_eprintf(interp, "\tTotal opcodes:\t%u\n",
                 cur_section->op_count);
         if (cur_section->branch_target)
-            PIO_eprintf(interp, "\tBranch target:\tOP%u\n",
+            Parrot_io_eprintf(interp, "\tBranch target:\tOP%u\n",
                     cur_section->branch_target->begin - code_start);
 
         cur_section = cur_section->next;
@@ -1700,7 +1700,7 @@
     jit_info->arena.size =
         (ptrdiff_t)(jit_info->native_ptr - jit_info->arena.start);
 #if JIT_DEBUG
-    PIO_eprintf(interp, "\nTotal size %u bytes\n",
+    Parrot_io_eprintf(interp, "\nTotal size %u bytes\n",
             (unsigned int)(jit_info->native_ptr - jit_info->arena.start));
 #endif
 

Modified: trunk/src/malloc.c
==============================================================================
--- trunk/src/malloc.c	(original)
+++ trunk/src/malloc.c	Mon Dec  8 21:16:33 2008
@@ -4722,30 +4722,30 @@
     {
         CHUNK_SIZE_T  free, reserved, committed;
         vminfo (&free, &reserved, &committed);
-        PIO_eprintf(NULL, "free bytes       = %10lu\n",
+        Parrot_io_eprintf(NULL, "free bytes       = %10lu\n",
                 free);
-        PIO_eprintf(NULL, "reserved bytes   = %10lu\n",
+        Parrot_io_eprintf(NULL, "reserved bytes   = %10lu\n",
                 reserved);
-        PIO_eprintf(NULL, "committed bytes  = %10lu\n",
+        Parrot_io_eprintf(NULL, "committed bytes  = %10lu\n",
                 committed);
     }
 #endif
 
 
-    PIO_eprintf(NULL, "max system bytes = %10lu\n",
+    Parrot_io_eprintf(NULL, "max system bytes = %10lu\n",
             (CHUNK_SIZE_T)(mi.usmblks));
-    PIO_eprintf(NULL, "system bytes     = %10lu\n",
+    Parrot_io_eprintf(NULL, "system bytes     = %10lu\n",
             (CHUNK_SIZE_T)(mi.arena + mi.hblkhd));
-    PIO_eprintf(NULL, "in use bytes     = %10lu\n",
+    Parrot_io_eprintf(NULL, "in use bytes     = %10lu\n",
             (CHUNK_SIZE_T)(mi.uordblks + mi.hblkhd));
 
 #ifdef WIN32
     {
         CHUNK_SIZE_T  kernel, user;
         if (cpuinfo (TRUE, &kernel, &user)) {
-            PIO_eprintf(NULL, "kernel ms        = %10lu\n",
+            Parrot_io_eprintf(NULL, "kernel ms        = %10lu\n",
                     kernel);
-            PIO_eprintf(NULL, "user ms          = %10lu\n",
+            Parrot_io_eprintf(NULL, "user ms          = %10lu\n",
                     user);
         }
     }
@@ -5056,7 +5056,7 @@
     static region_list_entry *g_last;
     void *result = (void *) MORECORE_FAILURE;
 #  ifdef TRACE
-    PIO_printf (NULL, "sbrk %d\n", size);
+    Parrot_io_printf (NULL, "sbrk %d\n", size);
 #  endif
 #  if defined (USE_MALLOC_LOCK) && defined (NEEDED)
     /* Wait for spin lock */
@@ -5121,7 +5121,7 @@
                         /* Assert postconditions */
                         assert ((unsigned) base_committed % g_pagesize == 0);
 #  ifdef TRACE
-                        PIO_printf (NULL, "Commit %p %d\n", base_committed,
+                        Parrot_io_printf (NULL, "Commit %p %d\n", base_committed,
                                     remaining_commit_size);
 #  endif
                         /* Adjust the regions commit top */
@@ -5154,7 +5154,7 @@
                             assert ((unsigned) memory_info.BaseAddress %
                                     g_pagesize == 0);
 #  ifdef TRACE
-                            PIO_printf (NULL, "Query %p %d %s\n",
+                            Parrot_io_printf (NULL, "Query %p %d %s\n",
                                         memory_info.BaseAddress,
                                         memory_info.RegionSize,
                                     memory_info.State == MEM_FREE ? "FREE":
@@ -5217,7 +5217,7 @@
                     /* Assert postconditions */
                     assert ((unsigned) base_reserved % g_regionsize == 0);
 #  ifdef TRACE
-                    PIO_printf (NULL, "Reserve %p %d\n", base_reserved,
+                    Parrot_io_printf (NULL, "Reserve %p %d\n", base_reserved,
                                 reserve_size);
 #  endif
                     /* Did we get contiguous memory? */
@@ -5262,7 +5262,7 @@
                 /* Assert postconditions */
                 assert ((unsigned) base_committed % g_pagesize == 0);
 #  ifdef TRACE
-                PIO_printf(NULL, "Commit %p %d\n", base_committed, commit_size);
+                Parrot_io_printf(NULL, "Commit %p %d\n", base_committed, commit_size);
 #  endif
                 /* Adjust the regions commit top */
                 g_last->top_committed = (char *) base_committed + commit_size;
@@ -5292,7 +5292,7 @@
                 if (! rc)
                     goto sbrk_exit;
 #  ifdef TRACE
-                PIO_printf(NULL, "Release %p %d\n", base_reserved,release_size);
+                Parrot_io_printf(NULL, "Release %p %d\n", base_reserved,release_size);
 #  endif
             }
             /* Adjust deallocation size */
@@ -5321,7 +5321,7 @@
                     if (! rc)
                         goto sbrk_exit;
 #  ifdef TRACE
-                    PIO_printf (NULL, "Decommit %p %d\n",
+                    Parrot_io_printf (NULL, "Decommit %p %d\n",
                                 base_committed, decommit_size);
 #  endif
                 }
@@ -5372,7 +5372,7 @@
     static long g_pagesize;
     static long g_regionsize;
 #  ifdef TRACE
-    PIO_printf (NULL, "mmap %d\n", size);
+    Parrot_io_printf (NULL, "mmap %d\n", size);
 #  endif
 #  if defined (USE_MALLOC_LOCK) && defined (NEEDED)
     /* Wait for spin lock */
@@ -5396,7 +5396,7 @@
     /* Assert postconditions */
     assert ((unsigned) ptr % g_regionsize == 0);
 #  ifdef TRACE
-    PIO_printf (NULL, "Commit %p %d\n", ptr, size);
+    Parrot_io_printf (NULL, "Commit %p %d\n", ptr, size);
 #  endif
 mmap_exit:
 #  if defined (USE_MALLOC_LOCK) && defined (NEEDED)
@@ -5412,7 +5412,7 @@
     static long g_regionsize;
     int rc = MUNMAP_FAILURE;
 #  ifdef TRACE
-    PIO_printf (NULL, "munmap %p %d\n", ptr, size);
+    Parrot_io_printf (NULL, "munmap %p %d\n", ptr, size);
 #  endif
 #  if defined (USE_MALLOC_LOCK) && defined (NEEDED)
     /* Wait for spin lock */
@@ -5432,7 +5432,7 @@
         goto munmap_exit;
     rc = 0;
 #  ifdef TRACE
-    PIO_printf (NULL, "Release %p %d\n", ptr, size);
+    Parrot_io_printf (NULL, "Release %p %d\n", ptr, size);
 #  endif
 munmap_exit:
 #  if defined (USE_MALLOC_LOCK) && defined (NEEDED)

Modified: trunk/src/multidispatch.c
==============================================================================
--- trunk/src/multidispatch.c	(original)
+++ trunk/src/multidispatch.c	Mon Dec  8 21:16:33 2008
@@ -52,7 +52,6 @@
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
 static INTVAL distance_cmp(SHIM_INTERP, INTVAL a, INTVAL b);
-
 static void mmd_add_multi_global(PARROT_INTERP,
     ARGIN(STRING *sub_name),
     ARGIN(PMC *sub_obj))
@@ -1494,7 +1493,7 @@
             else {
                 s2 = interp->vtables[type_call]->whoami;
             }
-            PIO_eprintf(interp, "arg %d: dist %d sig %Ss arg %Ss\n",
+            Parrot_io_eprintf(interp, "arg %d: dist %d sig %Ss arg %Ss\n",
                 i, dist, s1, s2);
         }
 #endif

Modified: trunk/src/oo.c
==============================================================================
--- trunk/src/oo.c	(original)
+++ trunk/src/oo.c	Mon Dec  8 21:16:33 2008
@@ -956,7 +956,7 @@
         result = "no";
 
     tracer = interp->debugger ? interp->debugger : interp;
-    PIO_eprintf(tracer, "# find_method class '%Ss' method '%Ss': %s\n",
+    Parrot_io_eprintf(tracer, "# find_method class '%Ss' method '%Ss': %s\n",
             class_name, name, result);
 }
 

Modified: trunk/src/ops/io.ops
==============================================================================
--- trunk/src/ops/io.ops	(original)
+++ trunk/src/ops/io.ops	Mon Dec  8 21:16:33 2008
@@ -1,5 +1,6 @@
 /*
  * $Id$
+ * Copyright (C) 2002-2008, The Perl Foundation.
 ** io.ops
 */
 
@@ -38,7 +39,7 @@
 =cut
 
 inline op close(invar PMC) :base_io {
-  PIO_close(interp, $1);
+  Parrot_io_close(interp, $1);
 }
 
 ########################################
@@ -53,19 +54,9 @@
 =cut
 
 inline op fdopen(out PMC, in INT, in STR) :filesys_open {
-    /* These char * need to go away soon */
-    char * const mode = string_to_cstring(interp, $3);
-
-    $1 = PIO_fdopen(interp, NULL, (PIOHANDLE)$2, mode);
+    $1 = Parrot_io_fdopen(interp, PMCNULL, (PIOHANDLE)$2, $3);
     if (!$1)
         $1 = pmc_new(interp, enum_class_Undef);
-
-    /* RT#42374 all results from string_to_cstring() need freeing
-     but this generates ugly warnings WRT discarding the const
-     qualifier -lt
-    */
-
-    string_cstring_free(mode);
 }
 
 =item B<getstdin>(out PMC)
@@ -99,21 +90,6 @@
 
 #########################################
 
-=item B<pioctl>(out INT, invar PMC, in INT, in INT)
-
-Perform an operation an an IO object. This is a general purpose
-hook for setting various flags, modes, etc.
-Examples: setting the record separator or setting the buffering
-
-=cut
-
-inline op pioctl(out INT, invar PMC, in INT, in INT) :advanced_io :deprecated {
-  $1 = PIO_pioctl(interp, $2, $3, $4);
-}
-
-
-#########################################
-
 =item B<open>(out PMC, in STR, in STR)
 
 Open URL (file, address, database, in core image) named $2 with
@@ -127,37 +103,25 @@
 =cut
 
 inline op open(out PMC, in STR, in STR) :filesys_open {
-    /* These char * need to go away soon */
     if (STRING_IS_NULL($2) || STRING_IS_NULL($3)) {
         opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
             EXCEPTION_UNEXPECTED_NULL, "Invalid open");
         goto ADDRESS(handler);
     }
     else {
-        char * const path = string_to_cstring(interp, $2);
-        char * const mode = string_to_cstring(interp, $3);
-
-        $1 = PIO_open(interp, NULL, path, mode);
-
-        string_cstring_free(mode);
-        string_cstring_free(path);
+        $1 = Parrot_io_open(interp, PMCNULL, $2, $3);
         PARROT_ASSERT(! PMC_IS_NULL($1));
     }
 }
 
 inline op open(out PMC, in STR) :filesys_open {
-    /* These char * need to go away soon */
     if (STRING_IS_NULL($2)) {
         opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
             EXCEPTION_UNEXPECTED_NULL, "Invalid open");
         goto ADDRESS(handler);
     }
     else {
-        char * const path = string_to_cstring(interp, $2);
-
-        $1 = PIO_open(interp, NULL, path, "+<");
-
-        string_cstring_free(path);
+        $1 = Parrot_io_open(interp, PMCNULL, $2, NULL);
         PARROT_ASSERT(! PMC_IS_NULL($1));
     }
 }
@@ -177,24 +141,24 @@
 =cut
 
 inline op print(in INT) :base_io {
-  PIO_printf(interp, INTVAL_FMT, (INTVAL)$1);
+  Parrot_io_printf(interp, INTVAL_FMT, (INTVAL)$1);
 }
 
 inline op print(in NUM) :base_io {
-  PIO_printf(interp, FLOATVAL_FMT, $1);
+  Parrot_io_printf(interp, FLOATVAL_FMT, $1);
 }
 
 op print(in STR) :base_io {
   STRING * const s = $1;
   if (s && string_length(interp, s))
-    PIO_putps(interp, _PIO_STDOUT(interp), s);
+    Parrot_io_putps(interp, _PIO_STDOUT(interp), s);
 }
 
 op print(invar PMC) :base_io {
   PMC * const p = $1;
   STRING * const s = (VTABLE_get_string(interp, p));
   if (s)
-    PIO_putps(interp, _PIO_STDOUT(interp), s);
+    Parrot_io_putps(interp, _PIO_STDOUT(interp), s);
 }
 
 =item B<say>(in INT)
@@ -210,18 +174,18 @@
 =cut
 
 inline op say(in INT) :base_io {
-  PIO_printf(interp, INTVAL_FMT "\n", (INTVAL)$1);
+  Parrot_io_printf(interp, INTVAL_FMT "\n", (INTVAL)$1);
 }
 
 inline op say(in NUM) :base_io {
-  PIO_printf(interp, FLOATVAL_FMT "\n", $1);
+  Parrot_io_printf(interp, FLOATVAL_FMT "\n", $1);
 }
 
 op say(in STR) :base_io {
   STRING * const s = $1;
   if (s && string_length(interp, s))
-    PIO_putps(interp, _PIO_STDOUT(interp), s);
-  PIO_puts(interp, _PIO_STDOUT(interp), "\n");
+    Parrot_io_putps(interp, _PIO_STDOUT(interp), s);
+  Parrot_io_puts(interp, _PIO_STDOUT(interp), "\n");
 }
 
 op say(invar PMC) :base_io {
@@ -236,8 +200,8 @@
     else {
         STRING * const s = VTABLE_get_string(interp, p);
         if (s)
-            PIO_putps(interp, _PIO_STDOUT(interp), s);
-        PIO_puts(interp, _PIO_STDOUT(interp), "\n");
+            Parrot_io_putps(interp, _PIO_STDOUT(interp), s);
+        Parrot_io_puts(interp, _PIO_STDOUT(interp), "\n");
     }
 }
 
@@ -259,24 +223,24 @@
 =cut
 
 op printerr(in INT) :base_io {
-  PIO_eprintf(interp, INTVAL_FMT, $1);
+  Parrot_io_eprintf(interp, INTVAL_FMT, $1);
 }
 
 op printerr(in NUM) :base_io {
-  PIO_eprintf(interp, FLOATVAL_FMT, $1);
+  Parrot_io_eprintf(interp, FLOATVAL_FMT, $1);
 }
 
 op printerr(in STR) :base_io {
   STRING * const s = $1;
   if (s && string_length(interp, s))
-    PIO_putps(interp, _PIO_STDERR(interp), s);
+    Parrot_io_putps(interp, _PIO_STDERR(interp), s);
 }
 
 op printerr(invar PMC) :base_io {
   PMC * const p = $1;
   STRING * const s = (VTABLE_get_string(interp, p));
   if (s)
-    PIO_putps(interp, _PIO_STDERR(interp), s);
+    Parrot_io_putps(interp, _PIO_STDERR(interp), s);
 }
 
 ##########################################
@@ -296,27 +260,27 @@
 op print(invar PMC, in INT) :base_io {
   if ($1) {
     STRING * const s = Parrot_sprintf_c(interp, INTVAL_FMT, $2);
-    PIO_putps(interp, $1, s);
+    Parrot_io_putps(interp, $1, s);
   }
 }
 
 op print(invar PMC, in NUM) :base_io {
   if ($1) {
     STRING * const s = Parrot_sprintf_c(interp, FLOATVAL_FMT, $2);
-    PIO_putps(interp, $1, s);
+    Parrot_io_putps(interp, $1, s);
   }
 }
 
 op print(invar PMC, in STR) :base_io {
   if ($2 && $1) {
-    PIO_putps(interp, $1, $2);
+    Parrot_io_putps(interp, $1, $2);
   }
 }
 
 op print(invar PMC, invar PMC) :base_io {
   if ($2 && $1) {
     STRING * const s = VTABLE_get_string(interp, $2);
-    PIO_putps(interp, $1, s);
+    Parrot_io_putps(interp, $1, s);
   }
 }
 
@@ -333,11 +297,11 @@
 =cut
 
 op read(out STR, in INT) :base_io {
-  $1 = PIO_reads(interp, _PIO_STDIN(interp), (size_t)$2);
+  $1 = Parrot_io_reads(interp, _PIO_STDIN(interp), (size_t)$2);
 }
 
 op read(out STR, invar PMC, in INT) :base_io {
-  $1 = PIO_reads(interp, $2, (size_t)$3);
+  $1 = Parrot_io_reads(interp, $2, (size_t)$3);
 }
 
 =item B<readline>(out STR, invar PMC)
@@ -353,24 +317,24 @@
      * io stuff are methods
      */
     opcode_t *dest = expr NEXT();
-    if (pio->vtable->base_type != enum_class_ParrotIO) {
+    if (pio->vtable->base_type != enum_class_FileHandle) {
         opcode_t *handler = Parrot_ex_throw_from_op_args(interp, dest,
             EXCEPTION_PIO_ERROR,
             "Cannot read line from empty filehandle");
         goto ADDRESS(handler);
     }
     else {
-        ParrotIO *io = (ParrotIO *)PMC_data(pio);
-        if (!io) {
+        INTVAL flags = Parrot_io_get_flags(interp, pio);
+        if (Parrot_io_is_closed(interp, pio)) {
             opcode_t *handler = Parrot_ex_throw_from_op_args(interp, dest,
                 EXCEPTION_PIO_ERROR,
                 "Cannot read line from empty filehandle");
             goto ADDRESS(handler);
         }
 
-        if (!(io->flags & PIO_F_LINEBUF))
-            PIO_setlinebuf(interp, pio);
-        $1 = PIO_reads(interp, pio, 0);
+        if (!(flags & PIO_F_LINEBUF))
+            Parrot_io_setlinebuf(interp, pio);
+        $1 = Parrot_io_reads(interp, pio, 0);
     }
 }
 
@@ -392,14 +356,14 @@
   STRING ** const s = &$1;
 
   *s = NULL;
-  PIO_peek(interp, _PIO_STDIN(interp), s);
+  Parrot_io_peek(interp, _PIO_STDIN(interp), s);
 }
 
 op peek(out STR, invar PMC) :base_io {
   STRING ** const s = &$1;
 
   *s = NULL;
-  PIO_peek(interp, $2, s);
+  Parrot_io_peek(interp, $2, s);
 }
 
 ##########################################
@@ -454,7 +418,7 @@
 
 op seek(invar PMC, in INT, in INT) :base_io {
     if ($1) {
-        if (PIO_seek(interp, $1, PIO_make_offset($2), $3) < 0) {
+        if (Parrot_io_seek(interp, $1, Parrot_io_make_offset($2), $3) < 0) {
             opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
                 EXCEPTION_PIO_ERROR,
                 "seek failed (32bit)");
@@ -465,7 +429,7 @@
 
 op seek(invar PMC, in INT, in INT, in INT) :base_io {
     if ($1) {
-        if (PIO_seek(interp, $1, PIO_make_offset32($2, $3), $4) < 0) {
+        if (Parrot_io_seek(interp, $1, Parrot_io_make_offset32($2, $3), $4) < 0) {
             opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
                 EXCEPTION_PIO_ERROR,
                 "seek failed (64bit)");
@@ -491,13 +455,13 @@
 
 op tell(out INT, invar PMC) :base_io {
   if ($2)
-    $1 = (INTVAL)PIO_tell(interp, $2);
+    $1 = (INTVAL)Parrot_io_tell(interp, $2);
 }
 
 op tell(out INT, out INT, invar PMC) :base_io {
   if ($3) {
     PIOOFF_T pos;
-    pos = PIO_tell(interp, $3);
+    pos = Parrot_io_tell(interp, $3);
     $1 = (INTVAL)(pos >> 31);
     $2 = (INTVAL)(pos & 0xffffffff);
   }
@@ -505,68 +469,6 @@
 
 ########################################
 
-=item B<socket>(out PMC, in INT, in INT, in INT)
-
-=item B<sockaddr>(out STR, in INT, in STR)
-
-=item B<connect>(out INT, invar PMC, in STR)
-
-=item B<recv>(out INT, invar PMC, out STR)
-
-=item B<send>(out INT, invar PMC, in STR)
-
-=item B<poll>(out INT, invar PMC, in INT, in INT, in INT)
-
-=item B<bind>(out INT, invar PMC, in STR)
-
-=item B<listen>(out INT, invar PMC, in INT)
-
-=item B<accept>(out PMC, invar PMC)
-
-=cut
-
-op socket(out PMC, in INT, in INT, in INT) :base_network {
-  $1 = PIO_socket(interp, $2, $3, $4);
-  if (!$1)
-    $1 = pmc_new(interp, enum_class_Undef);
-}
-
-op sockaddr(out STR, in INT, in STR) :base_network {
-    $1 = PIO_sockaddr_in(interp, (unsigned short)$2, $3);
-}
-
-op connect(out INT, invar PMC, in STR) :base_network {
-    $1 = (INTVAL)PIO_connect(interp, $2, $3);
-}
-
-op recv(out INT, invar PMC, out STR) :base_network {
-    STRING *dest = $3;
-    $1 = (INTVAL)PIO_recv(interp, $2, &dest);
-    $3 = dest;
-}
-
-op send(out INT, invar PMC, in STR) :base_network {
-    $1 = (INTVAL)PIO_send(interp, $2, $3);
-}
-
-op poll(out INT, invar PMC, in INT, in INT, in INT) :base_network {
-    $1 = (INTVAL)PIO_poll(interp, $2, $3, $4, $5);
-}
-
-op bind(out INT, invar PMC, in STR) :base_network {
-    $1 = (INTVAL)PIO_bind(interp, $2, $3);
-}
-
-op listen(out INT, invar PMC, in INT) :base_network {
-    $1 = (INTVAL)PIO_listen(interp, $2, $3);
-}
-
-op accept(out PMC, invar PMC) :base_network {
-    $1 = PIO_accept(interp, $2);
-}
-
-########################################
-
 =back
 
 =cut
@@ -574,18 +476,6 @@
 
 ###############################################################################
 
-=head1 COPYRIGHT
-
-Copyright (C) 2001-2008, The Perl Foundation.
-
-=head1 LICENSE
-
-This program is free software. It is subject to the same license
-as the Parrot interpreter itself.
-
-=cut
-
-
 /*
  * Local variables:
  *   c-file-style: "parrot"

Modified: trunk/src/ops/ops.num
==============================================================================
--- trunk/src/ops/ops.num	(original)
+++ trunk/src/ops/ops.num	Mon Dec  8 21:16:33 2008
@@ -471,875 +471,841 @@
 getstdin_p                      441
 getstdout_p                     442
 getstderr_p                     443
-pioctl_i_p_i_i                  444
-pioctl_i_p_ic_i                 445
-pioctl_i_p_i_ic                 446
-pioctl_i_p_ic_ic                447
-open_p_s_s                      448
-open_p_sc_s                     449
-open_p_s_sc                     450
-open_p_sc_sc                    451
-open_p_s                        452
-open_p_sc                       453
-print_i                         454
-print_ic                        455
-print_n                         456
-print_nc                        457
-print_s                         458
-print_sc                        459
-print_p                         460
-say_i                           461
-say_ic                          462
-say_n                           463
-say_nc                          464
-say_s                           465
-say_sc                          466
-say_p                           467
-printerr_i                      468
-printerr_ic                     469
-printerr_n                      470
-printerr_nc                     471
-printerr_s                      472
-printerr_sc                     473
-printerr_p                      474
-print_p_i                       475
-print_p_ic                      476
-print_p_n                       477
-print_p_nc                      478
-print_p_s                       479
-print_p_sc                      480
-print_p_p                       481
-read_s_i                        482
-read_s_ic                       483
-read_s_p_i                      484
-read_s_p_ic                     485
-readline_s_p                    486
-peek_s                          487
-peek_s_p                        488
-stat_i_s_i                      489
-stat_i_sc_i                     490
-stat_i_s_ic                     491
-stat_i_sc_ic                    492
-stat_i_i_i                      493
-stat_i_ic_i                     494
-stat_i_i_ic                     495
-stat_i_ic_ic                    496
-seek_p_i_i                      497
-seek_p_ic_i                     498
-seek_p_i_ic                     499
-seek_p_ic_ic                    500
-seek_p_i_i_i                    501
-seek_p_ic_i_i                   502
-seek_p_i_ic_i                   503
-seek_p_ic_ic_i                  504
-seek_p_i_i_ic                   505
-seek_p_ic_i_ic                  506
-seek_p_i_ic_ic                  507
-seek_p_ic_ic_ic                 508
-tell_i_p                        509
-tell_i_i_p                      510
-socket_p_i_i_i                  511
-socket_p_ic_i_i                 512
-socket_p_i_ic_i                 513
-socket_p_ic_ic_i                514
-socket_p_i_i_ic                 515
-socket_p_ic_i_ic                516
-socket_p_i_ic_ic                517
-socket_p_ic_ic_ic               518
-sockaddr_s_i_s                  519
-sockaddr_s_ic_s                 520
-sockaddr_s_i_sc                 521
-sockaddr_s_ic_sc                522
-connect_i_p_s                   523
-connect_i_p_sc                  524
-recv_i_p_s                      525
-send_i_p_s                      526
-send_i_p_sc                     527
-poll_i_p_i_i_i                  528
-poll_i_p_ic_i_i                 529
-poll_i_p_i_ic_i                 530
-poll_i_p_ic_ic_i                531
-poll_i_p_i_i_ic                 532
-poll_i_p_ic_i_ic                533
-poll_i_p_i_ic_ic                534
-poll_i_p_ic_ic_ic               535
-bind_i_p_s                      536
-bind_i_p_sc                     537
-listen_i_p_i                    538
-listen_i_p_ic                   539
-accept_p_p                      540
-infix_ic_p_i                    541
-infix_ic_p_ic                   542
-infix_ic_p_n                    543
-infix_ic_p_nc                   544
-infix_ic_p_s                    545
-infix_ic_p_sc                   546
-infix_ic_p_p                    547
-infix_ic_p_p_i                  548
-infix_ic_p_p_ic                 549
-infix_ic_p_p_n                  550
-infix_ic_p_p_nc                 551
-infix_ic_p_p_s                  552
-infix_ic_p_p_sc                 553
-infix_ic_p_p_p                  554
-n_infix_ic_p_p_i                555
-n_infix_ic_p_p_ic               556
-n_infix_ic_p_p_n                557
-n_infix_ic_p_p_nc               558
-n_infix_ic_p_p_s                559
-n_infix_ic_p_p_sc               560
-n_infix_ic_p_p_p                561
-abs_i                           562
-abs_n                           563
-abs_i_i                         564
-abs_n_n                         565
-abs_p                           566
-abs_p_p                         567
-n_abs_p_p                       568
-add_i_i                         569
-add_i_ic                        570
-add_n_n                         571
-add_n_nc                        572
-add_p_p                         573
-add_p_i                         574
-add_p_ic                        575
-add_p_n                         576
-add_p_nc                        577
-add_i_i_i                       578
-add_i_ic_i                      579
-add_i_i_ic                      580
-add_n_n_n                       581
-add_n_nc_n                      582
-add_n_n_nc                      583
-add_p_p_p                       584
-add_p_p_i                       585
-add_p_p_ic                      586
-add_p_p_n                       587
-add_p_p_nc                      588
-cmod_i_i_i                      589
-cmod_i_ic_i                     590
-cmod_i_i_ic                     591
-cmod_p_p_i                      592
-cmod_p_p_ic                     593
-cmod_p_p_p                      594
-cmod_n_n_n                      595
-cmod_n_nc_n                     596
-cmod_n_n_nc                     597
-cmod_p_p_n                      598
-cmod_p_p_nc                     599
-dec_i                           600
-dec_n                           601
-dec_p                           602
-div_i_i                         603
-div_i_ic                        604
-div_n_n                         605
-div_n_nc                        606
-div_p_p                         607
-div_p_i                         608
-div_p_ic                        609
-div_p_n                         610
-div_p_nc                        611
-div_i_i_i                       612
-div_i_ic_i                      613
-div_i_i_ic                      614
-div_i_ic_ic                     615
-div_n_n_n                       616
-div_n_nc_n                      617
-div_n_n_nc                      618
-div_n_nc_nc                     619
-div_p_p_p                       620
-div_p_p_i                       621
-div_p_p_ic                      622
-div_p_p_n                       623
-div_p_p_nc                      624
-fdiv_i_i                        625
-fdiv_i_ic                       626
-fdiv_n_n                        627
-fdiv_n_nc                       628
-fdiv_p_p                        629
-fdiv_p_i                        630
-fdiv_p_ic                       631
-fdiv_p_n                        632
-fdiv_p_nc                       633
-fdiv_i_i_i                      634
-fdiv_i_ic_i                     635
-fdiv_i_i_ic                     636
-fdiv_n_n_n                      637
-fdiv_n_nc_n                     638
-fdiv_n_n_nc                     639
-fdiv_p_p_p                      640
-fdiv_p_p_i                      641
-fdiv_p_p_ic                     642
-fdiv_p_p_n                      643
-fdiv_p_p_nc                     644
-ceil_n                          645
-ceil_i_n                        646
-ceil_n_n                        647
-floor_n                         648
-floor_i_n                       649
-floor_n_n                       650
-inc_i                           651
-inc_n                           652
-inc_p                           653
-mod_i_i                         654
-mod_i_ic                        655
-mod_n_n                         656
-mod_n_nc                        657
-mod_p_p                         658
-mod_p_i                         659
-mod_p_ic                        660
-mod_p_n                         661
-mod_p_nc                        662
-mod_i_i_i                       663
-mod_i_ic_i                      664
-mod_i_i_ic                      665
-mod_n_n_n                       666
-mod_n_nc_n                      667
-mod_n_n_nc                      668
-mod_p_p_p                       669
-mod_p_p_i                       670
-mod_p_p_ic                      671
-mod_p_p_n                       672
-mod_p_p_nc                      673
-mul_i_i                         674
-mul_i_ic                        675
-mul_n_n                         676
-mul_n_nc                        677
-mul_p_p                         678
-mul_p_i                         679
-mul_p_ic                        680
-mul_p_n                         681
-mul_p_nc                        682
-mul_i_i_i                       683
-mul_i_ic_i                      684
-mul_i_i_ic                      685
-mul_n_n_n                       686
-mul_n_nc_n                      687
-mul_n_n_nc                      688
-mul_p_p_p                       689
-mul_p_p_i                       690
-mul_p_p_ic                      691
-mul_p_p_n                       692
-mul_p_p_nc                      693
-neg_i                           694
-neg_n                           695
-neg_p                           696
-neg_i_i                         697
-neg_n_n                         698
-neg_p_p                         699
-n_neg_p_p                       700
-pow_n_n_n                       701
-pow_n_nc_n                      702
-pow_n_n_nc                      703
-pow_p_p_p                       704
-pow_p_p_i                       705
-pow_p_p_ic                      706
-pow_p_p_n                       707
-pow_p_p_nc                      708
-sub_i_i                         709
-sub_i_ic                        710
-sub_n_n                         711
-sub_n_nc                        712
-sub_p_p                         713
-sub_p_i                         714
-sub_p_ic                        715
-sub_p_n                         716
-sub_p_nc                        717
-sub_i_i_i                       718
-sub_i_ic_i                      719
-sub_i_i_ic                      720
-sub_n_n_n                       721
-sub_n_nc_n                      722
-sub_n_n_nc                      723
-sub_p_p_p                       724
-sub_p_p_i                       725
-sub_p_p_ic                      726
-sub_p_p_n                       727
-sub_p_p_nc                      728
-sqrt_n_n                        729
-acos_n_n                        730
-asec_n_n                        731
-asin_n_n                        732
-atan_n_n                        733
-atan_n_n_n                      734
-atan_n_nc_n                     735
-atan_n_n_nc                     736
-cos_n_n                         737
-cosh_n_n                        738
-exp_n_n                         739
-ln_n_n                          740
-log10_n_n                       741
-log2_n_n                        742
-sec_n_n                         743
-sech_n_n                        744
-sin_n_n                         745
-sinh_n_n                        746
-tan_n_n                         747
-tanh_n_n                        748
-gcd_i_i_i                       749
-gcd_i_ic_i                      750
-gcd_i_i_ic                      751
-lcm_i_i_i                       752
-lcm_i_ic_i                      753
-lcm_i_i_ic                      754
-fact_i_i                        755
-fact_n_i                        756
-callmethodcc_p_s                757
-callmethodcc_p_sc               758
-callmethodcc_p_p                759
-callmethod_p_s_p                760
-callmethod_p_sc_p               761
-callmethod_p_p_p                762
-tailcallmethod_p_s              763
-tailcallmethod_p_sc             764
-tailcallmethod_p_p              765
-addmethod_p_s_p                 766
-addmethod_p_sc_p                767
-can_i_p_s                       768
-can_i_p_sc                      769
-does_i_p_s                      770
-does_i_p_sc                     771
-does_i_p_p                      772
-does_i_p_pc                     773
-isa_i_p_s                       774
-isa_i_p_sc                      775
-isa_i_p_p                       776
-isa_i_p_pc                      777
-newclass_p_s                    778
-newclass_p_sc                   779
-newclass_p_p                    780
-newclass_p_pc                   781
-subclass_p_p                    782
-subclass_p_pc                   783
-subclass_p_p_s                  784
-subclass_p_pc_s                 785
-subclass_p_p_sc                 786
-subclass_p_pc_sc                787
-subclass_p_p_p                  788
-subclass_p_pc_p                 789
-subclass_p_p_pc                 790
-subclass_p_pc_pc                791
-subclass_p_s                    792
-subclass_p_sc                   793
-subclass_p_s_s                  794
-subclass_p_sc_s                 795
-subclass_p_s_sc                 796
-subclass_p_sc_sc                797
-subclass_p_s_p                  798
-subclass_p_sc_p                 799
-subclass_p_s_pc                 800
-subclass_p_sc_pc                801
-get_class_p_s                   802
-get_class_p_sc                  803
-get_class_p_p                   804
-get_class_p_pc                  805
-class_p_p                       806
-addparent_p_p                   807
-removeparent_p_p                808
-addrole_p_p                     809
-addattribute_p_s                810
-addattribute_p_sc               811
-removeattribute_p_s             812
-removeattribute_p_sc            813
-removeattribute_p_i             814
-removeattribute_p_ic            815
-getattribute_p_p_s              816
-getattribute_p_p_sc             817
-getattribute_p_p_p_s            818
-getattribute_p_p_pc_s           819
-getattribute_p_p_p_sc           820
-getattribute_p_p_pc_sc          821
-setattribute_p_s_p              822
-setattribute_p_sc_p             823
-setattribute_p_p_s_p            824
-setattribute_p_pc_s_p           825
-setattribute_p_p_sc_p           826
-setattribute_p_pc_sc_p          827
-inspect_p_p                     828
-inspect_p_pc                    829
-inspect_p_p_s                   830
-inspect_p_pc_s                  831
-inspect_p_p_sc                  832
-inspect_p_pc_sc                 833
-pic_infix___ic_p_p              834
-pic_inline_sub___ic_p_p         835
-pic_get_params___pc             836
-pic_set_returns___pc            837
-pic_callr___pc                  838
-new_p_s                         839
-new_p_sc                        840
-new_p_s_p                       841
-new_p_sc_p                      842
-new_p_s_pc                      843
-new_p_sc_pc                     844
-new_p_p                         845
-new_p_pc                        846
-new_p_p_p                       847
-new_p_pc_p                      848
-new_p_p_pc                      849
-new_p_pc_pc                     850
-typeof_s_p                      851
-typeof_p_p                      852
-get_repr_s_p                    853
-find_method_p_p_s               854
-find_method_p_p_sc              855
-defined_i_p                     856
-defined_i_p_ki                  857
-defined_i_p_kic                 858
-defined_i_p_k                   859
-defined_i_p_kc                  860
-exists_i_p_ki                   861
-exists_i_p_kic                  862
-exists_i_p_k                    863
-exists_i_p_kc                   864
-delete_p_k                      865
-delete_p_kc                     866
-delete_p_ki                     867
-delete_p_kic                    868
-elements_i_p                    869
-push_p_i                        870
-push_p_ic                       871
-push_p_n                        872
-push_p_nc                       873
-push_p_s                        874
-push_p_sc                       875
-push_p_p                        876
-pop_i_p                         877
-pop_n_p                         878
-pop_s_p                         879
-pop_p_p                         880
-unshift_p_i                     881
-unshift_p_ic                    882
-unshift_p_n                     883
-unshift_p_nc                    884
-unshift_p_s                     885
-unshift_p_sc                    886
-unshift_p_p                     887
-shift_i_p                       888
-shift_n_p                       889
-shift_s_p                       890
-shift_p_p                       891
-setprop_p_s_p                   892
-setprop_p_sc_p                  893
-getprop_p_s_p                   894
-getprop_p_sc_p                  895
-delprop_p_s                     896
-delprop_p_sc                    897
-prophash_p_p                    898
-freeze_s_p                      899
-thaw_p_s                        900
-thaw_p_sc                       901
-add_multi_s_s_p                 902
-add_multi_sc_s_p                903
-add_multi_s_sc_p                904
-add_multi_sc_sc_p               905
-find_multi_p_s_s                906
-find_multi_p_sc_s               907
-find_multi_p_s_sc               908
-find_multi_p_sc_sc              909
-register_p                      910
-unregister_p                    911
-get_mro_p_p                     912
-box_p_i                         913
-box_p_ic                        914
-box_p_n                         915
-box_p_nc                        916
-box_p_s                         917
-box_p_sc                        918
-clone_s_s                       919
-clone_s_sc                      920
-exchange_i_i                    921
-exchange_p_p                    922
-exchange_n_n                    923
-exchange_s_s                    924
-set_i_i                         925
-set_i_ic                        926
-set_i_n                         927
-set_i_nc                        928
-set_i_s                         929
-set_i_sc                        930
-set_n_n                         931
-set_n_nc                        932
-set_n_i                         933
-set_n_ic                        934
-set_n_s                         935
-set_n_sc                        936
-set_n_p                         937
-set_s_p                         938
-set_s_s                         939
-set_s_sc                        940
-set_s_i                         941
-set_s_ic                        942
-set_s_n                         943
-set_s_nc                        944
-set_p_pc                        945
-set_p_p                         946
-set_p_i                         947
-set_p_ic                        948
-set_p_n                         949
-set_p_nc                        950
-set_p_s                         951
-set_p_sc                        952
-set_i_p                         953
-assign_p_p                      954
-assign_p_i                      955
-assign_p_ic                     956
-assign_p_n                      957
-assign_p_nc                     958
-assign_p_s                      959
-assign_p_sc                     960
-assign_s_s                      961
-assign_s_sc                     962
-setref_p_p                      963
-deref_p_p                       964
-setp_ind_i_p                    965
-setp_ind_ic_p                   966
-setn_ind_i_n                    967
-setn_ind_ic_n                   968
-setn_ind_i_nc                   969
-setn_ind_ic_nc                  970
-sets_ind_i_s                    971
-sets_ind_ic_s                   972
-sets_ind_i_sc                   973
-sets_ind_ic_sc                  974
-seti_ind_i_i                    975
-seti_ind_ic_i                   976
-seti_ind_i_ic                   977
-seti_ind_ic_ic                  978
-set_p_ki_i                      979
-set_p_kic_i                     980
-set_p_ki_ic                     981
-set_p_kic_ic                    982
-set_p_ki_n                      983
-set_p_kic_n                     984
-set_p_ki_nc                     985
-set_p_kic_nc                    986
-set_p_ki_s                      987
-set_p_kic_s                     988
-set_p_ki_sc                     989
-set_p_kic_sc                    990
-set_p_ki_p                      991
-set_p_kic_p                     992
-set_i_p_ki                      993
-set_i_p_kic                     994
-set_n_p_ki                      995
-set_n_p_kic                     996
-set_s_p_ki                      997
-set_s_p_kic                     998
-set_p_p_ki                      999
-set_p_p_kic                    1000
-set_p_k_i                      1001
-set_p_kc_i                     1002
-set_p_k_ic                     1003
-set_p_kc_ic                    1004
-set_p_k_n                      1005
-set_p_kc_n                     1006
-set_p_k_nc                     1007
-set_p_kc_nc                    1008
-set_p_k_s                      1009
-set_p_kc_s                     1010
-set_p_k_sc                     1011
-set_p_kc_sc                    1012
-set_p_k_p                      1013
-set_p_kc_p                     1014
-set_i_p_k                      1015
-set_i_p_kc                     1016
-set_n_p_k                      1017
-set_n_p_kc                     1018
-set_s_p_k                      1019
-set_s_p_kc                     1020
-set_p_p_k                      1021
-set_p_p_kc                     1022
-clone_p_p                      1023
-clone_p_p_p                    1024
-clone_p_p_pc                   1025
-copy_p_p                       1026
-null_s                         1027
-null_i                         1028
-null_p                         1029
-null_n                         1030
-cleari                         1031
-clearn                         1032
-clears                         1033
-clearp                         1034
-stm_start                      1035
-stm_validate_ic                1036
-stm_commit_ic                  1037
-stm_wait_ic                    1038
-stm_abort                      1039
-stm_depth_i                    1040
-ord_i_s                        1041
-ord_i_sc                       1042
-ord_i_s_i                      1043
-ord_i_sc_i                     1044
-ord_i_s_ic                     1045
-ord_i_sc_ic                    1046
-chr_s_i                        1047
-chr_s_ic                       1048
-chopn_s_i                      1049
-chopn_s_ic                     1050
-chopn_s_s_i                    1051
-chopn_s_sc_i                   1052
-chopn_s_s_ic                   1053
-chopn_s_sc_ic                  1054
-concat_s_s                     1055
-concat_s_sc                    1056
-concat_p_p                     1057
-concat_p_s                     1058
-concat_p_sc                    1059
-concat_s_s_s                   1060
-concat_s_sc_s                  1061
-concat_s_s_sc                  1062
-concat_p_p_s                   1063
-concat_p_p_sc                  1064
-concat_p_p_p                   1065
-repeat_s_s_i                   1066
-repeat_s_sc_i                  1067
-repeat_s_s_ic                  1068
-repeat_s_sc_ic                 1069
-repeat_p_p_i                   1070
-repeat_p_p_ic                  1071
-repeat_p_p_p                   1072
-repeat_p_i                     1073
-repeat_p_ic                    1074
-repeat_p_p                     1075
-length_i_s                     1076
-length_i_sc                    1077
-bytelength_i_s                 1078
-bytelength_i_sc                1079
-pin_s                          1080
-unpin_s                        1081
-substr_s_s_i                   1082
-substr_s_sc_i                  1083
-substr_s_s_ic                  1084
-substr_s_sc_ic                 1085
-substr_s_s_i_i                 1086
-substr_s_sc_i_i                1087
-substr_s_s_ic_i                1088
-substr_s_sc_ic_i               1089
-substr_s_s_i_ic                1090
-substr_s_sc_i_ic               1091
-substr_s_s_ic_ic               1092
-substr_s_sc_ic_ic              1093
-substr_s_s_i_i_s               1094
-substr_s_s_ic_i_s              1095
-substr_s_s_i_ic_s              1096
-substr_s_s_ic_ic_s             1097
-substr_s_s_i_i_sc              1098
-substr_s_s_ic_i_sc             1099
-substr_s_s_i_ic_sc             1100
-substr_s_s_ic_ic_sc            1101
-substr_s_i_i_s                 1102
-substr_s_ic_i_s                1103
-substr_s_i_ic_s                1104
-substr_s_ic_ic_s               1105
-substr_s_i_i_sc                1106
-substr_s_ic_i_sc               1107
-substr_s_i_ic_sc               1108
-substr_s_ic_ic_sc              1109
-substr_s_p_i_i                 1110
-substr_s_p_ic_i                1111
-substr_s_p_i_ic                1112
-substr_s_p_ic_ic               1113
-index_i_s_s                    1114
-index_i_sc_s                   1115
-index_i_s_sc                   1116
-index_i_sc_sc                  1117
-index_i_s_s_i                  1118
-index_i_sc_s_i                 1119
-index_i_s_sc_i                 1120
-index_i_sc_sc_i                1121
-index_i_s_s_ic                 1122
-index_i_sc_s_ic                1123
-index_i_s_sc_ic                1124
-index_i_sc_sc_ic               1125
-sprintf_s_s_p                  1126
-sprintf_s_sc_p                 1127
-sprintf_p_p_p                  1128
-new_s                          1129
-new_s_i                        1130
-new_s_ic                       1131
-stringinfo_i_s_i               1132
-stringinfo_i_sc_i              1133
-stringinfo_i_s_ic              1134
-stringinfo_i_sc_ic             1135
-upcase_s_s                     1136
-upcase_s_sc                    1137
-upcase_s                       1138
-downcase_s_s                   1139
-downcase_s_sc                  1140
-downcase_s                     1141
-titlecase_s_s                  1142
-titlecase_s_sc                 1143
-titlecase_s                    1144
-join_s_s_p                     1145
-join_s_sc_p                    1146
-split_p_s_s                    1147
-split_p_sc_s                   1148
-split_p_s_sc                   1149
-split_p_sc_sc                  1150
-charset_i_s                    1151
-charset_i_sc                   1152
-charsetname_s_i                1153
-charsetname_s_ic               1154
-find_charset_i_s               1155
-find_charset_i_sc              1156
-trans_charset_s_i              1157
-trans_charset_s_ic             1158
-trans_charset_s_s_i            1159
-trans_charset_s_sc_i           1160
-trans_charset_s_s_ic           1161
-trans_charset_s_sc_ic          1162
-encoding_i_s                   1163
-encoding_i_sc                  1164
-encodingname_s_i               1165
-encodingname_s_ic              1166
-find_encoding_i_s              1167
-find_encoding_i_sc             1168
-trans_encoding_s_i             1169
-trans_encoding_s_ic            1170
-trans_encoding_s_s_i           1171
-trans_encoding_s_sc_i          1172
-trans_encoding_s_s_ic          1173
-trans_encoding_s_sc_ic         1174
-is_cclass_i_i_s_i              1175
-is_cclass_i_ic_s_i             1176
-is_cclass_i_i_sc_i             1177
-is_cclass_i_ic_sc_i            1178
-is_cclass_i_i_s_ic             1179
-is_cclass_i_ic_s_ic            1180
-is_cclass_i_i_sc_ic            1181
-is_cclass_i_ic_sc_ic           1182
-find_cclass_i_i_s_i_i          1183
-find_cclass_i_ic_s_i_i         1184
-find_cclass_i_i_sc_i_i         1185
-find_cclass_i_ic_sc_i_i        1186
-find_cclass_i_i_s_ic_i         1187
-find_cclass_i_ic_s_ic_i        1188
-find_cclass_i_i_sc_ic_i        1189
-find_cclass_i_ic_sc_ic_i       1190
-find_cclass_i_i_s_i_ic         1191
-find_cclass_i_ic_s_i_ic        1192
-find_cclass_i_i_sc_i_ic        1193
-find_cclass_i_ic_sc_i_ic       1194
-find_cclass_i_i_s_ic_ic        1195
-find_cclass_i_ic_s_ic_ic       1196
-find_cclass_i_i_sc_ic_ic       1197
-find_cclass_i_ic_sc_ic_ic      1198
-find_not_cclass_i_i_s_i_i      1199
-find_not_cclass_i_ic_s_i_i     1200
-find_not_cclass_i_i_sc_i_i     1201
-find_not_cclass_i_ic_sc_i_i    1202
-find_not_cclass_i_i_s_ic_i     1203
-find_not_cclass_i_ic_s_ic_i    1204
-find_not_cclass_i_i_sc_ic_i    1205
-find_not_cclass_i_ic_sc_ic_i   1206
-find_not_cclass_i_i_s_i_ic     1207
-find_not_cclass_i_ic_s_i_ic    1208
-find_not_cclass_i_i_sc_i_ic    1209
-find_not_cclass_i_ic_sc_i_ic   1210
-find_not_cclass_i_i_s_ic_ic    1211
-find_not_cclass_i_ic_s_ic_ic   1212
-find_not_cclass_i_i_sc_ic_ic   1213
-find_not_cclass_i_ic_sc_ic_ic  1214
-escape_s_s                     1215
-compose_s_s                    1216
-compose_s_sc                   1217
-spawnw_i_s                     1218
-spawnw_i_sc                    1219
-spawnw_i_p                     1220
-err_i                          1221
-err_s                          1222
-err_s_i                        1223
-err_s_ic                       1224
-time_i                         1225
-time_n                         1226
-gmtime_s_i                     1227
-gmtime_s_ic                    1228
-localtime_s_i                  1229
-localtime_s_ic                 1230
-decodetime_p_i                 1231
-decodetime_p_ic                1232
-decodelocaltime_p_i            1233
-decodelocaltime_p_ic           1234
-sysinfo_s_i                    1235
-sysinfo_s_ic                   1236
-sysinfo_i_i                    1237
-sysinfo_i_ic                   1238
-sleep_i                        1239
-sleep_ic                       1240
-sleep_n                        1241
-sleep_nc                       1242
-sizeof_i_i                     1243
-sizeof_i_ic                    1244
-store_lex_s_p                  1245
-store_lex_sc_p                 1246
-find_lex_p_s                   1247
-find_lex_p_sc                  1248
-get_namespace_p                1249
-get_namespace_p_p              1250
-get_namespace_p_pc             1251
-get_hll_namespace_p            1252
-get_hll_namespace_p_p          1253
-get_hll_namespace_p_pc         1254
-get_root_namespace_p           1255
-get_root_namespace_p_p         1256
-get_root_namespace_p_pc        1257
-get_global_p_s                 1258
-get_global_p_sc                1259
-get_global_p_p_s               1260
-get_global_p_pc_s              1261
-get_global_p_p_sc              1262
-get_global_p_pc_sc             1263
-get_hll_global_p_s             1264
-get_hll_global_p_sc            1265
-get_hll_global_p_p_s           1266
-get_hll_global_p_pc_s          1267
-get_hll_global_p_p_sc          1268
-get_hll_global_p_pc_sc         1269
-get_root_global_p_s            1270
-get_root_global_p_sc           1271
-get_root_global_p_p_s          1272
-get_root_global_p_pc_s         1273
-get_root_global_p_p_sc         1274
-get_root_global_p_pc_sc        1275
-set_global_s_p                 1276
-set_global_sc_p                1277
-set_global_p_s_p               1278
-set_global_pc_s_p              1279
-set_global_p_sc_p              1280
-set_global_pc_sc_p             1281
-set_hll_global_s_p             1282
-set_hll_global_sc_p            1283
-set_hll_global_p_s_p           1284
-set_hll_global_pc_s_p          1285
-set_hll_global_p_sc_p          1286
-set_hll_global_pc_sc_p         1287
-set_root_global_s_p            1288
-set_root_global_sc_p           1289
-set_root_global_p_s_p          1290
-set_root_global_pc_s_p         1291
-set_root_global_p_sc_p         1292
-set_root_global_pc_sc_p        1293
-store_global_s_p               1294
-store_global_sc_p              1295
-store_global_s_s_p             1296
-store_global_sc_s_p            1297
-store_global_s_sc_p            1298
-store_global_sc_sc_p           1299
-store_global_p_s_p             1300
-store_global_pc_s_p            1301
-store_global_p_sc_p            1302
-store_global_pc_sc_p           1303
-find_global_p_s                1304
-find_global_p_sc               1305
-find_global_p_s_s              1306
-find_global_p_sc_s             1307
-find_global_p_s_sc             1308
-find_global_p_sc_sc            1309
-find_global_p_p_s              1310
-find_global_p_pc_s             1311
-find_global_p_p_sc             1312
-find_global_p_pc_sc            1313
-find_name_p_s                  1314
-find_name_p_sc                 1315
+open_p_s_s                      444
+open_p_sc_s                     445
+open_p_s_sc                     446
+open_p_sc_sc                    447
+open_p_s                        448
+open_p_sc                       449
+print_i                         450
+print_ic                        451
+print_n                         452
+print_nc                        453
+print_s                         454
+print_sc                        455
+print_p                         456
+say_i                           457
+say_ic                          458
+say_n                           459
+say_nc                          460
+say_s                           461
+say_sc                          462
+say_p                           463
+printerr_i                      464
+printerr_ic                     465
+printerr_n                      466
+printerr_nc                     467
+printerr_s                      468
+printerr_sc                     469
+printerr_p                      470
+print_p_i                       471
+print_p_ic                      472
+print_p_n                       473
+print_p_nc                      474
+print_p_s                       475
+print_p_sc                      476
+print_p_p                       477
+read_s_i                        478
+read_s_ic                       479
+read_s_p_i                      480
+read_s_p_ic                     481
+readline_s_p                    482
+peek_s                          483
+peek_s_p                        484
+stat_i_s_i                      485
+stat_i_sc_i                     486
+stat_i_s_ic                     487
+stat_i_sc_ic                    488
+stat_i_i_i                      489
+stat_i_ic_i                     490
+stat_i_i_ic                     491
+stat_i_ic_ic                    492
+seek_p_i_i                      493
+seek_p_ic_i                     494
+seek_p_i_ic                     495
+seek_p_ic_ic                    496
+seek_p_i_i_i                    497
+seek_p_ic_i_i                   498
+seek_p_i_ic_i                   499
+seek_p_ic_ic_i                  500
+seek_p_i_i_ic                   501
+seek_p_ic_i_ic                  502
+seek_p_i_ic_ic                  503
+seek_p_ic_ic_ic                 504
+tell_i_p                        505
+tell_i_i_p                      506
+infix_ic_p_i                    507
+infix_ic_p_ic                   508
+infix_ic_p_n                    509
+infix_ic_p_nc                   510
+infix_ic_p_s                    511
+infix_ic_p_sc                   512
+infix_ic_p_p                    513
+infix_ic_p_p_i                  514
+infix_ic_p_p_ic                 515
+infix_ic_p_p_n                  516
+infix_ic_p_p_nc                 517
+infix_ic_p_p_s                  518
+infix_ic_p_p_sc                 519
+infix_ic_p_p_p                  520
+n_infix_ic_p_p_i                521
+n_infix_ic_p_p_ic               522
+n_infix_ic_p_p_n                523
+n_infix_ic_p_p_nc               524
+n_infix_ic_p_p_s                525
+n_infix_ic_p_p_sc               526
+n_infix_ic_p_p_p                527
+abs_i                           528
+abs_n                           529
+abs_i_i                         530
+abs_n_n                         531
+abs_p                           532
+abs_p_p                         533
+n_abs_p_p                       534
+add_i_i                         535
+add_i_ic                        536
+add_n_n                         537
+add_n_nc                        538
+add_p_p                         539
+add_p_i                         540
+add_p_ic                        541
+add_p_n                         542
+add_p_nc                        543
+add_i_i_i                       544
+add_i_ic_i                      545
+add_i_i_ic                      546
+add_n_n_n                       547
+add_n_nc_n                      548
+add_n_n_nc                      549
+add_p_p_p                       550
+add_p_p_i                       551
+add_p_p_ic                      552
+add_p_p_n                       553
+add_p_p_nc                      554
+cmod_i_i_i                      555
+cmod_i_ic_i                     556
+cmod_i_i_ic                     557
+cmod_p_p_i                      558
+cmod_p_p_ic                     559
+cmod_p_p_p                      560
+cmod_n_n_n                      561
+cmod_n_nc_n                     562
+cmod_n_n_nc                     563
+cmod_p_p_n                      564
+cmod_p_p_nc                     565
+dec_i                           566
+dec_n                           567
+dec_p                           568
+div_i_i                         569
+div_i_ic                        570
+div_n_n                         571
+div_n_nc                        572
+div_p_p                         573
+div_p_i                         574
+div_p_ic                        575
+div_p_n                         576
+div_p_nc                        577
+div_i_i_i                       578
+div_i_ic_i                      579
+div_i_i_ic                      580
+div_i_ic_ic                     581
+div_n_n_n                       582
+div_n_nc_n                      583
+div_n_n_nc                      584
+div_n_nc_nc                     585
+div_p_p_p                       586
+div_p_p_i                       587
+div_p_p_ic                      588
+div_p_p_n                       589
+div_p_p_nc                      590
+fdiv_i_i                        591
+fdiv_i_ic                       592
+fdiv_n_n                        593
+fdiv_n_nc                       594
+fdiv_p_p                        595
+fdiv_p_i                        596
+fdiv_p_ic                       597
+fdiv_p_n                        598
+fdiv_p_nc                       599
+fdiv_i_i_i                      600
+fdiv_i_ic_i                     601
+fdiv_i_i_ic                     602
+fdiv_n_n_n                      603
+fdiv_n_nc_n                     604
+fdiv_n_n_nc                     605
+fdiv_p_p_p                      606
+fdiv_p_p_i                      607
+fdiv_p_p_ic                     608
+fdiv_p_p_n                      609
+fdiv_p_p_nc                     610
+ceil_n                          611
+ceil_i_n                        612
+ceil_n_n                        613
+floor_n                         614
+floor_i_n                       615
+floor_n_n                       616
+inc_i                           617
+inc_n                           618
+inc_p                           619
+mod_i_i                         620
+mod_i_ic                        621
+mod_n_n                         622
+mod_n_nc                        623
+mod_p_p                         624
+mod_p_i                         625
+mod_p_ic                        626
+mod_p_n                         627
+mod_p_nc                        628
+mod_i_i_i                       629
+mod_i_ic_i                      630
+mod_i_i_ic                      631
+mod_n_n_n                       632
+mod_n_nc_n                      633
+mod_n_n_nc                      634
+mod_p_p_p                       635
+mod_p_p_i                       636
+mod_p_p_ic                      637
+mod_p_p_n                       638
+mod_p_p_nc                      639
+mul_i_i                         640
+mul_i_ic                        641
+mul_n_n                         642
+mul_n_nc                        643
+mul_p_p                         644
+mul_p_i                         645
+mul_p_ic                        646
+mul_p_n                         647
+mul_p_nc                        648
+mul_i_i_i                       649
+mul_i_ic_i                      650
+mul_i_i_ic                      651
+mul_n_n_n                       652
+mul_n_nc_n                      653
+mul_n_n_nc                      654
+mul_p_p_p                       655
+mul_p_p_i                       656
+mul_p_p_ic                      657
+mul_p_p_n                       658
+mul_p_p_nc                      659
+neg_i                           660
+neg_n                           661
+neg_p                           662
+neg_i_i                         663
+neg_n_n                         664
+neg_p_p                         665
+n_neg_p_p                       666
+pow_n_n_n                       667
+pow_n_nc_n                      668
+pow_n_n_nc                      669
+pow_p_p_p                       670
+pow_p_p_i                       671
+pow_p_p_ic                      672
+pow_p_p_n                       673
+pow_p_p_nc                      674
+sub_i_i                         675
+sub_i_ic                        676
+sub_n_n                         677
+sub_n_nc                        678
+sub_p_p                         679
+sub_p_i                         680
+sub_p_ic                        681
+sub_p_n                         682
+sub_p_nc                        683
+sub_i_i_i                       684
+sub_i_ic_i                      685
+sub_i_i_ic                      686
+sub_n_n_n                       687
+sub_n_nc_n                      688
+sub_n_n_nc                      689
+sub_p_p_p                       690
+sub_p_p_i                       691
+sub_p_p_ic                      692
+sub_p_p_n                       693
+sub_p_p_nc                      694
+sqrt_n_n                        695
+acos_n_n                        696
+asec_n_n                        697
+asin_n_n                        698
+atan_n_n                        699
+atan_n_n_n                      700
+atan_n_nc_n                     701
+atan_n_n_nc                     702
+cos_n_n                         703
+cosh_n_n                        704
+exp_n_n                         705
+ln_n_n                          706
+log10_n_n                       707
+log2_n_n                        708
+sec_n_n                         709
+sech_n_n                        710
+sin_n_n                         711
+sinh_n_n                        712
+tan_n_n                         713
+tanh_n_n                        714
+gcd_i_i_i                       715
+gcd_i_ic_i                      716
+gcd_i_i_ic                      717
+lcm_i_i_i                       718
+lcm_i_ic_i                      719
+lcm_i_i_ic                      720
+fact_i_i                        721
+fact_n_i                        722
+callmethodcc_p_s                723
+callmethodcc_p_sc               724
+callmethodcc_p_p                725
+callmethod_p_s_p                726
+callmethod_p_sc_p               727
+callmethod_p_p_p                728
+tailcallmethod_p_s              729
+tailcallmethod_p_sc             730
+tailcallmethod_p_p              731
+addmethod_p_s_p                 732
+addmethod_p_sc_p                733
+can_i_p_s                       734
+can_i_p_sc                      735
+does_i_p_s                      736
+does_i_p_sc                     737
+does_i_p_p                      738
+does_i_p_pc                     739
+isa_i_p_s                       740
+isa_i_p_sc                      741
+isa_i_p_p                       742
+isa_i_p_pc                      743
+newclass_p_s                    744
+newclass_p_sc                   745
+newclass_p_p                    746
+newclass_p_pc                   747
+subclass_p_p                    748
+subclass_p_pc                   749
+subclass_p_p_s                  750
+subclass_p_pc_s                 751
+subclass_p_p_sc                 752
+subclass_p_pc_sc                753
+subclass_p_p_p                  754
+subclass_p_pc_p                 755
+subclass_p_p_pc                 756
+subclass_p_pc_pc                757
+subclass_p_s                    758
+subclass_p_sc                   759
+subclass_p_s_s                  760
+subclass_p_sc_s                 761
+subclass_p_s_sc                 762
+subclass_p_sc_sc                763
+subclass_p_s_p                  764
+subclass_p_sc_p                 765
+subclass_p_s_pc                 766
+subclass_p_sc_pc                767
+get_class_p_s                   768
+get_class_p_sc                  769
+get_class_p_p                   770
+get_class_p_pc                  771
+class_p_p                       772
+addparent_p_p                   773
+removeparent_p_p                774
+addrole_p_p                     775
+addattribute_p_s                776
+addattribute_p_sc               777
+removeattribute_p_s             778
+removeattribute_p_sc            779
+removeattribute_p_i             780
+removeattribute_p_ic            781
+getattribute_p_p_s              782
+getattribute_p_p_sc             783
+getattribute_p_p_p_s            784
+getattribute_p_p_pc_s           785
+getattribute_p_p_p_sc           786
+getattribute_p_p_pc_sc          787
+setattribute_p_s_p              788
+setattribute_p_sc_p             789
+setattribute_p_p_s_p            790
+setattribute_p_pc_s_p           791
+setattribute_p_p_sc_p           792
+setattribute_p_pc_sc_p          793
+inspect_p_p                     794
+inspect_p_pc                    795
+inspect_p_p_s                   796
+inspect_p_pc_s                  797
+inspect_p_p_sc                  798
+inspect_p_pc_sc                 799
+pic_infix___ic_p_p              800
+pic_inline_sub___ic_p_p         801
+pic_get_params___pc             802
+pic_set_returns___pc            803
+pic_callr___pc                  804
+new_p_s                         805
+new_p_sc                        806
+new_p_s_p                       807
+new_p_sc_p                      808
+new_p_s_pc                      809
+new_p_sc_pc                     810
+new_p_p                         811
+new_p_pc                        812
+new_p_p_p                       813
+new_p_pc_p                      814
+new_p_p_pc                      815
+new_p_pc_pc                     816
+typeof_s_p                      817
+typeof_p_p                      818
+get_repr_s_p                    819
+find_method_p_p_s               820
+find_method_p_p_sc              821
+defined_i_p                     822
+defined_i_p_ki                  823
+defined_i_p_kic                 824
+defined_i_p_k                   825
+defined_i_p_kc                  826
+exists_i_p_ki                   827
+exists_i_p_kic                  828
+exists_i_p_k                    829
+exists_i_p_kc                   830
+delete_p_k                      831
+delete_p_kc                     832
+delete_p_ki                     833
+delete_p_kic                    834
+elements_i_p                    835
+push_p_i                        836
+push_p_ic                       837
+push_p_n                        838
+push_p_nc                       839
+push_p_s                        840
+push_p_sc                       841
+push_p_p                        842
+pop_i_p                         843
+pop_n_p                         844
+pop_s_p                         845
+pop_p_p                         846
+unshift_p_i                     847
+unshift_p_ic                    848
+unshift_p_n                     849
+unshift_p_nc                    850
+unshift_p_s                     851
+unshift_p_sc                    852
+unshift_p_p                     853
+shift_i_p                       854
+shift_n_p                       855
+shift_s_p                       856
+shift_p_p                       857
+setprop_p_s_p                   858
+setprop_p_sc_p                  859
+getprop_p_s_p                   860
+getprop_p_sc_p                  861
+delprop_p_s                     862
+delprop_p_sc                    863
+prophash_p_p                    864
+freeze_s_p                      865
+thaw_p_s                        866
+thaw_p_sc                       867
+add_multi_s_s_p                 868
+add_multi_sc_s_p                869
+add_multi_s_sc_p                870
+add_multi_sc_sc_p               871
+find_multi_p_s_s                872
+find_multi_p_sc_s               873
+find_multi_p_s_sc               874
+find_multi_p_sc_sc              875
+register_p                      876
+unregister_p                    877
+get_mro_p_p                     878
+box_p_i                         879
+box_p_ic                        880
+box_p_n                         881
+box_p_nc                        882
+box_p_s                         883
+box_p_sc                        884
+clone_s_s                       885
+clone_s_sc                      886
+exchange_i_i                    887
+exchange_p_p                    888
+exchange_n_n                    889
+exchange_s_s                    890
+set_i_i                         891
+set_i_ic                        892
+set_i_n                         893
+set_i_nc                        894
+set_i_s                         895
+set_i_sc                        896
+set_n_n                         897
+set_n_nc                        898
+set_n_i                         899
+set_n_ic                        900
+set_n_s                         901
+set_n_sc                        902
+set_n_p                         903
+set_s_p                         904
+set_s_s                         905
+set_s_sc                        906
+set_s_i                         907
+set_s_ic                        908
+set_s_n                         909
+set_s_nc                        910
+set_p_pc                        911
+set_p_p                         912
+set_p_i                         913
+set_p_ic                        914
+set_p_n                         915
+set_p_nc                        916
+set_p_s                         917
+set_p_sc                        918
+set_i_p                         919
+assign_p_p                      920
+assign_p_i                      921
+assign_p_ic                     922
+assign_p_n                      923
+assign_p_nc                     924
+assign_p_s                      925
+assign_p_sc                     926
+assign_s_s                      927
+assign_s_sc                     928
+setref_p_p                      929
+deref_p_p                       930
+setp_ind_i_p                    931
+setp_ind_ic_p                   932
+setn_ind_i_n                    933
+setn_ind_ic_n                   934
+setn_ind_i_nc                   935
+setn_ind_ic_nc                  936
+sets_ind_i_s                    937
+sets_ind_ic_s                   938
+sets_ind_i_sc                   939
+sets_ind_ic_sc                  940
+seti_ind_i_i                    941
+seti_ind_ic_i                   942
+seti_ind_i_ic                   943
+seti_ind_ic_ic                  944
+set_p_ki_i                      945
+set_p_kic_i                     946
+set_p_ki_ic                     947
+set_p_kic_ic                    948
+set_p_ki_n                      949
+set_p_kic_n                     950
+set_p_ki_nc                     951
+set_p_kic_nc                    952
+set_p_ki_s                      953
+set_p_kic_s                     954
+set_p_ki_sc                     955
+set_p_kic_sc                    956
+set_p_ki_p                      957
+set_p_kic_p                     958
+set_i_p_ki                      959
+set_i_p_kic                     960
+set_n_p_ki                      961
+set_n_p_kic                     962
+set_s_p_ki                      963
+set_s_p_kic                     964
+set_p_p_ki                      965
+set_p_p_kic                     966
+set_p_k_i                       967
+set_p_kc_i                      968
+set_p_k_ic                      969
+set_p_kc_ic                     970
+set_p_k_n                       971
+set_p_kc_n                      972
+set_p_k_nc                      973
+set_p_kc_nc                     974
+set_p_k_s                       975
+set_p_kc_s                      976
+set_p_k_sc                      977
+set_p_kc_sc                     978
+set_p_k_p                       979
+set_p_kc_p                      980
+set_i_p_k                       981
+set_i_p_kc                      982
+set_n_p_k                       983
+set_n_p_kc                      984
+set_s_p_k                       985
+set_s_p_kc                      986
+set_p_p_k                       987
+set_p_p_kc                      988
+clone_p_p                       989
+clone_p_p_p                     990
+clone_p_p_pc                    991
+copy_p_p                        992
+null_s                          993
+null_i                          994
+null_p                          995
+null_n                          996
+cleari                          997
+clearn                          998
+clears                          999
+clearp                         1000
+stm_start                      1001
+stm_validate_ic                1002
+stm_commit_ic                  1003
+stm_wait_ic                    1004
+stm_abort                      1005
+stm_depth_i                    1006
+ord_i_s                        1007
+ord_i_sc                       1008
+ord_i_s_i                      1009
+ord_i_sc_i                     1010
+ord_i_s_ic                     1011
+ord_i_sc_ic                    1012
+chr_s_i                        1013
+chr_s_ic                       1014
+chopn_s_i                      1015
+chopn_s_ic                     1016
+chopn_s_s_i                    1017
+chopn_s_sc_i                   1018
+chopn_s_s_ic                   1019
+chopn_s_sc_ic                  1020
+concat_s_s                     1021
+concat_s_sc                    1022
+concat_p_p                     1023
+concat_p_s                     1024
+concat_p_sc                    1025
+concat_s_s_s                   1026
+concat_s_sc_s                  1027
+concat_s_s_sc                  1028
+concat_p_p_s                   1029
+concat_p_p_sc                  1030
+concat_p_p_p                   1031
+repeat_s_s_i                   1032
+repeat_s_sc_i                  1033
+repeat_s_s_ic                  1034
+repeat_s_sc_ic                 1035
+repeat_p_p_i                   1036
+repeat_p_p_ic                  1037
+repeat_p_p_p                   1038
+repeat_p_i                     1039
+repeat_p_ic                    1040
+repeat_p_p                     1041
+length_i_s                     1042
+length_i_sc                    1043
+bytelength_i_s                 1044
+bytelength_i_sc                1045
+pin_s                          1046
+unpin_s                        1047
+substr_s_s_i                   1048
+substr_s_sc_i                  1049
+substr_s_s_ic                  1050
+substr_s_sc_ic                 1051
+substr_s_s_i_i                 1052
+substr_s_sc_i_i                1053
+substr_s_s_ic_i                1054
+substr_s_sc_ic_i               1055
+substr_s_s_i_ic                1056
+substr_s_sc_i_ic               1057
+substr_s_s_ic_ic               1058
+substr_s_sc_ic_ic              1059
+substr_s_s_i_i_s               1060
+substr_s_s_ic_i_s              1061
+substr_s_s_i_ic_s              1062
+substr_s_s_ic_ic_s             1063
+substr_s_s_i_i_sc              1064
+substr_s_s_ic_i_sc             1065
+substr_s_s_i_ic_sc             1066
+substr_s_s_ic_ic_sc            1067
+substr_s_i_i_s                 1068
+substr_s_ic_i_s                1069
+substr_s_i_ic_s                1070
+substr_s_ic_ic_s               1071
+substr_s_i_i_sc                1072
+substr_s_ic_i_sc               1073
+substr_s_i_ic_sc               1074
+substr_s_ic_ic_sc              1075
+substr_s_p_i_i                 1076
+substr_s_p_ic_i                1077
+substr_s_p_i_ic                1078
+substr_s_p_ic_ic               1079
+index_i_s_s                    1080
+index_i_sc_s                   1081
+index_i_s_sc                   1082
+index_i_sc_sc                  1083
+index_i_s_s_i                  1084
+index_i_sc_s_i                 1085
+index_i_s_sc_i                 1086
+index_i_sc_sc_i                1087
+index_i_s_s_ic                 1088
+index_i_sc_s_ic                1089
+index_i_s_sc_ic                1090
+index_i_sc_sc_ic               1091
+sprintf_s_s_p                  1092
+sprintf_s_sc_p                 1093
+sprintf_p_p_p                  1094
+new_s                          1095
+new_s_i                        1096
+new_s_ic                       1097
+stringinfo_i_s_i               1098
+stringinfo_i_sc_i              1099
+stringinfo_i_s_ic              1100
+stringinfo_i_sc_ic             1101
+upcase_s_s                     1102
+upcase_s_sc                    1103
+upcase_s                       1104
+downcase_s_s                   1105
+downcase_s_sc                  1106
+downcase_s                     1107
+titlecase_s_s                  1108
+titlecase_s_sc                 1109
+titlecase_s                    1110
+join_s_s_p                     1111
+join_s_sc_p                    1112
+split_p_s_s                    1113
+split_p_sc_s                   1114
+split_p_s_sc                   1115
+split_p_sc_sc                  1116
+charset_i_s                    1117
+charset_i_sc                   1118
+charsetname_s_i                1119
+charsetname_s_ic               1120
+find_charset_i_s               1121
+find_charset_i_sc              1122
+trans_charset_s_i              1123
+trans_charset_s_ic             1124
+trans_charset_s_s_i            1125
+trans_charset_s_sc_i           1126
+trans_charset_s_s_ic           1127
+trans_charset_s_sc_ic          1128
+encoding_i_s                   1129
+encoding_i_sc                  1130
+encodingname_s_i               1131
+encodingname_s_ic              1132
+find_encoding_i_s              1133
+find_encoding_i_sc             1134
+trans_encoding_s_i             1135
+trans_encoding_s_ic            1136
+trans_encoding_s_s_i           1137
+trans_encoding_s_sc_i          1138
+trans_encoding_s_s_ic          1139
+trans_encoding_s_sc_ic         1140
+is_cclass_i_i_s_i              1141
+is_cclass_i_ic_s_i             1142
+is_cclass_i_i_sc_i             1143
+is_cclass_i_ic_sc_i            1144
+is_cclass_i_i_s_ic             1145
+is_cclass_i_ic_s_ic            1146
+is_cclass_i_i_sc_ic            1147
+is_cclass_i_ic_sc_ic           1148
+find_cclass_i_i_s_i_i          1149
+find_cclass_i_ic_s_i_i         1150
+find_cclass_i_i_sc_i_i         1151
+find_cclass_i_ic_sc_i_i        1152
+find_cclass_i_i_s_ic_i         1153
+find_cclass_i_ic_s_ic_i        1154
+find_cclass_i_i_sc_ic_i        1155
+find_cclass_i_ic_sc_ic_i       1156
+find_cclass_i_i_s_i_ic         1157
+find_cclass_i_ic_s_i_ic        1158
+find_cclass_i_i_sc_i_ic        1159
+find_cclass_i_ic_sc_i_ic       1160
+find_cclass_i_i_s_ic_ic        1161
+find_cclass_i_ic_s_ic_ic       1162
+find_cclass_i_i_sc_ic_ic       1163
+find_cclass_i_ic_sc_ic_ic      1164
+find_not_cclass_i_i_s_i_i      1165
+find_not_cclass_i_ic_s_i_i     1166
+find_not_cclass_i_i_sc_i_i     1167
+find_not_cclass_i_ic_sc_i_i    1168
+find_not_cclass_i_i_s_ic_i     1169
+find_not_cclass_i_ic_s_ic_i    1170
+find_not_cclass_i_i_sc_ic_i    1171
+find_not_cclass_i_ic_sc_ic_i   1172
+find_not_cclass_i_i_s_i_ic     1173
+find_not_cclass_i_ic_s_i_ic    1174
+find_not_cclass_i_i_sc_i_ic    1175
+find_not_cclass_i_ic_sc_i_ic   1176
+find_not_cclass_i_i_s_ic_ic    1177
+find_not_cclass_i_ic_s_ic_ic   1178
+find_not_cclass_i_i_sc_ic_ic   1179
+find_not_cclass_i_ic_sc_ic_ic  1180
+escape_s_s                     1181
+compose_s_s                    1182
+compose_s_sc                   1183
+spawnw_i_s                     1184
+spawnw_i_sc                    1185
+spawnw_i_p                     1186
+err_i                          1187
+err_s                          1188
+err_s_i                        1189
+err_s_ic                       1190
+time_i                         1191
+time_n                         1192
+gmtime_s_i                     1193
+gmtime_s_ic                    1194
+localtime_s_i                  1195
+localtime_s_ic                 1196
+decodetime_p_i                 1197
+decodetime_p_ic                1198
+decodelocaltime_p_i            1199
+decodelocaltime_p_ic           1200
+sysinfo_s_i                    1201
+sysinfo_s_ic                   1202
+sysinfo_i_i                    1203
+sysinfo_i_ic                   1204
+sleep_i                        1205
+sleep_ic                       1206
+sleep_n                        1207
+sleep_nc                       1208
+sizeof_i_i                     1209
+sizeof_i_ic                    1210
+store_lex_s_p                  1211
+store_lex_sc_p                 1212
+find_lex_p_s                   1213
+find_lex_p_sc                  1214
+get_namespace_p                1215
+get_namespace_p_p              1216
+get_namespace_p_pc             1217
+get_hll_namespace_p            1218
+get_hll_namespace_p_p          1219
+get_hll_namespace_p_pc         1220
+get_root_namespace_p           1221
+get_root_namespace_p_p         1222
+get_root_namespace_p_pc        1223
+get_global_p_s                 1224
+get_global_p_sc                1225
+get_global_p_p_s               1226
+get_global_p_pc_s              1227
+get_global_p_p_sc              1228
+get_global_p_pc_sc             1229
+get_hll_global_p_s             1230
+get_hll_global_p_sc            1231
+get_hll_global_p_p_s           1232
+get_hll_global_p_pc_s          1233
+get_hll_global_p_p_sc          1234
+get_hll_global_p_pc_sc         1235
+get_root_global_p_s            1236
+get_root_global_p_sc           1237
+get_root_global_p_p_s          1238
+get_root_global_p_pc_s         1239
+get_root_global_p_p_sc         1240
+get_root_global_p_pc_sc        1241
+set_global_s_p                 1242
+set_global_sc_p                1243
+set_global_p_s_p               1244
+set_global_pc_s_p              1245
+set_global_p_sc_p              1246
+set_global_pc_sc_p             1247
+set_hll_global_s_p             1248
+set_hll_global_sc_p            1249
+set_hll_global_p_s_p           1250
+set_hll_global_pc_s_p          1251
+set_hll_global_p_sc_p          1252
+set_hll_global_pc_sc_p         1253
+set_root_global_s_p            1254
+set_root_global_sc_p           1255
+set_root_global_p_s_p          1256
+set_root_global_pc_s_p         1257
+set_root_global_p_sc_p         1258
+set_root_global_pc_sc_p        1259
+store_global_s_p               1260
+store_global_sc_p              1261
+store_global_s_s_p             1262
+store_global_sc_s_p            1263
+store_global_s_sc_p            1264
+store_global_sc_sc_p           1265
+store_global_p_s_p             1266
+store_global_pc_s_p            1267
+store_global_p_sc_p            1268
+store_global_pc_sc_p           1269
+find_global_p_s                1270
+find_global_p_sc               1271
+find_global_p_s_s              1272
+find_global_p_sc_s             1273
+find_global_p_s_sc             1274
+find_global_p_sc_sc            1275
+find_global_p_p_s              1276
+find_global_p_pc_s             1277
+find_global_p_p_sc             1278
+find_global_p_pc_sc            1279
+find_name_p_s                  1280
+find_name_p_sc                 1281

Modified: trunk/src/packdump.c
==============================================================================
--- trunk/src/packdump.c	(original)
+++ trunk/src/packdump.c	Mon Dec  8 21:16:33 2008
@@ -59,7 +59,7 @@
     opcode_t i;
 
     for (i = 0; i < self->const_count; i++) {
-        PIO_printf(interp, "    # %ld:\n", (long)i);
+        Parrot_io_printf(interp, "    # %ld:\n", (long)i);
         PackFile_Constant_dump(interp, self, self->constants[i]);
     }
 }
@@ -121,18 +121,18 @@
     INTVAL idx = 0;
     int printed_flag_p = 0;
 
-    PIO_printf(interp, "\tFLAGS => 0x%04lx (", flags);
+    Parrot_io_printf(interp, "\tFLAGS => 0x%04lx (", flags);
     while (flags) {
         if (flags & 1) {
             if (printed_flag_p)
-                PIO_printf(interp, ",");
-            PIO_printf(interp, "%s", flag_bit_names[idx]);
+                Parrot_io_printf(interp, ",");
+            Parrot_io_printf(interp, "%s", flag_bit_names[idx]);
             printed_flag_p++;
         }
         idx++;
         flags >>= 1;
     }
-    PIO_printf(interp, ")\n");
+    Parrot_io_printf(interp, ")\n");
 }
 
 static void
@@ -145,63 +145,63 @@
     switch (self->type) {
 
     case PFC_NUMBER:
-        PIO_printf(interp, "    [ 'PFC_NUMBER', %g ],\n", self->u.number);
+        Parrot_io_printf(interp, "    [ 'PFC_NUMBER', %g ],\n", self->u.number);
         break;
 
     case PFC_STRING:
-        PIO_printf(interp, "    [ 'PFC_STRING', {\n");
+        Parrot_io_printf(interp, "    [ 'PFC_STRING', {\n");
         pobj_flag_dump(interp, (long)PObj_get_FLAGS(self->u.string));
-        PIO_printf(interp, "        CHARSET  => %ld,\n",
+        Parrot_io_printf(interp, "        CHARSET  => %ld,\n",
                    self->u.string->charset);
         i = self->u.string->bufused;
-        PIO_printf(interp, "        SIZE     => %ld,\n",
+        Parrot_io_printf(interp, "        SIZE     => %ld,\n",
                    (long)i);
 
-        PIO_printf(interp, "        DATA     => \"%Ss\"\n",
+        Parrot_io_printf(interp, "        DATA     => \"%Ss\"\n",
                        string_escape_string(interp, self->u.string));
-        PIO_printf(interp, "    } ],\n");
+        Parrot_io_printf(interp, "    } ],\n");
         break;
 
     case PFC_KEY:
         for (i = 0, key = self->u.key; key; key = (PMC*)PMC_data(key), i++)
             ;
         /* number of key components */
-        PIO_printf(interp, "    [ 'PFC_KEY' (%ld items)\n", i);
+        Parrot_io_printf(interp, "    [ 'PFC_KEY' (%ld items)\n", i);
         /* and now type / value per component */
         for (key = self->u.key; key; key = (PMC*)PMC_data(key)) {
             opcode_t type = PObj_get_FLAGS(key);
 
-            PIO_printf(interp, "       {\n");
+            Parrot_io_printf(interp, "       {\n");
             if ((type & (KEY_start_slice_FLAG|KEY_inf_slice_FLAG)) ==
                 (KEY_start_slice_FLAG|KEY_inf_slice_FLAG))
-                PIO_printf(interp, "        SLICE_BITS  => PF_VT_END_INF\n");
+                Parrot_io_printf(interp, "        SLICE_BITS  => PF_VT_END_INF\n");
             if ((type & (KEY_end_slice_FLAG|KEY_inf_slice_FLAG)) ==
                 (KEY_end_slice_FLAG|KEY_inf_slice_FLAG))
-                PIO_printf(interp, "        SLICE_BITS  => PF_VT_START_ZERO\n");
+                Parrot_io_printf(interp, "        SLICE_BITS  => PF_VT_START_ZERO\n");
             if (type & KEY_start_slice_FLAG)
-                PIO_printf(interp, "        SLICE_BITS  => PF_VT_START_SLICE\n");
+                Parrot_io_printf(interp, "        SLICE_BITS  => PF_VT_START_SLICE\n");
             if (type & KEY_end_slice_FLAG)
-                PIO_printf(interp, "        SLICE_BITS  => PF_VT_END_SLICE\n");
+                Parrot_io_printf(interp, "        SLICE_BITS  => PF_VT_END_SLICE\n");
 
             type &= KEY_type_FLAGS;
             pobj_flag_dump(interp, (long)PObj_get_FLAGS(key));
             switch (type) {
                 case KEY_integer_FLAG:
-                    PIO_printf(interp, "        TYPE        => INTEGER\n");
-                    PIO_printf(interp, "        DATA        => %ld\n", PMC_int_val(key));
-                    PIO_printf(interp, "       },\n");
+                    Parrot_io_printf(interp, "        TYPE        => INTEGER\n");
+                    Parrot_io_printf(interp, "        DATA        => %ld\n", PMC_int_val(key));
+                    Parrot_io_printf(interp, "       },\n");
                     break;
                 case KEY_number_FLAG:
                     {
                     const PackFile_Constant *detail;
                     size_t ct_index;
 
-                    PIO_printf(interp, "        TYPE        => NUMBER\n");
+                    Parrot_io_printf(interp, "        TYPE        => NUMBER\n");
                     ct_index = PackFile_find_in_const(interp, ct, key, PFC_NUMBER);
-                    PIO_printf(interp, "        PFC_OFFSET  => %ld\n", ct_index);
+                    Parrot_io_printf(interp, "        PFC_OFFSET  => %ld\n", ct_index);
                     detail = ct->constants[ct_index];
-                    PIO_printf(interp, "        DATA        => %ld\n", detail->u.number);
-                    PIO_printf(interp, "       },\n");
+                    Parrot_io_printf(interp, "        DATA        => %ld\n", detail->u.number);
+                    Parrot_io_printf(interp, "       },\n");
                     }
                     break;
                 case KEY_string_FLAG:
@@ -209,46 +209,46 @@
                     const PackFile_Constant *detail;
                     size_t ct_index;
 
-                    PIO_printf(interp, "        TYPE        => STRING\n");
+                    Parrot_io_printf(interp, "        TYPE        => STRING\n");
                     ct_index = PackFile_find_in_const(interp, ct, key, PFC_STRING);
-                    PIO_printf(interp, "        PFC_OFFSET  => %ld\n", ct_index);
+                    Parrot_io_printf(interp, "        PFC_OFFSET  => %ld\n", ct_index);
                     detail = ct->constants[ct_index];
-                    PIO_printf(interp, "        DATA        => '%.*s'\n",
+                    Parrot_io_printf(interp, "        DATA        => '%.*s'\n",
                               (int)detail->u.string->bufused,
                               (char *)detail->u.string->strstart);
-                    PIO_printf(interp, "       },\n");
+                    Parrot_io_printf(interp, "       },\n");
                     }
                     break;
                 case KEY_integer_FLAG | KEY_register_FLAG:
-                    PIO_printf(interp, "        TYPE        => I REGISTER\n");
-                    PIO_printf(interp, "        DATA        => %ld\n", PMC_int_val(key));
-                    PIO_printf(interp, "       },\n");
+                    Parrot_io_printf(interp, "        TYPE        => I REGISTER\n");
+                    Parrot_io_printf(interp, "        DATA        => %ld\n", PMC_int_val(key));
+                    Parrot_io_printf(interp, "       },\n");
                     break;
                 case KEY_number_FLAG | KEY_register_FLAG:
-                    PIO_printf(interp, "        TYPE        => N REGISTER\n");
-                    PIO_printf(interp, "        DATA        => %ld\n", PMC_int_val(key));
-                    PIO_printf(interp, "       },\n");
+                    Parrot_io_printf(interp, "        TYPE        => N REGISTER\n");
+                    Parrot_io_printf(interp, "        DATA        => %ld\n", PMC_int_val(key));
+                    Parrot_io_printf(interp, "       },\n");
                     break;
                 case KEY_string_FLAG | KEY_register_FLAG:
-                    PIO_printf(interp, "        TYPE        => S REGISTER\n");
-                    PIO_printf(interp, "        DATA        => %ld\n", PMC_int_val(key));
-                    PIO_printf(interp, "       },\n");
+                    Parrot_io_printf(interp, "        TYPE        => S REGISTER\n");
+                    Parrot_io_printf(interp, "        DATA        => %ld\n", PMC_int_val(key));
+                    Parrot_io_printf(interp, "       },\n");
                     break;
                 case KEY_pmc_FLAG | KEY_register_FLAG:
-                    PIO_printf(interp, "        TYPE        => P REGISTER\n");
-                    PIO_printf(interp, "        DATA        => %ld\n", PMC_int_val(key));
-                    PIO_printf(interp, "       },\n");
+                    Parrot_io_printf(interp, "        TYPE        => P REGISTER\n");
+                    Parrot_io_printf(interp, "        DATA        => %ld\n", PMC_int_val(key));
+                    Parrot_io_printf(interp, "       },\n");
                     break;
                 default:
-                    PIO_eprintf(NULL, "PackFile_Constant_pack: "
+                    Parrot_io_eprintf(NULL, "PackFile_Constant_pack: "
                             "unsupported constant type\n");
                     Parrot_exit(interp, 1);
             }
         }
-        PIO_printf(interp, "    ],\n");
+        Parrot_io_printf(interp, "    ],\n");
         break;
     case PFC_PMC:
-        PIO_printf(interp, "    [ 'PFC_PMC', {\n");
+        Parrot_io_printf(interp, "    [ 'PFC_PMC', {\n");
         {
             PMC * const pmc = self->u.key;
             Parrot_sub *sub;
@@ -269,7 +269,7 @@
                     {
                     const int n = VTABLE_get_integer(interp, pmc);
                     STRING* const out_buffer = VTABLE_get_repr(interp, pmc);
-                    PIO_printf(interp,
+                    Parrot_io_printf(interp,
                             "\tclass => %Ss,\n"
                             "\telement count => %d,\n"
                             "\telements => %Ss,\n",
@@ -304,7 +304,7 @@
                     else {
                         namespace_description = null;
                     }
-                    PIO_printf(interp,
+                    Parrot_io_printf(interp,
                             "\tclass => %Ss,\n"
                             "\tstart_offs => %d,\n"
                             "\tend_offs => %d,\n"
@@ -325,22 +325,22 @@
                             sub->HLL_id);
                     break;
                 case enum_class_FixedIntegerArray:
-                    PIO_printf(interp,
+                    Parrot_io_printf(interp,
                             "\tclass => %Ss,\n"
                             "\trepr => '%Ss'\n",
                             pmc->vtable->whoami,
                             VTABLE_get_repr(interp, pmc));
                     break;
                 default:
-                    PIO_printf(interp, "\tno dump info for PMC %ld %Ss\n",
+                    Parrot_io_printf(interp, "\tno dump info for PMC %ld %Ss\n",
                             pmc->vtable->base_type, pmc->vtable->whoami);
-                    PIO_printf(interp, "\tclass => %Ss,\n", pmc->vtable->whoami);
+                    Parrot_io_printf(interp, "\tclass => %Ss,\n", pmc->vtable->whoami);
             }
         }
-        PIO_printf(interp, "    } ],\n");
+        Parrot_io_printf(interp, "    } ],\n");
         break;
     default:
-        PIO_printf(interp, "    [ 'PFC_\?\?\?', type '0x%x' ],\n",
+        Parrot_io_printf(interp, "    [ 'PFC_\?\?\?', type '0x%x' ],\n",
                 self->type);
         break;
     }
@@ -363,18 +363,18 @@
     opcode_t i;
 
     for (i = 0; i < ft->fixup_count; i++) {
-        PIO_printf(interp, "\t#%d\n", (int) i);
+        Parrot_io_printf(interp, "\t#%d\n", (int) i);
         switch (ft->fixups[i]->type) {
             case enum_fixup_label:
             case enum_fixup_sub:
-                PIO_printf(interp,
+                Parrot_io_printf(interp,
                         "\ttype => %d offs => %8d name => '%s',\n",
                         (int)ft->fixups[i]->type,
                         (int)ft->fixups[i]->offset,
                         ft->fixups[i]->name);
                     break;
             default:
-                PIO_printf(interp, "\ttype => %d ???,\n",
+                Parrot_io_printf(interp, "\ttype => %d ???,\n",
                         (int) ft->fixups[i]->type);
                 break;
         }

Modified: trunk/src/packfile.c
==============================================================================
--- trunk/src/packfile.c	(original)
+++ trunk/src/packfile.c	Mon Dec  8 21:16:33 2008
@@ -345,7 +345,7 @@
 PackFile_destroy(PARROT_INTERP, ARGMOD_NULLOK(PackFile *pf))
 {
     if (!pf) {
-        PIO_eprintf(NULL, "PackFile_destroy: pf == NULL!\n");
+        Parrot_io_eprintf(NULL, "PackFile_destroy: pf == NULL!\n");
         return;
     }
 
@@ -695,7 +695,7 @@
     PackFile_ConstTable * const ct = self->const_table;
 
 #if TRACE_PACKFILE
-    PIO_eprintf(NULL, "PackFile: do_sub_pragmas (action=%d)\n", action);
+    Parrot_io_eprintf(NULL, "PackFile: do_sub_pragmas (action=%d)\n", action);
 #endif
 
     for (i = 0; i < ft->fixup_count; i++) {
@@ -773,7 +773,7 @@
 
     /* Ensure the magic is correct. */
     if (memcmp(header->magic, "\376PBC\r\n\032\n", 8) != 0) {
-        PIO_eprintf(NULL, "PackFile_unpack: "
+        Parrot_io_eprintf(NULL, "PackFile_unpack: "
             "This is not a valid Parrot bytecode file\n");
         return 0;
     }
@@ -782,39 +782,39 @@
      * support bytecode versions matching the current one. */
     if (header->bc_major != PARROT_PBC_MAJOR
     &&  header->bc_minor != PARROT_PBC_MINOR) {
-        PIO_eprintf(NULL, "PackFile_unpack: This Parrot cannot read bytecode "
+        Parrot_io_eprintf(NULL, "PackFile_unpack: This Parrot cannot read bytecode "
             "files with version %d.%d.\n", header->bc_major, header->bc_minor);
         return 0;
     }
 
     /* Check wordsize, byte order and floating point number type are valid. */
     if (header->wordsize != 4 && header->wordsize != 8) {
-        PIO_eprintf(NULL, "PackFile_unpack: Invalid wordsize %d\n",
+        Parrot_io_eprintf(NULL, "PackFile_unpack: Invalid wordsize %d\n",
                     header->wordsize);
         return 0;
     }
 
     if (header->byteorder != 0 && header->byteorder != 1) {
-        PIO_eprintf(NULL, "PackFile_unpack: Invalid byte ordering %d\n",
+        Parrot_io_eprintf(NULL, "PackFile_unpack: Invalid byte ordering %d\n",
                     header->byteorder);
         return 0;
     }
 
     if (header->floattype != 0 && header->floattype != 1) {
-        PIO_eprintf(NULL, "PackFile_unpack: Invalid floattype %d\n",
+        Parrot_io_eprintf(NULL, "PackFile_unpack: Invalid floattype %d\n",
                     header->floattype);
         return 0;
     }
 
     /* Describe what was read for debugging. */
 #if TRACE_PACKFILE
-    PIO_eprintf(NULL, "PackFile_unpack: Wordsize %d.\n", header->wordsize);
-    PIO_eprintf(NULL, "PackFile_unpack: Floattype %d (%s).\n",
+    Parrot_io_eprintf(NULL, "PackFile_unpack: Wordsize %d.\n", header->wordsize);
+    Parrot_io_eprintf(NULL, "PackFile_unpack: Floattype %d (%s).\n",
                 header->floattype,
                 header->floattype ?
                   "x86 little endian 12 byte long double" :
                   "IEEE-754 8 byte double");
-    PIO_eprintf(NULL, "PackFile_unpack: Byteorder %d (%sendian).\n",
+    Parrot_io_eprintf(NULL, "PackFile_unpack: Byteorder %d (%sendian).\n",
                 header->byteorder, header->byteorder ? "big " : "little-");
 #endif
 
@@ -836,7 +836,7 @@
     }
     else {
         /* Don't know this UUID type. */
-        PIO_eprintf(NULL, "PackFile_unpack: Invalid UUID type %d\n",
+        Parrot_io_eprintf(NULL, "PackFile_unpack: Invalid UUID type %d\n",
                     header->uuid_type);
     }
 
@@ -854,7 +854,7 @@
     header->dir_format = PF_fetch_opcode(self, &cursor);
 
     if (header->dir_format != PF_DIR_FORMAT) {
-        PIO_eprintf(NULL, "PackFile_unpack: Dir format was %d not %d\n",
+        Parrot_io_eprintf(NULL, "PackFile_unpack: Dir format was %d not %d\n",
                     header->dir_format, PF_DIR_FORMAT);
         return 0;
     }
@@ -866,7 +866,7 @@
     UNUSED(padding);
 
 #if TRACE_PACKFILE
-    PIO_eprintf(NULL, "PackFile_unpack: Directory read, offset %d.\n",
+    Parrot_io_eprintf(NULL, "PackFile_unpack: Directory read, offset %d.\n",
                 (INTVAL)cursor - (INTVAL)packed);
 #endif
 
@@ -891,7 +891,7 @@
 #endif
 
 #if TRACE_PACKFILE
-    PIO_eprintf(NULL, "PackFile_unpack: Unpack done.\n");
+    Parrot_io_eprintf(NULL, "PackFile_unpack: Unpack done.\n");
 #endif
 
     return cursor - packed;
@@ -1240,7 +1240,7 @@
     self->data = mem_allocate_n_typed(self->size, opcode_t);
 
     if (!self->data) {
-        PIO_eprintf(NULL, "PackFile_unpack: Unable to allocate data memory!\n");
+        Parrot_io_eprintf(NULL, "PackFile_unpack: Unable to allocate data memory!\n");
         self->size = 0;
         return NULL;
     }
@@ -1254,7 +1254,7 @@
         for (i = 0; i < (int)self->size; i++) {
             self->data[i] = PF_fetch_opcode(self->pf, &cursor);
 #if TRACE_PACKFILE
-            PIO_eprintf(NULL, "op[#%d] %u\n", i, self->data[i]);
+            Parrot_io_eprintf(NULL, "op[#%d] %u\n", i, self->data[i]);
 #endif
         }
     }
@@ -1276,9 +1276,9 @@
 void
 default_dump_header(PARROT_INTERP, ARGIN(const PackFile_Segment *self))
 {
-    PIO_printf(interp, "%s => [ # offs 0x%x(%d)",
+    Parrot_io_printf(interp, "%s => [ # offs 0x%x(%d)",
             self->name, (int)self->file_offset, (int)self->file_offset);
-    PIO_printf(interp, " = op_count %d, itype %d, id %d, size %d, ...",
+    Parrot_io_printf(interp, " = op_count %d, itype %d, id %d, size %d, ...",
             (int)self->op_count, (int)self->itype,
             (int)self->id, (int)self->size);
 }
@@ -1302,19 +1302,19 @@
     default_dump_header(interp, self);
 
     if (i % 8)
-        PIO_printf(interp, "\n %04x:  ", (int) i);
+        Parrot_io_printf(interp, "\n %04x:  ", (int) i);
 
     for (; i < (self->data ? self->size :
             self->file_offset + self->op_count); i++) {
 
         if (i % 8 == 0)
-            PIO_printf(interp, "\n %04x:  ", (int) i);
+            Parrot_io_printf(interp, "\n %04x:  ", (int) i);
 
-        PIO_printf(interp, "%08lx ", (unsigned long)
+        Parrot_io_printf(interp, "%08lx ", (unsigned long)
                 self->data ? self->data[i] : self->pf->src[i]);
     }
 
-    PIO_printf(interp, "\n]\n");
+    Parrot_io_printf(interp, "\n]\n");
 }
 
 
@@ -1683,22 +1683,22 @@
 
     default_dump_header(interp, self);
 
-    PIO_printf(interp, "\n\t# %d segments\n", dir->num_segments);
+    Parrot_io_printf(interp, "\n\t# %d segments\n", dir->num_segments);
 
     for (i = 0; i < dir->num_segments; i++) {
         const PackFile_Segment * const seg = dir->segments[i];
 
-        PIO_printf(interp,
+        Parrot_io_printf(interp,
 
                 "\ttype %d\t%s\t", (int)seg->type, seg->name);
-        PIO_printf(interp,
+        Parrot_io_printf(interp,
                 " offs 0x%x(0x%x)\top_count %d\n",
                 (int)seg->file_offset,
                 (int)seg->file_offset * sizeof (opcode_t),
                 (int)seg->op_count);
     }
 
-    PIO_printf(interp, "]\n");
+    Parrot_io_printf(interp, "]\n");
 
     for (i = 0; i < dir->num_segments; i++)
         PackFile_Segment_dump(interp, dir->segments[i]);
@@ -1740,13 +1740,13 @@
             type = PF_UNKNOWN_SEG;
 
 #if TRACE_PACKFILE
-        PIO_eprintf(NULL, "Segment type %d.\n", type);
+        Parrot_io_eprintf(NULL, "Segment type %d.\n", type);
 #endif
         /* get name */
         name = PF_fetch_cstring(pf, &cursor);
 
 #if TRACE_PACKFILE
-        PIO_eprintf(NULL, "Segment name \"%s\".\n", name);
+        Parrot_io_eprintf(NULL, "Segment name \"%s\".\n", name);
 #endif
 
         /* create it */
@@ -2433,52 +2433,52 @@
 
     default_dump_header(interp, self);
 
-    PIO_printf(interp, "\n  mappings => [\n");
+    Parrot_io_printf(interp, "\n  mappings => [\n");
     for (i = 0; i < debug->num_mappings; i++) {
-        PIO_printf(interp, "    #%d\n    [\n", i);
-        PIO_printf(interp, "        OFFSET => %d,\n",
+        Parrot_io_printf(interp, "    #%d\n    [\n", i);
+        Parrot_io_printf(interp, "        OFFSET => %d,\n",
                    debug->mappings[i]->offset);
         switch (debug->mappings[i]->mapping_type) {
             case PF_DEBUGMAPPINGTYPE_NONE:
-                PIO_printf(interp, "        MAPPINGTYPE => NONE\n");
+                Parrot_io_printf(interp, "        MAPPINGTYPE => NONE\n");
                 break;
             case PF_DEBUGMAPPINGTYPE_FILENAME:
                 {
                 char *filename;
 
-                PIO_printf(interp, "        MAPPINGTYPE => FILENAME,\n");
+                Parrot_io_printf(interp, "        MAPPINGTYPE => FILENAME,\n");
                 filename = string_to_cstring(interp, PF_CONST(debug->code,
                            debug->mappings[i]->u.filename)->u.string);
-                PIO_printf(interp, "        FILENAME => %s\n", filename);
+                Parrot_io_printf(interp, "        FILENAME => %s\n", filename);
                 string_cstring_free(filename);
                 }
                 break;
             case PF_DEBUGMAPPINGTYPE_SOURCESEG:
-                PIO_printf(interp, "        MAPPINGTYPE => SOURCESEG,\n");
-                PIO_printf(interp, "        SOURCESEG => %d\n",
+                Parrot_io_printf(interp, "        MAPPINGTYPE => SOURCESEG,\n");
+                Parrot_io_printf(interp, "        SOURCESEG => %d\n",
                            debug->mappings[i]->u.source_seg);
                 break;
             default:
                 break;
         }
-        PIO_printf(interp, "    ],\n");
+        Parrot_io_printf(interp, "    ],\n");
     }
 
-    PIO_printf(interp, "  ]\n");
+    Parrot_io_printf(interp, "  ]\n");
 
     j = self->data ? 0: self->file_offset + 4;
     if (j % 8)
-        PIO_printf(interp, "\n %04x:  ", (int) j);
+        Parrot_io_printf(interp, "\n %04x:  ", (int) j);
 
     for (; j < (self->data ? self->size :
             self->file_offset + self->op_count); j++) {
         if (j % 8 == 0) {
-            PIO_printf(interp, "\n %04x:  ", (int) j);
+            Parrot_io_printf(interp, "\n %04x:  ", (int) j);
         }
-        PIO_printf(interp, "%08lx ", (unsigned long)
+        Parrot_io_printf(interp, "%08lx ", (unsigned long)
                 self->data ? self->data[j] : self->pf->src[j]);
     }
-    PIO_printf(interp, "\n]\n");
+    Parrot_io_printf(interp, "\n]\n");
 }
 
 /*
@@ -2714,7 +2714,7 @@
     if (really && Interp_trace_TEST(interp, PARROT_TRACE_SUB_CALL_FLAG)) {
         Interp * const tracer = interp->debugger ?
             interp->debugger : interp;
-        PIO_eprintf(tracer, "*** switching to %s\n",
+        Parrot_io_eprintf(tracer, "*** switching to %s\n",
                 new_cs->base.name);
     }
     interp->code = new_cs;
@@ -2903,7 +2903,7 @@
 {
     opcode_t i;
     if (!self) {
-        PIO_eprintf(interp, "PackFile_FixupTable_clear: self == NULL!\n");
+        Parrot_io_eprintf(interp, "PackFile_FixupTable_clear: self == NULL!\n");
         return;
     }
 
@@ -3059,7 +3059,7 @@
     PackFile_FixupTable * const self = (PackFile_FixupTable *)seg;
 
     if (!self) {
-        PIO_eprintf(interp, "PackFile_FixupTable_unpack: self == NULL!\n");
+        Parrot_io_eprintf(interp, "PackFile_FixupTable_unpack: self == NULL!\n");
         return NULL;
     }
 
@@ -3073,7 +3073,7 @@
             self->fixup_count * sizeof (PackFile_FixupEntry *));
 
         if (!self->fixups) {
-            PIO_eprintf(interp,
+            Parrot_io_eprintf(interp,
                     "PackFile_FixupTable_unpack: Could not allocate "
                     "memory for array!\n");
             self->fixup_count = 0;
@@ -3095,7 +3095,7 @@
             case enum_fixup_none:
                 break;
             default:
-                PIO_eprintf(interp,
+                Parrot_io_eprintf(interp,
                         "PackFile_FixupTable_unpack: Unknown fixup type %d!\n",
                         entry->type);
                 return NULL;
@@ -3302,7 +3302,7 @@
     self->const_count = PF_fetch_opcode(pf, &cursor);
 
 #if TRACE_PACKFILE
-    PIO_eprintf(interp,
+    Parrot_io_eprintf(interp,
             "PackFile_ConstTable_unpack: Unpacking %ld constants\n",
             self->const_count);
 #endif
@@ -3315,7 +3315,7 @@
         self->const_count * sizeof (PackFile_Constant *));
 
     if (!self->constants) {
-        PIO_eprintf(interp,
+        Parrot_io_eprintf(interp,
                 "PackFile_ConstTable_unpack: Could not allocate "
                 "memory for array!\n");
         self->const_count = 0;
@@ -3324,7 +3324,7 @@
 
     for (i = 0; i < self->const_count; i++) {
 #if TRACE_PACKFILE
-        PIO_eprintf(interp,
+        Parrot_io_eprintf(interp,
                 "PackFile_ConstTable_unpack(): Unpacking constant %ld\n", i);
 #endif
 
@@ -3481,7 +3481,7 @@
             break;
 
         default:
-            PIO_eprintf(NULL,
+            Parrot_io_eprintf(NULL,
                     "Constant_packed_size: Unrecognized type '%c'!\n",
                     (char)self->type);
             return 0;
@@ -3518,7 +3518,7 @@
 
 /* #define TRACE_PACKFILE 1 */
 #if TRACE_PACKFILE
-    PIO_eprintf(NULL, "PackFile_Constant_unpack(): Type is %ld ('%c')...\n",
+    Parrot_io_eprintf(NULL, "PackFile_Constant_unpack(): Type is %ld ('%c')...\n",
             type, (char)type);
 #endif
 
@@ -3543,7 +3543,7 @@
                 self, cursor);
         break;
     default:
-        PIO_eprintf(NULL,
+        Parrot_io_eprintf(NULL,
                 "Constant_unpack: Unrecognized type '%c' during unpack!\n",
                 (char)type);
         return NULL;

Modified: trunk/src/packfile/pf_items.c
==============================================================================
--- trunk/src/packfile/pf_items.c	(original)
+++ trunk/src/packfile/pf_items.c	Mon Dec  8 21:16:33 2008
@@ -434,7 +434,7 @@
     if (!pf || !pf->fetch_op)
         return *(*stream)++;
 #if TRACE_PACKFILE == 2
-    PIO_eprintf(NULL, "PF_fetch_opcode: Reordering.\n");
+    Parrot_io_eprintf(NULL, "PF_fetch_opcode: Reordering.\n");
 #endif
     o = (pf->fetch_op)(*((const unsigned char **)stream));
     *((const unsigned char **) (stream)) += pf->header->wordsize;
@@ -567,7 +567,7 @@
     double d;
     if (!pf || !pf->fetch_nv) {
 #if TRACE_PACKFILE
-        PIO_eprintf(NULL, "PF_fetch_number: Native [%d bytes]\n",
+        Parrot_io_eprintf(NULL, "PF_fetch_number: Native [%d bytes]\n",
                 sizeof (FLOATVAL));
 #endif
         memcpy(&f, (const char*)*stream, sizeof (FLOATVAL));
@@ -577,7 +577,7 @@
     }
     f = (FLOATVAL) 0;
 #if TRACE_PACKFILE
-    PIO_eprintf(NULL, "PF_fetch_number: Byteordering..\n");
+    Parrot_io_eprintf(NULL, "PF_fetch_number: Byteordering..\n");
 #endif
     /* Here is where the size transforms get messy */
     if (NUMVAL_SIZE == 8 && ! pf->header->floattype) {
@@ -671,10 +671,10 @@
 
 /* #define TRACE_PACKFILE 1 */
 #if TRACE_PACKFILE
-    PIO_eprintf(NULL, "PF_fetch_string(): flags are 0x%04x...\n", flags);
-    PIO_eprintf(NULL, "PF_fetch_string(): charset_nr is %ld...\n",
+    Parrot_io_eprintf(NULL, "PF_fetch_string(): flags are 0x%04x...\n", flags);
+    Parrot_io_eprintf(NULL, "PF_fetch_string(): charset_nr is %ld...\n",
            charset_nr);
-    PIO_eprintf(NULL, "PF_fetch_string(): size is %ld...\n", size);
+    Parrot_io_eprintf(NULL, "PF_fetch_string(): size is %ld...\n", size);
 #endif
 
 
@@ -682,9 +682,9 @@
     s = string_make(interp, (const char *)*cursor, size, charset_name, flags);
 
 #if TRACE_PACKFILE
-    PIO_eprintf(NULL, "PF_fetch_string(): string is: ");
-    PIO_putps(interp, PIO_STDERR(interp), s);
-    PIO_eprintf(NULL, "\n");
+    Parrot_io_eprintf(NULL, "PF_fetch_string(): string is: ");
+    Parrot_io_putps(interp, Parrot_io_STDERR(interp), s);
+    Parrot_io_eprintf(NULL, "\n");
 #endif
 
 /*    s = string_make(interp, *cursor, size,
@@ -714,7 +714,7 @@
     opcode_t padded_size = s->bufused;
     char *charcursor;
 
-/*    PIO_eprintf(NULL, "PF_store_string(): size is %ld...\n", s->bufused); */
+/*    Parrot_io_eprintf(NULL, "PF_store_string(): size is %ld...\n", s->bufused); */
 
     if (padded_size % sizeof (opcode_t)) {
         padded_size += sizeof (opcode_t) - (padded_size % sizeof (opcode_t));

Modified: trunk/src/packout.c
==============================================================================
--- trunk/src/packout.c	(original)
+++ trunk/src/packout.c	Mon Dec  8 21:16:33 2008
@@ -218,7 +218,7 @@
         else if (type == PFC_NUMBER && ct->constants[i]->u.number ==
                  PMC_num_val(key))
             return i;
-    PIO_eprintf(NULL, "find_in_const: couldn't find const for key\n");
+    Parrot_io_eprintf(NULL, "find_in_const: couldn't find const for key\n");
     Parrot_exit(interp, 1);
 }
 
@@ -325,7 +325,7 @@
                     *cursor++ = PMC_int_val(key);
                     break;
                 default:
-                    PIO_eprintf(NULL, "PackFile_Constant_pack: "
+                    Parrot_io_eprintf(NULL, "PackFile_Constant_pack: "
                             "unsupported constant type\n");
                     Parrot_exit(interp, 1);
             }
@@ -334,7 +334,7 @@
         break;
 
     default:
-        PIO_eprintf(NULL, "PackFile_Constant_pack: unsupported constant\n");
+        Parrot_io_eprintf(NULL, "PackFile_Constant_pack: unsupported constant\n");
         Parrot_exit(interp, 1);
         break;
     }

Modified: trunk/src/pbc_merge.c
==============================================================================
--- trunk/src/pbc_merge.c	(original)
+++ trunk/src/pbc_merge.c	Mon Dec  8 21:16:33 2008
@@ -213,7 +213,7 @@
     STRING * const fs = string_make(interp, fullname,
             strlen(fullname), NULL, 0);
     if (!Parrot_stat_info_intval(interp, fs, STAT_EXISTS)) {
-        PIO_eprintf(interp, "PBC Merge: Can't stat %s, code %i.\n",
+        Parrot_io_eprintf(interp, "PBC Merge: Can't stat %s, code %i.\n",
                 fullname, errno);
         Parrot_exit(interp, 1);
     }
@@ -224,7 +224,7 @@
     /* Attempt to open file and handle any errors. */
     io = fopen(fullname, "rb");
     if (!io) {
-        PIO_eprintf(interp, "PBC Merge: Can't open %s, code %i.\n",
+        Parrot_io_eprintf(interp, "PBC Merge: Can't open %s, code %i.\n",
                 fullname, errno);
         Parrot_exit(interp, 1);
     }
@@ -245,7 +245,7 @@
             (char *)mem_sys_realloc(program_code, program_size + chunk_size);
 
         if (!program_code) {
-            PIO_eprintf(interp,
+            Parrot_io_eprintf(interp,
                 "PBC Merge: Could not reallocate buffer");
             Parrot_exit(interp, 1);
         }
@@ -254,7 +254,7 @@
     }
 
     if (read_result < 0) {
-        PIO_eprintf(interp,
+        Parrot_io_eprintf(interp,
                 "PBC Merge: Problem reading packfile from PIO.\n");
         Parrot_exit(interp, 1);
     }
@@ -264,7 +264,7 @@
     pf = PackFile_new(interp, is_mapped);
     if (!PackFile_unpack(interp,
                 pf, (opcode_t *)program_code, program_size)) {
-        PIO_eprintf(interp, "PBC Merge: Can't unpack packfile %s.\n",
+        Parrot_io_eprintf(interp, "PBC Merge: Can't unpack packfile %s.\n",
                 fullname);
         Parrot_exit(interp, 1);
     }
@@ -300,7 +300,7 @@
         (PackFile_ByteCode *)PackFile_Segment_new_seg(interp,
             &pf->directory, PF_BYTEC_SEG, BYTE_CODE_SEGMENT_NAME, 1);
     if (bc_seg == NULL) {
-        PIO_eprintf(interp, "PBC Merge: Error creating bytecode segment.");
+        Parrot_io_eprintf(interp, "PBC Merge: Error creating bytecode segment.");
         Parrot_exit(interp, 1);
     }
 
@@ -309,7 +309,7 @@
         /* Get the bytecode segment from the input file. */
         PackFile_ByteCode * const in_seg = inputs[i]->pf->cur_cs;
         if (in_seg == NULL) {
-            PIO_eprintf(interp,
+            Parrot_io_eprintf(interp,
                 "PBC Merge: Cannot locate bytecode segment in %s",
                 inputs[i]->filename);
             Parrot_exit(interp, 1);
@@ -318,7 +318,7 @@
         /* Re-allocate the current buffer. */
         mem_realloc_n_typed(bc, cursor + in_seg->base.size, opcode_t);
         if (bc == NULL) {
-            PIO_eprintf(interp, "PBC Merge: Cannot reallocate memory\n");
+            Parrot_io_eprintf(interp, "PBC Merge: Cannot reallocate memory\n");
             Parrot_exit(interp, 1);
         }
 
@@ -363,7 +363,7 @@
     PackFile_ConstTable * const const_seg = (PackFile_ConstTable*)PackFile_Segment_new_seg(
         interp, &pf->directory, PF_CONST_SEG, CONSTANT_SEGMENT_NAME, 1);
     if (const_seg == NULL) {
-        PIO_eprintf(interp,
+        Parrot_io_eprintf(interp,
             "PBC Merge: Error creating constant table segment.");
         Parrot_exit(interp, 1);
     }
@@ -373,7 +373,7 @@
         /* Get the constant table segment from the input file. */
         PackFile_ConstTable * const in_seg = inputs[i]->pf->cur_cs->const_table;
         if (in_seg == NULL) {
-            PIO_eprintf(interp,
+            Parrot_io_eprintf(interp,
                 "PBC Merge: Cannot locate constant table segment in %s\n",
                 inputs[i]->filename);
             Parrot_exit(interp, 1);
@@ -387,7 +387,7 @@
             constants = (PackFile_Constant **)mem_sys_realloc(constants,
                 (cursor + in_seg->const_count) * sizeof (Parrot_Pointer));
             if (constants == NULL) {
-                PIO_eprintf(interp, "PBC Merge: Out of memory");
+                Parrot_io_eprintf(interp, "PBC Merge: Out of memory");
                 Parrot_exit(interp, 1);
             }
         }
@@ -399,7 +399,7 @@
             PackFile_Constant *copy      = mem_allocate_typed(
                 PackFile_Constant);
             if (copy == NULL) {
-                PIO_eprintf(interp, "PBC Merge: Out of memory");
+                Parrot_io_eprintf(interp, "PBC Merge: Out of memory");
                 Parrot_exit(interp, 1);
             }
 
@@ -459,7 +459,7 @@
     fixup_seg = (PackFile_FixupTable*)PackFile_Segment_new_seg(
         interp, &pf->directory, PF_FIXUP_SEG, FIXUP_TABLE_SEGMENT_NAME, 1);
     if (fixup_seg == NULL) {
-        PIO_eprintf(interp,
+        Parrot_io_eprintf(interp,
             "PBC Merge: Error creating fixup table segment.");
         Parrot_exit(interp, 1);
     }
@@ -469,7 +469,7 @@
         /* Get the fixup segment from the input file. */
         PackFile_FixupTable * const in_seg = inputs[i]->pf->cur_cs->fixups;
         if (in_seg == NULL) {
-            PIO_eprintf(interp,
+            Parrot_io_eprintf(interp,
                 "PBC Merge: Cannot locate fixup segment in %s",
                 inputs[i]->filename);
             Parrot_exit(interp, 1);
@@ -480,7 +480,7 @@
             fixups = (PackFile_FixupEntry **)mem_sys_realloc(fixups,
                 (cursor + in_seg->fixup_count) * sizeof (Parrot_Pointer));
             if (fixups == NULL) {
-                PIO_eprintf(interp, "PBC Merge: Out of memory");
+                Parrot_io_eprintf(interp, "PBC Merge: Out of memory");
                 Parrot_exit(interp, 1);
             }
         }
@@ -495,7 +495,7 @@
             char *name_copy = (char *)mem_sys_allocate(
                 strlen(cur_entry->name) + 1);
             if (copy == NULL || name_copy == NULL) {
-                PIO_eprintf(interp, "PBC Merge: Out of memory");
+                Parrot_io_eprintf(interp, "PBC Merge: Out of memory");
                 Parrot_exit(interp, 1);
             }
 
@@ -513,7 +513,7 @@
                     copy->offset = cur_entry->offset + inputs[i]->const_start;
                     break;
                 default:
-                    PIO_eprintf(interp, "PBC Merge: Unknown fixup type");
+                    Parrot_io_eprintf(interp, "PBC Merge: Unknown fixup type");
                     Parrot_exit(interp, 1);
             }
 
@@ -563,7 +563,7 @@
         lines = (opcode_t *)mem_sys_realloc(lines,
                 (num_lines + in_seg->base.size) * sizeof (opcode_t));
         if (lines == NULL) {
-            PIO_eprintf(interp, "PBC Merge: Cannot reallocate memory\n");
+            Parrot_io_eprintf(interp, "PBC Merge: Cannot reallocate memory\n");
             Parrot_exit(interp, 1);
         }
         memcpy(lines + num_lines, in_seg->base.data,
@@ -755,7 +755,7 @@
     /* Create a new empty packfile. */
     PackFile * const merged = PackFile_new(interp, 0);
     if (merged == NULL) {
-        PIO_eprintf(interp, "PBC Merge: Error creating new packfile.\n");
+        Parrot_io_eprintf(interp, "PBC Merge: Error creating new packfile.\n");
         Parrot_exit(interp, 1);
     }
 
@@ -797,18 +797,18 @@
     /* Allocate memory. */
     opcode_t * const pack = (opcode_t*) mem_sys_allocate(size);
     if (pack == NULL) {
-        PIO_eprintf(interp, "PBC Merge: Out of memory");
+        Parrot_io_eprintf(interp, "PBC Merge: Out of memory");
         Parrot_exit(interp, 1);
     }
 
     /* Write and clean up. */
     PackFile_pack(interp, pf, pack);
     if ((fp = fopen(filename, "wb")) == 0) {
-        PIO_eprintf(interp, "PBC Merge: Couldn't open %s\n", filename);
+        Parrot_io_eprintf(interp, "PBC Merge: Couldn't open %s\n", filename);
         Parrot_exit(interp, 1);
     }
     if ((1 != fwrite(pack, size, 1, fp))) {
-        PIO_eprintf(interp, "PBC Merge: Couldn't write %s\n", filename);
+        Parrot_io_eprintf(interp, "PBC Merge: Couldn't write %s\n", filename);
         Parrot_exit(interp, 1);
     }
     fclose(fp);
@@ -887,7 +887,7 @@
         input_files[i]->pf = pbc_merge_loadpbc(interp,
             input_files[i]->filename);
         if (input_files[i]->pf == NULL) {
-            PIO_eprintf(interp,
+            Parrot_io_eprintf(interp,
                 "PBC Merge: Unknown error while reading and unpacking %s\n",
                 *argv);
             Parrot_exit(interp, 1);

Modified: trunk/src/pdump.c
==============================================================================
--- trunk/src/pdump.c	(original)
+++ trunk/src/pdump.c	Mon Dec  8 21:16:33 2008
@@ -65,9 +65,9 @@
 static void
 const_dump(PARROT_INTERP, const PackFile_Segment *segp)
 {
-    PIO_printf(interp, "%s => [\n", segp->name);
+    Parrot_io_printf(interp, "%s => [\n", segp->name);
     PackFile_ConstTable_dump(interp, (const PackFile_ConstTable *)segp);
-    PIO_printf(interp, "],\n");
+    Parrot_io_printf(interp, "],\n");
 }
 
 /*
@@ -84,9 +84,9 @@
 static void
 fixup_dump(PARROT_INTERP, const PackFile_Segment *segp)
 {
-    PIO_printf(interp, "%s => [\n", segp->name);
+    Parrot_io_printf(interp, "%s => [\n", segp->name);
     PackFile_Fixup_dump(interp, (const PackFile_FixupTable *)segp);
-    PIO_printf(interp, "],\n");
+    Parrot_io_printf(interp, "],\n");
 }
 
 /*
@@ -105,24 +105,24 @@
 {
     opcode_t *pc;
     size_t i, n;
-    PIO_printf(interp, "%s => [ # %d ops at offs 0x%x\n",
+    Parrot_io_printf(interp, "%s => [ # %d ops at offs 0x%x\n",
             self->name, (int)self->size, (int)self->file_offset + 4);
     pc = self->data;
     while (pc < self->data + self->size) {
         /* trace_op_dump(interp, self->pf->src, pc); */
-        PIO_printf(interp, " %04x:  ", (int) (pc - self->data));
+        Parrot_io_printf(interp, " %04x:  ", (int) (pc - self->data));
         n = (size_t)interp->op_info_table[*pc].op_count;
         for (i = 0; i < 6; i++)
             if (i < n)
-                PIO_printf(interp, "%08lx ", (unsigned long) pc[i]);
+                Parrot_io_printf(interp, "%08lx ", (unsigned long) pc[i]);
             else
-                PIO_printf(interp, "         ");
-        PIO_printf(interp, "%s\n",
+                Parrot_io_printf(interp, "         ");
+        Parrot_io_printf(interp, "%s\n",
                 interp->op_info_table[*pc].full_name);
         ADD_OP_VAR_PART(interp, interp->code, pc, n);
         pc += n;
     }
-    PIO_printf(interp, "]\n");
+    Parrot_io_printf(interp, "]\n");
 }
 
 /*
@@ -139,23 +139,23 @@
 static void
 PackFile_header_dump(PARROT_INTERP, PackFile *pf)
 {
-    PIO_printf(interp, "HEADER => [\n");
-    PIO_printf(interp, "\twordsize  = %d", pf->header->wordsize);
-    PIO_printf(interp, "\t(interpreter's wordsize    = %d)\n",
+    Parrot_io_printf(interp, "HEADER => [\n");
+    Parrot_io_printf(interp, "\twordsize  = %d", pf->header->wordsize);
+    Parrot_io_printf(interp, "\t(interpreter's wordsize    = %d)\n",
             sizeof (opcode_t));
-    PIO_printf(interp, "\t(interpreter's INTVAL size = %d)\n",
+    Parrot_io_printf(interp, "\t(interpreter's INTVAL size = %d)\n",
             sizeof (INTVAL));
-    PIO_printf(interp, "\tbyteorder = %d", pf->header->byteorder);
-    PIO_printf(interp, "\t(interpreter's byteorder   = %d)\n",
+    Parrot_io_printf(interp, "\tbyteorder = %d", pf->header->byteorder);
+    Parrot_io_printf(interp, "\t(interpreter's byteorder   = %d)\n",
             PARROT_BIGENDIAN);
-    PIO_printf(interp, "\tfloattype = %d", pf->header->floattype);
-    PIO_printf(interp, "\t(interpreter's NUMVAL_SIZE = %d)\n", NUMVAL_SIZE);
-    PIO_printf(interp, "\t%s endianize, %s opcode, %s numval transform\n",
+    Parrot_io_printf(interp, "\tfloattype = %d", pf->header->floattype);
+    Parrot_io_printf(interp, "\t(interpreter's NUMVAL_SIZE = %d)\n", NUMVAL_SIZE);
+    Parrot_io_printf(interp, "\t%s endianize, %s opcode, %s numval transform\n",
             pf->need_endianize ? "**need**" : "no",
             pf->need_wordsize ? "**need**" : "no",
             pf->fetch_nv ? "**need**" : "no");
-    PIO_printf(interp, "\tdirformat = %d\n", pf->header->dir_format);
-    PIO_printf(interp, "]\n");
+    Parrot_io_printf(interp, "\tdirformat = %d\n", pf->header->dir_format);
+    Parrot_io_printf(interp, "]\n");
 }
 
 /*

Modified: trunk/src/pmc/coroutine.pmc
==============================================================================
--- trunk/src/pmc/coroutine.pmc	(original)
+++ trunk/src/pmc/coroutine.pmc	Mon Dec  8 21:16:33 2008
@@ -39,18 +39,18 @@
     Parrot_coro * const co     = PMC_coro(sub);
     Interp      * const tracer = interp->debugger ? interp->debugger : interp;
 
-    PIO_eprintf(tracer, "# %s coro '%Ss'",
+    Parrot_io_eprintf(tracer, "# %s coro '%Ss'",
         !(PObj_get_FLAGS(sub) & SUB_FLAG_CORO_FF) ?
         "Calling" : "yielding from",
         Parrot_full_sub_name(interp, sub));
 
     if (co->ctx && (PObj_get_FLAGS(sub) & SUB_FLAG_CORO_FF)) {
-        PIO_eprintf(tracer, " to '%Ss'",
+        Parrot_io_eprintf(tracer, " to '%Ss'",
                 Parrot_full_sub_name(interp,
                     co->ctx->caller_ctx->current_sub));
     }
 
-    PIO_eprintf(tracer, "\n# ");
+    Parrot_io_eprintf(tracer, "\n# ");
     print_pbc_location(interp);
 }
 

Modified: trunk/src/pmc/filehandle.pmc
==============================================================================
--- trunk/src/pmc/filehandle.pmc	(original)
+++ trunk/src/pmc/filehandle.pmc	Mon Dec  8 21:16:33 2008
@@ -26,6 +26,7 @@
     ATTR INTVAL flags;                /* Filehandle flags             */
     ATTR STRING *filename;            /* The opened path and filename */
     ATTR STRING *mode;                /* The mode string used in open */
+    ATTR STRING *encoding;            /* The encoding for read/write  */
     ATTR PIOHANDLE os_handle;         /* Low level OS descriptor      */
     ATTR PIOOFF_T file_size;          /* Current file size            */
     ATTR PIOOFF_T file_pos;           /* Current real file pointer    */
@@ -53,6 +54,7 @@
         PMC_data(SELF)            = data_struct;
         data_struct->flags        = 0;
         data_struct->mode         = NULL;
+        data_struct->encoding     = NULL;
         data_struct->filename     = NULL;
         data_struct->file_size    = 0;
         data_struct->file_pos     = piooffsetzero;
@@ -114,6 +116,8 @@
             pobject_lives(interp, (PObj *)data_struct->mode);
         if (data_struct->filename)
             pobject_lives(interp, (PObj *)data_struct->filename);
+        if (data_struct->encoding)
+            pobject_lives(interp, (PObj *)data_struct->encoding);
     }
 
 /*
@@ -129,8 +133,12 @@
         if (PARROT_FILEHANDLE(SELF)) {
             Parrot_FileHandle_attributes *data_struct = PARROT_FILEHANDLE(SELF);
 
-            if (!Parrot_io_is_closed(INTERP, SELF))
-                Parrot_io_close(INTERP, SELF);
+            if (!Parrot_io_is_closed(INTERP, SELF)) {
+                if (data_struct->flags & PIO_F_SHARED)
+                    Parrot_io_flush(INTERP, SELF);
+                else
+                    Parrot_io_close(INTERP, SELF);
+            }
 
             if (data_struct->buffer_start)
                 mem_sys_free(data_struct->buffer_start);
@@ -140,6 +148,20 @@
         }
     }
 
+/*
+
+=item C<INTVAL get_bool()>
+
+Returns whether the FileHandle has reached the end of the file.
+
+=cut
+
+*/
+
+    VTABLE INTVAL get_bool() {
+        return !Parrot_io_eof(INTERP, SELF);
+    }
+
 
 /*
 
@@ -245,6 +267,75 @@
 
 /*
 
+=item METHOD readall(STRING *name);
+
+Read the entire contents of a file named I<name> into a Parrot string. On a
+filehandle object that isn't opened yet, the path to a file can be passed to
+C<readall> and it will open a filehandle on that file, read in the contents,
+and close the filehandle.
+
+  .local pmc pio
+  pio = new 'FileHandle'
+  $S0 = pio.'readall'('the_file')
+
+If the filehandle is already open, then no file path should be passed. The
+C<readall> method will read the contents of the file, and will not close the
+filehandle when finished.
+
+  pio = open 'the_file', 'r'
+  $S0 = pio.'readall'()
+
+=cut
+
+*/
+
+    METHOD readall(STRING *name :optional, INTVAL got_name :opt_flag) {
+        STRING *result;
+
+        if (got_name) {
+            /* called as class method - open, slurp, close file */
+            PMC *filehandle;
+            STRING *encoding;
+            size_t size;
+            GET_ATTR_encoding(INTERP, SELF, encoding);
+            if (!Parrot_io_is_closed(INTERP, SELF)) {
+                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
+                                "Cannot readall on a new file from an already open filehandle");
+            }
+            filehandle  = Parrot_io_open(INTERP, PMCNULL, name, NULL);
+            SET_ATTR_encoding(INTERP, filehandle, encoding);
+            size = (size_t)(Parrot_stat_info_intval(INTERP, name, STAT_FILESIZE));
+
+            result = Parrot_io_reads(INTERP, filehandle, size);
+            Parrot_io_close(INTERP, filehandle);
+            RETURN(STRING *result);
+        }
+        else {
+            /* slurp open file */
+            if (Parrot_io_is_closed(INTERP, SELF)) {
+                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
+                                "Cannot readall without a file name or open filehandle");
+            }
+            result = string_make_empty(INTERP, enum_stringrep_one, 0);
+
+            /* Do line buffering on the filehandle */
+            if (!(PARROT_FILEHANDLE(SELF)->flags & PIO_F_LINEBUF))
+                Parrot_io_setlinebuf(INTERP, SELF);
+
+            do {
+                STRING * const part = Parrot_io_reads(INTERP, SELF, 0);
+
+                result = string_append(INTERP, result, part);
+                if (Parrot_io_eof(INTERP, SELF))
+                    break;
+            } while (1);
+        }
+
+        RETURN(STRING *result);
+    }
+
+/*
+
 =item C<METHOD print([INTVAL|FLOATVAL|STRING *|PMC*] value)>
 
 Print the passed in integer, number, string, or PMC to the filehandle.
@@ -262,6 +353,20 @@
 
 /*
 
+=item C<METHOD puts(STRING *value)>
+
+Print the string to the filehandle.
+
+=cut
+
+*/
+
+    METHOD puts(STRING *to_print) {
+        Parrot_io_putps(interp, SELF, to_print);
+    }
+
+/*
+
 =item C<METHOD buffer_type(STRING *new_type :optional)>
 
 Set or retrieve the buffering behavior for the filehandle. The argument and
@@ -354,26 +459,76 @@
 
     }
 
-#ifdef PIO_OS_UNIX
+/*
+
+=item C<METHOD encoding(STRING *new_encoding)>
+
+Set or retrieve the encoding attribute (a string name of the selected encoding
+scheme) for the filehandle.
+
+=cut
+
+*/
+
+    METHOD encoding(STRING *new_encoding :optional, INTVAL got_encoding :opt_flag) {
+        STRING *encoding;
+        STRING *encoding_copy = NULL;
+
+        if (got_encoding) {
+            if (!STRING_IS_NULL(new_encoding))
+                encoding_copy = string_copy(INTERP, new_encoding);
+            SET_ATTR_encoding(INTERP, SELF, encoding_copy);
+            RETURN(STRING *new_encoding);
+        }
+
+        GET_ATTR_encoding(INTERP, SELF, encoding);
+        if (!STRING_IS_NULL(encoding))
+            encoding_copy = string_copy(INTERP, encoding);
+
+        RETURN(STRING *encoding_copy);
+
+    }
+
+/*
+
+=item C<METHOD eof()>
+
+Returns true if the filehandle is at end-of-file, returns false otherwise.
+
+=cut
+
+*/
+
+    METHOD eof() {
+        if (Parrot_io_eof(INTERP, SELF))
+            RETURN(INTVAL 1);
+
+        RETURN(INTVAL 0);
+    }
+
 
 /*
 
 =item C<METHOD get_fd()>
 
 Retrieve the integer file descriptor for the FileHandle (only available on
-Unix-based platforms that use integer file descriptors).
+platforms that use integer file descriptors).
 
 =cut
 
 */
 
     METHOD get_fd() {
+#ifndef PIO_OS_STDIO
         INTVAL os_handle;
         GET_ATTR_os_handle(INTERP, SELF, os_handle);
         RETURN(INTVAL os_handle);
+#endif /*PIO_OS_STDIO*/
+
+        RETURN(INTVAL -1);
+
     }
 
-#endif /*PIO_OS_UNIX*/
 
 /*
 

Modified: trunk/src/pmc/pccmethod_test.pmc
==============================================================================
--- trunk/src/pmc/pccmethod_test.pmc	(original)
+++ trunk/src/pmc/pccmethod_test.pmc	Mon Dec  8 21:16:33 2008
@@ -18,21 +18,21 @@
     METHOD test_method()
     {
         UNUSED(SELF);
-        PIO_printf(interp, "test_method\n");
+        Parrot_io_printf(interp, "test_method\n");
     }
 
     METHOD test_method0(int a1)
     {
         UNUSED(SELF);
-        PIO_printf(interp, "test_method0\n");
-        PIO_printf(interp, "%d\n", a1);
+        Parrot_io_printf(interp, "test_method0\n");
+        Parrot_io_printf(interp, "%d\n", a1);
     }
 
     METHOD test_method1(int a1, int a2, int a3, int a4, int a5, int a6)
     {
         UNUSED(SELF);
-        PIO_printf(interp, "test_method1\n");
-        PIO_printf(interp, "%d,%d,%d,%d,%d,%d\n", a1, a2, a3, a4, a5, a6);
+        Parrot_io_printf(interp, "test_method1\n");
+        Parrot_io_printf(interp, "%d,%d,%d,%d,%d,%d\n", a1, a2, a3, a4, a5, a6);
     }
 
     METHOD test_method2(int a1 :optional, int a1o :opt_flag,
@@ -40,8 +40,8 @@
     {
         STRING *kevin = CONST_STRING(interp, "KEVIN");
         UNUSED(SELF);
-        PIO_printf(interp, "test_method2\n");
-        PIO_printf(interp, "%d, %d, %Ss %Ss\n", a1, a1o,
+        Parrot_io_printf(interp, "test_method2\n");
+        Parrot_io_printf(interp, "%d, %d, %Ss %Ss\n", a1, a1o,
             VTABLE_name(interp, slurpy_pos),
             VTABLE_get_repr(interp, slurpy_pos));
 
@@ -51,8 +51,8 @@
     METHOD test_method3(PMC *a1 :named("a1name"), PMC *a2  :named("a2name"))
     {
         UNUSED(SELF);
-        PIO_printf(interp, "test_method3\n");
-        PIO_printf(interp, "%Ps, %Ps\n", a1, a2);
+        Parrot_io_printf(interp, "test_method3\n");
+        Parrot_io_printf(interp, "%Ps, %Ps\n", a1, a2);
     }
 
     METHOD test_method4(int george :optional, int g_f :opt_flag,
@@ -63,7 +63,7 @@
         UNUSED(g_f);
         UNUSED(slurpy_pos);
         UNUSED(slurpy_named);
-        PIO_printf(interp, "test_method4\n");
+        Parrot_io_printf(interp, "test_method4\n");
     }
 }
 

Modified: trunk/src/pmc/sub.pmc
==============================================================================
--- trunk/src/pmc/sub.pmc	(original)
+++ trunk/src/pmc/sub.pmc	Mon Dec  8 21:16:33 2008
@@ -28,7 +28,7 @@
     Interp * const tracer = interp->debugger ? interp->debugger : interp;
 
     /* sub was located via globals */
-    PIO_eprintf(tracer, "# Calling sub '%Ss'\n# ",
+    Parrot_io_eprintf(tracer, "# Calling sub '%Ss'\n# ",
         Parrot_full_sub_name(interp, sub));
 
     print_pbc_location(interp);

Modified: trunk/src/pmc/unmanagedstruct.pmc
==============================================================================
--- trunk/src/pmc/unmanagedstruct.pmc	(original)
+++ trunk/src/pmc/unmanagedstruct.pmc	Mon Dec  8 21:16:33 2008
@@ -154,7 +154,7 @@
     max  = (size_t)VTABLE_get_integer_keyed_int(interp, init, ix + 1);
 
 #ifdef STRUCT_DEBUG
-    PIO_eprintf(interp, " count = %d ix = %d max = %d\n",
+    Parrot_io_eprintf(interp, " count = %d ix = %d max = %d\n",
             (int)count, (int)ix, (int)max);
 #endif
 
@@ -177,7 +177,7 @@
             offs = PMC_int_val(init);
 
 #ifdef STRUCT_DEBUG
-            PIO_eprintf(interp, "offs = %d\n", (int)offs);
+            Parrot_io_eprintf(interp, "offs = %d\n", (int)offs);
 #endif
 
             p += offs * count;

Modified: trunk/src/runops_cores.c
==============================================================================
--- trunk/src/runops_cores.c	(original)
+++ trunk/src/runops_cores.c	Mon Dec  8 21:16:33 2008
@@ -90,7 +90,7 @@
     return pc;
 #else
     UNUSED(pc);
-    PIO_eprintf(interp,
+    Parrot_io_eprintf(interp,
             "Computed goto unavailable in this configuration.\n");
     Parrot_exit(interp, 1);
 #endif
@@ -147,14 +147,14 @@
          * see trace_system_areas() in src/cpu_dep.c */
         debugger->lo_var_ptr = interp->lo_var_ptr;
 
-        pio = PIO_STDERR(debugger);
+        pio = Parrot_io_STDERR(debugger);
 
-        if (PIO_isatty(debugger, pio))
-            PIO_setlinebuf(debugger, pio);
+        if (Parrot_io_is_tty(debugger, pio))
+            Parrot_io_setlinebuf(debugger, pio);
         else {
             /* this is essential (100 x faster!)  and should probably
              * be in init/open code */
-            PIO_setbuf(debugger, pio, 8192);
+            Parrot_io_setbuf(debugger, pio, 8192);
         }
     }
     else
@@ -173,16 +173,16 @@
 
         if (dod != arena_base->dod_runs) {
             dod = arena_base->dod_runs;
-            PIO_eprintf(debugger, "       DOD\n");
+            Parrot_io_eprintf(debugger, "       DOD\n");
         }
 
         if (gc != arena_base->collect_runs) {
             gc = arena_base->collect_runs;
-            PIO_eprintf(debugger, "       GC\n");
+            Parrot_io_eprintf(debugger, "       GC\n");
         }
     }
 
-    PIO_flush(debugger, PIO_STDERR(debugger));
+    Parrot_io_flush(debugger, Parrot_io_STDERR(debugger));
 
     return pc;
 }

Modified: trunk/src/spf_vtable.c
==============================================================================
--- trunk/src/spf_vtable.c	(original)
+++ trunk/src/spf_vtable.c	Mon Dec  8 21:16:33 2008
@@ -593,7 +593,7 @@
 =head1 TODO
 
 In the future, it may be deemed desirable to similarly vtable-ize
-appending things to the string, allowing for faster C<PIO_printf()> &c,
+appending things to the string, allowing for faster C<Parrot_io_printf()> &c,
 as well as a version that writes directly to a C string. However, at
 this point neither of those is needed.
 

Modified: trunk/src/stacks.c
==============================================================================
--- trunk/src/stacks.c	(original)
+++ trunk/src/stacks.c	Mon Dec  8 21:16:33 2008
@@ -456,7 +456,7 @@
 =item C<void Parrot_dump_dynamic_environment>
 
 Print a representation of the dynamic stack to the standard error (using
-C<PIO_eprintf>).  This is used only temporarily for debugging.
+C<Parrot_io_eprintf>).  This is used only temporarily for debugging.
 
 =cut
 
@@ -474,7 +474,7 @@
         if (! e)
             Parrot_ex_throw_from_c_args(interp, NULL, 1, "Dynamic environment stack damaged");
 
-        PIO_eprintf(interp, "[%4d:  chunk %p entry %p "
+        Parrot_io_eprintf(interp, "[%4d:  chunk %p entry %p "
                                  "type %d cleanup %p]\n",
                     height, dynamic_env, e,
                     e->entry_type, e->cleanup);
@@ -482,18 +482,18 @@
                 || e->entry_type == STACK_ENTRY_ACTION) {
             PMC * const thing = UVal_pmc(e->entry);
 
-            PIO_eprintf(interp, "[        PMC %p type %d => %Ss]\n",
+            Parrot_io_eprintf(interp, "[        PMC %p type %d => %Ss]\n",
                         thing, thing->vtable->base_type,
                         VTABLE_get_string(interp, thing));
         }
         else if (e->entry_type == STACK_ENTRY_MARK) {
-            PIO_eprintf(interp, "[        mark %d]\n",
+            Parrot_io_eprintf(interp, "[        mark %d]\n",
                         UVal_int(e->entry));
         }
         dynamic_env = dynamic_env->prev;
         height--;
     }
-    PIO_eprintf(interp, "[%4d:  chunk %p %s base]\n",
+    Parrot_io_eprintf(interp, "[%4d:  chunk %p %s base]\n",
                 height, dynamic_env, dynamic_env->name);
 }
 

Modified: trunk/src/stm/backend.c
==============================================================================
--- trunk/src/stm/backend.c	(original)
+++ trunk/src/stm/backend.c	Mon Dec  8 21:16:33 2008
@@ -32,8 +32,8 @@
 #define STM_DEBUG 0
 
 #if STM_DEBUG
-#  define STM_TRACE(x...) PIO_fprintf(interp, PIO_STDERR(interp), x); \
-                                   PIO_fprintf(interp, PIO_STDERR(interp), "\n")
+#  define STM_TRACE(x...) Parrot_io_fprintf(interp, Parrot_io_STDERR(interp), x); \
+                                   Parrot_io_fprintf(interp, Parrot_io_STDERR(interp), "\n")
 #  undef fprintf
 #  define STM_TRACE_SAFE(x...) fprintf(stderr, x); fprintf(stderr, "\n");
 #else

Modified: trunk/src/string.c
==============================================================================
--- trunk/src/string.c	(original)
+++ trunk/src/string.c	Mon Dec  8 21:16:33 2008
@@ -159,7 +159,7 @@
         if (n_interpreters > 1 && PObj_is_movable_TESTALL(s) &&
                 !Parrot_in_memory_pool(interp, PObj_bufstart(s))) {
             Parrot_unmake_COW(interp, d);
-            PIO_eprintf(interp, "cross-interpreter copy of "
+            Parrot_io_eprintf(interp, "cross-interpreter copy of "
                                      "relocatable string '%Ss' into tid %d\n",
                         d,
                         interp->thread_data->tid);

Modified: trunk/src/sub.c
==============================================================================
--- trunk/src/sub.c	(original)
+++ trunk/src/sub.c	Mon Dec  8 21:16:33 2008
@@ -677,7 +677,7 @@
     if (Interp_trace_TEST(interp, PARROT_TRACE_SUB_CALL_FLAG)) {
         PMC *sub = to_ctx->current_sub;
 
-        PIO_eprintf(interp, "# Back in sub '%Ss', env %p\n",
+        Parrot_io_eprintf(interp, "# Back in sub '%Ss', env %p\n",
                     Parrot_full_sub_name(interp, sub),
                     interp->dynamic_env);
     }

Modified: trunk/src/thread.c
==============================================================================
--- trunk/src/thread.c	(original)
+++ trunk/src/thread.c	Mon Dec  8 21:16:33 2008
@@ -458,7 +458,7 @@
         /* caught exception */
         /* XXX what should we really do here */
         /* PMC *exception = Parrot_cx_peek_task(interp);
-        PIO_eprintf(interp,
+        Parrot_io_eprintf(interp,
                     "Unhandled exception in thread with tid %d "
                     "(message=%Ss, number=%d)\n",
                     interp->thread_data->tid,
@@ -643,7 +643,7 @@
 pt_transfer_sub(ARGOUT(Parrot_Interp d), ARGIN(Parrot_Interp s), ARGIN(PMC *sub))
 {
 #if defined THREAD_DEBUG && THREAD_DEBUG
-    PIO_eprintf(s, "copying over subroutine [%Ss]\n",
+    Parrot_io_eprintf(s, "copying over subroutine [%Ss]\n",
         Parrot_full_sub_name(s, sub));
 #endif
     return make_local_copy(d, s, sub);

Modified: trunk/src/trace.c
==============================================================================
--- trunk/src/trace.c	(original)
+++ trunk/src/trace.c	Mon Dec  8 21:16:33 2008
@@ -82,75 +82,75 @@
     Interp * const debugger = interp->debugger;
 
     if (!pmc) {
-        PIO_eprintf(debugger, "(null)");
+        Parrot_io_eprintf(debugger, "(null)");
         return;
     }
     if (PMC_IS_NULL(pmc))  {
-        PIO_eprintf(debugger, "PMCNULL");
+        Parrot_io_eprintf(debugger, "PMCNULL");
         return;
     }
     if (!pmc->vtable || (UINTVAL)pmc->vtable == 0xdeadbeef) {
-        PIO_eprintf(debugger, "<!!no vtable!!>");
+        Parrot_io_eprintf(debugger, "<!!no vtable!!>");
         return;
     }
     if (PObj_on_free_list_TEST(pmc)) {
-        PIO_eprintf(debugger, "**************** PMC is on free list *****\n");
+        Parrot_io_eprintf(debugger, "**************** PMC is on free list *****\n");
     }
     if (pmc->vtable->pmc_class == pmc) {
         STRING * const name = trace_class_name(pmc);
-        PIO_eprintf(debugger, "Class=%Ss:PMC(%#p)", name, pmc);
+        Parrot_io_eprintf(debugger, "Class=%Ss:PMC(%#p)", name, pmc);
     }
     else if (pmc->vtable->base_type == enum_class_String) {
         const STRING * const s = VTABLE_get_string(interp, pmc);
         if (!s)
-            PIO_eprintf(debugger, "%S=PMC(%#p Str:(NULL))",
+            Parrot_io_eprintf(debugger, "%S=PMC(%#p Str:(NULL))",
                     VTABLE_name(interp, pmc), pmc);
         else {
             STRING* const escaped = string_escape_string_delimited(
                             interp, s, 20);
             if (escaped)
-                PIO_eprintf(debugger, "%S=PMC(%#p Str:\"%Ss\")",
+                Parrot_io_eprintf(debugger, "%S=PMC(%#p Str:\"%Ss\")",
                     VTABLE_name(interp, pmc), pmc,
                     escaped);
             else
-                PIO_eprintf(debugger, "%S=PMC(%#p Str:\"(null)\")",
+                Parrot_io_eprintf(debugger, "%S=PMC(%#p Str:\"(null)\")",
                     VTABLE_name(interp, pmc), pmc);
         }
     }
     else if (pmc->vtable->base_type == enum_class_Boolean) {
-        PIO_eprintf(debugger, "Boolean=PMC(%#p: %d)",
+        Parrot_io_eprintf(debugger, "Boolean=PMC(%#p: %d)",
                 pmc, PMC_int_val(pmc));
     }
     else if (pmc->vtable->base_type == enum_class_Integer) {
-        PIO_eprintf(debugger, "Integer=PMC(%#p: %d)",
+        Parrot_io_eprintf(debugger, "Integer=PMC(%#p: %d)",
                 pmc, PMC_int_val(pmc));
     }
     else if (pmc->vtable->base_type == enum_class_BigInt) {
         STRING * const s = VTABLE_get_string(interp, pmc);
-        PIO_eprintf(debugger, "BigInt=PMC(%#p: %Ss)",
+        Parrot_io_eprintf(debugger, "BigInt=PMC(%#p: %Ss)",
                 pmc, s);
     }
     else if (pmc->vtable->base_type == enum_class_Complex) {
         STRING * const s = VTABLE_get_string(interp, pmc);
-        PIO_eprintf(debugger, "Complex=PMC(%#p: %Ss)",
+        Parrot_io_eprintf(debugger, "Complex=PMC(%#p: %Ss)",
                 pmc, s);
     }
     else if (pmc->vtable->base_type == enum_class_RetContinuation
             ||  pmc->vtable->base_type == enum_class_Continuation
             ||  pmc->vtable->base_type == enum_class_Sub) {
-        PIO_eprintf(debugger, "%S=PMC(%#p pc:%d)",
+        Parrot_io_eprintf(debugger, "%S=PMC(%#p pc:%d)",
                 VTABLE_name(interp, pmc), pmc,
                 PMC_sub(pmc)->start_offs);
     }
     else if (PObj_is_object_TEST(pmc)) {
-        PIO_eprintf(debugger, "Object(%Ss)=PMC(%#p)",
+        Parrot_io_eprintf(debugger, "Object(%Ss)=PMC(%#p)",
                 VTABLE_get_string(interp, VTABLE_get_class(interp, pmc)), pmc);
     }
     else if (pmc->vtable->base_type == enum_class_delegate) {
-        PIO_eprintf(debugger, "delegate=PMC(%#p)", pmc);
+        Parrot_io_eprintf(debugger, "delegate=PMC(%#p)", pmc);
     }
     else {
-        PIO_eprintf(debugger, "%S=PMC(%#p)",
+        Parrot_io_eprintf(debugger, "%S=PMC(%#p)",
                 VTABLE_name(interp, pmc), pmc);
     }
 }
@@ -170,15 +170,15 @@
 {
     Interp * const debugger = interp->debugger;
 
-    int len = PIO_eprintf(debugger, "[");
+    int len = Parrot_io_eprintf(debugger, "[");
 
     while (key) {
         switch (PObj_get_FLAGS(key) & KEY_type_FLAGS) {
         case KEY_integer_FLAG:
-            len += PIO_eprintf(debugger, "%vi", PMC_int_val(key));
+            len += Parrot_io_eprintf(debugger, "%vi", PMC_int_val(key));
             break;
         case KEY_number_FLAG:
-            len += PIO_eprintf(debugger, "%vg", PMC_num_val(key));
+            len += Parrot_io_eprintf(debugger, "%vg", PMC_num_val(key));
             break;
         case KEY_string_FLAG:
             {
@@ -186,17 +186,17 @@
             STRING* const escaped = string_escape_string_delimited(
                             interp, s, 20);
             if (escaped)
-                len += PIO_eprintf(debugger, "\"%Ss\"", escaped);
+                len += Parrot_io_eprintf(debugger, "\"%Ss\"", escaped);
             else
-                len += PIO_eprintf(debugger, "\"(null)\"");
+                len += Parrot_io_eprintf(debugger, "\"(null)\"");
             }
             break;
         case KEY_integer_FLAG|KEY_register_FLAG:
-            len += PIO_eprintf(debugger, "I%vd=%vd", PMC_int_val(key),
+            len += Parrot_io_eprintf(debugger, "I%vd=%vd", PMC_int_val(key),
                     REG_INT(interp, PMC_int_val(key)));
             break;
         case KEY_number_FLAG|KEY_register_FLAG:
-            len += PIO_eprintf(debugger, "I%vd=%vd", PMC_int_val(key),
+            len += Parrot_io_eprintf(debugger, "I%vd=%vd", PMC_int_val(key),
                     REG_NUM(interp, PMC_int_val(key)));
             break;
         case KEY_string_FLAG|KEY_register_FLAG:
@@ -205,19 +205,19 @@
             STRING* const escaped = string_escape_string_delimited(
                             interp, s, 20);
             if (escaped)
-                len += PIO_eprintf(debugger, "S%vd=\"%Ss\"", PMC_int_val(key),
+                len += Parrot_io_eprintf(debugger, "S%vd=\"%Ss\"", PMC_int_val(key),
                         escaped);
             else
-                len += PIO_eprintf(debugger, "S%vd=\"(null)\"",
+                len += Parrot_io_eprintf(debugger, "S%vd=\"(null)\"",
                         PMC_int_val(key));
             }
             break;
         case KEY_pmc_FLAG|KEY_register_FLAG:
-            len += PIO_eprintf(debugger, "P%vd=", PMC_int_val(key));
+            len += Parrot_io_eprintf(debugger, "P%vd=", PMC_int_val(key));
             trace_pmc_dump(debugger, REG_PMC(interp, PMC_int_val(key)));
             break;
         default:
-            len += PIO_eprintf(debugger, "??");
+            len += Parrot_io_eprintf(debugger, "??");
             key = NULL;
             break;
         }
@@ -225,11 +225,11 @@
         if (key) {
             key = (PMC *)PMC_data(key);
             if (key)
-                len += PIO_eprintf(debugger, ";");
+                len += Parrot_io_eprintf(debugger, ";");
         }
     } /* while */
 
-    len += PIO_eprintf(debugger, "]");
+    len += Parrot_io_eprintf(debugger, "]");
     return len;
 }
 
@@ -263,22 +263,22 @@
     sig = NULL; /* silence compiler uninit warning */
 
     s = 1;
-    len = PIO_eprintf(debugger, "%6vu ", (UINTVAL)(pc - code_start));
+    len = Parrot_io_eprintf(debugger, "%6vu ", (UINTVAL)(pc - code_start));
     if (STREQ(info->name, "infix")) {
         /* this should rather be MMD_opcode_name, which doesn't
          * exit yet
          */
-        len += PIO_eprintf(debugger, "%s",
+        len += Parrot_io_eprintf(debugger, "%s",
                 Parrot_MMD_method_name(interp, pc[1]) + 2);
         s = 2;
     }
     else if (STREQ(info->name, "n_infix")) {
-        len += PIO_eprintf(debugger, "n_%s",
+        len += Parrot_io_eprintf(debugger, "n_%s",
                 Parrot_MMD_method_name(interp, pc[1]) + 2);
         s = 2;
     }
     else
-        len += PIO_eprintf(debugger, "%s", info->name);
+        len += Parrot_io_eprintf(debugger, "%s", info->name);
 
     n = info->op_count;
     var_args = 0;
@@ -299,7 +299,7 @@
 
     if (n > 1) {
         INTVAL i;
-        len += PIO_eprintf(debugger, " ");
+        len += Parrot_io_eprintf(debugger, " ");
         /* pass 1 print arguments */
         for (i = s; i < n; i++) {
             const opcode_t o = pc[i];
@@ -319,21 +319,21 @@
                     type != PARROT_ARG_KIC &&
                     type != PARROT_ARG_KI &&
                     type != PARROT_ARG_K) {
-                len += PIO_eprintf(debugger, ", ");
+                len += Parrot_io_eprintf(debugger, ", ");
             }
             switch (type) {
                 case PARROT_ARG_IC:
-                    len += PIO_eprintf(debugger, "%vd", o);
+                    len += Parrot_io_eprintf(debugger, "%vd", o);
                     break;
                 case PARROT_ARG_NC:
-                    len += PIO_eprintf(debugger, "%vg", PCONST(o)->u.number);
+                    len += Parrot_io_eprintf(debugger, "%vg", PCONST(o)->u.number);
                     break;
                 case PARROT_ARG_PC:
                     if (var_args)
-                        len += PIO_eprintf(debugger, "PC%d (%d)",
+                        len += Parrot_io_eprintf(debugger, "PC%d (%d)",
                                 (int)o, var_args);
                     else
-                        len += PIO_eprintf(debugger, "PC%d", (int)o);
+                        len += Parrot_io_eprintf(debugger, "PC%d", (int)o);
                     break;
                 case PARROT_ARG_SC:
                     {
@@ -341,39 +341,39 @@
                             interp,
                             PCONST(o)->u.string, 20);
                     if (escaped)
-                        len += PIO_eprintf(debugger, "\"%Ss\"", escaped);
+                        len += Parrot_io_eprintf(debugger, "\"%Ss\"", escaped);
                     else
-                        len += PIO_eprintf(debugger, "\"(null)\"");
+                        len += Parrot_io_eprintf(debugger, "\"(null)\"");
                     }
                     break;
                 case PARROT_ARG_KC:
                     len += trace_key_dump(interp, PCONST(o)->u.key);
                     break;
                 case PARROT_ARG_KIC:
-                    len += PIO_eprintf(debugger, "[%vd]", o);
+                    len += Parrot_io_eprintf(debugger, "[%vd]", o);
                     break;
                 case PARROT_ARG_KI:
-                    len += PIO_eprintf(debugger, "[I%vd]", o);
+                    len += Parrot_io_eprintf(debugger, "[I%vd]", o);
                     more = 1;
                     break;
                 case PARROT_ARG_K:
-                    len += PIO_eprintf(debugger, "[P%vd]", o);
+                    len += Parrot_io_eprintf(debugger, "[P%vd]", o);
                     more = 1;
                     break;
                 case PARROT_ARG_I:
-                    len += PIO_eprintf(debugger, "I%vd", o);
+                    len += Parrot_io_eprintf(debugger, "I%vd", o);
                     more = 1;
                     break;
                 case PARROT_ARG_N:
-                    len += PIO_eprintf(debugger, "N%vd", o);
+                    len += Parrot_io_eprintf(debugger, "N%vd", o);
                     more = 1;
                     break;
                 case PARROT_ARG_P:
-                    len += PIO_eprintf(debugger, "P%vd", o);
+                    len += Parrot_io_eprintf(debugger, "P%vd", o);
                     more = 1;
                     break;
                 case PARROT_ARG_S:
-                    len += PIO_eprintf(debugger, "S%vd", o);
+                    len += Parrot_io_eprintf(debugger, "S%vd", o);
                     more = 1;
                     break;
                 default:
@@ -388,10 +388,10 @@
             STRING * const fill = string_repeat(debugger,
                     const_string(debugger, " "),
                     ARGS_COLUMN - len, NULL);
-            PIO_putps(debugger, PIO_STDERR(debugger), fill);
+            Parrot_io_putps(debugger, Parrot_io_STDERR(debugger), fill);
         }
         else {
-            PIO_eprintf(debugger, "\t");
+            Parrot_io_eprintf(debugger, "\t");
         }
 
         /* pass 2 print argument details if needed */
@@ -403,39 +403,39 @@
                 type = SIG_ITEM(sig, i - 2) &
                     (PARROT_ARG_TYPE_MASK|PARROT_ARG_CONSTANT);
             if (i > s) {
-                PIO_eprintf(debugger, " ");
+                Parrot_io_eprintf(debugger, " ");
             }
             switch (type) {
                 case PARROT_ARG_I:
-                    PIO_eprintf(debugger, "I%vd=%vd", o, REG_INT(interp, o));
+                    Parrot_io_eprintf(debugger, "I%vd=%vd", o, REG_INT(interp, o));
                     break;
                 case PARROT_ARG_N:
-                    PIO_eprintf(debugger, "N%vd=%vf", o, REG_NUM(interp, o));
+                    Parrot_io_eprintf(debugger, "N%vd=%vf", o, REG_NUM(interp, o));
                     break;
                 case PARROT_ARG_PC:
-                    PIO_eprintf(debugger, "PC%vd=", o);
+                    Parrot_io_eprintf(debugger, "PC%vd=", o);
                     trace_pmc_dump(interp, PCONST(o)->u.key);
                     break;
                 case PARROT_ARG_P:
-                    PIO_eprintf(debugger, "P%vd=", o);
+                    Parrot_io_eprintf(debugger, "P%vd=", o);
                     trace_pmc_dump(interp, REG_PMC(interp, o));
                     break;
                 case PARROT_ARG_S:
                     if (REG_STR(interp, o)) {
                         STRING* const escaped = string_escape_string_delimited(
                                 interp, REG_STR(interp, o), 20);
-                        PIO_eprintf(debugger, "S%vd=\"%Ss\"", o,
+                        Parrot_io_eprintf(debugger, "S%vd=\"%Ss\"", o,
                                 escaped);
                     }
                     else
-                        PIO_eprintf(debugger, "S%vd=\"(null)\"", o);
+                        Parrot_io_eprintf(debugger, "S%vd=\"(null)\"", o);
                     break;
                 case PARROT_ARG_K:
-                    PIO_eprintf(debugger, "P%vd=", o);
+                    Parrot_io_eprintf(debugger, "P%vd=", o);
                     trace_key_dump(interp, REG_PMC(interp, *(pc + i)));
                     break;
                 case PARROT_ARG_KI:
-                    PIO_eprintf(debugger, "I%vd=[%vd]", o, REG_INT(interp, o));
+                    Parrot_io_eprintf(debugger, "I%vd=[%vd]", o, REG_INT(interp, o));
                     break;
                 default:
                     break;
@@ -443,7 +443,7 @@
         }
     }
 done:
-    PIO_eprintf(debugger, "\n");
+    Parrot_io_eprintf(debugger, "\n");
 }
 
 /*
@@ -472,7 +472,7 @@
     if (pc >= code_start && pc < code_end)
         trace_op_dump(interp, code_start, pc);
     else
-        PIO_eprintf(interp, "PC=%ld; OP=<err>\n", (long)(pc - code_start));
+        Parrot_io_eprintf(interp, "PC=%ld; OP=<err>\n", (long)(pc - code_start));
 }
 
 /*

Modified: trunk/src/warnings.c
==============================================================================
--- trunk/src/warnings.c	(original)
+++ trunk/src/warnings.c	Mon Dec  8 21:16:33 2008
@@ -36,7 +36,7 @@
 
 =item C<void print_pbc_location>
 
-Prints the bytecode location of the warning or error to C<PIO_STDERR>.
+Prints the bytecode location of the warning or error to C<Parrot_io_STDERR>.
 
 =cut
 
@@ -47,7 +47,7 @@
 print_pbc_location(PARROT_INTERP)
 {
     Interp * const tracer = interp->debugger ? interp->debugger : interp;
-    PIO_eprintf(tracer, "%Ss\n",
+    Parrot_io_eprintf(tracer, "%Ss\n",
             Parrot_Context_infostr(interp,
                 CONTEXT(interp)));
 }
@@ -66,11 +66,11 @@
 print_warning(PARROT_INTERP, ARGIN_NULLOK(STRING *msg))
 {
     if (!msg)
-        PIO_puts(interp, PIO_STDERR(interp), "Unknown warning\n");
+        Parrot_io_puts(interp, Parrot_io_STDERR(interp), "Unknown warning\n");
     else {
-        PIO_putps(interp, PIO_STDERR(interp), msg);
+        Parrot_io_putps(interp, Parrot_io_STDERR(interp), msg);
         if (string_ord(interp, msg, -1) != '\n')
-            PIO_eprintf(interp, "%c", '\n');
+            Parrot_io_eprintf(interp, "%c", '\n');
     }
     print_pbc_location(interp);
     return 1;

Modified: trunk/t/compilers/imcc/syn/op.t
==============================================================================
--- trunk/t/compilers/imcc/syn/op.t	(original)
+++ trunk/t/compilers/imcc/syn/op.t	Mon Dec  8 21:16:33 2008
@@ -268,7 +268,7 @@
 
 pir_output_is( <<'CODE', <<'OUT', "x = can" );
 .sub test :main
-    $P0 = new 'ParrotIO'
+    $P0 = new 'FileHandle'
     $I0 = can $P0, "puts"
     print $I0
     print "\n"

Modified: trunk/t/op/interp.t
==============================================================================
--- trunk/t/op/interp.t	(original)
+++ trunk/t/op/interp.t	Mon Dec  8 21:16:33 2008
@@ -7,7 +7,7 @@
 use lib qw( . lib ../lib ../../lib );
 
 use Test::More;
-use Parrot::Test tests => 9;
+use Parrot::Test tests => 8;
 
 =head1 NAME
 
@@ -45,14 +45,13 @@
 OUTPUT
 }
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'runinterp - works without printing' );
+pir_output_is( <<'CODE', <<'OUTPUT', 'runinterp - works with printing' );
 .sub 'test' :main
     .local string actual
     .local pmc test_interp
                test_interp = new 'ParrotInterpreter'
     .local pmc stdout
                stdout = getstdout
-    push stdout, 'string'
 
     print "uno\n"
     runinterp test_interp, pasm
@@ -62,7 +61,6 @@
     $S0 = readline stdout
     actual .= $S0
     if $S0 goto get_stdout
-    $S0 = pop stdout
 
     print actual
     goto pasm_end
@@ -77,40 +75,6 @@
 dos
 OUTPUT
 
-pir_output_is(
-    <<'CODE', <<'OUTPUT', 'runinterp - works with printing', todo => 'something funky here' );
-.sub 'test' :main
-    .local string actual
-    .local pmc test_interp
-               test_interp = new 'ParrotInterpreter'
-    .local pmc stdout
-               stdout = getstdout
-    push stdout, 'string'
-
-    print "uno\n"
-    runinterp test_interp, pasm
-    print "dos\n"
-
-  get_stdout:
-    $S0 = readline stdout
-    actual .= $S0
-    if $S0 goto get_stdout
-    $S0 = pop stdout
-
-    print actual
-    goto pasm_end
-
-  pasm:
-    print "y uno es igual a\n"
-    end
-  pasm_end:
-.end
-CODE
-uno
-y uno es igual a
-dos
-OUTPUT
-
 # Need to disable DOD while trace is on, as there's a non-zero chance that a
 # DOD sweep would occur, causing a bonus "DOD" line in the output, which makes
 # the test fail.

Modified: trunk/t/op/string_cs.t
==============================================================================
--- trunk/t/op/string_cs.t	(original)
+++ trunk/t/op/string_cs.t	Mon Dec  8 21:16:33 2008
@@ -490,16 +490,18 @@
 
 SKIP: {
     skip( 'no ICU lib', 16 ) unless $PConfig{has_icu};
-    pasm_output_is( <<'CODE', <<"OUTPUT", "unicode downcase" );
-    set S0, iso-8859-1:"T�TSCH"
-    find_charset I0, "unicode"
-    trans_charset S1, S0, I0
-    downcase S1
-    getstdout P0          # need to convert back to utf8
-    push P0, "utf8"       # push utf8 output layer
-    print S1
+    pir_output_is( <<'CODE', <<"OUTPUT", "unicode downcase" );
+.sub main :main
+    set $S0, iso-8859-1:"T�TSCH"
+    find_charset $I0, "unicode"
+    trans_charset $S1, $S0, $I0
+    downcase $S1
+    getstdout $P0           # need to convert back to utf8
+    $P0.'encoding'("utf8")  # set utf8 output
+    print $S1
     print "\n"
     end
+.end
 CODE
 t\xc3\xb6tsch
 OUTPUT
@@ -690,28 +692,32 @@
 6
 OUTPUT
 
-    pasm_output_is( <<'CODE', <<"OUTPUT", "unicode upcase" );
-    set S0, iso-8859-1:"t�tsch"
-    find_charset I0, "unicode"
-    trans_charset S1, S0, I0
-    upcase S1
-    getstdout P0          # need to convert back to utf8
-    push P0, "utf8"       # push utf8 output layer
-    print S1
+    pir_output_is( <<'CODE', <<"OUTPUT", "unicode upcase" );
+.sub main :main
+    set $S0, iso-8859-1:"t�tsch"
+    find_charset $I0, "unicode"
+    trans_charset $S1, $S0, $I0
+    upcase $S1
+    getstdout $P0         # need to convert back to utf8
+    $P0.'encoding'("utf8") # set utf8 output
+    print $S1
     print "\n"
     end
+.end
 CODE
 T\x{c3}\x{96}TSCH
 OUTPUT
 
-    pasm_output_is( <<'CODE', <<"OUTPUT", "unicode upcase to combined char" );
-    set S1, unicode:"hacek j \u01f0"
-    upcase S1
-    getstdout P0          # need to convert back to utf8
-    push P0, "utf8"       # push utf8 output layer
-    print S1
+    pir_output_is( <<'CODE', <<"OUTPUT", "unicode upcase to combined char" );
+.sub main :main
+    set $S1, unicode:"hacek j \u01f0"
+    upcase $S1
+    getstdout $P0          # need to convert back to utf8
+    $P0.'encoding'("utf8") # set utf8 output
+    print $S1
     print "\n"
     end
+.end
 CODE
 HACEK J J\xcc\x8c
 OUTPUT
@@ -732,54 +738,60 @@
     # (gdb) x /8h src->strstart
     # 0x844fb60:      0x005f  0x005f  0x005f  0x004a  0x030c  0x0031  0x0032  0x0000
 
-    pasm_output_is( <<'CODE', <<"OUTPUT", "unicode upcase to combined char 3.2 bug?" );
-    set S1, unicode:"___\u01f0123"
-    upcase S1
-    getstdout P0          # need to convert back to utf8
-    push P0, "utf8"       # push utf8 output layer
-    print S1
+    pir_output_is( <<'CODE', <<"OUTPUT", "unicode upcase to combined char 3.2 bug?" );
+.sub main :main
+    set $S1, unicode:"___\u01f0123"
+    upcase $S1
+    getstdout $P0          # need to convert back to utf8
+    $P0.'encoding'("utf8") # set utf8 output
+    print $S1
     print "\n"
     end
+.end
 CODE
 ___J\xcc\x8c123
 OUTPUT
 
-    pasm_output_is( <<'CODE', <<"OUTPUT", "unicode titlecase" );
-    set S0, iso-8859-1:"t�tsch leo"
-    find_charset I0, "unicode"
-    trans_charset S1, S0, I0
-    titlecase S1
-    getstdout P0          # need to convert back to utf8
-    push P0, "utf8"       # push utf8 output layer
-    print S1
+    pir_output_is( <<'CODE', <<"OUTPUT", "unicode titlecase" );
+.sub main :main
+    set $S0, iso-8859-1:"t�tsch leo"
+    find_charset $I0, "unicode"
+    trans_charset $S1, $S0, $I0
+    titlecase $S1
+    getstdout $P0          # need to convert back to utf8
+    $P0.'encoding'("utf8") # set utf8 output
+    print $S1
     print "\n"
     end
+.end
 CODE
 T\x{c3}\x{b6}tsch Leo
 OUTPUT
 
-    pasm_output_is( <<'CODE', <<OUTPUT, "combose combined char" );
-    set S1, unicode:"___\u01f0___"
-    length I0, S1
-    upcase S1        # decompose J+hacek
-    length I1, S1    # 1 longer
-    downcase S1      # j+hacek
-    length I2, S1
-    compose S1, S1
-    length I3, S1    # back at original string
-    getstdout P0          # need to convert back to utf8
-    push P0, "utf8"       # push utf8 output layer
-    print S1
+    pir_output_is( <<'CODE', <<OUTPUT, "combose combined char" );
+.sub main :main
+    set $S1, unicode:"___\u01f0___"
+    length $I0, $S1
+    upcase $S1         # decompose J+hacek
+    length $I1, $S1    # 1 longer
+    downcase $S1       # j+hacek
+    length $I2, $S1
+    compose $S1, $S1
+    length $I3, $S1        # back at original string
+    getstdout $P0          # need to convert back to utf8
+    $P0.'encoding'("utf8") # set utf8 output
+    print $S1
     print "\n"
-    print I0
+    print $I0
     print ' '
-    print I1
+    print $I1
     print ' '
-    print I2
+    print $I2
     print ' '
-    print I3
+    print $I3
     print "\n"
     end
+.end
 CODE
 ___\x{c7}\x{b0}___
 7 8 8 7

Modified: trunk/t/op/stringu.t
==============================================================================
--- trunk/t/op/stringu.t	(original)
+++ trunk/t/op/stringu.t	Mon Dec  8 21:16:33 2008
@@ -23,127 +23,147 @@
 
 =cut
 
-pasm_output_is( <<'CODE', <<OUTPUT, "angstrom" );
-    getstdout P0
-    push P0, "utf8"
-    chr S0, 0x212B
-    print P0, S0
-    print P0, "\n"
+pir_output_is( <<'CODE', <<OUTPUT, "angstrom" );
+.sub main :main
+    getstdout $P0
+    $P0.'encoding'("utf8")
+    chr $S0, 0x212B
+    print $P0, $S0
+    print $P0, "\n"
     end
+.end
 CODE
 \xe2\x84\xab
 OUTPUT
 
-pasm_output_is( <<'CODE', <<OUTPUT, "escaped angstrom" );
-    getstdout P0
-    push P0, "utf8"
-    set S0, unicode:"\x{212b}"
-    print S0
+pir_output_is( <<'CODE', <<OUTPUT, "escaped angstrom" );
+.sub main :main
+    getstdout $P0
+    $P0.'encoding'("utf8")
+    set $S0, unicode:"\x{212b}"
+    print $S0
     print "\n"
     end
+.end
 CODE
 \xe2\x84\xab
 OUTPUT
 
-pasm_output_is( <<'CODE', <<OUTPUT, "escaped angstrom 2" );
-    getstdout P0
-    push P0, "utf8"
-    set S0, unicode:"aaaaaa\x{212b}"
-    print S0
+pir_output_is( <<'CODE', <<OUTPUT, "escaped angstrom 2" );
+.sub main :main
+    getstdout $P0
+    $P0.'encoding'("utf8")
+    set $S0, unicode:"aaaaaa\x{212b}"
+    print $S0
     print "\n"
     end
+.end
 CODE
 aaaaaa\xe2\x84\xab
 OUTPUT
 
-pasm_output_is( <<'CODE', <<OUTPUT, "escaped angstrom 3" );
-    getstdout P0
-    push P0, "utf8"
-    set S0, unicode:"aaaaaa\x{212b}-aaaaaa"
-    print S0
+pir_output_is( <<'CODE', <<OUTPUT, "escaped angstrom 3" );
+.sub main :main
+    getstdout $P0
+    $P0.'encoding'("utf8")
+    set $S0, unicode:"aaaaaa\x{212b}-aaaaaa"
+    print $S0
     print "\n"
     end
+.end
 CODE
 aaaaaa\xe2\x84\xab-aaaaaa
 OUTPUT
 
-pasm_output_is( <<'CODE', <<OUTPUT, 'escaped angstrom 3 \uhhhh' );
-    getstdout P0
-    push P0, "utf8"
-    set S0, unicode:"aaaaaa\u212b-aaaaaa"
-    print S0
+pir_output_is( <<'CODE', <<OUTPUT, 'escaped angstrom 3 \uhhhh' );
+.sub main :main
+    getstdout $P0
+    $P0.'encoding'("utf8")
+    set $S0, unicode:"aaaaaa\u212b-aaaaaa"
+    print $S0
     print "\n"
     end
+.end
 CODE
 aaaaaa\xe2\x84\xab-aaaaaa
 OUTPUT
 
-pasm_output_is( <<'CODE', <<OUTPUT, "MATHEMATICAL BOLD CAPITAL A" );
-    getstdout P0
-    push P0, "utf8"
-    set S0, unicode:"aaaaaa\x{1d400}-aaaaaa"
-    print S0
+pir_output_is( <<'CODE', <<OUTPUT, "MATHEMATICAL BOLD CAPITAL A" );
+.sub main :main
+    getstdout $P0
+    $P0.'encoding'("utf8")
+    set $S0, unicode:"aaaaaa\x{1d400}-aaaaaa"
+    print $S0
     print "\n"
     end
+.end 
 CODE
 aaaaaa\xf0\x9d\x90\x80-aaaaaa
 OUTPUT
 
-pasm_output_is( <<'CODE', <<OUTPUT, 'MATHEMATICAL BOLD CAPITAL A \U' );
-    getstdout P0
-    push P0, "utf8"
-    set S0, unicode:"aaaaaa\U0001d400-aaaaaa"
-    print S0
+pir_output_is( <<'CODE', <<OUTPUT, 'MATHEMATICAL BOLD CAPITAL A \U' );
+.sub main :main
+    getstdout $P0
+    $P0.'encoding'("utf8")
+    set $S0, unicode:"aaaaaa\U0001d400-aaaaaa"
+    print $S0
     print "\n"
     end
+.end
 CODE
 aaaaaa\xf0\x9d\x90\x80-aaaaaa
 OUTPUT
 
-pasm_output_is( <<'CODE', <<OUTPUT, "two upscales" );
-    getstdout P0
-    push P0, "utf8"
-    set S0, unicode:"aaaaaa\x{212b}-bbbbbb\x{1d400}-cccccc"
-    print S0
+pir_output_is( <<'CODE', <<OUTPUT, "two upscales" );
+.sub main :main
+    getstdout $P0
+    $P0.'encoding'("utf8")
+    set $S0, unicode:"aaaaaa\x{212b}-bbbbbb\x{1d400}-cccccc"
+    print $S0
     print "\n"
-    length I0, S0
-    print I0
+    length $I0, $S0
+    print $I0
     print "\n"
     end
+.end
 CODE
 aaaaaa\xe2\x84\xab-bbbbbb\xf0\x9d\x90\x80-cccccc
 22
 OUTPUT
 
-pasm_output_is( <<'CODE', <<OUTPUT, "two upscales - don't downscale" );
-    getstdout P0
-    push P0, "utf8"
-    set S0, unicode:"aaaaaa\x{1d400}-bbbbbb\x{212b}-cccccc"
-    print S0
+pir_output_is( <<'CODE', <<OUTPUT, "two upscales - don't downscale" );
+.sub main :main
+    getstdout $P0
+    $P0.'encoding'("utf8")
+    set $S0, unicode:"aaaaaa\x{1d400}-bbbbbb\x{212b}-cccccc"
+    print $S0
     print "\n"
-    length I0, S0
-    print I0
+    length $I0, $S0
+    print $I0
     print "\n"
     end
+.end
 CODE
 aaaaaa\xf0\x9d\x90\x80-bbbbbb\xe2\x84\xab-cccccc
 22
 OUTPUT
 
-pasm_output_is( <<'CODE', <<OUTPUT, '\cX, \ooo' );
-    getstdout P0
-    push P0, "utf8"
-    set S0, "ok 1\cJ"
-    print S0
-    set S0, "ok 2\012"
-    print S0
-    set S0, "ok 3\12"
-    print S0
-    set S0, "ok 4\x0a"
-    print S0
-    set S0, "ok 5\xa"
-    print S0
+pir_output_is( <<'CODE', <<OUTPUT, '\cX, \ooo' );
+.sub main :main
+    getstdout $P0
+    $P0.'encoding'("utf8")
+    set $S0, "ok 1\cJ"
+    print $S0
+    set $S0, "ok 2\012"
+    print $S0
+    set $S0, "ok 3\12"
+    print $S0
+    set $S0, "ok 4\x0a"
+    print $S0
+    set $S0, "ok 5\xa"
+    print $S0
     end
+.end
 CODE
 ok 1
 ok 2

Modified: trunk/t/pmc/filehandle.t
==============================================================================
--- trunk/t/pmc/filehandle.t	(original)
+++ trunk/t/pmc/filehandle.t	Mon Dec  8 21:16:33 2008
@@ -7,7 +7,8 @@
 use lib qw( . lib ../lib ../../lib );
 
 use Test::More;
-use Parrot::Test tests => 10;
+use Parrot::Test tests => 17;
+use Parrot::Test::Util 'create_tempfile';
 use Parrot::Test::Util 'create_tempfile';
 
 =head1 NAME
@@ -47,7 +48,7 @@
     say 'ok 2 - \$P1.close()'
 
     \$P3 = new 'FileHandle'
-    \$P3.'open'('README', 'rw')
+    \$P3.'open'('$temp_file', 'rw')
     say 'ok 3 - \$P3.open(\$S1, \$S2) # rw mode'
     \$P3.'close'()
 
@@ -238,6 +239,56 @@
 ok 2 - $S0 = $P1.readline() # again on same stream
 OUT
 
+my $LINES;
+($LINES, $temp_file) = create_tempfile( UNLINK => 1 );
+
+for my $counter (1 .. 10000) {
+    print $LINES $counter, "\n";
+}
+close $LINES;
+
+pir_output_is( <<"CODE", <<'OUT', 'readline 10,000 lines' );
+.sub 'test' :main
+    load_bytecode 'String/Utils.pbc'
+    .local pmc chomp
+               chomp = get_global ['String';'Utils'], 'chomp'
+    .local string test_line
+    .local pmc filehandle
+    .local int counter
+    filehandle = new 'FileHandle'
+    filehandle.'open'('$temp_file')
+
+    counter = 0
+  read_loop:
+    inc counter 
+    # read in the file one line at a time...
+    \$I0 = filehandle.'eof'()
+    if \$I0 goto end_read_loop
+
+    test_line = readline filehandle
+    if test_line == "" goto end_read_loop
+    test_line = chomp( test_line )
+    \$I1 = test_line
+    if \$I1 == counter goto read_loop
+      print "not "
+## the following lines provide more extensive debugging
+## output on a readline failure
+#      print counter
+#      print " = "
+#      print \$I1
+#      print "\\n"
+#      counter = \$I1
+#      goto read_loop
+
+  end_read_loop:
+    say 'ok 1 - read 10,000 lines'
+    filehandle.'close'()
+.end
+CODE
+ok 1 - read 10,000 lines
+OUT
+
+
 # RT #46833 test reading/writing code points once supported
 
 # RT #46835 test reading long chunks, eof, and across newlines
@@ -366,8 +417,69 @@
 ok 3 - $S0 = $P0.readline()    # buffer flushed
 OUT
 
-# L<PDD22/I\/O PMC API/=item mode>
+# L<PDD22/I\/O PMC API/=item encoding>
+pir_output_is( <<'CODE', <<'OUT', 'encoding' );
+.sub 'test' :main
+    $P0 = new 'FileHandle'
+
+    $P0.'encoding'('utf8')
+    $S0 = $P0.'encoding'()
+    if $S0 == 'utf8' goto ok_1
+    print 'not '
+  ok_1:
+    say 'ok 1 - $S0 = $P1.encoding() # utf8'
+
+.end
+CODE
+ok 1 - $S0 = $P1.encoding() # utf8
+OUT
+
+(undef, $temp_file) = create_tempfile( UNLINK => 1 );
+
+pir_output_is( <<"CODE", <<'OUT', 'encoding - read/write' );
+.sub 'test' :main
+    \$P0 = new 'FileHandle'
+    \$P0.'encoding'('utf8')
+
+    \$P0.'open'('$temp_file', 'w')
+
+    \$P0.'print'(1234567890)
+    \$P0.'print'("\\n")
+    \$S0 = iso-8859-1:"TÖTSCH" 
+    \$P0.'print'(\$S0)
+    \$P0.'close'()
+
+    \$P1 = new 'FileHandle'
+    \$P1.'encoding'('utf8')
 
+    \$P1.'open'('$temp_file')
+
+    \$S1 = \$P1.'readline'()
+    if \$S1 == "1234567890\\n" goto ok_1
+print \$S1
+    print 'not '
+  ok_1:
+    say 'ok 1 - \$S1 = \$P1.readline() # read with utf8 encoding on'
+
+    \$S2 = \$P1.'readline'()
+    if \$S2 == \$S0 goto ok_2
+print \$S2
+    print 'not '
+  ok_2:
+    say 'ok 2 - \$S2 = \$P1.readline() # read iso-8859-1 string'
+
+    \$P1.'close'()
+
+.end
+CODE
+ok 1 - $S1 = $P1.readline() # read with utf8 encoding on
+ok 2 - $S2 = $P1.readline() # read iso-8859-1 string
+OUT
+
+
+(undef, $temp_file) = create_tempfile( UNLINK => 1 );
+
+# L<PDD22/I\/O PMC API/=item mode>
 pir_output_is( <<'CODE', <<'OUT', 'mode' );
 .sub 'test' :main
     $P0 = new 'FileHandle'
@@ -387,6 +499,89 @@
 ok 1 - $S0 = $P0.mode() # get read mode
 OUT
 
+pir_output_is( <<"CODE", <<"OUTPUT", "readall - closed filehandle" );
+.sub main :main
+    \$S0 = <<"EOS"
+line 1
+line 2
+line 3
+EOS
+    .local pmc pio, pio2
+    pio = new 'FileHandle'
+    pio.'open'("$temp_file", "w")
+    pio.'print'(\$S0)
+    pio.'close'()
+    pio2 = new 'FileHandle'
+    \$S1 = pio2.'readall'('$temp_file')
+    if \$S0 == \$S1 goto ok
+    print "not "
+ok:
+    say "ok"
+.end
+CODE
+ok
+OUTPUT
+
+pir_output_is( <<"CODE", <<"OUTPUT", "readall() - opened filehandle" );
+.sub main :main
+    \$S0 = <<"EOS"
+line 1
+line 2
+line 3
+EOS
+    .local pmc pio, pio2
+    pio = new 'FileHandle'
+    pio.'open'("$temp_file", "w")
+    pio.'print'(\$S0)
+    pio.'close'()
+
+    pio2 = new 'FileHandle'
+    pio2.'open'("$temp_file", "r")
+    \$S1 = pio2.'readall'()
+    if \$S0 == \$S1 goto ok
+    print "not "
+ok:
+    say "ok"
+.end
+CODE
+ok
+OUTPUT
+
+pir_output_is( <<"CODE", <<"OUTPUT", "readall() - utf8 on closed filehandle" );
+.sub 'main'
+    .local pmc ifh
+    ifh = new 'FileHandle'
+    ifh.'encoding'('utf8')
+   
+    \$S0 = ifh.'readall'('$temp_file')
+
+    \$I0 = encoding \$S0
+    \$S1 = encodingname \$I0
+
+    say \$S1
+.end
+CODE
+utf8
+OUTPUT
+
+pir_output_is( <<"CODE", <<"OUTPUT", "readall() - utf8 on opened filehandle" );
+.sub 'main'
+    .local pmc ifh
+    ifh = new 'FileHandle'
+    ifh.'encoding'('utf8')
+    ifh.'open'('$temp_file')
+
+    \$S0 = ifh.'readall'()
+
+    \$I0 = encoding \$S0
+    \$S1 = encodingname \$I0
+
+    say \$S1
+.end
+CODE
+utf8
+OUTPUT
+
 # RT #46843
 # L<PDD22/I\/O PMC API/=item get_fd>
 # NOTES: this is going to be platform dependent

Modified: trunk/t/pmc/io.t
==============================================================================
--- trunk/t/pmc/io.t	(original)
+++ trunk/t/pmc/io.t	Mon Dec  8 21:16:33 2008
@@ -7,7 +7,8 @@
 use lib qw( . lib ../lib ../../lib );
 
 use Test::More;
-use Parrot::Test tests => 45;
+use Parrot::Test tests => 43;
+use Parrot::Test::Util 'create_tempfile';
 use Parrot::Test::Util 'create_tempfile';
 
 =head1 NAME
@@ -157,11 +158,18 @@
 my (undef, $no_such_file) = create_tempfile( UNLINK => 1, OPEN => 0 );
 
 pasm_output_is( <<"CODE", <<'OUTPUT', "get_bool" );
+    push_eh read_non_existent_file
     open P0, "$no_such_file", "<"
-    unless P0, ok1
+
     print "Huh: '$no_such_file' exists? - not "
 ok1:
     say "ok 1"
+
+    open P0, "$temp_file", ">"
+    print P0, "a line\\n"
+    print P0, "a line\\n"
+    close P0
+
     open P0, "$temp_file", "<"
     if P0, ok2
     print "not "
@@ -184,6 +192,9 @@
     print "not "
 ok6:    say "ok 6"
     end
+read_non_existent_file:
+    pop_eh
+    branch ok1
 CODE
 ok 1
 ok 2
@@ -193,38 +204,38 @@
 ok 6
 OUTPUT
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "read on invalid fh should throw exception" );
-    open P0, "no_such_file", "<"
-    unless P0, ok1
-    print "Huh: 'no_such_file' exists? - not "
-ok1:
-    print "ok 1\n"
+pasm_output_is( <<"CODE", <<'OUTPUT', "read on invalid fh should throw exception" );
+    new P0, 'FileHandle'
+
+    push_eh _readline_handler
+    readline S0, P0
+    print "not "
 
-        push_eh _readline_handler
-        readline S0, P0 # Currently segfaults
-        print "not "
 _readline_handler:
-        print "ok 2\n"
-    branch fin
+        print "ok 1\\n"
+        pop_eh
+
+    push_eh _read_handler
+    read S0, P0, 1
+    print "not "
 
-        push_eh _read_handler
-        read S0, P0, 1
-        print "not "
 _read_handler:
-        print "ok 3\n"
+        print "ok 2\\n"
+        pop_eh
+
+    push_eh _print_handler
+    print P0, "kill me now\\n"
+    print "not "
 
-        push_eh _print_handler
-        print P0, "kill me now\n"
-        print "not "
 _print_handler:
-fin:
-        print "ok 4\n"
+        print "ok 3\\n"
+        pop_eh
 
-        end
+    end
 CODE
 ok 1
 ok 2
-ok 4
+ok 3
 OUTPUT
 
 SKIP: {
@@ -287,7 +298,7 @@
    new P0, 'String'
    set P0, "Bar\\n"
 
-   open P1, "$temp_file"
+   open P1, "$temp_file", "w"
    print P1, I0
    print P1, N0
    print P1, S0
@@ -309,23 +320,36 @@
 
 # write to file opened for reading
 pasm_output_is( <<"CODE", <<'OUTPUT', "3-arg open" );
-   open P1, "$temp_file", "<"
+   open P1, "$temp_file", ">"
    print P1, "Foobar\\n"
    close P1
 
+   push_eh _print_to_read_only
+
+   open P2, "$temp_file", "<"
+   print P2, "baz\\n"
+   say "skipped"
+
+_print_to_read_only:
+   say "caught writing to file opened for reading"
+   pop_eh
+
+   close P2
+
    open P3, "$temp_file", "<"
    readline S1, P3
    close P3
-
    print S1
-   say "writing to file opened for reading"
+
+
    end
 CODE
-writing to file opened for reading
+caught writing to file opened for reading
+Foobar
 OUTPUT
 
 pasm_output_is( <<"CODE", <<'OUTPUT', 'open and close' );
-   open P1, "$temp_file"
+   open P1, "$temp_file", "w"
    print P1, "Hello, World!\\n"
    close P1
    say "done"
@@ -361,7 +385,7 @@
 Parrot overwrites
 OUTPUT
 
-pasm_output_is( <<"CODE", '', "PIO_flush on buffer full" );
+pasm_output_is( <<"CODE", '', "Parrot_io_flush on buffer full" );
    set I0, 0
    set I1, 10000
 
@@ -382,21 +406,26 @@
 words
 OUTPUT
 
-pasm_output_is( <<"CODE", '0', "turn off buffering" );
-   open P0, "$temp_file", ">"
+pir_output_is( <<"CODE", <<'OUTPUT', "turn off buffering" );
+.sub main :main
+   open \$P0, "$temp_file", ">"
 
-#  PIOCTL_CMDSETBUFTYPE, PIOCTL_NONBUF
-   pioctl I0, P0, 3, 0
+#  set buffer type
+   \$P0.'buffer_type'('unbuffered')
 
-#  PIOCTL_CMDGETBUFTYPE, <dummy value>
-   pioctl I0, P0, 4, 0
-   print I0
+#  get buffer type
+   \$S0 = \$P0.'buffer_type'()
+   print \$S0
+   print "\\n"
 
-   print P0, "Howdy World\\n"
+   print \$P0, "Howdy World\\n"
 
-   close P0
+   close \$P0
    end
+.end
 CODE
+unbuffered
+OUTPUT
 
 file_content_is( $temp_file, <<'OUTPUT', 'unbuffered file contents' );
 Howdy World
@@ -622,49 +651,7 @@
 ok 1
 OUTPUT
 
-pasm_output_like( <<'CODE', <<'OUTPUT', "layer names" );
-    getstdin P0
-    set S0, P0[0]
-    print S0
-    print "-"
-    set S0, P0[1]
-    print S0
-    print "-"
-    set S0, P0[-1]
-    print S0
-    print "-"
-    set S0, P0[-2]
-    print S0
-    print "-"
-    set S0, P0[-3]
-    print S0
-    print "-"
-    end
-CODE
-/^(unix|win32|stdio)-buf-buf-\1--$/
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "layer push, pop" );
-    getstdin P0
-    push P0, "utf8"
-    set S0, P0[-1]
-    print S0
-    print "\n"
-    pop S1, P0
-    print S1
-    print "\n"
-    set S0, P0[-1]
-    print S0
-    print "\n"
-    end
-CODE
-utf8
-utf8
-buf
-OUTPUT
-
 pir_output_is( <<"CODE", <<'OUTPUT', "substr after reading from file" );
-
 .sub _main
     # Write something into a file
     .local pmc out
@@ -746,7 +733,7 @@
 print $FOO "T\xc3\xb6tsch\n";
 close $FOO;
 
-pir_output_is( <<"CODE", <<"OUTPUT", "utf8 read layer" );
+pir_output_is( <<"CODE", <<"OUTPUT", "utf8 read enabled" );
 .sub main :main
     .local pmc pio
     .local int len
@@ -755,7 +742,7 @@
     f = '$temp_file'
     len = stat f, .STAT_FILESIZE
     pio = open f, "<"
-    push pio, "utf8"
+    pio.'encoding'("utf8")
     \$S0 = read pio, len
     close pio
     \$I1 = charset \$S0
@@ -776,13 +763,13 @@
 T\xf6tsch
 OUTPUT
 
-pir_output_is( <<"CODE", <<"OUTPUT", "utf8 read layer - readline" );
+pir_output_is( <<"CODE", <<"OUTPUT", "utf8 read enabled - readline" );
 .sub main :main
     .local pmc pio
     .local string f
     f = '$temp_file'
     pio = open f, "<"
-    push pio, "utf8"
+    pio.'encoding'("utf8")
     \$S0 = readline pio
     close pio
     \$I1 = charset \$S0
@@ -803,7 +790,7 @@
 T\xf6tsch
 OUTPUT
 
-pir_output_is( <<"CODE", <<"OUTPUT", "utf8 read layer, read parts" );
+pir_output_is( <<"CODE", <<"OUTPUT", "utf8 read enabled, read parts" );
 .sub main :main
     .local pmc pio
     .local int len
@@ -812,7 +799,7 @@
     f = '$temp_file'
     len = stat f, .STAT_FILESIZE
     pio = open f, "<"
-    push pio, "utf8"
+    pio.'encoding'("utf8")
     \$S0 = read pio, 2
     len -= 2
     \$S1 = read pio, len
@@ -836,32 +823,28 @@
 T\xf6tsch
 OUTPUT
 
-pir_output_is( <<'CODE', <<"OUTPUT", "string read/write layer" );
+pir_output_is( <<'CODE', <<"OUTPUT", "string read/write handle", todo => "no stringhandle yet" );
 .sub main :main
     .local pmc    pio
     .local string greeting
     .local string layer
 
-    pio = getstdout
-    push pio, "string"
-    print "Hello"
-    print ", "
-    print "world!"
-    print "\n"
+    pio = new 'StringHandle'
+    print pio, "Hello"
+    print pio, ", "
+    print pio, "world!"
+    print pio, "\n"
 
     greeting = read pio, 1024
-    pop layer, pio
 
     print greeting
-    print layer
     print "\n"
 .end
 CODE
 Hello, world!
-string
 OUTPUT
 
-pir_output_is( <<"CODE", <<"OUTPUT", "PIO.slurp() - classmeth" );
+pir_output_is( <<"CODE", <<"OUTPUT", "PIO.readall() - classmeth" );
 .sub main :main
     \$S0 = <<"EOS"
 line 1
@@ -872,8 +855,8 @@
     pio = open    "$temp_file", ">"
     print pio, \$S0
     close pio
-    cl = new 'ParrotIO'
-    \$S1 = cl.'slurp'('$temp_file')
+    cl = new 'FileHandle'
+    \$S1 = cl.'readall'('$temp_file')
     if \$S0 == \$S1 goto ok
     print "not "
 ok:
@@ -883,7 +866,7 @@
 ok
 OUTPUT
 
-pir_output_is( <<"CODE", <<"OUTPUT", "PIO.slurp() - object" );
+pir_output_is( <<"CODE", <<"OUTPUT", "PIO.readall() - object" );
 .sub main :main
     \$S0 = <<"EOS"
 line 1
@@ -895,7 +878,7 @@
     print pio, \$S0
     close pio
     pio2 = open    "$temp_file", "<"
-    \$S1 = pio2.'slurp'('dummy')
+    \$S1 = pio2.'readall'()
     if \$S0 == \$S1 goto ok
     print "not "
 ok:

Modified: trunk/t/pmc/parrotio.t
==============================================================================
--- trunk/t/pmc/parrotio.t	(original)
+++ trunk/t/pmc/parrotio.t	Mon Dec  8 21:16:33 2008
@@ -10,7 +10,7 @@
 
 =head1 NAME
 
-t/pmc/parrotio.t - test the ParrotIO PMC
+t/pmc/parrotio.t - test the FileHandle PMC
 
 =head1 SYNOPSIS
 
@@ -18,24 +18,24 @@
 
 =head1 DESCRIPTION
 
-Tests the ParrotIO PMC.
+Tests the FileHandle PMC.
 
 =cut
 
 # L<PDD22/I\/O PMC API/=item new>
 pir_output_is( <<'CODE', <<'OUT', 'new' );
 .sub 'test' :main
-    new $P0, 'ParrotIO'
-    say "ok 1 - $P0 = new 'ParrotIO'"
+    new $P0, 'FileHandle'
+    say "ok 1 - $P0 = new 'FileHandle'"
 .end
 CODE
-ok 1 - $P0 = new 'ParrotIO'
+ok 1 - $P0 = new 'FileHandle'
 OUT
 
 # L<PDD22/I\/O PMC API/=item open.*=item close>
 pir_output_is( <<'CODE', <<'OUT', 'open and close - synchronous', todo => 'not yet implemented' );
 .sub 'test' :main
-    $P0 = new 'ParrotIO'
+    $P0 = new 'FileHandle'
     $P0.open('README')
     say 'ok 1 - $P0.open($S1)'
 
@@ -89,7 +89,7 @@
     pir_output_is( <<'CODE', <<'OUT', 'open and close - asynchronous' );
 .sub 'test' :main
     $P1 = # RT #46831 create a callback here
-    $P0 = new 'ParrotIO'
+    $P0 = new 'FileHandle'
 
     $P0.open('README')
     say 'ok 1 - $P0.open($S1)'
@@ -123,7 +123,7 @@
     .local pmc chomp
                chomp = get_global ['String';'Utils'], 'chomp'
 
-    $P0 = new 'ParrotIO'
+    $P0 = new 'FileHandle'
     $P0.open('README')
 
     $S0 = $P0.read(14) # bytes
@@ -177,7 +177,7 @@
 # L<PDD22/I\/O PMC API/=item record_separator>
 pir_output_is( <<'CODE', <<'OUT', 'record_separator', todo => 'not yet implemented' );
 .sub 'test' :main
-    $P0 = new 'ParrotIO'
+    $P0 = new 'FileHandle'
 
     $S0 = $P0.record_separator()
     if $S0 == "\n" goto ok_1
@@ -215,7 +215,7 @@
 .sub 'test' :main
     .include 'io_buffer_types.pasm'
 
-    $P0 = new 'ParrotIO'
+    $P0 = new 'FileHandle'
 
     $P0.buffer_type('unbuffered')
     $I0 = $P0.buffer_type()

Modified: trunk/t/src/basic.t
==============================================================================
--- trunk/t/src/basic.t	(original)
+++ trunk/t/src/basic.t	Mon Dec  8 21:16:33 2008
@@ -70,11 +70,11 @@
         return 1;
     }
 
-    PIO_eprintf(interp, "main\n");
+    Parrot_io_eprintf(interp, "main\n");
 
     Parrot_run_native(interp, the_test);
 
-    PIO_eprintf(interp, "back\n");
+    Parrot_io_eprintf(interp, "back\n");
     Parrot_exit(interp, 0);
     return 0;
 }
@@ -87,7 +87,7 @@
     UNUSED(start);
 
     /* tests go here */
-    PIO_eprintf(interp, "ok\n");
+    Parrot_io_eprintf(interp, "ok\n");
 
     return NULL; /* always return 0 or bad things may happen */
 }

Modified: trunk/t/src/compiler.t
==============================================================================
--- trunk/t/src/compiler.t	(original)
+++ trunk/t/src/compiler.t	Mon Dec  8 21:16:33 2008
@@ -52,7 +52,7 @@
     PMC    *comp    = Parrot_PMC_get_pmc_keyed_str(interp, compreg, pir);
 
     if (PMC_IS_NULL(comp) || !Parrot_PMC_defined(interp, comp)) {
-        PIO_eprintf(interp, "Pir compiler not loaded");
+        Parrot_io_eprintf(interp, "Pir compiler not loaded");
         exit(EXIT_FAILURE);
     }
 
@@ -60,7 +60,7 @@
     prog = imcc_compile_pir(interp, c_src);
 
     if (PMC_IS_NULL(prog) || !Parrot_PMC_defined(interp, prog)) {
-        PIO_eprintf(interp, "Pir compiler returned no prog");
+        Parrot_io_eprintf(interp, "Pir compiler returned no prog");
         exit(EXIT_FAILURE);
     }
 
@@ -136,7 +136,7 @@
     PMC    *comp   = Parrot_PMC_get_pmc_keyed_str(interp, compreg, pir);
 
     if (PMC_IS_NULL(comp) || !Parrot_PMC_defined(interp, comp)) {
-        PIO_eprintf(interp, "Pir compiler not loaded");
+        Parrot_io_eprintf(interp, "Pir compiler not loaded");
         exit(EXIT_FAILURE);
     }
 
@@ -144,7 +144,7 @@
     prog = Parrot_compile_string(interp, pir, c_src, &error);
 
     if (PMC_IS_NULL(prog) || !Parrot_PMC_defined(interp, prog)) {
-        PIO_eprintf(interp, "Pir compiler returned no prog");
+        Parrot_io_eprintf(interp, "Pir compiler returned no prog");
         exit(EXIT_FAILURE);
     }
 
@@ -211,7 +211,7 @@
     PMC      *prog = Parrot_compile_string(interp, type, src, &error);
 
     if (PMC_IS_NULL(prog) || !Parrot_PMC_defined(interp, prog)) {
-        PIO_eprintf(interp, "Pir compiler returned no prog");
+        Parrot_io_eprintf(interp, "Pir compiler returned no prog");
         exit(EXIT_FAILURE);
     }
 
@@ -251,7 +251,7 @@
     PMC    *comp    = Parrot_PMC_get_pmc_keyed_str(interp, compreg, pir);
 
     if (PMC_IS_NULL(comp) || !Parrot_PMC_defined(interp, comp)) {
-        PIO_eprintf(interp, "Pir compiler not loaded");
+        Parrot_io_eprintf(interp, "Pir compiler not loaded");
         exit(EXIT_FAILURE);
     }
 
@@ -304,7 +304,7 @@
     PMC      *prog = Parrot_compile_string(interp, type, src, &error);
 
     if (PMC_IS_NULL(prog) || !Parrot_PMC_defined(interp, prog)) {
-        PIO_eprintf(interp, "Pir compiler returned no prog\n");
+        Parrot_io_eprintf(interp, "Pir compiler returned no prog\n");
         return;
     }
 
@@ -344,7 +344,7 @@
     PMC    *comp    = Parrot_PMC_get_pmc_keyed_str(interp, compreg, pir);
 
     if (PMC_IS_NULL(comp) || !Parrot_PMC_defined(interp, comp)) {
-        PIO_eprintf(interp, "Pir compiler not loaded");
+        Parrot_io_eprintf(interp, "Pir compiler not loaded");
         return NULL;
     }
 
@@ -397,7 +397,7 @@
     PMC      *prog = Parrot_compile_string(interp, type, src, &error);
 
     if (PMC_IS_NULL(prog) || !Parrot_PMC_defined(interp, prog)) {
-        PIO_eprintf(interp, "Pir compiler returned no prog\n");
+        Parrot_io_eprintf(interp, "Pir compiler returned no prog\n");
         return;
     }
 
@@ -436,7 +436,7 @@
     PMC    *comp    = Parrot_PMC_get_pmc_keyed_str(interp, compreg, pir);
 
     if (PMC_IS_NULL(comp) || !Parrot_PMC_defined(interp, comp)) {
-        PIO_eprintf(interp, "Pir compiler not loaded");
+        Parrot_io_eprintf(interp, "Pir compiler not loaded");
         return NULL;
     }
 
@@ -489,7 +489,7 @@
     PMC      *prog = Parrot_compile_string(interp, type, src, &error);
 
     if (PMC_IS_NULL(prog) || !Parrot_PMC_defined(interp, prog)) {
-        PIO_eprintf(interp, "Pir compiler returned no prog\n");
+        Parrot_io_eprintf(interp, "Pir compiler returned no prog\n");
         return;
     }
 
@@ -527,7 +527,7 @@
     PMC    *comp    = Parrot_PMC_get_pmc_keyed_str(interp, compreg, pir);
 
     if (PMC_IS_NULL(comp) || !Parrot_PMC_defined(interp, comp)) {
-        PIO_eprintf(interp, "Pir compiler not loaded");
+        Parrot_io_eprintf(interp, "Pir compiler not loaded");
         return NULL;
     }
 

Modified: trunk/t/src/exit.t
==============================================================================
--- trunk/t/src/exit.t	(original)
+++ trunk/t/src/exit.t	Mon Dec  8 21:16:33 2008
@@ -44,7 +44,7 @@
 void
 ex3(Parrot_Interp interp, int x, void*p)
 {
-    PIO_printf(interp, "ex3\n");
+    Parrot_io_printf(interp, "ex3\n");
 }
 
 int

Modified: trunk/t/src/extend.t
==============================================================================
--- trunk/t/src/extend.t	(original)
+++ trunk/t/src/extend.t	Mon Dec  8 21:16:33 2008
@@ -450,7 +450,7 @@
     Parrot_eprintf(interp, "back\\n");
 
     /* win32 seems to buffer stderr ? */
-    PIO_flush(interp, PIO_STDERR(interp));
+    Parrot_io_flush(interp, Parrot_io_STDERR(interp));
 
     name = const_string(interp, "_sub2");
     sub  = Parrot_find_global_cur(interp, name);

Modified: trunk/t/src/warnings.t
==============================================================================
--- trunk/t/src/warnings.t	(original)
+++ trunk/t/src/warnings.t	Mon Dec  8 21:16:33 2008
@@ -71,26 +71,26 @@
     PARROT_WARNINGS_on(interp, PARROT_WARNINGS_ALL_FLAG);
 
     error_val = Parrot_warn(interp, PARROT_WARNINGS_ALL_FLAG, "all");
-    PIO_eprintf(interp, "%d\n", error_val);
+    Parrot_io_eprintf(interp, "%d\n", error_val);
 
     /* warnings are on, this should return an error */
     error_val = Parrot_warn(interp, PARROT_WARNINGS_NONE_FLAG, "none");
-    PIO_eprintf(interp, "%d\n", error_val);
+    Parrot_io_eprintf(interp, "%d\n", error_val);
 
     error_val = Parrot_warn(interp, PARROT_WARNINGS_UNDEF_FLAG, "undef");
-    PIO_eprintf(interp, "%d\n", error_val);
+    Parrot_io_eprintf(interp, "%d\n", error_val);
 
     error_val = Parrot_warn(interp, PARROT_WARNINGS_IO_FLAG, "io");
-    PIO_eprintf(interp, "%d\n", error_val);
+    Parrot_io_eprintf(interp, "%d\n", error_val);
 
     error_val = Parrot_warn(interp, PARROT_WARNINGS_PLATFORM_FLAG, "platform");
-    PIO_eprintf(interp, "%d\n", error_val);
+    Parrot_io_eprintf(interp, "%d\n", error_val);
 
     error_val = Parrot_warn(interp, PARROT_WARNINGS_DYNEXT_FLAG, "dynext");
-    PIO_eprintf(interp, "%d\n", error_val);
+    Parrot_io_eprintf(interp, "%d\n", error_val);
 
     error_val = Parrot_warn(interp, 0, "eek"); /* should return error */
-    PIO_eprintf(interp, "%d\n", error_val);
+    Parrot_io_eprintf(interp, "%d\n", error_val);
 
     Parrot_exit(interp, 0);
     return 0;

Modified: trunk/t/steps/auto_pmc-01.t
==============================================================================
--- trunk/t/steps/auto_pmc-01.t	(original)
+++ trunk/t/steps/auto_pmc-01.t	Mon Dec  8 21:16:33 2008
@@ -146,7 +146,7 @@
 ########## --pmc ##########
 
 my @dummy_options = qw(
-default.pmc null.pmc env.pmc key.pmc random.pmc unmanagedstruct.pmc managedstruct.pmc delegate.pmc exception.pmc vtablecache.pmc parrotio.pmc parrotlibrary.pmc parrotinterpreter.pmc parrotthread.pmc lexpad.pmc timer.pmc pointer.pmc sub.pmc continuation.pmc retcontinuation.pmc exceptionhandler.pmc coroutine.pmc eval.pmc nci.pmc float.pmc integer.pmc bigint.pmc complex.pmc string.pmc boolean.pmc ref.pmc sharedref.pmc array.pmc fixedintegerarray.pmc intlist.pmc iterator.pmc sarray.pmc fixedstringarray.pmc multiarray.pmc hash.pmc orderedhash.pmc tqueue.pmc os.pmc file.pmc addrregistry.pmc bound_nci.pmc capture.pmc class.pmc codestring.pmc deleg_pmc.pmc enumerate.pmc exporter.pmc fixedbooleanarray.pmc fixedfloatarray.pmc fixedpmcarray.pmc lexinfo.pmc multisub.pmc namespace.pmc object.pmc pair.pmc parrotrunningthread.pmc pccmethod_test.pmc pmcproxy.pmc resizablebooleanarray.pmc resizablefloatarray.pmc resizableintegerarray.pmc resizablepmcarray.pmc resizablestringarray.pmc role.pm
 c scalar.pmc scheduler.pmc slice.pmc stmlog.pmc stmref.pmc stmvar.pmc task.pmc undef.pmc
+default.pmc null.pmc env.pmc key.pmc random.pmc unmanagedstruct.pmc managedstruct.pmc delegate.pmc exception.pmc vtablecache.pmc parrotlibrary.pmc parrotinterpreter.pmc parrotthread.pmc lexpad.pmc timer.pmc pointer.pmc sub.pmc continuation.pmc retcontinuation.pmc exceptionhandler.pmc coroutine.pmc eval.pmc nci.pmc float.pmc integer.pmc bigint.pmc complex.pmc string.pmc boolean.pmc ref.pmc sharedref.pmc array.pmc fixedintegerarray.pmc intlist.pmc iterator.pmc sarray.pmc fixedstringarray.pmc multiarray.pmc hash.pmc orderedhash.pmc tqueue.pmc os.pmc file.pmc addrregistry.pmc bound_nci.pmc capture.pmc class.pmc codestring.pmc deleg_pmc.pmc enumerate.pmc exporter.pmc fixedbooleanarray.pmc fixedfloatarray.pmc fixedpmcarray.pmc lexinfo.pmc multisub.pmc namespace.pmc object.pmc pair.pmc parrotrunningthread.pmc pccmethod_test.pmc pmcproxy.pmc resizablebooleanarray.pmc resizablefloatarray.pmc resizableintegerarray.pmc resizablepmcarray.pmc resizablestringarray.pmc role.pmc scalar.pmc 
 scheduler.pmc slice.pmc stmlog.pmc stmref.pmc stmvar.pmc task.pmc undef.pmc
 );
 my $dummy_options = join q{ } => @dummy_options;
 
@@ -168,7 +168,7 @@
 
 @dummy_options = qw(
 default.pmc null.pmc env.pmc key.pmc random.pmc unmanagedstruct.pmc
-managedstruct.pmc delegate.pmc constexception.pmc vtablecache.pmc parrotio.pmc parrotlibrary.pmc parrotinterpreter.pmc parrotthread.pmc lexpad.pmc timer.pmc pointer.pmc sub.pmc continuation.pmc retcontinuation.pmc exceptionhandler.pmc coroutine.pmc eval.pmc nci.pmc float.pmc integer.pmc bigint.pmc complex.pmc string.pmc boolean.pmc ref.pmc sharedref.pmc array.pmc fixedintegerarray.pmc intlist.pmc iterator.pmc sarray.pmc fixedstringarray.pmc multiarray.pmc hash.pmc orderedhash.pmc tqueue.pmc os.pmc file.pmc addrregistry.pmc bound_nci.pmc capture.pmc class.pmc codestring.pmc deleg_pmc.pmc enumerate.pmc exporter.pmc fixedbooleanarray.pmc fixedfloatarray.pmc fixedpmcarray.pmc lexinfo.pmc multisub.pmc namespace.pmc object.pmc pair.pmc parrotrunningthread.pmc pccmethod_test.pmc pmcproxy.pmc resizablebooleanarray.pmc resizablefloatarray.pmc resizableintegerarray.pmc resizablepmcarray.pmc resizablestringarray.pmc role.pmc scalar.pmc scheduler.pmc slice.pmc stmlog.pmc stmref.pmc stmv
 ar.pmc task.pmc undef.pmc
+managedstruct.pmc delegate.pmc constexception.pmc vtablecache.pmc parrotlibrary.pmc parrotinterpreter.pmc parrotthread.pmc lexpad.pmc timer.pmc pointer.pmc sub.pmc continuation.pmc retcontinuation.pmc exceptionhandler.pmc coroutine.pmc eval.pmc nci.pmc float.pmc integer.pmc bigint.pmc complex.pmc string.pmc boolean.pmc ref.pmc sharedref.pmc array.pmc fixedintegerarray.pmc intlist.pmc iterator.pmc sarray.pmc fixedstringarray.pmc multiarray.pmc hash.pmc orderedhash.pmc tqueue.pmc os.pmc file.pmc addrregistry.pmc bound_nci.pmc capture.pmc class.pmc codestring.pmc deleg_pmc.pmc enumerate.pmc exporter.pmc fixedbooleanarray.pmc fixedfloatarray.pmc fixedpmcarray.pmc lexinfo.pmc multisub.pmc namespace.pmc object.pmc pair.pmc parrotrunningthread.pmc pccmethod_test.pmc pmcproxy.pmc resizablebooleanarray.pmc resizablefloatarray.pmc resizableintegerarray.pmc resizablepmcarray.pmc resizablestringarray.pmc role.pmc scalar.pmc scheduler.pmc slice.pmc stmlog.pmc stmref.pmc stmvar.pmc task.p
 mc undef.pmc
 );
 $dummy_options = join q{ } => @dummy_options;
 



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About