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