Module Name: src
Committed By: christos
Date: Tue Mar 27 15:06:01 UTC 2012
Modified Files:
src/include: stdio.h
Log Message:
funopen2()
To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/include/stdio.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/include/stdio.h
diff -u src/include/stdio.h:1.80 src/include/stdio.h:1.81
--- src/include/stdio.h:1.80 Sun Jan 22 13:36:16 2012
+++ src/include/stdio.h Tue Mar 27 11:06:01 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: stdio.h,v 1.80 2012/01/22 18:36:16 christos Exp $ */
+/* $NetBSD: stdio.h,v 1.81 2012/03/27 15:06:01 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -121,9 +121,9 @@ typedef struct __sFILE {
/* operations */
void *_cookie; /* cookie passed to io functions */
int (*_close)(void *);
- int (*_read) (void *, char *, int);
+ ssize_t (*_read) (void *, void *, size_t);
__off_t (*_seek) (void *, __off_t, int);
- int (*_write)(void *, const char *, int);
+ ssize_t (*_write)(void *, const void *, size_t);
/* file extension */
struct __sbuf _ext;
@@ -136,8 +136,9 @@ typedef struct __sFILE {
unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */
unsigned char _nbuf[1]; /* guarantee a getc() buffer */
+ int (*_flush)(void *);
/* Formerly used by fgetln/fgetwln; kept for binary compatibility */
- struct __sbuf _lb__unused;
+ char _lb_unused[sizeof(struct __sbuf) - sizeof(int (*)(void *))];
/* Unix stdio files get aligned to block boundaries on fseek() */
int _blksize; /* stat.st_blksize (may be != _bf._size) */
@@ -427,13 +428,21 @@ __END_DECLS
*/
__BEGIN_DECLS
FILE *funopen(const void *,
- int (*)(void *, char *, int),
- int (*)(void *, const char *, int),
- off_t (*)(void *, off_t, int),
- int (*)(void *));
+ int (*)(void *, char *, int),
+ int (*)(void *, const char *, int),
+ off_t (*)(void *, off_t, int),
+ int (*)(void *));
+FILE *funopen2(const void *,
+ ssize_t (*)(void *, void *, size_t),
+ ssize_t (*)(void *, const void *, size_t),
+ off_t (*)(void *, off_t, int),
+ int (*)(void *),
+ int (*)(void *));
__END_DECLS
#define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0)
#define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0)
+#define fropen2(cookie, fn) funopen2(cookie, fn, 0, 0, 0, 0)
+#define fwopen2(cookie, fn) funopen2(cookie, 0, fn, 0, 0, 0)
#endif /* _NETBSD_SOURCE */
/*