Author: petdance
Date: Thu Jun 14 14:53:44 2007
New Revision: 19010
Modified:
trunk/config/gen/makefiles/root.in
trunk/include/parrot/io.h
trunk/src/io/io_layers.c
trunk/src/io/io_mmap.c
trunk/src/io/io_passdown.c
trunk/src/io/io_private.h
trunk/src/io/io_stdio.c
trunk/src/io/io_string.c
trunk/src/io/io_unix.c
trunk/src/io/io_utf8.c
trunk/src/io/io_win32.c
Log:
Finished headerizing the src/io/io.* files
Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in (original)
+++ trunk/config/gen/makefiles/root.in Thu Jun 14 14:53:44 2007
@@ -1822,13 +1822,13 @@
HEADERIZER_O_FILES = \
$(INTERP_O_FILES) \
- $(IO_O_FILES) \
$(CLASS_O_FILES) \
# Slowing working my way up to having everything headerized in
$(HEADERIZER_O_FILES)
HEADERIZER_O_FILES = \
$(CHARSET_O_FILES) \
$(ENCODING_O_FILES) \
+ $(IO_O_FILES) \
src/byteorder.o \
src/charset.o \
src/datatypes.o \
@@ -1845,7 +1845,6 @@
src/hash.o \
src/headers.o \
src/intlist.o \
- src/io/io.c \
src/key.o \
src/list.o \
src/mmd.o \
Modified: trunk/include/parrot/io.h
==============================================================================
--- trunk/include/parrot/io.h (original)
+++ trunk/include/parrot/io.h Thu Jun 14 14:53:44 2007
@@ -349,12 +349,26 @@
/* HEADERIZER END: src/io/io.c */
/* io_layers.c - If you add new layers, register them in init_layers() */
-PARROT_API extern INTVAL PIO_push_layer(Interp *, PMC *, ParrotIOLayer *);
-PARROT_API extern ParrotIOLayer *PIO_pop_layer(Interp *, PMC *);
-PARROT_API extern ParrotIOLayer *PIO_copy_stack(ParrotIOLayer *);
-PARROT_API ParrotIOLayer *PIO_get_layer(Interp *, const char *name);
-PARROT_API extern ParrotIOLayer *PIO_base_new_layer(ParrotIOLayer *proto);
-PARROT_API extern void PIO_base_delete_layer(ParrotIOLayer *proto);
+/* HEADERIZER BEGIN: src/io/io_layers.c */
+
+PARROT_API void PIO_base_delete_layer( ParrotIOLayer *layer /*NULLOK*/ );
+PARROT_API ParrotIOLayer * PIO_base_new_layer( ParrotIOLayer *proto );
+PARROT_API ParrotIOLayer * PIO_copy_stack( ParrotIOLayer *stack /*NULLOK*/ );
+PARROT_API ParrotIOLayer * PIO_get_layer( Interp *interp,
+ const char *name /*NN*/ )
+ __attribute__nonnull__(2)
+ __attribute__warn_unused_result__;
+
+PARROT_API ParrotIOLayer * PIO_pop_layer( Interp *interp,
+ PMC *pmc /*NULLOK*/ );
+
+PARROT_API INTVAL PIO_push_layer( Interp *interp,
+ PMC *pmc /*NULLOK*/,
+ ParrotIOLayer *layer /*NULLOK*/ );
+
+STRING * PIO_pop_layer_str( Interp *interp, PMC *pmc );
+void PIO_push_layer_str( Interp *interp, PMC *pmc, STRING *ls );
+/* HEADERIZER END: src/io/io_layers.c */
/* Put platform specific macros here if you must */
#ifdef PIO_OS_WIN32
Modified: trunk/src/io/io_layers.c
==============================================================================
--- trunk/src/io/io_layers.c (original)
+++ trunk/src/io/io_layers.c Thu Jun 14 14:53:44 2007
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2001-2006, The Perl Foundation.
+Copyright (C) 2001-2007, The Perl Foundation.
$Id$
=head1 NAME
@@ -14,28 +14,23 @@
stack is searched downwards until a non-C<NULL> function pointer
is found for that particular slot.
-*/
-
-/*
-
=head2 Layer and Stack Functions
-=over 4
-
-=item C<ParrotIOLayer *
-PIO_base_new_layer(ParrotIOLayer *proto)>
+FUNCDOC: PIO_base_new_layer
The default IO layer constructor. Creates and returns a new
C<ParrotIOLayer>. If a prototype C<*proto> is supplied then its values
will be copied to the new instance.
-=cut
-
*/
#include "parrot/parrot.h"
+#include "parrot/io.h"
#include "io_private.h"
+/* HEADER: include/parrot/io.h */
+
+PARROT_API
ParrotIOLayer *
PIO_base_new_layer(ParrotIOLayer *proto)
{
@@ -63,18 +58,16 @@
/*
-=item C<void
-PIO_base_delete_layer(ParrotIOLayer *layer)>
+PIO_base_delete_layer
The default IO layer destructor. Frees the memory associated with
C<*layer>.
-=cut
-
*/
+PARROT_API
void
-PIO_base_delete_layer(ParrotIOLayer *layer)
+PIO_base_delete_layer(ParrotIOLayer *layer /*NULLOK*/)
{
if (layer != NULL)
mem_sys_free(layer);
@@ -191,24 +184,20 @@
/*
-=item C<ParrotIOLayer *
-PIO_pop_layer(Interp *interp, PMC *pmc)>
+FUNCDOC: PIO_pop_layer
Pop a layer from an IO object (C<*pmc>) or the default stack.
-=item C<STRING *
-PIO_pop_layer_str(Interp *interp, PMC *pmc)>
+FUNCDOC: PIO_pop_layer_str
Pop a layer from an IO object (C<*pmc>) and return the name of the
popped layer. The layer gets freed.
-=cut
-
*/
PARROT_API
ParrotIOLayer *
-PIO_pop_layer(Interp *interp, PMC *pmc)
+PIO_pop_layer(Interp *interp, PMC *pmc /*NULLOK*/)
{
ParrotIO * const io = PMC_data_typed(pmc, ParrotIO *);
@@ -269,24 +258,21 @@
/*
-=item C<ParrotIOLayer *
-PIO_copy_stack(ParrotIOLayer *stack)>
+FUNCDOC: PIO_copy_stack
Primarily used to copy the default IO stack for a new IO object. Later
we will do some funky copy-on-write stuff.
-=cut
-
*/
PARROT_API
ParrotIOLayer *
-PIO_copy_stack(ParrotIOLayer *stack)
+PIO_copy_stack(ParrotIOLayer *stack /*NULLOK*/)
{
ParrotIOLayer *ptr_new = NULL;
- ParrotIOLayer **ptr_ptr_new;
ParrotIOLayer *ptr_last = NULL;
- ptr_ptr_new = &ptr_new;
+ ParrotIOLayer **ptr_ptr_new = &ptr_new;
+
while (stack) {
*ptr_ptr_new = PIO_base_new_layer(stack);
(*ptr_ptr_new)->flags |= PIO_L_LAYER_COPIED;
@@ -299,15 +285,6 @@
return ptr_new;
}
-/*
-
-=back
-
-=cut
-
-*/
-
-
/*
* Local variables:
Modified: trunk/src/io/io_mmap.c
==============================================================================
--- trunk/src/io/io_mmap.c (original)
+++ trunk/src/io/io_mmap.c Thu Jun 14 14:53:44 2007
@@ -10,10 +10,6 @@
Open mmaps the file.
-*/
-
-/*
-
=head2 mmap layer functions
=over 4
@@ -25,6 +21,8 @@
#include "parrot/parrot.h"
#include "io_private.h"
+/* HEADER: none */
+
static ParrotIO *
PIO_mmap_open(Interp *interp, ParrotIOLayer *layer,
const char *path, INTVAL flags);
Modified: trunk/src/io/io_passdown.c
==============================================================================
--- trunk/src/io/io_passdown.c (original)
+++ trunk/src/io/io_passdown.c Thu Jun 14 14:53:44 2007
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2001-2003, The Perl Foundation.
+Copyright (C) 2001-2007, The Perl Foundation.
$Id$
=head1 NAME
@@ -14,33 +14,28 @@
=head2 Functions
-=over 4
-
-=cut
-
*/
#include <parrot/parrot.h>
#include "io_private.h"
+/* HEADER: src/io/io_private.h */
+
/*
-=item C<ParrotIO *
-PIO_open_down(Interp *interp, ParrotIOLayer * layer, const char * name,
- INTVAL flags)>
+FUNCDOC: PIO_open_down
Looks for the implementation of C<Open> and calls it if found, returning
its return value.
Returns C<NULL> if no implementation is found.
-=cut
-
*/
ParrotIO *
-PIO_open_down(Interp *interp, ParrotIOLayer * layer, const char * name,
+PIO_open_down(Interp *interp, ParrotIOLayer *layer /*NULLOK*/, const char
*name /*NN*/,
INTVAL flags)
+ /* WARN_UNUSED */
{
while (layer) {
if (layer->api->Open) {
@@ -54,22 +49,19 @@
/*
-=item C<ParrotIO *
-PIO_open_async_down(Interp *interp, ParrotIOLayer * layer, const char * name,
- const char * mode, DummyCodeRef * dummy)>
+FUNCDOC: PIO_open_async_down
Looks for the implementation of C<Open_ASync> and calls it if found,
returning its return value.
Returns C<NULL> if no implementation is found.
-=cut
-
*/
ParrotIO *
-PIO_open_async_down(Interp *interp, ParrotIOLayer * layer, const char * name,
- const char * mode, DummyCodeRef * dummy)
+PIO_open_async_down(Interp *interp, ParrotIOLayer *layer /*NULLOK*/, const
char *name /*NN*/,
+ const char *mode /*NN*/, DummyCodeRef * dummy)
+ /* WARN_UNUSED */
{
while (layer) {
if (layer->api->Open_ASync) {
@@ -84,20 +76,18 @@
/*
-=item C<ParrotIO *
-PIO_fdopen_down(Interp *interp, ParrotIOLayer * layer, PIOHANDLE fd, INTVAL
flags)>
+PIO_fdopen_down
Looks for the implementation of C<FDOpen> and calls it if found,
returning its return value.
Returns C<NULL> if no implementation is found.
-=cut
-
*/
ParrotIO *
-PIO_fdopen_down(Interp *interp, ParrotIOLayer * layer, PIOHANDLE fd, INTVAL
flags)
+PIO_fdopen_down(Interp *interp, ParrotIOLayer *layer /*NULLOK*/, PIOHANDLE fd,
INTVAL flags)
+ /* WARN_UNUSED */
{
while (layer) {
if (layer->api->FDOpen) {
@@ -109,22 +99,9 @@
return NULL;
}
-/*
-
-=item C<INTVAL
-PIO_close_down(Interp *interp, ParrotIOLayer * layer, ParrotIO * io)>
-
-Looks for the implementation of C<Close> and calls it if found,
-returning its return value.
-
-Returns C<-1> if no implementation is found.
-
-=cut
-
-*/
-
size_t
-PIO_peek_down(Interp *interp, ParrotIOLayer * layer, ParrotIO * io, STRING **
buf)
+PIO_peek_down(Interp *interp, ParrotIOLayer *layer /*NULLOK*/, ParrotIO * io,
STRING ** buf)
+ /* WARN_UNUSED */
{
while (layer) {
if (layer->api->Peek) {
@@ -138,8 +115,20 @@
}
+/*
+
+FUNCDOC: PIO_close_down
+
+Looks for the implementation of C<Close> and calls it if found,
+returning its return value.
+
+Returns C<-1> if no implementation is found.
+
+*/
+
INTVAL
-PIO_close_down(Interp *interp, ParrotIOLayer * layer, ParrotIO * io)
+PIO_close_down(Interp *interp, ParrotIOLayer *layer /*NULLOK*/, ParrotIO * io)
+ /* WARN_UNUSED */
{
while (layer) {
if (layer->api->Close) {
@@ -153,20 +142,18 @@
/*
-=item C<size_t
-PIO_write_down(Interp *interp, ParrotIOLayer * layer, ParrotIO * io, STRING *)>
+PIO_write_down
Looks for the implementation of C<Write> and calls it if found,
returning its return value.
Returns C<0> if no implementation is found.
-=cut
-
*/
size_t
-PIO_write_down(Interp *interp, ParrotIOLayer * layer, ParrotIO * io, STRING *s)
+PIO_write_down(Interp *interp, ParrotIOLayer *layer /*NULLOK*/, ParrotIO * io,
STRING *s)
+ /* WARN_UNUSED */
{
while (layer) {
if (layer->api->Write) {
@@ -180,22 +167,19 @@
/*
-=item C<size_t
-PIO_write_async_down(Interp *interp, ParrotIOLayer * layer, ParrotIO * io,
- STRING *s, DummyCodeRef *dummy)>
+FUNCDOC: PIO_write_async_down
Looks for the implementation of C<WriteASync> and calls it if found,
returning its return value.
Returns C<0> if no implementation is found.
-=cut
-
*/
size_t
-PIO_write_async_down(Interp *interp, ParrotIOLayer * layer, ParrotIO * io,
+PIO_write_async_down(Interp *interp, ParrotIOLayer *layer /*NULLOK*/, ParrotIO
* io,
STRING *s, DummyCodeRef *dummy)
+ /* WARN_UNUSED */
{
while (layer) {
if (layer->api->Write_ASync) {
@@ -209,21 +193,18 @@
/*
-=item C<size_t
-PIO_read_down(Interp *interp, ParrotIOLayer * layer, ParrotIO * io, void * buf,
- size_t len)>
+FUNCDOC: PIO_read_down
Looks for the implementation of C<Read> and calls it if found, returning
its return value.
Returns C<0> if no implementation is found.
-=cut
-
*/
size_t
-PIO_read_down(Interp *interp, ParrotIOLayer * layer, ParrotIO * io, STRING **
buf)
+PIO_read_down(Interp *interp, ParrotIOLayer *layer /*NULLOK*/, ParrotIO * io,
STRING ** buf)
+ /* WARN_UNUSED */
{
while (layer) {
if (layer->api->Read) {
@@ -237,22 +218,19 @@
/*
-=item C<size_t
-PIO_read_async_down(Interp *interp, ParrotIOLayer * layer, ParrotIO * io,
- STRING ** buf, DummyCodeRef *dummy)>
+FUNCDOC: PIO_read_async_down
Looks for the implementation of C<Read_ASync> and calls it if found,
returning its return value.
Returns C<0> if no implementation is found.
-=cut
-
*/
size_t
-PIO_read_async_down(Interp *interp, ParrotIOLayer * layer, ParrotIO * io,
+PIO_read_async_down(Interp *interp, ParrotIOLayer *layer /*NULLOK*/, ParrotIO
* io,
STRING ** buf, DummyCodeRef *dummy)
+ /* WARN_UNUSED */
{
while (layer) {
if (layer->api->Read_ASync) {
@@ -266,20 +244,18 @@
/*
-=item C<INTVAL
-PIO_flush_down(Interp *interp, ParrotIOLayer * layer, ParrotIO * io)>
+FUNCDOC: PIO_flush_down
Looks for the implementation of C<Flush> and calls it if found,
returning its return value.
Returns C<0> if no implementation is found.
-=cut
-
*/
INTVAL
-PIO_flush_down(Interp *interp, ParrotIOLayer * layer, ParrotIO * io)
+PIO_flush_down(Interp *interp, ParrotIOLayer *layer /*NULLOK*/, ParrotIO * io)
+ /* WARN_UNUSED */
{
while (layer) {
if (layer->api->Flush) {
@@ -293,22 +269,19 @@
/*
-=item C<PIOOFF_T
-PIO_seek_down(Interp *interp, ParrotIOLayer * layer, ParrotIO * io, PIOOFF_T
offset,
- INTVAL whence)>
+FUNCDOC: PIO_seek_down
Looks for the implementation of C<Seek> and calls it if found, returning
its return value.
Returns C<-1> if no implementation is found.
-=cut
-
*/
PIOOFF_T
-PIO_seek_down(Interp *interp, ParrotIOLayer * layer, ParrotIO * io, PIOOFF_T
offset,
+PIO_seek_down(Interp *interp, ParrotIOLayer *layer /*NULLOK*/, ParrotIO * io,
PIOOFF_T offset,
INTVAL whence)
+ /* WARN_UNUSED */
{
while (layer) {
if (layer->api->Seek) {
@@ -322,20 +295,18 @@
/*
-=item C<PIOOFF_T
-PIO_tell_down(Interp *interp, ParrotIOLayer * layer, ParrotIO * io)>
+FUNCDOC: PIO_tell_down
Looks for the implementation of C<Tell> and calls it if found, returning
its return value.
Returns C<0> if no implementation is found.
-=cut
-
*/
PIOOFF_T
-PIO_tell_down(Interp *interp, ParrotIOLayer * layer, ParrotIO * io)
+PIO_tell_down(Interp *interp, ParrotIOLayer *layer /*NULLOK*/, ParrotIO * io)
+ /* WARN_UNUSED */
{
while (layer) {
if (layer->api->Tell) {
@@ -349,22 +320,19 @@
/*
-=item C<INTVAL
-PIO_setbuf_down(Interp *interp, ParrotIOLayer * layer, ParrotIO * io,
- size_t bufsize)>
+FUNCDOC: PIO_setbuf_down
Looks for the implementation of C<SetBuf> and calls it if found,
returning its return value.
Returns C<-1> if no implementation is found.
-=cut
-
*/
INTVAL
-PIO_setbuf_down(Interp *interp, ParrotIOLayer * layer, ParrotIO * io,
+PIO_setbuf_down(Interp *interp, ParrotIOLayer *layer /*NULLOK*/, ParrotIO * io,
size_t bufsize)
+ /* WARN_UNUSED */
{
while (layer) {
if (layer->api->SetBuf) {
@@ -378,20 +346,18 @@
/*
-=item C<INTVAL
-PIO_setlinebuf_down(Interp *interp, ParrotIOLayer * layer, ParrotIO * io)>
+FUNCDOC: PIO_setlinebuf_down
Looks for the implementation of C<SetLineBuf> and calls it if found,
returning its return value.
Returns C<-1> if no implementation is found.
-=cut
-
*/
INTVAL
-PIO_setlinebuf_down(Interp *interp, ParrotIOLayer * layer, ParrotIO * io)
+PIO_setlinebuf_down(Interp *interp, ParrotIOLayer *layer /*NULLOK*/, ParrotIO
* io)
+ /* WARN_UNUSED */
{
while (layer) {
if (layer->api->SetLineBuf) {
@@ -405,20 +371,18 @@
/*
-=item C<INTVAL
-PIO_eof_down(Interp *interp, ParrotIOLayer * layer, ParrotIO * io)>
+FUNCDOC: PIO_eof_down
Looks for the implementation of C<Eof> and calls it if found, returning
its return value.
Returns C<-1> if no implementation is found.
-=cut
-
*/
INTVAL
-PIO_eof_down(Interp *interp, ParrotIOLayer * layer, ParrotIO * io)
+PIO_eof_down(Interp *interp, ParrotIOLayer *layer /*NULLOK*/, ParrotIO * io)
+ /* WARN_UNUSED */
{
while (layer) {
if (layer->api->Eof) {
@@ -432,22 +396,19 @@
/*
-=item C<INTVAL
-PIO_poll_down(Interp *interp, ParrotIOLayer *layer, ParrotIO *io,
- INTVAL which, INTVAL sec, INTVAL usec)>
+FUNCDOC: PIO_poll_down
Looks for the implementation of C<Poll> and calls it if found, returning
its return value.
Returns C<-1> if no implementation is found.
-=cut
-
*/
INTVAL
PIO_poll_down(Interp *interp, ParrotIOLayer *layer, ParrotIO *io,
- INTVAL which, INTVAL sec, INTVAL usec)
+ INTVAL which, INTVAL sec, INTVAL usec)
+ /* WARN_UNUSED */
{
while (layer) {
if (layer->api->Poll) {
@@ -460,22 +421,19 @@
/*
-=item C<ParrotIO *
-PIO_socket_down(Interp *interp, ParrotIOLayer *layer, INTVAL fam, INTVAL type,
- INTVAL proto)>
+FUNCDOC: PIO_socket_down
Looks for the implementation of C<Socket> and calls it if found,
returning its return value.
Returns C<NULL> if no implementation is found.
-=cut
-
*/
ParrotIO *
PIO_socket_down(Interp *interp, ParrotIOLayer *layer, INTVAL fam, INTVAL type,
INTVAL proto)
+ /* WARN_UNUSED */
{
while (layer) {
if (layer->api->Socket) {
@@ -488,20 +446,18 @@
/*
-=item C<INTVAL
-PIO_recv_down(Interp *interp, ParrotIOLayer *layer, ParrotIO *io, STRING
**buf)>
+FUNCDOC: PIO_recv_down
Looks for the implementation of C<Recv> and calls it if found, returning
its return value.
Returns C<-1> if no implementation is found.
-=cut
-
*/
INTVAL
PIO_recv_down(Interp *interp, ParrotIOLayer *layer, ParrotIO *io, STRING **buf)
+ /* WARN_UNUSED */
{
while (layer) {
if (layer->api->Recv) {
@@ -514,21 +470,18 @@
/*
-=item C<INTVAL
-PIO_send_down(Interp *interp, ParrotIOLayer *layer, ParrotIO *io, STRING *buf)>
+FUNCDOC: PIO_send_down
Looks for the implementation of C<Send> and calls it if found, returning
its return value.
Returns C<-1> if no implementation is found.
-
-=cut
-
*/
INTVAL
PIO_send_down(Interp *interp, ParrotIOLayer *layer, ParrotIO *io, STRING *buf)
+ /* WARN_UNUSED */
{
while (layer) {
if (layer->api->Send) {
@@ -541,22 +494,18 @@
/*
-=item C<INTVAL
-PIO_connect_down(Interp *interp, ParrotIOLayer *layer,
- ParrotIO *io, STRING *address)>
+FUNCDOC: PIO_connect_down
Looks for the implementation of C<Connect> and calls it if found,
returning its return value.
Returns C<-1> if no implementation is found.
-
-=cut
-
*/
INTVAL
PIO_connect_down(Interp *interp, ParrotIOLayer *layer, ParrotIO *io, STRING
*address)
+ /* WARN_UNUSED */
{
while (layer) {
if (layer->api->Connect) {
@@ -569,21 +518,18 @@
/*
-=item C<INTVAL
-PIO_bind_down(Interp *interp, ParrotIOLayer *layer, ParrotIO *io, STRING
*address)>
+FUNCDOC: PIO_bind_down
Looks for the implementation of C<Bind> and calls it if found,
returning its return value.
Returns C<-1> if no implementation is found.
-
-=cut
-
*/
INTVAL
PIO_bind_down(Interp *interp, ParrotIOLayer *layer, ParrotIO *io, STRING
*address)
+ /* WARN_UNUSED */
{
while (layer) {
if (layer->api->Bind) {
@@ -596,21 +542,18 @@
/*
-=item C<INTVAL
-PIO_listen_down(Interp *interp, ParrotIOLayer *layer, ParrotIO *io, INTVAL
backlog)>
+FUNCDOC: PIO_listen_down
Looks for the implementation of C<listen> and calls it if found,
returning its return value.
Returns C<-1> if no implementation is found.
-
-=cut
-
*/
INTVAL
PIO_listen_down(Interp *interp, ParrotIOLayer *layer, ParrotIO *io, INTVAL
backlog)
+ /* WARN_UNUSED */
{
while (layer) {
if (layer->api->Listen) {
@@ -623,22 +566,18 @@
/*
-=item C<ParrotIO *
-PIO_accept_down(Interp *interp, ParrotIOLayer *layer, ParrotIO *io, STRING
*address)>
-
+FUNCDOC: PIO_accept_down
Looks for the implementation of C<Accept> and calls it if found,
returning its return value.
Returns C<-1> if no implementation is found.
-
-=cut
-
*/
ParrotIO *
PIO_accept_down(Interp *interp, ParrotIOLayer *layer, ParrotIO *io)
+ /* WARN_UNUSED */
{
while (layer) {
if (layer->api->Accept) {
@@ -651,8 +590,6 @@
/*
-=back
-
=head1 SEE ALSO
F<src/io/io_buf.c>,
@@ -669,8 +606,6 @@
Some ideas and goals from Perl5.7 and Nick Ing-Simmons' work.
-=cut
-
*/
Modified: trunk/src/io/io_private.h
==============================================================================
--- trunk/src/io/io_private.h (original)
+++ trunk/src/io/io_private.h Thu Jun 14 14:53:44 2007
@@ -136,42 +136,155 @@
* These function walk down the layerstack starting at l
* and calling the first non-null function it finds.
*/
-ParrotIO *PIO_open_down(Interp *, ParrotIOLayer * layer, const char * name,
- INTVAL flags);
-ParrotIO *PIO_open_async_down(Interp *, ParrotIOLayer * layer,
- const char * name, const char * mode,
- DummyCodeRef *);
-ParrotIO *PIO_fdopen_down(Interp *, ParrotIOLayer * layer, PIOHANDLE fd,
- INTVAL flags);
-INTVAL PIO_close_down(Interp *, ParrotIOLayer * layer, ParrotIO * io);
-size_t PIO_write_down(Interp *, ParrotIOLayer * layer, ParrotIO * io,
- STRING *);
-size_t PIO_write_async_down(Interp *, ParrotIOLayer * layer, ParrotIO * io,
- STRING *, DummyCodeRef *);
-size_t PIO_read_down(Interp *, ParrotIOLayer * layer, ParrotIO * io,
- STRING **);
-size_t PIO_read_async_down(Interp *, ParrotIOLayer * layer, ParrotIO * io,
- STRING **, DummyCodeRef *);
-size_t PIO_peek_down(Interp *, ParrotIOLayer * layer, ParrotIO * io,
- STRING **);
-INTVAL PIO_flush_down(Interp *, ParrotIOLayer * layer, ParrotIO * io);
-PIOOFF_T PIO_seek_down(Interp *, ParrotIOLayer * layer, ParrotIO * io,
- PIOOFF_T offset, INTVAL whence);
-PIOOFF_T PIO_tell_down(Interp *, ParrotIOLayer * layer, ParrotIO * io);
-INTVAL PIO_setbuf_down(Interp *, ParrotIOLayer * layer, ParrotIO * io,
- size_t bufsize);
-INTVAL PIO_setlinebuf_down(Interp *, ParrotIOLayer * layer, ParrotIO * io);
-INTVAL PIO_eof_down(Interp *, ParrotIOLayer * layer, ParrotIO * io);
-INTVAL PIO_poll_down(Interp *, ParrotIOLayer * layer, ParrotIO *io,
- INTVAL which, INTVAL sec, INTVAL usec);
-ParrotIO *PIO_socket_down(Interp *, ParrotIOLayer *layer, INTVAL fam,
- INTVAL type, INTVAL proto);
-INTVAL PIO_recv_down(Interp *, ParrotIOLayer *layer, ParrotIO *io, STRING
**buf);
-INTVAL PIO_send_down(Interp *, ParrotIOLayer *layer, ParrotIO *io, STRING
*buf);
-INTVAL PIO_connect_down(Interp *, ParrotIOLayer *layer, ParrotIO *io,
STRING *address);
-INTVAL PIO_bind_down(Interp *, ParrotIOLayer *layer, ParrotIO *io, STRING
*address);
-INTVAL PIO_listen_down(Interp *, ParrotIOLayer *layer, ParrotIO *io, INTVAL
backlog);
-ParrotIO *PIO_accept_down(Interp *, ParrotIOLayer *layer, ParrotIO *io);
+
+/* HEADERIZER BEGIN: src/io/io_layers.c */
+/* HEADERIZER END: src/io/io_layers.c */
+
+/* HEADERIZER BEGIN: src/io/io_passdown.c */
+
+ParrotIO * PIO_accept_down( Interp *interp,
+ ParrotIOLayer *layer,
+ ParrotIO *io )
+ __attribute__warn_unused_result__;
+
+INTVAL PIO_bind_down( Interp *interp,
+ ParrotIOLayer *layer,
+ ParrotIO *io,
+ STRING *address )
+ __attribute__warn_unused_result__;
+
+INTVAL PIO_close_down( Interp *interp,
+ ParrotIOLayer *layer /*NULLOK*/,
+ ParrotIO * io )
+ __attribute__warn_unused_result__;
+
+INTVAL PIO_connect_down( Interp *interp,
+ ParrotIOLayer *layer,
+ ParrotIO *io,
+ STRING *address )
+ __attribute__warn_unused_result__;
+
+INTVAL PIO_eof_down( Interp *interp,
+ ParrotIOLayer *layer /*NULLOK*/,
+ ParrotIO * io )
+ __attribute__warn_unused_result__;
+
+ParrotIO * PIO_fdopen_down( Interp *interp,
+ ParrotIOLayer *layer /*NULLOK*/,
+ PIOHANDLE fd,
+ INTVAL flags )
+ __attribute__warn_unused_result__;
+
+INTVAL PIO_flush_down( Interp *interp,
+ ParrotIOLayer *layer /*NULLOK*/,
+ ParrotIO * io )
+ __attribute__warn_unused_result__;
+
+INTVAL PIO_listen_down( Interp *interp,
+ ParrotIOLayer *layer,
+ ParrotIO *io,
+ INTVAL backlog )
+ __attribute__warn_unused_result__;
+
+ParrotIO * PIO_open_async_down( Interp *interp,
+ ParrotIOLayer *layer /*NULLOK*/,
+ const char *name /*NN*/,
+ const char *mode /*NN*/,
+ DummyCodeRef * dummy )
+ __attribute__nonnull__(3)
+ __attribute__nonnull__(4)
+ __attribute__warn_unused_result__;
+
+ParrotIO * PIO_open_down( Interp *interp,
+ ParrotIOLayer *layer /*NULLOK*/,
+ const char *name /*NN*/,
+ INTVAL flags )
+ __attribute__nonnull__(3)
+ __attribute__warn_unused_result__;
+
+size_t PIO_peek_down( Interp *interp,
+ ParrotIOLayer *layer /*NULLOK*/,
+ ParrotIO * io,
+ STRING ** buf )
+ __attribute__warn_unused_result__;
+
+INTVAL PIO_poll_down( Interp *interp,
+ ParrotIOLayer *layer,
+ ParrotIO *io,
+ INTVAL which,
+ INTVAL sec,
+ INTVAL usec )
+ __attribute__warn_unused_result__;
+
+size_t PIO_read_async_down( Interp *interp,
+ ParrotIOLayer *layer /*NULLOK*/,
+ ParrotIO * io,
+ STRING ** buf,
+ DummyCodeRef *dummy )
+ __attribute__warn_unused_result__;
+
+size_t PIO_read_down( Interp *interp,
+ ParrotIOLayer *layer /*NULLOK*/,
+ ParrotIO * io,
+ STRING ** buf )
+ __attribute__warn_unused_result__;
+
+INTVAL PIO_recv_down( Interp *interp,
+ ParrotIOLayer *layer,
+ ParrotIO *io,
+ STRING **buf )
+ __attribute__warn_unused_result__;
+
+PIOOFF_T PIO_seek_down( Interp *interp,
+ ParrotIOLayer *layer /*NULLOK*/,
+ ParrotIO * io,
+ PIOOFF_T offset,
+ INTVAL whence )
+ __attribute__warn_unused_result__;
+
+INTVAL PIO_send_down( Interp *interp,
+ ParrotIOLayer *layer,
+ ParrotIO *io,
+ STRING *buf )
+ __attribute__warn_unused_result__;
+
+INTVAL PIO_setbuf_down( Interp *interp,
+ ParrotIOLayer *layer /*NULLOK*/,
+ ParrotIO * io,
+ size_t bufsize )
+ __attribute__warn_unused_result__;
+
+INTVAL PIO_setlinebuf_down( Interp *interp,
+ ParrotIOLayer *layer /*NULLOK*/,
+ ParrotIO * io )
+ __attribute__warn_unused_result__;
+
+ParrotIO * PIO_socket_down( Interp *interp,
+ ParrotIOLayer *layer,
+ INTVAL fam,
+ INTVAL type,
+ INTVAL proto )
+ __attribute__warn_unused_result__;
+
+PIOOFF_T PIO_tell_down( Interp *interp,
+ ParrotIOLayer *layer /*NULLOK*/,
+ ParrotIO * io )
+ __attribute__warn_unused_result__;
+
+size_t PIO_write_async_down( Interp *interp,
+ ParrotIOLayer *layer /*NULLOK*/,
+ ParrotIO * io,
+ STRING *s,
+ DummyCodeRef *dummy )
+ __attribute__warn_unused_result__;
+
+size_t PIO_write_down( Interp *interp,
+ ParrotIOLayer *layer /*NULLOK*/,
+ ParrotIO * io,
+ STRING *s )
+ __attribute__warn_unused_result__;
+
+/* HEADERIZER END: src/io/io_passdown.c */
/*
* By default, any layer not implementing an interface (ie. leaving
Modified: trunk/src/io/io_stdio.c
==============================================================================
--- trunk/src/io/io_stdio.c (original)
+++ trunk/src/io/io_stdio.c Thu Jun 14 14:53:44 2007
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2001-2003, The Perl Foundation.
+Copyright (C) 2001-2007, The Perl Foundation.
$Id$
=head1 NAME
@@ -25,7 +25,9 @@
#include "parrot/parrot.h"
#include "io_private.h"
-extern INTVAL PIO_stdio_getblksize(PIOHANDLE fd);
+/* HEADER: none */
+
+extern INTVAL PIO_stdio_getblksize(PIOHANDLE fd); /* XXX Use a
declaration in a header file */
/* Defined at bottom */
extern const ParrotIOLayerAPI pio_stdio_layer_api;
Modified: trunk/src/io/io_string.c
==============================================================================
--- trunk/src/io/io_string.c (original)
+++ trunk/src/io/io_string.c Thu Jun 14 14:53:44 2007
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2006, The Perl Foundation.
+Copyright (c) 2006-2007, The Perl Foundation.
$Id$
=head1 NAME
@@ -10,10 +10,6 @@
Capture output to a string PMC.
-*/
-
-/*
-
=head2 String Layer Functions
=over 4
@@ -25,6 +21,8 @@
#include "parrot/parrot.h"
#include "io_private.h"
+/* HEADER: none */
+
static size_t
PIO_string_read(Interp *interp, ParrotIOLayer *l, ParrotIO *io, STRING **buf);
static size_t
Modified: trunk/src/io/io_unix.c
==============================================================================
--- trunk/src/io/io_unix.c (original)
+++ trunk/src/io/io_unix.c Thu Jun 14 14:53:44 2007
@@ -30,6 +30,8 @@
#include "parrot/parrot.h"
#include "io_private.h"
+/* HEADER: none */
+
#ifdef PIO_OS_UNIX
/* Defined at bottom */
Modified: trunk/src/io/io_utf8.c
==============================================================================
--- trunk/src/io/io_utf8.c (original)
+++ trunk/src/io/io_utf8.c Thu Jun 14 14:53:44 2007
@@ -27,6 +27,8 @@
#include "io_private.h"
#include "../unicode.h"
+/* HEADER: none */
+
static size_t
PIO_utf8_write(Interp *interp, ParrotIOLayer *l, ParrotIO *io, STRING *s);
Modified: trunk/src/io/io_win32.c
==============================================================================
--- trunk/src/io/io_win32.c (original)
+++ trunk/src/io/io_win32.c Thu Jun 14 14:53:44 2007
@@ -29,6 +29,8 @@
#include "parrot/parrot.h"
#include "io_private.h"
+/* HEADER: none */
+
#ifdef PIO_OS_WIN32
# include <tchar.h>