cvsuser     02/06/07 20:37:10

  Modified:    .        MANIFEST
               io       io.c io_unix.c io_win32.c
               include/parrot io.h
               config/gen/makefiles root.in
  Added:       io       io_stdio.c
  Log:
  Added a real io_stdio layer- uses STDIO only.  Should run anywhere, but may
  not be as functional as io_unix or io_win32.
  
  Revision  Changes    Path
  1.162     +1 -0      parrot/MANIFEST
  
  Index: MANIFEST
  ===================================================================
  RCS file: /cvs/public/parrot/MANIFEST,v
  retrieving revision 1.161
  retrieving revision 1.162
  diff -u -w -r1.161 -r1.162
  --- MANIFEST  8 Jun 2002 00:43:51 -0000       1.161
  +++ MANIFEST  8 Jun 2002 03:37:05 -0000       1.162
  @@ -191,6 +191,7 @@
   io/io.c
   io/io_buf.c
   io/io_unix.c
  +io/io_stdio.c
   io/io_win32.c
   jit.c
   jit/alpha/core.jit
  
  
  
  1.25      +7 -3      parrot/io/io.c
  
  Index: io.c
  ===================================================================
  RCS file: /cvs/public/parrot/io/io.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -w -r1.24 -r1.25
  --- io.c      8 Jun 2002 00:11:19 -0000       1.24
  +++ io.c      8 Jun 2002 03:37:07 -0000       1.25
  @@ -1,7 +1,7 @@
   /* io.c
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *      $Id: io.c,v 1.24 2002/06/08 00:11:19 josh Exp $
  + *      $Id: io.c,v 1.25 2002/06/08 03:37:07 josh Exp $
    *  Overview:
    *      This is the Parrot IO subsystem API.  Generic IO stuff
    *      goes here, each specific layer goes in its own file...
  @@ -160,11 +160,15 @@
       /* Optimize this to keep a default stack and just
        * call copy stack.
        */
  -#ifndef WIN32
  +#ifdef PIO_OS_UNIX
       PIO_push_layer(interpreter, PIO_base_new_layer(&pio_unix_layer), NULL);
  -#else
  +#endif
  +#ifdef PIO_OS_WIN32
       PIO_push_layer(interpreter, PIO_base_new_layer(&pio_win32_layer), NULL);
   #endif
  +#ifdef PIO_OS_STDIO
  +    PIO_push_layer(interpreter, PIO_base_new_layer(&pio_stdio_layer), NULL);
  +#endif  
   #if 0
       PIO_push_layer(interpreter, PIO_base_new_layer(&pio_buf_layer), NULL);
   #endif
  
  
  
  1.18      +3 -4      parrot/io/io_unix.c
  
  Index: io_unix.c
  ===================================================================
  RCS file: /cvs/public/parrot/io/io_unix.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -w -r1.17 -r1.18
  --- io_unix.c 30 Apr 2002 04:23:03 -0000      1.17
  +++ io_unix.c 8 Jun 2002 03:37:07 -0000       1.18
  @@ -1,7 +1,7 @@
   /* io_unix.c
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *      $Id: io_unix.c,v 1.17 2002/04/30 04:23:03 mrjoltcola Exp $
  + *      $Id: io_unix.c,v 1.18 2002/06/08 03:37:07 josh Exp $
    *  Overview:
    *      This is the Parrot IO UNIX layer. May be changed to
    *      include other platforms if that platform is similar 
  @@ -17,8 +17,7 @@
   
   #include "parrot/parrot.h"
   
  -/* Configure doesn't generate a generic UNIX define yet */
  -#ifndef WIN32
  +#ifdef PIO_OS_UNIX
   
   /* Defined at bottom */
   extern ParrotIOLayerAPI pio_unix_layer_api;
  @@ -438,7 +437,7 @@
   };
   
   
  -#endif /* WIN32 */
  +#endif /* PIO_OS_UNIX */
   
   /*
    * Local variables:
  
  
  
  1.18      +3 -3      parrot/io/io_win32.c
  
  Index: io_win32.c
  ===================================================================
  RCS file: /cvs/public/parrot/io/io_win32.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -w -r1.17 -r1.18
  --- io_win32.c        30 Apr 2002 04:23:03 -0000      1.17
  +++ io_win32.c        8 Jun 2002 03:37:07 -0000       1.18
  @@ -1,7 +1,7 @@
   /* io_win32.c
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *      $Id: io_win32.c,v 1.17 2002/04/30 04:23:03 mrjoltcola Exp $
  + *      $Id: io_win32.c,v 1.18 2002/06/08 03:37:07 josh Exp $
    *  Overview:
    *      This is the Parrot IO OS layer for Win32 platforms.
    *  Data Structure and Algorithms:
  @@ -14,7 +14,7 @@
   
   #include "parrot/parrot.h"
   
  -#ifdef WIN32
  +#ifdef PIO_OS_WIN32
   
   #  include <tchar.h>
   
  @@ -321,7 +321,7 @@
   
   
   
  -#endif /* WIN32 */
  +#endif /* PIO_OS_WIN32 */
   
   
   /*
  
  
  
  1.19      +148 -255  parrot/io/io_stdio.c
  
  
  
  
  1.21      +34 -7     parrot/include/parrot/io.h
  
  Index: io.h
  ===================================================================
  RCS file: /cvs/public/parrot/include/parrot/io.h,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -w -r1.20 -r1.21
  --- io.h      8 Jun 2002 00:11:17 -0000       1.20
  +++ io.h      8 Jun 2002 03:37:09 -0000       1.21
  @@ -1,7 +1,7 @@
   /* io.h
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *     $Id: io.h,v 1.20 2002/06/08 00:11:17 josh Exp $
  + *     $Id: io.h,v 1.21 2002/06/08 03:37:09 josh Exp $
    *  Overview:
    *      Parrot IO subsystem 
    *  Data Structure and Algorithms:
  @@ -17,6 +17,17 @@
   #if !defined(PARROT_IO_H_GUARD)
   #define PARROT_IO_H_GUARD
   
  +/* which OS are we on? (this should be moved into Configure-land) */
  +#ifdef WIN32
  +#  define PIO_OS_WIN32
  +#else
  +#  ifdef HAS_UNISTD
  +#    define PIO_OS_UNIX
  +#  else
  +#    define PIO_OS_STDIO
  +#    include <stdio.h>
  +#  endif
  +#endif
   
   #ifndef STDIN_FILENO
   # define STDIN_FILENO 0
  @@ -93,13 +104,18 @@
   };
   
   
  -#ifdef WIN32
  +#ifdef PIO_OS_WIN32
   typedef HANDLE PIOHANDLE;
   typedef LARGE_INTEGER PIOOFF_T;
  -#else
  +#endif
  +#ifdef PIO_OS_UNIX
   typedef int PIOHANDLE;
   typedef off_t PIOOFF_T;
   #endif
  +#ifdef PIO_OS_STDIO
  +typedef FILE* PIOHANDLE;
  +typedef long PIOOFF_T;
  +#endif
   
   extern PIOOFF_T piooffsetzero;
   
  @@ -159,11 +175,15 @@
   
   
   /* Others to come */
  -#ifndef WIN32
  +#ifdef PIO_OS_UNIX
   extern ParrotIOLayer pio_unix_layer;
  -#else
  +#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;
   
   /* This is list of valid layers */
  @@ -295,16 +315,23 @@
   
   
   /* Put platform specific macros here if you must */
  -#ifdef WIN32
  +#ifdef PIO_OS_WIN32
   extern INTVAL           PIO_win32_isatty(PIOHANDLE fd);
   #  define PIO_isatty(x)   PIO_win32_isatty(x)
   extern INTVAL           PIO_win32_getblksize(PIOHANDLE fd);
   #  define PIO_getblksize(x)   PIO_win32_getblksize(x)
  -#else
  +#endif
  +#ifdef PIO_OS_UNIX
   extern INTVAL           PIO_unix_isatty(PIOHANDLE fd);
   #  define PIO_isatty(x)   PIO_unix_isatty(x)
   extern INTVAL           PIO_unix_getblksize(PIOHANDLE fd);
   #  define PIO_getblksize(x)   PIO_unix_getblksize(x)
  +#endif
  +#ifdef PIO_OS_STDIO
  +extern INTVAL           PIO_stdio_isatty(PIOHANDLE fd);
  +#  define PIO_isatty(x)   PIO_stdio_isatty(x)
  +extern INTVAL           PIO_stdio_getblksize(PIOHANDLE fd);
  +#  define PIO_getblksize(x)   PIO_stdio_getblksize(x)
   #endif
   
   
  
  
  
  1.10      +4 -1      parrot/config/gen/makefiles/root.in
  
  Index: root.in
  ===================================================================
  RCS file: /cvs/public/parrot/config/gen/makefiles/root.in,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -w -r1.9 -r1.10
  --- root.in   8 Jun 2002 00:43:52 -0000       1.9
  +++ root.in   8 Jun 2002 03:37:10 -0000       1.10
  @@ -83,7 +83,8 @@
   
   CHARTYPE_O_FILES = chartypes/unicode$(O) chartypes/usascii$(O)
   
  -IO_O_FILES = io/io$(O) io/io_buf$(O) io/io_unix$(O) io/io_win32$(O)
  +IO_O_FILES = io/io$(O) io/io_buf$(O) io/io_unix$(O) io/io_win32$(O) \
  +             io/io_stdio$(O)
   
   INTERP_O_FILES = exceptions$(O) global_setup$(O) interpreter$(O) parrot$(O) \
                                 register$(O) core_ops$(O) core_ops_prederef$(O) 
memory$(O) \
  @@ -355,6 +356,8 @@
   io/io_unix$(O) : $(GENERAL_H_FILES)
   
   io/io_win32$(O) : $(GENERAL_H_FILES)
  +
  +io/io_stdio$(O) : $(GENERAL_H_FILES)
   
   memory$(O) : $(GENERAL_H_FILES)
   
  
  
  


Reply via email to