2 * This file is part of DisOrder
3 * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 * @brief Support for MIME and allied protocols
27 int mime_content_type(const char *s
,
29 struct kvp
**parametersp
);
31 const char *mime_parse(const char *s
,
32 int (*callback
)(const char *name
, const char *value
,
35 /* Parse a MIME message. Calls CALLBACK for each header field, then returns a
36 * pointer to the decoded body (might or might not point back into the original
39 int mime_multipart(const char *s
,
40 int (*callback
)(const char *s
, void *u
),
43 /* call CALLBACK with each part of multipart document [s,s+n) */
45 int mime_rfc2388_content_disposition(const char *s
,
47 char **parameternamep
,
48 char **parametervaluep
);
49 /* Parse an RFC2388-style content-disposition field */
51 char *mime_qp(const char *s
);
53 /** @brief Parsed form of an HTTP Cookie: header field
55 * See <a href="http://tools.ietf.org/html/rfc2109">RFC 2109</a>.
58 /** @brief @c $Version or NULL if not set */
61 /** @brief List of cookies */
62 struct cookie
*cookies
;
64 /** @brief Number of cookies */
68 /** @brief A parsed cookie
70 * See <a href="http://tools.ietf.org/html/rfc2109">RFC 2109</a> and @ref
74 /** @brief Cookie name */
77 /** @brief Cookie value */
80 /** @brief Cookie path */
83 /** @brief Cookie domain */
88 int parse_cookie(const char *s
,
89 struct cookiedata
*cd
);
90 const struct cookie
*find_cookie(const struct cookiedata
*cd
,
92 char *quote822(const char *s
, int force
);
93 char *mime_to_qp(const char *text
);
94 const char *mime_encode_text(const char *text
,
95 const char **charsetp
,
96 const char **encodingp
);
97 const char *mime_parse_word(const char *s
, char **valuep
,
99 int mime_http_separator(int c
);
100 int mime_tspecial(int c
);