X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=util%2Fgmime-extra.h;h=a42e43e72c01f16824c142b786875089f8630e6b;hb=e9b870b6923afe767a7c9938be24f5390102031a;hp=fef4f4252ed11a7a40445946edeffc81fdf931f0;hpb=32819f74d3ac2eee25cf234d988688cc82ecbc0a;p=notmuch diff --git a/util/gmime-extra.h b/util/gmime-extra.h index fef4f425..a42e43e7 100644 --- a/util/gmime-extra.h +++ b/util/gmime-extra.h @@ -1,30 +1,25 @@ #ifndef _GMIME_EXTRA_H #define _GMIME_EXTRA_H #include - -GMimeStream *g_mime_stream_stdout_new(void); - #include - -#if (GMIME_MAJOR_VERSION < 3) - -#define GMIME_ADDRESS_TYPE_TO GMIME_RECIPIENT_TYPE_TO -#define GMIME_ADDRESS_TYPE_CC GMIME_RECIPIENT_TYPE_CC -#define GMIME_ADDRESS_TYPE_BCC GMIME_RECIPIENT_TYPE_BCC - - -#else /* GMime >= 3.0 */ -typedef GMimeAddressType GMimeRecipientType; +#ifdef __cplusplus +extern "C" { #endif +GMimeStream *g_mime_stream_stdout_new(void); + +/** + * Get last 16 hex digits of fingerprint ("keyid") + */ +const char *g_mime_certificate_get_fpr16 (GMimeCertificate *cert); /** * Return the contents of the appropriate address header as a string * Should be freed using g_free */ -char *g_mime_message_get_address_string (GMimeMessage *message, GMimeRecipientType type); +char *g_mime_message_get_address_string (GMimeMessage *message, GMimeAddressType type); -InternetAddressList * g_mime_message_get_addresses (GMimeMessage *message, GMimeRecipientType type); +InternetAddressList * g_mime_message_get_addresses (GMimeMessage *message, GMimeAddressType type); /** * return talloc allocated date string @@ -38,6 +33,7 @@ char *g_mime_message_get_date_string (void *ctx, GMimeMessage *message); InternetAddressList * g_mime_message_get_from (GMimeMessage *message); + /** * return string for From: address * (owned by gmime) @@ -50,4 +46,24 @@ InternetAddressList * g_mime_message_get_reply_to_list (GMimeMessage *message); * return talloc allocated reply-to string */ char * g_mime_message_get_reply_to_string (void *ctx, GMimeMessage *message); + +void g_mime_parser_set_scan_from (GMimeParser *parser, gboolean flag); + +gboolean g_mime_signature_status_good (GMimeSignatureStatus status); + +gboolean g_mime_signature_status_bad (GMimeSignatureStatus status); + +gboolean g_mime_signature_status_error (GMimeSignatureStatus status); + +gint64 g_mime_utils_header_decode_date_unix (const char *date); + +/** + * Return string for valid User ID (or NULL if no valid User ID exists) + */ +const char * g_mime_certificate_get_valid_userid (GMimeCertificate *cert); + +#ifdef __cplusplus +} +#endif + #endif