[gmime: 12/21] Made g_mime_header_get_raw_[name,value] public



commit 6d0d6fc7e42e1ad2f04ac347d6da034ad9b15d1b
Author: Jeffrey Stedfast <jestedfa microsoft com>
Date:   Sat Mar 25 09:40:07 2017 -0400

    Made g_mime_header_get_raw_[name,value] public

 gmime/gmime-header.c          |   16 ++++++++++------
 gmime/gmime-header.h          |    3 +++
 gmime/gmime-internal.h        |    2 --
 gmime/gmime-message-partial.c |    4 ++--
 4 files changed, 15 insertions(+), 10 deletions(-)
---
diff --git a/gmime/gmime-header.c b/gmime/gmime-header.c
index 3e0b347..d31adae 100644
--- a/gmime/gmime-header.c
+++ b/gmime/gmime-header.c
@@ -207,14 +207,18 @@ g_mime_header_set_value (GMimeHeader *header, const char *value)
  * g_mime_header_get_raw_name:
  * @header: a #GMimeHeader
  *
- * Gets the header's raw name.
+ * Gets the header's raw name. The raw header name is the complete string up to
+ * (but not including) the ':' separating the header's name from its value. This
+ * string may be different from the value returned by g_mime_header_get_name()
+ * if the parsed message's header contained trailing whitespace after the header
+ * name, such as: "Subject : this is the subject\r\n".
  *
- * Returns: the header name.
+ * Returns: the raw header name.
  **/
 const char *
-_g_mime_header_get_raw_name (GMimeHeader *header)
+g_mime_header_get_raw_name (GMimeHeader *header)
 {
-       //g_return_val_if_fail (GMIME_IS_HEADER (header), NULL);
+       g_return_val_if_fail (GMIME_IS_HEADER (header), NULL);
        
        return header->raw_name;
 }
@@ -229,9 +233,9 @@ _g_mime_header_get_raw_name (GMimeHeader *header)
  * Returns: the header value or %NULL if invalid.
  **/
 const char *
-_g_mime_header_get_raw_value (GMimeHeader *header)
+g_mime_header_get_raw_value (GMimeHeader *header)
 {
-       //g_return_val_if_fail (GMIME_IS_HEADER (header), NULL);
+       g_return_val_if_fail (GMIME_IS_HEADER (header), NULL);
        
        return header->raw_value;
 }
diff --git a/gmime/gmime-header.h b/gmime/gmime-header.h
index 26e45e6..0a01596 100644
--- a/gmime/gmime-header.h
+++ b/gmime/gmime-header.h
@@ -95,10 +95,13 @@ struct _GMimeHeaderClass {
 GType g_mime_header_get_type (void);
 
 const char *g_mime_header_get_name (GMimeHeader *header);
+const char *g_mime_header_get_raw_name (GMimeHeader *header);
 
 const char *g_mime_header_get_value (GMimeHeader *header);
 void g_mime_header_set_value (GMimeHeader *header, const char *value);
 
+const char *g_mime_header_get_raw_value (GMimeHeader *header);
+
 gint64 g_mime_header_get_offset (GMimeHeader *header);
 
 ssize_t g_mime_header_write_to_stream (GMimeHeaderList *headers, GMimeHeader *header,
diff --git a/gmime/gmime-internal.h b/gmime/gmime-internal.h
index 67f7a19..031687e 100644
--- a/gmime/gmime-internal.h
+++ b/gmime/gmime-internal.h
@@ -53,8 +53,6 @@ G_GNUC_INTERNAL void g_mime_parser_options_shutdown (void);
 G_GNUC_INTERNAL GMimeParserOptions *_g_mime_parser_options_clone (GMimeParserOptions *options);
 
 /* GMimeHeader */
-G_GNUC_INTERNAL const char *_g_mime_header_get_raw_name (GMimeHeader *header);
-G_GNUC_INTERNAL const char *_g_mime_header_get_raw_value (GMimeHeader *header);
 G_GNUC_INTERNAL void _g_mime_header_set_raw_value (GMimeHeader *header, const char *raw_value);
 G_GNUC_INTERNAL void _g_mime_header_set_offset (GMimeHeader *header, gint64 offset);
 
diff --git a/gmime/gmime-message-partial.c b/gmime/gmime-message-partial.c
index 703a971..62a94ab 100644
--- a/gmime/gmime-message-partial.c
+++ b/gmime/gmime-message-partial.c
@@ -336,8 +336,8 @@ message_partial_message_new (GMimeMessage *base)
        
        for (i = 0; i < count; i++) {
                header = g_mime_header_list_get_header_at (headers, i);
-               raw_value = _g_mime_header_get_raw_value (header);
-               raw_name = _g_mime_header_get_raw_name (header);
+               raw_value = g_mime_header_get_raw_value (header);
+               raw_name = g_mime_header_get_raw_name (header);
                offset = g_mime_header_get_offset (header);
                value = g_mime_header_get_value (header);
                name = g_mime_header_get_name (header);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]