From 6ddcdb9da510ddf2b6309006ded0827f467e23b4 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 2 Aug 2007 20:23:06 +0000 Subject: Implement fmemopen and open_memstream. * libc/stdio/fmemopen.c (_fmemopen_r, fmemopen): New file. * libc/stdio/open_memstream.c (_open_memstream_r, open_memstream): New file. * libc/stdio/fopencookie.c (fcwriter): Minor optimization. * libc/include/stdio.h (dprintf, vdprintf): Group all POSIX 200x functions together. (fmemopen, open_memstream): Declare new functions. * libc/stdio/stdio.tex: Document them. * libc/stdio/Makefile.am (ELIX_4_SOURCES, CHEWOUT_FILES): Add fmemopen and open_memstream. * libc/stdio/Makefile.in: Regenerate. --- newlib/libc/stdio/fopencookie.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'newlib/libc/stdio/fopencookie.c') diff --git a/newlib/libc/stdio/fopencookie.c b/newlib/libc/stdio/fopencookie.c index 35afa3257..854bb49e9 100644 --- a/newlib/libc/stdio/fopencookie.c +++ b/newlib/libc/stdio/fopencookie.c @@ -122,9 +122,9 @@ _DEFUN(fcwriter, (ptr, cookie, buf, n), if (c->fp->_flags & __SAPP && c->fp->_seek) { #ifdef __LARGE64_FILES - c->fp->_seek64 (ptr, c->fp->_cookie, 0, SEEK_END); + c->fp->_seek64 (ptr, cookie, 0, SEEK_END); #else - c->fp->_seek (ptr, c->fp->_cookie, 0, SEEK_END); + c->fp->_seek (ptr, cookie, 0, SEEK_END); #endif } errno = 0; @@ -134,7 +134,7 @@ _DEFUN(fcwriter, (ptr, cookie, buf, n), } static _fpos_t -_DEFUN(fcseeker, (ptr, cookie, off, whence), +_DEFUN(fcseeker, (ptr, cookie, pos, whence), struct _reent *ptr _AND void *cookie _AND _fpos_t pos _AND @@ -162,7 +162,7 @@ _DEFUN(fcseeker, (ptr, cookie, off, whence), #ifdef __LARGE64_FILES static _fpos64_t -_DEFUN(fcseeker64, (ptr, cookie, off, whence), +_DEFUN(fcseeker64, (ptr, cookie, pos, whence), struct _reent *ptr _AND void *cookie _AND _fpos64_t pos _AND -- cgit v1.2.3