~ubuntu-branches/ubuntu/dapper/gnupg2/dapper

« back to all changes in this revision

Viewing changes to tools/rfc822parse.h

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Mueller
  • Date: 2005-03-29 10:30:32 UTC
  • Revision ID: james.westby@ubuntu.com-20050329103032-sj42n2ain3ipx310
Tags: upstream-1.9.15
ImportĀ upstreamĀ versionĀ 1.9.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* rfc822parse.h - Simple mail and MIME parser
 
2
 *      Copyright (C) 1999 Werner Koch, Duesseldorf
 
3
 *      Copyright (C) 2003, g10 Code GmbH
 
4
 *
 
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.
 
9
 *
 
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.
 
14
 *
 
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
 
18
 */
 
19
 
 
20
#ifndef RFC822PARSE_H
 
21
#define RFC822PARSE_H
 
22
 
 
23
struct rfc822parse_context;
 
24
typedef struct rfc822parse_context *rfc822parse_t;
 
25
 
 
26
typedef enum 
 
27
  {
 
28
    RFC822PARSE_OPEN = 1,
 
29
    RFC822PARSE_CLOSE,
 
30
    RFC822PARSE_CANCEL,
 
31
    RFC822PARSE_T2BODY,
 
32
    RFC822PARSE_FINISH,
 
33
    RFC822PARSE_RCVD_SEEN,
 
34
    RFC822PARSE_LEVEL_DOWN,
 
35
    RFC822PARSE_LEVEL_UP,
 
36
    RFC822PARSE_BOUNDARY,
 
37
    RFC822PARSE_LAST_BOUNDARY,
 
38
    RFC822PARSE_BEGIN_HEADER,
 
39
    RFC822PARSE_PREAMBLE,
 
40
    RFC822PARSE_EPILOGUE
 
41
  } 
 
42
rfc822parse_event_t;
 
43
 
 
44
struct rfc822parse_field_context;
 
45
typedef struct rfc822parse_field_context *rfc822parse_field_t;
 
46
 
 
47
 
 
48
typedef int (*rfc822parse_cb_t) (void *opaque,
 
49
                                 rfc822parse_event_t event,
 
50
                                 rfc822parse_t msg);
 
51
 
 
52
 
 
53
rfc822parse_t rfc822parse_open (rfc822parse_cb_t cb, void *opaque_value);
 
54
 
 
55
void rfc822parse_close (rfc822parse_t msg);
 
56
 
 
57
void rfc822parse_cancel (rfc822parse_t msg);
 
58
int rfc822parse_finish (rfc822parse_t msg);
 
59
 
 
60
int rfc822parse_insert (rfc822parse_t msg,
 
61
                        const unsigned char *line, size_t length);
 
62
 
 
63
char *rfc822parse_get_field (rfc822parse_t msg, const char *name, int which,
 
64
                             size_t *valueoff);
 
65
 
 
66
const char *rfc822parse_enum_header_lines (rfc822parse_t msg, void **context);
 
67
 
 
68
rfc822parse_field_t rfc822parse_parse_field (rfc822parse_t msg,
 
69
                                             const char *name,
 
70
                                             int which);
 
71
 
 
72
void rfc822parse_release_field (rfc822parse_field_t field);
 
73
 
 
74
const char *rfc822parse_query_parameter (rfc822parse_field_t ctx,
 
75
                                         const char *attr, int lower_value);
 
76
 
 
77
const char *rfc822parse_query_media_type (rfc822parse_field_t ctx,
 
78
                                          const char **subtype);
 
79
 
 
80
#endif /*RFC822PARSE_H */