[gmime] Added g_mime_references_get_type()



commit 4cca3dc74eb74dfecdcf13032940397506a3b456
Author: Jeffrey Stedfast <jestedfa microsoft com>
Date:   Thu Feb 23 18:37:07 2017 -0500

    Added g_mime_references_get_type()
    
    Patch by Evan Nemerson

 gmime/gmime-utils.c |    3 +++
 gmime/gmime-utils.h |    4 ++++
 gmime/gmime.c       |    6 +-----
 3 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/gmime/gmime-utils.c b/gmime/gmime-utils.c
index eb0d1f0..99f99a0 100644
--- a/gmime/gmime-utils.c
+++ b/gmime/gmime-utils.c
@@ -1006,6 +1006,9 @@ g_mime_utils_decode_message_id (const char *message_id)
 }
 
 
+G_DEFINE_BOXED_TYPE (GMimeReferences, g_mime_references, g_mime_references_copy, g_mime_references_free);
+
+
 /**
  * g_mime_references_decode:
  * @text: string containing a list of msg-ids
diff --git a/gmime/gmime-utils.h b/gmime/gmime-utils.h
index 4f0a8d3..8d1054d 100644
--- a/gmime/gmime-utils.h
+++ b/gmime/gmime-utils.h
@@ -23,6 +23,7 @@
 #define __GMIME_UTILS_H__
 
 #include <glib.h>
+#include <glib-object.h>
 #include <time.h>
 #include <stdarg.h>
 
@@ -31,6 +32,8 @@
 
 G_BEGIN_DECLS
 
+#define GMIME_TYPE_REFERENCES (gmime_references_get_type ())
+
 typedef struct _GMimeReferences GMimeReferences;
 
 /**
@@ -56,6 +59,7 @@ char *g_mime_utils_generate_message_id (const char *fqdn);
 char *g_mime_utils_decode_message_id (const char *message_id);
 
 /* decode a References or In-Reply-To header */
+GType g_mime_references_get_type (void) G_GNUC_CONST;
 GMimeReferences *g_mime_references_decode (const char *text);
 GMimeReferences *g_mime_references_copy (GMimeReferences *references);
 void g_mime_references_append (GMimeReferences **refs, const char *msgid);
diff --git a/gmime/gmime.c b/gmime/gmime.c
index 81eb621..2416e6a 100644
--- a/gmime/gmime.c
+++ b/gmime/gmime.c
@@ -128,11 +128,7 @@ g_mime_init (void)
        
        gmime_gpgme_error_quark = g_quark_from_static_string ("gmime-gpgme");
        gmime_error_quark = g_quark_from_static_string ("gmime");
-       
-       g_boxed_type_register_static ("GMimeReferences",
-                                     (GBoxedCopyFunc) g_mime_references_copy,
-                                     (GBoxedFreeFunc) g_mime_references_free);
-       
+
        /* register our GObject types with the GType system */
        g_mime_crypto_context_get_type ();
        g_mime_decrypt_result_get_type ();


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