From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
To: Notmuch Mail <notmuch@notmuchmail.org>
Subject: [PATCH v2 03/15] gmime-cleanup: remove GMime 2.6 variant codeblocks
Date: Thu, 2 May 2019 09:19:35 -0400 [thread overview]
Message-ID: <20190502131947.16509-3-dkg@fifthhorseman.net> (raw)
In-Reply-To: <20190502131947.16509-1-dkg@fifthhorseman.net>
signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
---
lib/message-file.c | 42 ---------------------
notmuch-show.c | 21 -----------
| 93 ----------------------------------------------
| 12 ------
4 files changed, 168 deletions(-)
diff --git a/lib/message-file.c b/lib/message-file.c
index 8f0dbbda..ac5545b3 100644
--- a/lib/message-file.c
+++ b/lib/message-file.c
@@ -238,47 +238,6 @@ _extend_header (char *combined, const char *value) {
return combined;
}
-#if (GMIME_MAJOR_VERSION < 3)
-static char *
-_notmuch_message_file_get_combined_header (notmuch_message_file_t *message,
- const char *header)
-{
- GMimeHeaderList *headers;
- GMimeHeaderIter *iter;
- char *combined = NULL;
-
- headers = g_mime_object_get_header_list (GMIME_OBJECT (message->message));
- if (! headers)
- return NULL;
-
- iter = g_mime_header_iter_new ();
- if (! iter)
- return NULL;
-
- if (! g_mime_header_list_get_iter (headers, iter))
- goto DONE;
-
- do {
- const char *value;
- if (strcasecmp (g_mime_header_iter_get_name (iter), header) != 0)
- continue;
-
- /* Note that GMime retains ownership of value... */
- value = g_mime_header_iter_get_value (iter);
-
- combined = _extend_header (combined, value);
- } while (g_mime_header_iter_next (iter));
-
- /* Return empty string for non-existing headers. */
- if (! combined)
- combined = g_strdup ("");
-
- DONE:
- g_mime_header_iter_free (iter);
-
- return combined;
-}
-#else
static char *
_notmuch_message_file_get_combined_header (notmuch_message_file_t *message,
const char *header)
@@ -310,7 +269,6 @@ _notmuch_message_file_get_combined_header (notmuch_message_file_t *message,
return combined;
}
-#endif
const char *
_notmuch_message_file_get_header (notmuch_message_file_t *message,
diff --git a/notmuch-show.c b/notmuch-show.c
index 4ed5ff2b..ad7cf122 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -383,26 +383,6 @@ do_format_signature_errors (sprinter_t *sp, struct key_map_struct *key_map,
sp->end (sp);
}
-#if (GMIME_MAJOR_VERSION < 3)
-static void
-format_signature_errors (sprinter_t *sp, GMimeSignature *signature)
-{
- GMimeSignatureError errors = g_mime_signature_get_errors (signature);
-
- if (errors == GMIME_SIGNATURE_ERROR_NONE)
- return;
-
- struct key_map_struct key_map[] = {
- { GMIME_SIGNATURE_ERROR_EXPSIG, "sig-expired" },
- { GMIME_SIGNATURE_ERROR_NO_PUBKEY, "key-missing"},
- { GMIME_SIGNATURE_ERROR_EXPKEYSIG, "key-expired"},
- { GMIME_SIGNATURE_ERROR_REVKEYSIG, "key-revoked"},
- { GMIME_SIGNATURE_ERROR_UNSUPP_ALGO, "alg-unsupported"},
- };
-
- do_format_signature_errors (sp, key_map, ARRAY_SIZE(key_map), errors);
-}
-#else
static void
format_signature_errors (sprinter_t *sp, GMimeSignature *signature)
{
@@ -425,7 +405,6 @@ format_signature_errors (sprinter_t *sp, GMimeSignature *signature)
do_format_signature_errors (sp, key_map, ARRAY_SIZE(key_map), errors);
}
-#endif
/* Signature status sprinter */
static void
--git a/util/gmime-extra.c b/util/gmime-extra.c
index bc1e3c4d..4b577a5b 100644
--- a/util/gmime-extra.c
+++ b/util/gmime-extra.c
@@ -31,97 +31,6 @@ g_string_talloc_strdup (void *ctx, char *g_string)
return new_str;
}
-#if (GMIME_MAJOR_VERSION < 3)
-
-const char *
-g_mime_certificate_get_valid_userid (GMimeCertificate *cert)
-{
- /* output user id only if validity is FULL or ULTIMATE. */
- /* note that gmime 2.6 is using the term "trust" here, which
- * is WRONG. It's actually user id "validity". */
- const char *name = g_mime_certificate_get_name (cert);
- if (name == NULL)
- return name;
- GMimeCertificateTrust trust = g_mime_certificate_get_trust (cert);
- if (trust == GMIME_CERTIFICATE_TRUST_FULLY || trust == GMIME_CERTIFICATE_TRUST_ULTIMATE)
- return name;
- return NULL;
-}
-
-char *
-g_mime_message_get_address_string (GMimeMessage *message, GMimeRecipientType type)
-{
- InternetAddressList *list = g_mime_message_get_recipients (message, type);
- return internet_address_list_to_string (list, 0);
-}
-
-inline InternetAddressList *
-g_mime_message_get_addresses (GMimeMessage *message, GMimeRecipientType type)
-{
- return g_mime_message_get_recipients (message, type);
-}
-
-char *
-g_mime_message_get_date_string (void *ctx, GMimeMessage *message)
-{
- char *date = g_mime_message_get_date_as_string (message);
- return g_string_talloc_strdup (ctx, date);
-}
-
-InternetAddressList *
-g_mime_message_get_from (GMimeMessage *message)
-{
- return internet_address_list_parse_string (g_mime_message_get_sender (message));
-}
-
-const char *
-g_mime_message_get_from_string (GMimeMessage *message) {
- return g_mime_message_get_sender (message);
-}
-
-InternetAddressList *
-g_mime_message_get_reply_to_list (GMimeMessage *message)
-{
- const char *reply_to;
-
- reply_to = g_mime_message_get_reply_to (message);
- if (reply_to && *reply_to)
- return internet_address_list_parse_string (reply_to);
- else
- return NULL;
-}
-
-/**
- * return talloc allocated reply-to string
- */
-char *
-g_mime_message_get_reply_to_string (void *ctx, GMimeMessage *message)
-{
- return talloc_strdup(ctx, g_mime_message_get_reply_to (message));
-}
-
-gboolean
-g_mime_signature_status_good (GMimeSignatureStatus status) {
- return (status == GMIME_SIGNATURE_STATUS_GOOD);
-}
-
-gboolean
-g_mime_signature_status_bad (GMimeSignatureStatus status) {
- return (status == GMIME_SIGNATURE_STATUS_BAD);
-}
-
-gboolean
-g_mime_signature_status_error (GMimeSignatureError error) {
- return (error != GMIME_SIGNATURE_ERROR_NONE);
-}
-
-gint64
-g_mime_utils_header_decode_date_unix (const char *date) {
- return (gint64) g_mime_utils_header_decode_date (date, NULL);
-}
-
-#else /* GMime >= 3.0 */
-
const char *
g_mime_certificate_get_valid_userid (GMimeCertificate *cert)
{
@@ -223,5 +132,3 @@ g_mime_utils_header_decode_date_unix (const char *date) {
return ret;
}
-
-#endif
--git a/util/gmime-extra.h b/util/gmime-extra.h
index 5d8c52f7..d539ec3a 100644
--- a/util/gmime-extra.h
+++ b/util/gmime-extra.h
@@ -9,17 +9,6 @@ extern "C" {
GMimeStream *g_mime_stream_stdout_new(void);
-#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
-
-#define g_mime_2_6_unref(obj) g_object_unref (obj)
-#define g_mime_3_unused(arg) arg
-#define g_mime_certificate_get_fpr16(cert) g_mime_certificate_get_key_id (cert)
-#else /* GMime >= 3.0 */
-
#define GMIME_ENABLE_RFC_2047_WORKAROUNDS 0xdeadbeef
#define g_mime_content_type_to_string(c) g_mime_content_type_get_mime_type (c)
#define g_mime_filter_crlf_new(encode,dots) g_mime_filter_dos2unix_new (FALSE)
@@ -47,7 +36,6 @@ typedef GMimeSignatureStatus GMimeSignatureError;
#define g_mime_2_6_unref(obj) /*ignore*/
#define g_mime_3_unused(arg) unused(arg)
-#endif
/**
* Get last 16 hex digits of fingerprint ("keyid")
--
2.20.1
next prev parent reply other threads:[~2019-05-02 13:19 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-01 10:46 [PATCH] build: drop support for gmime-2.6 David Bremner
2019-05-01 19:58 ` Tomi Ollila
2019-05-01 20:37 ` David Bremner
2019-05-01 20:14 ` Daniel Kahn Gillmor
2019-05-01 20:35 ` David Bremner
2019-05-01 20:41 ` Rollins, Jameson
2019-05-02 1:07 ` David Bremner
2019-05-02 2:21 ` Rollins, Jameson
2019-05-02 5:16 ` Dropping GMime 2.6 compatibility layer Daniel Kahn Gillmor
2019-05-02 5:16 ` [PATCH 01/16] gmime-cleanup: drop unused gmime 2.6 content_type from _index_encrypted_mime_part Daniel Kahn Gillmor
2019-05-02 9:40 ` David Bremner
2019-05-02 5:16 ` [PATCH 02/16] gmime-cleanup: remove GMime 2.6 variant codeblocks Daniel Kahn Gillmor
2019-05-02 5:16 ` [PATCH 03/16] gmime-cleanup: remove obsolete gpg_path configuration option and crypto contexts Daniel Kahn Gillmor
2019-05-02 9:50 ` David Bremner
2019-05-02 13:01 ` Daniel Kahn Gillmor
2019-05-02 5:16 ` [PATCH 04/16] gmime-cleanup: always support session keys Daniel Kahn Gillmor
2019-05-02 5:16 ` [PATCH 05/16] gmime-cleanup: tests should only care about gmime 3 Daniel Kahn Gillmor
2019-05-02 5:16 ` [PATCH 06/16] gmime-cleanup: simplify T355-smime.sh Daniel Kahn Gillmor
2019-05-02 5:16 ` [PATCH 07/16] gmime-cleanup: drop g_mime_2_6_unref Daniel Kahn Gillmor
2019-05-02 5:16 ` [PATCH 08/16] gmime-cleanup: drop all unused GMimeCryptoContext arguments Daniel Kahn Gillmor
2019-05-02 10:03 ` David Bremner
2019-05-02 5:16 ` [PATCH 09/16] gmime-cleanup: drop unused gmime #defines and simplify g_mime_init () Daniel Kahn Gillmor
2019-05-02 9:24 ` David Bremner
2019-05-02 5:16 ` [PATCH 10/16] gmime-cleanup: use GMime 3.0 data types Daniel Kahn Gillmor
2019-05-02 5:16 ` [PATCH 11/16] gmime-cleanup: use GMime 3.0 function names Daniel Kahn Gillmor
2019-05-02 5:16 ` [PATCH 12/16] gmime-cleanup: pass NULL arguments explicitly where GMime 3.0 expects it Daniel Kahn Gillmor
2019-05-02 10:06 ` David Bremner
2019-05-02 5:16 ` [PATCH 13/16] gmime-cleanup: pass NULL as default GMimeParserOptions Daniel Kahn Gillmor
2019-05-02 5:16 ` [PATCH 14/16] gmime-cleanup: no longer need to use GMime major version during build Daniel Kahn Gillmor
2019-05-02 10:10 ` David Bremner
2019-05-02 13:09 ` Daniel Kahn Gillmor
2019-05-02 5:16 ` [PATCH 15/16] gmime-cleanup: use GMIME_MINVER instead of GMIME3_MINVER Daniel Kahn Gillmor
2019-05-02 5:16 ` [PATCH 16/16] gmime-cleanup: strip remaining references to GMime 2.6 Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 01/15] build: drop support for gmime-2.6 Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 02/15] gmime-cleanup: drop unused gmime 2.6 content_type from _index_encrypted_mime_part Daniel Kahn Gillmor
2019-05-02 13:19 ` Daniel Kahn Gillmor [this message]
2019-05-02 13:19 ` [PATCH v2 04/15] gmime-cleanup: remove obsolete gpg_path configuration option and crypto contexts Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 05/15] gmime-cleanup: always support session keys Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 06/15] gmime-cleanup: tests should only care about gmime 3 Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 07/15] gmime-cleanup: simplify T355-smime.sh Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 08/15] gmime-cleanup: drop g_mime_2_6_unref Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 09/15] gmime-cleanup: drop all arguments unused in GMime 3 Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 10/15] gmime-cleanup: drop unused gmime #defines and simplify g_mime_init () Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 11/15] gmime-cleanup: use GMime 3.0 data types Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 12/15] gmime-cleanup: use GMime 3.0 function names Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 13/15] gmime-cleanup: pass NULL arguments explicitly where GMime 3.0 expects it Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 14/15] gmime-cleanup: pass NULL as default GMimeParserOptions Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 15/15] gmime-cleanup: no longer need to use GMime major version during build Daniel Kahn Gillmor
2019-05-03 10:43 ` [PATCH v2 01/15] build: drop support for gmime-2.6 David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190502131947.16509-3-dkg@fifthhorseman.net \
--to=dkg@fifthhorseman.net \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).