]> git.notmuchmail.org Git - notmuch/blob - util/gmime-extra.h
gmime-cleanup: use GMime 3.0 function names
[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_message_set_subject(m,s) g_mime_message_set_subject(m,s,NULL)
13 #define g_mime_multipart_signed_verify(mps,ctx,err) g_mime_multipart_signed_verify(mps, GMIME_ENCRYPT_NONE, err)
14 #define g_mime_object_write_to_stream(o,s) g_mime_object_write_to_stream (o,NULL,s)
15 #define g_mime_object_set_header(o,h,v) g_mime_object_set_header (o,h,v,NULL)
16 #define g_mime_parser_construct_message(p) g_mime_parser_construct_message (p, g_mime_parser_options_get_default ())
17 #define g_mime_utils_header_decode_text(txt) g_mime_utils_header_decode_text (NULL, txt)
18 #define internet_address_to_string(ia,encode) internet_address_to_string (ia,NULL,encode)
19 #define internet_address_list_parse_string(str) internet_address_list_parse (NULL,str)
20
21 /**
22  * Get last 16 hex digits of fingerprint ("keyid")
23  */
24 const char *g_mime_certificate_get_fpr16 (GMimeCertificate *cert);
25 /**
26  * Return the contents of the appropriate address header as a string
27  * Should be freed using g_free
28  */
29 char *g_mime_message_get_address_string (GMimeMessage *message, GMimeAddressType type);
30
31 InternetAddressList * g_mime_message_get_addresses (GMimeMessage *message, GMimeAddressType type);
32
33 /**
34  * return talloc allocated date string
35  */
36
37 char *g_mime_message_get_date_string (void *ctx, GMimeMessage *message);
38
39 /**
40  * glib allocated list of From: addresses
41  */
42
43 InternetAddressList * g_mime_message_get_from (GMimeMessage *message);
44
45
46 /**
47  * return string for From: address
48  * (owned by gmime)
49  */
50 const char * g_mime_message_get_from_string (GMimeMessage *message);
51
52 InternetAddressList * g_mime_message_get_reply_to_list (GMimeMessage *message);
53
54 /**
55  * return talloc allocated reply-to string
56  */
57 char * g_mime_message_get_reply_to_string (void *ctx, GMimeMessage *message);
58
59 void g_mime_parser_set_scan_from (GMimeParser *parser, gboolean flag);
60
61 gboolean g_mime_signature_status_good (GMimeSignatureStatus status);
62
63 gboolean g_mime_signature_status_bad (GMimeSignatureStatus status);
64
65 gboolean g_mime_signature_status_error (GMimeSignatureStatus status);
66
67 gint64 g_mime_utils_header_decode_date_unix (const char *date);
68
69 /**
70  * Return string for valid User ID (or NULL if no valid User ID exists)
71  */
72 const char * g_mime_certificate_get_valid_userid (GMimeCertificate *cert);
73
74 #ifdef __cplusplus
75 }
76 #endif
77
78 #endif