Skip to content

Commit

Permalink
[io] Remove unused PIO_PEEK
Browse files Browse the repository at this point in the history
  • Loading branch information
nwellnhof committed Jan 9, 2011
1 parent fb48675 commit 3916b26
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 108 deletions.
12 changes: 0 additions & 12 deletions include/parrot/io_portable.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,6 @@ PMC * Parrot_io_open_portable(PARROT_INTERP,
__attribute__nonnull__(3)
FUNC_MODIFIES(*filehandle);

size_t Parrot_io_peek_portable(PARROT_INTERP,
ARGIN(PMC *filehandle),
ARGIN(STRING **buf))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(3);

size_t Parrot_io_read_portable(PARROT_INTERP,
ARGIN(PMC *filehandle),
ARGMOD(char *buf),
Expand Down Expand Up @@ -125,10 +118,6 @@ size_t Parrot_io_write_portable(PARROT_INTERP,
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(filehandle) \
, PARROT_ASSERT_ARG(path))
#define ASSERT_ARGS_Parrot_io_peek_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(filehandle) \
, PARROT_ASSERT_ARG(buf))
#define ASSERT_ARGS_Parrot_io_read_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(filehandle) \
Expand Down Expand Up @@ -165,7 +154,6 @@ size_t Parrot_io_write_portable(PARROT_INTERP,
#define PIO_SEEK(interp, pmc, offset, start) \
Parrot_io_seek_portable((interp), (pmc), (offset), (start))
#define PIO_TELL(interp, pmc) Parrot_io_tell_portable((interp), (pmc))
#define PIO_PEEK(interp, pmc, buf) Parrot_io_peek_portable((interp), (pmc), (buf))
#define PIO_FLUSH(interp, pmc) Parrot_io_flush_portable((interp), (pmc))
#define PIO_GETBLKSIZE(handle) Parrot_io_getblksize_portable((handle))
#define PIO_IS_TTY(interp, handle) Parrot_io_unimplemented_portable(interp)
Expand Down
8 changes: 0 additions & 8 deletions include/parrot/io_unix.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ PIOHANDLE Parrot_io_open_unix(PARROT_INTERP,
__attribute__nonnull__(1)
__attribute__nonnull__(2);

size_t Parrot_io_peek_unix(PARROT_INTERP,
SHIM(PMC *filehandle),
SHIM(STRING **buf))
__attribute__nonnull__(1);

PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
INTVAL Parrot_io_pipe_unix(SHIM_INTERP,
Expand Down Expand Up @@ -140,8 +135,6 @@ size_t Parrot_io_write_unix(PARROT_INTERP,
#define ASSERT_ARGS_Parrot_io_open_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(path))
#define ASSERT_ARGS_Parrot_io_peek_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_io_pipe_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(reader) \
, PARROT_ASSERT_ARG(writer))
Expand Down Expand Up @@ -285,7 +278,6 @@ INTVAL Parrot_io_socket_unix(PARROT_INTERP,
#define PIO_SEEK(interp, pmc, offset, start) \
Parrot_io_seek_unix((interp), (pmc), (offset), (start))
#define PIO_TELL(interp, pmc) Parrot_io_tell_unix((interp), (pmc))
#define PIO_PEEK(interp, pmc, buf) Parrot_io_peek_unix((interp), (pmc), (buf))
#define PIO_FLUSH(interp, pmc) Parrot_io_flush_unix((interp), (pmc))
#define PIO_GETBLKSIZE(handle) Parrot_io_getblksize_unix((handle))
#define PIO_IS_TTY(interp, handle) \
Expand Down
8 changes: 0 additions & 8 deletions include/parrot/io_win32.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ PIOHANDLE Parrot_io_open_win32(PARROT_INTERP,
__attribute__nonnull__(1)
__attribute__nonnull__(2);

size_t Parrot_io_peek_win32(PARROT_INTERP,
SHIM(PMC *filehandle),
SHIM(STRING **buf))
__attribute__nonnull__(1);

PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
INTVAL Parrot_io_pipe_win32(SHIM_INTERP,
Expand Down Expand Up @@ -136,8 +131,6 @@ size_t Parrot_io_write_win32(PARROT_INTERP,
#define ASSERT_ARGS_Parrot_io_open_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(path))
#define ASSERT_ARGS_Parrot_io_peek_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_io_pipe_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(reader) \
, PARROT_ASSERT_ARG(writer))
Expand Down Expand Up @@ -277,7 +270,6 @@ INTVAL Parrot_io_socket_win32(PARROT_INTERP,
#define PIO_SEEK(interp, pmc, offset, start) \
Parrot_io_seek_win32((interp), (pmc), (offset), (start))
#define PIO_TELL(interp, pmc) Parrot_io_tell_win32((interp), (pmc))
#define PIO_PEEK(interp, pmc, buf) Parrot_io_peek_win32((interp), (pmc), (buf))
#define PIO_FLUSH(interp, pmc) Parrot_io_flush_win32((interp), (pmc))
#define PIO_GETBLKSIZE(handle) Parrot_io_getblksize_win32((handle))
#define PIO_IS_TTY(interp, handle) \
Expand Down
35 changes: 0 additions & 35 deletions src/io/portable.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,41 +278,6 @@ io_is_tty_portable(PIOHANDLE fptr)
}


/*
=item C<size_t Parrot_io_peek_portable(PARROT_INTERP, PMC *filehandle, STRING
**buf)>
Retrieves the next character in the stream without modifying the stream.
=cut
*/

size_t
Parrot_io_peek_portable(PARROT_INTERP,
ARGIN(PMC *filehandle),
ARGIN(STRING **buf))
{
ASSERT_ARGS(Parrot_io_peek_portable)
FILE * const fptr = (FILE *)Parrot_io_get_os_handle(interp, filehandle);
STRING * const s = Parrot_io_make_string(interp, buf, 1);

/* read the next byte into the buffer */
const size_t bytes = fread(s->strstart, 1, 1, fptr);

/* if we got anything from the stream, push it back on */
if (bytes) {
s->bufused = s->strlen = 1;
ungetc(*(char *)s->strstart, fptr);
}
else
s->bufused = s->strlen = 1;

return bytes;
}


/*
=item C<INTVAL Parrot_io_getblksize_portable(PIOHANDLE fptr)>
Expand Down
23 changes: 0 additions & 23 deletions src/io/unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,29 +653,6 @@ Parrot_io_open_pipe_unix(PARROT_INTERP, ARGIN(STRING *command), INTVAL flags,
# endif
}

/*
=item C<size_t Parrot_io_peek_unix(PARROT_INTERP, PMC *filehandle, STRING
**buf)>
Retrieve the next character in the stream without modifying the stream. Not
implemented on this platform.
=cut
*/

size_t
Parrot_io_peek_unix(PARROT_INTERP,
SHIM(PMC *filehandle),
SHIM(STRING **buf))
{
ASSERT_ARGS(Parrot_io_peek_unix)
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
"peek() not implemented");
}


/*
=item C<INTVAL Parrot_io_pipe_unix(PARROT_INTERP, PIOHANDLE *reader, PIOHANDLE
Expand Down
22 changes: 0 additions & 22 deletions src/io/win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,28 +550,6 @@ Parrot_io_tell_win32(PARROT_INTERP, ARGIN(PMC *filehandle))

/*
=item C<size_t Parrot_io_peek_win32(PARROT_INTERP, PMC *filehandle, STRING
**buf)>
Retrieve the next character in the stream without modifying the stream. Not
implemented for this platform.
=cut
*/

size_t
Parrot_io_peek_win32(PARROT_INTERP,
SHIM(PMC *filehandle),
SHIM(STRING **buf))
{
ASSERT_ARGS(Parrot_io_peek_win32)
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
"peek() not implemented");
}

/*
=item C<PIOHANDLE Parrot_io_open_pipe_win32(PARROT_INTERP, STRING *command,
INTVAL flags, INTVAL *pid)>
Expand Down

0 comments on commit 3916b26

Please sign in to comment.