3 #include <gmime/gmime.h>
5 GMimeStream *g_mime_stream_stdout_new(void);
10 #if (GMIME_MAJOR_VERSION < 3)
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
16 #define g_mime_2_6_unref(obj) g_object_unref (obj)
17 #define g_mime_3_unused(arg) arg
18 #define g_mime_certificate_get_fpr16(cert) g_mime_certificate_get_key_id (cert)
19 #else /* GMime >= 3.0 */
21 #define GMIME_ENABLE_RFC_2047_WORKAROUNDS 0xdeadbeef
22 #define g_mime_content_type_to_string(c) g_mime_content_type_get_mime_type (c)
23 #define g_mime_filter_crlf_new(encode,dots) g_mime_filter_dos2unix_new (FALSE)
24 #define g_mime_gpg_context_new(func,path) g_mime_gpg_context_new ()
25 #define g_mime_gpg_context_set_use_agent(ctx,val) /*ignore*/
26 #define g_mime_gpg_context_set_always_trust(ctx,val) /*ignore*/
27 #define g_mime_init(flags) g_mime_init()
28 #define g_mime_message_add_recipient(m,t,n,a) g_mime_message_add_mailbox (m,t,n,a)
29 #define g_mime_message_set_subject(m,s) g_mime_message_set_subject(m,s,NULL)
30 #define g_mime_multipart_signed_verify(mps,ctx,err) g_mime_multipart_signed_verify(mps, GMIME_ENCRYPT_NONE, err)
31 #define g_mime_object_write_to_stream(o,s) g_mime_object_write_to_stream (o,NULL,s)
32 #define g_mime_object_set_header(o,h,v) g_mime_object_set_header (o,h,v,NULL)
33 #define g_mime_parser_construct_message(p) g_mime_parser_construct_message (p, g_mime_parser_options_get_default ())
34 #define g_mime_part_get_content_object(p) g_mime_part_get_content (p)
35 #define g_mime_pkcs7_context_new(arg) g_mime_pkcs7_context_new()
36 #define g_mime_pkcs7_context_set_always_trust(ctx,val) /*ignore*/
37 #define g_mime_signature_get_errors(sig) g_mime_signature_get_status (sig)
38 #define g_mime_utils_header_decode_text(txt) g_mime_utils_header_decode_text (NULL, txt)
39 #define internet_address_to_string(ia,encode) internet_address_to_string (ia,NULL,encode)
40 #define internet_address_list_parse_string(str) internet_address_list_parse (NULL,str)
42 typedef GMimeAddressType GMimeRecipientType;
44 typedef GMimeSignatureStatus GMimeSignatureError;
46 #define g_mime_2_6_unref(obj) /*ignore*/
47 #define g_mime_3_unused(arg) unused(arg)
51 * Get last 16 hex digits of fingerprint ("keyid")
53 const char *g_mime_certificate_get_fpr16 (GMimeCertificate *cert);
55 * Return the contents of the appropriate address header as a string
56 * Should be freed using g_free
58 char *g_mime_message_get_address_string (GMimeMessage *message, GMimeRecipientType type);
60 InternetAddressList * g_mime_message_get_addresses (GMimeMessage *message, GMimeRecipientType type);
63 * return talloc allocated date string
66 char *g_mime_message_get_date_string (void *ctx, GMimeMessage *message);
69 * glib allocated list of From: addresses
72 InternetAddressList * g_mime_message_get_from (GMimeMessage *message);
76 * return string for From: address
79 const char * g_mime_message_get_from_string (GMimeMessage *message);
81 InternetAddressList * g_mime_message_get_reply_to_list (GMimeMessage *message);
84 * return talloc allocated reply-to string
86 char * g_mime_message_get_reply_to_string (void *ctx, GMimeMessage *message);
88 void g_mime_parser_set_scan_from (GMimeParser *parser, gboolean flag);
90 gboolean g_mime_signature_status_good (GMimeSignatureStatus status);
92 gboolean g_mime_signature_status_bad (GMimeSignatureStatus status);
94 gboolean g_mime_signature_status_error (GMimeSignatureError status);
96 gint64 g_mime_utils_header_decode_date_unix (const char *date);
99 * Return string for valid User ID (or NULL if no valid User ID exists)
101 const char * g_mime_certificate_get_valid_userid (GMimeCertificate *cert);