gmime r1304 - in trunk: . docs/reference gmime



Author: fejj
Date: Fri May 30 22:41:16 2008
New Revision: 1304
URL: http://svn.gnome.org/viewvc/gmime?rev=1304&view=rev

Log:
2008-05-30  Jeffrey Stedfast  <fejj novell com>

	* gmime/gmime-message.c (g_mime_message_get_headers): Removed as
	GMimeObject has an equivalent method.
	(handle_multipart_alternative): Removed.
	(handle_multipart_mixed): Removed.
	(g_mime_message_get_header): Removed, this has equivalent
	functionality on GMimeObject.
	(g_mime_message_set_header): Same.
	(g_mime_message_add_header): Same.



Modified:
   trunk/ChangeLog
   trunk/docs/reference/gmime-sections.txt
   trunk/gmime/gmime-message.c
   trunk/gmime/gmime-message.h

Modified: trunk/docs/reference/gmime-sections.txt
==============================================================================
--- trunk/docs/reference/gmime-sections.txt	(original)
+++ trunk/docs/reference/gmime-sections.txt	Fri May 30 22:41:16 2008
@@ -788,12 +788,8 @@
 g_mime_message_get_date_string
 g_mime_message_set_message_id
 g_mime_message_get_message_id
-g_mime_message_add_header
-g_mime_message_set_header
-g_mime_message_get_header
 g_mime_message_set_mime_part
 g_mime_message_get_mime_part
-g_mime_message_get_headers
 g_mime_message_foreach_part
 
 <SUBSECTION Private>

Modified: trunk/gmime/gmime-message.c
==============================================================================
--- trunk/gmime/gmime-message.c	(original)
+++ trunk/gmime/gmime-message.c	Fri May 30 22:41:16 2008
@@ -1296,76 +1296,6 @@
 
 
 /**
- * g_mime_message_add_header: Add an arbitrary message header
- * @message: MIME Message
- * @header: rfc822 header field
- * @value: the contents of the header field
- *
- * Add an arbitrary message header to the MIME Message such as
- * X-Mailer, X-Priority, or In-Reply-To.
- *
- * WARNING: This interface is deprecated. Use
- * g_mime_object_add_header() instead.
- **/
-void
-g_mime_message_add_header (GMimeMessage *message, const char *header, const char *value)
-{
-	g_return_if_fail (GMIME_IS_MESSAGE (message));
-	g_return_if_fail (header != NULL);
-	g_return_if_fail (value != NULL);
-	
-	g_mime_object_add_header (GMIME_OBJECT (message), header, value);
-}
-
-
-/**
- * g_mime_message_set_header: Add an arbitrary message header
- * @message: MIME Message
- * @header: rfc822 header field
- * @value: the contents of the header field
- *
- * Set an arbitrary message header to the MIME Message such as
- * X-Mailer, X-Priority, or In-Reply-To.
- *
- * WARNING: This interface is deprecated. Use
- * g_mime_object_set_header().
- **/
-void
-g_mime_message_set_header (GMimeMessage *message, const char *header, const char *value)
-{
-	g_return_if_fail (GMIME_IS_MESSAGE (message));
-	g_return_if_fail (header != NULL);
-	g_return_if_fail (value != NULL);
-	
-	g_mime_object_set_header (GMIME_OBJECT (message), header, value);
-}
-
-
-/**
- * g_mime_message_get_header:
- * @message: MIME Message
- * @header: rfc822 header field
- *
- * Gets the value of the requested header @header if it exists, or
- * %NULL otherwise.
- *
- * WARNING: This interface is deprecated. Use
- * g_mime_message_get_header().
- *
- * Returns the value of the requested header (or %NULL if it isn't
- * set)
- **/
-const char *
-g_mime_message_get_header (GMimeMessage *message, const char *header)
-{
-	g_return_val_if_fail (GMIME_IS_MESSAGE (message), NULL);
-	g_return_val_if_fail (header != NULL, NULL);
-	
-	return g_mime_object_get_header (GMIME_OBJECT (message), header);
-}
-
-
-/**
  * g_mime_message_get_mime_part:
  * @message: MIME Message
  *
@@ -1411,110 +1341,6 @@
 }
 
 
-/* The proper way to handle a multipart/alternative part is to return
- * the last part that we know how to render. For our purposes, we are
- * going to assume:
- *
- * If @want_plain is %FALSE then assume we can render text/plain and
- * text/html, thus the order of preference is text/html, then
- * text/plain and finally text/<any>.
- *
- * Otherwise, if @want_plain is %TRUE then we assume that we do not
- * know how to render text/html and so our order of preference becomes
- * text/plain and then text/<any>.
- **/
-static GMimeObject *
-handle_multipart_alternative (GMimeMultipart *multipart, gboolean want_plain, gboolean *is_html)
-{
-	GMimeObject *mime_part, *text_part = NULL;
-	const GMimeContentType *type;
-	GList *subpart;
-	
-	subpart = multipart->subparts;
-	while (subpart) {
-		mime_part = subpart->data;
-		
-		type = g_mime_object_get_content_type (mime_part);
-		if (g_mime_content_type_is_type (type, "text", "*")) {
-			if (!text_part || !g_ascii_strcasecmp (type->subtype, want_plain ? "plain" : "html")) {
-				*is_html = !g_ascii_strcasecmp (type->subtype, "html");
-				text_part = mime_part;
-			}
-		}
-		
-		subpart = subpart->next;
-	}
-	
-	return text_part;
-}
-
-static GMimeObject *
-handle_multipart_mixed (GMimeMultipart *multipart, gboolean want_plain, gboolean *is_html)
-{
-	GMimeObject *mime_part, *text_part = NULL;
-	const GMimeContentType *type, *first_type = NULL;
-	GList *subpart;
-	
-	subpart = multipart->subparts;
-	while (subpart) {
-		mime_part = subpart->data;
-		
-		type = g_mime_object_get_content_type (mime_part);
-		if (GMIME_IS_MULTIPART (mime_part)) {
-			multipart = GMIME_MULTIPART (mime_part);
-			if (g_mime_content_type_is_type (type, "multipart", "alternative")) {
-				mime_part = handle_multipart_alternative (multipart, want_plain, is_html);
-				if (mime_part)
-					return mime_part;
-			} else {
-				mime_part = handle_multipart_mixed (multipart, want_plain, is_html);
-				if (mime_part && !text_part)
-					text_part = mime_part;
-			}
-		} else if (g_mime_content_type_is_type (type, "text", "*")) {
-			if (!g_ascii_strcasecmp (type->subtype, want_plain ? "plain" : "html")) {
-				/* we got what we came for */
-				*is_html = !g_ascii_strcasecmp (type->subtype, "html");
-				return mime_part;
-			}
-			
-			/* if we haven't yet found a text part or if it is a type we can
-			 * understand and it is the first of that type, save it */
-			if (!text_part || (!g_ascii_strcasecmp (type->subtype, "plain") && (first_type &&
-					   g_ascii_strcasecmp (type->subtype, first_type->subtype) != 0))) {
-				*is_html = !g_ascii_strcasecmp (type->subtype, "html");
-				text_part = mime_part;
-				first_type = type;
-			}
-		}
-		
-		subpart = subpart->next;
-	}
-	
-	return text_part;
-}
-
-
-/**
- * g_mime_message_get_headers:
- * @message: MIME Message
- *
- * Allocates a string buffer containing the raw message headers.
- *
- * WARNING: This interface is deprecated. Use
- * g_mime_object_get_headers() instead.
- *
- * Returns an allocated string containing the raw message headers.
- **/
-char *
-g_mime_message_get_headers (GMimeMessage *message)
-{
-	g_return_val_if_fail (GMIME_IS_MESSAGE (message), NULL);
-	
-	return g_mime_object_get_headers (GMIME_OBJECT (message));
-}
-
-
 /**
  * g_mime_message_foreach_part:
  * @message: MIME message

Modified: trunk/gmime/gmime-message.h
==============================================================================
--- trunk/gmime/gmime-message.h	(original)
+++ trunk/gmime/gmime-message.h	Fri May 30 22:41:16 2008
@@ -123,8 +123,6 @@
 GMimeObject *g_mime_message_get_mime_part (GMimeMessage *message);
 void g_mime_message_set_mime_part (GMimeMessage *message, GMimeObject *mime_part);
 
-char *g_mime_message_get_headers (GMimeMessage *message);
-
 void g_mime_message_foreach_part (GMimeMessage *message, GMimePartFunc callback, gpointer data);
 
 G_END_DECLS



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