gmime r1422 - in trunk: . docs/reference gmime tests tools
- From: fejj svn gnome org
- To: svn-commits-list gnome org
- Subject: gmime r1422 - in trunk: . docs/reference gmime tests tools
- Date: Sun, 31 Aug 2008 19:07:54 +0000 (UTC)
Author: fejj
Date: Sun Aug 31 19:07:54 2008
New Revision: 1422
URL: http://svn.gnome.org/viewvc/gmime?rev=1422&view=rev
Log:
2008-08-31 Jeffrey Stedfast <fejj novell com>
* gmime/gmime-parser.c (parser_scan_multipart_subparts): Updated
for GMimeMultipart API changes.
* gmime/gmime-multipart-signed.c (sign_prepare): Updated for
GMimeMultipart API changes.
(g_mime_multipart_signed_sign): Same.
* gmime/gmime-multipart-encrypted.c (g_mime_multipart_encrypted_encrypt):
Updated for GMimeMultipart API changes.
* gmime/gmime-multipart.c (g_mime_multipart_add): Renamed from
g_mime_multipart_add_part(). The "_part" seemed superfluous.
(g_mime_multipart_remove): Same.
(g_mime_multipart_remove_at): Same.
(g_mime_multipart_insert): Renamed from
g_mime_multipart_add_part_at().
(g_mime_multipart_get_count): Renamed to be more obvious.
Modified:
trunk/ChangeLog
trunk/docs/reference/gmime-sections.txt
trunk/gmime/gmime-multipart-encrypted.c
trunk/gmime/gmime-multipart-signed.c
trunk/gmime/gmime-multipart.c
trunk/gmime/gmime-multipart.h
trunk/gmime/gmime-parser.c
trunk/tests/test-mbox.c
trunk/tests/test-parser.c
trunk/tests/test-partial.c
trunk/tools/gmime-port-2-2-to-2-4.sh
Modified: trunk/docs/reference/gmime-sections.txt
==============================================================================
--- trunk/docs/reference/gmime-sections.txt (original)
+++ trunk/docs/reference/gmime-sections.txt Sun Aug 31 19:07:54 2008
@@ -750,12 +750,12 @@
g_mime_multipart_get_postface
g_mime_multipart_set_boundary
g_mime_multipart_get_boundary
-g_mime_multipart_add_part
-g_mime_multipart_add_part_at
-g_mime_multipart_get_number
+g_mime_multipart_add
+g_mime_multipart_insert
+g_mime_multipart_remove
+g_mime_multipart_remove_at
+g_mime_multipart_get_count
g_mime_multipart_get_part
-g_mime_multipart_remove_part
-g_mime_multipart_remove_part_at
g_mime_multipart_foreach
g_mime_multipart_get_subpart_from_content_id
Modified: trunk/gmime/gmime-multipart-encrypted.c
==============================================================================
--- trunk/gmime/gmime-multipart-encrypted.c (original)
+++ trunk/gmime/gmime-multipart-encrypted.c Sun Aug 31 19:07:54 2008
@@ -309,8 +309,8 @@
/* save the version and encrypted parts */
/* FIXME: make sure there aren't any other parts?? */
- g_mime_multipart_add_part (GMIME_MULTIPART (mpe), GMIME_OBJECT (version_part));
- g_mime_multipart_add_part (GMIME_MULTIPART (mpe), GMIME_OBJECT (encrypted_part));
+ g_mime_multipart_add (GMIME_MULTIPART (mpe), GMIME_OBJECT (version_part));
+ g_mime_multipart_add (GMIME_MULTIPART (mpe), GMIME_OBJECT (encrypted_part));
g_object_unref (encrypted_part);
g_object_unref (version_part);
Modified: trunk/gmime/gmime-multipart-signed.c
==============================================================================
--- trunk/gmime/gmime-multipart-signed.c (original)
+++ trunk/gmime/gmime-multipart-signed.c Sun Aug 31 19:07:54 2008
@@ -242,7 +242,7 @@
return;
}
- n = g_mime_multipart_get_number (multipart);
+ n = g_mime_multipart_get_count (multipart);
for (i = 0; i < n; i++) {
subpart = g_mime_multipart_get_part (multipart, i);
sign_prepare (subpart);
@@ -373,8 +373,8 @@
/* save the content and signature parts */
/* FIXME: make sure there aren't any other parts?? */
- g_mime_multipart_add_part (GMIME_MULTIPART (mps), content);
- g_mime_multipart_add_part (GMIME_MULTIPART (mps), (GMimeObject *) signature);
+ g_mime_multipart_add (GMIME_MULTIPART (mps), content);
+ g_mime_multipart_add (GMIME_MULTIPART (mps), (GMimeObject *) signature);
g_object_unref (signature);
g_object_unref (content);
@@ -413,7 +413,7 @@
g_return_val_if_fail (GMIME_IS_CIPHER_CONTEXT (ctx), NULL);
g_return_val_if_fail (ctx->sign_protocol != NULL, NULL);
- if (g_mime_multipart_get_number ((GMimeMultipart *) mps) < 2) {
+ if (g_mime_multipart_get_count ((GMimeMultipart *) mps) < 2) {
g_set_error (err, GMIME_ERROR, GMIME_ERROR_PARSE_ERROR, "%s",
"Cannot verify multipart/signed part due to missing subparts.");
return NULL;
Modified: trunk/gmime/gmime-multipart.c
==============================================================================
--- trunk/gmime/gmime-multipart.c (original)
+++ trunk/gmime/gmime-multipart.c Sun Aug 31 19:07:54 2008
@@ -63,12 +63,12 @@
static ssize_t multipart_write_to_stream (GMimeObject *object, GMimeStream *stream);
/* GMimeMultipart class methods */
-static void multipart_add_part (GMimeMultipart *multipart, GMimeObject *part);
-static void multipart_add_part_at (GMimeMultipart *multipart, GMimeObject *part, int index);
-static gboolean multipart_remove_part (GMimeMultipart *multipart, GMimeObject *part);
-static GMimeObject *multipart_remove_part_at (GMimeMultipart *multipart, int index);
+static void multipart_add (GMimeMultipart *multipart, GMimeObject *part);
+static void multipart_insert (GMimeMultipart *multipart, int index, GMimeObject *part);
+static gboolean multipart_remove (GMimeMultipart *multipart, GMimeObject *part);
+static GMimeObject *multipart_remove_at (GMimeMultipart *multipart, int index);
static GMimeObject *multipart_get_part (GMimeMultipart *multipart, int index);
-static int multipart_get_number (GMimeMultipart *multipart);
+static int multipart_get_count (GMimeMultipart *multipart);
static void multipart_set_boundary (GMimeMultipart *multipart, const char *boundary);
static const char *multipart_get_boundary (GMimeMultipart *multipart);
@@ -120,12 +120,12 @@
object_class->get_headers = multipart_get_headers;
object_class->write_to_stream = multipart_write_to_stream;
- klass->add_part = multipart_add_part;
- klass->add_part_at = multipart_add_part_at;
- klass->remove_part = multipart_remove_part;
- klass->remove_part_at = multipart_remove_part_at;
+ klass->add = multipart_add;
+ klass->insert = multipart_insert;
+ klass->remove = multipart_remove;
+ klass->remove_at = multipart_remove_at;
klass->get_part = multipart_get_part;
- klass->get_number = multipart_get_number;
+ klass->get_count = multipart_get_count;
klass->set_boundary = multipart_set_boundary;
klass->get_boundary = multipart_get_boundary;
}
@@ -353,7 +353,7 @@
/**
* g_mime_multipart_set_preface:
- * @multipart: multipart
+ * @multipart: a #GMimeMultipart object
* @preface: preface
*
* Sets the preface on the multipart.
@@ -370,7 +370,7 @@
/**
* g_mime_multipart_get_preface:
- * @multipart: multipart
+ * @multipart: a #GMimeMultipart object
*
* Gets the preface on the multipart.
*
@@ -387,7 +387,7 @@
/**
* g_mime_multipart_set_postface:
- * @multipart: multipart
+ * @multipart: a #GMimeMultipart object
* @postface: postface
*
* Sets the postface on the multipart.
@@ -404,7 +404,7 @@
/**
* g_mime_multipart_get_postface:
- * @multipart: multipart
+ * @multipart: a #GMimeMultipart object
*
* Gets the postface on the multipart.
*
@@ -420,28 +420,27 @@
static void
-multipart_add_part (GMimeMultipart *multipart, GMimeObject *part)
+multipart_add (GMimeMultipart *multipart, GMimeObject *part)
{
- g_object_ref (part);
-
g_ptr_array_add (multipart->children, part);
+ g_object_ref (part);
}
/**
- * g_mime_multipart_add_part:
- * @multipart: multipart
- * @part: mime part
+ * g_mime_multipart_add:
+ * @multipart: a #GMimeMultipart object
+ * @part: a #GMimeObject
*
* Adds a mime part to the multipart.
**/
void
-g_mime_multipart_add_part (GMimeMultipart *multipart, GMimeObject *part)
+g_mime_multipart_add (GMimeMultipart *multipart, GMimeObject *part)
{
g_return_if_fail (GMIME_IS_MULTIPART (multipart));
g_return_if_fail (GMIME_IS_OBJECT (part));
- GMIME_MULTIPART_GET_CLASS (multipart)->add_part (multipart, part);
+ GMIME_MULTIPART_GET_CLASS (multipart)->add (multipart, part);
}
@@ -466,35 +465,35 @@
}
static void
-multipart_add_part_at (GMimeMultipart *multipart, GMimeObject *part, int index)
+multipart_insert (GMimeMultipart *multipart, int index, GMimeObject *part)
{
- g_object_ref (part);
-
ptr_array_insert (multipart->children, index, part);
+ g_object_ref (part);
}
/**
- * g_mime_multipart_add_part_at:
- * @multipart: multipart
+ * g_mime_multipart_insert:
+ * @multipart: a #GMimeMultipart object
* @part: mime part
* @index: position to insert the mime part
*
- * Adds a mime part to the multipart at the position @index.
+ * Inserts the specified mime part into the multipart at the position
+ * @index.
**/
void
-g_mime_multipart_add_part_at (GMimeMultipart *multipart, GMimeObject *part, int index)
+g_mime_multipart_insert (GMimeMultipart *multipart, int index, GMimeObject *part)
{
g_return_if_fail (GMIME_IS_MULTIPART (multipart));
g_return_if_fail (GMIME_IS_OBJECT (part));
g_return_if_fail (index >= 0);
- GMIME_MULTIPART_GET_CLASS (multipart)->add_part_at (multipart, part, index);
+ GMIME_MULTIPART_GET_CLASS (multipart)->insert (multipart, index, part);
}
static gboolean
-multipart_remove_part (GMimeMultipart *multipart, GMimeObject *part)
+multipart_remove (GMimeMultipart *multipart, GMimeObject *part)
{
if (!g_ptr_array_remove (multipart->children, part))
return FALSE;
@@ -506,8 +505,8 @@
/**
- * g_mime_multipart_remove_part:
- * @multipart: multipart
+ * g_mime_multipart_remove:
+ * @multipart: a #GMimeMultipart object
* @part: mime part
*
* Removes the specified mime part from the multipart.
@@ -515,17 +514,17 @@
* Returns: %TRUE if the part was removed or %FALSE otherwise.
**/
gboolean
-g_mime_multipart_remove_part (GMimeMultipart *multipart, GMimeObject *part)
+g_mime_multipart_remove (GMimeMultipart *multipart, GMimeObject *part)
{
g_return_val_if_fail (GMIME_IS_MULTIPART (multipart), FALSE);
g_return_val_if_fail (GMIME_IS_OBJECT (part), FALSE);
- return GMIME_MULTIPART_GET_CLASS (multipart)->remove_part (multipart, part);
+ return GMIME_MULTIPART_GET_CLASS (multipart)->remove (multipart, part);
}
static GMimeObject *
-multipart_remove_part_at (GMimeMultipart *multipart, int index)
+multipart_remove_at (GMimeMultipart *multipart, int index)
{
GMimeObject *part;
@@ -541,21 +540,22 @@
/**
- * g_mime_multipart_remove_part_at:
- * @multipart: multipart
+ * g_mime_multipart_remove_at:
+ * @multipart: a #GMimeMultipart object
* @index: position of the mime part to remove
*
* Removes the mime part at position @index from the multipart.
*
- * Returns: the mime part that was removed.
+ * Returns: the mime part that was removed or %NULL if the part was
+ * not contained within the multipart.
**/
GMimeObject *
-g_mime_multipart_remove_part_at (GMimeMultipart *multipart, int index)
+g_mime_multipart_remove_at (GMimeMultipart *multipart, int index)
{
g_return_val_if_fail (GMIME_IS_MULTIPART (multipart), NULL);
g_return_val_if_fail (index >= 0, NULL);
- return GMIME_MULTIPART_GET_CLASS (multipart)->remove_part_at (multipart, index);
+ return GMIME_MULTIPART_GET_CLASS (multipart)->remove_at (multipart, index);
}
@@ -575,7 +575,7 @@
/**
* g_mime_multipart_get_part:
- * @multipart: multipart
+ * @multipart: a #GMimeMultipart object
* @index: position of the mime part
*
* Gets the mime part at position @index within the multipart.
@@ -593,26 +593,26 @@
static int
-multipart_get_number (GMimeMultipart *multipart)
+multipart_get_count (GMimeMultipart *multipart)
{
return multipart->children->len;
}
/**
- * g_mime_multipart_get_number:
- * @multipart: multipart
+ * g_mime_multipart_get_count:
+ * @multipart: a #GMimeMultipart object
*
* Gets the number of mime parts contained within the multipart.
*
* Returns: the number of mime parts contained within the multipart.
**/
int
-g_mime_multipart_get_number (GMimeMultipart *multipart)
+g_mime_multipart_get_count (GMimeMultipart *multipart)
{
g_return_val_if_fail (GMIME_IS_MULTIPART (multipart), -1);
- return GMIME_MULTIPART_GET_CLASS (multipart)->get_number (multipart);
+ return GMIME_MULTIPART_GET_CLASS (multipart)->get_count (multipart);
}
@@ -672,7 +672,7 @@
/**
* g_mime_multipart_set_boundary:
- * @multipart: multipart
+ * @multipart: a #GMimeMultipart object
* @boundary: boundary or %NULL to autogenerate one
*
* Sets @boundary as the boundary on the multipart. If @boundary is
@@ -699,7 +699,7 @@
/**
* g_mime_multipart_get_boundary:
- * @multipart: multipart
+ * @multipart: a #GMimeMultipart object
*
* Gets the boundary on the multipart. If the internal boundary is
* %NULL, then an auto-generated boundary will be set on the multipart
Modified: trunk/gmime/gmime-multipart.h
==============================================================================
--- trunk/gmime/gmime-multipart.h (original)
+++ trunk/gmime/gmime-multipart.h Sun Aug 31 19:07:54 2008
@@ -60,14 +60,13 @@
struct _GMimeMultipartClass {
GMimeObjectClass parent_class;
- void (* add_part) (GMimeMultipart *multipart, GMimeObject *part);
- void (* add_part_at) (GMimeMultipart *multipart, GMimeObject *part, int index);
- gboolean (* remove_part) (GMimeMultipart *multipart, GMimeObject *part);
-
- GMimeObject * (* remove_part_at) (GMimeMultipart *multipart, int index);
+ void (* add) (GMimeMultipart *multipart, GMimeObject *part);
+ void (* insert) (GMimeMultipart *multipart, int index, GMimeObject *part);
+ gboolean (* remove) (GMimeMultipart *multipart, GMimeObject *part);
+ GMimeObject * (* remove_at) (GMimeMultipart *multipart, int index);
GMimeObject * (* get_part) (GMimeMultipart *multipart, int index);
- int (* get_number) (GMimeMultipart *multipart);
+ int (* get_count) (GMimeMultipart *multipart);
void (* set_boundary) (GMimeMultipart *multipart, const char *boundary);
const char * (* get_boundary) (GMimeMultipart *multipart);
@@ -86,14 +85,13 @@
void g_mime_multipart_set_postface (GMimeMultipart *multipart, const char *postface);
const char *g_mime_multipart_get_postface (GMimeMultipart *multipart);
-void g_mime_multipart_add_part (GMimeMultipart *multipart, GMimeObject *part);
-void g_mime_multipart_add_part_at (GMimeMultipart *multipart, GMimeObject *part, int index);
-gboolean g_mime_multipart_remove_part (GMimeMultipart *multipart, GMimeObject *part);
-
-GMimeObject *g_mime_multipart_remove_part_at (GMimeMultipart *multipart, int index);
+void g_mime_multipart_add (GMimeMultipart *multipart, GMimeObject *part);
+void g_mime_multipart_insert (GMimeMultipart *multipart, int index, GMimeObject *part);
+gboolean g_mime_multipart_remove (GMimeMultipart *multipart, GMimeObject *part);
+GMimeObject *g_mime_multipart_remove_at (GMimeMultipart *multipart, int index);
GMimeObject *g_mime_multipart_get_part (GMimeMultipart *multipart, int index);
-int g_mime_multipart_get_number (GMimeMultipart *multipart);
+int g_mime_multipart_get_count (GMimeMultipart *multipart);
void g_mime_multipart_set_boundary (GMimeMultipart *multipart, const char *boundary);
const char *g_mime_multipart_get_boundary (GMimeMultipart *multipart);
Modified: trunk/gmime/gmime-parser.c
==============================================================================
--- trunk/gmime/gmime-parser.c (original)
+++ trunk/gmime/gmime-parser.c Sun Aug 31 19:07:54 2008
@@ -1499,7 +1499,7 @@
else
subpart = parser_construct_leaf_part (parser, content_type, &found);
- g_mime_multipart_add_part (multipart, subpart);
+ g_mime_multipart_add (multipart, subpart);
g_object_unref (subpart);
} while (found == FOUND_BOUNDARY && found_immediate_boundary (priv, FALSE));
Modified: trunk/tests/test-mbox.c
==============================================================================
--- trunk/tests/test-mbox.c (original)
+++ trunk/tests/test-mbox.c Sun Aug 31 19:07:54 2008
@@ -74,7 +74,7 @@
if (GMIME_IS_MULTIPART (part)) {
multipart = (GMimeMultipart *) part;
- n = g_mime_multipart_get_number (multipart);
+ n = g_mime_multipart_get_count (multipart);
for (i = 0; i < n; i++) {
subpart = g_mime_multipart_get_part (multipart, i);
print_mime_struct (stream, subpart, depth + 1);
Modified: trunk/tests/test-parser.c
==============================================================================
--- trunk/tests/test-parser.c (original)
+++ trunk/tests/test-parser.c Sun Aug 31 19:07:54 2008
@@ -70,7 +70,7 @@
if (GMIME_IS_MULTIPART (part)) {
multipart = (GMimeMultipart *) part;
- n = g_mime_multipart_get_number (multipart);
+ n = g_mime_multipart_get_count (multipart);
for (i = 0; i < n; i++) {
subpart = g_mime_multipart_get_part (multipart, i);
print_mime_struct (subpart, depth + 1);
Modified: trunk/tests/test-partial.c
==============================================================================
--- trunk/tests/test-partial.c (original)
+++ trunk/tests/test-partial.c Sun Aug 31 19:07:54 2008
@@ -52,7 +52,7 @@
if (GMIME_IS_MULTIPART (part)) {
multipart = (GMimeMultipart *) part;
- n = g_mime_multipart_get_number (multipart);
+ n = g_mime_multipart_get_count (multipart);
for (i = 0; i < n; i++) {
subpart = g_mime_multipart_get_part (multipart, i);
print_mime_struct (subpart, depth + 1);
Modified: trunk/tools/gmime-port-2-2-to-2-4.sh
==============================================================================
--- trunk/tools/gmime-port-2-2-to-2-4.sh (original)
+++ trunk/tools/gmime-port-2-2-to-2-4.sh Sun Aug 31 19:07:54 2008
@@ -65,6 +65,11 @@
-e "s/g_mime_part_set_encoding/g_mime_part_set_content_encoding/g" \
-e "s/g_mime_part_write_to_stream/g_mime_object_write_to_stream/g" \
-e "s/g_mime_part_to_string/g_mime_object_to_string/g" \
+ -e "s/g_mime_multipart_add_part/g_mime_multipart_add/g" \
+ -e "s/g_mime_multipart_add_part_at/g_mime_multipart_insert/g" \
+ -e "s/g_mime_multipart_remove_part/g_mime_multipart_remove/g" \
+ -e "s/g_mime_multipart_remove_part_at/g_mime_multipart_remove_at/g" \
+ -e "s/g_mime_multipart_get_number/g_mime_multipart_get_count/g" \
-e "s/g_mime_utils_base64_encode_close/g_mime_encoding_base64_encode_close/g" \
-e "s/g_mime_utils_base64_encode_step/g_mime_encoding_base64_encode_step/g" \
-e "s/g_mime_utils_base64_decode_step/g_mime_encoding_base64_decode_step/g" \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]