Deleted Added
full compact
funopen.c (165903) funopen.c (200150)
1/*-
2 * Copyright (c) 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Chris Torek.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#if defined(LIBC_SCCS) && !defined(lint)
34static char sccsid[] = "@(#)funopen.c 8.1 (Berkeley) 6/4/93";
35#endif /* LIBC_SCCS and not lint */
36#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Chris Torek.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#if defined(LIBC_SCCS) && !defined(lint)
34static char sccsid[] = "@(#)funopen.c 8.1 (Berkeley) 6/4/93";
35#endif /* LIBC_SCCS and not lint */
36#include <sys/cdefs.h>
37__FBSDID("$FreeBSD: head/lib/libc/stdio/funopen.c 165903 2007-01-09 00:28:16Z imp $");
37__FBSDID("$FreeBSD: head/lib/libc/stdio/funopen.c 200150 2009-12-05 19:31:38Z ed $");
38
39#include <stdio.h>
40#include <errno.h>
41
42#include "local.h"
43
44FILE *
38
39#include <stdio.h>
40#include <errno.h>
41
42#include "local.h"
43
44FILE *
45funopen(cookie, readfn, writefn, seekfn, closefn)
46 const void *cookie;
47 int (*readfn)(), (*writefn)();
48 fpos_t (*seekfn)(void *cookie, fpos_t off, int whence);
49 int (*closefn)();
45funopen(const void *cookie,
46 int (*readfn)(void *, char *, int),
47 int (*writefn)(void *, const char *, int),
48 fpos_t (*seekfn)(void *, fpos_t, int),
49 int (*closefn)(void *))
50{
51 FILE *fp;
52 int flags;
53
54 if (readfn == NULL) {
55 if (writefn == NULL) { /* illegal */
56 errno = EINVAL;
57 return (NULL);

--- 19 unchanged lines hidden ---
50{
51 FILE *fp;
52 int flags;
53
54 if (readfn == NULL) {
55 if (writefn == NULL) { /* illegal */
56 errno = EINVAL;
57 return (NULL);

--- 19 unchanged lines hidden ---