[gmime: 4/5] Renamed g_mime_parser_get_from() to g_mime_parser_get_mbox_marker()
- From: Jeffrey Stedfast <fejj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gmime: 4/5] Renamed g_mime_parser_get_from() to g_mime_parser_get_mbox_marker()
- Date: Tue, 21 Mar 2017 11:58:38 +0000 (UTC)
commit 9554202eb2ee8a2ef56479e97572e31b2e4c3571
Author: Jeffrey Stedfast <jestedfa microsoft com>
Date: Tue Mar 21 07:57:06 2017 -0400
Renamed g_mime_parser_get_from() to g_mime_parser_get_mbox_marker()
PORTING | 4 ++++
docs/reference/changes-3.0.sgml | 2 ++
docs/reference/gmime-sections.txt | 4 ++--
gmime/gmime-parser.c | 32 ++++++++++++++++----------------
gmime/gmime-parser.h | 4 ++--
tests/test-mbox.c | 4 ++--
6 files changed, 28 insertions(+), 22 deletions(-)
---
diff --git a/PORTING b/PORTING
index 26221bd..1800364 100644
--- a/PORTING
+++ b/PORTING
@@ -139,6 +139,10 @@ Porting from GMime 2.6 to GMime 3.0
- g_mime_parser_[get,set]_scan_from() have been replaced by
g_mime_parser_[get,set]_format() which takes a GMimeFormat argument.
+- g_mime_parser_get_from() has been renamed to g_mime_parser_get_mbox_marker().
+
+- g_mime_parser_get_from_offset() has been renamed to g_mime_parser_get_mbox_marker_offset().
+
- g_mime_parser_construct_[part,message]() now take a GMimeParserOptions argument.
diff --git a/docs/reference/changes-3.0.sgml b/docs/reference/changes-3.0.sgml
index 9a774ff..63a679c 100644
--- a/docs/reference/changes-3.0.sgml
+++ b/docs/reference/changes-3.0.sgml
@@ -56,6 +56,8 @@
<listitem><para><function>g_mime_part_get_content_object()</function> has been renamed to
<function>g_mime_part_get_content()</function>.</para></listitem>
<listitem><para><function>g_mime_part_set_content_object()</function> has been renamed to
<function>g_mime_part_set_content()</function>.</para></listitem>
<listitem><para><function>g_mime_parser_get_scan_from()</function> and
<function>g_mime_parser_set_scan_from()</function> have been replaced by
<function>g_mime_parser_get_format()</function> and <function>g_mime_parser_get_format()</function> which
take a GMimeFormat argument.</para></listitem>
+ <listitem><para><function>g_mime_parser_get_from()</function> has been renamed to
<function>g_mime_parser_get_mbox_marker()</function>.</para></listitem>
+ <likstitem><para><function>g_mime_parser_get_from_offset()</function> has been renamed to
<function>g_mime_parser_get_mbox_marker_offset()</function>.</para></listitem>
<listitem><para><function>g_mime_parser_construct_message()</function> and
<function>g_mime_parser_construct_part()</function> now take a GMimeParserOptions argument.</para></listitem>
</itemizedlist>
</refsect1>
diff --git a/docs/reference/gmime-sections.txt b/docs/reference/gmime-sections.txt
index 2f01588..e222d5d 100644
--- a/docs/reference/gmime-sections.txt
+++ b/docs/reference/gmime-sections.txt
@@ -1285,8 +1285,8 @@ g_mime_parser_tell
g_mime_parser_eos
g_mime_parser_construct_part
g_mime_parser_construct_message
-g_mime_parser_get_from
-g_mime_parser_get_from_offset
+g_mime_parser_get_mbox_marker
+g_mime_parser_get_mbox_marker_offset
g_mime_parser_get_headers_begin
g_mime_parser_get_headers_end
diff --git a/gmime/gmime-parser.c b/gmime/gmime-parser.c
index 82740a9..e4a15ae 100644
--- a/gmime/gmime-parser.c
+++ b/gmime/gmime-parser.c
@@ -162,13 +162,13 @@ struct _GMimeParserPrivate {
char *inptr;
char *inend;
- gint64 from_offset;
- GByteArray *from_line;
-
GMimeParserHeaderRegexFunc header_cb;
gpointer user_data;
GRegex *regex;
+ GByteArray *marker;
+ gint64 marker_offset;
+
/* header buffer */
char *headerbuf;
char *headerptr;
@@ -385,8 +385,8 @@ parser_init (GMimeParser *parser, GMimeStream *stream)
priv->inptr = priv->inbuf;
priv->inend = priv->inbuf;
- priv->from_offset = -1;
- priv->from_line = g_byte_array_new ();
+ priv->marker_offset = -1;
+ priv->marker = g_byte_array_new ();
priv->headerbuf = g_malloc (HEADER_INIT_SIZE);
priv->headerleft = HEADER_INIT_SIZE - 1;
@@ -422,7 +422,7 @@ parser_close (GMimeParser *parser)
if (priv->stream)
g_object_unref (priv->stream);
- g_byte_array_free (priv->from_line, TRUE);
+ g_byte_array_free (priv->marker, TRUE);
g_free (priv->headerbuf);
g_free (priv->rawbuf);
@@ -770,7 +770,7 @@ parser_step_marker (GMimeParser *parser, const char *marker, size_t marker_len)
ssize_t left = 0;
size_t len;
- g_byte_array_set_size (priv->from_line, 0);
+ g_byte_array_set_size (priv->marker, 0);
inptr = priv->inptr;
@@ -805,10 +805,10 @@ parser_step_marker (GMimeParser *parser, const char *marker, size_t marker_len)
inptr++;
if (len >= marker_len && !strncmp (start, marker, marker_len)) {
- priv->from_offset = parser_offset (priv, start);
+ priv->marker_offset = parser_offset (priv, start);
if (priv->format == GMIME_FORMAT_MBOX)
- g_byte_array_append (priv->from_line, (unsigned char *) start, len);
+ g_byte_array_append (priv->marker, (unsigned char *) start, len);
goto got_marker;
}
}
@@ -2086,7 +2086,7 @@ g_mime_parser_construct_message (GMimeParser *parser, GMimeParserOptions *option
/**
- * g_mime_parser_get_from:
+ * g_mime_parser_get_mbox_marker:
* @parser: a #GMimeParser context
*
* Gets the mbox-style From-line of the most recently parsed message
@@ -2096,7 +2096,7 @@ g_mime_parser_construct_message (GMimeParser *parser, GMimeParserOptions *option
* message or %NULL on error.
**/
char *
-g_mime_parser_get_from (GMimeParser *parser)
+g_mime_parser_get_mbox_marker (GMimeParser *parser)
{
struct _GMimeParserPrivate *priv;
@@ -2106,15 +2106,15 @@ g_mime_parser_get_from (GMimeParser *parser)
if (priv->format != GMIME_FORMAT_MBOX)
return NULL;
- if (priv->from_line->len)
- return g_strndup ((char *) priv->from_line->data, priv->from_line->len);
+ if (priv->marker->len)
+ return g_strndup ((char *) priv->marker->data, priv->marker->len);
return NULL;
}
/**
- * g_mime_parser_get_from_offset:
+ * g_mime_parser_get_mbox_marker_offset:
* @parser: a #GMimeParser context
*
* Gets the offset of the most recently parsed mbox-style From-line
@@ -2124,7 +2124,7 @@ g_mime_parser_get_from (GMimeParser *parser)
* or %-1 on error.
**/
gint64
-g_mime_parser_get_from_offset (GMimeParser *parser)
+g_mime_parser_get_mbox_marker_offset (GMimeParser *parser)
{
struct _GMimeParserPrivate *priv;
@@ -2134,7 +2134,7 @@ g_mime_parser_get_from_offset (GMimeParser *parser)
if (priv->format != GMIME_FORMAT_MBOX)
return -1;
- return priv->from_offset;
+ return priv->marker_offset;
}
diff --git a/gmime/gmime-parser.h b/gmime/gmime-parser.h
index a4247b1..ebe1fcf 100644
--- a/gmime/gmime-parser.h
+++ b/gmime/gmime-parser.h
@@ -122,9 +122,9 @@ gint64 g_mime_parser_tell (GMimeParser *parser);
gboolean g_mime_parser_eos (GMimeParser *parser);
-char *g_mime_parser_get_from (GMimeParser *parser);
+char *g_mime_parser_get_mbox_marker (GMimeParser *parser);
+gint64 g_mime_parser_get_mbox_marker_offset (GMimeParser *parser);
-gint64 g_mime_parser_get_from_offset (GMimeParser *parser);
gint64 g_mime_parser_get_headers_begin (GMimeParser *parser);
gint64 g_mime_parser_get_headers_end (GMimeParser *parser);
diff --git a/tests/test-mbox.c b/tests/test-mbox.c
index 77fc243..1367031 100644
--- a/tests/test-mbox.c
+++ b/tests/test-mbox.c
@@ -128,8 +128,8 @@ test_parser (GMimeParser *parser, GMimeStream *mbox, GMimeStream *summary)
g_mime_stream_printf (summary, "header offsets: %" G_GINT64_FORMAT ", %" G_GINT64_FORMAT "\n",
headers_begin, headers_end);
- marker_offset = g_mime_parser_get_from_offset (parser);
- marker = g_mime_parser_get_from (parser);
+ marker_offset = g_mime_parser_get_mbox_marker_offset (parser);
+ marker = g_mime_parser_get_mbox_marker (parser);
g_mime_stream_printf (summary, "%s\n", marker);
if ((list = g_mime_message_get_from (message)) != NULL &&
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]