cli: replace use of g_mime_message_get_recipients
[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
17 #else /* GMime >= 3.0 */
18 typedef GMimeAddressType GMimeRecipientType;
19 #endif
20
21 /**
22  * Return the contents of the appropriate address header as a string
23  * Should be freed using g_free
24  */
25 char *g_mime_message_get_address_string (GMimeMessage *message, GMimeRecipientType type);
26
27 InternetAddressList * g_mime_message_get_addresses (GMimeMessage *message, GMimeRecipientType type);
28
29 /**
30  * return talloc allocated date string
31  */
32
33 char *g_mime_message_get_date_string (void *ctx, GMimeMessage *message);
34
35 /**
36  * glib allocated list of From: addresses
37  */
38
39 InternetAddressList * g_mime_message_get_from (GMimeMessage *message);
40
41 /**
42  * return string for From: address
43  * (owned by gmime)
44  */
45 const char * g_mime_message_get_from_string (GMimeMessage *message);
46
47 InternetAddressList * g_mime_message_get_reply_to_list (GMimeMessage *message);
48
49 /**
50  * return talloc allocated reply-to string
51  */
52 char * g_mime_message_get_reply_to_string (void *ctx, GMimeMessage *message);
53 #endif