[PATCH v3 3/8] lib: make notmuch_message_get_database() take a const notmuch_message_t*

Daniel Kahn Gillmor dkg at fifthhorseman.net
Thu May 10 23:57:54 PDT 2018


This is technically an API change, but it is not an ABI change, and
it's merely a statement that limits what the library can do.

This is in parallel to notmuch_query_get_database(), which also takes
a const pointer.
---
 lib/message.cc | 2 +-
 lib/notmuch.h  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/message.cc b/lib/message.cc
index a7e8c3ca..153e4bed 100644
--- a/lib/message.cc
+++ b/lib/message.cc
@@ -1925,7 +1925,7 @@ notmuch_message_destroy (notmuch_message_t *message)
 }
 
 notmuch_database_t *
-notmuch_message_get_database (notmuch_message_t *message)
+notmuch_message_get_database (const notmuch_message_t *message)
 {
     return message->notmuch;
 }
diff --git a/lib/notmuch.h b/lib/notmuch.h
index df8f534a..c2a1912c 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -1351,7 +1351,7 @@ notmuch_messages_collect_tags (notmuch_messages_t *messages);
  * @since libnotmuch 5.2 (notmuch 0.27)
  */
 notmuch_database_t *
-notmuch_message_get_database (notmuch_message_t *message);
+notmuch_message_get_database (const notmuch_message_t *message);
 
 /**
  * Get the message ID of 'message'.
-- 
2.17.0



More information about the notmuch mailing list