[gmime: 4/6] Register GMimeFormatOptions as a boxed type



commit d5202f478ff84a19dcf1438eba36abc374161dd6
Author: Jeffrey Stedfast <jestedfa microsoft com>
Date:   Thu Mar 30 10:16:32 2017 -0400

    Register GMimeFormatOptions as a boxed type

 gmime/gmime-format-options.c |   19 ++++++++++++++++++-
 gmime/gmime-format-options.h |    7 ++++++-
 2 files changed, 24 insertions(+), 2 deletions(-)
---
diff --git a/gmime/gmime-format-options.c b/gmime/gmime-format-options.c
index 18a2908..3883005 100644
--- a/gmime/gmime-format-options.c
+++ b/gmime/gmime-format-options.c
@@ -43,6 +43,8 @@ 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
 g_mime_format_options_init (void)
 {
@@ -112,7 +114,7 @@ g_mime_format_options_new (void)
  *
  * Clones a #GMimeFormatOptions.
  *
- * Returns: a newly allocated #GMimeFormatOptions.
+ * Returns: (transfer full): a newly allocated #GMimeFormatOptions.
  **/
 GMimeFormatOptions *
 _g_mime_format_options_clone (GMimeFormatOptions *options, gboolean hidden)
@@ -142,6 +144,21 @@ _g_mime_format_options_clone (GMimeFormatOptions *options, gboolean hidden)
 
 
 /**
+ * g_mime_format_options_clone:
+ * @options: a #GMimeFormatOptions
+ *
+ * Clones a #GMimeFormatOptions.
+ *
+ * Returns: (transfer full): a newly allocated #GMimeFormatOptions.
+ **/
+GMimeFormatOptions *
+g_mime_format_options_clone (GMimeFormatOptions *options)
+{
+       return _g_mime_format_options_clone (options, TRUE);
+}
+
+
+/**
  * g_mime_format_options_free:
  * @options: a #GMimeFormatOptions
  *
diff --git a/gmime/gmime-format-options.h b/gmime/gmime-format-options.h
index 870b7d3..abbac0f 100644
--- a/gmime/gmime-format-options.h
+++ b/gmime/gmime-format-options.h
@@ -22,11 +22,12 @@
 #ifndef __GMIME_FORMAT_OPTIONS_H__
 #define __GMIME_FORMAT_OPTIONS_H__
 
-#include <glib.h>
 #include <gmime/gmime-filter.h>
 
 G_BEGIN_DECLS
 
+#define GMIME_TYPE_FORMAT_OPTIONS (gmime_format_options_get_type ())
+
 /**
  * GMimeNewLineFormat:
  * @GMIME_NEWLINE_FORMAT_UNIX: The Unix New-Line format ("\n").
@@ -83,11 +84,15 @@ typedef struct {
        guint maxline;
 } GMimeFormatOptions;
 
+GType g_mime_format_options_get_type (void) G_GNUC_CONST;
+
 GMimeFormatOptions *g_mime_format_options_get_default (void);
 
 GMimeFormatOptions *g_mime_format_options_new (void);
 void g_mime_format_options_free (GMimeFormatOptions *options);
 
+GMimeFormatOptions *g_mime_format_options_clone (GMimeFormatOptions *options);
+
 GMimeParamEncodingMethod g_mime_format_options_get_param_encoding_method (GMimeFormatOptions *options);
 void g_mime_format_options_set_param_encoding_method (GMimeFormatOptions *options, GMimeParamEncodingMethod 
method);
 


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