[gmime/gmime-2-4] added back header raw functions and updated docs



commit 75b1c8253ae2f8c52b114d7cc525fe716ae57544
Author: Jeffrey Stedfast <fejj gnome org>
Date:   Sat Apr 25 13:08:44 2009 -0400

    added back header raw functions and updated docs
    
    2009-04-25  Jeffrey Stedfast  <fejj novell com>
    
    	* gmime/gmime-header.c (g_mime_header_list_set_raw): Added back
    	just in case someone was foolish enough to use this API.
    	(g_mime_header_list_has_raw): Same.
---
 ChangeLog                         |    6 ++++
 docs/reference/gmime-sections.txt |    2 +
 gmime/gmime-header.c              |   48 +++++++++++++++++++++++++++++++++++++
 gmime/gmime-header.h              |    6 ++++
 4 files changed, 62 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b3eedff..b8b9ac9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-04-25  Jeffrey Stedfast  <fejj novell com>
+
+	* gmime/gmime-header.c (g_mime_header_list_set_raw): Added back
+	just in case someone was foolish enough to use this API.
+	(g_mime_header_list_has_raw): Same.
+
 2009-04-24  Jeffrey Stedfast  <fejj novell com>
 
 	* gmime/gmime-parser.c (struct _GMimeParserPrivate): Added
diff --git a/docs/reference/gmime-sections.txt b/docs/reference/gmime-sections.txt
index 137f7e7..0d5ebe5 100644
--- a/docs/reference/gmime-sections.txt
+++ b/docs/reference/gmime-sections.txt
@@ -602,6 +602,8 @@ g_mime_header_list_foreach
 g_mime_header_list_register_writer
 g_mime_header_list_write_to_stream
 g_mime_header_list_to_string
+g_mime_header_list_get_stream
+g_mime_header_list_set_stream
 g_mime_header_list_has_raw
 g_mime_header_list_set_raw
 </SECTION>
diff --git a/gmime/gmime-header.c b/gmime/gmime-header.c
index 23e5014..787ff3f 100644
--- a/gmime/gmime-header.c
+++ b/gmime/gmime-header.c
@@ -947,6 +947,8 @@ g_mime_header_list_register_writer (GMimeHeaderList *headers, const char *name,
  * @stream: a #GMimeStream
  *
  * Set the raw header stream.
+ *
+ * Since: 2.4.7
  **/
 void
 g_mime_header_list_set_stream (GMimeHeaderList *headers, GMimeStream *stream)
@@ -971,6 +973,8 @@ g_mime_header_list_set_stream (GMimeHeaderList *headers, GMimeStream *stream)
  * Gets the raw stream representing @headers.
  *
  * Returns: a #GMimeStream if set or %NULL otherwise.
+ *
+ * Since: 2.4.7
  **/
 GMimeStream *
 g_mime_header_list_get_stream (GMimeHeaderList *headers)
@@ -979,3 +983,47 @@ g_mime_header_list_get_stream (GMimeHeaderList *headers)
 	
 	return headers->stream;
 }
+
+
+/**
+ * g_mime_header_list_set_raw:
+ * @headers: a #GMimeHeaderList
+ * @raw: raw mime part header
+ *
+ * Set the raw header.
+ *
+ * Deprecated:2.4.7: Use g_mime_header_list_set_stream() instead.
+ **/
+void
+g_mime_header_list_set_raw (GMimeHeaderList *headers, const char *raw)
+{
+	g_return_if_fail (headers != NULL);
+	
+	if (headers->stream)
+		g_object_unref (headers->stream);
+	
+	if (raw)
+		headers->stream = g_mime_stream_mem_new_with_buffer (raw, strlen (raw));
+	else
+		headers->stream = NULL;
+}
+
+
+/**
+ * g_mime_header_list_has_raw:
+ * @headers: a #GMimeHeaderList
+ *
+ * Gets whether or not a raw header has been set on @headers.
+ *
+ * Returns: %TRUE if a raw header is set or %FALSE otherwise.
+ *
+ * Deprecated:2.4.7: Use g_mime_header_list_get_stream() and check
+ * against NULL instead.
+ **/
+gboolean
+g_mime_header_list_has_raw (const GMimeHeaderList *headers)
+{
+	g_return_val_if_fail (headers != NULL, FALSE);
+	
+	return headers->stream ? TRUE : FALSE;
+}
diff --git a/gmime/gmime-header.h b/gmime/gmime-header.h
index 1b8fad7..56ec48d 100644
--- a/gmime/gmime-header.h
+++ b/gmime/gmime-header.h
@@ -126,6 +126,12 @@ void g_mime_header_list_register_writer (GMimeHeaderList *headers, const char *n
 ssize_t g_mime_header_list_write_to_stream (const GMimeHeaderList *headers, GMimeStream *stream);
 char *g_mime_header_list_to_string (const GMimeHeaderList *headers);
 
+#ifndef GMIME_DISABLE_DEPRECATED
+/* for internal use only */
+void g_mime_header_list_set_raw (GMimeHeaderList *headers, const char *raw);
+gboolean g_mime_header_list_has_raw (const GMimeHeaderList *headers);
+#endif /* GMIME_DISABLE_DEPRECATED */
+
 G_END_DECLS
 
 #endif /* __GMIME_HEADER_H__ */



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