[svn:parrot] r38807 - in trunk: . include/parrot src/io
whiteknight at svn.parrot.org
whiteknight at svn.parrot.org
Fri May 15 23:38:11 UTC 2009
Author: whiteknight
Date: Fri May 15 23:38:11 2009
New Revision: 38807
URL: https://trac.parrot.org/parrot/changeset/38807
Log:
[io] remove the defunct io_string.c file which hadn't been used. Also, remove some associated references and vestiges that aren't needed anymore
Deleted:
trunk/src/io/io_string.c
Modified:
trunk/MANIFEST
trunk/include/parrot/io.h
trunk/src/io/api.c
Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST Fri May 15 23:33:01 2009 (r38806)
+++ trunk/MANIFEST Fri May 15 23:38:11 2009 (r38807)
@@ -1279,7 +1279,6 @@
src/io/core.c []
src/io/filehandle.c []
src/io/io_private.h []
-src/io/io_string.c []
src/io/portable.c []
src/io/socket_api.c []
src/io/socket_unix.c []
Modified: trunk/include/parrot/io.h
==============================================================================
--- trunk/include/parrot/io.h Fri May 15 23:33:01 2009 (r38806)
+++ trunk/include/parrot/io.h Fri May 15 23:38:11 2009 (r38807)
@@ -101,8 +101,6 @@
extern PIOOFF_T piooffsetzero;
-typedef struct _ParrotIOFilter ParrotIOFilter;
-typedef struct _ParrotIO ParrotIO;
typedef struct _ParrotIOData ParrotIOData;
#ifdef _MSC_VER
Modified: trunk/src/io/api.c
==============================================================================
--- trunk/src/io/api.c Fri May 15 23:33:01 2009 (r38806)
+++ trunk/src/io/api.c Fri May 15 23:38:11 2009 (r38807)
@@ -39,7 +39,10 @@
=item C<PMC * Parrot_io_stdhandle(PARROT_INTERP, INTVAL fileno, PMC *newhandle)>
-Get the current standard IO object and optionally set a new one.
+Get the current standard IO object with the specified filenumber. If the
+C<newhandle> parameter is non-null, set that to be the new standard IO object
+of that number. Returns the old IO object before the new one is set, so it
+can be cached for later.
=cut
@@ -172,7 +175,8 @@
=item C<INTVAL Parrot_io_close(PARROT_INTERP, PMC *pmc)>
-Closes the filehandle object.
+Closes the filehandle object. Calls the C<close> method on the filehandle
+PMC object.
=cut
@@ -197,7 +201,8 @@
=item C<INTVAL Parrot_io_is_closed(PARROT_INTERP, PMC *pmc)>
-Test whether a filehandle is closed.
+Test whether a filehandle is closed. Calls the C<is_closed> method of the
+filehandle PMC.
=cut
@@ -222,7 +227,8 @@
=item C<void Parrot_io_flush(PARROT_INTERP, PMC *pmc)>
-Flushes the C<ParrotIO> PMC C<*pmc>.
+Flushes the C<ParrotIO> PMC C<*pmc>. Calls the C<flush> method on the
+filehandle PMC.
=cut
@@ -243,7 +249,8 @@
=item C<STRING * Parrot_io_reads(PARROT_INTERP, PMC *pmc, size_t length)>
-Return a new C<STRING*> holding up to C<len> bytes.
+Return a new C<STRING*> holding up to C<len> bytes read from the filehandle
+PMC. Calls the C<read> method on the filehandle PMC.
=cut
@@ -267,7 +274,8 @@
=item C<STRING * Parrot_io_readline(PARROT_INTERP, PMC *pmc)>
-Return a new C<STRING*> holding the next line read from the file.
+Return a new C<STRING*> holding the next line read from the file. Calls
+the C<readline> method of the filehandle PMC.
=cut
@@ -445,7 +453,8 @@
=item C<INTVAL Parrot_io_putps(PARROT_INTERP, PMC *pmc, STRING *s)>
-Writes C<*s> to C<*pmc>. Parrot string version.
+Writes C<*s> to C<*pmc>. Parrot string version. Calls the C<puts> method
+on the filehandle PMC.
=cut
Deleted: trunk/src/io/io_string.c
==============================================================================
--- trunk/src/io/io_string.c Fri May 15 23:38:11 2009 (r38806)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,184 +0,0 @@
-/*
-Copyright (C) 2006-2009, Parrot Foundation.
-$Id$
-
-=head1 NAME
-
-src/io/io_string.c - IO Layer for strings
-
-=head1 DESCRIPTION
-
-Capture output to a string PMC.
-
-=head2 String Layer Functions
-
-=over 4
-
-=cut
-
-*/
-
-#include "parrot/parrot.h"
-#include "io_private.h"
-
-/* HEADERIZER HFILE: none */
-
-/* HEADERIZER BEGIN: static */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
-
-static size_t PIO_string_read(SHIM_INTERP,
- ARGMOD(ParrotIOLayer *l),
- SHIM(ParrotIO *io),
- ARGOUT(STRING **buf))
- __attribute__nonnull__(2)
- __attribute__nonnull__(4)
- FUNC_MODIFIES(*l)
- FUNC_MODIFIES(*buf);
-
-static size_t PIO_string_write(PARROT_INTERP,
- ARGMOD(ParrotIOLayer *l),
- SHIM(ParrotIO *io),
- ARGMOD(STRING *s))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2)
- __attribute__nonnull__(4)
- FUNC_MODIFIES(*l)
- FUNC_MODIFIES(*s);
-
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
-/* HEADERIZER END: static */
-
-static const ParrotIOLayerAPI pio_string_layer_api = {
- PIO_null_init,
- PIO_base_new_layer,
- PIO_base_delete_layer,
- PIO_null_push_layer,
- PIO_null_pop_layer,
- PIO_null_open,
- PIO_null_open2,
- PIO_null_open3,
- PIO_null_open_async,
- PIO_null_fdopen,
- PIO_null_close,
- PIO_string_write,
- PIO_null_write_async,
- PIO_string_read,
- PIO_null_read_async,
- PIO_null_flush,
- PIO_null_peek,
- PIO_null_seek,
- PIO_null_tell,
- PIO_null_setbuf,
- PIO_null_setlinebuf,
- PIO_null_getcount,
- PIO_null_fill,
- PIO_null_eof,
- NULL, /* no poll */
- NULL, /* no socket */
- NULL, /* no connect */
- NULL, /* no send */
- NULL, /* no recv */
- NULL, /* no bind */
- NULL, /* no listen */
- NULL /* no accept */
-};
-
-ParrotIOLayer pio_string_layer = {
- NULL,
- "string",
- 0,
- &pio_string_layer_api,
- NULL, NULL
-};
-
-/*
-
-=item C<ParrotIOLayer * PIO_string_register_layer(void)>
-
-Get a pointer to the C<pio_string_layer> structure.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-ParrotIOLayer *
-PIO_string_register_layer(void)
-{
- return &pio_string_layer;
-}
-
-/*
-
-=item C<static size_t PIO_string_read(PARROT_INTERP, ParrotIOLayer *l,
-ParrotIO *io, STRING **buf)>
-
-Read a string from layer C<l> and store it in the specified buffer.
-
-=cut
-
-*/
-
-static size_t
-PIO_string_read(SHIM_INTERP, ARGMOD(ParrotIOLayer *l), SHIM(ParrotIO *io), ARGOUT(STRING **buf))
-{
- if (!l->self)
- return 0;
-
- *buf = (STRING *)l->self;
- l->self = NULL;
-
- return (*buf)->strlen;
-}
-
-/*
-
-=item C<static size_t PIO_string_write(PARROT_INTERP, ParrotIOLayer *l, ParrotIO *io, STRING *s)>
-
-Write the string C<s> to the layer C<l>.
-
-=cut
-
-*/
-
-static size_t
-PIO_string_write(PARROT_INTERP, ARGMOD(ParrotIOLayer *l), SHIM(ParrotIO *io), ARGMOD(STRING *s))
-{
- STRING * const old_string = (STRING *)l->self;
-
- if (!old_string) {
- l->self = s;
- return s->strlen;
- }
-
- l->self = Parrot_str_append(interp, old_string, s);
- return Parrot_str_byte_length(interp, (STRING *)l->self);
-}
-
-/*
-
-=back
-
-=head1 SEE ALSO
-
-F<src/io/io_passdown.c>,
-F<src/io/io.c>,
-F<src/io/io_layers.c>,
-F<src/io/io_private.h>.
-
-=head1 HISTORY
-
-Initially written by chromatic.
-
-=cut
-
-*/
-
-
-/*
- * Local variables:
- * c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */
More information about the parrot-commits
mailing list