cli: hide rename of GMimeCertificateTrust
[notmuch] / util / gmime-extra.h
1 #ifndef _GMIME_EXTRA_H
2 #define _GMIME_EXTRA_H
3 #include <gmime/gmime.h>
4
5 GMimeStream *g_mime_stream_stdout_new(void);
6
7 #include <talloc.h>
8
9
10 #if (GMIME_MAJOR_VERSION < 3)
11
12 #define GMIME_ADDRESS_TYPE_TO GMIME_RECIPIENT_TYPE_TO
13 #define GMIME_ADDRESS_TYPE_CC GMIME_RECIPIENT_TYPE_CC
14 #define GMIME_ADDRESS_TYPE_BCC GMIME_RECIPIENT_TYPE_BCC
15
16 #else /* GMime >= 3.0 */
17 typedef GMimeAddressType GMimeRecipientType;
18
19 #define GMIME_ENABLE_RFC_2047_WORKAROUNDS 0xdeadbeef
20 #define g_mime_content_type_to_string(c) g_mime_content_type_get_mime_type (c)
21 #define g_mime_filter_crlf_new(encode,dots) g_mime_filter_dos2unix_new (FALSE)
22 #define g_mime_gpg_context_new(func,path) g_mime_gpg_context_new ()
23 #define g_mime_gpg_context_set_use_agent(ctx,val) /*ignore*/
24 #define g_mime_gpg_context_set_always_trust(ctx,val) /*ignore*/
25 #define g_mime_init(flags) g_mime_init()
26 #define g_mime_message_add_recipient(m,t,n,a) g_mime_message_add_mailbox (m,t,n,a)
27 #define g_mime_message_set_subject(m,s) g_mime_message_set_subject(m,s,NULL)
28 #define g_mime_multipart_encrypted_decrypt(mpe,ctx,out,err) g_mime_multipart_encrypted_decrypt(mpe, 0, NULL, out, err)
29 #define g_mime_multipart_signed_verify(mps,ctx,err) g_mime_multipart_signed_verify(mps, 0, err)
30 #define g_mime_object_write_to_stream(o,s) g_mime_object_write_to_stream (o,NULL,s)
31 #define g_mime_object_set_header(o,h,v) g_mime_object_set_header (o,h,v,NULL)
32 #define g_mime_parser_construct_message(p) g_mime_parser_construct_message (p, g_mime_parser_options_get_default ())
33 #define g_mime_part_get_content_object(p) g_mime_part_get_content (p)
34 #define g_mime_pkcs7_context_new(arg) g_mime_pkcs7_context_new()
35 #define g_mime_pkcs7_context_set_always_trust(ctx,val) /*ignore*/
36 #define g_mime_signature_get_errors(sig) g_mime_signature_get_status (sig)
37 #define g_mime_utils_header_decode_text(txt) g_mime_utils_header_decode_text (NULL, txt)
38 #define internet_address_to_string(ia,encode) internet_address_to_string (ia,NULL,encode)
39 #define internet_address_list_parse_string(str) internet_address_list_parse (NULL,str)
40
41 typedef GMimeAddressType GMimeRecipientType;
42
43 typedef GMimeSignatureStatus GMimeSignatureError;
44
45 typedef GMimeTrust GMimeCertificateTrust;
46
47 #define GMIME_CERTIFICATE_TRUST_UNKNOWN GMIME_TRUST_UNKNOWN
48 #define GMIME_CERTIFICATE_TRUST_UNDEFINED GMIME_TRUST_UNDEFINED
49 #define GMIME_CERTIFICATE_TRUST_NEVER GMIME_TRUST_NEVER
50 #define GMIME_CERTIFICATE_TRUST_MARGINAL GMIME_TRUST_MARGINAL
51 #define GMIME_CERTIFICATE_TRUST_FULLY GMIME_TRUST_FULL
52 #define GMIME_CERTIFICATE_TRUST_ULTIMATE GMIME_TRUST_ULTIMATE
53
54 #endif
55
56 /**
57  * Return the contents of the appropriate address header as a string
58  * Should be freed using g_free
59  */
60 char *g_mime_message_get_address_string (GMimeMessage *message, GMimeRecipientType type);
61
62 InternetAddressList * g_mime_message_get_addresses (GMimeMessage *message, GMimeRecipientType type);
63
64 /**
65  * return talloc allocated date string
66  */
67
68 char *g_mime_message_get_date_string (void *ctx, GMimeMessage *message);
69
70 /**
71  * glib allocated list of From: addresses
72  */
73
74 InternetAddressList * g_mime_message_get_from (GMimeMessage *message);
75
76
77 /**
78  * return string for From: address
79  * (owned by gmime)
80  */
81 const char * g_mime_message_get_from_string (GMimeMessage *message);
82
83 InternetAddressList * g_mime_message_get_reply_to_list (GMimeMessage *message);
84
85 /**
86  * return talloc allocated reply-to string
87  */
88 char * g_mime_message_get_reply_to_string (void *ctx, GMimeMessage *message);
89
90 void g_mime_parser_set_scan_from (GMimeParser *parser, gboolean flag);
91
92 gboolean g_mime_signature_status_good (GMimeSignatureStatus status);
93
94 gboolean g_mime_signature_status_bad (GMimeSignatureStatus status);
95
96 gboolean g_mime_signature_status_error (GMimeSignatureError status);
97 #endif