1
/* rfc822parse.h - Simple mail and MIME parser
2
* Copyright (C) 1999 Werner Koch, Duesseldorf
3
* Copyright (C) 2003, g10 Code GmbH
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License as
7
* published by the Free Software Foundation; either version 2 of the
8
* License, or (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, USA
23
struct rfc822parse_context;
24
typedef struct rfc822parse_context *rfc822parse_t;
33
RFC822PARSE_RCVD_SEEN,
34
RFC822PARSE_LEVEL_DOWN,
37
RFC822PARSE_LAST_BOUNDARY,
38
RFC822PARSE_BEGIN_HEADER,
44
struct rfc822parse_field_context;
45
typedef struct rfc822parse_field_context *rfc822parse_field_t;
48
typedef int (*rfc822parse_cb_t) (void *opaque,
49
rfc822parse_event_t event,
53
rfc822parse_t rfc822parse_open (rfc822parse_cb_t cb, void *opaque_value);
55
void rfc822parse_close (rfc822parse_t msg);
57
void rfc822parse_cancel (rfc822parse_t msg);
58
int rfc822parse_finish (rfc822parse_t msg);
60
int rfc822parse_insert (rfc822parse_t msg,
61
const unsigned char *line, size_t length);
63
char *rfc822parse_get_field (rfc822parse_t msg, const char *name, int which,
66
const char *rfc822parse_enum_header_lines (rfc822parse_t msg, void **context);
68
rfc822parse_field_t rfc822parse_parse_field (rfc822parse_t msg,
72
void rfc822parse_release_field (rfc822parse_field_t field);
74
const char *rfc822parse_query_parameter (rfc822parse_field_t ctx,
75
const char *attr, int lower_value);
77
const char *rfc822parse_query_media_type (rfc822parse_field_t ctx,
78
const char **subtype);
80
#endif /*RFC822PARSE_H */