mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 02:48:08 +01:00
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.
This commit is contained in:
parent
ab2d904e06
commit
dac7e1d4b1
4 changed files with 0 additions and 100 deletions
|
@ -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;
|
||||
}
|
||||
|
|
21
message.cc
21
message.cc
|
@ -259,27 +259,6 @@ notmuch_message_get_header (notmuch_message_t *message, const char *header)
|
|||
return notmuch_message_file_get_header (message->message_file, header);
|
||||
}
|
||||
|
||||
const char *
|
||||
notmuch_message_get_all_headers (notmuch_message_t *message)
|
||||
{
|
||||
_notmuch_message_ensure_message_file (message);
|
||||
if (message->message_file == NULL)
|
||||
return NULL;
|
||||
|
||||
return notmuch_message_file_get_all_headers (message->message_file);
|
||||
}
|
||||
|
||||
size_t
|
||||
notmuch_message_get_header_size (notmuch_message_t *message)
|
||||
{
|
||||
_notmuch_message_ensure_message_file (message);
|
||||
if (message->message_file == NULL)
|
||||
return 0;
|
||||
|
||||
return notmuch_message_file_get_header_size (message->message_file);
|
||||
|
||||
}
|
||||
|
||||
const char *
|
||||
notmuch_message_get_thread_id (notmuch_message_t *message)
|
||||
{
|
||||
|
|
|
@ -278,24 +278,6 @@ const char *
|
|||
notmuch_message_file_get_header (notmuch_message_file_t *message,
|
||||
const char *header);
|
||||
|
||||
/* Get the entire set of headers from an email message as a string.
|
||||
*
|
||||
* The returned value is owned by the notmuch message and is valid
|
||||
* only until the message is closed. The caller should copy it if
|
||||
* needing to modify the value or to hold onto it for longer.
|
||||
*
|
||||
* Returns NULL in the case of any error.
|
||||
*/
|
||||
const char *
|
||||
notmuch_message_file_get_all_headers (notmuch_message_file_t *message);
|
||||
|
||||
/* Get the size in bytes of the full header section of 'message'.
|
||||
*
|
||||
* Returns 0 in the case of any error.
|
||||
*/
|
||||
size_t
|
||||
notmuch_message_file_get_header_size (notmuch_message_file_t *message);
|
||||
|
||||
/* date.c */
|
||||
|
||||
/* Parse an RFC 8222 date string to a time_t value.
|
||||
|
|
24
notmuch.h
24
notmuch.h
|
@ -632,16 +632,6 @@ notmuch_message_get_filename (notmuch_message_t *message);
|
|||
time_t
|
||||
notmuch_message_get_date (notmuch_message_t *message);
|
||||
|
||||
/* Get the size in bytes of the full header section of 'message'.
|
||||
*
|
||||
* This is useful in conjunction with notmuch_message_get_filename
|
||||
* for separately parsing the message header and content.
|
||||
*
|
||||
* Returns 0 in the case of any error.
|
||||
*/
|
||||
size_t
|
||||
notmuch_message_get_header_size (notmuch_message_t *message);
|
||||
|
||||
/* Get the value of the specified header from 'message'.
|
||||
*
|
||||
* The value will be read from the actual message file, not from the
|
||||
|
@ -657,20 +647,6 @@ notmuch_message_get_header_size (notmuch_message_t *message);
|
|||
const char *
|
||||
notmuch_message_get_header (notmuch_message_t *message, const char *header);
|
||||
|
||||
/* Get the entire set of headers from an email message as a string.
|
||||
*
|
||||
* The value will be read from the actual message file, not from the
|
||||
* notmuch database.
|
||||
*
|
||||
* The returned value is owned by the notmuch message and is valid
|
||||
* only until the message is closed. The caller should copy it if
|
||||
* needing to modify the value or to hold onto it for longer.
|
||||
*
|
||||
* Returns NULL in the case of any error.
|
||||
*/
|
||||
const char *
|
||||
notmuch_message_get_all_headers (notmuch_message_t *message);
|
||||
|
||||
/* Get the tags for 'message', returning a notmuch_tags_t object which
|
||||
* can be used to iterate over all tags.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue