2 * This file is part of DisOrder
3 * Copyright (C) 2005 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 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * 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, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
24 int mime_content_type(const char *s
,
26 char **parameternamep
,
27 char **parametervaluep
);
28 /* Parse a content-type value. returns 0 on success, -1 on error.
29 * paramaternamep and parametervaluep are only set if present.
30 * type and parametername are forced to lower case.
33 const char *mime_parse(const char *s
,
34 int (*callback
)(const char *name
, const char *value
,
37 /* Parse a MIME message. Calls CALLBACK for each header field, then returns a
38 * pointer to the decoded body (might or might not point back into the original
41 int mime_multipart(const char *s
,
42 int (*callback
)(const char *s
, void *u
),
45 /* call CALLBACK with each part of multipart document [s,s+n) */
47 int mime_rfc2388_content_disposition(const char *s
,
49 char **parameternamep
,
50 char **parametervaluep
);
51 /* Parse an RFC2388-style content-disposition field */
53 char *mime_qp(const char *s
);
54 char *mime_base64(const char *s
);
55 /* convert quoted-printable or base64 data */