From dac7e1d4b15af5a7fa6cce3112bc08eb8e8f02e6 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Mon, 2 Nov 2009 16:08:24 -0800 Subject: Remove notmuch_message_get_header_size and notmuch_message_get_all_headers The notmuch.c main program now uses GMime directly rather than using these functions, and I'd rather not export any functions unless we have good evidence that the functions are necessary. --- message-file.c | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'message-file.c') diff --git a/message-file.c b/message-file.c index 0cb85d8..75caba6 100644 --- a/message-file.c +++ b/message-file.c @@ -350,40 +350,3 @@ notmuch_message_file_get_header (notmuch_message_file_t *message, return NULL; } - -size_t -notmuch_message_file_get_header_size (notmuch_message_file_t *message) -{ - if (! message->parsing_finished) - notmuch_message_file_get_header (message, NULL); - - if (! message->parsing_finished) - INTERNAL_ERROR ("Parsing for NULL header did not force parsing to finish.\n"); - - return message->header_size; -} - -const char * -notmuch_message_file_get_all_headers (notmuch_message_file_t *message) -{ - char *headers = NULL; - size_t header_size = notmuch_message_file_get_header_size (message); - - if (header_size == 0) - return ""; - - headers = talloc_size (message, header_size + 1); - if (unlikely (headers == NULL)) - return NULL; - - rewind (message->file); - if (fread (headers, 1, header_size, message->file) != header_size) { - fprintf (stderr, "Error: Short read occurred trying to read message header.\n"); - talloc_free (headers); - return NULL; - } - - headers[header_size] = '\0'; - - return headers; -} -- cgit v1.2.3