Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2007-08-03 00:23:06 +0400
committerEric Blake <eblake@redhat.com>2007-08-03 00:23:06 +0400
commit6ddcdb9da510ddf2b6309006ded0827f467e23b4 (patch)
treef0e349d3cc7ad6083b3a652e688d385215a41dc8 /newlib/libc/include
parent191814588af712faa0093d21a08c51c97abae3f2 (diff)
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.
Diffstat (limited to 'newlib/libc/include')
-rw-r--r--newlib/libc/include/stdio.h30
1 files changed, 24 insertions, 6 deletions
diff --git a/newlib/libc/include/stdio.h b/newlib/libc/include/stdio.h
index b387a4455..51c72a447 100644
--- a/newlib/libc/include/stdio.h
+++ b/newlib/libc/include/stdio.h
@@ -244,11 +244,9 @@ char * _EXFUN(asnprintf, (char *, size_t *, const char *, ...)
_ATTRIBUTE ((__format__ (__printf__, 3, 4))));
int _EXFUN(asprintf, (char **, const char *, ...)
_ATTRIBUTE ((__format__ (__printf__, 2, 3))));
-#ifndef dprintf
+#ifndef diprintf
int _EXFUN(diprintf, (int, const char *, ...)
_ATTRIBUTE ((__format__ (__printf__, 2, 3))));
-int _EXFUN(dprintf, (int, const char *, ...)
- _ATTRIBUTE ((__format__ (__printf__, 2, 3))));
#endif
int _EXFUN(fcloseall, (_VOID));
int _EXFUN(fiprintf, (FILE *, const char *, ...)
@@ -278,8 +276,6 @@ int _EXFUN(vasprintf, (char **, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 2, 0))));
int _EXFUN(vdiprintf, (int, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 2, 0))));
-int _EXFUN(vdprintf, (int, const char *, __VALIST)
- _ATTRIBUTE ((__format__ (__printf__, 2, 0))));
int _EXFUN(vfiprintf, (FILE *, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 2, 0))));
int _EXFUN(vfiscanf, (FILE *, const char *, __VALIST)
@@ -306,7 +302,7 @@ int _EXFUN(vsscanf, (const char *, const char *, __VALIST)
#endif /* !__STRICT_ANSI__ */
/*
- * Routines in POSIX 1003.1.
+ * Routines in POSIX 1003.1:2001.
*/
#ifndef __STRICT_ANSI__
@@ -330,6 +326,26 @@ int _EXFUN(putchar_unlocked, (int));
#endif /* ! __STRICT_ANSI__ */
/*
+ * Routines in POSIX 1003.1:200x.
+ */
+
+#ifndef __STRICT_ANSI__
+# ifndef _REENT_ONLY
+# ifndef dprintf
+int _EXFUN(dprintf, (int, const char *, ...)
+ _ATTRIBUTE ((__format__ (__printf__, 2, 3))));
+# endif
+FILE * _EXFUN(fmemopen, (void *, size_t, const char *));
+/* getdelim - see __getdelim for now */
+/* getline - see __getline for now */
+FILE * _EXFUN(open_memstream, (char **, size_t *));
+/* renameat - unimplemented for now */
+int _EXFUN(vdprintf, (int, const char *, __VALIST)
+ _ATTRIBUTE ((__format__ (__printf__, 2, 0))));
+# endif
+#endif
+
+/*
* Recursive versions of the above.
*/
@@ -354,6 +370,7 @@ int _EXFUN(_fiprintf_r, (struct _reent *, FILE *, const char *, ...)
_ATTRIBUTE ((__format__ (__printf__, 3, 4))));
int _EXFUN(_fiscanf_r, (struct _reent *, FILE *, const char *, ...)
_ATTRIBUTE ((__format__ (__scanf__, 3, 4))));
+FILE * _EXFUN(_fmemopen_r, (struct _reent *, void *, size_t, const char *));
FILE * _EXFUN(_fopen_r, (struct _reent *, const char *, const char *));
int _EXFUN(_fprintf_r, (struct _reent *, FILE *, const char *, ...)
_ATTRIBUTE ((__format__ (__printf__, 3, 4))));
@@ -376,6 +393,7 @@ int _EXFUN(_iscanf_r, (struct _reent *, const char *, ...)
_ATTRIBUTE ((__format__ (__scanf__, 2, 3))));
int _EXFUN(_mkstemp_r, (struct _reent *, char *));
char * _EXFUN(_mktemp_r, (struct _reent *, char *));
+FILE * _EXFUN(_open_memstream_r, (struct _reent *, char **, size_t *));
void _EXFUN(_perror_r, (struct _reent *, const char *));
int _EXFUN(_printf_r, (struct _reent *, const char *, ...)
_ATTRIBUTE ((__format__ (__printf__, 2, 3))));