-/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <stddef.h>
#include <stdio.h>
/* Defined in fopen.c. */
-extern int EXFUN(__getmode, (CONST char *mode, __io_mode *mptr));
+extern int __getmode __P ((const char *mode, __io_mode *mptr));
/* Open a new stream that will read and/or write from the buffer in
S, which is of LEN bytes. If the mode indicates appending, the
to read, attempted writes always return an output error and attempted
reads always return end-of-file. */
FILE *
-DEFUN(fmemopen, (s, len, mode),
- PTR s AND size_t len AND CONST char *mode)
+fmemopen (s, len, mode)
+ void *s;
+ size_t len;
+ const char *mode;
{
__io_mode m;
register FILE *stream;
{
int save = errno;
(void) fclose (stream);
- errno = save;
+ __set_errno (save);
return NULL;
}
}
stream->__bufp = p;
}
else if (stream->__mode.__truncate)
- memset ((PTR) stream->__buffer, 0, len);
+ memset ((void *) stream->__buffer, 0, len);
return stream;
}