Author: allison
Date: Sun Nov 30 23:02:00 2008
New Revision: 33414

Modified:
   branches/pdd22io_part2/include/parrot/io.h
   branches/pdd22io_part2/src/io/core.c
   branches/pdd22io_part2/src/io/io_private.h

Log:
[pdd22io] Removing a number of unused struct, type, and macro definitions, and
unused function prototypes.


Modified: branches/pdd22io_part2/include/parrot/io.h
==============================================================================
--- branches/pdd22io_part2/include/parrot/io.h  (original)
+++ branches/pdd22io_part2/include/parrot/io.h  Sun Nov 30 23:02:00 2008
@@ -83,15 +83,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;
 
@@ -114,24 +105,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))
@@ -139,393 +116,8 @@
 #  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 */
-/* 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)
-        __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)
-        __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))
-        __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 */
-
 /* 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. */
@@ -1005,20 +597,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: branches/pdd22io_part2/src/io/core.c
==============================================================================
--- branches/pdd22io_part2/src/io/core.c        (original)
+++ branches/pdd22io_part2/src/io/core.c        Sun Nov 30 23:02:00 2008
@@ -67,7 +67,6 @@
     if (interp->piodata == NULL)
         Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
             "PIO alloc piodata failure.");
-    interp->piodata->default_stack = NULL;
     interp->piodata->table         =
         (PMC **)mem_sys_allocate_zeroed(PIO_NR_OPEN * sizeof (PMC *));
 

Modified: branches/pdd22io_part2/src/io/io_private.h
==============================================================================
--- branches/pdd22io_part2/src/io/io_private.h  (original)
+++ branches/pdd22io_part2/src/io/io_private.h  Sun Nov 30 23:02:00 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
 

Reply via email to