COUNT_FOPEN(3)

NAME
count_fopen - read a fixed number of bytes from a stream

LIBRARY
PDEL Library (libpdel, -lpdel)

SYNOPSIS
#include <sys/types.h>
#include <stdio.h>
#include <pdel/io/count_fp.h>
FILE *
count_fopen(FILE *fp, off_t count, int closeit);

DESCRIPTION
count_fopen() creates a new read-only stream that reads up to, but no more than, count bytes from the underlying stream fp. After count bytes have been read, further attempts to read from the returned stream will return EOF.

fclose(3) should be used to close the returned stream. The closeit parameter determines whether the underlying stream fp is closed when the returned stream is closed.

RETURN VALUES
boundary_fopen() returns NULL to indicate an error, with errno set appropriately.

SEE ALSO
boundary_fopen(3), string_fp(3), libpdel(3) N. Freed, N. Borenstein, Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types, RFC 2046.

HISTORY
The PDEL library was developed at Packet Design, LLC. http://www.packetdesign.com/

AUTHORS
Archie Cobbs <archie@freebsd.org>