Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/include funopen2()



details:   https://anonhg.NetBSD.org/src/rev/17bcf7c47b90
branches:  trunk
changeset: 778456:17bcf7c47b90
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Mar 27 15:06:01 2012 +0000

description:
funopen2()

diffstat:

 include/stdio.h |  25 +++++++++++++++++--------
 1 files changed, 17 insertions(+), 8 deletions(-)

diffs (58 lines):

diff -r d9e812af1207 -r 17bcf7c47b90 include/stdio.h
--- a/include/stdio.h   Tue Mar 27 15:05:42 2012 +0000
+++ b/include/stdio.h   Tue Mar 27 15:06:01 2012 +0000
@@ -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 @@
        /* 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 @@
        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 @@
  */
 __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 */
 
 /*



Home | Main Index | Thread Index | Old Index