/*  $NetBSD: funopen.c,v 1.10 2005/11/29 03:12:00 christos Exp $  */

/*-
 * Copyright (c) 1990, 1993
 *  The Regents of the University of California.  All rights reserved.
 *
 * This code is derived from software contributed to Berkeley by
 * Chris Torek.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */
#include  <LibConfig.h>
#include <sys/EfiCdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)funopen.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: funopen.c,v 1.10 2005/11/29 03:12:00 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */

#include <stdio.h>
#include <errno.h>
#include "reentrant.h"
#include "local.h"

FILE *
funopen(cookie, readfn, writefn, seekfn, closefn)
  const void *cookie;
  int (*readfn) __P((void *, char *, int));
  int (*writefn) __P((void *, const char *, int));
  fpos_t (*seekfn) __P((void *, fpos_t, int));
  int (*closefn) __P((void *));
{
  FILE *fp;
  int flags;

  if (readfn == NULL) {
    if (writefn == NULL) {    /* illegal */
      errno = EINVAL;
      return (NULL);
    } else
      flags = __SWR;    /* write only */
  } else {
    if (writefn == NULL)
      flags = __SRD;    /* read only */
    else
      flags = __SRW;    /* read-write */
  }
  if ((fp = __sfp()) == NULL)
    return (NULL);
  fp->_flags = flags;
  fp->_file = -1;
  fp->_cookie = __UNCONST(cookie);
  fp->_read = readfn;
  fp->_write = writefn;
  fp->_seek = seekfn;
  fp->_close = closefn;
  return (fp);
}
