]>
Commit | Line | Data |
---|---|---|
c6905e45 JH |
1 | #ifndef MAILINFO_H |
2 | #define MAILINFO_H | |
3 | ||
ef3ca954 EN |
4 | #include "strbuf.h" |
5 | ||
c6905e45 JH |
6 | #define MAX_BOUNDARIES 5 |
7 | ||
f1aa2994 | 8 | enum quoted_cr_action { |
59b519ab | 9 | quoted_cr_unset = -1, |
f1aa2994 ĐTCD |
10 | quoted_cr_nowarn, |
11 | quoted_cr_warn, | |
133a4fda | 12 | quoted_cr_strip, |
f1aa2994 ĐTCD |
13 | }; |
14 | ||
c6905e45 JH |
15 | struct mailinfo { |
16 | FILE *input; | |
17 | FILE *output; | |
18 | FILE *patchfile; | |
19 | ||
20 | struct strbuf name; | |
21 | struct strbuf email; | |
22 | int keep_subject; | |
23 | int keep_non_patch_brackets_in_subject; | |
f1aa2994 | 24 | int quoted_cr; /* enum quoted_cr_action */ |
c6905e45 JH |
25 | int add_message_id; |
26 | int use_scissors; | |
27 | int use_inbody_headers; | |
28 | const char *metainfo_charset; | |
29 | ||
30 | struct strbuf *content[MAX_BOUNDARIES]; | |
31 | struct strbuf **content_top; | |
32 | struct strbuf charset; | |
3aa4d81f RS |
33 | unsigned int format_flowed:1; |
34 | unsigned int delsp:1; | |
0b689562 | 35 | unsigned int have_quoted_cr:1; |
c6905e45 JH |
36 | char *message_id; |
37 | enum { | |
38 | TE_DONTCARE, TE_QP, TE_BASE64 | |
39 | } transfer_encoding; | |
40 | int patch_lines; | |
41 | int filter_stage; /* still reading log or are we copying patch? */ | |
42 | int header_stage; /* still checking in-body headers? */ | |
6b4b013f | 43 | struct strbuf inbody_header_accum; |
c6905e45 JH |
44 | struct strbuf **p_hdr_data; |
45 | struct strbuf **s_hdr_data; | |
46 | ||
47 | struct strbuf log_message; | |
6ac617a3 | 48 | int input_error; |
c6905e45 JH |
49 | }; |
50 | ||
f1aa2994 | 51 | int mailinfo_parse_quoted_cr_action(const char *actionstr, int *action); |
55454427 DL |
52 | void setup_mailinfo(struct mailinfo *); |
53 | int mailinfo(struct mailinfo *, const char *msg, const char *patch); | |
54 | void clear_mailinfo(struct mailinfo *); | |
c6905e45 JH |
55 | |
56 | #endif /* MAILINFO_H */ |