Sync with 'maint'
[git/gitster.git] / mailinfo.h
blobf2ffd0349e8007256f5b2118d41faf35a53edf0d
1 #ifndef MAILINFO_H
2 #define MAILINFO_H
4 #include "strbuf.h"
6 #define MAX_BOUNDARIES 5
8 enum quoted_cr_action {
9 quoted_cr_unset = -1,
10 quoted_cr_nowarn,
11 quoted_cr_warn,
12 quoted_cr_strip,
15 struct mailinfo {
16 FILE *input;
17 FILE *output;
18 FILE *patchfile;
20 struct strbuf name;
21 struct strbuf email;
22 int keep_subject;
23 int keep_non_patch_brackets_in_subject;
24 int quoted_cr; /* enum quoted_cr_action */
25 int add_message_id;
26 int use_scissors;
27 int use_inbody_headers;
28 const char *metainfo_charset;
30 struct strbuf *content[MAX_BOUNDARIES];
31 struct strbuf **content_top;
32 struct strbuf charset;
33 unsigned int format_flowed:1;
34 unsigned int delsp:1;
35 unsigned int have_quoted_cr:1;
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? */
43 struct strbuf inbody_header_accum;
44 struct strbuf **p_hdr_data;
45 struct strbuf **s_hdr_data;
47 struct strbuf log_message;
48 int input_error;
51 int mailinfo_parse_quoted_cr_action(const char *actionstr, int *action);
52 void setup_mailinfo(struct mailinfo *);
53 int mailinfo(struct mailinfo *, const char *msg, const char *patch);
54 void clear_mailinfo(struct mailinfo *);
56 #endif /* MAILINFO_H */