+const char *
+_notmuch_message_get_subject (notmuch_message_t *message)
+{
+ if (! message->message_file) {
+ notmuch_message_file_t *message_file;
+ const char *filename;
+
+ filename = notmuch_message_get_filename (message);
+ if (unlikely (filename == NULL))
+ return NULL;
+
+ message_file = _notmuch_message_file_open_ctx (message, filename);
+ if (unlikely (message_file == NULL))
+ return NULL;
+
+ message->message_file = message_file;
+ }
+
+ return notmuch_message_file_get_header (message->message_file,
+ "subject");
+}
+