]> git.notmuchmail.org Git - notmuch/blob - util/gmime-extra.h
gmime-cleanup: drop unused gmime #defines and simplify g_mime_init ()
[notmuch] / util / gmime-extra.h
1 #ifndef _GMIME_EXTRA_H
2 #define _GMIME_EXTRA_H
3 #include <gmime/gmime.h>
4 #include <talloc.h>
5
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9
10 GMimeStream *g_mime_stream_stdout_new(void);
11
12 #define g_mime_content_type_to_string(c) g_mime_content_type_get_mime_type (c)
13 #define g_mime_filter_crlf_new(encode,dots) g_mime_filter_dos2unix_new (FALSE)
14 #define g_mime_message_add_recipient(m,t,n,a) g_mime_message_add_mailbox (m,t,n,a)
15 #define g_mime_message_set_subject(m,s) g_mime_message_set_subject(m,s,NULL)
16 #define g_mime_multipart_signed_verify(mps,ctx,err) g_mime_multipart_signed_verify(mps, GMIME_ENCRYPT_NONE, err)
17 #define g_mime_object_write_to_stream(o,s) g_mime_object_write_to_stream (o,NULL,s)
18 #define g_mime_object_set_header(o,h,v) g_mime_object_set_header (o,h,v,NULL)
19 #define g_mime_parser_construct_message(p) g_mime_parser_construct_message (p, g_mime_parser_options_get_default ())
20 #define g_mime_part_get_content_object(p) g_mime_part_get_content (p)
21 #define g_mime_signature_get_errors(sig) g_mime_signature_get_status (sig)
22 #define g_mime_utils_header_decode_text(txt) g_mime_utils_header_decode_text (NULL, txt)
23 #define internet_address_to_string(ia,encode) internet_address_to_string (ia,NULL,encode)
24 #define internet_address_list_parse_string(str) internet_address_list_parse (NULL,str)
25
26 typedef GMimeAddressType GMimeRecipientType;
27
28 typedef GMimeSignatureStatus GMimeSignatureError;
29
30 /**
31  * Get last 16 hex digits of fingerprint ("keyid")
32  */
33 const char *g_mime_certificate_get_fpr16 (GMimeCertificate *cert);
34 /**
35  * Return the contents of the appropriate address header as a string
36  * Should be freed using g_free
37  */
38 char *g_mime_message_get_address_string (GMimeMessage *message, GMimeRecipientType type);
39
40 InternetAddressList * g_mime_message_get_addresses (GMimeMessage *message, GMimeRecipientType type);
41
42 /**
43  * return talloc allocated date string
44  */
45
46 char *g_mime_message_get_date_string (void *ctx, GMimeMessage *message);
47
48 /**
49  * glib allocated list of From: addresses
50  */
51
52 InternetAddressList * g_mime_message_get_from (GMimeMessage *message);
53
54
55 /**
56  * return string for From: address
57  * (owned by gmime)
58  */
59 const char * g_mime_message_get_from_string (GMimeMessage *message);
60
61 InternetAddressList * g_mime_message_get_reply_to_list (GMimeMessage *message);
62
63 /**
64  * return talloc allocated reply-to string
65  */
66 char * g_mime_message_get_reply_to_string (void *ctx, GMimeMessage *message);
67
68 void g_mime_parser_set_scan_from (GMimeParser *parser, gboolean flag);
69
70 gboolean g_mime_signature_status_good (GMimeSignatureStatus status);
71
72 gboolean g_mime_signature_status_bad (GMimeSignatureStatus status);
73
74 gboolean g_mime_signature_status_error (GMimeSignatureError status);
75
76 gint64 g_mime_utils_header_decode_date_unix (const char *date);
77
78 /**
79  * Return string for valid User ID (or NULL if no valid User ID exists)
80  */
81 const char * g_mime_certificate_get_valid_userid (GMimeCertificate *cert);
82
83 #ifdef __cplusplus
84 }
85 #endif
86
87 #endif