CamelIMAPXStream: Add a private structure.
authorMatthew Barnes <mbarnes@redhat.com>
Wed, 29 Aug 2012 13:56:53 +0000 (09:56 -0400)
committerMatthew Barnes <mbarnes@redhat.com>
Thu, 30 Aug 2012 20:39:31 +0000 (16:39 -0400)
camel/camel-imapx-stream.c
camel/camel-imapx-stream.h
docs/reference/camel/camel-sections.txt

index 7ffcf3c..e0a5dd4 100644 (file)
 #include "camel-imapx-utils.h"
 #include "camel-imapx-stream.h"
 
+#define CAMEL_IMAPX_STREAM_GET_PRIVATE(obj) \
+       (G_TYPE_INSTANCE_GET_PRIVATE \
+       ((obj), CAMEL_TYPE_IMAPX_STREAM, CamelIMAPXStreamPrivate))
+
 #define t(...) camel_imapx_debug(token, __VA_ARGS__)
 #define io(...) camel_imapx_debug(io, __VA_ARGS__)
 
+struct _CamelIMAPXStreamPrivate {
+       gint placeholder;
+};
+
 G_DEFINE_TYPE (CamelIMAPXStream, camel_imapx_stream, CAMEL_TYPE_STREAM)
 
 static gint
@@ -192,6 +200,8 @@ camel_imapx_stream_class_init (CamelIMAPXStreamClass *class)
        GObjectClass *object_class;
        CamelStreamClass *stream_class;
 
+       g_type_class_add_private (class, sizeof (CamelIMAPXStreamPrivate));
+
        object_class = G_OBJECT_CLASS (class);
        object_class->dispose = imapx_stream_dispose;
        object_class->finalize = imapx_stream_finalize;
@@ -207,6 +217,8 @@ camel_imapx_stream_class_init (CamelIMAPXStreamClass *class)
 static void
 camel_imapx_stream_init (CamelIMAPXStream *is)
 {
+       is->priv = CAMEL_IMAPX_STREAM_GET_PRIVATE (is);
+
        /* +1 is room for appending a 0 if we need to for a token */
        is->bufsize = 4096;
        is->ptr = is->end = is->buf = g_malloc (is->bufsize + 1);
index ec9a533..2c534e3 100644 (file)
@@ -55,6 +55,7 @@ G_BEGIN_DECLS
 
 typedef struct _CamelIMAPXStream CamelIMAPXStream;
 typedef struct _CamelIMAPXStreamClass CamelIMAPXStreamClass;
+typedef struct _CamelIMAPXStreamPrivate CamelIMAPXStreamPrivate;
 
 typedef enum {
        IMAPX_TOK_PROTOCOL = -2,
@@ -67,6 +68,7 @@ typedef enum {
 
 struct _CamelIMAPXStream {
        CamelStream parent;
+       CamelIMAPXStreamPrivate *priv;
 
        CamelStream *source;
        gchar tagprefix; /* For debugging output */
index 16f62a4..c9b3dcf 100644 (file)
@@ -1000,6 +1000,7 @@ CAMEL_IS_IMAPX_STREAM_CLASS
 CAMEL_IMAPX_STREAM_GET_CLASS
 CamelIMAPXStreamClass
 <SUBSECTION Private>
+CamelIMAPXStreamPrivate
 camel_imapx_stream_get_type
 </SECTION>