Annotation of embedaddon/libpdel/http/http_mime.3, revision 1.1
1.1 ! misho 1: .\" Copyright (c) 2001-2002 Packet Design, LLC.
! 2: .\" All rights reserved.
! 3: .\"
! 4: .\" Subject to the following obligations and disclaimer of warranty,
! 5: .\" use and redistribution of this software, in source or object code
! 6: .\" forms, with or without modifications are expressly permitted by
! 7: .\" Packet Design; provided, however, that:
! 8: .\"
! 9: .\" (i) Any and all reproductions of the source or object code
! 10: .\" must include the copyright notice above and the following
! 11: .\" disclaimer of warranties; and
! 12: .\" (ii) No rights are granted, in any manner or form, to use
! 13: .\" Packet Design trademarks, including the mark "PACKET DESIGN"
! 14: .\" on advertising, endorsements, or otherwise except as such
! 15: .\" appears in the above copyright notice or in the software.
! 16: .\"
! 17: .\" THIS SOFTWARE IS BEING PROVIDED BY PACKET DESIGN "AS IS", AND
! 18: .\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, PACKET DESIGN MAKES NO
! 19: .\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING
! 20: .\" THIS SOFTWARE, INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED
! 21: .\" WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
! 22: .\" OR NON-INFRINGEMENT. PACKET DESIGN DOES NOT WARRANT, GUARANTEE,
! 23: .\" OR MAKE ANY REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS
! 24: .\" OF THE USE OF THIS SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY,
! 25: .\" RELIABILITY OR OTHERWISE. IN NO EVENT SHALL PACKET DESIGN BE
! 26: .\" LIABLE FOR ANY DAMAGES RESULTING FROM OR ARISING OUT OF ANY USE
! 27: .\" OF THIS SOFTWARE, INCLUDING WITHOUT LIMITATION, ANY DIRECT,
! 28: .\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE, OR CONSEQUENTIAL
! 29: .\" DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, LOSS OF
! 30: .\" USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY THEORY OF
! 31: .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
! 32: .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
! 33: .\" THE USE OF THIS SOFTWARE, EVEN IF PACKET DESIGN IS ADVISED OF
! 34: .\" THE POSSIBILITY OF SUCH DAMAGE.
! 35: .\"
! 36: .\" Author: Archie Cobbs <archie@freebsd.org>
! 37: .\"
! 38: .\" $Id: http_mime.3,v 1.6 2004/06/02 17:24:36 archie Exp $
! 39: .\"
! 40: .Dd April 22, 2002
! 41: .Dt HTTP_MIME 3
! 42: .Os
! 43: .Sh NAME
! 44: .Nm http_mime
! 45: .Nd multi-part MIME suport
! 46: .Sh LIBRARY
! 47: PDEL Library (libpdel, \-lpdel)
! 48: .\"
! 49: .Sh SYNOPSIS
! 50: .\"
! 51: .In sys/types.h
! 52: .In stdio.h
! 53: .In netinet/in.h
! 54: .In openssl/ssl.h
! 55: .In pdel/http/http_defs.h
! 56: .In pdel/http/http_server.h
! 57: .Ft u_int
! 58: .Fn http_mime_multipart_get_count "struct mime_multipart *mp"
! 59: .Ft "struct mime_part *"
! 60: .Fn http_mime_multipart_get_part "struct mime_multipart *mp" "int index"
! 61: .Ft void
! 62: .Fn http_mime_multipart_free "struct mime_multipart **mpp"
! 63: .Ft "const char *"
! 64: .Fn http_mime_part_get_header "struct mime_part *part" "const char *name"
! 65: .Ft u_int
! 66: .Fn http_mime_part_get_length "struct mime_part *part"
! 67: .Ft "u_char *"
! 68: .Fn http_mime_part_get_data "struct mime_part *part"
! 69: .\"
! 70: .Sh DESCRIPTION
! 71: .\"
! 72: These functions handle multi-part MIME document data as returned by
! 73: .Xr http_request_read_mime_multipart 3 .
! 74: .Pp
! 75: A
! 76: .Li "struct mime_multipart"
! 77: represents an entire multi-part document, while a
! 78: .Li "struct mime_part"
! 79: represents a single part.
! 80: .Pp
! 81: .Fn http_mime_multipart_get_count
! 82: returns the number of parts in
! 83: .Fa mp .
! 84: .Pp
! 85: .Fn http_mime_multipart_get_part
! 86: retrieves the part with index
! 87: .Fa index ,
! 88: which must be less than the value returned by
! 89: .Fn http_mime_multipart_get_count .
! 90: .Pp
! 91: .Fn http_mime_multipart_free
! 92: frees a multi-part document.
! 93: Upon return.
! 94: .Fa "*mpp"
! 95: will be set to
! 96: .Dv NULL.
! 97: If
! 98: .Fa "*mpp"
! 99: is already
! 100: .Dv NULL
! 101: when
! 102: .Fn http_mime_multipart_free
! 103: is invoked, nothing happens.
! 104: .Pp
! 105: .Fn http_mime_part_get_header
! 106: retrieves a header having name
! 107: .Fa name
! 108: associated with the part
! 109: .Fa part .
! 110: .Pp
! 111: .Fn http_mime_part_get_length
! 112: returns the length in bytes of
! 113: .Fa part .
! 114: .Pp
! 115: .Fn http_mime_part_get_data
! 116: returns a pointer to the data of
! 117: .Fa part .
! 118: .Sh RETURN VALUES
! 119: .Fn http_mime_multipart_get_part
! 120: return
! 121: .Dv NULL
! 122: with
! 123: .Va errno
! 124: set to
! 125: .Er EINVAL
! 126: if
! 127: .Fa index
! 128: is out of range.
! 129: .Pp
! 130: .Fn http_mime_part_get_header
! 131: returns
! 132: .Dv NULL
! 133: with
! 134: .Va errno
! 135: set to
! 136: .Er ENOENT
! 137: if the header is not found.
! 138: .Sh SEE ALSO
! 139: .Xr http_client 3 ,
! 140: .Xr http_request 3 ,
! 141: .Xr http_response 3 ,
! 142: .Xr http_server 3 ,
! 143: .Xr libpdel 3
! 144: .Rs
! 145: .%A N. Freed
! 146: .%A N. Borenstein
! 147: .%T "Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types"
! 148: .%O RFC 2046
! 149: .Re
! 150: .Sh HISTORY
! 151: The PDEL library was developed at Packet Design, LLC.
! 152: .Dv "http://www.packetdesign.com/"
! 153: .Sh AUTHORS
! 154: .An Archie Cobbs Aq archie@freebsd.org
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>