[gmime] Dropped g_mime_parser_construct_*_with_options(). Just roll it into regular method.
- From: Jeffrey Stedfast <fejj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gmime] Dropped g_mime_parser_construct_*_with_options(). Just roll it into regular method.
- Date: Tue, 14 Mar 2017 02:24:42 +0000 (UTC)
commit 28bc0aa67ce476f1cc15386d4036512db6a7abb8
Author: Jeffrey Stedfast <jestedfa microsoft com>
Date: Mon Mar 13 22:23:43 2017 -0400
Dropped g_mime_parser_construct_*_with_options(). Just roll it into regular method.
examples/basic-example.c | 2 +-
examples/imap-example.c | 8 +++---
gmime/gmime-application-pkcs7-mime.c | 4 +-
gmime/gmime-message-partial.c | 2 +-
gmime/gmime-multipart-encrypted.c | 2 +-
gmime/gmime-multipart-signed.c | 2 +-
gmime/gmime-parser.c | 47 ++++++----------------------------
gmime/gmime-parser.h | 7 +---
tests/test-mbox.c | 2 +-
tests/test-parser.c | 2 +-
tests/test-partial.c | 2 +-
tests/test-pgpmime.c | 4 +-
tests/test-smime.c | 2 +-
13 files changed, 26 insertions(+), 60 deletions(-)
---
diff --git a/examples/basic-example.c b/examples/basic-example.c
index f386a44..c5ad1b3 100644
--- a/examples/basic-example.c
+++ b/examples/basic-example.c
@@ -68,7 +68,7 @@ parse_message (int fd)
g_object_unref (stream);
/* parse the message from the stream */
- message = g_mime_parser_construct_message (parser);
+ message = g_mime_parser_construct_message (parser, NULL);
/* free the parser (and the stream) */
g_object_unref (parser);
diff --git a/examples/imap-example.c b/examples/imap-example.c
index 9026429..9b10d41 100644
--- a/examples/imap-example.c
+++ b/examples/imap-example.c
@@ -768,7 +768,7 @@ reconstruct_message_part (GMimeMessagePart *msgpart, const char *uid, const char
parser = g_mime_parser_new_with_stream (stream);
g_object_unref (stream);
- message = g_mime_parser_construct_message (parser);
+ message = g_mime_parser_construct_message (parser, NULL);
g_object_unref (parser);
g_mime_message_part_set_message (msgpart, message);
@@ -822,7 +822,7 @@ reconstruct_multipart (GMimeMultipart *multipart, struct _bodystruct *body,
parser = g_mime_parser_new_with_stream (stream);
g_object_unref (stream);
- subpart = g_mime_parser_construct_part (parser);
+ subpart = g_mime_parser_construct_part (parser, NULL);
g_object_unref (parser);
if (GMIME_IS_MULTIPART (subpart)) {
@@ -863,7 +863,7 @@ reconstruct_message (const char *uid)
/* constructs message object and toplevel mime part (although
the toplevel mime part will not have any content... */
- message = g_mime_parser_construct_message (parser);
+ message = g_mime_parser_construct_message (parser, NULL);
g_object_unref (parser);
if (GMIME_IS_MULTIPART (message->mime_part)) {
@@ -939,7 +939,7 @@ int main (int argc, char **argv)
g_mime_parser_set_format (parser, format);
g_object_unref (stream);
- message = g_mime_parser_construct_message (parser);
+ message = g_mime_parser_construct_message (parser, NULL);
g_object_unref (parser);
if (message) {
diff --git a/gmime/gmime-application-pkcs7-mime.c b/gmime/gmime-application-pkcs7-mime.c
index 95a3986..be2ca54 100644
--- a/gmime/gmime-application-pkcs7-mime.c
+++ b/gmime/gmime-application-pkcs7-mime.c
@@ -364,7 +364,7 @@ g_mime_application_pkcs7_mime_decrypt (GMimeApplicationPkcs7Mime *pkcs7_mime,
g_mime_parser_init_with_stream (parser, stream);
g_object_unref (stream);
- decrypted = g_mime_parser_construct_part (parser);
+ decrypted = g_mime_parser_construct_part (parser, NULL);
g_object_unref (parser);
if (!decrypted) {
@@ -519,7 +519,7 @@ g_mime_application_pkcs7_mime_verify (GMimeApplicationPkcs7Mime *pkcs7_mime, GMi
g_mime_parser_init_with_stream (parser, stream);
g_object_unref (stream);
- *entity = g_mime_parser_construct_part (parser);
+ *entity = g_mime_parser_construct_part (parser, NULL);
g_object_unref (parser);
if (*entity == NULL) {
diff --git a/gmime/gmime-message-partial.c b/gmime/gmime-message-partial.c
index cadd313..c1deacd 100644
--- a/gmime/gmime-message-partial.c
+++ b/gmime/gmime-message-partial.c
@@ -305,7 +305,7 @@ g_mime_message_partial_reconstruct_message (GMimeMessagePartial **partials, size
g_mime_parser_init_with_stream (parser, cat);
g_object_unref (cat);
- message = g_mime_parser_construct_message (parser);
+ message = g_mime_parser_construct_message (parser, NULL);
g_object_unref (parser);
return message;
diff --git a/gmime/gmime-multipart-encrypted.c b/gmime/gmime-multipart-encrypted.c
index f2f282e..1f5d2ef 100644
--- a/gmime/gmime-multipart-encrypted.c
+++ b/gmime/gmime-multipart-encrypted.c
@@ -369,7 +369,7 @@ g_mime_multipart_encrypted_decrypt (GMimeMultipartEncrypted *encrypted, GMimeDec
g_mime_parser_init_with_stream (parser, stream);
g_object_unref (stream);
- decrypted = g_mime_parser_construct_part (parser);
+ decrypted = g_mime_parser_construct_part (parser, NULL);
g_object_unref (parser);
if (!decrypted) {
diff --git a/gmime/gmime-multipart-signed.c b/gmime/gmime-multipart-signed.c
index 10f8c9e..3aa0c08 100644
--- a/gmime/gmime-multipart-signed.c
+++ b/gmime/gmime-multipart-signed.c
@@ -276,7 +276,7 @@ g_mime_multipart_signed_sign (GMimeCryptoContext *ctx, GMimeObject *entity,
/* construct the content part */
parser = g_mime_parser_new_with_stream (stream);
- entity = g_mime_parser_construct_part (parser);
+ entity = g_mime_parser_construct_part (parser, NULL);
g_object_unref (stream);
g_object_unref (parser);
diff --git a/gmime/gmime-parser.c b/gmime/gmime-parser.c
index 5b485db..f57165e 100644
--- a/gmime/gmime-parser.c
+++ b/gmime/gmime-parser.c
@@ -1967,6 +1967,7 @@ parser_construct_part (GMimeParser *parser, GMimeParserOptions *options)
/**
* g_mime_parser_construct_part:
* @parser: a #GMimeParser context
+ * @options: a #GMimeParserOptions or %NULL for the default options
*
* Constructs a MIME part from @parser.
*
@@ -1974,29 +1975,12 @@ parser_construct_part (GMimeParser *parser, GMimeParserOptions *options)
* fail.
**/
GMimeObject *
-g_mime_parser_construct_part (GMimeParser *parser)
+g_mime_parser_construct_part (GMimeParser *parser, GMimeParserOptions *options)
{
g_return_val_if_fail (GMIME_IS_PARSER (parser), NULL);
- return parser_construct_part (parser, g_mime_parser_options_get_default ());
-}
-
-
-/**
- * g_mime_parser_construct_part_with_options:
- * @parser: a #GMimeParser context
- * @options: a #GMimeParserOptions
- *
- * Constructs a MIME part from @parser.
- *
- * Returns: (transfer full): a MIME part based on @parser or %NULL on
- * fail.
- **/
-GMimeObject *
-g_mime_parser_construct_part_with_options (GMimeParser *parser, GMimeParserOptions *options)
-{
- g_return_val_if_fail (GMIME_IS_PARSER (parser), NULL);
- g_return_val_if_fail (options != NULL, NULL);
+ if (options == NULL)
+ options = g_mime_parser_options_get_default ();
return parser_construct_part (parser, options);
}
@@ -2070,34 +2054,19 @@ parser_construct_message (GMimeParser *parser, GMimeParserOptions *options)
/**
* g_mime_parser_construct_message:
* @parser: a #GMimeParser context
+ * @options: a #GMimeParserOptions or %NULL for the default options
*
* Constructs a MIME message from @parser.
*
* Returns: (transfer full): a MIME message or %NULL on fail.
**/
GMimeMessage *
-g_mime_parser_construct_message (GMimeParser *parser)
+g_mime_parser_construct_message (GMimeParser *parser, GMimeParserOptions *options)
{
g_return_val_if_fail (GMIME_IS_PARSER (parser), NULL);
- return parser_construct_message (parser, g_mime_parser_options_get_default ());
-}
-
-
-/**
- * g_mime_parser_construct_message_with_options:
- * @parser: a #GMimeParser context
- * @options: a #GMimeParserOptions
- *
- * Constructs a MIME message from @parser.
- *
- * Returns: (transfer full): a MIME message or %NULL on fail.
- **/
-GMimeMessage *
-g_mime_parser_construct_message_with_options (GMimeParser *parser, GMimeParserOptions *options)
-{
- g_return_val_if_fail (GMIME_IS_PARSER (parser), NULL);
- g_return_val_if_fail (options != NULL, NULL);
+ if (options == NULL)
+ options = g_mime_parser_options_get_default ();
return parser_construct_message (parser, options);
}
diff --git a/gmime/gmime-parser.h b/gmime/gmime-parser.h
index bc8aba7..2f7eee9 100644
--- a/gmime/gmime-parser.h
+++ b/gmime/gmime-parser.h
@@ -115,11 +115,8 @@ void g_mime_parser_set_header_regex (GMimeParser *parser, const char *regex,
GMimeParserHeaderRegexFunc header_cb,
gpointer user_data);
-GMimeObject *g_mime_parser_construct_part (GMimeParser *parser);
-GMimeObject *g_mime_parser_construct_part_with_options (GMimeParser *parser, GMimeParserOptions *options);
-
-GMimeMessage *g_mime_parser_construct_message (GMimeParser *parser);
-GMimeMessage *g_mime_parser_construct_message_with_options (GMimeParser *parser, GMimeParserOptions
*options);
+GMimeObject *g_mime_parser_construct_part (GMimeParser *parser, GMimeParserOptions *options);
+GMimeMessage *g_mime_parser_construct_message (GMimeParser *parser, GMimeParserOptions *options);
gint64 g_mime_parser_tell (GMimeParser *parser);
diff --git a/tests/test-mbox.c b/tests/test-mbox.c
index 809c225..e91b060 100644
--- a/tests/test-mbox.c
+++ b/tests/test-mbox.c
@@ -114,7 +114,7 @@ test_parser (GMimeParser *parser, GMimeStream *mbox, GMimeStream *summary)
while (!g_mime_parser_eos (parser)) {
message_begin = g_mime_parser_tell (parser);
- if (!(message = g_mime_parser_construct_message (parser)))
+ if (!(message = g_mime_parser_construct_message (parser, NULL)))
throw (exception_new ("failed to parse message #%d", nmsg));
message_end = g_mime_parser_tell (parser);
diff --git a/tests/test-parser.c b/tests/test-parser.c
index 1eba419..c3b41d8 100644
--- a/tests/test-parser.c
+++ b/tests/test-parser.c
@@ -166,7 +166,7 @@ test_parser (GMimeStream *stream)
g_mime_parser_init_with_stream (parser, stream);
ZenTimerStart (NULL);
- message = g_mime_parser_construct_message (parser);
+ message = g_mime_parser_construct_message (parser, NULL);
ZenTimerStop (NULL);
ZenTimerReport (NULL, "gmime::parser_construct_message");
diff --git a/tests/test-partial.c b/tests/test-partial.c
index a76fb0c..928badb 100644
--- a/tests/test-partial.c
+++ b/tests/test-partial.c
@@ -189,7 +189,7 @@ int main (int argc, char **argv)
g_mime_parser_init_with_stream (parser, stream);
g_object_unref (stream);
- if (!(message = g_mime_parser_construct_message (parser)))
+ if (!(message = g_mime_parser_construct_message (parser, NULL)))
throw (exception_new ("Failed to parse `%s'", path));
if (!GMIME_IS_MESSAGE_PARTIAL (message->mime_part)) {
diff --git a/tests/test-pgpmime.c b/tests/test-pgpmime.c
index 3aebfe1..5d92430 100644
--- a/tests/test-pgpmime.c
+++ b/tests/test-pgpmime.c
@@ -203,7 +203,7 @@ create_message (GMimeObject *body)
g_mime_parser_init_with_stream (parser, stream);
g_object_unref (stream);
- message = g_mime_parser_construct_message (parser);
+ message = g_mime_parser_construct_message (parser, NULL);
g_object_unref (parser);
return message;
@@ -357,7 +357,7 @@ test_multipart_encrypted (GMimeCryptoContext *ctx, gboolean sign,
parser = g_mime_parser_new ();
g_mime_parser_init_with_stream (parser, stream);
- message = g_mime_parser_construct_message (parser);
+ message = g_mime_parser_construct_message (parser, NULL);
g_object_unref (parser);
if (!GMIME_IS_MULTIPART_ENCRYPTED (message->mime_part)) {
diff --git a/tests/test-smime.c b/tests/test-smime.c
index 7657f1f..aee8d18 100644
--- a/tests/test-smime.c
+++ b/tests/test-smime.c
@@ -205,7 +205,7 @@ create_message (GMimeObject *body)
g_mime_parser_init_with_stream (parser, stream);
g_object_unref (stream);
- message = g_mime_parser_construct_message (parser);
+ message = g_mime_parser_construct_message (parser, NULL);
g_object_unref (parser);
return message;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]