Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
BOUNDARY_FOPEN(3)	    Library Functions Manual	     BOUNDARY_FOPEN(3)

NAME
       boundary_fopen -- read from a stream until a boundary string is matched

LIBRARY
       PDEL Library (libpdel, -lpdel)

SYNOPSIS
       #include	<stdio.h>
       #include	<pdel/io/boundary_fp.h>

       FILE *
       boundary_fopen(FILE *fp,	const char *boundary, int closeit);

DESCRIPTION
       boundary_fopen()	 creates  a  new read-only stream that reads data from
       the underlying stream fp	until the boundary string is encountered,  af-
       ter  which  EOF is returned.  If	the boundary string does not appear in
       the underlying stream input, the	entire input is	passed	through	 unal-
       tered.

       When  the boundary string appears, the last character readable from the
       newly created boundary stream will be the  character  just  before  the
       first character of the boundary string.	Therefore, the boundary	string
       itself  does  not  appear in the	input from the boundary	stream.	 In no
       case are	any characters beyond  the  last  character  of	 the  boundary
       string  read  out  from the underlying stream, i.e., the	last character
       read from the underlying	stream will  be	 the  last  character  of  the
       boundary	string.

       The  boundary  matching	algorithm  runs	 in linear time.  However, the
       boundary	string is limited to 255 characters in	length	(not  counting
       the terminating '\0' byte).

       fclose(3) should	be used	to close the returned stream.  The closeit pa-
       rameter determines whether the underlying stream	fp is also closed when
       the boundary stream is closed.

       Boundary	 streams are useful for	online parsing of multipart MIME docu-
       ment body parts as defined in RFC 2046.

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

SEE ALSO
       count_fopen(3), string_fp(3), libpdel(3)

       N.  Freed  and  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>

FreeBSD	ports 15.0		April 22, 2002		     BOUNDARY_FOPEN(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=boundary_fopen&sektion=3&manpath=FreeBSD+Ports+15.0>

home | help