#include <sofia-sip/url.h>
#include <sofia-sip/msg_types.h>
#include <sofia-sip/su_types.h>
Go to the source code of this file.
|
msg_multipart_t * | msg_multipart_create (su_home_t *home, char const *content_type, void const *data, isize_t dlen) |
| Create a part for MIME multipart entity. More...
|
|
msg_multipart_t * | msg_multipart_parse (su_home_t *home, msg_content_type_t const *c, msg_payload_t *pl) |
| Parse a MIME multipart. More...
|
|
int | msg_multipart_complete (su_home_t *home, msg_content_type_t *c, msg_multipart_t *mp) |
| Add all missing parts to the multipart. More...
|
|
msg_header_t * | msg_multipart_serialize (msg_header_t **head0, msg_multipart_t *mp) |
| Serialize a multipart message.
|
|
issize_t | msg_multipart_prepare (msg_t *msg, msg_multipart_t *mp, int flags) |
| Encode a multipart. More...
|
|
isize_t | msg_accept_any_dup_xtra (msg_header_t const *h, isize_t offset) |
| Calculate extra memory used by accept-* headers. More...
|
|
char * | msg_accept_any_dup_one (msg_header_t *dst, msg_header_t const *src, char *b, isize_t xtra) |
| Duplicate one msg_accept_any_t object. More...
|
|
msg_content_length_t * | msg_content_length_create (su_home_t *, uint32_t n) |
|
unsigned | msg_q_value (char const *q) |
| Calculate Q value. More...
|
|
msg_accept_t * | msg_accept_match (msg_accept_t const *, msg_content_type_t const *) |
| Check if the Content-Type is Acceptable. More...
|
|
MIME headers and multipart messages (RFC 2045).
- Author
- Pekka Pessi Pekka.nosp@m..Pes.nosp@m.si@no.nosp@m.kia..nosp@m.com
- Date
- Created: Fri Aug 16 19:18:26 EEST 2002 ppessi
◆ msg_accept_any_dup_one()
Duplicate one msg_accept_any_t object.
◆ msg_accept_any_dup_xtra()
isize_t msg_accept_any_dup_xtra |
( |
msg_header_t const * |
h, |
|
|
isize_t |
offset |
|
) |
| |
Calculate extra memory used by accept-* headers.
◆ msg_accept_match()
Check if the Content-Type is Acceptable.
- Returns
- Best Accept header field from , or NULL if no match.
@TODO Content-Type parameters (e.g., charset) are not checked.
- Since
- Not yet released
◆ msg_multipart_complete()
Add all missing parts to the multipart.
Add missing components such as boundaries between body parts, separators between body-part headers and data, and close-delimiter after last body-part to the multipart message.
- Parameters
-
[in,out] | home | home for allocating structures |
[in,out] | c | content-type header for multipart |
[in,out] | mp | pointer to first multipart structure |
- Return values
-
0 | when successful |
-1 | upon an error |
- Errors:
- \n EBADMSG
- The Content-Type header c is malformed, or multipart message contains a malformed Content-Type header.
- \n ENOMEM
- A memory allocation failed.
- \n EINVAL
- The function msg_multipart_complete() was given invalid arguments.
◆ msg_multipart_create()
Create a part for MIME multipart entity.
The function msg_multipart_create() allocates a new msg_multipart_t object from memory home home. If content_type is non-NULL, it makes a msg_content_type_t header object and adds the header to the msg_multipart_t object. If dlen is nonzero, it allocates a msg_payload_t structure of dlen bytes for the payload of the newly created msg_multipart_t object. If data is non-NULL, it copies the dlen bytes of of data to the payload of the newly created msg_multipart_t object.
- Returns
- A pointer to the newly created msg_multipart_t object, or NULL upon an error.
◆ msg_multipart_parse()
Parse a MIME multipart.
The function msg_multipart_parse() parses a MIME multipart message. The common syntax of multiparts is described in RFC 2046 (section 7).
- Parameters
-
[in,out] | home | home for allocating structures |
[in] | c | content-type header for multipart |
[in] | pl | payload structure for multipart |
After parsing, the pl will contain the plain-text preamble (if any).
- Note
- If no Content-Type header is given, the msg_multipart_parse() tries to look for a suitable boundary. Currently, it takes first boundary-looking string and uses that, so it can be fooled with, for instance, signature
"--Pekka"
.
◆ msg_multipart_prepare()
Encode a multipart.
- Returns
- The size of multipart in bytes, or -1 upon an error.
◆ msg_q_value()
unsigned msg_q_value |
( |
char const * |
q | ) |
|
Calculate Q value.
The function msg_q_value() converts q-value string q to numeric value in range (0..1000). Q values are used, for instance, to describe relative priorities of acceptable Content-Types.
- Parameters
-
q | q-value string ("1" | "." 1,3DIGIT) |
- Returns
- The function msg_q_value() returns an integer in range 0 .. 1000.
- Since
- Not yet released