[gmime: 1/4] Privatize the GMimeParserOptions and GMimeFormatOptions structs
- From: Jeffrey Stedfast <fejj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gmime: 1/4] Privatize the GMimeParserOptions and GMimeFormatOptions structs
- Date: Sat, 8 Apr 2017 14:46:50 +0000 (UTC)
commit aefa8e88888eb240296f0fdf66473ff35ba95a83
Author: Jeffrey Stedfast <jestedfa microsoft com>
Date: Sat Apr 8 07:59:42 2017 -0400
Privatize the GMimeParserOptions and GMimeFormatOptions structs
gmime/gmime-format-options.c | 14 +++++++++++---
gmime/gmime-format-options.h | 15 +--------------
gmime/gmime-parser-options.c | 11 +++++++++--
gmime/gmime-parser-options.h | 11 +----------
4 files changed, 22 insertions(+), 29 deletions(-)
---
diff --git a/gmime/gmime-format-options.c b/gmime/gmime-format-options.c
index 88528a6..a9d70c0 100644
--- a/gmime/gmime-format-options.c
+++ b/gmime/gmime-format-options.c
@@ -30,9 +30,6 @@
#include "gmime-filter-unix2dos.h"
-static GMimeFormatOptions *default_options = NULL;
-
-
/**
* SECTION: gmime-format-options
* @title: GMimeFormatOptions
@@ -43,6 +40,17 @@ static GMimeFormatOptions *default_options = NULL;
**/
+struct _GMimeFormatOptions {
+ GMimeParamEncodingMethod method;
+ GMimeNewLineFormat newline;
+ gboolean mixed_charsets;
+ gboolean international;
+ GPtrArray *hidden;
+ guint maxline;
+};
+
+static GMimeFormatOptions *default_options = NULL;
+
G_DEFINE_BOXED_TYPE (GMimeFormatOptions, g_mime_format_options, g_mime_format_options_clone,
g_mime_format_options_free);
void
diff --git a/gmime/gmime-format-options.h b/gmime/gmime-format-options.h
index be23194..680d9ed 100644
--- a/gmime/gmime-format-options.h
+++ b/gmime/gmime-format-options.h
@@ -66,23 +66,10 @@ typedef enum {
/**
* GMimeFormatOptions:
- * @method: The method to use for parameter encoding.
- * @newline: The new-line format to use.
- * @mixed_charsets: Whether or not to allow mixed charsets when encoding header values.
- * @international: Whether or not to allow internationalized header values.
- * @hidden: A list of hidden headers.
- * @maxline: The max line length to allow for encoded content.
*
* Format options for serializing various GMime objects.
**/
-typedef struct {
- GMimeParamEncodingMethod method;
- GMimeNewLineFormat newline;
- gboolean mixed_charsets;
- gboolean international;
- GPtrArray *hidden;
- guint maxline;
-} GMimeFormatOptions;
+typedef struct _GMimeFormatOptions GMimeFormatOptions;
GType g_mime_format_options_get_type (void);
diff --git a/gmime/gmime-parser-options.c b/gmime/gmime-parser-options.c
index 9531ae9..cb3fd9c 100644
--- a/gmime/gmime-parser-options.c
+++ b/gmime/gmime-parser-options.c
@@ -30,8 +30,6 @@
static char *default_charsets[3] = { "utf-8", "iso-8859-1", NULL };
-static GMimeParserOptions *default_options = NULL;
-
/**
* SECTION: gmime-parser-options
@@ -44,6 +42,15 @@ static GMimeParserOptions *default_options = NULL;
**/
+struct _GMimeParserOptions {
+ GMimeRfcComplianceMode addresses;
+ GMimeRfcComplianceMode parameters;
+ GMimeRfcComplianceMode rfc2047;
+ char **charsets;
+};
+
+static GMimeParserOptions *default_options = NULL;
+
G_DEFINE_BOXED_TYPE (GMimeParserOptions, g_mime_parser_options, g_mime_parser_options_clone,
g_mime_parser_options_free);
void
diff --git a/gmime/gmime-parser-options.h b/gmime/gmime-parser-options.h
index 31d9385..fc3bc28 100644
--- a/gmime/gmime-parser-options.h
+++ b/gmime/gmime-parser-options.h
@@ -43,19 +43,10 @@ typedef enum {
/**
* GMimeParserOptions:
- * @addresses: The compliance mode that should be used when parsing rfc822 addresses.
- * @parameters: The compliance mode that should be used when parsing Content-Type and Content-Disposition
parameters.
- * @rfc2047: The compliance mode that should be used when decoding rfc2047 encoded words.
- * @charsets: The fallback charsets to try when decoding 8-bit headers.
*
* A set of parser options used by #GMimeParser and various other parsing functions.
**/
-typedef struct {
- GMimeRfcComplianceMode addresses;
- GMimeRfcComplianceMode parameters;
- GMimeRfcComplianceMode rfc2047;
- char **charsets;
-} GMimeParserOptions;
+typedef struct _GMimeParserOptions GMimeParserOptions;
GType g_mime_parser_options_get_type (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]