[evolution-data-server/account-mgmt: 1/28] Revert "Bug #614480 - Avoid using G_TYPE_INSTANCE_GET_PRIVATE repeatedly"
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/account-mgmt: 1/28] Revert "Bug #614480 - Avoid using G_TYPE_INSTANCE_GET_PRIVATE repeatedly"
- Date: Wed, 2 Mar 2011 03:45:06 +0000 (UTC)
commit 247ba56dff166dc8bd2f5f44cafc60927d62e661
Author: Matthew Barnes <mbarnes redhat com>
Date: Thu Feb 24 08:21:16 2011 -0500
Revert "Bug #614480 - Avoid using G_TYPE_INSTANCE_GET_PRIVATE repeatedly"
This reverts commit 5630aa0f4577d389658be4517db13d2f19924db4.
addressbook/libebook/e-book-view.c | 14 ++-
addressbook/libebook/e-book.c | 20 ++--
addressbook/libedata-book/e-book-backend-cache.c | 6 +-
addressbook/libedata-book/e-book-backend.c | 10 +-
addressbook/libedata-book/e-data-book-factory.c | 4 +-
addressbook/libedata-book/e-data-book-view.c | 8 +-
calendar/backends/caldav/e-cal-backend-caldav.c | 138 ++++++++++----------
calendar/backends/caldav/e-cal-backend-caldav.h | 8 +-
calendar/libecal/e-cal-view.c | 11 +-
calendar/libecal/e-cal.c | 3 +-
calendar/libedata-cal/e-cal-backend-cache.c | 8 +-
calendar/libedata-cal/e-cal-backend-file-store.c | 58 +++++----
calendar/libedata-cal/e-cal-backend-intervaltree.c | 8 +-
calendar/libedata-cal/e-cal-backend-store.c | 31 +++--
calendar/libedata-cal/e-cal-backend.c | 8 +-
calendar/libedata-cal/e-data-cal-factory.c | 4 +-
calendar/libedata-cal/e-data-cal-view.c | 3 +-
calendar/libedata-cal/e-data-cal.c | 4 +-
camel/camel-certdb.c | 9 +-
camel/camel-cipher-context.c | 10 +-
camel/camel-data-cache.c | 8 +-
camel/camel-data-wrapper.c | 6 +-
camel/camel-disco-folder.c | 6 +-
camel/camel-filter-driver.c | 130 +++++++++++--------
camel/camel-folder-search.c | 6 +-
camel/camel-folder-summary.c | 32 +++--
camel/camel-folder.c | 9 +-
camel/camel-gpg-context.c | 6 +-
camel/camel-index.c | 6 +-
camel/camel-medium.c | 8 +-
camel/camel-mime-filter-basic.c | 12 +-
camel/camel-mime-filter-bestenc.c | 14 ++-
camel/camel-mime-filter-canon.c | 8 +-
camel/camel-mime-filter-charset.c | 26 ++--
camel/camel-mime-filter-crlf.c | 12 +-
camel/camel-mime-filter-enriched.c | 18 ++-
camel/camel-mime-filter-from.c | 8 +-
camel/camel-mime-filter-gzip.c | 20 ++-
camel/camel-mime-filter-html.c | 12 +-
camel/camel-mime-filter-index.c | 29 +++--
camel/camel-mime-filter-linewrap.c | 12 +-
camel/camel-mime-filter-pgp.c | 10 +-
camel/camel-mime-filter-progress.c | 14 ++-
camel/camel-mime-filter-save.c | 10 +-
camel/camel-mime-filter-tohtml.c | 17 ++-
camel/camel-mime-filter-windows.c | 14 ++-
camel/camel-mime-filter-yenc.c | 14 ++-
camel/camel-mime-filter.c | 8 +-
camel/camel-mime-part.c | 8 +-
camel/camel-object.c | 8 +-
camel/camel-offline-folder.c | 6 +-
camel/camel-offline-store.c | 6 +-
camel/camel-operation.c | 8 +-
camel/camel-partition-table.c | 12 ++-
camel/camel-sasl-cram-md5.c | 6 +-
camel/camel-sasl-digest-md5.c | 6 +-
camel/camel-sasl-gssapi.c | 9 +-
camel/camel-sasl-login.c | 8 +-
camel/camel-sasl-ntlm.c | 6 +-
camel/camel-sasl-plain.c | 6 +-
camel/camel-sasl-popb4smtp.c | 6 +-
camel/camel-sasl.c | 10 +-
camel/camel-service.c | 6 +-
camel/camel-session.c | 7 +-
camel/camel-smime-context.c | 7 +-
camel/camel-store-summary.c | 7 +-
camel/camel-store.c | 6 +-
camel/camel-stream-buffer.c | 25 ++--
camel/camel-stream-filter.c | 25 ++--
camel/camel-stream-fs.c | 22 ++--
camel/camel-stream-mem.c | 20 ++-
camel/camel-tcp-stream-raw.c | 6 +-
camel/camel-tcp-stream-ssl.c | 10 +-
camel/camel-tcp-stream.c | 6 +-
camel/camel-text-index.c | 90 ++++++++-----
camel/camel-transport.c | 8 +-
camel/camel-vee-folder.c | 46 ++++---
camel/providers/groupwise/camel-groupwise-folder.c | 6 +-
camel/providers/groupwise/camel-groupwise-store.c | 7 +-
camel/providers/imap/camel-imap-folder.c | 6 +-
camel/providers/imap/camel-imap-wrapper.c | 6 +-
camel/providers/imapx/camel-imapx-conn-manager.c | 9 +-
camel/providers/local/camel-local-folder.c | 6 +-
camel/providers/local/camel-maildir-summary.c | 9 +-
camel/providers/local/camel-mh-summary.c | 6 +-
camel/providers/nntp/camel-nntp-folder.c | 6 +-
camel/providers/nntp/camel-nntp-store.c | 6 +-
camel/providers/nntp/camel-nntp-summary.c | 6 +-
libedataserver/e-proxy.c | 8 +-
libedataserver/e-soap-message.c | 57 ++++----
libedataserver/e-soap-message.h | 3 -
libedataserver/e-soap-response.c | 28 ++--
libedataserver/e-soap-response.h | 3 -
libedataserverui/e-categories-dialog.c | 10 +-
libedataserverui/e-category-completion.c | 7 +-
libedataserverui/e-cell-renderer-color.c | 14 ++-
libedataserverui/e-contact-store.c | 10 +-
libedataserverui/e-destination-store.c | 11 +-
libedataserverui/e-name-selector-dialog.c | 13 ++-
libedataserverui/e-name-selector-entry.c | 19 ++-
libedataserverui/e-name-selector-list.c | 7 +-
libedataserverui/e-name-selector-model.c | 9 +-
libedataserverui/e-name-selector.c | 16 ++-
libedataserverui/e-source-combo-box.c | 12 ++-
libedataserverui/e-source-selector.c | 10 +-
libedataserverui/e-tree-model-generator.c | 7 +-
servers/groupwise/soup-soap-message.c | 57 ++++----
servers/groupwise/soup-soap-message.h | 3 -
servers/groupwise/soup-soap-response.c | 28 ++--
servers/groupwise/soup-soap-response.h | 3 -
110 files changed, 1041 insertions(+), 603 deletions(-)
---
diff --git a/addressbook/libebook/e-book-view.c b/addressbook/libebook/e-book-view.c
index c8e280a..93ce01b 100644
--- a/addressbook/libebook/e-book-view.c
+++ b/addressbook/libebook/e-book-view.c
@@ -30,6 +30,9 @@
G_DEFINE_TYPE (EBookView, e_book_view, G_TYPE_OBJECT);
+#define E_BOOK_VIEW_GET_PRIVATE(o) \
+ (G_TYPE_INSTANCE_GET_PRIVATE ((o), E_TYPE_BOOK_VIEW, EBookViewPrivate))
+
struct _EBookViewPrivate {
EGdbusBookView *gdbus_bookview;
EBook *book;
@@ -266,10 +269,13 @@ e_book_view_stop (EBookView *book_view)
static void
e_book_view_init (EBookView *book_view)
{
- book_view->priv = G_TYPE_INSTANCE_GET_PRIVATE (book_view, E_TYPE_BOOK_VIEW, EBookViewPrivate);
- book_view->priv->gdbus_bookview = NULL;
- book_view->priv->book = NULL;
- book_view->priv->running = FALSE;
+ EBookViewPrivate *priv = E_BOOK_VIEW_GET_PRIVATE (book_view);
+
+ priv->gdbus_bookview = NULL;
+ priv->book = NULL;
+ priv->running = FALSE;
+
+ book_view->priv = priv;
}
static void
diff --git a/addressbook/libebook/e-book.c b/addressbook/libebook/e-book.c
index 8f26481..e63cce8 100644
--- a/addressbook/libebook/e-book.c
+++ b/addressbook/libebook/e-book.c
@@ -53,6 +53,7 @@ static EList *array_to_elist (gchar **list);
static gboolean unwrap_gerror (GError *error, GError **client_error);
G_DEFINE_TYPE (EBook, e_book, G_TYPE_OBJECT)
+#define E_BOOK_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), E_TYPE_BOOK, EBookPrivate))
enum {
WRITABLE_STATUS,
@@ -248,20 +249,21 @@ e_book_class_init (EBookClass *e_book_class)
static void
e_book_init (EBook *book)
{
- book->priv = G_TYPE_INSTANCE_GET_PRIVATE (book, E_TYPE_BOOK, EBookPrivate);
+ EBookPrivate *priv = E_BOOK_GET_PRIVATE (book);
LOCK_FACTORY ();
active_books++;
UNLOCK_FACTORY ();
- book->priv->gdbus_book = NULL;
- book->priv->source = NULL;
- book->priv->uri = NULL;
- book->priv->loaded = FALSE;
- book->priv->writable = FALSE;
- book->priv->connected = FALSE;
- book->priv->cap = NULL;
- book->priv->cap_queried = FALSE;
+ priv->gdbus_book = NULL;
+ priv->source = NULL;
+ priv->uri = NULL;
+ priv->loaded = FALSE;
+ priv->writable = FALSE;
+ priv->connected = FALSE;
+ priv->cap = NULL;
+ priv->cap_queried = FALSE;
+ book->priv = priv;
}
static void
diff --git a/addressbook/libedata-book/e-book-backend-cache.c b/addressbook/libedata-book/e-book-backend-cache.c
index 4d297a3..df1a2c6 100644
--- a/addressbook/libedata-book/e-book-backend-cache.c
+++ b/addressbook/libedata-book/e-book-backend-cache.c
@@ -28,6 +28,10 @@
#include "e-book-backend-cache.h"
#include "e-book-backend-sexp.h"
+#define E_BOOK_BACKEND_CACHE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_BOOK_BACKEND_CACHE, EBookBackendCachePrivate))
+
struct _EBookBackendCachePrivate {
gint placeholder;
};
@@ -43,7 +47,7 @@ e_book_backend_cache_class_init (EBookBackendCacheClass *class)
static void
e_book_backend_cache_init (EBookBackendCache *cache)
{
- cache->priv = G_TYPE_INSTANCE_GET_PRIVATE (cache, E_TYPE_BOOK_BACKEND_CACHE, EBookBackendCachePrivate);
+ cache->priv = E_BOOK_BACKEND_CACHE_GET_PRIVATE (cache);
}
/**
diff --git a/addressbook/libedata-book/e-book-backend.c b/addressbook/libedata-book/e-book-backend.c
index 17a1927..2c0be6a 100644
--- a/addressbook/libedata-book/e-book-backend.c
+++ b/addressbook/libedata-book/e-book-backend.c
@@ -14,6 +14,10 @@
#include "e-data-book.h"
#include "e-book-backend.h"
+#define E_BOOK_BACKEND_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_BOOK_BACKEND, EBookBackendPrivate))
+
struct _EBookBackendPrivate {
GMutex *open_mutex;
@@ -108,7 +112,7 @@ book_backend_dispose (GObject *object)
{
EBookBackendPrivate *priv;
- priv = E_BOOK_BACKEND (object)->priv;
+ priv = E_BOOK_BACKEND_GET_PRIVATE (object);
if (priv->views != NULL) {
g_object_unref (priv->views);
@@ -129,7 +133,7 @@ book_backend_finalize (GObject *object)
{
EBookBackendPrivate *priv;
- priv = E_BOOK_BACKEND (object)->priv;
+ priv = E_BOOK_BACKEND_GET_PRIVATE (object);
g_list_free (priv->clients);
@@ -179,7 +183,7 @@ e_book_backend_class_init (EBookBackendClass *class)
static void
e_book_backend_init (EBookBackend *backend)
{
- backend->priv = G_TYPE_INSTANCE_GET_PRIVATE (backend, E_TYPE_BOOK_BACKEND, EBookBackendPrivate);
+ backend->priv = E_BOOK_BACKEND_GET_PRIVATE (backend);
backend->priv->views = e_list_new (
(EListCopyFunc) NULL, (EListFreeFunc) NULL, NULL);
diff --git a/addressbook/libedata-book/e-data-book-factory.c b/addressbook/libedata-book/e-data-book-factory.c
index 8308191..c5c6998 100644
--- a/addressbook/libedata-book/e-data-book-factory.c
+++ b/addressbook/libedata-book/e-data-book-factory.c
@@ -65,6 +65,8 @@ static gboolean opt_keep_running = FALSE;
G_DEFINE_TYPE (EDataBookFactory, e_data_book_factory, G_TYPE_OBJECT);
+#define E_DATA_BOOK_FACTORY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), E_TYPE_DATA_BOOK_FACTORY, EDataBookFactoryPrivate))
+
struct _EDataBookFactoryPrivate {
EGdbusBookFactory *gdbus_object;
@@ -417,7 +419,7 @@ e_data_book_factory_init (EDataBookFactory *factory)
{
GError *error = NULL;
- factory->priv = G_TYPE_INSTANCE_GET_PRIVATE (factory, E_TYPE_DATA_BOOK_FACTORY, EDataBookFactoryPrivate);
+ factory->priv = E_DATA_BOOK_FACTORY_GET_PRIVATE (factory);
factory->priv->gdbus_object = e_gdbus_book_factory_stub_new ();
g_signal_connect (factory->priv->gdbus_object, "handle-get-book", G_CALLBACK (impl_BookFactory_getBook), factory);
diff --git a/addressbook/libedata-book/e-data-book-view.c b/addressbook/libedata-book/e-data-book-view.c
index 061bbbf..3b2a850 100644
--- a/addressbook/libedata-book/e-data-book-view.c
+++ b/addressbook/libedata-book/e-data-book-view.c
@@ -35,6 +35,7 @@ static void reset_array (GArray *array);
static void ensure_pending_flush_timeout (EDataBookView *view);
G_DEFINE_TYPE (EDataBookView, e_data_book_view, G_TYPE_OBJECT);
+#define E_DATA_BOOK_VIEW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), E_TYPE_DATA_BOOK_VIEW, EDataBookViewPrivate))
#define THRESHOLD_ITEMS 32 /* how many items can be hold in a cache, before propagated to UI */
#define THRESHOLD_SECONDS 2 /* how long to wait until notifications are propagated to UI; in seconds */
@@ -433,7 +434,7 @@ e_data_book_view_notify_update_prefiltered_vcard (EDataBookView *book_view, cons
void
e_data_book_view_notify_remove (EDataBookView *book_view, const gchar *id)
{
- EDataBookViewPrivate *priv = book_view->priv;
+ EDataBookViewPrivate *priv = E_DATA_BOOK_VIEW_GET_PRIVATE (book_view);
if (!priv->running)
return;
@@ -492,7 +493,7 @@ e_data_book_view_notify_complete (EDataBookView *book_view, const GError *error)
void
e_data_book_view_notify_status_message (EDataBookView *book_view, const gchar *message)
{
- EDataBookViewPrivate *priv = book_view->priv;
+ EDataBookViewPrivate *priv = E_DATA_BOOK_VIEW_GET_PRIVATE (book_view);
gchar *gdbus_message = NULL;
if (!priv->running)
@@ -595,8 +596,7 @@ impl_DataBookView_dispose (EGdbusBookView *object, GDBusMethodInvocation *invoca
static void
e_data_book_view_init (EDataBookView *book_view)
{
- EDataBookViewPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (book_view, E_TYPE_DATA_BOOK_VIEW, EDataBookViewPrivate);
-
+ EDataBookViewPrivate *priv = E_DATA_BOOK_VIEW_GET_PRIVATE (book_view);
book_view->priv = priv;
priv->gdbus_object = e_gdbus_book_view_stub_new ();
diff --git a/calendar/backends/caldav/e-cal-backend-caldav.c b/calendar/backends/caldav/e-cal-backend-caldav.c
index bfda9c1..5de656b 100644
--- a/calendar/backends/caldav/e-cal-backend-caldav.c
+++ b/calendar/backends/caldav/e-cal-backend-caldav.c
@@ -291,7 +291,7 @@ put_component_to_store (ECalBackendCalDAV *cbdav,
time_t time_start, time_end;
ECalBackendCalDAVPrivate *priv;
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
e_cal_util_get_component_occur_times (comp, &time_start, &time_end,
resolve_tzid, cbdav, icaltimezone_get_utc_timezone (),
@@ -562,7 +562,7 @@ check_state (ECalBackendCalDAV *cbdav, gboolean *online, GError **perror)
{
ECalBackendCalDAVPrivate *priv;
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
*online = FALSE;
@@ -903,7 +903,7 @@ soup_authenticate (SoupSession *session,
ECalBackendCalDAV *cbdav;
cbdav = E_CAL_BACKEND_CALDAV (data);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
/* do not send same password twice, but keep it for later use */
if (!retrying)
@@ -980,7 +980,7 @@ caldav_generate_uri (ECalBackendCalDAV *cbdav, const gchar *target)
gchar *uri;
const gchar *slash;
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
slash = strrchr (target, '/');
if (slash)
@@ -1005,7 +1005,7 @@ caldav_server_open_calendar (ECalBackendCalDAV *cbdav, gboolean *server_unreacha
g_return_val_if_fail (cbdav != NULL, FALSE);
g_return_val_if_fail (server_unreachable != NULL, FALSE);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
/* FIXME: setup text_uri */
@@ -1079,7 +1079,7 @@ check_calendar_changed_on_server (ECalBackendCalDAV *cbdav)
g_return_val_if_fail (cbdav != NULL, TRUE);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
/* no support for 'getctag', thus update cache */
if (!priv->ctag_supported)
@@ -1173,7 +1173,7 @@ caldav_server_list_objects (ECalBackendCalDAV *cbdav, CalDAVObject **objs, gint
xmlNsPtr nscd;
gboolean result;
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
/* Allocate the soup message */
message = soup_message_new ("REPORT", priv->uri);
if (message == NULL)
@@ -1297,7 +1297,7 @@ caldav_server_get_object (ECalBackendCalDAV *cbdav, CalDAVObject *object, GError
const gchar *hdr;
gchar *uri;
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
g_assert (object != NULL && object->href != NULL);
@@ -1362,7 +1362,7 @@ caldav_post_freebusy (ECalBackendCalDAV *cbdav, const gchar *url, gchar **post_f
e_return_data_cal_error_if_fail (post_fb != NULL, InvalidArg);
e_return_data_cal_error_if_fail (*post_fb != NULL, InvalidArg);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
message = soup_message_new (SOUP_METHOD_POST, url);
if (message == NULL) {
@@ -1400,7 +1400,7 @@ caldav_server_put_object (ECalBackendCalDAV *cbdav, CalDAVObject *object, icalco
const gchar *hdr;
gchar *uri;
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
hdr = NULL;
g_assert (object != NULL && object->cdata != NULL);
@@ -1513,7 +1513,7 @@ caldav_server_delete_object (ECalBackendCalDAV *cbdav, CalDAVObject *object, GEr
SoupMessage *message;
gchar *uri;
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
g_assert (object != NULL && object->href != NULL);
@@ -1553,7 +1553,7 @@ caldav_receive_schedule_outbox_url (ECalBackendCalDAV *cbdav)
g_return_val_if_fail (cbdav != NULL, FALSE);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
g_return_val_if_fail (priv != NULL, FALSE);
g_return_val_if_fail (priv->schedule_outbox_url == NULL, TRUE);
@@ -1679,7 +1679,7 @@ remove_complist_from_cache_and_notify_cb (gpointer key, gpointer value, gpointer
GSList *l;
struct cache_comp_list *ccl = value;
ECalBackendCalDAV *cbdav = data;
- ECalBackendCalDAVPrivate *priv = cbdav->priv;
+ ECalBackendCalDAVPrivate *priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
for (l = ccl->slist; l; l = l->next) {
ECalComponent *old_comp = l->data;
@@ -1742,7 +1742,7 @@ synchronize_cache (ECalBackendCalDAV *cbdav, time_t start_time, time_t end_time)
return;
}
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
bkend = E_CAL_BACKEND (cbdav);
len = 0;
sobjs = NULL;
@@ -2052,7 +2052,7 @@ caldav_synch_slave_loop (gpointer data)
gboolean know_unreachable;
cbdav = E_CAL_BACKEND_CALDAV (data);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
g_mutex_lock (priv->busy_lock);
@@ -2185,7 +2185,7 @@ get_usermail (ECalBackend *backend)
}
cbdav = E_CAL_BACKEND_CALDAV (backend);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
if (priv && priv->is_google && priv->username) {
res = maybe_append_email_domain (priv->username, "@gmail.com");
@@ -2207,7 +2207,7 @@ caldav_is_read_only (ECalBackendSync *backend,
ECalBackendCalDAVPrivate *priv;
cbdav = E_CAL_BACKEND_CALDAV (backend);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
/* no write support in offline mode yet! */
if (priv->mode == CAL_MODE_LOCAL) {
@@ -2287,7 +2287,7 @@ initialize_backend (ECalBackendCalDAV *cbdav, GError **perror)
const gchar *refresh;
const gchar *cache_dir;
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
backend = E_CAL_BACKEND (cbdav);
source = e_cal_backend_get_source (backend);
@@ -2442,7 +2442,7 @@ caldav_do_open (ECalBackendSync *backend,
ECalBackendCalDAVPrivate *priv;
cbdav = E_CAL_BACKEND_CALDAV (backend);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
g_mutex_lock (priv->busy_lock);
@@ -2516,7 +2516,7 @@ caldav_refresh (ECalBackendSync *backend, EDataCal *cal, GError **perror)
gboolean online;
cbdav = E_CAL_BACKEND_CALDAV (backend);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
g_mutex_lock (priv->busy_lock);
@@ -2545,7 +2545,7 @@ caldav_remove (ECalBackendSync *backend,
gboolean online;
cbdav = E_CAL_BACKEND_CALDAV (backend);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
/* first tell it to die, then wait for its lock */
priv->slave_cmd = SLAVE_SHOULD_DIE;
@@ -2600,7 +2600,7 @@ remove_comp_from_cache (ECalBackendCalDAV *cbdav, const gchar *uid, const gchar
ECalBackendCalDAVPrivate *priv;
gboolean res = FALSE;
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
if (!rid || !*rid) {
/* get with detached instances */
@@ -2660,7 +2660,7 @@ get_comp_from_cache (ECalBackendCalDAV *cbdav, const gchar *uid, const gchar *ri
ECalBackendCalDAVPrivate *priv;
icalcomponent *icalcomp = NULL;
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
if (rid == NULL || !*rid) {
/* get with detached instances */
@@ -3015,7 +3015,7 @@ remove_cached_attachment (ECalBackendCalDAV *cbdav, const gchar *uid)
g_return_if_fail (cbdav != NULL);
g_return_if_fail (uid != NULL);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
l = e_cal_backend_store_get_components_by_uid (priv->store, uid);
len = g_slist_length (l);
g_slist_foreach (l, (GFunc)g_object_unref, NULL);
@@ -3080,7 +3080,7 @@ add_timezones_from_component (ECalBackendCalDAV *cbdav, icalcomponent *vcal_comp
g_return_if_fail (vcal_comp != NULL);
g_return_if_fail (icalcomp != NULL);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
f_data.store = priv->store;
f_data.vcal_comp = vcal_comp;
@@ -3186,7 +3186,7 @@ cache_contains (ECalBackendCalDAV *cbdav, const gchar *uid, const gchar *rid)
g_return_val_if_fail (cbdav != NULL, FALSE);
g_return_val_if_fail (uid != NULL, FALSE);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
g_return_val_if_fail (priv != NULL && priv->store != NULL, FALSE);
comp = e_cal_backend_store_get_component (priv->store, uid, rid);
@@ -3419,7 +3419,7 @@ do_modify_object (ECalBackendCalDAV *cbdav, const gchar *calobj, CalObjModType m
struct icaltimetype current;
gchar *href = NULL, *etag = NULL;
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
if (new_object)
*new_object = NULL;
@@ -3585,7 +3585,7 @@ do_remove_object (ECalBackendCalDAV *cbdav, const gchar *uid, const gchar *rid,
gboolean online;
gchar *href = NULL, *etag = NULL;
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
if (object)
*object = NULL;
@@ -3728,7 +3728,7 @@ extract_timezones (ECalBackendCalDAV *cbdav, icalcomponent *icomp)
return FALSE;
}
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
zone = icaltimezone_new ();
for (iter = timezones; iter; iter = iter->next) {
@@ -3922,7 +3922,7 @@ do_receive_objects (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj
}
#define caldav_busy_stub(_func_name, _params, _call_func, _call_params) \
-static void \
+static void \
_func_name _params \
{ \
ECalBackendCalDAV *cbdav; \
@@ -3931,7 +3931,7 @@ _func_name _params \
gboolean was_slave_busy; \
\
cbdav = E_CAL_BACKEND_CALDAV (backend); \
- priv = cbdav->priv; \
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav); \
\
/* this is done before locking */ \
old_slave_cmd = priv->slave_cmd; \
@@ -3942,7 +3942,7 @@ _func_name _params \
} \
\
g_mutex_lock (priv->busy_lock); \
- _call_func _call_params; \
+ _call_func _call_params; \
\
/* this is done before unlocking */ \
if (was_slave_busy) { \
@@ -4043,7 +4043,7 @@ caldav_add_timezone (ECalBackendSync *backend,
e_return_data_cal_error_if_fail (E_IS_CAL_BACKEND_CALDAV (cbdav), InvalidArg);
e_return_data_cal_error_if_fail (tzobj != NULL, InvalidArg);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
tz_comp = icalparser_parse_string (tzobj);
if (!tz_comp) {
@@ -4080,7 +4080,7 @@ caldav_set_default_zone (ECalBackendSync *backend,
e_return_data_cal_error_if_fail (tzobj != NULL, InvalidArg);
cbdav = E_CAL_BACKEND_CALDAV (backend);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
tz_comp = icalparser_parse_string (tzobj);
if (!tz_comp) {
@@ -4115,7 +4115,7 @@ caldav_get_object_list (ECalBackendSync *backend,
gboolean prunning_by_time;
cbdav = E_CAL_BACKEND_CALDAV (backend);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
sexp = e_cal_backend_sexp_new (sexp_string);
@@ -4173,7 +4173,7 @@ caldav_start_query (ECalBackend *backend,
time_t occur_start = -1, occur_end = -1;
gboolean prunning_by_time;
cbdav = E_CAL_BACKEND_CALDAV (backend);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
sexp_string = e_data_cal_view_get_text (query);
sexp = e_cal_backend_sexp_new (sexp_string);
@@ -4236,7 +4236,7 @@ caldav_get_free_busy (ECalBackendSync *backend,
GError *err = NULL;
cbdav = E_CAL_BACKEND_CALDAV (backend);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
e_return_data_cal_error_if_fail (priv != NULL, InvalidArg);
e_return_data_cal_error_if_fail (users != NULL, InvalidArg);
@@ -4424,7 +4424,7 @@ caldav_is_loaded (ECalBackend *backend)
ECalBackendCalDAVPrivate *priv;
cbdav = E_CAL_BACKEND_CALDAV (backend);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
return priv->loaded;
}
@@ -4436,7 +4436,7 @@ caldav_get_mode (ECalBackend *backend)
ECalBackendCalDAVPrivate *priv;
cbdav = E_CAL_BACKEND_CALDAV (backend);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
return priv->mode;
}
@@ -4448,7 +4448,7 @@ caldav_set_mode (ECalBackend *backend, CalMode mode)
ECalBackendCalDAVPrivate *priv;
cbdav = E_CAL_BACKEND_CALDAV (backend);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
/*g_mutex_lock (priv->busy_lock);*/
@@ -4498,7 +4498,7 @@ caldav_internal_get_default_timezone (ECalBackend *backend)
g_return_val_if_fail (E_IS_CAL_BACKEND_CALDAV (backend), NULL);
cbdav = E_CAL_BACKEND_CALDAV (backend);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
g_return_val_if_fail (priv->default_zone != NULL, NULL);
@@ -4514,7 +4514,7 @@ caldav_internal_get_timezone (ECalBackend *backend,
ECalBackendCalDAVPrivate *priv;
cbdav = E_CAL_BACKEND_CALDAV (backend);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
zone = NULL;
if (priv->store)
@@ -4536,7 +4536,7 @@ caldav_source_changed_cb (ESource *source, ECalBackendCalDAV *cbdav)
g_return_if_fail (source != NULL);
g_return_if_fail (cbdav != NULL);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
g_return_if_fail (priv != NULL);
old_slave_cmd = priv->slave_cmd;
@@ -4570,7 +4570,7 @@ e_cal_backend_caldav_dispose (GObject *object)
ESource *source;
cbdav = E_CAL_BACKEND_CALDAV (object);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
/* tell the slave to stop before acquiring a lock,
as it can work at the moment, and lock can be locked */
@@ -4621,7 +4621,7 @@ e_cal_backend_caldav_finalize (GObject *object)
ECalBackendCalDAVPrivate *priv;
cbdav = E_CAL_BACKEND_CALDAV (object);
- priv = cbdav->priv;
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
g_mutex_free (priv->busy_lock);
g_cond_free (priv->cond);
@@ -4639,43 +4639,45 @@ e_cal_backend_caldav_finalize (GObject *object)
static void
e_cal_backend_caldav_init (ECalBackendCalDAV *cbdav)
{
- cbdav->priv = G_TYPE_INSTANCE_GET_PRIVATE (cbdav, E_TYPE_CAL_BACKEND_CALDAV, ECalBackendCalDAVPrivate);
+ ECalBackendCalDAVPrivate *priv;
+
+ priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
- cbdav->priv->session = soup_session_sync_new ();
- g_object_set (cbdav->priv->session, SOUP_SESSION_TIMEOUT, 90, NULL);
+ priv->session = soup_session_sync_new ();
+ g_object_set (priv->session, SOUP_SESSION_TIMEOUT, 90, NULL);
- cbdav->priv->proxy = e_proxy_new ();
- e_proxy_setup_proxy (cbdav->priv->proxy);
- g_signal_connect (cbdav->priv->proxy, "changed", G_CALLBACK (proxy_settings_changed), cbdav->priv);
+ priv->proxy = e_proxy_new ();
+ e_proxy_setup_proxy (priv->proxy);
+ g_signal_connect (priv->proxy, "changed", G_CALLBACK (proxy_settings_changed), priv);
if (G_UNLIKELY (caldav_debug_show (DEBUG_MESSAGE)))
- caldav_debug_setup (cbdav->priv->session);
+ caldav_debug_setup (priv->session);
- cbdav->priv->default_zone = icaltimezone_get_utc_timezone ();
+ priv->default_zone = icaltimezone_get_utc_timezone ();
- cbdav->priv->disposed = FALSE;
- cbdav->priv->loaded = FALSE;
- cbdav->priv->opened = FALSE;
+ priv->disposed = FALSE;
+ priv->loaded = FALSE;
+ priv->opened = FALSE;
/* Thinks the 'getctag' extension is available the first time, but unset it when realizes it isn't. */
- cbdav->priv->ctag_supported = TRUE;
- cbdav->priv->ctag_to_store = NULL;
+ priv->ctag_supported = TRUE;
+ priv->ctag_to_store = NULL;
- cbdav->priv->schedule_outbox_url = NULL;
+ priv->schedule_outbox_url = NULL;
- cbdav->priv->is_google = FALSE;
+ priv->is_google = FALSE;
- cbdav->priv->busy_lock = g_mutex_new ();
- cbdav->priv->cond = g_cond_new ();
- cbdav->priv->slave_gone_cond = g_cond_new ();
+ priv->busy_lock = g_mutex_new ();
+ priv->cond = g_cond_new ();
+ priv->slave_gone_cond = g_cond_new ();
/* Slave control ... */
- cbdav->priv->slave_cmd = SLAVE_SHOULD_SLEEP;
- cbdav->priv->slave_busy = FALSE;
- cbdav->priv->refresh_time.tv_usec = 0;
- cbdav->priv->refresh_time.tv_sec = DEFAULT_REFRESH_TIME;
+ priv->slave_cmd = SLAVE_SHOULD_SLEEP;
+ priv->slave_busy = FALSE;
+ priv->refresh_time.tv_usec = 0;
+ priv->refresh_time.tv_sec = DEFAULT_REFRESH_TIME;
- g_signal_connect (cbdav->priv->session, "authenticate",
+ g_signal_connect (priv->session, "authenticate",
G_CALLBACK (soup_authenticate), cbdav);
e_cal_backend_sync_set_lock (E_CAL_BACKEND_SYNC (cbdav), FALSE);
diff --git a/calendar/backends/caldav/e-cal-backend-caldav.h b/calendar/backends/caldav/e-cal-backend-caldav.h
index 9289c0f..1fc24ba 100644
--- a/calendar/backends/caldav/e-cal-backend-caldav.h
+++ b/calendar/backends/caldav/e-cal-backend-caldav.h
@@ -32,19 +32,19 @@ G_BEGIN_DECLS
#define E_CAL_BACKEND_CALDAV_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CAL_BACKEND_CALDAV, ECalBackendCalDAVClass))
#define E_IS_CAL_BACKEND_CALDAV(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CAL_BACKEND_CALDAV))
#define E_IS_CAL_BACKEND_CALDAV_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_CAL_BACKEND_CALDAV))
+#define E_CAL_BACKEND_CALDAV_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), E_TYPE_CAL_BACKEND_CALDAV, ECalBackendCalDAVPrivate))
typedef struct _ECalBackendCalDAV ECalBackendCalDAV;
typedef struct _ECalBackendCalDAVClass ECalBackendCalDAVClass;
+
typedef struct _ECalBackendCalDAVPrivate ECalBackendCalDAVPrivate;
struct _ECalBackendCalDAV {
- ECalBackendSync backend;
-
- ECalBackendCalDAVPrivate *priv;
+ ECalBackendSync backend;
};
struct _ECalBackendCalDAVClass {
- ECalBackendSyncClass parent_class;
+ ECalBackendSyncClass parent_class;
};
GType e_cal_backend_caldav_get_type (void);
diff --git a/calendar/libecal/e-cal-view.c b/calendar/libecal/e-cal-view.c
index 960c70f..b3fce4d 100644
--- a/calendar/libecal/e-cal-view.c
+++ b/calendar/libecal/e-cal-view.c
@@ -33,6 +33,7 @@
#include "e-gdbus-egdbuscalview.h"
G_DEFINE_TYPE (ECalView, e_cal_view, G_TYPE_OBJECT);
+#define E_CAL_VIEW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), E_TYPE_CAL_VIEW, ECalViewPrivate))
/* Private part of the ECalView structure */
struct _ECalViewPrivate {
@@ -178,7 +179,7 @@ done_cb (EGdbusCalView *gdbus_calview, /* ECalendarStatus */ guint status, const
static void
e_cal_view_init (ECalView *view)
{
- view->priv = G_TYPE_INSTANCE_GET_PRIVATE (view, E_TYPE_CAL_VIEW, ECalViewPrivate);
+ view->priv = E_CAL_VIEW_GET_PRIVATE (view);
}
static void
@@ -188,7 +189,7 @@ e_cal_view_set_property (GObject *object, guint property_id, const GValue *value
ECalViewPrivate *priv;
view = E_CAL_VIEW (object);
- priv = view->priv;
+ priv = E_CAL_VIEW_GET_PRIVATE (view);
switch (property_id) {
case PROP_VIEW:
@@ -218,7 +219,7 @@ e_cal_view_get_property (GObject *object, guint property_id, GValue *value, GPar
ECalViewPrivate *priv;
view = E_CAL_VIEW (object);
- priv = view->priv;
+ priv = E_CAL_VIEW_GET_PRIVATE (view);
switch (property_id) {
case PROP_VIEW:
@@ -414,7 +415,7 @@ e_cal_view_start (ECalView *view)
g_return_if_fail (view != NULL);
g_return_if_fail (E_IS_CAL_VIEW (view));
- priv = view->priv;
+ priv = E_CAL_VIEW_GET_PRIVATE (view);
if (priv->gdbus_calview) {
e_gdbus_cal_view_call_start_sync (priv->gdbus_calview, NULL, &error);
@@ -450,7 +451,7 @@ e_cal_view_stop (ECalView *view)
g_return_if_fail (view != NULL);
g_return_if_fail (E_IS_CAL_VIEW (view));
- priv = view->priv;
+ priv = E_CAL_VIEW_GET_PRIVATE (view);
if (priv->gdbus_calview) {
e_gdbus_cal_view_call_stop_sync (priv->gdbus_calview, NULL, &error);
diff --git a/calendar/libecal/e-cal.c b/calendar/libecal/e-cal.c
index 234e607..d5e87e4 100644
--- a/calendar/libecal/e-cal.c
+++ b/calendar/libecal/e-cal.c
@@ -66,6 +66,7 @@ static GStaticRecMutex cal_factory_proxy_lock = G_STATIC_REC_MUTEX_INIT;
#define UNLOCK_CACHE() g_static_rec_mutex_unlock (&priv->cache_lock)
G_DEFINE_TYPE (ECal, e_cal, G_TYPE_OBJECT)
+#define E_CAL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), E_TYPE_CAL, ECalPrivate))
static gboolean open_calendar (ECal *ecal, gboolean only_if_exists, GError **error,
#ifndef E_CAL_DISABLE_DEPRECATED
@@ -410,7 +411,7 @@ e_cal_init (ECal *ecal)
active_cals++;
UNLOCK_FACTORY ();
- ecal->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (ecal, E_TYPE_CAL, ECalPrivate);
+ ecal->priv = priv = E_CAL_GET_PRIVATE (ecal);
priv->load_state = E_CAL_LOAD_NOT_LOADED;
priv->uri = NULL;
diff --git a/calendar/libedata-cal/e-cal-backend-cache.c b/calendar/libedata-cal/e-cal-backend-cache.c
index 67b82d1..04e9abe 100644
--- a/calendar/libedata-cal/e-cal-backend-cache.c
+++ b/calendar/libedata-cal/e-cal-backend-cache.c
@@ -30,6 +30,10 @@
#include <libedataserver/e-data-server-util.h>
#include "e-cal-backend-cache.h"
+#define E_CAL_BACKEND_CACHE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CAL_BACKEND_CACHE, ECalBackendCachePrivate))
+
struct _ECalBackendCachePrivate {
GHashTable *timezones;
};
@@ -41,7 +45,7 @@ e_cal_backend_cache_finalize (GObject *object)
{
ECalBackendCachePrivate *priv;
- priv = E_CAL_BACKEND_CACHE (object)->priv;
+ priv = E_CAL_BACKEND_CACHE_GET_PRIVATE (object);
g_hash_table_destroy (priv->timezones);
@@ -69,7 +73,7 @@ timezones_value_destroy (icaltimezone *zone)
static void
e_cal_backend_cache_init (ECalBackendCache *cache)
{
- cache->priv = G_TYPE_INSTANCE_GET_PRIVATE (cache, E_TYPE_CAL_BACKEND_CACHE, ECalBackendCachePrivate);
+ cache->priv = E_CAL_BACKEND_CACHE_GET_PRIVATE (cache);
cache->priv->timezones = g_hash_table_new_full (
g_str_hash, g_str_equal,
diff --git a/calendar/libedata-cal/e-cal-backend-file-store.c b/calendar/libedata-cal/e-cal-backend-file-store.c
index 6d8fe2a..7a512aa 100644
--- a/calendar/libedata-cal/e-cal-backend-file-store.c
+++ b/calendar/libedata-cal/e-cal-backend-file-store.c
@@ -29,6 +29,10 @@
#define KEY_FILE_NAME "keys.xml"
#define IDLE_SAVE_TIMEOUT 6000
+#define E_CAL_BACKEND_FILE_STORE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CAL_BACKEND_FILE_STORE, ECalBackendFileStorePrivate))
+
typedef struct {
ECalComponent *comp;
GHashTable *recurrences;
@@ -107,7 +111,7 @@ put_component (ECalBackendFileStore *fstore, ECalComponent *comp)
g_return_val_if_fail (comp != NULL, FALSE);
- priv = fstore->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
e_cal_component_get_uid (comp, &uid);
if (uid == NULL) {
@@ -147,7 +151,7 @@ remove_component (ECalBackendFileStore *fstore, const gchar *uid, const gchar *r
gboolean ret_val = TRUE;
gboolean remove_completely = FALSE;
- priv = fstore->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
g_static_rw_lock_writer_lock (&priv->lock);
@@ -182,7 +186,7 @@ get_component (ECalBackendFileStore *fstore, const gchar *uid, const gchar *rid)
FullCompObject *obj = NULL;
ECalComponent *comp = NULL;
- priv = fstore->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
g_static_rw_lock_reader_lock (&priv->lock);
@@ -219,7 +223,7 @@ e_cal_backend_file_store_has_component (ECalBackendStore *store, const gchar *ui
gboolean ret_val = FALSE;
FullCompObject *obj = NULL;
- priv = fstore->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
g_static_rw_lock_reader_lock (&priv->lock);
@@ -248,7 +252,7 @@ e_cal_backend_file_store_put_component (ECalBackendStore *store, ECalComponent *
ECalBackendFileStorePrivate *priv;
gboolean ret_val = FALSE;
- priv = fstore->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
ret_val = put_component (fstore, comp);
@@ -269,7 +273,7 @@ e_cal_backend_file_store_remove_component (ECalBackendStore *store, const gchar
ECalBackendFileStorePrivate *priv;
gboolean ret_val = FALSE;
- priv = fstore->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
ret_val = remove_component (fstore, uid, rid);
@@ -290,7 +294,7 @@ e_cal_backend_file_store_get_timezone (ECalBackendStore *store, const gchar *tzi
ECalBackendFileStorePrivate *priv;
const icaltimezone *zone = NULL;
- priv = fstore->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
g_static_rw_lock_reader_lock (&priv->lock);
zone = g_hash_table_lookup (priv->timezones, tzid);
@@ -307,7 +311,7 @@ e_cal_backend_file_store_put_timezone (ECalBackendStore *store, const icaltimezo
gboolean ret_val = FALSE;
icaltimezone *copy;
- priv = fstore->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
g_static_rw_lock_writer_lock (&priv->lock);
copy = copy_timezone ((icaltimezone *) zone);
@@ -331,7 +335,7 @@ e_cal_backend_file_store_remove_timezone (ECalBackendStore *store, const gchar *
ECalBackendFileStorePrivate *priv;
gboolean ret_val = FALSE;
- priv = fstore->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
g_static_rw_lock_writer_lock (&priv->lock);
ret_val = g_hash_table_remove (priv->timezones, tzid);
@@ -354,7 +358,7 @@ e_cal_backend_file_store_get_key_value (ECalBackendStore *store, const gchar *ke
ECalBackendFileStorePrivate *priv;
const gchar *value;
- priv = fstore->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
g_static_rw_lock_reader_lock (&priv->lock);
value = e_file_cache_get_object (priv->keys_cache, key);
@@ -370,7 +374,7 @@ e_cal_backend_file_store_put_key_value (ECalBackendStore *store, const gchar *ke
ECalBackendFileStorePrivate *priv;
gboolean ret_val = FALSE;
- priv = fstore->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
g_static_rw_lock_writer_lock (&priv->lock);
@@ -396,7 +400,7 @@ e_cal_backend_file_store_get_default_timezone (ECalBackendStore *store)
const gchar *tzid;
const icaltimezone *zone = NULL;
- priv = fstore->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
g_static_rw_lock_reader_lock (&priv->lock);
@@ -418,7 +422,7 @@ e_cal_backend_file_store_set_default_timezone (ECalBackendStore *store, const ic
icaltimezone *copy;
const gchar *key = "default-zone";
- priv = fstore->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
g_static_rw_lock_writer_lock (&priv->lock);
@@ -442,7 +446,7 @@ e_cal_backend_file_store_thaw_changes (ECalBackendStore *store)
ECalBackendFileStore *fstore = E_CAL_BACKEND_FILE_STORE (store);
ECalBackendFileStorePrivate *priv;
- priv = fstore->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
priv->freeze_changes = FALSE;
@@ -458,7 +462,7 @@ e_cal_backend_file_store_freeze_changes (ECalBackendStore *store)
ECalBackendFileStore *fstore = E_CAL_BACKEND_FILE_STORE (store);
ECalBackendFileStorePrivate *priv;
- priv = fstore->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
priv->freeze_changes = TRUE;
e_file_cache_freeze_changes (priv->keys_cache);
@@ -482,7 +486,7 @@ e_cal_backend_file_store_get_components_by_uid (ECalBackendStore *store, const g
FullCompObject *obj = NULL;
GSList *comps = NULL;
- priv = fstore->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
g_static_rw_lock_reader_lock (&priv->lock);
@@ -524,7 +528,7 @@ e_cal_backend_file_store_get_components (ECalBackendStore *store)
ECalBackendFileStorePrivate *priv;
GSList *comps = NULL;
- priv = fstore->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
g_static_rw_lock_reader_lock (&priv->lock);
g_hash_table_foreach (priv->comp_uid_hash, (GHFunc) add_full_comp_to_slist, &comps);
@@ -566,7 +570,7 @@ e_cal_backend_file_store_get_component_ids (ECalBackendStore *store)
ECalBackendFileStorePrivate *priv;
GSList *comp_ids = NULL;
- priv = fstore->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
g_static_rw_lock_reader_lock (&priv->lock);
g_hash_table_foreach (priv->comp_uid_hash, (GHFunc) add_comp_ids_to_slist, &comp_ids);
@@ -583,7 +587,7 @@ add_timezone (ECalBackendFileStore *fstore, icalcomponent *vtzcomp)
icaltimezone *zone;
const gchar *tzid;
- priv = fstore->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
prop = icalcomponent_get_first_property (vtzcomp, ICAL_TZID_PROPERTY);
if (!prop)
@@ -687,7 +691,7 @@ e_cal_backend_file_store_load (ECalBackendStore *store)
ECalBackendFileStorePrivate *priv;
icalcomponent *icalcomp;
- priv = fstore->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
if (!priv->cache_file_name || !priv->key_file_name)
return FALSE;
@@ -717,7 +721,7 @@ e_cal_backend_file_store_remove (ECalBackendStore *store)
ECalBackendFileStore *fstore = E_CAL_BACKEND_FILE_STORE (store);
ECalBackendFileStorePrivate *priv;
- priv = fstore->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
/* This will remove all the contents in the directory */
e_file_cache_remove (priv->keys_cache);
@@ -737,7 +741,7 @@ e_cal_backend_file_store_clean (ECalBackendStore *store)
ECalBackendFileStore *fstore = E_CAL_BACKEND_FILE_STORE (store);
ECalBackendFileStorePrivate *priv;
- priv = fstore->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (store);
g_static_rw_lock_writer_lock (&priv->lock);
@@ -795,7 +799,7 @@ timeout_save_cache (gpointer user_data)
gsize len, nwrote;
FILE *f;
- priv = fstore->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
g_static_rw_lock_reader_lock (&priv->lock);
@@ -832,7 +836,7 @@ save_cache (ECalBackendFileStore *store)
{
ECalBackendFileStorePrivate *priv;
- priv = store->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (store);
if (priv->save_timeout_id) {
g_source_remove (priv->save_timeout_id);
@@ -855,7 +859,7 @@ cal_backend_file_store_finalize (GObject *object)
ECalBackendFileStore *fstore = (ECalBackendFileStore *) object;
ECalBackendFileStorePrivate *priv;
- priv = fstore->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
if (priv->save_timeout_id) {
g_source_remove (priv->save_timeout_id);
@@ -902,7 +906,7 @@ cal_backend_file_store_constructed (GObject *object)
ECalBackendFileStorePrivate *priv;
const gchar *path;
- priv = E_CAL_BACKEND_FILE_STORE (object)->priv;
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (object);
path = e_cal_backend_store_get_path (E_CAL_BACKEND_STORE (object));
priv->cache_file_name = g_build_filename (path, CACHE_FILE_NAME, NULL);
@@ -948,7 +952,7 @@ e_cal_backend_file_store_init (ECalBackendFileStore *store)
{
ECalBackendFileStorePrivate *priv;
- priv = G_TYPE_INSTANCE_GET_PRIVATE (store, E_TYPE_CAL_BACKEND_FILE_STORE, ECalBackendFileStorePrivate);
+ priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (store);
store->priv = priv;
diff --git a/calendar/libedata-cal/e-cal-backend-intervaltree.c b/calendar/libedata-cal/e-cal-backend-intervaltree.c
index 7cfe417..172a977 100644
--- a/calendar/libedata-cal/e-cal-backend-intervaltree.c
+++ b/calendar/libedata-cal/e-cal-backend-intervaltree.c
@@ -39,6 +39,10 @@
G_DEFINE_TYPE (EIntervalTree, e_intervaltree, G_TYPE_OBJECT)
+#define E_INTERVALTREE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_INTERVALTREE, EIntervalTreePrivate))
+
typedef struct _EIntervalNode EIntervalNode;
static EIntervalNode*
@@ -740,7 +744,7 @@ e_intervaltree_remove (EIntervalTree *tree,
static void
e_intervaltree_finalize (GObject *object)
{
- EIntervalTreePrivate *priv = E_INTERVALTREE (object)->priv;
+ EIntervalTreePrivate *priv = E_INTERVALTREE_GET_PRIVATE (object);
if (priv->root) {
g_free (priv->root);
@@ -776,7 +780,7 @@ e_intervaltree_init (EIntervalTree *tree)
EIntervalTreePrivate *priv;
EIntervalNode *root, *nil;
- tree->priv = G_TYPE_INSTANCE_GET_PRIVATE (tree, E_TYPE_INTERVALTREE, EIntervalTreePrivate);
+ tree->priv = E_INTERVALTREE_GET_PRIVATE (tree);
priv = tree->priv;
priv->nil = nil = g_new (EIntervalNode, 1);
diff --git a/calendar/libedata-cal/e-cal-backend-store.c b/calendar/libedata-cal/e-cal-backend-store.c
index 129a3c7..f0a8fbe 100644
--- a/calendar/libedata-cal/e-cal-backend-store.c
+++ b/calendar/libedata-cal/e-cal-backend-store.c
@@ -23,6 +23,10 @@
#include "e-cal-backend-intervaltree.h"
#include <libedataserver/e-data-server-util.h>
+#define E_CAL_BACKEND_STORE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CAL_BACKEND_STORE, ECalBackendStorePrivate))
+
struct _ECalBackendStorePrivate {
gchar *path;
EIntervalTree *intervaltree;
@@ -85,7 +89,7 @@ cal_backend_store_finalize (GObject *object)
{
ECalBackendStorePrivate *priv;
- priv = E_CAL_BACKEND_STORE (object)->priv;
+ priv = E_CAL_BACKEND_STORE_GET_PRIVATE (object);
g_free (priv->path);
if (priv->intervaltree) {
@@ -124,8 +128,10 @@ e_cal_backend_store_class_init (ECalBackendStoreClass *class)
static void
e_cal_backend_store_init (ECalBackendStore *store)
{
- store->priv = G_TYPE_INSTANCE_GET_PRIVATE (store, E_TYPE_CAL_BACKEND_STORE, ECalBackendStorePrivate);
- store->priv->intervaltree = e_intervaltree_new ();
+ ECalBackendStorePrivate *priv;
+ priv = E_CAL_BACKEND_STORE_GET_PRIVATE (store);
+ store->priv = priv;
+ priv->intervaltree = e_intervaltree_new ();
}
/**
@@ -153,7 +159,7 @@ e_cal_backend_store_load (ECalBackendStore *store)
g_return_val_if_fail (E_IS_CAL_BACKEND_STORE (store), FALSE);
- priv = store->priv;
+ priv = E_CAL_BACKEND_STORE_GET_PRIVATE (store);
if (priv->loaded)
return TRUE;
@@ -172,10 +178,9 @@ gboolean
e_cal_backend_store_remove (ECalBackendStore *store)
{
ECalBackendStorePrivate *priv;
-
g_return_val_if_fail (E_IS_CAL_BACKEND_STORE (store), FALSE);
- priv = store->priv;
+ priv = E_CAL_BACKEND_STORE_GET_PRIVATE (store);
/* remove interval tree */
e_intervaltree_destroy (priv->intervaltree);
priv->intervaltree = NULL;
@@ -192,10 +197,9 @@ gboolean
e_cal_backend_store_clean (ECalBackendStore *store)
{
ECalBackendStorePrivate *priv;
-
g_return_val_if_fail (E_IS_CAL_BACKEND_STORE (store), FALSE);
- priv = store->priv;
+ priv = E_CAL_BACKEND_STORE_GET_PRIVATE (store);
if (priv->intervaltree) {
e_intervaltree_destroy (priv->intervaltree);
@@ -242,11 +246,10 @@ gboolean
e_cal_backend_store_put_component_with_time_range (ECalBackendStore *store, ECalComponent *comp, time_t occurence_start, time_t occurence_end)
{
ECalBackendStorePrivate *priv;
-
g_return_val_if_fail (E_IS_CAL_BACKEND_STORE (store), FALSE);
g_return_val_if_fail (E_IS_CAL_COMPONENT (comp), FALSE);
- priv = store->priv;
+ priv = E_CAL_BACKEND_STORE_GET_PRIVATE (store);
if ((E_CAL_BACKEND_STORE_GET_CLASS (store))->put_component (store, comp)) {
if (e_intervaltree_insert (priv->intervaltree, occurence_start, occurence_end, comp))
@@ -279,11 +282,10 @@ gboolean
e_cal_backend_store_remove_component (ECalBackendStore *store, const gchar *uid, const gchar *rid)
{
ECalBackendStorePrivate *priv;
-
g_return_val_if_fail (E_IS_CAL_BACKEND_STORE (store), FALSE);
g_return_val_if_fail (uid != NULL, FALSE);
- priv = store->priv;
+ priv = E_CAL_BACKEND_STORE_GET_PRIVATE (store);
if ((E_CAL_BACKEND_STORE_GET_CLASS (store))->remove_component (store, uid, rid)) {
if (e_intervaltree_remove (priv->intervaltree, uid, rid))
@@ -412,7 +414,7 @@ e_cal_backend_store_get_components_occuring_in_range (ECalBackendStore *store, t
g_return_val_if_fail (store != NULL, NULL);
g_return_val_if_fail (E_IS_CAL_BACKEND_STORE (store), NULL);
- priv = store->priv;
+ priv = E_CAL_BACKEND_STORE_GET_PRIVATE (store);
if (!(objects = e_intervaltree_search (priv->intervaltree, start, end)))
return NULL;
@@ -513,11 +515,10 @@ void
e_cal_backend_store_interval_tree_add_comp (ECalBackendStore *store, ECalComponent *comp, time_t occurence_start, time_t occurence_end)
{
ECalBackendStorePrivate *priv;
-
g_return_if_fail (E_IS_CAL_BACKEND_STORE (store));
g_return_if_fail (E_IS_CAL_COMPONENT (comp));
- priv = store->priv;
+ priv = E_CAL_BACKEND_STORE_GET_PRIVATE (store);
e_intervaltree_insert (priv->intervaltree, occurence_start, occurence_end, comp);
}
diff --git a/calendar/libedata-cal/e-cal-backend.c b/calendar/libedata-cal/e-cal-backend.c
index acd3f8c..bff4e62 100644
--- a/calendar/libedata-cal/e-cal-backend.c
+++ b/calendar/libedata-cal/e-cal-backend.c
@@ -31,6 +31,10 @@
#include "e-cal-backend.h"
#include "e-cal-backend-cache.h"
+#define E_CAL_BACKEND_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CAL_BACKEND, ECalBackendPrivate))
+
/* For convenience */
#define CLASS(backend) (E_CAL_BACKEND_GET_CLASS(backend))
@@ -260,7 +264,7 @@ cal_backend_finalize (GObject *object)
{
ECalBackendPrivate *priv;
- priv = E_CAL_BACKEND (object)->priv;
+ priv = E_CAL_BACKEND_GET_PRIVATE (object);
g_assert (priv->clients == NULL);
@@ -358,7 +362,7 @@ e_cal_backend_class_init (ECalBackendClass *class)
static void
e_cal_backend_init (ECalBackend *backend)
{
- backend->priv = G_TYPE_INSTANCE_GET_PRIVATE (backend, E_TYPE_CAL_BACKEND, ECalBackendPrivate);
+ backend->priv = E_CAL_BACKEND_GET_PRIVATE (backend);
backend->priv->clients = NULL;
backend->priv->clients_mutex = g_mutex_new ();
diff --git a/calendar/libedata-cal/e-data-cal-factory.c b/calendar/libedata-cal/e-data-cal-factory.c
index 9013035..a242c85 100644
--- a/calendar/libedata-cal/e-data-cal-factory.c
+++ b/calendar/libedata-cal/e-data-cal-factory.c
@@ -78,6 +78,8 @@ static gboolean opt_keep_running = FALSE;
G_DEFINE_TYPE (EDataCalFactory, e_data_cal_factory, G_TYPE_OBJECT);
+#define E_DATA_CAL_FACTORY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), E_TYPE_DATA_CAL_FACTORY, EDataCalFactoryPrivate))
+
struct _EDataCalFactoryPrivate {
EGdbusCalFactory *gdbus_object;
@@ -528,7 +530,7 @@ e_data_cal_factory_init (EDataCalFactory *factory)
{
GError *error = NULL;
- factory->priv = G_TYPE_INSTANCE_GET_PRIVATE (factory, E_TYPE_DATA_CAL_FACTORY, EDataCalFactoryPrivate);
+ factory->priv = E_DATA_CAL_FACTORY_GET_PRIVATE (factory);
factory->priv->gdbus_object = e_gdbus_cal_factory_stub_new ();
g_signal_connect (factory->priv->gdbus_object, "handle-get-cal", G_CALLBACK (impl_CalFactory_getCal), factory);
diff --git a/calendar/libedata-cal/e-data-cal-view.c b/calendar/libedata-cal/e-data-cal-view.c
index 18d7a24..a8cb142 100644
--- a/calendar/libedata-cal/e-data-cal-view.c
+++ b/calendar/libedata-cal/e-data-cal-view.c
@@ -64,6 +64,7 @@ struct _EDataCalViewPrivate {
};
G_DEFINE_TYPE (EDataCalView, e_data_cal_view, G_TYPE_OBJECT);
+#define E_DATA_CAL_VIEW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), E_DATA_CAL_VIEW_TYPE, EDataCalViewPrivate))
static void e_data_cal_view_dispose (GObject *object);
static void e_data_cal_view_finalize (GObject *object);
@@ -390,7 +391,7 @@ e_data_cal_view_get_property (GObject *object, guint property_id, GValue *value,
static void
e_data_cal_view_init (EDataCalView *query)
{
- EDataCalViewPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (query, E_DATA_CAL_VIEW_TYPE, EDataCalViewPrivate);
+ EDataCalViewPrivate *priv = E_DATA_CAL_VIEW_GET_PRIVATE (query);
query->priv = priv;
diff --git a/calendar/libedata-cal/e-data-cal.c b/calendar/libedata-cal/e-data-cal.c
index 0b48753..0a80e0b 100644
--- a/calendar/libedata-cal/e-data-cal.c
+++ b/calendar/libedata-cal/e-data-cal.c
@@ -39,6 +39,8 @@
G_DEFINE_TYPE (EDataCal, e_data_cal, G_TYPE_OBJECT);
+#define E_DATA_CAL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), E_TYPE_DATA_CAL, EDataCalPrivate))
+
#define EDC_ERROR(_code) e_data_cal_create_error (_code, NULL)
#define EDC_ERROR_EX(_code, _msg) e_data_cal_create_error (_code, _msg)
@@ -1207,7 +1209,7 @@ e_data_cal_init (EDataCal *ecal)
{
EGdbusCal *gdbus_object;
- ecal->priv = G_TYPE_INSTANCE_GET_PRIVATE (ecal, E_TYPE_DATA_CAL, EDataCalPrivate);
+ ecal->priv = E_DATA_CAL_GET_PRIVATE (ecal);
ecal->priv->gdbus_object = e_gdbus_cal_stub_new ();
diff --git a/camel/camel-certdb.c b/camel/camel-certdb.c
index f2845d2..4608e70 100644
--- a/camel/camel-certdb.c
+++ b/camel/camel-certdb.c
@@ -42,6 +42,10 @@
#define CAMEL_CERTDB_VERSION 0x100
+#define CAMEL_CERTDB_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_CERTDB, CamelCertDBPrivate))
+
struct _CamelCertDBPrivate {
GMutex *db_lock; /* for the db hashtable/array */
GMutex *io_lock; /* load/save lock, for access to saved_count, etc */
@@ -67,7 +71,7 @@ certdb_finalize (GObject *object)
CamelCertDB *certdb = CAMEL_CERTDB (object);
CamelCertDBPrivate *priv;
- priv = certdb->priv;
+ priv = CAMEL_CERTDB_GET_PRIVATE (object);
if (certdb->flags & CAMEL_CERTDB_DIRTY)
camel_certdb_save (certdb);
@@ -114,7 +118,8 @@ camel_certdb_class_init (CamelCertDBClass *class)
static void
camel_certdb_init (CamelCertDB *certdb)
{
- certdb->priv = G_TYPE_INSTANCE_GET_PRIVATE (certdb, CAMEL_TYPE_CERTDB, CamelCertDBPrivate);
+ certdb->priv = CAMEL_CERTDB_GET_PRIVATE (certdb);
+
certdb->filename = NULL;
certdb->version = CAMEL_CERTDB_VERSION;
certdb->saved_certs = 0;
diff --git a/camel/camel-cipher-context.c b/camel/camel-cipher-context.c
index 2fc0a33..3aef8b1 100644
--- a/camel/camel-cipher-context.c
+++ b/camel/camel-cipher-context.c
@@ -46,6 +46,10 @@
#define d(x)
+#define CAMEL_CIPHER_CONTEXT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_CIPHER_CONTEXT, CamelCipherContextPrivate))
+
typedef struct _AsyncContext AsyncContext;
struct _CamelCipherContextPrivate {
@@ -148,7 +152,7 @@ cipher_context_dispose (GObject *object)
{
CamelCipherContextPrivate *priv;
- priv = CAMEL_CIPHER_CONTEXT (object)->priv;
+ priv = CAMEL_CIPHER_CONTEXT_GET_PRIVATE (object);
if (priv->session != NULL) {
g_object_unref (priv->session);
@@ -164,7 +168,7 @@ cipher_context_finalize (GObject *object)
{
CamelCipherContextPrivate *priv;
- priv = CAMEL_CIPHER_CONTEXT (object)->priv;
+ priv = CAMEL_CIPHER_CONTEXT_GET_PRIVATE (object);
g_mutex_free (priv->lock);
@@ -761,7 +765,7 @@ camel_cipher_context_class_init (CamelCipherContextClass *class)
static void
camel_cipher_context_init (CamelCipherContext *context)
{
- context->priv = G_TYPE_INSTANCE_GET_PRIVATE (context, CAMEL_TYPE_CIPHER_CONTEXT, CamelCipherContextPrivate);
+ context->priv = CAMEL_CIPHER_CONTEXT_GET_PRIVATE (context);
context->priv->lock = g_mutex_new ();
}
diff --git a/camel/camel-data-cache.c b/camel/camel-data-cache.c
index 9e8b051..ed663d9 100644
--- a/camel/camel-data-cache.c
+++ b/camel/camel-data-cache.c
@@ -49,6 +49,10 @@
once an hour should be enough */
#define CAMEL_DATA_CACHE_CYCLE_TIME (60*60)
+#define CAMEL_DATA_CACHE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_DATA_CACHE, CamelDataCachePrivate))
+
struct _CamelDataCachePrivate {
CamelObjectBag *busy_bag;
@@ -106,7 +110,7 @@ data_cache_finalize (GObject *object)
{
CamelDataCachePrivate *priv;
- priv = CAMEL_DATA_CACHE (object)->priv;
+ priv = CAMEL_DATA_CACHE_GET_PRIVATE (object);
camel_object_bag_destroy (priv->busy_bag);
g_free (priv->path);
@@ -149,7 +153,7 @@ camel_data_cache_init (CamelDataCache *data_cache)
(CamelCopyFunc) g_strdup,
(GFreeFunc) g_free);
- data_cache->priv = G_TYPE_INSTANCE_GET_PRIVATE (data_cache, CAMEL_TYPE_DATA_CACHE, CamelDataCachePrivate);
+ data_cache->priv = CAMEL_DATA_CACHE_GET_PRIVATE (data_cache);
data_cache->priv->busy_bag = busy_bag;
data_cache->priv->expire_age = -1;
data_cache->priv->expire_access = -1;
diff --git a/camel/camel-data-wrapper.c b/camel/camel-data-wrapper.c
index b775ea6..bdb485a 100644
--- a/camel/camel-data-wrapper.c
+++ b/camel/camel-data-wrapper.c
@@ -36,6 +36,10 @@
#define d(x)
+#define CAMEL_DATA_WRAPPER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_DATA_WRAPPER, CamelDataWrapperPrivate))
+
typedef struct _AsyncContext AsyncContext;
struct _CamelDataWrapperPrivate {
@@ -471,7 +475,7 @@ camel_data_wrapper_class_init (CamelDataWrapperClass *class)
static void
camel_data_wrapper_init (CamelDataWrapper *data_wrapper)
{
- data_wrapper->priv = G_TYPE_INSTANCE_GET_PRIVATE (data_wrapper, CAMEL_TYPE_DATA_WRAPPER, CamelDataWrapperPrivate);
+ data_wrapper->priv = CAMEL_DATA_WRAPPER_GET_PRIVATE (data_wrapper);
g_static_mutex_init (&data_wrapper->priv->stream_lock);
diff --git a/camel/camel-disco-folder.c b/camel/camel-disco-folder.c
index 54bbaf6..9283010 100644
--- a/camel/camel-disco-folder.c
+++ b/camel/camel-disco-folder.c
@@ -32,6 +32,10 @@
#include "camel-disco-store.h"
#include "camel-session.h"
+#define CAMEL_DISCO_FOLDER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_DISCO_FOLDER, CamelDiscoFolderPrivate))
+
struct _CamelDiscoFolderPrivate {
gboolean offline_sync;
};
@@ -470,7 +474,7 @@ camel_disco_folder_class_init (CamelDiscoFolderClass *class)
static void
camel_disco_folder_init (CamelDiscoFolder *disco_folder)
{
- disco_folder->priv = G_TYPE_INSTANCE_GET_PRIVATE (disco_folder, CAMEL_TYPE_DISCO_FOLDER, CamelDiscoFolderPrivate);
+ disco_folder->priv = CAMEL_DISCO_FOLDER_GET_PRIVATE (disco_folder);
g_signal_connect (
disco_folder, "changed",
diff --git a/camel/camel-filter-driver.c b/camel/camel-filter-driver.c
index 0d5d9d6..2c876cd 100644
--- a/camel/camel-filter-driver.c
+++ b/camel/camel-filter-driver.c
@@ -56,6 +56,10 @@
/* an invalid pointer */
#define FOLDER_INVALID ((gpointer)~0)
+#define CAMEL_FILTER_DRIVER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_FILTER_DRIVER, CamelFilterDriverPrivate))
+
/* type of status for a log report */
enum filter_log_t {
FILTER_LOG_NONE,
@@ -184,7 +188,7 @@ filter_driver_dispose (GObject *object)
{
CamelFilterDriverPrivate *priv;
- priv = CAMEL_FILTER_DRIVER (object)->priv;
+ priv = CAMEL_FILTER_DRIVER_GET_PRIVATE (object);
if (priv->defaultfolder != NULL) {
camel_folder_thaw (priv->defaultfolder);
@@ -207,7 +211,7 @@ filter_driver_finalize (GObject *object)
CamelFilterDriverPrivate *priv;
struct _filter_rule *node;
- priv = CAMEL_FILTER_DRIVER (object)->priv;
+ priv = CAMEL_FILTER_DRIVER_GET_PRIVATE (object);
/* close all folders that were opened for appending */
close_folders (CAMEL_FILTER_DRIVER (object));
@@ -249,7 +253,7 @@ camel_filter_driver_init (CamelFilterDriver *filter_driver)
{
gint ii;
- filter_driver->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter_driver, CAMEL_TYPE_FILTER_DRIVER, CamelFilterDriverPrivate);
+ filter_driver->priv = CAMEL_FILTER_DRIVER_GET_PRIVATE (filter_driver);
camel_dlist_init (&filter_driver->priv->rules);
@@ -299,78 +303,94 @@ camel_filter_driver_new (CamelSession *session)
void
camel_filter_driver_set_folder_func (CamelFilterDriver *d, CamelFilterGetFolderFunc get_folder, gpointer data)
{
- d->priv->get_folder = get_folder;
- d->priv->data = data;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (d);
+
+ p->get_folder = get_folder;
+ p->data = data;
}
void
camel_filter_driver_set_logfile (CamelFilterDriver *d, FILE *logfile)
{
- d->priv->logfile = logfile;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (d);
+
+ p->logfile = logfile;
}
void
camel_filter_driver_set_status_func (CamelFilterDriver *d, CamelFilterStatusFunc *func, gpointer data)
{
- d->priv->statusfunc = func;
- d->priv->statusdata = data;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (d);
+
+ p->statusfunc = func;
+ p->statusdata = data;
}
void
camel_filter_driver_set_shell_func (CamelFilterDriver *d, CamelFilterShellFunc *func, gpointer data)
{
- d->priv->shellfunc = func;
- d->priv->shelldata = data;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (d);
+
+ p->shellfunc = func;
+ p->shelldata = data;
}
void
camel_filter_driver_set_play_sound_func (CamelFilterDriver *d, CamelFilterPlaySoundFunc *func, gpointer data)
{
- d->priv->playfunc = func;
- d->priv->playdata = data;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (d);
+
+ p->playfunc = func;
+ p->playdata = data;
}
void
camel_filter_driver_set_system_beep_func (CamelFilterDriver *d, CamelFilterSystemBeepFunc *func, gpointer data)
{
- d->priv->beep = func;
- d->priv->beepdata = data;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (d);
+
+ p->beep = func;
+ p->beepdata = data;
}
void
camel_filter_driver_set_default_folder (CamelFilterDriver *d, CamelFolder *def)
{
- if (d->priv->defaultfolder) {
- camel_folder_thaw (d->priv->defaultfolder);
- g_object_unref (d->priv->defaultfolder);
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (d);
+
+ if (p->defaultfolder) {
+ camel_folder_thaw (p->defaultfolder);
+ g_object_unref (p->defaultfolder);
}
- d->priv->defaultfolder = def;
+ p->defaultfolder = def;
- if (d->priv->defaultfolder) {
- camel_folder_freeze (d->priv->defaultfolder);
- g_object_ref (d->priv->defaultfolder);
+ if (p->defaultfolder) {
+ camel_folder_freeze (p->defaultfolder);
+ g_object_ref (p->defaultfolder);
}
}
void
camel_filter_driver_add_rule (CamelFilterDriver *d, const gchar *name, const gchar *match, const gchar *action)
{
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (d);
struct _filter_rule *node;
node = g_malloc (sizeof (*node));
node->match = g_strdup (match);
node->action = g_strdup (action);
node->name = g_strdup (name);
- camel_dlist_addtail (&d->priv->rules, (CamelDListNode *)node);
+ camel_dlist_addtail (&p->rules, (CamelDListNode *)node);
}
gint
camel_filter_driver_remove_rule_by_name (CamelFilterDriver *d, const gchar *name)
{
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (d);
struct _filter_rule *node;
- node = (struct _filter_rule *) d->priv->rules.head;
+ node = (struct _filter_rule *) p->rules.head;
while (node->next) {
if (!strcmp (node->name, name)) {
camel_dlist_remove ((CamelDListNode *) node);
@@ -392,13 +412,14 @@ static void
report_status (CamelFilterDriver *driver, enum camel_filter_status_t status, gint pc, const gchar *desc, ...)
{
/* call user-defined status report function */
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
va_list ap;
gchar *str;
- if (driver->priv->statusfunc) {
+ if (p->statusfunc) {
va_start (ap, desc);
str = g_strdup_vprintf (desc, ap);
- driver->priv->statusfunc (driver, status, pc, str, driver->priv->statusdata);
+ p->statusfunc (driver, status, pc, str, p->statusdata);
g_free (str);
}
}
@@ -407,13 +428,14 @@ report_status (CamelFilterDriver *driver, enum camel_filter_status_t status, gin
void
camel_filter_driver_set_global (CamelFilterDriver *d, const gchar *name, const gchar *value)
{
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (d);
gchar *oldkey, *oldvalue;
- if (g_hash_table_lookup_extended (d->priv->globals, name, (gpointer)&oldkey, (gpointer)&oldvalue)) {
+ if (g_hash_table_lookup_extended (p->globals, name, (gpointer)&oldkey, (gpointer)&oldvalue)) {
g_free (oldvalue);
- g_hash_table_insert (d->priv->globals, oldkey, g_strdup (value));
+ g_hash_table_insert (p->globals, oldkey, g_strdup (value));
} else {
- g_hash_table_insert (d->priv->globals, g_strdup (name), g_strdup (value));
+ g_hash_table_insert (p->globals, g_strdup (name), g_strdup (value));
}
}
#endif
@@ -421,8 +443,10 @@ camel_filter_driver_set_global (CamelFilterDriver *d, const gchar *name, const g
static ESExpResult *
do_delete (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+
d(fprintf (stderr, "doing delete\n"));
- driver->priv->deleted = TRUE;
+ p->deleted = TRUE;
camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Delete");
return NULL;
@@ -431,7 +455,7 @@ do_delete (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterD
static ESExpResult *
do_forward_to (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
- CamelFilterDriverPrivate *p = driver->priv;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
d(fprintf (stderr, "marking message for forwarding\n"));
@@ -457,7 +481,7 @@ do_forward_to (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFil
static ESExpResult *
do_copy (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
- CamelFilterDriverPrivate *p = driver->priv;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
gint i;
d(fprintf (stderr, "copying message...\n"));
@@ -514,7 +538,7 @@ do_copy (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDri
static ESExpResult *
do_move (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
- CamelFilterDriverPrivate *p = driver->priv;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
gint i;
d(fprintf (stderr, "moving message...\n"));
@@ -593,7 +617,7 @@ do_move (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDri
static ESExpResult *
do_stop (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
- CamelFilterDriverPrivate *p = driver->priv;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Stopped processing");
d(fprintf (stderr, "terminating message processing\n"));
@@ -605,7 +629,7 @@ do_stop (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDri
static ESExpResult *
do_label (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
- CamelFilterDriverPrivate *p = driver->priv;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
d(fprintf (stderr, "setting label tag\n"));
if (argc > 0 && argv[0]->type == ESEXP_RES_STRING) {
@@ -637,7 +661,7 @@ do_label (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDr
static ESExpResult *
do_color (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
- CamelFilterDriverPrivate *p = driver->priv;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
d(fprintf (stderr, "setting color tag\n"));
if (argc > 0 && argv[0]->type == ESEXP_RES_STRING) {
@@ -654,7 +678,7 @@ do_color (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDr
static ESExpResult *
do_score (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
- CamelFilterDriverPrivate *p = driver->priv;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
d(fprintf (stderr, "setting score tag\n"));
if (argc > 0 && argv[0]->type == ESEXP_RES_INT) {
@@ -672,7 +696,7 @@ do_score (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDr
static ESExpResult *
do_adjust_score (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
- CamelFilterDriverPrivate *p = driver->priv;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
d(fprintf (stderr, "adjusting score tag\n"));
if (argc > 0 && argv[0]->type == ESEXP_RES_INT) {
@@ -693,7 +717,7 @@ do_adjust_score (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelF
static ESExpResult *
set_flag (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
- CamelFilterDriverPrivate *p = driver->priv;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
guint32 flags;
d(fprintf (stderr, "setting flag\n"));
@@ -715,7 +739,7 @@ set_flag (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDr
static ESExpResult *
unset_flag (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
- CamelFilterDriverPrivate *p = driver->priv;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
guint32 flags;
d(fprintf (stderr, "unsetting flag\n"));
@@ -766,7 +790,7 @@ child_watch (GPid pid,
static gint
pipe_to_system (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
- CamelFilterDriverPrivate *p = driver->priv;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
gint i, pipe_to_child, pipe_from_child;
CamelMimeMessage *message = NULL;
CamelMimeParser *parser;
@@ -914,7 +938,7 @@ pipe_message (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilt
static ESExpResult *
do_shell (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
- CamelFilterDriverPrivate *p = driver->priv;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
GString *command;
GPtrArray *args;
gint i;
@@ -955,7 +979,7 @@ do_shell (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDr
static ESExpResult *
do_beep (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
- CamelFilterDriverPrivate *p = driver->priv;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
d(fprintf (stderr, "beep\n"));
@@ -970,7 +994,7 @@ do_beep (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDri
static ESExpResult *
play_sound (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
- CamelFilterDriverPrivate *p = driver->priv;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
d(fprintf (stderr, "play sound\n"));
@@ -985,7 +1009,7 @@ play_sound (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilter
static ESExpResult *
do_only_once (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
- CamelFilterDriverPrivate *p = driver->priv;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
d(fprintf (stderr, "only once\n"));
@@ -999,7 +1023,7 @@ do_only_once (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilt
static CamelFolder *
open_folder (CamelFilterDriver *driver, const gchar *folder_url)
{
- CamelFilterDriverPrivate *p = driver->priv;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
CamelFolder *camelfolder;
/* we have a lookup table of currently open folders */
@@ -1032,7 +1056,7 @@ close_folder (gpointer key, gpointer value, gpointer data)
{
CamelFolder *folder = value;
CamelFilterDriver *driver = data;
- CamelFilterDriverPrivate *p = driver->priv;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
p->closed++;
g_free (key);
@@ -1053,7 +1077,7 @@ close_folder (gpointer key, gpointer value, gpointer data)
static gint
close_folders (CamelFilterDriver *driver)
{
- CamelFilterDriverPrivate *p = driver->priv;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
report_status(driver, CAMEL_FILTER_STATUS_PROGRESS, 0, _("Syncing folders"));
@@ -1077,7 +1101,7 @@ free_key (gpointer key, gpointer value, gpointer user_data)
static void
camel_filter_driver_log (CamelFilterDriver *driver, enum filter_log_t status, const gchar *desc, ...)
{
- CamelFilterDriverPrivate *p = driver->priv;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
if (p->logfile) {
gchar *str = NULL;
@@ -1132,7 +1156,7 @@ struct _run_only_once {
static gboolean
run_only_once (gpointer key, gchar *action, struct _run_only_once *data)
{
- CamelFilterDriverPrivate *p = data->driver->priv;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (data->driver);
ESExpResult *r;
d(printf ("evaluating: %s\n\n", action));
@@ -1180,7 +1204,7 @@ void
camel_filter_driver_flush (CamelFilterDriver *driver,
GError **error)
{
- CamelFilterDriverPrivate *p = driver->priv;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
struct _run_only_once data;
if (!p->only_once)
@@ -1237,7 +1261,7 @@ camel_filter_driver_filter_mbox (CamelFilterDriver *driver,
GCancellable *cancellable,
GError **error)
{
- CamelFilterDriverPrivate *p = driver->priv;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
CamelMimeParser *mp = NULL;
gchar *source_url = NULL;
gint fd = -1;
@@ -1369,7 +1393,7 @@ camel_filter_driver_filter_folder (CamelFilterDriver *driver,
GCancellable *cancellable,
GError **error)
{
- CamelFilterDriverPrivate *p = driver->priv;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
gboolean freeuids = FALSE;
CamelMessageInfo *info;
gchar *source_url, *service_url;
@@ -1512,7 +1536,7 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver,
GCancellable *cancellable,
GError **error)
{
- CamelFilterDriverPrivate *p = driver->priv;
+ struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
struct _filter_rule *node;
gboolean freeinfo = FALSE;
gboolean filtered = FALSE;
diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c
index 4c62050..c8a6f4e 100644
--- a/camel/camel-folder-search.c
+++ b/camel/camel-folder-search.c
@@ -57,6 +57,10 @@
#define r(x)
#define dd(x) if (camel_debug("search")) x
+#define CAMEL_FOLDER_SEARCH_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_FOLDER_SEARCH, CamelFolderSearchPrivate))
+
struct _CamelFolderSearchPrivate {
GError **error;
@@ -157,7 +161,7 @@ camel_folder_search_class_init (CamelFolderSearchClass *class)
static void
camel_folder_search_init (CamelFolderSearch *search)
{
- search->priv = G_TYPE_INSTANCE_GET_PRIVATE (search, CAMEL_TYPE_FOLDER_SEARCH, CamelFolderSearchPrivate);
+ search->priv = CAMEL_FOLDER_SEARCH_GET_PRIVATE (search);
search->sexp = e_sexp_new ();
}
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index 5aaccc3..a6ac654 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -59,6 +59,10 @@
#include "camel-vtrash-folder.h"
#include "camel-mime-part-utils.h"
+#define CAMEL_FOLDER_SUMMARY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_FOLDER_SUMMARY, CamelFolderSummaryPrivate))
+
/* Make 5 minutes as default cache drop */
#define SUMMARY_CACHE_DROP 300
#define dd(x) if (camel_debug("sync")) x
@@ -153,7 +157,7 @@ folder_summary_dispose (GObject *object)
{
CamelFolderSummaryPrivate *priv;
- priv = CAMEL_FOLDER_SUMMARY (object)->priv;
+ priv = CAMEL_FOLDER_SUMMARY_GET_PRIVATE (object);
if (priv->filter_index != NULL) {
g_object_unref (priv->filter_index);
@@ -911,7 +915,7 @@ camel_folder_summary_class_init (CamelFolderSummaryClass *class)
static void
camel_folder_summary_init (CamelFolderSummary *summary)
{
- summary->priv = G_TYPE_INSTANCE_GET_PRIVATE (summary, CAMEL_TYPE_FOLDER_SUMMARY, CamelFolderSummaryPrivate);
+ summary->priv = CAMEL_FOLDER_SUMMARY_GET_PRIVATE (summary);
summary->priv->filter_charset = g_hash_table_new (
camel_strcase_hash, camel_strcase_equal);
@@ -1001,7 +1005,7 @@ camel_folder_summary_set_filename (CamelFolderSummary *s, const gchar *name)
void
camel_folder_summary_set_index (CamelFolderSummary *s, CamelIndex *index)
{
- struct _CamelFolderSummaryPrivate *p = s->priv;
+ struct _CamelFolderSummaryPrivate *p = CAMEL_FOLDER_SUMMARY_GET_PRIVATE (s);
if (p->index)
g_object_unref (p->index);
@@ -1726,7 +1730,7 @@ cfs_reload_from_db (CamelFolderSummary *s, GError **error)
cfs_schedule_info_release_timer (s);
- if (s->priv->need_preview) {
+ if (CAMEL_FOLDER_SUMMARY_GET_PRIVATE (s)->need_preview) {
struct _preview_update_msg *m;
m = camel_session_thread_msg_new (((CamelService *)parent_store)->session, &preview_update_ops, sizeof (*m));
@@ -1747,7 +1751,7 @@ void
camel_folder_summary_add_preview (CamelFolderSummary *s, CamelMessageInfo *info)
{
camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
- g_hash_table_insert (s->priv->preview_updates, (gchar *)info->uid, ((CamelMessageInfoBase *)info)->preview);
+ g_hash_table_insert (CAMEL_FOLDER_SUMMARY_GET_PRIVATE (s)->preview_updates, (gchar *)info->uid, ((CamelMessageInfoBase *)info)->preview);
camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
}
@@ -2215,11 +2219,11 @@ camel_folder_summary_save_to_db (CamelFolderSummary *s,
cdb = parent_store->cdb_w;
d(printf ("\ncamel_folder_summary_save_to_db called \n"));
- if (s->priv->need_preview && g_hash_table_size (s->priv->preview_updates)) {
+ if (CAMEL_FOLDER_SUMMARY_GET_PRIVATE (s)->need_preview && g_hash_table_size (CAMEL_FOLDER_SUMMARY_GET_PRIVATE (s)->preview_updates)) {
camel_db_begin_transaction (parent_store->cdb_w, NULL);
camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
- g_hash_table_foreach (s->priv->preview_updates, (GHFunc)msg_save_preview, s->folder);
- g_hash_table_remove_all (s->priv->preview_updates);
+ g_hash_table_foreach (CAMEL_FOLDER_SUMMARY_GET_PRIVATE (s)->preview_updates, (GHFunc)msg_save_preview, s->folder);
+ g_hash_table_remove_all (CAMEL_FOLDER_SUMMARY_GET_PRIVATE (s)->preview_updates);
camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
camel_db_end_transaction (parent_store->cdb_w, NULL);
}
@@ -2657,7 +2661,7 @@ camel_folder_summary_info_new_from_parser (CamelFolderSummary *s, CamelMimeParse
CamelMessageInfo *info = NULL;
gchar *buffer;
gsize len;
- CamelFolderSummaryPrivate *p = s->priv;
+ struct _CamelFolderSummaryPrivate *p = CAMEL_FOLDER_SUMMARY_GET_PRIVATE (s);
goffset start;
CamelIndexName *name = NULL;
@@ -2716,7 +2720,7 @@ CamelMessageInfo *
camel_folder_summary_info_new_from_message (CamelFolderSummary *s, CamelMimeMessage *msg, const gchar *bodystructure)
{
CamelMessageInfo *info;
- CamelFolderSummaryPrivate *p = s->priv;
+ struct _CamelFolderSummaryPrivate *p = CAMEL_FOLDER_SUMMARY_GET_PRIVATE (s);
CamelIndexName *name = NULL;
info = CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->message_info_new_from_message (s, msg, bodystructure);
@@ -3806,7 +3810,7 @@ summary_build_content_info (CamelFolderSummary *s, CamelMessageInfo *msginfo, Ca
CamelMessageContentInfo *info = NULL;
CamelContentType *ct;
gint enc_id = -1, chr_id = -1, html_id = -1, idx_id = -1;
- CamelFolderSummaryPrivate *p = s->priv;
+ struct _CamelFolderSummaryPrivate *p = CAMEL_FOLDER_SUMMARY_GET_PRIVATE (s);
CamelMimeFilter *mfc;
CamelMessageContentInfo *part;
const gchar *calendar_header;
@@ -3968,7 +3972,7 @@ summary_build_content_info_message (CamelFolderSummary *s, CamelMessageInfo *msg
{
CamelDataWrapper *containee;
gint parts, i;
- CamelFolderSummaryPrivate *p = s->priv;
+ struct _CamelFolderSummaryPrivate *p = CAMEL_FOLDER_SUMMARY_GET_PRIVATE (s);
CamelMessageContentInfo *info = NULL, *child;
CamelContentType *ct;
const struct _camel_header_raw *header;
@@ -4772,7 +4776,7 @@ camel_message_info_dump (CamelMessageInfo *mi)
void
camel_folder_summary_set_need_preview (CamelFolderSummary *summary, gboolean preview)
{
- summary->priv->need_preview = preview;
+ CAMEL_FOLDER_SUMMARY_GET_PRIVATE (summary)->need_preview = preview;
}
/**
@@ -4783,7 +4787,7 @@ camel_folder_summary_set_need_preview (CamelFolderSummary *summary, gboolean pre
gboolean
camel_folder_summary_get_need_preview (CamelFolderSummary *summary)
{
- return summary->priv->need_preview;
+ return CAMEL_FOLDER_SUMMARY_GET_PRIVATE (summary)->need_preview;
}
static gboolean
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index 1f57796..b30ffd1 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -42,6 +42,10 @@
#include "camel-vtrash-folder.h"
#include "camel-string-utils.h"
+#define CAMEL_FOLDER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_FOLDER, CamelFolderPrivate))
+
#define d(x)
#define w(x)
@@ -508,7 +512,7 @@ folder_finalize (GObject *object)
{
CamelFolderPrivate *priv;
- priv = CAMEL_FOLDER (object)->priv;
+ priv = CAMEL_FOLDER_GET_PRIVATE (object);
g_free (priv->name);
g_free (priv->full_name);
@@ -1641,7 +1645,8 @@ camel_folder_class_init (CamelFolderClass *class)
static void
camel_folder_init (CamelFolder *folder)
{
- folder->priv = G_TYPE_INSTANCE_GET_PRIVATE (folder, CAMEL_TYPE_FOLDER, CamelFolderPrivate);
+ folder->priv = CAMEL_FOLDER_GET_PRIVATE (folder);
+
folder->priv->frozen = 0;
folder->priv->changed_frozen = camel_folder_change_info_new ();
diff --git a/camel/camel-gpg-context.c b/camel/camel-gpg-context.c
index 8495377..dd10985 100644
--- a/camel/camel-gpg-context.c
+++ b/camel/camel-gpg-context.c
@@ -73,6 +73,10 @@
static gint logid;
#endif
+#define CAMEL_GPG_CONTEXT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_GPG_CONTEXT, CamelGpgContextPrivate))
+
struct _CamelGpgContextPrivate {
gboolean always_trust;
};
@@ -2233,7 +2237,7 @@ camel_gpg_context_class_init (CamelGpgContextClass *class)
static void
camel_gpg_context_init (CamelGpgContext *context)
{
- context->priv = G_TYPE_INSTANCE_GET_PRIVATE (context, CAMEL_TYPE_GPG_CONTEXT, CamelGpgContextPrivate);
+ context->priv = CAMEL_GPG_CONTEXT_GET_PRIVATE (context);
}
/**
diff --git a/camel/camel-index.c b/camel/camel-index.c
index ab8643c..b2a23bb 100644
--- a/camel/camel-index.c
+++ b/camel/camel-index.c
@@ -39,6 +39,10 @@
#define CAMEL_INDEX_VERSION (0x01)
+#define CAMEL_INDEX_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_INDEX, CamelIndexPrivate))
+
struct _CamelIndexPrivate {
gpointer dummy;
};
@@ -74,7 +78,7 @@ camel_index_class_init (CamelIndexClass *class)
static void
camel_index_init (CamelIndex *index)
{
- index->priv = G_TYPE_INSTANCE_GET_PRIVATE (index, CAMEL_TYPE_INDEX, CamelIndexPrivate);
+ index->priv = CAMEL_INDEX_GET_PRIVATE (index);
index->version = CAMEL_INDEX_VERSION;
}
diff --git a/camel/camel-medium.c b/camel/camel-medium.c
index d12b61d..ef0f162 100644
--- a/camel/camel-medium.c
+++ b/camel/camel-medium.c
@@ -33,6 +33,10 @@
#define d(x)
+#define CAMEL_MEDIUM_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MEDIUM, CamelMediumPrivate))
+
struct _CamelMediumPrivate {
/* The content of the medium, as opposed to our parent
* CamelDataWrapper, which wraps both the headers and
@@ -86,7 +90,7 @@ medium_dispose (GObject *object)
{
CamelMediumPrivate *priv;
- priv = CAMEL_MEDIUM (object)->priv;
+ priv = CAMEL_MEDIUM_GET_PRIVATE (object);
if (priv->content != NULL) {
g_object_unref (priv->content);
@@ -162,7 +166,7 @@ camel_medium_class_init (CamelMediumClass *class)
static void
camel_medium_init (CamelMedium *medium)
{
- medium->priv = G_TYPE_INSTANCE_GET_PRIVATE (medium, CAMEL_TYPE_MEDIUM, CamelMediumPrivate);
+ medium->priv = CAMEL_MEDIUM_GET_PRIVATE (medium);
}
/**
diff --git a/camel/camel-mime-filter-basic.c b/camel/camel-mime-filter-basic.c
index 68c82ff..b820173 100644
--- a/camel/camel-mime-filter-basic.c
+++ b/camel/camel-mime-filter-basic.c
@@ -24,6 +24,10 @@
#include "camel-mime-filter-basic.h"
#include "camel-mime-utils.h"
+#define CAMEL_MIME_FILTER_BASIC_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_BASIC, CamelMimeFilterBasicPrivate))
+
struct _CamelMimeFilterBasicPrivate {
CamelMimeFilterBasicType type;
guchar uubuf[60];
@@ -46,7 +50,7 @@ mime_filter_basic_filter (CamelMimeFilter *mime_filter,
CamelMimeFilterBasicPrivate *priv;
gsize newlen;
- priv = CAMEL_MIME_FILTER_BASIC (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_BASIC_GET_PRIVATE (mime_filter);
switch (priv->type) {
case CAMEL_MIME_FILTER_BASIC_BASE64_ENC:
@@ -151,7 +155,7 @@ mime_filter_basic_complete (CamelMimeFilter *mime_filter,
CamelMimeFilterBasicPrivate *priv;
gsize newlen = 0;
- priv = CAMEL_MIME_FILTER_BASIC (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_BASIC_GET_PRIVATE (mime_filter);
switch (priv->type) {
case CAMEL_MIME_FILTER_BASIC_BASE64_ENC:
@@ -217,7 +221,7 @@ mime_filter_basic_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterBasicPrivate *priv;
- priv = CAMEL_MIME_FILTER_BASIC (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_BASIC_GET_PRIVATE (mime_filter);
switch (priv->type) {
case CAMEL_MIME_FILTER_BASIC_QP_ENC:
@@ -245,7 +249,7 @@ camel_mime_filter_basic_class_init (CamelMimeFilterBasicClass *class)
static void
camel_mime_filter_basic_init (CamelMimeFilterBasic *filter)
{
- filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_BASIC, CamelMimeFilterBasicPrivate);
+ filter->priv = CAMEL_MIME_FILTER_BASIC_GET_PRIVATE (filter);
}
/**
diff --git a/camel/camel-mime-filter-bestenc.c b/camel/camel-mime-filter-bestenc.c
index 8fb6183..d868ae8 100644
--- a/camel/camel-mime-filter-bestenc.c
+++ b/camel/camel-mime-filter-bestenc.c
@@ -27,6 +27,10 @@
#include "camel-mime-filter-bestenc.h"
+#define CAMEL_MIME_FILTER_BESTENC_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_BESTENC, CamelMimeFilterBestencPrivate))
+
struct _CamelMimeFilterBestencPrivate {
guint flags; /* our creation flags */
@@ -64,7 +68,7 @@ mime_filter_bestenc_filter (CamelMimeFilter *mime_filter,
CamelMimeFilterBestencPrivate *priv;
register guchar *p, *pend;
- priv = CAMEL_MIME_FILTER_BESTENC (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_BESTENC_GET_PRIVATE (mime_filter);
if (len == 0)
goto donothing;
@@ -165,7 +169,7 @@ mime_filter_bestenc_complete (CamelMimeFilter *mime_filter,
{
CamelMimeFilterBestencPrivate *priv;
- priv = CAMEL_MIME_FILTER_BESTENC (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_BESTENC_GET_PRIVATE (mime_filter);
mime_filter_bestenc_filter (
mime_filter, in, len, prespace, out, outlen, outprespace);
@@ -180,7 +184,7 @@ mime_filter_bestenc_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterBestencPrivate *priv;
- priv = CAMEL_MIME_FILTER_BESTENC (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_BESTENC_GET_PRIVATE (mime_filter);
priv->count0 = 0;
priv->count8 = 0;
@@ -211,7 +215,7 @@ camel_mime_filter_bestenc_class_init (CamelMimeFilterBestencClass *class)
static void
camel_mime_filter_bestenc_init (CamelMimeFilterBestenc *filter)
{
- filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_BESTENC, CamelMimeFilterBestencPrivate);
+ filter->priv = CAMEL_MIME_FILTER_BESTENC_GET_PRIVATE (filter);
mime_filter_bestenc_reset (CAMEL_MIME_FILTER (filter));
}
@@ -253,7 +257,7 @@ camel_mime_filter_bestenc_get_best_encoding (CamelMimeFilterBestenc *filter,
CamelTransferEncoding bestenc;
gint istext;
- priv = filter->priv;
+ priv = CAMEL_MIME_FILTER_BESTENC_GET_PRIVATE (filter);
istext = (required & CAMEL_BESTENC_TEXT) ? 1 : 0;
required = required & ~CAMEL_BESTENC_TEXT;
diff --git a/camel/camel-mime-filter-canon.c b/camel/camel-mime-filter-canon.c
index 9c644c3..6143f47 100644
--- a/camel/camel-mime-filter-canon.c
+++ b/camel/camel-mime-filter-canon.c
@@ -31,6 +31,10 @@
#include "camel-mime-filter-canon.h"
+#define CAMEL_MIME_FILTER_CANON_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_CANON, CamelMimeFilterCanonPrivate))
+
struct _CamelMimeFilterCanonPrivate {
guint32 flags;
};
@@ -54,7 +58,7 @@ mime_filter_canon_run (CamelMimeFilter *mime_filter,
register gchar *o;
gint lf = 0;
- priv = CAMEL_MIME_FILTER_CANON (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_CANON_GET_PRIVATE (mime_filter);
/* first, work out how much space we need */
inptr = (guchar *)in;
@@ -189,7 +193,7 @@ camel_mime_filter_canon_class_init (CamelMimeFilterCanonClass *class)
static void
camel_mime_filter_canon_init (CamelMimeFilterCanon *filter)
{
- filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_CANON, CamelMimeFilterCanonPrivate);
+ filter->priv = CAMEL_MIME_FILTER_CANON_GET_PRIVATE (filter);
}
/**
diff --git a/camel/camel-mime-filter-charset.c b/camel/camel-mime-filter-charset.c
index d6a6041..4564970 100644
--- a/camel/camel-mime-filter-charset.c
+++ b/camel/camel-mime-filter-charset.c
@@ -30,6 +30,10 @@
#include "camel-iconv.h"
#include "camel-mime-filter-charset.h"
+#define CAMEL_MIME_FILTER_CHARSET_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_CHARSET, CamelMimeFilterCharsetPrivate))
+
#define d(x)
#define w(x)
@@ -46,7 +50,7 @@ mime_filter_charset_finalize (GObject *object)
{
CamelMimeFilterCharsetPrivate *priv;
- priv = CAMEL_MIME_FILTER_CHARSET (object)->priv;
+ priv = CAMEL_MIME_FILTER_CHARSET_GET_PRIVATE (object);
g_free (priv->from);
g_free (priv->to);
@@ -74,7 +78,7 @@ mime_filter_charset_complete (CamelMimeFilter *mime_filter,
const gchar *inbuf;
gchar *outbuf;
- priv = CAMEL_MIME_FILTER_CHARSET (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_CHARSET_GET_PRIVATE (mime_filter);
if (priv->ic == (iconv_t) -1)
goto noop;
@@ -157,7 +161,7 @@ mime_filter_charset_filter (CamelMimeFilter *mime_filter,
const gchar *inbuf;
gchar *outbuf;
- priv = CAMEL_MIME_FILTER_CHARSET (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_CHARSET_GET_PRIVATE (mime_filter);
if (priv->ic == (iconv_t) -1)
goto noop;
@@ -220,7 +224,7 @@ mime_filter_charset_reset (CamelMimeFilter *mime_filter)
gchar *buffer;
gsize outlen = 16;
- priv = CAMEL_MIME_FILTER_CHARSET (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_CHARSET_GET_PRIVATE (mime_filter);
/* what happens with the output bytes if this resets the state? */
if (priv->ic != (iconv_t) -1) {
@@ -249,7 +253,7 @@ camel_mime_filter_charset_class_init (CamelMimeFilterCharsetClass *class)
static void
camel_mime_filter_charset_init (CamelMimeFilterCharset *filter)
{
- filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_CHARSET, CamelMimeFilterCharsetPrivate);
+ filter->priv = CAMEL_MIME_FILTER_CHARSET_GET_PRIVATE (filter);
filter->priv->ic = (iconv_t) -1;
}
@@ -267,11 +271,11 @@ CamelMimeFilter *
camel_mime_filter_charset_new (const gchar *from_charset,
const gchar *to_charset)
{
- CamelMimeFilter *res;
+ CamelMimeFilter *new;
CamelMimeFilterCharsetPrivate *priv;
- res = g_object_new (CAMEL_TYPE_MIME_FILTER_CHARSET, NULL);
- priv = CAMEL_MIME_FILTER_CHARSET (res)->priv;
+ new = g_object_new (CAMEL_TYPE_MIME_FILTER_CHARSET, NULL);
+ priv = CAMEL_MIME_FILTER_CHARSET_GET_PRIVATE (new);
priv->ic = camel_iconv_open (to_charset, from_charset);
if (priv->ic == (iconv_t) -1) {
@@ -279,12 +283,12 @@ camel_mime_filter_charset_new (const gchar *from_charset,
from_charset ? from_charset : "(null)",
to_charset ? to_charset : "(null)",
g_strerror (errno)));
- g_object_unref (res);
- res = NULL;
+ g_object_unref (new);
+ new = NULL;
} else {
priv->from = g_strdup (from_charset);
priv->to = g_strdup (to_charset);
}
- return res;
+ return new;
}
diff --git a/camel/camel-mime-filter-crlf.c b/camel/camel-mime-filter-crlf.c
index c19dfb4..a233dcb 100644
--- a/camel/camel-mime-filter-crlf.c
+++ b/camel/camel-mime-filter-crlf.c
@@ -22,6 +22,10 @@
#include "camel-mime-filter-crlf.h"
+#define CAMEL_MIME_FILTER_CRLF_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_CRLF, CamelMimeFilterCRLFPrivate))
+
struct _CamelMimeFilterCRLFPrivate {
CamelMimeFilterCRLFDirection direction;
CamelMimeFilterCRLFMode mode;
@@ -47,7 +51,7 @@ mime_filter_crlf_filter (CamelMimeFilter *mime_filter,
gboolean do_dots;
gchar *outptr;
- priv = CAMEL_MIME_FILTER_CRLF (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_CRLF_GET_PRIVATE (mime_filter);
do_dots = priv->mode == CAMEL_MIME_FILTER_CRLF_MODE_CRLF_DOTS;
@@ -143,7 +147,7 @@ mime_filter_crlf_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterCRLFPrivate *priv;
- priv = CAMEL_MIME_FILTER_CRLF (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_CRLF_GET_PRIVATE (mime_filter);
priv->saw_cr = FALSE;
priv->saw_lf = TRUE;
@@ -166,7 +170,7 @@ camel_mime_filter_crlf_class_init (CamelMimeFilterCRLFClass *class)
static void
camel_mime_filter_crlf_init (CamelMimeFilterCRLF *filter)
{
- filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_CRLF, CamelMimeFilterCRLFPrivate);
+ filter->priv = CAMEL_MIME_FILTER_CRLF_GET_PRIVATE (filter);
filter->priv->saw_cr = FALSE;
filter->priv->saw_lf = TRUE;
@@ -190,7 +194,7 @@ camel_mime_filter_crlf_new (CamelMimeFilterCRLFDirection direction,
CamelMimeFilterCRLFPrivate *priv;
filter = g_object_new (CAMEL_TYPE_MIME_FILTER_CRLF, NULL);
- priv = CAMEL_MIME_FILTER_CRLF (filter)->priv;
+ priv = CAMEL_MIME_FILTER_CRLF_GET_PRIVATE (filter);
priv->direction = direction;
priv->mode = mode;
diff --git a/camel/camel-mime-filter-enriched.c b/camel/camel-mime-filter-enriched.c
index e4c5408..b878d82 100644
--- a/camel/camel-mime-filter-enriched.c
+++ b/camel/camel-mime-filter-enriched.c
@@ -30,6 +30,10 @@
#include "camel-mime-filter-enriched.h"
#include "camel-string-utils.h"
+#define CAMEL_MIME_FILTER_ENRICHED_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_ENRICHED, CamelMimeFilterEnrichedPrivate))
+
struct _CamelMimeFilterEnrichedPrivate {
guint32 flags;
gint nofill;
@@ -224,7 +228,7 @@ enriched_to_html (CamelMimeFilter *mime_filter,
register const gchar *inptr;
register gchar *outptr;
- priv = CAMEL_MIME_FILTER_ENRICHED (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_ENRICHED_GET_PRIVATE (mime_filter);
camel_mime_filter_set_size (mime_filter, inlen * 2 + 6, FALSE);
@@ -515,7 +519,7 @@ mime_filter_enriched_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterEnrichedPrivate *priv;
- priv = CAMEL_MIME_FILTER_ENRICHED (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_ENRICHED_GET_PRIVATE (mime_filter);
priv->nofill = 0;
}
@@ -545,7 +549,7 @@ camel_mime_filter_enriched_class_init (CamelMimeFilterEnrichedClass *class)
static void
camel_mime_filter_enriched_init (CamelMimeFilterEnriched *filter)
{
- filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_ENRICHED, CamelMimeFilterEnrichedPrivate);
+ filter->priv = CAMEL_MIME_FILTER_ENRICHED_GET_PRIVATE (filter);
}
/**
@@ -560,15 +564,15 @@ camel_mime_filter_enriched_init (CamelMimeFilterEnriched *filter)
CamelMimeFilter *
camel_mime_filter_enriched_new (guint32 flags)
{
- CamelMimeFilter *res;
+ CamelMimeFilter *new;
CamelMimeFilterEnrichedPrivate *priv;
- res = g_object_new (CAMEL_TYPE_MIME_FILTER_ENRICHED, NULL);
- priv = CAMEL_MIME_FILTER_ENRICHED (res)->priv;
+ new = g_object_new (CAMEL_TYPE_MIME_FILTER_ENRICHED, NULL);
+ priv = CAMEL_MIME_FILTER_ENRICHED_GET_PRIVATE (new);
priv->flags = flags;
- return res;
+ return new;
}
/**
diff --git a/camel/camel-mime-filter-from.c b/camel/camel-mime-filter-from.c
index f297967..d774b21 100644
--- a/camel/camel-mime-filter-from.c
+++ b/camel/camel-mime-filter-from.c
@@ -27,6 +27,10 @@
#include "camel-mime-filter-from.h"
+#define CAMEL_MIME_FILTER_FROM_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_FROM, CamelMimeFilterFromPrivate))
+
#define d(x)
struct _CamelMimeFilterFromPrivate {
@@ -57,7 +61,7 @@ mime_filter_from_filter (CamelMimeFilter *mime_filter,
struct fromnode *head = NULL, *tail = (struct fromnode *)&head, *node;
gchar *outptr;
- priv = CAMEL_MIME_FILTER_FROM (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_FROM_GET_PRIVATE (mime_filter);
inptr = in;
inend = inptr+len;
@@ -160,7 +164,7 @@ camel_mime_filter_from_class_init (CamelMimeFilterFromClass *class)
static void
camel_mime_filter_from_init (CamelMimeFilterFrom *filter)
{
- filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_FROM, CamelMimeFilterFromPrivate);
+ filter->priv = CAMEL_MIME_FILTER_FROM_GET_PRIVATE (filter);
}
/**
diff --git a/camel/camel-mime-filter-gzip.c b/camel/camel-mime-filter-gzip.c
index e98116b..358bf2c 100644
--- a/camel/camel-mime-filter-gzip.c
+++ b/camel/camel-mime-filter-gzip.c
@@ -31,6 +31,10 @@
#include "camel-mime-filter-gzip.h"
+#define CAMEL_MIME_FILTER_GZIP_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_GZIP, CamelMimeFilterGZipPrivate))
+
/* rfc1952 */
enum {
@@ -106,7 +110,7 @@ gzip_filter (CamelMimeFilter *mime_filter,
CamelMimeFilterGZipPrivate *priv;
gint retval;
- priv = CAMEL_MIME_FILTER_GZIP (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_GZIP_GET_PRIVATE (mime_filter);
if (!priv->state.zip.wrote_hdr) {
priv->hdr.v.id1 = 31;
@@ -198,7 +202,7 @@ gunzip_filter (CamelMimeFilter *mime_filter,
guint16 need, val;
gint retval;
- priv = CAMEL_MIME_FILTER_GZIP (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_GZIP_GET_PRIVATE (mime_filter);
if (!priv->state.unzip.got_hdr) {
if (len < 10) {
@@ -343,7 +347,7 @@ mime_filter_gzip_finalize (GObject *object)
{
CamelMimeFilterGZipPrivate *priv;
- priv = CAMEL_MIME_FILTER_GZIP (object)->priv;
+ priv = CAMEL_MIME_FILTER_GZIP_GET_PRIVATE (object);
if (priv->mode == CAMEL_MIME_FILTER_GZIP_MODE_ZIP)
deflateEnd (priv->stream);
@@ -367,7 +371,7 @@ mime_filter_gzip_filter (CamelMimeFilter *mime_filter,
{
CamelMimeFilterGZipPrivate *priv;
- priv = CAMEL_MIME_FILTER_GZIP (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_GZIP_GET_PRIVATE (mime_filter);
if (priv->mode == CAMEL_MIME_FILTER_GZIP_MODE_ZIP)
gzip_filter (
@@ -390,7 +394,7 @@ mime_filter_gzip_complete (CamelMimeFilter *mime_filter,
{
CamelMimeFilterGZipPrivate *priv;
- priv = CAMEL_MIME_FILTER_GZIP (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_GZIP_GET_PRIVATE (mime_filter);
if (priv->mode == CAMEL_MIME_FILTER_GZIP_MODE_ZIP)
gzip_filter (
@@ -408,7 +412,7 @@ mime_filter_gzip_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterGZipPrivate *priv;
- priv = CAMEL_MIME_FILTER_GZIP (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_GZIP_GET_PRIVATE (mime_filter);
memset (&priv->state, 0, sizeof (priv->state));
@@ -441,7 +445,7 @@ camel_mime_filter_gzip_class_init (CamelMimeFilterGZipClass *class)
static void
camel_mime_filter_gzip_init (CamelMimeFilterGZip *mime_filter)
{
- mime_filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (mime_filter, CAMEL_TYPE_MIME_FILTER_GZIP, CamelMimeFilterGZipPrivate);
+ mime_filter->priv = CAMEL_MIME_FILTER_GZIP_GET_PRIVATE (mime_filter);
mime_filter->priv->stream = g_new0 (z_stream, 1);
mime_filter->priv->crc32 = crc32 (0, Z_NULL, 0);
}
@@ -463,7 +467,7 @@ camel_mime_filter_gzip_new (CamelMimeFilterGZipMode mode, gint level)
gint retval;
new = g_object_new (CAMEL_TYPE_MIME_FILTER_GZIP, NULL);
- priv = CAMEL_MIME_FILTER_GZIP (new)->priv;
+ priv = CAMEL_MIME_FILTER_GZIP_GET_PRIVATE (new);
priv->mode = mode;
priv->level = level;
diff --git a/camel/camel-mime-filter-html.c b/camel/camel-mime-filter-html.c
index 0ac795c..4c6c48f 100644
--- a/camel/camel-mime-filter-html.c
+++ b/camel/camel-mime-filter-html.c
@@ -33,6 +33,10 @@
#define d(x)
+#define CAMEL_MIME_FILTER_HTML_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_HTML, CamelMimeFilterHTMLPrivate))
+
struct _CamelMimeFilterHTMLPrivate {
CamelHTMLParser *ctxt;
};
@@ -78,7 +82,7 @@ mime_filter_html_run (CamelMimeFilter *mime_filter,
camel_html_parser_t state;
gchar *outp;
- priv = CAMEL_MIME_FILTER_HTML (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_HTML_GET_PRIVATE (mime_filter);
d(printf("converting html:\n%.*s\n", (gint)inlen, in));
@@ -120,7 +124,7 @@ mime_filter_html_dispose (GObject *object)
{
CamelMimeFilterHTMLPrivate *priv;
- priv = CAMEL_MIME_FILTER_HTML (object)->priv;
+ priv = CAMEL_MIME_FILTER_HTML_GET_PRIVATE (object);
if (priv->ctxt != NULL) {
g_object_unref (priv->ctxt);
@@ -164,7 +168,7 @@ mime_filter_html_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterHTMLPrivate *priv;
- priv = CAMEL_MIME_FILTER_HTML (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_HTML_GET_PRIVATE (mime_filter);
g_object_unref (priv->ctxt);
priv->ctxt = camel_html_parser_new ();
@@ -190,7 +194,7 @@ camel_mime_filter_html_class_init (CamelMimeFilterHTMLClass *class)
static void
camel_mime_filter_html_init (CamelMimeFilterHTML *mime_filter)
{
- mime_filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (mime_filter, CAMEL_TYPE_MIME_FILTER_HTML, CamelMimeFilterHTMLPrivate);
+ mime_filter->priv = CAMEL_MIME_FILTER_HTML_GET_PRIVATE (mime_filter);
mime_filter->priv->ctxt = camel_html_parser_new ();
}
diff --git a/camel/camel-mime-filter-index.c b/camel/camel-mime-filter-index.c
index 059fa80..47c15dd 100644
--- a/camel/camel-mime-filter-index.c
+++ b/camel/camel-mime-filter-index.c
@@ -21,6 +21,10 @@
#include "camel-mime-filter-index.h"
#include "camel-text-index.h"
+#define CAMEL_MIME_FILTER_INDEX_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_INDEX, CamelMimeFilterIndexPrivate))
+
struct _CamelMimeFilterIndexPrivate {
CamelIndex *index;
CamelIndexName *name;
@@ -33,7 +37,7 @@ mime_filter_index_dispose (GObject *object)
{
CamelMimeFilterIndexPrivate *priv;
- priv = CAMEL_MIME_FILTER_INDEX (object)->priv;
+ priv = CAMEL_MIME_FILTER_INDEX_GET_PRIVATE (object);
if (priv->name != NULL) {
g_object_unref (priv->name);
@@ -60,7 +64,7 @@ mime_filter_index_filter (CamelMimeFilter *mime_filter,
{
CamelMimeFilterIndexPrivate *priv;
- priv = CAMEL_MIME_FILTER_INDEX (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_INDEX_GET_PRIVATE (mime_filter);
if (priv->index == NULL || priv->name==NULL) {
goto donothing;
@@ -85,7 +89,7 @@ mime_filter_index_complete (CamelMimeFilter *mime_filter,
{
CamelMimeFilterIndexPrivate *priv;
- priv = CAMEL_MIME_FILTER_INDEX (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_INDEX_GET_PRIVATE (mime_filter);
if (priv->index == NULL || priv->name==NULL) {
goto donothing;
@@ -119,7 +123,7 @@ camel_mime_filter_index_class_init (CamelMimeFilterIndexClass *class)
static void
camel_mime_filter_index_init (CamelMimeFilterIndex *filter)
{
- filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_INDEX, CamelMimeFilterIndexPrivate);
+ filter->priv = CAMEL_MIME_FILTER_INDEX_GET_PRIVATE (filter);
}
/**
@@ -133,17 +137,18 @@ camel_mime_filter_index_init (CamelMimeFilterIndex *filter)
CamelMimeFilter *
camel_mime_filter_index_new (CamelIndex *index)
{
- CamelMimeFilter *res;
+ CamelMimeFilter *new;
CamelMimeFilterIndexPrivate *priv;
- res = g_object_new (CAMEL_TYPE_MIME_FILTER_INDEX, NULL);
-
- priv = CAMEL_MIME_FILTER_INDEX (res)->priv;
- priv->index = index;
- if (index)
- g_object_ref (index);
+ new = g_object_new (CAMEL_TYPE_MIME_FILTER_INDEX, NULL);
- return res;
+ if (new) {
+ priv = CAMEL_MIME_FILTER_INDEX_GET_PRIVATE (new);
+ priv->index = index;
+ if (index)
+ g_object_ref (index);
+ }
+ return new;
}
/* Set the match name for any indexed words */
diff --git a/camel/camel-mime-filter-linewrap.c b/camel/camel-mime-filter-linewrap.c
index 6d6c2ff..0449d89 100644
--- a/camel/camel-mime-filter-linewrap.c
+++ b/camel/camel-mime-filter-linewrap.c
@@ -27,6 +27,10 @@
#include "camel-mime-filter-linewrap.h"
+#define CAMEL_MIME_FILTER_LINEWRAP_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_LINEWRAP, CamelMimeFilterLinewrapPrivate))
+
struct _CamelMimeFilterLinewrapPrivate {
guint wrap_len;
guint max_len;
@@ -51,7 +55,7 @@ mime_filter_linewrap_filter (CamelMimeFilter *mime_filter,
const gchar *inend, *p;
gint nchars;
- priv = CAMEL_MIME_FILTER_LINEWRAP (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_LINEWRAP_GET_PRIVATE (mime_filter);
nchars = priv->nchars;
@@ -154,7 +158,7 @@ mime_filter_linewrap_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterLinewrapPrivate *priv;
- priv = CAMEL_MIME_FILTER_LINEWRAP (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_LINEWRAP_GET_PRIVATE (mime_filter);
priv->nchars = 0;
}
@@ -175,7 +179,7 @@ camel_mime_filter_linewrap_class_init (CamelMimeFilterLinewrapClass *class)
static void
camel_mime_filter_linewrap_init (CamelMimeFilterLinewrap *filter)
{
- filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_LINEWRAP, CamelMimeFilterLinewrapPrivate);
+ filter->priv = CAMEL_MIME_FILTER_LINEWRAP_GET_PRIVATE (filter);
}
CamelMimeFilter *
@@ -188,7 +192,7 @@ camel_mime_filter_linewrap_new (guint preferred_len,
CamelMimeFilterLinewrapPrivate *priv;
filter = g_object_new (CAMEL_TYPE_MIME_FILTER_LINEWRAP, NULL);
- priv = CAMEL_MIME_FILTER_LINEWRAP (filter)->priv;
+ priv = CAMEL_MIME_FILTER_LINEWRAP_GET_PRIVATE (filter);
priv->indent = indent_char;
priv->wrap_len = preferred_len;
diff --git a/camel/camel-mime-filter-pgp.c b/camel/camel-mime-filter-pgp.c
index fe868dc..c9a539a 100644
--- a/camel/camel-mime-filter-pgp.c
+++ b/camel/camel-mime-filter-pgp.c
@@ -32,6 +32,10 @@
#include "camel-mime-filter-pgp.h"
+#define CAMEL_MIME_FILTER_PGP_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_PGP, CamelMimeFilterPgpPrivate))
+
#define BEGIN_PGP_SIGNED_MESSAGE "-----BEGIN PGP SIGNED MESSAGE-----"
#define BEGIN_PGP_SIGNATURE "-----BEGIN PGP SIGNATURE-----"
#define END_PGP_SIGNATURE "-----END PGP SIGNATURE-----"
@@ -70,7 +74,7 @@ mime_filter_pgp_run (CamelMimeFilter *mime_filter,
gboolean blank;
gsize len;
- priv = CAMEL_MIME_FILTER_PGP (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_PGP_GET_PRIVATE (mime_filter);
/* only need as much space as the input, we're stripping chars */
camel_mime_filter_set_size (mime_filter, inlen, FALSE);
@@ -179,7 +183,7 @@ mime_filter_pgp_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterPgpPrivate *priv;
- priv = CAMEL_MIME_FILTER_PGP (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_PGP_GET_PRIVATE (mime_filter);
priv->state = PGP_PREFACE;
}
@@ -200,7 +204,7 @@ camel_mime_filter_pgp_class_init (CamelMimeFilterPgpClass *class)
static void
camel_mime_filter_pgp_init (CamelMimeFilterPgp *filter)
{
- filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_PGP, CamelMimeFilterPgpPrivate);
+ filter->priv = CAMEL_MIME_FILTER_PGP_GET_PRIVATE (filter);
}
CamelMimeFilter *
diff --git a/camel/camel-mime-filter-progress.c b/camel/camel-mime-filter-progress.c
index 436cc8a..109b3bc 100644
--- a/camel/camel-mime-filter-progress.c
+++ b/camel/camel-mime-filter-progress.c
@@ -30,6 +30,10 @@
#include "camel-mime-filter-progress.h"
#include "camel-operation.h"
+#define CAMEL_MIME_FILTER_PROGRESS_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_PROGRESS, CamelMimeFilterProgressPrivate))
+
#define d(x)
#define w(x)
@@ -46,7 +50,7 @@ mime_filter_progress_dispose (GObject *object)
{
CamelMimeFilterProgressPrivate *priv;
- priv = CAMEL_MIME_FILTER_PROGRESS (object)->priv;
+ priv = CAMEL_MIME_FILTER_PROGRESS_GET_PRIVATE (object);
if (priv->cancellable != NULL) {
g_object_unref (priv->cancellable);
@@ -69,7 +73,7 @@ mime_filter_progress_filter (CamelMimeFilter *mime_filter,
CamelMimeFilterProgressPrivate *priv;
gdouble percent;
- priv = CAMEL_MIME_FILTER_PROGRESS (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_PROGRESS_GET_PRIVATE (mime_filter);
priv->count += len;
if (priv->count < priv->total)
@@ -103,7 +107,7 @@ mime_filter_progress_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterProgressPrivate *priv;
- priv = CAMEL_MIME_FILTER_PROGRESS (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_PROGRESS_GET_PRIVATE (mime_filter);
priv->count = 0;
}
@@ -128,7 +132,7 @@ camel_mime_filter_progress_class_init (CamelMimeFilterProgressClass *class)
static void
camel_mime_filter_progress_init (CamelMimeFilterProgress *filter)
{
- filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_PROGRESS, CamelMimeFilterProgressPrivate);
+ filter->priv = CAMEL_MIME_FILTER_PROGRESS_GET_PRIVATE (filter);
}
/**
@@ -153,7 +157,7 @@ camel_mime_filter_progress_new (GCancellable *cancellable,
CamelMimeFilterProgressPrivate *priv;
filter = g_object_new (CAMEL_TYPE_MIME_FILTER_PROGRESS, NULL);
- priv = CAMEL_MIME_FILTER_PROGRESS (filter)->priv;
+ priv = CAMEL_MIME_FILTER_PROGRESS_GET_PRIVATE (filter);
if (CAMEL_IS_OPERATION (cancellable))
priv->cancellable = g_object_ref (cancellable);
diff --git a/camel/camel-mime-filter-save.c b/camel/camel-mime-filter-save.c
index 4966e73..b7092f1 100644
--- a/camel/camel-mime-filter-save.c
+++ b/camel/camel-mime-filter-save.c
@@ -27,6 +27,10 @@
#include "camel-mime-filter-save.h"
#include "camel-stream-mem.h"
+#define CAMEL_MIME_FILTER_SAVE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_SAVE, CamelMimeFilterSavePrivate))
+
struct _CamelMimeFilterSavePrivate {
CamelStream *stream;
};
@@ -44,7 +48,7 @@ mime_filter_save_filter (CamelMimeFilter *mime_filter,
{
CamelMimeFilterSavePrivate *priv;
- priv = CAMEL_MIME_FILTER_SAVE (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_SAVE_GET_PRIVATE (mime_filter);
if (priv->stream != NULL)
camel_stream_write (priv->stream, in, len, NULL, NULL);
@@ -91,7 +95,7 @@ camel_mime_filter_save_class_init (CamelMimeFilterSaveClass *class)
static void
camel_mime_filter_save_init (CamelMimeFilterSave *filter)
{
- filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_SAVE, CamelMimeFilterSavePrivate);
+ filter->priv = CAMEL_MIME_FILTER_SAVE_GET_PRIVATE (filter);
}
/**
@@ -113,7 +117,7 @@ camel_mime_filter_save_new (CamelStream *stream)
g_return_val_if_fail (CAMEL_IS_STREAM (stream), NULL);
filter = g_object_new (CAMEL_TYPE_MIME_FILTER_SAVE, NULL);
- priv = CAMEL_MIME_FILTER_SAVE (filter)->priv;
+ priv = CAMEL_MIME_FILTER_SAVE_GET_PRIVATE (filter);
if (stream != NULL)
priv->stream = g_object_ref (stream);
diff --git a/camel/camel-mime-filter-tohtml.c b/camel/camel-mime-filter-tohtml.c
index 962a843..c397010 100644
--- a/camel/camel-mime-filter-tohtml.c
+++ b/camel/camel-mime-filter-tohtml.c
@@ -31,6 +31,10 @@
#include "camel-url-scanner.h"
#include "camel-utf8.h"
+#define CAMEL_MIME_FILTER_TOHTML_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_TOHTML, CamelMimeFilterToHTMLPrivate))
+
struct _CamelMimeFilterToHTMLPrivate {
CamelUrlScanner *scanner;
@@ -155,7 +159,7 @@ writeln (CamelMimeFilter *mime_filter,
CamelMimeFilterToHTMLPrivate *priv;
const guchar *inptr = in;
- priv = CAMEL_MIME_FILTER_TOHTML (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_TOHTML_GET_PRIVATE (mime_filter);
while (inptr < inend) {
guint32 u;
@@ -235,7 +239,7 @@ html_convert (CamelMimeFilter *mime_filter,
const gchar *inend;
gint depth;
- priv = CAMEL_MIME_FILTER_TOHTML (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_TOHTML_GET_PRIVATE (mime_filter);
if (inlen == 0) {
if (priv->pre_open) {
@@ -393,7 +397,7 @@ mime_filter_tohtml_finalize (GObject *object)
{
CamelMimeFilterToHTMLPrivate *priv;
- priv = CAMEL_MIME_FILTER_TOHTML (object)->priv;
+ priv = CAMEL_MIME_FILTER_TOHTML_GET_PRIVATE (object);
camel_url_scanner_free (priv->scanner);
@@ -434,7 +438,7 @@ mime_filter_tohtml_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterToHTMLPrivate *priv;
- priv = CAMEL_MIME_FILTER_TOHTML (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_TOHTML_GET_PRIVATE (mime_filter);
priv->column = 0;
priv->pre_open = FALSE;
@@ -460,7 +464,8 @@ camel_mime_filter_tohtml_class_init (CamelMimeFilterToHTMLClass *class)
static void
camel_mime_filter_tohtml_init (CamelMimeFilterToHTML *filter)
{
- filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_TOHTML, CamelMimeFilterToHTMLPrivate);
+ filter->priv = CAMEL_MIME_FILTER_TOHTML_GET_PRIVATE (filter);
+
filter->priv->scanner = camel_url_scanner_new ();
}
@@ -482,7 +487,7 @@ camel_mime_filter_tohtml_new (guint32 flags, guint32 color)
gint i;
filter = g_object_new (CAMEL_TYPE_MIME_FILTER_TOHTML, NULL);
- priv = CAMEL_MIME_FILTER_TOHTML (filter)->priv;
+ priv = CAMEL_MIME_FILTER_TOHTML_GET_PRIVATE (filter);
priv->flags = flags;
priv->color = color;
diff --git a/camel/camel-mime-filter-windows.c b/camel/camel-mime-filter-windows.c
index 72d5bfe..0f62acf 100644
--- a/camel/camel-mime-filter-windows.c
+++ b/camel/camel-mime-filter-windows.c
@@ -31,6 +31,10 @@
#include "camel-charset-map.h"
#include "camel-mime-filter-windows.h"
+#define CAMEL_MIME_FILTER_WINDOWS_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_WINDOWS, CamelMimeFilterWindowsPrivate))
+
#define d(x)
#define w(x)
@@ -46,7 +50,7 @@ mime_filter_windows_finalize (GObject *object)
{
CamelMimeFilterWindowsPrivate *priv;
- priv = CAMEL_MIME_FILTER_WINDOWS (object)->priv;
+ priv = CAMEL_MIME_FILTER_WINDOWS_GET_PRIVATE (object);
g_free (priv->claimed_charset);
@@ -67,7 +71,7 @@ mime_filter_windows_filter (CamelMimeFilter *mime_filter,
register guchar *inptr;
guchar *inend;
- priv = CAMEL_MIME_FILTER_WINDOWS (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_WINDOWS_GET_PRIVATE (mime_filter);
if (!priv->is_windows) {
inptr = (guchar *) in;
@@ -109,7 +113,7 @@ mime_filter_windows_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterWindowsPrivate *priv;
- priv = CAMEL_MIME_FILTER_WINDOWS (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_WINDOWS_GET_PRIVATE (mime_filter);
priv->is_windows = FALSE;
}
@@ -134,7 +138,7 @@ camel_mime_filter_windows_class_init (CamelMimeFilterWindowsClass *class)
static void
camel_mime_filter_windows_init (CamelMimeFilterWindows *filter)
{
- filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_WINDOWS, CamelMimeFilterWindowsPrivate);
+ filter->priv = CAMEL_MIME_FILTER_WINDOWS_GET_PRIVATE (filter);
}
/**
@@ -155,7 +159,7 @@ camel_mime_filter_windows_new (const gchar *claimed_charset)
g_return_val_if_fail (claimed_charset != NULL, NULL);
filter = g_object_new (CAMEL_TYPE_MIME_FILTER_WINDOWS, NULL);
- priv = CAMEL_MIME_FILTER_WINDOWS (filter)->priv;
+ priv = CAMEL_MIME_FILTER_WINDOWS_GET_PRIVATE (filter);
priv->claimed_charset = g_strdup (claimed_charset);
diff --git a/camel/camel-mime-filter-yenc.c b/camel/camel-mime-filter-yenc.c
index cf81579..2d1fc93 100644
--- a/camel/camel-mime-filter-yenc.c
+++ b/camel/camel-mime-filter-yenc.c
@@ -28,6 +28,10 @@
#include "camel-mime-filter-yenc.h"
+#define CAMEL_MIME_FILTER_YENC_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER_YENC, CamelMimeFilterYencPrivate))
+
struct _CamelMimeFilterYencPrivate {
CamelMimeFilterYencDirection direction;
@@ -54,7 +58,7 @@ mime_filter_yenc_filter (CamelMimeFilter *mime_filter,
CamelMimeFilterYencPrivate *priv;
gsize newlen = 0;
- priv = CAMEL_MIME_FILTER_YENC (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_YENC_GET_PRIVATE (mime_filter);
switch (priv->direction) {
case CAMEL_MIME_FILTER_YENC_DIRECTION_ENCODE:
@@ -163,7 +167,7 @@ mime_filter_yenc_complete (CamelMimeFilter *mime_filter,
CamelMimeFilterYencPrivate *priv;
gsize newlen = 0;
- priv = CAMEL_MIME_FILTER_YENC (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_YENC_GET_PRIVATE (mime_filter);
switch (priv->direction) {
case CAMEL_MIME_FILTER_YENC_DIRECTION_ENCODE:
@@ -205,7 +209,7 @@ mime_filter_yenc_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterYencPrivate *priv;
- priv = CAMEL_MIME_FILTER_YENC (mime_filter)->priv;
+ priv = CAMEL_MIME_FILTER_YENC_GET_PRIVATE (mime_filter);
switch (priv->direction) {
case CAMEL_MIME_FILTER_YENC_DIRECTION_ENCODE:
@@ -236,7 +240,7 @@ camel_mime_filter_yenc_class_init (CamelMimeFilterYencClass *class)
static void
camel_mime_filter_yenc_init (CamelMimeFilterYenc *filter)
{
- filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_YENC, CamelMimeFilterYencPrivate);
+ filter->priv = CAMEL_MIME_FILTER_YENC_GET_PRIVATE (filter);
filter->priv->part = 0;
filter->priv->pcrc = CAMEL_MIME_YENCODE_CRC_INIT;
@@ -258,7 +262,7 @@ camel_mime_filter_yenc_new (CamelMimeFilterYencDirection direction)
CamelMimeFilterYencPrivate *priv;
filter = g_object_new (CAMEL_TYPE_MIME_FILTER_YENC, NULL);
- priv = CAMEL_MIME_FILTER_YENC (filter)->priv;
+ priv = CAMEL_MIME_FILTER_YENC_GET_PRIVATE (filter);
priv->direction = direction;
diff --git a/camel/camel-mime-filter.c b/camel/camel-mime-filter.c
index 0f98de1..5b0f0aa 100644
--- a/camel/camel-mime-filter.c
+++ b/camel/camel-mime-filter.c
@@ -29,6 +29,10 @@
#include <mcheck.h>
#endif
+#define CAMEL_MIME_FILTER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_FILTER, CamelMimeFilterPrivate))
+
struct _CamelMimeFilterPrivate {
gchar *inbuf;
gsize inlen;
@@ -82,7 +86,7 @@ camel_mime_filter_class_init (CamelMimeFilterClass *class)
static void
camel_mime_filter_init (CamelMimeFilter *mime_filter)
{
- mime_filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (mime_filter, CAMEL_TYPE_MIME_FILTER, CamelMimeFilterPrivate);
+ mime_filter->priv = CAMEL_MIME_FILTER_GET_PRIVATE (mime_filter);
mime_filter->outreal = NULL;
mime_filter->outbuf = NULL;
@@ -147,7 +151,7 @@ static void filter_run (CamelMimeFilter *f,
struct _CamelMimeFilterPrivate *p;
gint newlen;
- p = f->priv;
+ p = CAMEL_MIME_FILTER_GET_PRIVATE (f);
newlen = len + prespace + f->backlen;
if (p->inlen < newlen) {
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index f428283..5267175 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -49,6 +49,10 @@
#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
+#define CAMEL_MIME_PART_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MIME_PART, CamelMimePartPrivate))
+
typedef struct _AsyncContext AsyncContext;
struct _CamelMimePartPrivate {
@@ -395,7 +399,7 @@ mime_part_finalize (GObject *object)
{
CamelMimePartPrivate *priv;
- priv = CAMEL_MIME_PART (object)->priv;
+ priv = CAMEL_MIME_PART_GET_PRIVATE (object);
g_free (priv->description);
g_free (priv->content_id);
@@ -915,7 +919,7 @@ camel_mime_part_init (CamelMimePart *mime_part)
{
CamelDataWrapper *data_wrapper;
- mime_part->priv = G_TYPE_INSTANCE_GET_PRIVATE (mime_part, CAMEL_TYPE_MIME_PART, CamelMimePartPrivate);
+ mime_part->priv = CAMEL_MIME_PART_GET_PRIVATE (mime_part);
mime_part->priv->encoding = CAMEL_TRANSFER_ENCODING_DEFAULT;
data_wrapper = CAMEL_DATA_WRAPPER (mime_part);
diff --git a/camel/camel-object.c b/camel/camel-object.c
index 42c3c61..c9d3026 100644
--- a/camel/camel-object.c
+++ b/camel/camel-object.c
@@ -35,6 +35,10 @@
#define d(x)
+#define CAMEL_OBJECT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_OBJECT, CamelObjectPrivate))
+
struct _CamelObjectPrivate {
gchar *state_filename;
};
@@ -128,7 +132,7 @@ object_finalize (GObject *object)
{
CamelObjectPrivate *priv;
- priv = CAMEL_OBJECT (object)->priv;
+ priv = CAMEL_OBJECT_GET_PRIVATE (object);
g_free (priv->state_filename);
@@ -360,7 +364,7 @@ camel_object_class_init (CamelObjectClass *class)
static void
camel_object_init (CamelObject *object)
{
- object->priv = G_TYPE_INSTANCE_GET_PRIVATE (object, CAMEL_TYPE_OBJECT, CamelObjectPrivate);
+ object->priv = CAMEL_OBJECT_GET_PRIVATE (object);
}
GQuark
diff --git a/camel/camel-offline-folder.c b/camel/camel-offline-folder.c
index 52b23bd..c1b2901 100644
--- a/camel/camel-offline-folder.c
+++ b/camel/camel-offline-folder.c
@@ -33,6 +33,10 @@
#include "camel-session.h"
#include "camel-store.h"
+#define CAMEL_OFFLINE_FOLDER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_OFFLINE_FOLDER, CamelOfflineFolderPrivate))
+
typedef struct _AsyncContext AsyncContext;
struct _CamelOfflineFolderPrivate {
@@ -318,7 +322,7 @@ camel_offline_folder_class_init (CamelOfflineFolderClass *class)
static void
camel_offline_folder_init (CamelOfflineFolder *folder)
{
- folder->priv = G_TYPE_INSTANCE_GET_PRIVATE (folder, CAMEL_TYPE_OFFLINE_FOLDER, CamelOfflineFolderPrivate);
+ folder->priv = CAMEL_OFFLINE_FOLDER_GET_PRIVATE (folder);
g_signal_connect (
folder, "changed",
diff --git a/camel/camel-offline-store.c b/camel/camel-offline-store.c
index 6ce9c49..a93377a 100644
--- a/camel/camel-offline-store.c
+++ b/camel/camel-offline-store.c
@@ -31,6 +31,10 @@
#include "camel-offline-store.h"
#include "camel-session.h"
+#define CAMEL_OFFLINE_STORE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_OFFLINE_STORE, CamelOfflineStorePrivate))
+
struct _CamelOfflineStorePrivate {
gboolean online;
};
@@ -71,7 +75,7 @@ camel_offline_store_class_init (CamelOfflineStoreClass *class)
static void
camel_offline_store_init (CamelOfflineStore *store)
{
- store->priv = G_TYPE_INSTANCE_GET_PRIVATE (store, CAMEL_TYPE_OFFLINE_STORE, CamelOfflineStorePrivate);
+ store->priv = CAMEL_OFFLINE_STORE_GET_PRIVATE (store);
store->priv->online = TRUE;
}
diff --git a/camel/camel-operation.c b/camel/camel-operation.c
index cbcf34c..13626d9 100644
--- a/camel/camel-operation.c
+++ b/camel/camel-operation.c
@@ -31,6 +31,10 @@
#include "camel-msgport.h"
#include "camel-operation.h"
+#define CAMEL_OPERATION_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_OPERATION, CamelOperationPrivate))
+
#define PROGRESS_DELAY 250 /* milliseconds */
#define TRANSIENT_DELAY 250 /* milliseconds */
#define POP_MESSAGE_DELAY 999 /* milliseconds */
@@ -158,7 +162,7 @@ operation_finalize (GObject *object)
{
CamelOperationPrivate *priv;
- priv = CAMEL_OPERATION (object)->priv;
+ priv = CAMEL_OPERATION_GET_PRIVATE (object);
LOCK ();
@@ -203,7 +207,7 @@ camel_operation_class_init (CamelOperationClass *class)
static void
camel_operation_init (CamelOperation *operation)
{
- operation->priv = G_TYPE_INSTANCE_GET_PRIVATE (operation, CAMEL_TYPE_OPERATION, CamelOperationPrivate);
+ operation->priv = CAMEL_OPERATION_GET_PRIVATE (operation);
g_queue_init (&operation->priv->status_stack);
operation->priv->cancel_port = camel_msgport_new ();
diff --git a/camel/camel-partition-table.c b/camel/camel-partition-table.c
index af2e2da..ffd42c3 100644
--- a/camel/camel-partition-table.c
+++ b/camel/camel-partition-table.c
@@ -46,6 +46,10 @@
#define CAMEL_PARTITION_TABLE_LOCK(kf, lock) (g_static_mutex_lock(&(kf)->priv->lock))
#define CAMEL_PARTITION_TABLE_UNLOCK(kf, lock) (g_static_mutex_unlock(&(kf)->priv->lock))
+#define CAMEL_PARTITION_TABLE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_PARTITION_TABLE, CamelPartitionTablePrivate))
+
struct _CamelPartitionTablePrivate {
GStaticMutex lock; /* for locking partition */
};
@@ -88,7 +92,7 @@ camel_partition_table_class_init (CamelPartitionTableClass *class)
static void
camel_partition_table_init (CamelPartitionTable *cpi)
{
- cpi->priv = G_TYPE_INSTANCE_GET_PRIVATE (cpi, CAMEL_TYPE_PARTITION_TABLE, CamelPartitionTablePrivate);
+ cpi->priv = CAMEL_PARTITION_TABLE_GET_PRIVATE (cpi);
camel_dlist_init (&cpi->partition);
g_static_mutex_init (&cpi->priv->lock);
@@ -595,6 +599,10 @@ fail:
/* ********************************************************************** */
+#define CAMEL_KEY_TABLE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_KEY_TABLE, CamelKeyTablePrivate))
+
#define CAMEL_KEY_TABLE_LOCK(kf, lock) (g_static_mutex_lock(&(kf)->priv->lock))
#define CAMEL_KEY_TABLE_UNLOCK(kf, lock) (g_static_mutex_unlock(&(kf)->priv->lock))
@@ -638,7 +646,7 @@ camel_key_table_class_init (CamelKeyTableClass *class)
static void
camel_key_table_init (CamelKeyTable *table)
{
- table->priv = G_TYPE_INSTANCE_GET_PRIVATE (table, CAMEL_TYPE_KEY_TABLE, CamelKeyTablePrivate);
+ table->priv = CAMEL_KEY_TABLE_GET_PRIVATE (table);
g_static_mutex_init (&table->priv->lock);
}
diff --git a/camel/camel-sasl-cram-md5.c b/camel/camel-sasl-cram-md5.c
index acaf2ef..3ce6237 100644
--- a/camel/camel-sasl-cram-md5.c
+++ b/camel/camel-sasl-cram-md5.c
@@ -33,6 +33,10 @@
#include "camel-sasl-cram-md5.h"
#include "camel-service.h"
+#define CAMEL_SASL_CRAM_MD5_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_SASL_CRAM_MD5, CamelSaslCramMd5Private))
+
struct _CamelSaslCramMd5Private {
gint placeholder; /* allow for future expansion */
};
@@ -142,5 +146,5 @@ camel_sasl_cram_md5_class_init (CamelSaslCramMd5Class *class)
static void
camel_sasl_cram_md5_init (CamelSaslCramMd5 *sasl)
{
- sasl->priv = G_TYPE_INSTANCE_GET_PRIVATE (sasl, CAMEL_TYPE_SASL_CRAM_MD5, CamelSaslCramMd5Private);
+ sasl->priv = CAMEL_SASL_CRAM_MD5_GET_PRIVATE (sasl);
}
diff --git a/camel/camel-sasl-digest-md5.c b/camel/camel-sasl-digest-md5.c
index 7d0e19e..2338c45 100644
--- a/camel/camel-sasl-digest-md5.c
+++ b/camel/camel-sasl-digest-md5.c
@@ -48,6 +48,10 @@
#define PARANOID(x) x
+#define CAMEL_SASL_DIGEST_MD5_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_SASL_DIGEST_MD5, CamelSaslDigestMd5Private))
+
/* Implements rfc2831 */
CamelServiceAuthType camel_sasl_digest_md5_authtype = {
@@ -942,5 +946,5 @@ camel_sasl_digest_md5_class_init (CamelSaslDigestMd5Class *class)
static void
camel_sasl_digest_md5_init (CamelSaslDigestMd5 *sasl)
{
- sasl->priv = G_TYPE_INSTANCE_GET_PRIVATE (sasl, CAMEL_TYPE_SASL_DIGEST_MD5, CamelSaslDigestMd5Private);
+ sasl->priv = CAMEL_SASL_DIGEST_MD5_GET_PRIVATE (sasl);
}
diff --git a/camel/camel-sasl-gssapi.c b/camel/camel-sasl-gssapi.c
index 23f6102..ad1dff8 100644
--- a/camel/camel-sasl-gssapi.c
+++ b/camel/camel-sasl-gssapi.c
@@ -77,6 +77,10 @@ extern gss_OID gss_nt_service_name;
#define DBUS_INTERFACE "org.gnome.KrbAuthDialog"
#define DBUS_METHOD "org.gnome.KrbAuthDialog.acquireTgt"
+#define CAMEL_SASL_GSSAPI_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_SASL_GSSAPI, CamelSaslGssapiPrivate))
+
CamelServiceAuthType camel_sasl_gssapi_authtype = {
N_("GSSAPI"),
@@ -264,7 +268,7 @@ sasl_gssapi_challenge_sync (CamelSasl *sasl,
struct addrinfo *ai, hints;
const gchar *service_name;
- priv = CAMEL_SASL_GSSAPI (sasl)->priv;
+ priv = CAMEL_SASL_GSSAPI_GET_PRIVATE (sasl);
service = camel_sasl_get_service (sasl);
service_name = camel_sasl_get_service_name (sasl);
@@ -441,7 +445,8 @@ static void
camel_sasl_gssapi_init (CamelSaslGssapi *sasl)
{
#ifdef HAVE_KRB5
- sasl->priv = G_TYPE_INSTANCE_GET_PRIVATE (sasl, CAMEL_TYPE_SASL_GSSAPI, CamelSaslGssapiPrivate);
+ sasl->priv = CAMEL_SASL_GSSAPI_GET_PRIVATE (sasl);
+
sasl->priv->state = GSSAPI_STATE_INIT;
sasl->priv->ctx = GSS_C_NO_CONTEXT;
sasl->priv->target = GSS_C_NO_NAME;
diff --git a/camel/camel-sasl-login.c b/camel/camel-sasl-login.c
index f3ca3d2..8615ae3 100644
--- a/camel/camel-sasl-login.c
+++ b/camel/camel-sasl-login.c
@@ -31,6 +31,10 @@
#include "camel-sasl-login.h"
#include "camel-service.h"
+#define CAMEL_SASL_LOGIN_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_SASL_LOGIN, CamelSaslLoginPrivate))
+
CamelServiceAuthType camel_sasl_login_authtype = {
N_("Login"),
@@ -63,7 +67,7 @@ sasl_login_challenge_sync (CamelSasl *sasl,
CamelService *service;
CamelURL *url;
- priv = CAMEL_SASL_LOGIN (sasl)->priv;
+ priv = CAMEL_SASL_LOGIN_GET_PRIVATE (sasl);
service = camel_sasl_get_service (sasl);
url = service->url;
@@ -110,5 +114,5 @@ camel_sasl_login_class_init (CamelSaslLoginClass *class)
static void
camel_sasl_login_init (CamelSaslLogin *sasl)
{
- sasl->priv = G_TYPE_INSTANCE_GET_PRIVATE (sasl, CAMEL_TYPE_SASL_LOGIN, CamelSaslLoginPrivate);
+ sasl->priv = CAMEL_SASL_LOGIN_GET_PRIVATE (sasl);
}
diff --git a/camel/camel-sasl-ntlm.c b/camel/camel-sasl-ntlm.c
index 94d50d5..a683d4b 100644
--- a/camel/camel-sasl-ntlm.c
+++ b/camel/camel-sasl-ntlm.c
@@ -29,6 +29,10 @@
#include "camel-sasl-ntlm.h"
+#define CAMEL_SASL_NTLM_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_SASL_NTLM, CamelSaslNTLMPrivate))
+
struct _CamelSaslNTLMPrivate {
gint placeholder; /* allow for future expansion */
};
@@ -732,5 +736,5 @@ camel_sasl_ntlm_class_init (CamelSaslNTLMClass *class)
static void
camel_sasl_ntlm_init (CamelSaslNTLM *sasl)
{
- sasl->priv = G_TYPE_INSTANCE_GET_PRIVATE (sasl, CAMEL_TYPE_SASL_NTLM, CamelSaslNTLMPrivate);
+ sasl->priv = CAMEL_SASL_NTLM_GET_PRIVATE (sasl);
}
diff --git a/camel/camel-sasl-plain.c b/camel/camel-sasl-plain.c
index a4b0049..39b6571 100644
--- a/camel/camel-sasl-plain.c
+++ b/camel/camel-sasl-plain.c
@@ -31,6 +31,10 @@
#include "camel-sasl-plain.h"
#include "camel-service.h"
+#define CAMEL_SASL_PLAIN_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_SASL_PLAIN, CamelSaslPlainPrivate))
+
struct _CamelSaslPlainPrivate {
gint placeholder; /* allow for future expansion */
};
@@ -87,5 +91,5 @@ camel_sasl_plain_class_init (CamelSaslPlainClass *class)
static void
camel_sasl_plain_init (CamelSaslPlain *sasl)
{
- sasl->priv = G_TYPE_INSTANCE_GET_PRIVATE (sasl, CAMEL_TYPE_SASL_PLAIN, CamelSaslPlainPrivate);
+ sasl->priv = CAMEL_SASL_PLAIN_GET_PRIVATE (sasl);
}
diff --git a/camel/camel-sasl-popb4smtp.c b/camel/camel-sasl-popb4smtp.c
index eb90afa..8bfc5b0 100644
--- a/camel/camel-sasl-popb4smtp.c
+++ b/camel/camel-sasl-popb4smtp.c
@@ -34,6 +34,10 @@
#include "camel-session.h"
#include "camel-store.h"
+#define CAMEL_SASL_POPB4SMTP_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_SASL_POPB4SMTP, CamelSaslPOPB4SMTPPrivate))
+
struct _CamelSaslPOPB4SMTPPrivate {
gint placeholder; /* allow for future expansion */
};
@@ -148,5 +152,5 @@ camel_sasl_popb4smtp_class_init (CamelSaslPOPB4SMTPClass *class)
static void
camel_sasl_popb4smtp_init (CamelSaslPOPB4SMTP *sasl)
{
- sasl->priv = G_TYPE_INSTANCE_GET_PRIVATE (sasl, CAMEL_TYPE_SASL_POPB4SMTP, CamelSaslPOPB4SMTPPrivate);
+ sasl->priv = CAMEL_SASL_POPB4SMTP_GET_PRIVATE (sasl);
}
diff --git a/camel/camel-sasl.c b/camel/camel-sasl.c
index d4290fe..a433e2f 100644
--- a/camel/camel-sasl.c
+++ b/camel/camel-sasl.c
@@ -40,6 +40,10 @@
#define w(x)
+#define CAMEL_SASL_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_SASL, CamelSaslPrivate))
+
typedef struct _AsyncContext AsyncContext;
struct _CamelSaslPrivate {
@@ -189,7 +193,7 @@ sasl_dispose (GObject *object)
{
CamelSaslPrivate *priv;
- priv = CAMEL_SASL (object)->priv;
+ priv = CAMEL_SASL_GET_PRIVATE (object);
if (priv->service != NULL) {
g_object_unref (priv->service);
@@ -205,7 +209,7 @@ sasl_finalize (GObject *object)
{
CamelSaslPrivate *priv;
- priv = CAMEL_SASL (object)->priv;
+ priv = CAMEL_SASL_GET_PRIVATE (object);
g_free (priv->mechanism);
g_free (priv->service_name);
@@ -350,7 +354,7 @@ camel_sasl_class_init (CamelSaslClass *class)
static void
camel_sasl_init (CamelSasl *sasl)
{
- sasl->priv = G_TYPE_INSTANCE_GET_PRIVATE (sasl, CAMEL_TYPE_SASL, CamelSaslPrivate);
+ sasl->priv = CAMEL_SASL_GET_PRIVATE (sasl);
}
/**
diff --git a/camel/camel-service.c b/camel/camel-service.c
index 5bb7e7d..fb78026 100644
--- a/camel/camel-service.c
+++ b/camel/camel-service.c
@@ -42,6 +42,10 @@
#define d(x)
#define w(x)
+#define CAMEL_SERVICE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_SERVICE, CamelServicePrivate))
+
struct _CamelServicePrivate {
GStaticRecMutex connect_lock; /* for locking connection operations */
GStaticMutex connect_op_lock; /* for locking the connection_op */
@@ -224,7 +228,7 @@ camel_service_class_init (CamelServiceClass *class)
static void
camel_service_init (CamelService *service)
{
- service->priv = G_TYPE_INSTANCE_GET_PRIVATE (service, CAMEL_TYPE_SERVICE, CamelServicePrivate);
+ service->priv = CAMEL_SERVICE_GET_PRIVATE (service);
g_static_rec_mutex_init (&service->priv->connect_lock);
g_static_mutex_init (&service->priv->connect_op_lock);
diff --git a/camel/camel-session.c b/camel/camel-session.c
index 306ca18..d5b16fb 100644
--- a/camel/camel-session.c
+++ b/camel/camel-session.c
@@ -49,6 +49,10 @@
#define d(x)
+#define CAMEL_SESSION_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_SESSION, CamelSessionPrivate))
+
struct _CamelSessionPrivate {
GMutex *lock; /* for locking everything basically */
GMutex *thread_lock; /* locking threads */
@@ -425,7 +429,8 @@ camel_session_class_init (CamelSessionClass *class)
static void
camel_session_init (CamelSession *session)
{
- session->priv = G_TYPE_INSTANCE_GET_PRIVATE (session, CAMEL_TYPE_SESSION, CamelSessionPrivate);
+ session->priv = CAMEL_SESSION_GET_PRIVATE (session);
+
session->priv->lock = g_mutex_new ();
session->priv->thread_lock = g_mutex_new ();
session->priv->thread_id = 1;
diff --git a/camel/camel-smime-context.c b/camel/camel-smime-context.c
index 47e22fa..0f34fbe 100644
--- a/camel/camel-smime-context.c
+++ b/camel/camel-smime-context.c
@@ -61,6 +61,10 @@
#define d(x)
+#define CAMEL_SMIME_CONTEXT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_SMIME_CONTEXT, CamelSMIMEContextPrivate))
+
struct _CamelSMIMEContextPrivate {
CERTCertDBHandle *certdb;
@@ -1285,7 +1289,8 @@ camel_smime_context_class_init (CamelSMIMEContextClass *class)
static void
camel_smime_context_init (CamelSMIMEContext *smime_context)
{
- smime_context->priv = G_TYPE_INSTANCE_GET_PRIVATE (smime_context, CAMEL_TYPE_SMIME_CONTEXT, CamelSMIMEContextPrivate);
+ smime_context->priv = CAMEL_SMIME_CONTEXT_GET_PRIVATE (smime_context);
+
smime_context->priv->certdb = CERT_GetDefaultCertDB ();
smime_context->priv->sign_mode = CAMEL_SMIME_SIGN_CLEARSIGN;
smime_context->priv->password_tries = 0;
diff --git a/camel/camel-store-summary.c b/camel/camel-store-summary.c
index 2105b89..a7549da 100644
--- a/camel/camel-store-summary.c
+++ b/camel/camel-store-summary.c
@@ -51,6 +51,10 @@
/* current version */
#define CAMEL_STORE_SUMMARY_VERSION (2)
+#define CAMEL_STORE_SUMMARY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_STORE_SUMMARY, CamelStoreSummaryPrivate))
+
struct _CamelStoreSummaryPrivate {
GMutex *summary_lock; /* for the summary hashtable/array */
GMutex *io_lock; /* load/save lock, for access to saved_count, etc */
@@ -316,7 +320,8 @@ camel_store_summary_class_init (CamelStoreSummaryClass *class)
static void
camel_store_summary_init (CamelStoreSummary *summary)
{
- summary->priv = G_TYPE_INSTANCE_GET_PRIVATE (summary, CAMEL_TYPE_STORE_SUMMARY, CamelStoreSummaryPrivate);
+ summary->priv = CAMEL_STORE_SUMMARY_GET_PRIVATE (summary);
+
summary->store_info_size = sizeof (CamelStoreInfo);
summary->store_info_chunks = NULL;
diff --git a/camel/camel-store.c b/camel/camel-store.c
index 07f7b47..c2f26c9 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -44,6 +44,10 @@
#define d(x)
#define w(x)
+#define CAMEL_STORE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_STORE, CamelStorePrivate))
+
typedef struct _AsyncContext AsyncContext;
typedef struct _SignalData SignalData;
@@ -1361,7 +1365,7 @@ camel_store_class_init (CamelStoreClass *class)
static void
camel_store_init (CamelStore *store)
{
- store->priv = G_TYPE_INSTANCE_GET_PRIVATE (store, CAMEL_TYPE_STORE, CamelStorePrivate);
+ store->priv = CAMEL_STORE_GET_PRIVATE (store);
/* set vtrash and vjunk on by default */
store->flags = CAMEL_STORE_VTRASH | CAMEL_STORE_VJUNK;
diff --git a/camel/camel-stream-buffer.c b/camel/camel-stream-buffer.c
index a8cb54c..6881276 100644
--- a/camel/camel-stream-buffer.c
+++ b/camel/camel-stream-buffer.c
@@ -33,6 +33,10 @@
#include "camel-stream-buffer.h"
+#define CAMEL_STREAM_BUFFER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_STREAM_BUFFER, CamelStreamBufferPrivate))
+
struct _CamelStreamBufferPrivate {
CamelStream *stream;
@@ -85,7 +89,7 @@ set_vbuf (CamelStreamBuffer *stream,
{
CamelStreamBufferPrivate *priv;
- priv = CAMEL_STREAM_BUFFER (stream)->priv;
+ priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
if (priv->buf && !(priv->flags & BUF_USER))
g_free (priv->buf);
@@ -109,7 +113,7 @@ stream_buffer_dispose (GObject *object)
{
CamelStreamBufferPrivate *priv;
- priv = CAMEL_STREAM_BUFFER (object)->priv;
+ priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (object);
if (priv->stream != NULL) {
g_object_unref (priv->stream);
@@ -125,7 +129,7 @@ stream_buffer_finalize (GObject *object)
{
CamelStreamBufferPrivate *priv;
- priv = CAMEL_STREAM_BUFFER (object)->priv;
+ priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (object);
if (!(priv->flags & BUF_USER))
g_free (priv->buf);
@@ -149,7 +153,7 @@ stream_buffer_read (CamelStream *stream,
gchar *bptr = buffer;
GError *local_error = NULL;
- priv = CAMEL_STREAM_BUFFER (stream)->priv;
+ priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
g_return_val_if_fail (
(priv->mode & CAMEL_STREAM_BUFFER_MODE) ==
@@ -221,7 +225,7 @@ stream_buffer_write (CamelStream *stream,
gssize total = n;
gssize left, todo;
- priv = CAMEL_STREAM_BUFFER (stream)->priv;
+ priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
g_return_val_if_fail (
(priv->mode & CAMEL_STREAM_BUFFER_MODE) ==
@@ -269,7 +273,7 @@ stream_buffer_flush (CamelStream *stream,
{
CamelStreamBufferPrivate *priv;
- priv = CAMEL_STREAM_BUFFER (stream)->priv;
+ priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
if ((priv->mode & CAMEL_STREAM_BUFFER_MODE) == CAMEL_STREAM_BUFFER_WRITE) {
gsize len = priv->ptr - priv->buf;
@@ -294,7 +298,7 @@ stream_buffer_close (CamelStream *stream,
{
CamelStreamBufferPrivate *priv;
- priv = CAMEL_STREAM_BUFFER (stream)->priv;
+ priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
if (stream_buffer_flush (stream, cancellable, error) == -1)
return -1;
@@ -307,7 +311,7 @@ stream_buffer_eos (CamelStream *stream)
{
CamelStreamBufferPrivate *priv;
- priv = CAMEL_STREAM_BUFFER (stream)->priv;
+ priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
return camel_stream_eos (priv->stream) && priv->ptr == priv->end;
}
@@ -321,7 +325,7 @@ stream_buffer_init_vbuf (CamelStreamBuffer *stream,
{
CamelStreamBufferPrivate *priv;
- priv = CAMEL_STREAM_BUFFER (stream)->priv;
+ priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
set_vbuf (stream, buf, mode, size);
@@ -365,7 +369,8 @@ camel_stream_buffer_class_init (CamelStreamBufferClass *class)
static void
camel_stream_buffer_init (CamelStreamBuffer *stream)
{
- stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream, CAMEL_TYPE_STREAM_BUFFER, CamelStreamBufferPrivate);
+ stream->priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
+
stream->priv->flags = 0;
stream->priv->size = BUF_SIZE;
stream->priv->buf = g_malloc (BUF_SIZE);
diff --git a/camel/camel-stream-filter.c b/camel/camel-stream-filter.c
index e29694f..0a67e8d 100644
--- a/camel/camel-stream-filter.c
+++ b/camel/camel-stream-filter.c
@@ -35,6 +35,10 @@
/*extern void g_check(gpointer mp);*/
#define g_check(x)
+#define CAMEL_STREAM_FILTER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_STREAM_FILTER, CamelStreamFilterPrivate))
+
struct _filter {
struct _filter *next;
gint id;
@@ -95,7 +99,7 @@ stream_filter_read (CamelStream *stream,
gssize size;
struct _filter *f;
- priv = CAMEL_STREAM_FILTER (stream)->priv;
+ priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
priv->last_was_read = TRUE;
@@ -174,7 +178,7 @@ stream_filter_write (CamelStream *stream,
gsize presize, len, left = n;
gchar *buffer, realbuffer[READ_SIZE+READ_PAD];
- priv = CAMEL_STREAM_FILTER (stream)->priv;
+ priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
priv->last_was_read = FALSE;
@@ -226,7 +230,7 @@ stream_filter_flush (CamelStream *stream,
gsize presize;
gsize len;
- priv = CAMEL_STREAM_FILTER (stream)->priv;
+ priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
if (priv->last_was_read)
return 0;
@@ -263,7 +267,7 @@ stream_filter_close (CamelStream *stream,
{
CamelStreamFilterPrivate *priv;
- priv = CAMEL_STREAM_FILTER (stream)->priv;
+ priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
/* Ignore errors while flushing. */
if (!priv->last_was_read)
@@ -277,7 +281,7 @@ stream_filter_eos (CamelStream *stream)
{
CamelStreamFilterPrivate *priv;
- priv = CAMEL_STREAM_FILTER (stream)->priv;
+ priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
if (priv->filteredlen > 0)
return FALSE;
@@ -295,7 +299,7 @@ stream_filter_reset (CamelStream *stream,
CamelStreamFilterPrivate *priv;
struct _filter *f;
- priv = CAMEL_STREAM_FILTER (stream)->priv;
+ priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
priv->filteredlen = 0;
priv->flushed = FALSE;
@@ -333,7 +337,8 @@ camel_stream_filter_class_init (CamelStreamFilterClass *class)
static void
camel_stream_filter_init (CamelStreamFilter *stream)
{
- stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream, CAMEL_TYPE_STREAM_FILTER, CamelStreamFilterPrivate);
+ stream->priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
+
stream->priv->realbuffer = g_malloc (READ_SIZE + READ_PAD);
stream->priv->buffer = stream->priv->realbuffer + READ_PAD;
stream->priv->last_was_read = TRUE;
@@ -358,7 +363,7 @@ camel_stream_filter_new (CamelStream *source)
g_return_val_if_fail (CAMEL_IS_STREAM (source), NULL);
stream = g_object_new (CAMEL_TYPE_STREAM_FILTER, NULL);
- priv = CAMEL_STREAM_FILTER (stream)->priv;
+ priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
priv->source = g_object_ref (source);
@@ -402,7 +407,7 @@ camel_stream_filter_add (CamelStreamFilter *stream,
g_return_val_if_fail (CAMEL_IS_STREAM_FILTER (stream), -1);
g_return_val_if_fail (CAMEL_IS_MIME_FILTER (filter), -1);
- priv = stream->priv;
+ priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
fn = g_malloc (sizeof (*fn));
fn->id = priv->filterid++;
@@ -433,7 +438,7 @@ camel_stream_filter_remove (CamelStreamFilter *stream,
g_return_if_fail (CAMEL_IS_STREAM_FILTER (stream));
- priv = stream->priv;
+ priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
f = (struct _filter *)&priv->filters;
while (f && f->next) {
diff --git a/camel/camel-stream-fs.c b/camel/camel-stream-fs.c
index 54af8f6..146eac8 100644
--- a/camel/camel-stream-fs.c
+++ b/camel/camel-stream-fs.c
@@ -39,6 +39,10 @@
#include "camel-stream-fs.h"
#include "camel-win32.h"
+#define CAMEL_STREAM_FS_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_STREAM_FS, CamelStreamFsPrivate))
+
struct _CamelStreamFsPrivate {
gint fd; /* file descriptor on the underlying file */
};
@@ -55,7 +59,7 @@ stream_fs_finalize (GObject *object)
{
CamelStreamFsPrivate *priv;
- priv = CAMEL_STREAM_FS (object)->priv;
+ priv = CAMEL_STREAM_FS_GET_PRIVATE (object);
if (priv->fd != -1)
close (priv->fd);
@@ -74,7 +78,7 @@ stream_fs_read (CamelStream *stream,
CamelStreamFsPrivate *priv;
gssize nread;
- priv = CAMEL_STREAM_FS (stream)->priv;
+ priv = CAMEL_STREAM_FS_GET_PRIVATE (stream);
nread = camel_read (priv->fd, buffer, n, cancellable, error);
@@ -93,7 +97,7 @@ stream_fs_write (CamelStream *stream,
{
CamelStreamFsPrivate *priv;
- priv = CAMEL_STREAM_FS (stream)->priv;
+ priv = CAMEL_STREAM_FS_GET_PRIVATE (stream);
return camel_write (priv->fd, buffer, n, cancellable, error);
}
@@ -105,7 +109,7 @@ stream_fs_flush (CamelStream *stream,
{
CamelStreamFsPrivate *priv;
- priv = CAMEL_STREAM_FS (stream)->priv;
+ priv = CAMEL_STREAM_FS_GET_PRIVATE (stream);
if (g_cancellable_set_error_if_cancelled (cancellable, error))
return -1;
@@ -128,7 +132,7 @@ stream_fs_close (CamelStream *stream,
{
CamelStreamFsPrivate *priv;
- priv = CAMEL_STREAM_FS (stream)->priv;
+ priv = CAMEL_STREAM_FS_GET_PRIVATE (stream);
if (g_cancellable_set_error_if_cancelled (cancellable, error))
return -1;
@@ -151,7 +155,7 @@ stream_fs_tell (GSeekable *seekable)
{
CamelStreamFsPrivate *priv;
- priv = CAMEL_STREAM_FS (seekable)->priv;
+ priv = CAMEL_STREAM_FS_GET_PRIVATE (seekable);
return (goffset) lseek (priv->fd, 0, SEEK_CUR);
}
@@ -172,7 +176,7 @@ stream_fs_seek (GSeekable *seekable,
CamelStreamFsPrivate *priv;
goffset real = 0;
- priv = CAMEL_STREAM_FS (seekable)->priv;
+ priv = CAMEL_STREAM_FS_GET_PRIVATE (seekable);
switch (type) {
case G_SEEK_SET:
@@ -258,7 +262,7 @@ camel_stream_fs_seekable_init (GSeekableIface *interface)
static void
camel_stream_fs_init (CamelStreamFs *stream)
{
- stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream, CAMEL_TYPE_STREAM_FS, CamelStreamFsPrivate);
+ stream->priv = CAMEL_STREAM_FS_GET_PRIVATE (stream);
stream->priv->fd = -1;
}
@@ -282,7 +286,7 @@ camel_stream_fs_new_with_fd (gint fd)
return NULL;
stream = g_object_new (CAMEL_TYPE_STREAM_FS, NULL);
- priv = CAMEL_STREAM_FS (stream)->priv;
+ priv = CAMEL_STREAM_FS_GET_PRIVATE (stream);
priv->fd = fd;
diff --git a/camel/camel-stream-mem.c b/camel/camel-stream-mem.c
index e3ed3ed..fbd5324 100644
--- a/camel/camel-stream-mem.c
+++ b/camel/camel-stream-mem.c
@@ -34,6 +34,10 @@
#include "camel-stream-mem.h"
+#define CAMEL_STREAM_MEM_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_STREAM_MEM, CamelStreamMemPrivate))
+
struct _CamelStreamMemPrivate {
guint owner : 1; /* do we own the buffer? */
guint secure : 1; /* do we clear the buffer on finalize?
@@ -73,7 +77,7 @@ stream_mem_finalize (GObject *object)
{
CamelStreamMemPrivate *priv;
- priv = CAMEL_STREAM_MEM (object)->priv;
+ priv = CAMEL_STREAM_MEM_GET_PRIVATE (object);
if (priv->buffer && priv->owner) {
/* TODO: we need our own bytearray type since we don't know
@@ -97,7 +101,7 @@ stream_mem_read (CamelStream *stream,
CamelStreamMemPrivate *priv;
gssize nread;
- priv = CAMEL_STREAM_MEM (stream)->priv;
+ priv = CAMEL_STREAM_MEM_GET_PRIVATE (stream);
nread = MIN (n, priv->buffer->len - priv->position);
if (nread > 0) {
@@ -119,7 +123,7 @@ stream_mem_write (CamelStream *stream,
CamelStreamMemPrivate *priv;
gssize nwrite = n;
- priv = CAMEL_STREAM_MEM (stream)->priv;
+ priv = CAMEL_STREAM_MEM_GET_PRIVATE (stream);
/* FIXME: we shouldn't use g_byte_arrays or g_malloc perhaps? */
if (priv->position == priv->buffer->len) {
@@ -138,7 +142,7 @@ stream_mem_eos (CamelStream *stream)
{
CamelStreamMemPrivate *priv;
- priv = CAMEL_STREAM_MEM (stream)->priv;
+ priv = CAMEL_STREAM_MEM_GET_PRIVATE (stream);
return priv->buffer->len <= priv->position;
}
@@ -148,7 +152,7 @@ stream_mem_tell (GSeekable *seekable)
{
CamelStreamMemPrivate *priv;
- priv = CAMEL_STREAM_MEM (seekable)->priv;
+ priv = CAMEL_STREAM_MEM_GET_PRIVATE (seekable);
return priv->position;
}
@@ -169,7 +173,7 @@ stream_mem_seek (GSeekable *seekable,
CamelStreamMemPrivate *priv;
goffset position;
- priv = CAMEL_STREAM_MEM (seekable)->priv;
+ priv = CAMEL_STREAM_MEM_GET_PRIVATE (seekable);
switch (type) {
case G_SEEK_SET:
@@ -250,7 +254,7 @@ camel_stream_mem_seekable_init (GSeekableIface *interface)
static void
camel_stream_mem_init (CamelStreamMem *stream)
{
- stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream, CAMEL_TYPE_STREAM_MEM, CamelStreamMemPrivate);
+ stream->priv = CAMEL_STREAM_MEM_GET_PRIVATE (stream);
}
/**
@@ -313,7 +317,7 @@ camel_stream_mem_new_with_byte_array (GByteArray *buffer)
g_return_val_if_fail (buffer != NULL, NULL);
stream = g_object_new (CAMEL_TYPE_STREAM_MEM, NULL);
- priv = CAMEL_STREAM_MEM (stream)->priv;
+ priv = CAMEL_STREAM_MEM_GET_PRIVATE (stream);
priv->buffer = buffer;
priv->owner = TRUE;
diff --git a/camel/camel-tcp-stream-raw.c b/camel/camel-tcp-stream-raw.c
index 4074519..ab1407e 100644
--- a/camel/camel-tcp-stream-raw.c
+++ b/camel/camel-tcp-stream-raw.c
@@ -1281,6 +1281,10 @@ _camel_tcp_stream_raw_replace_file_desc (CamelTcpStreamRaw *raw, PRFileDesc *new
priv->sockfd = new_file_desc;
}
+#define CAMEL_TCP_STREAM_RAW_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_TCP_STREAM_RAW, CamelTcpStreamRawPrivate))
+
static void
camel_tcp_stream_raw_class_init (CamelTcpStreamRawClass *class)
{
@@ -1313,7 +1317,7 @@ camel_tcp_stream_raw_init (CamelTcpStreamRaw *stream)
{
CamelTcpStreamRawPrivate *priv;
- stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream, CAMEL_TYPE_TCP_STREAM_RAW, CamelTcpStreamRawPrivate);
+ stream->priv = CAMEL_TCP_STREAM_RAW_GET_PRIVATE (stream);
priv = stream->priv;
priv->sockfd = NULL;
diff --git a/camel/camel-tcp-stream-ssl.c b/camel/camel-tcp-stream-ssl.c
index 0411d19..58c3b8d 100644
--- a/camel/camel-tcp-stream-ssl.c
+++ b/camel/camel-tcp-stream-ssl.c
@@ -70,6 +70,10 @@
#define IO_TIMEOUT (PR_TicksPerSecond() * 4 * 60)
#define CONNECT_TIMEOUT (PR_TicksPerSecond () * 4 * 60)
+#define CAMEL_TCP_STREAM_SSL_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_TCP_STREAM_SSL, CamelTcpStreamSSLPrivate))
+
struct _CamelTcpStreamSSLPrivate {
CamelSession *session;
gchar *expected_host;
@@ -84,7 +88,7 @@ tcp_stream_ssl_dispose (GObject *object)
{
CamelTcpStreamSSLPrivate *priv;
- priv = CAMEL_TCP_STREAM_SSL (object)->priv;
+ priv = CAMEL_TCP_STREAM_SSL_GET_PRIVATE (object);
if (priv->session != NULL) {
g_object_unref (priv->session);
@@ -100,7 +104,7 @@ tcp_stream_ssl_finalize (GObject *object)
{
CamelTcpStreamSSLPrivate *priv;
- priv = CAMEL_TCP_STREAM_SSL (object)->priv;
+ priv = CAMEL_TCP_STREAM_SSL_GET_PRIVATE (object);
g_free (priv->expected_host);
@@ -762,7 +766,7 @@ camel_tcp_stream_ssl_class_init (CamelTcpStreamSSLClass *class)
static void
camel_tcp_stream_ssl_init (CamelTcpStreamSSL *stream)
{
- stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream, CAMEL_TYPE_TCP_STREAM_SSL, CamelTcpStreamSSLPrivate);
+ stream->priv = CAMEL_TCP_STREAM_SSL_GET_PRIVATE (stream);
}
/**
diff --git a/camel/camel-tcp-stream.c b/camel/camel-tcp-stream.c
index ee40a8e..682418f 100644
--- a/camel/camel-tcp-stream.c
+++ b/camel/camel-tcp-stream.c
@@ -36,6 +36,10 @@
#define w(x)
+#define CAMEL_TCP_STREAM_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_TCP_STREAM, CamelTcpStreamPrivate))
+
struct _CamelTcpStreamPrivate {
gchar *socks_host;
gint socks_port;
@@ -67,7 +71,7 @@ camel_tcp_stream_class_init (CamelTcpStreamClass *class)
static void
camel_tcp_stream_init (CamelTcpStream *tcp_stream)
{
- tcp_stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (tcp_stream, CAMEL_TYPE_TCP_STREAM, CamelTcpStreamPrivate);
+ tcp_stream->priv = CAMEL_TCP_STREAM_GET_PRIVATE (tcp_stream);
}
/**
diff --git a/camel/camel-text-index.c b/camel/camel-text-index.c
index 7d5f96e..61aa5bd 100644
--- a/camel/camel-text-index.c
+++ b/camel/camel-text-index.c
@@ -60,6 +60,10 @@ static gint text_index_compress_nosync (CamelIndex *idx);
/* ********************************************************************** */
+#define CAMEL_TEXT_INDEX_NAME_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_TEXT_INDEX_NAME, CamelTextIndexNamePrivate))
+
struct _CamelTextIndexNamePrivate {
GString *buffer;
camel_key_t nameid;
@@ -70,6 +74,10 @@ CamelTextIndexName *camel_text_index_name_new (CamelTextIndex *idx, const gchar
/* ****************************** */
+#define CAMEL_TEXT_INDEX_CURSOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_TEXT_INDEX_CURSOR, CamelTextIndexCursorPrivate))
+
struct _CamelTextIndexCursorPrivate {
camel_block_t first;
camel_block_t next;
@@ -86,6 +94,10 @@ CamelTextIndexCursor *camel_text_index_cursor_new (CamelTextIndex *idx, camel_bl
/* ****************************** */
+#define CAMEL_TEXT_INDEX_KEY_CURSOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_TEXT_INDEX_KEY_CURSOR, CamelTextIndexKeyCursorPrivate))
+
struct _CamelTextIndexKeyCursorPrivate {
CamelKeyTable *table;
@@ -102,6 +114,10 @@ CamelTextIndexKeyCursor *camel_text_index_key_cursor_new (CamelTextIndex *idx, C
#define CAMEL_TEXT_INDEX_VERSION "TEXT.000"
#define CAMEL_TEXT_INDEX_KEY_VERSION "KEYS.000"
+#define CAMEL_TEXT_INDEX_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_TEXT_INDEX, CamelTextIndexPrivate))
+
struct _CamelTextIndexPrivate {
CamelBlockFile *blocks;
CamelKeyFile *links;
@@ -159,7 +175,7 @@ text_index_dispose (GObject *object)
{
CamelTextIndexPrivate *priv;
- priv = CAMEL_TEXT_INDEX (object)->priv;
+ priv = CAMEL_TEXT_INDEX_GET_PRIVATE (object);
/* Only run this the first time. */
if (priv->word_index != NULL)
@@ -204,7 +220,7 @@ text_index_finalize (GObject *object)
{
CamelTextIndexPrivate *priv;
- priv = CAMEL_TEXT_INDEX (object)->priv;
+ priv = CAMEL_TEXT_INDEX_GET_PRIVATE (object);
g_assert (camel_dlist_empty (&priv->word_cache));
g_assert (g_hash_table_size (priv->words) == 0);
@@ -224,7 +240,7 @@ text_index_add_name_to_word (CamelIndex *idx,
camel_key_t nameid)
{
struct _CamelTextIndexWord *w, *wp, *ww;
- CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
+ CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
camel_key_t wordid;
camel_block_t data;
struct _CamelTextIndexRoot *rb = (struct _CamelTextIndexRoot *)p->blocks->root;
@@ -309,7 +325,7 @@ text_index_add_name_to_word (CamelIndex *idx,
static gint
text_index_sync (CamelIndex *idx)
{
- CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
+ CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
struct _CamelTextIndexWord *ww;
struct _CamelTextIndexRoot *rb;
gint ret = 0, wfrag, nfrag;
@@ -442,8 +458,8 @@ text_index_compress_nosync (CamelIndex *idx)
if (newidx == NULL)
return -1;
- newp = CAMEL_TEXT_INDEX (newidx)->priv;
- oldp = CAMEL_TEXT_INDEX (idx)->priv;
+ newp = CAMEL_TEXT_INDEX_GET_PRIVATE (newidx);
+ oldp = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
CAMEL_TEXT_INDEX_LOCK (idx, lock);
@@ -584,7 +600,7 @@ fail:
static gint
text_index_delete (CamelIndex *idx)
{
- CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
+ CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
gint ret = 0;
if (camel_block_file_delete (p->blocks) == -1)
@@ -598,7 +614,7 @@ text_index_delete (CamelIndex *idx)
static gint
text_index_rename (CamelIndex *idx, const gchar *path)
{
- CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
+ CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
gchar *newlink, *newblock;
gint err, ret;
@@ -634,7 +650,7 @@ text_index_rename (CamelIndex *idx, const gchar *path)
static gint
text_index_has_name (CamelIndex *idx, const gchar *name)
{
- CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
+ CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
return camel_partition_table_lookup (p->name_hash, name) != 0;
}
@@ -642,7 +658,7 @@ text_index_has_name (CamelIndex *idx, const gchar *name)
static CamelIndexName *
text_index_add_name (CamelIndex *idx, const gchar *name)
{
- CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
+ CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
camel_key_t keyid;
CamelIndexName *idn;
struct _CamelTextIndexRoot *rb = (struct _CamelTextIndexRoot *)p->blocks->root;
@@ -720,7 +736,7 @@ text_index_find_name (CamelIndex *idx, const gchar *name)
static void
text_index_delete_name (CamelIndex *idx, const gchar *name)
{
- CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
+ CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
camel_key_t keyid;
struct _CamelTextIndexRoot *rb = (struct _CamelTextIndexRoot *)p->blocks->root;
@@ -744,7 +760,7 @@ text_index_delete_name (CamelIndex *idx, const gchar *name)
static CamelIndexCursor *
text_index_find (CamelIndex *idx, const gchar *word)
{
- CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
+ CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
camel_key_t keyid;
camel_block_t data = 0;
guint flags;
@@ -770,7 +786,7 @@ text_index_find (CamelIndex *idx, const gchar *word)
static CamelIndexCursor *
text_index_words (CamelIndex *idx)
{
- CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
+ CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
return (CamelIndexCursor *)camel_text_index_key_cursor_new ((CamelTextIndex *)idx, p->word_index);
}
@@ -778,7 +794,7 @@ text_index_words (CamelIndex *idx)
static CamelIndexCursor *
text_index_names (CamelIndex *idx)
{
- CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
+ CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
return (CamelIndexCursor *)camel_text_index_key_cursor_new ((CamelTextIndex *)idx, p->name_index);
}
@@ -813,7 +829,7 @@ camel_text_index_class_init (CamelTextIndexClass *class)
static void
camel_text_index_init (CamelTextIndex *text_index)
{
- text_index->priv = G_TYPE_INSTANCE_GET_PRIVATE (text_index, CAMEL_TYPE_TEXT_INDEX, CamelTextIndexPrivate);
+ text_index->priv = CAMEL_TEXT_INDEX_GET_PRIVATE (text_index);
camel_dlist_init (&text_index->priv->word_cache);
text_index->priv->words = g_hash_table_new (g_str_hash, g_str_equal);
@@ -843,7 +859,7 @@ CamelTextIndex *
camel_text_index_new (const gchar *path, gint flags)
{
CamelTextIndex *idx = g_object_new (CAMEL_TYPE_TEXT_INDEX, NULL);
- CamelTextIndexPrivate *p = idx->priv;
+ CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
struct _CamelTextIndexRoot *rb;
gchar *link;
CamelBlock *bl;
@@ -1016,7 +1032,7 @@ camel_text_index_remove (const gchar *old)
void
camel_text_index_info (CamelTextIndex *idx)
{
- CamelTextIndexPrivate *p = idx->priv;
+ CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
struct _CamelTextIndexRoot *rb = (struct _CamelTextIndexRoot *)p->blocks->root;
gint frag;
@@ -1215,7 +1231,7 @@ dump_raw (GHashTable *map, gchar *path)
void
camel_text_index_dump (CamelTextIndex *idx)
{
- CamelTextIndexPrivate *p = idx->priv;
+ CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
#ifndef DUMP_RAW
camel_key_t keyid;
gchar *word;
@@ -1274,7 +1290,7 @@ camel_text_index_dump (CamelTextIndex *idx)
void
camel_text_index_validate (CamelTextIndex *idx)
{
- CamelTextIndexPrivate *p = idx->priv;
+ CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
camel_key_t keyid;
gchar *word;
const gchar *name;
@@ -1405,7 +1421,7 @@ text_index_name_finalize (GObject *object)
{
CamelTextIndexNamePrivate *priv;
- priv = CAMEL_TEXT_INDEX_NAME (object)->priv;
+ priv = CAMEL_TEXT_INDEX_NAME_GET_PRIVATE (object);
g_hash_table_destroy (CAMEL_TEXT_INDEX_NAME (object)->parent.words);
@@ -1495,7 +1511,7 @@ camel_utf8_next (const guchar **ptr, const guchar *ptrend)
static gsize
text_index_name_add_buffer (CamelIndexName *idn, const gchar *buffer, gsize len)
{
- CamelTextIndexNamePrivate *p = CAMEL_TEXT_INDEX_NAME (idn)->priv;
+ CamelTextIndexNamePrivate *p = CAMEL_TEXT_INDEX_NAME_GET_PRIVATE (idn);
const guchar *ptr, *ptrend;
guint32 c;
gchar utf8[8];
@@ -1549,7 +1565,8 @@ camel_text_index_name_class_init (CamelTextIndexNameClass *class)
static void
camel_text_index_name_init (CamelTextIndexName *text_index_name)
{
- text_index_name->priv = G_TYPE_INSTANCE_GET_PRIVATE (text_index_name, CAMEL_TYPE_TEXT_INDEX_NAME, CamelTextIndexNamePrivate);
+ text_index_name->priv =
+ CAMEL_TEXT_INDEX_NAME_GET_PRIVATE (text_index_name);
text_index_name->parent.words = g_hash_table_new (
g_str_hash, g_str_equal);
@@ -1564,7 +1581,7 @@ camel_text_index_name_new (CamelTextIndex *idx, const gchar *name, camel_key_t n
{
CamelTextIndexName *idn = g_object_new (CAMEL_TYPE_TEXT_INDEX_NAME, NULL);
CamelIndexName *cin = &idn->parent;
- CamelTextIndexNamePrivate *p = idn->priv;
+ CamelTextIndexNamePrivate *p = CAMEL_TEXT_INDEX_NAME_GET_PRIVATE (idn);
cin->index = g_object_ref (idx);
cin->name = camel_mempool_strdup (p->pool, name);
@@ -1584,7 +1601,7 @@ text_index_cursor_finalize (GObject *object)
{
CamelTextIndexCursorPrivate *priv;
- priv = CAMEL_TEXT_INDEX_CURSOR (object)->priv;
+ priv = CAMEL_TEXT_INDEX_CURSOR_GET_PRIVATE (object);
g_free (priv->records);
g_free (priv->current);
@@ -1596,8 +1613,8 @@ text_index_cursor_finalize (GObject *object)
static const gchar *
text_index_cursor_next (CamelIndexCursor *idc)
{
- CamelTextIndexCursorPrivate *p = CAMEL_TEXT_INDEX_CURSOR (idc)->priv;
- CamelTextIndexPrivate *tip = CAMEL_TEXT_INDEX (idc->index)->priv;
+ CamelTextIndexCursorPrivate *p = CAMEL_TEXT_INDEX_CURSOR_GET_PRIVATE (idc);
+ CamelTextIndexPrivate *tip = CAMEL_TEXT_INDEX_GET_PRIVATE (idc->index);
guint flags;
c (printf ("Going to next cursor for word with data '%08x' next %08x\n", p->first, p->next));
@@ -1631,7 +1648,7 @@ text_index_cursor_next (CamelIndexCursor *idc)
static void
text_index_cursor_reset (CamelIndexCursor *idc)
{
- CamelTextIndexCursorPrivate *p = CAMEL_TEXT_INDEX_CURSOR (idc)->priv;
+ CamelTextIndexCursorPrivate *p = CAMEL_TEXT_INDEX_CURSOR_GET_PRIVATE (idc);
g_free (p->records);
p->records = NULL;
@@ -1661,7 +1678,8 @@ camel_text_index_cursor_class_init (CamelTextIndexCursorClass *class)
static void
camel_text_index_cursor_init (CamelTextIndexCursor *text_index_cursor)
{
- text_index_cursor->priv = G_TYPE_INSTANCE_GET_PRIVATE (text_index_cursor, CAMEL_TYPE_TEXT_INDEX_CURSOR, CamelTextIndexCursorPrivate);
+ text_index_cursor->priv =
+ CAMEL_TEXT_INDEX_CURSOR_GET_PRIVATE (text_index_cursor);
}
CamelTextIndexCursor *
@@ -1669,7 +1687,7 @@ camel_text_index_cursor_new (CamelTextIndex *idx, camel_block_t data)
{
CamelTextIndexCursor *idc = g_object_new (CAMEL_TYPE_TEXT_INDEX_CURSOR, NULL);
CamelIndexCursor *cic = &idc->parent;
- CamelTextIndexCursorPrivate *p = idc->priv;
+ CamelTextIndexCursorPrivate *p = CAMEL_TEXT_INDEX_CURSOR_GET_PRIVATE (idc);
cic->index = g_object_ref (idx);
p->first = data;
@@ -1691,7 +1709,7 @@ text_index_key_cursor_dispose (GObject *object)
{
CamelTextIndexKeyCursorPrivate *priv;
- priv = CAMEL_TEXT_INDEX_KEY_CURSOR (object)->priv;
+ priv = CAMEL_TEXT_INDEX_KEY_CURSOR_GET_PRIVATE (object);
if (priv->table != NULL) {
g_object_unref (priv->table);
@@ -1707,7 +1725,7 @@ text_index_key_cursor_finalize (GObject *object)
{
CamelTextIndexKeyCursorPrivate *priv;
- priv = CAMEL_TEXT_INDEX_KEY_CURSOR (object)->priv;
+ priv = CAMEL_TEXT_INDEX_KEY_CURSOR_GET_PRIVATE (object);
g_free (priv->current);
@@ -1718,7 +1736,7 @@ text_index_key_cursor_finalize (GObject *object)
static const gchar *
text_index_key_cursor_next (CamelIndexCursor *idc)
{
- CamelTextIndexKeyCursorPrivate *p = CAMEL_TEXT_INDEX_KEY_CURSOR (idc)->priv;
+ CamelTextIndexKeyCursorPrivate *p = CAMEL_TEXT_INDEX_KEY_CURSOR_GET_PRIVATE (idc);
c (printf ("Going to next cursor for keyid %08x\n", p->keyid));
@@ -1740,7 +1758,7 @@ text_index_key_cursor_next (CamelIndexCursor *idc)
static void
text_index_key_cursor_reset (CamelIndexCursor *idc)
{
- CamelTextIndexKeyCursorPrivate *p = CAMEL_TEXT_INDEX_KEY_CURSOR (idc)->priv;
+ CamelTextIndexKeyCursorPrivate *p = CAMEL_TEXT_INDEX_KEY_CURSOR_GET_PRIVATE (idc);
p->keyid = 0;
p->flags = 0;
@@ -1769,7 +1787,9 @@ camel_text_index_key_cursor_class_init (CamelTextIndexKeyCursorClass *class)
static void
camel_text_index_key_cursor_init (CamelTextIndexKeyCursor *text_index_key_cursor)
{
- text_index_key_cursor->priv = G_TYPE_INSTANCE_GET_PRIVATE (text_index_key_cursor, CAMEL_TYPE_TEXT_INDEX_KEY_CURSOR, CamelTextIndexKeyCursorPrivate);
+ text_index_key_cursor->priv =
+ CAMEL_TEXT_INDEX_KEY_CURSOR_GET_PRIVATE (text_index_key_cursor);
+
text_index_key_cursor->priv->keyid = 0;
text_index_key_cursor->priv->flags = 0;
text_index_key_cursor->priv->data = 0;
@@ -1781,7 +1801,7 @@ camel_text_index_key_cursor_new (CamelTextIndex *idx, CamelKeyTable *table)
{
CamelTextIndexKeyCursor *idc = g_object_new (CAMEL_TYPE_TEXT_INDEX_KEY_CURSOR, NULL);
CamelIndexCursor *cic = &idc->parent;
- CamelTextIndexKeyCursorPrivate *p = idc->priv;
+ CamelTextIndexKeyCursorPrivate *p = CAMEL_TEXT_INDEX_KEY_CURSOR_GET_PRIVATE (idc);
cic->index = g_object_ref (idx);
p->table = g_object_ref (table);
diff --git a/camel/camel-transport.c b/camel/camel-transport.c
index 97e0970..aa31fc4 100644
--- a/camel/camel-transport.c
+++ b/camel/camel-transport.c
@@ -32,6 +32,10 @@
#include "camel-mime-message.h"
#include "camel-transport.h"
+#define CAMEL_TRANSPORT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_TRANSPORT, CamelTransportPrivate))
+
typedef struct _AsyncContext AsyncContext;
struct _CamelTransportPrivate {
@@ -67,7 +71,7 @@ transport_finalize (GObject *object)
{
CamelTransportPrivate *priv;
- priv = CAMEL_TRANSPORT (object)->priv;
+ priv = CAMEL_TRANSPORT_GET_PRIVATE (object);
g_mutex_free (priv->send_lock);
@@ -160,7 +164,7 @@ camel_transport_class_init (CamelTransportClass *class)
static void
camel_transport_init (CamelTransport *transport)
{
- transport->priv = G_TYPE_INSTANCE_GET_PRIVATE (transport, CAMEL_TYPE_TRANSPORT, CamelTransportPrivate);
+ transport->priv = CAMEL_TRANSPORT_GET_PRIVATE (transport);
transport->priv->send_lock = g_mutex_new ();
}
diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c
index 7257988..21ff8ca 100644
--- a/camel/camel-vee-folder.c
+++ b/camel/camel-vee-folder.c
@@ -44,6 +44,10 @@
#define d(x)
#define dd(x) (camel_debug ("vfolder")?(x):0)
+#define CAMEL_VEE_FOLDER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_VEE_FOLDER, CamelVeeFolderPrivate))
+
struct _CamelVeeFolderPrivate {
gboolean destroyed;
GList *folders; /* lock using subfolder_lock before changing/accessing */
@@ -332,7 +336,7 @@ folder_changed_change (CamelSession *session, CamelSessionThreadMsg *msg)
/* Check the folder hasn't beem removed while we weren't watching */
camel_vee_folder_lock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
- if (g_list_find (vf->priv->folders, sub) == NULL) {
+ if (g_list_find (CAMEL_VEE_FOLDER_GET_PRIVATE (vf)->folders, sub) == NULL) {
camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
return;
}
@@ -752,7 +756,7 @@ count_result (CamelFolderSummary *summary,
guint32 count=0;
gchar *expr = g_strdup_printf ("(and %s %s)", vf->expression ? vf->expression : "", query);
GList *node;
- CamelVeeFolderPrivate *p = vf->priv;
+ CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vf);
node = p->folders;
while (node) {
@@ -852,7 +856,7 @@ vee_folder_stop_folder (CamelVeeFolder *vf,
CamelFolder *sub,
GCancellable *cancellable)
{
- CamelVeeFolderPrivate *p = vf->priv;
+ CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vf);
gint i;
CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
@@ -882,7 +886,7 @@ vee_folder_stop_folder (CamelVeeFolder *vf,
camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
if (folder_unmatched != NULL) {
- CamelVeeFolderPrivate *up = folder_unmatched->priv;
+ CamelVeeFolderPrivate *up = CAMEL_VEE_FOLDER_GET_PRIVATE (folder_unmatched);
camel_vee_folder_lock (folder_unmatched, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
/* if folder deleted, then blow it away from unmatched always, and remove all refs to it */
@@ -1002,7 +1006,7 @@ vee_folder_search_by_expression (CamelFolder *folder,
GPtrArray *matches, *result = g_ptr_array_new ();
gchar *expr;
CamelVeeFolder *vf = (CamelVeeFolder *)folder;
- CamelVeeFolderPrivate *p = vf->priv;
+ CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vf);
GHashTable *searched = g_hash_table_new (NULL, NULL);
CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
gboolean is_folder_unmatched = vf == folder_unmatched && folder_unmatched;
@@ -1064,7 +1068,7 @@ vee_folder_search_by_uids (CamelFolder *folder,
GPtrArray *folder_uids = g_ptr_array_new ();
gchar *expr;
CamelVeeFolder *vf = (CamelVeeFolder *)folder;
- CamelVeeFolderPrivate *p = vf->priv;
+ CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vf);
GHashTable *searched = g_hash_table_new (NULL, NULL);
camel_vee_folder_lock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
@@ -1126,7 +1130,7 @@ vee_folder_count_by_expression (CamelFolder *folder,
gchar *expr;
guint32 count = 0;
CamelVeeFolder *vf = (CamelVeeFolder *)folder;
- CamelVeeFolderPrivate *p = vf->priv;
+ CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vf);
GHashTable *searched = g_hash_table_new (NULL, NULL);
CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
@@ -1156,7 +1160,7 @@ vee_folder_count_by_expression (CamelFolder *folder,
static void
vee_folder_delete (CamelFolder *folder)
{
- CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER (folder)->priv;
+ CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (folder);
/* NB: this is never called on UNMTACHED */
@@ -1181,7 +1185,7 @@ static void
vee_folder_freeze (CamelFolder *folder)
{
CamelVeeFolder *vfolder = (CamelVeeFolder *)folder;
- CamelVeeFolderPrivate *p = vfolder->priv;
+ CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vfolder);
GList *node;
camel_vee_folder_lock (vfolder, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
@@ -1204,7 +1208,7 @@ static void
vee_folder_thaw (CamelFolder *folder)
{
CamelVeeFolder *vfolder = (CamelVeeFolder *)folder;
- CamelVeeFolderPrivate *p = vfolder->priv;
+ CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vfolder);
GList *node;
camel_vee_folder_lock (vfolder, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
@@ -1282,7 +1286,7 @@ vee_folder_refresh_info_sync (CamelFolder *folder,
GError **error)
{
CamelVeeFolder *vf = (CamelVeeFolder *)folder;
- CamelVeeFolderPrivate *p = vf->priv;
+ CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vf);
GList *node, *list;
gboolean success = TRUE;
@@ -1315,7 +1319,7 @@ vee_folder_synchronize_sync (CamelFolder *folder,
GError **error)
{
CamelVeeFolder *vf = (CamelVeeFolder *)folder;
- CamelVeeFolderPrivate *p = vf->priv;
+ CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vf);
GList *node;
if (((CamelVeeSummary *)folder->summary)->fake_visible_count)
@@ -1405,7 +1409,7 @@ static void
vee_folder_set_expression (CamelVeeFolder *vee_folder,
const gchar *query)
{
- CamelVeeFolderPrivate *p = vee_folder->priv;
+ CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vee_folder);
GList *node;
camel_vee_folder_lock (vee_folder, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
@@ -1488,7 +1492,7 @@ vee_folder_remove_folder_helper (CamelVeeFolder *vf, CamelFolder *source)
/* check if this folder is still to be part of unmatched */
if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0 && !killun) {
camel_vee_folder_lock (folder_unmatched, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
- still = g_list_find (folder_unmatched->priv->folders, source) != NULL;
+ still = g_list_find (CAMEL_VEE_FOLDER_GET_PRIVATE (folder_unmatched)->folders, source) != NULL;
camel_vee_folder_unlock (folder_unmatched, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
camel_vee_folder_hash_folder (source, hash);
}
@@ -1888,7 +1892,7 @@ vee_folder_folder_changed (CamelVeeFolder *vee_folder,
CamelFolder *sub,
CamelFolderChangeInfo *changes)
{
- CamelVeeFolderPrivate *p = vee_folder->priv;
+ CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vee_folder);
struct _folder_changed_msg *m;
CamelStore *parent_store;
CamelSession *session;
@@ -1966,7 +1970,7 @@ camel_vee_folder_init (CamelVeeFolder *vee_folder)
{
CamelFolder *folder = CAMEL_FOLDER (vee_folder);
- vee_folder->priv = G_TYPE_INSTANCE_GET_PRIVATE (vee_folder, CAMEL_TYPE_VEE_FOLDER, CamelVeeFolderPrivate);
+ vee_folder->priv = CAMEL_VEE_FOLDER_GET_PRIVATE (vee_folder);
folder->folder_flags |= (CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY |
CAMEL_FOLDER_HAS_SEARCH_CAPABILITY);
@@ -2072,7 +2076,7 @@ camel_vee_folder_set_expression (CamelVeeFolder *vf, const gchar *query)
void
camel_vee_folder_add_folder (CamelVeeFolder *vf, CamelFolder *sub)
{
- CamelVeeFolderPrivate *p = vf->priv;
+ CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vf);
gint i;
CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
@@ -2097,7 +2101,7 @@ camel_vee_folder_add_folder (CamelVeeFolder *vf, CamelFolder *sub)
camel_folder_unlock (CAMEL_FOLDER (vf), CAMEL_FOLDER_CHANGE_LOCK);
}
if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0 && !CAMEL_IS_VEE_FOLDER (sub) && folder_unmatched != NULL) {
- CamelVeeFolderPrivate *up = folder_unmatched->priv;
+ CamelVeeFolderPrivate *up = CAMEL_VEE_FOLDER_GET_PRIVATE (folder_unmatched);
up->folders = g_list_append (
up->folders, g_object_ref (sub));
@@ -2138,7 +2142,7 @@ void
camel_vee_folder_remove_folder (CamelVeeFolder *vf,
CamelFolder *sub)
{
- CamelVeeFolderPrivate *p = vf->priv;
+ CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vf);
gint i;
CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
@@ -2168,7 +2172,7 @@ camel_vee_folder_remove_folder (CamelVeeFolder *vf,
camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
if (folder_unmatched != NULL) {
- CamelVeeFolderPrivate *up = folder_unmatched->priv;
+ CamelVeeFolderPrivate *up = CAMEL_VEE_FOLDER_GET_PRIVATE (folder_unmatched);
camel_vee_folder_lock (folder_unmatched, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
/* if folder deleted, then blow it away from unmatched always, and remove all refs to it */
@@ -2241,7 +2245,7 @@ remove_folders (CamelFolder *folder,
void
camel_vee_folder_set_folders (CamelVeeFolder *vf, GList *folders)
{
- CamelVeeFolderPrivate *p = vf->priv;
+ CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vf);
GHashTable *remove = g_hash_table_new (NULL, NULL);
GList *l;
CamelFolder *folder;
diff --git a/camel/providers/groupwise/camel-groupwise-folder.c b/camel/providers/groupwise/camel-groupwise-folder.c
index fdbcd35..7c8f5eb 100644
--- a/camel/providers/groupwise/camel-groupwise-folder.c
+++ b/camel/providers/groupwise/camel-groupwise-folder.c
@@ -61,6 +61,10 @@ which needs to be better organized via functions */
#define MAX_ATTACHMENT_SIZE 1*1024*1024 /*In bytes*/
#define GROUPWISE_BULK_DELETE_LIMIT 100
+#define CAMEL_GROUPWISE_FOLDER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_GROUPWISE_FOLDER, CamelGroupwiseFolderPrivate))
+
struct _CamelGroupwiseFolderPrivate {
#ifdef ENABLE_THREADS
@@ -3050,7 +3054,7 @@ camel_groupwise_folder_init (CamelGroupwiseFolder *gw_folder)
{
CamelFolder *folder = CAMEL_FOLDER (gw_folder);
- gw_folder->priv = G_TYPE_INSTANCE_GET_PRIVATE (gw_folder, CAMEL_TYPE_GROUPWISE_FOLDER, CamelGroupwiseFolderPrivate);
+ gw_folder->priv = CAMEL_GROUPWISE_FOLDER_GET_PRIVATE (gw_folder);
folder->permanent_flags = CAMEL_MESSAGE_ANSWERED | CAMEL_MESSAGE_DELETED |
CAMEL_MESSAGE_DRAFT | CAMEL_MESSAGE_FLAGGED | CAMEL_MESSAGE_SEEN;
diff --git a/camel/providers/groupwise/camel-groupwise-store.c b/camel/providers/groupwise/camel-groupwise-store.c
index 11fcfe7..3afd18c 100644
--- a/camel/providers/groupwise/camel-groupwise-store.c
+++ b/camel/providers/groupwise/camel-groupwise-store.c
@@ -53,6 +53,10 @@
#define JUNK_ENABLE 1
#define JUNK_PERSISTENCE 14
+#define CAMEL_GROUPWISE_STORE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_GROUPWISE_STORE, CamelGroupwiseStorePrivate))
+
const gchar * CREATE_CURSOR_VIEW = "peek id default recipient threading hasAttachment subject status priority startDate created delivered size recurrenceKey";
struct _CamelGroupwiseStorePrivate {
@@ -1586,7 +1590,8 @@ camel_groupwise_store_class_init (CamelGroupwiseStoreClass *class)
static void
camel_groupwise_store_init (CamelGroupwiseStore *groupwise_store)
{
- groupwise_store->priv = G_TYPE_INSTANCE_GET_PRIVATE (groupwise_store, CAMEL_TYPE_GROUPWISE_STORE, CamelGroupwiseStorePrivate);
+ groupwise_store->priv =
+ CAMEL_GROUPWISE_STORE_GET_PRIVATE (groupwise_store);
d("in groupwise store init\n");
groupwise_store->priv->server_name = NULL;
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index b02b5e0..acb4caf 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -58,6 +58,10 @@
* octets) */
#define UID_SET_LIMIT (768)
+#define CAMEL_IMAP_FOLDER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_IMAP_FOLDER, CamelImapFolderPrivate))
+
/* The custom property ID is a CamelArg artifact.
* It still identifies the property in state files. */
enum {
@@ -300,7 +304,7 @@ camel_imap_folder_init (CamelImapFolder *imap_folder)
{
CamelFolder *folder = CAMEL_FOLDER (imap_folder);
- imap_folder->priv = G_TYPE_INSTANCE_GET_PRIVATE (imap_folder, CAMEL_TYPE_IMAP_FOLDER, CamelImapFolderPrivate);
+ imap_folder->priv = CAMEL_IMAP_FOLDER_GET_PRIVATE (imap_folder);
folder->permanent_flags = CAMEL_MESSAGE_ANSWERED | CAMEL_MESSAGE_DELETED |
CAMEL_MESSAGE_DRAFT | CAMEL_MESSAGE_FLAGGED | CAMEL_MESSAGE_SEEN;
diff --git a/camel/providers/imap/camel-imap-wrapper.c b/camel/providers/imap/camel-imap-wrapper.c
index 91b03d1..f0218f2 100644
--- a/camel/providers/imap/camel-imap-wrapper.c
+++ b/camel/providers/imap/camel-imap-wrapper.c
@@ -31,6 +31,10 @@
#include "camel-imap-folder.h"
#include "camel-imap-wrapper.h"
+#define CAMEL_IMAP_WRAPPER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_IMAP_WRAPPER, CamelImapWrapperPrivate))
+
struct _CamelImapWrapperPrivate {
GMutex *lock;
};
@@ -144,7 +148,7 @@ camel_imap_wrapper_class_init (CamelImapWrapperClass *class)
static void
camel_imap_wrapper_init (CamelImapWrapper *imap_wrapper)
{
- imap_wrapper->priv = G_TYPE_INSTANCE_GET_PRIVATE (imap_wrapper, CAMEL_TYPE_IMAP_WRAPPER, CamelImapWrapperPrivate);
+ imap_wrapper->priv = CAMEL_IMAP_WRAPPER_GET_PRIVATE (imap_wrapper);
imap_wrapper->priv->lock = g_mutex_new ();
}
diff --git a/camel/providers/imapx/camel-imapx-conn-manager.c b/camel/providers/imapx/camel-imapx-conn-manager.c
index f979f82..b1b0728 100644
--- a/camel/providers/imapx/camel-imapx-conn-manager.c
+++ b/camel/providers/imapx/camel-imapx-conn-manager.c
@@ -25,6 +25,10 @@
#define c(...) camel_imapx_debug(conman, __VA_ARGS__)
+#define CAMEL_IMAPX_CONN_MANAGER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_OBJECT, CamelIMAPXConnManager))
+
#define CON_LOCK(x) (g_static_rec_mutex_lock(&(x)->priv->con_man_lock))
#define CON_UNLOCK(x) (g_static_rec_mutex_unlock(&(x)->priv->con_man_lock))
@@ -96,7 +100,10 @@ camel_imapx_conn_manager_class_init (CamelIMAPXConnManagerClass *class)
static void
camel_imapx_conn_manager_init (CamelIMAPXConnManager *con_man)
{
- con_man->priv = G_TYPE_INSTANCE_GET_PRIVATE (con_man, CAMEL_TYPE_OBJECT, CamelIMAPXConnManagerPrivate);
+ CamelIMAPXConnManagerPrivate *priv;
+
+ priv = g_new0 (CamelIMAPXConnManagerPrivate, 1);
+ con_man->priv = priv;
/* default is 1 connection */
con_man->priv->n_connections = 1;
diff --git a/camel/providers/local/camel-local-folder.c b/camel/providers/local/camel-local-folder.c
index 90d0bf8..c6bfbcb 100644
--- a/camel/providers/local/camel-local-folder.c
+++ b/camel/providers/local/camel-local-folder.c
@@ -51,6 +51,10 @@
#define PATH_MAX _POSIX_PATH_MAX
#endif
+#define CAMEL_LOCAL_FOLDER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_LOCAL_FOLDER, CamelLocalFolderPrivate))
+
/* The custom property ID is a CamelArg artifact.
* It still identifies the property in state files. */
enum {
@@ -474,7 +478,7 @@ camel_local_folder_init (CamelLocalFolder *local_folder)
{
CamelFolder *folder = CAMEL_FOLDER (local_folder);
- local_folder->priv = G_TYPE_INSTANCE_GET_PRIVATE (local_folder, CAMEL_TYPE_LOCAL_FOLDER, CamelLocalFolderPrivate);
+ local_folder->priv = CAMEL_LOCAL_FOLDER_GET_PRIVATE (local_folder);
local_folder->priv->search_lock = g_mutex_new ();
folder->folder_flags |= (CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY |
diff --git a/camel/providers/local/camel-maildir-summary.c b/camel/providers/local/camel-maildir-summary.c
index cb97661..9f324ea 100644
--- a/camel/providers/local/camel-maildir-summary.c
+++ b/camel/providers/local/camel-maildir-summary.c
@@ -42,6 +42,10 @@
#define CAMEL_MAILDIR_SUMMARY_VERSION (0x2000)
+#define CAMEL_MAILDIR_SUMMARY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MAILDIR_SUMMARY, CamelMaildirSummaryPrivate))
+
static CamelMessageInfo *message_info_migrate (CamelFolderSummary *s, FILE *in);
static CamelMessageInfo *message_info_new_from_header (CamelFolderSummary *, struct _camel_header_raw *);
static void message_info_free (CamelFolderSummary *, CamelMessageInfo *mi);
@@ -70,7 +74,7 @@ maildir_summary_finalize (GObject *object)
{
CamelMaildirSummaryPrivate *priv;
- priv = CAMEL_MAILDIR_SUMMARY (object)->priv;
+ priv = CAMEL_MAILDIR_SUMMARY_GET_PRIVATE (object);
g_free (priv->hostname);
g_mutex_free (priv->summary_lock);
@@ -116,7 +120,8 @@ camel_maildir_summary_init (CamelMaildirSummary *maildir_summary)
folder_summary = CAMEL_FOLDER_SUMMARY (maildir_summary);
- maildir_summary->priv = G_TYPE_INSTANCE_GET_PRIVATE (maildir_summary, CAMEL_TYPE_MAILDIR_SUMMARY, CamelMaildirSummaryPrivate);
+ maildir_summary->priv =
+ CAMEL_MAILDIR_SUMMARY_GET_PRIVATE (maildir_summary);
/* set unique file version */
folder_summary->version += CAMEL_MAILDIR_SUMMARY_VERSION;
diff --git a/camel/providers/local/camel-mh-summary.c b/camel/providers/local/camel-mh-summary.c
index 34a09c1..fa693e8 100644
--- a/camel/providers/local/camel-mh-summary.c
+++ b/camel/providers/local/camel-mh-summary.c
@@ -41,6 +41,10 @@
#define CAMEL_MH_SUMMARY_VERSION (0x2000)
+#define CAMEL_MH_SUMMARY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_MH_SUMMARY, CamelMhSummaryPrivate))
+
static gint mh_summary_check (CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, GCancellable *cancellable, GError **error);
static gint mh_summary_sync (CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, GCancellable *cancellable, GError **error);
/*static gint mh_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, CamelMessageInfo *info, CamelFolderChangeInfo *, GError **error);*/
@@ -74,7 +78,7 @@ camel_mh_summary_init (CamelMhSummary *mh_summary)
{
CamelFolderSummary *folder_summary;
- mh_summary->priv = G_TYPE_INSTANCE_GET_PRIVATE (mh_summary, CAMEL_TYPE_MH_SUMMARY, CamelMhSummaryPrivate);
+ mh_summary->priv = CAMEL_MH_SUMMARY_GET_PRIVATE (mh_summary);
folder_summary = CAMEL_FOLDER_SUMMARY (mh_summary);
diff --git a/camel/providers/nntp/camel-nntp-folder.c b/camel/providers/nntp/camel-nntp-folder.c
index b464e53..c8a663f 100644
--- a/camel/providers/nntp/camel-nntp-folder.c
+++ b/camel/providers/nntp/camel-nntp-folder.c
@@ -39,6 +39,10 @@
#include "camel-nntp-store.h"
#include "camel-nntp-summary.h"
+#define CAMEL_NNTP_FOLDER_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_NNTP_FOLDER, CamelNNTPFolderPrivate))
+
G_DEFINE_TYPE (CamelNNTPFolder, camel_nntp_folder, CAMEL_TYPE_DISCO_FOLDER)
static void
@@ -639,7 +643,7 @@ camel_nntp_folder_class_init (CamelNNTPFolderClass *class)
static void
camel_nntp_folder_init (CamelNNTPFolder *nntp_folder)
{
- nntp_folder->priv = G_TYPE_INSTANCE_GET_PRIVATE (nntp_folder, CAMEL_TYPE_NNTP_FOLDER, CamelNNTPFolderPrivate);
+ nntp_folder->priv = CAMEL_NNTP_FOLDER_GET_PRIVATE (nntp_folder);
nntp_folder->changes = camel_folder_change_info_new ();
nntp_folder->priv->search_lock = g_mutex_new ();
diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c
index 4ebc59e..0dd5edd 100644
--- a/camel/providers/nntp/camel-nntp-store.c
+++ b/camel/providers/nntp/camel-nntp-store.c
@@ -54,6 +54,10 @@
#define DUMP_EXTENSIONS
+#define CAMEL_NNTP_STORE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_NNTP_STORE, CamelNNTPStorePrivate))
+
G_DEFINE_TYPE (CamelNNTPStore, camel_nntp_store, CAMEL_TYPE_DISCO_STORE)
static gint
@@ -1384,7 +1388,7 @@ camel_nntp_store_init (CamelNNTPStore *nntp_store)
nntp_store->mem = (CamelStreamMem *)camel_stream_mem_new ();
- nntp_store->priv = G_TYPE_INSTANCE_GET_PRIVATE (nntp_store, CAMEL_TYPE_NNTP_STORE, CamelNNTPStorePrivate);
+ nntp_store->priv = CAMEL_NNTP_STORE_GET_PRIVATE (nntp_store);
}
/* Enter owning lock */
diff --git a/camel/providers/nntp/camel-nntp-summary.c b/camel/providers/nntp/camel-nntp-summary.c
index b6491d3..82cf030 100644
--- a/camel/providers/nntp/camel-nntp-summary.c
+++ b/camel/providers/nntp/camel-nntp-summary.c
@@ -44,6 +44,10 @@
#define CAMEL_NNTP_SUMMARY_VERSION (1)
+#define CAMEL_NNTP_SUMMARY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), CAMEL_TYPE_NNTP_SUMMARY, CamelNNTPSummaryPrivate))
+
struct _CamelNNTPSummaryPrivate {
gchar *uid;
@@ -83,7 +87,7 @@ camel_nntp_summary_init (CamelNNTPSummary *nntp_summary)
{
CamelFolderSummary *summary = CAMEL_FOLDER_SUMMARY (nntp_summary);
- nntp_summary->priv = G_TYPE_INSTANCE_GET_PRIVATE (nntp_summary, CAMEL_TYPE_NNTP_SUMMARY, CamelNNTPSummaryPrivate);
+ nntp_summary->priv = CAMEL_NNTP_SUMMARY_GET_PRIVATE (nntp_summary);
/* and a unique file version */
summary->version += CAMEL_NNTP_SUMMARY_VERSION;
diff --git a/libedataserver/e-proxy.c b/libedataserver/e-proxy.c
index 85af8bf..d743840 100644
--- a/libedataserver/e-proxy.c
+++ b/libedataserver/e-proxy.c
@@ -97,6 +97,10 @@ enum ProxyType {
#define RIGHT_KEY(sufix) (priv->type == PROXY_TYPE_SYSTEM ? KEY_GCONF_SYS_ ## sufix : KEY_GCONF_EVO_ ## sufix)
+#define E_PROXY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_PROXY, EProxyPrivate))
+
struct _EProxyPrivate {
SoupURI *uri_http, *uri_https;
guint notify_id_evo, notify_id_sys, notify_id_sys_http; /* conxn id of gconf_client_notify_add */
@@ -157,7 +161,7 @@ e_proxy_dispose (GObject *object)
EProxyPrivate *priv;
GConfClient* client;
- priv = E_PROXY (object)->priv;
+ priv = E_PROXY_GET_PRIVATE (object);
client = gconf_client_get_default ();
@@ -224,7 +228,7 @@ e_proxy_class_init (EProxyClass *class)
static void
e_proxy_init (EProxy *proxy)
{
- proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, E_TYPE_PROXY, EProxyPrivate);
+ proxy->priv = E_PROXY_GET_PRIVATE (proxy);
proxy->priv->type = PROXY_TYPE_SYSTEM;
}
diff --git a/libedataserver/e-soap-message.c b/libedataserver/e-soap-message.c
index 1fd1a26..32587b3 100644
--- a/libedataserver/e-soap-message.c
+++ b/libedataserver/e-soap-message.c
@@ -9,7 +9,7 @@
G_DEFINE_TYPE (ESoapMessage, e_soap_message, SOUP_TYPE_MESSAGE)
-struct _ESoapMessagePrivate {
+typedef struct {
/* Serialization fields */
xmlDocPtr doc;
xmlNodePtr last_node;
@@ -19,12 +19,13 @@ struct _ESoapMessagePrivate {
xmlChar *env_uri;
gboolean body_started;
gchar *action;
-};
+} ESoapMessagePrivate;
+#define E_SOAP_MESSAGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), E_TYPE_SOAP_MESSAGE, ESoapMessagePrivate))
static void
finalize (GObject *object)
{
- ESoapMessagePrivate *priv = E_SOAP_MESSAGE (object)->priv;
+ ESoapMessagePrivate *priv = E_SOAP_MESSAGE_GET_PRIVATE (object);
if (priv->doc)
xmlFreeDoc (priv->doc);
@@ -51,18 +52,18 @@ e_soap_message_class_init (ESoapMessageClass *e_soap_message_class)
static void
e_soap_message_init (ESoapMessage *msg)
{
- msg->priv = G_TYPE_INSTANCE_GET_PRIVATE (msg, E_TYPE_SOAP_MESSAGE, ESoapMessagePrivate);
+ ESoapMessagePrivate *priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
/* initialize XML structures */
- msg->priv->doc = xmlNewDoc ((const xmlChar *)"1.0");
- msg->priv->doc->standalone = FALSE;
- msg->priv->doc->encoding = xmlCharStrdup ("UTF-8");
+ priv->doc = xmlNewDoc ((const xmlChar *)"1.0");
+ priv->doc->standalone = FALSE;
+ priv->doc->encoding = xmlCharStrdup ("UTF-8");
}
static xmlNsPtr
fetch_ns (ESoapMessage *msg, const gchar *prefix, const gchar *ns_uri)
{
- ESoapMessagePrivate *priv = msg->priv;
+ ESoapMessagePrivate *priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
xmlNsPtr ns = NULL;
if (prefix && ns_uri)
@@ -140,7 +141,7 @@ e_soap_message_new_from_uri (const gchar *method, SoupURI *uri,
SOUP_MESSAGE_URI, uri,
NULL);
- priv = msg->priv;
+ priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
priv->doc->standalone = standalone;
@@ -171,7 +172,7 @@ e_soap_message_start_envelope (ESoapMessage *msg)
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
priv->last_node = priv->doc->xmlRootNode =
xmlNewDocNode (priv->doc, NULL, (const xmlChar *)"Envelope", NULL);
@@ -233,7 +234,7 @@ e_soap_message_start_body (ESoapMessage *msg)
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
if (priv->body_started)
return;
@@ -291,7 +292,7 @@ e_soap_message_start_element (ESoapMessage *msg,
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
priv->last_node = xmlNewChild (priv->last_node, NULL, (const xmlChar *)name, NULL);
@@ -316,7 +317,7 @@ e_soap_message_end_element (ESoapMessage *msg)
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
priv->last_node = priv->last_node->parent;
}
@@ -346,7 +347,7 @@ e_soap_message_start_fault (ESoapMessage *msg,
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
priv->last_node = xmlNewChild (priv->last_node,
priv->soap_ns,
@@ -392,7 +393,7 @@ e_soap_message_start_fault_detail (ESoapMessage *msg)
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
priv->last_node = xmlNewChild (priv->last_node,
priv->soap_ns,
@@ -434,7 +435,7 @@ e_soap_message_start_header (ESoapMessage *msg)
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
priv->last_node = xmlNewChild (priv->last_node, priv->soap_ns,
(const xmlChar *)"Header", NULL);
@@ -479,7 +480,7 @@ e_soap_message_start_header_element (ESoapMessage *msg,
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
e_soap_message_start_element (msg, name, prefix, ns_uri);
if (actor_uri)
@@ -587,7 +588,7 @@ e_soap_message_write_string (ESoapMessage *msg, const gchar *string)
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
xmlNodeAddContent (priv->last_node, (const xmlChar *)string);
}
@@ -609,7 +610,7 @@ e_soap_message_write_buffer (ESoapMessage *msg, const gchar *buffer, gint len)
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
xmlNodeAddContentLen (priv->last_node, (const xmlChar *)buffer, len);
}
@@ -630,7 +631,7 @@ e_soap_message_set_element_type (ESoapMessage *msg, const gchar *xsi_type)
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
xmlNewNsProp (priv->last_node, priv->xsi_ns, (const xmlChar *)"type", (const xmlChar *)xsi_type);
}
@@ -649,7 +650,7 @@ e_soap_message_set_null (ESoapMessage *msg)
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
xmlNewNsProp (priv->last_node, priv->xsi_ns, (const xmlChar *)"null", (const xmlChar *)"1");
}
@@ -676,7 +677,7 @@ e_soap_message_add_attribute (ESoapMessage *msg,
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
xmlNewNsProp (priv->last_node,
fetch_ns (msg, prefix, ns_uri),
@@ -699,7 +700,7 @@ e_soap_message_add_namespace (ESoapMessage *msg, const gchar *prefix, const gcha
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
xmlNewNs (priv->last_node, (const xmlChar *)(ns_uri ? ns_uri : ""), (const xmlChar *)prefix);
}
@@ -739,7 +740,7 @@ e_soap_message_set_encoding_style (ESoapMessage *msg, const gchar *enc_style)
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
xmlNewNsProp (priv->last_node, priv->soap_ns, (const xmlChar *)"encodingStyle", (const xmlChar *)enc_style);
}
@@ -758,7 +759,7 @@ e_soap_message_reset (ESoapMessage *msg)
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
xmlFreeDoc (priv->doc);
priv->doc = xmlNewDoc ((const xmlChar *)"1.0");
@@ -793,7 +794,7 @@ e_soap_message_persist (ESoapMessage *msg)
gint len;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
xmlDocDumpMemory (priv->doc, &body, &len);
@@ -822,7 +823,7 @@ e_soap_message_get_namespace_prefix (ESoapMessage *msg, const gchar *ns_uri)
xmlNsPtr ns = NULL;
g_return_val_if_fail (E_IS_SOAP_MESSAGE (msg), NULL);
- priv = msg->priv;
+ priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
g_return_val_if_fail (ns_uri != NULL, NULL);
ns = xmlSearchNsByHref (priv->doc, priv->last_node, (const xmlChar *)ns_uri);
@@ -853,7 +854,7 @@ e_soap_message_get_xml_doc (ESoapMessage *msg)
ESoapMessagePrivate *priv;
g_return_val_if_fail (E_IS_SOAP_MESSAGE (msg), NULL);
- priv = msg->priv;
+ priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
return priv->doc;
}
diff --git a/libedataserver/e-soap-message.h b/libedataserver/e-soap-message.h
index bc92009..053f169 100644
--- a/libedataserver/e-soap-message.h
+++ b/libedataserver/e-soap-message.h
@@ -20,12 +20,9 @@ G_BEGIN_DECLS
#define E_IS_SOAP_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SOAP_MESSAGE))
#define E_SOAP_MESSAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_SOAP_MESSAGE, ESoapMessageClass))
-typedef struct _ESoapMessagePrivate ESoapMessagePrivate;
-
typedef struct {
SoupMessage parent;
- ESoapMessagePrivate *priv;
} ESoapMessage;
typedef struct {
diff --git a/libedataserver/e-soap-response.c b/libedataserver/e-soap-response.c
index 3941571..ae59f63 100644
--- a/libedataserver/e-soap-response.c
+++ b/libedataserver/e-soap-response.c
@@ -11,7 +11,7 @@
G_DEFINE_TYPE (ESoapResponse, e_soap_response, G_TYPE_OBJECT)
-struct _ESoapResponsePrivate {
+typedef struct {
/* the XML document */
xmlDocPtr xmldoc;
xmlNodePtr xml_root;
@@ -19,14 +19,15 @@ struct _ESoapResponsePrivate {
xmlNodePtr xml_method;
xmlNodePtr soap_fault;
GList *parameters;
-};
+} ESoapResponsePrivate;
+#define E_SOAP_RESPONSE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), E_TYPE_SOAP_RESPONSE, ESoapResponsePrivate))
static xmlNode *soup_xml_real_node (xmlNode *node);
static void
finalize (GObject *object)
{
- ESoapResponsePrivate *priv = E_SOAP_RESPONSE (object)->priv;
+ ESoapResponsePrivate *priv = E_SOAP_RESPONSE_GET_PRIVATE (object);
if (priv->xmldoc)
xmlFreeDoc (priv->xmldoc);
@@ -49,8 +50,9 @@ e_soap_response_class_init (ESoapResponseClass *e_soap_response_class)
static void
e_soap_response_init (ESoapResponse *response)
{
- response->priv = G_TYPE_INSTANCE_GET_PRIVATE (response, E_TYPE_SOAP_RESPONSE, ESoapResponsePrivate);
- response->priv->xmldoc = xmlNewDoc ((const xmlChar *)"1.0");
+ ESoapResponsePrivate *priv = E_SOAP_RESPONSE_GET_PRIVATE (response);
+
+ priv->xmldoc = xmlNewDoc ((const xmlChar *)"1.0");
}
/**
@@ -139,7 +141,7 @@ e_soap_response_from_string (ESoapResponse *response, const gchar *xmlstr)
xmlNodePtr xml_root, xml_body, xml_method = NULL;
g_return_val_if_fail (E_IS_SOAP_RESPONSE (response), FALSE);
- priv = response->priv;
+ priv = E_SOAP_RESPONSE_GET_PRIVATE (response);
g_return_val_if_fail (xmlstr != NULL, FALSE);
/* clear the previous contents */
@@ -208,7 +210,7 @@ e_soap_response_get_method_name (ESoapResponse *response)
ESoapResponsePrivate *priv;
g_return_val_if_fail (E_IS_SOAP_RESPONSE (response), NULL);
- priv = response->priv;
+ priv = E_SOAP_RESPONSE_GET_PRIVATE (response);
g_return_val_if_fail (priv->xml_method != NULL, NULL);
return (const gchar *) priv->xml_method->name;
@@ -229,7 +231,7 @@ e_soap_response_set_method_name (ESoapResponse *response, const gchar *method_na
ESoapResponsePrivate *priv;
g_return_if_fail (E_IS_SOAP_RESPONSE (response));
- priv = response->priv;
+ priv = E_SOAP_RESPONSE_GET_PRIVATE (response);
g_return_if_fail (priv->xml_method != NULL);
g_return_if_fail (method_name != NULL);
@@ -457,7 +459,7 @@ e_soap_response_get_parameters (ESoapResponse *response)
ESoapResponsePrivate *priv;
g_return_val_if_fail (E_IS_SOAP_RESPONSE (response), NULL);
- priv = response->priv;
+ priv = E_SOAP_RESPONSE_GET_PRIVATE (response);
return (const GList *) priv->parameters;
}
@@ -479,7 +481,7 @@ e_soap_response_get_first_parameter (ESoapResponse *response)
ESoapResponsePrivate *priv;
g_return_val_if_fail (E_IS_SOAP_RESPONSE (response), NULL);
- priv = response->priv;
+ priv = E_SOAP_RESPONSE_GET_PRIVATE (response);
return priv->parameters ? priv->parameters->data : NULL;
}
@@ -505,7 +507,7 @@ e_soap_response_get_first_parameter_by_name (ESoapResponse *response,
GList *l;
g_return_val_if_fail (E_IS_SOAP_RESPONSE (response), NULL);
- priv = response->priv;
+ priv = E_SOAP_RESPONSE_GET_PRIVATE (response);
g_return_val_if_fail (name != NULL, NULL);
for (l = priv->parameters; l != NULL; l = l->next) {
@@ -538,7 +540,7 @@ e_soap_response_get_next_parameter (ESoapResponse *response,
GList *l;
g_return_val_if_fail (E_IS_SOAP_RESPONSE (response), NULL);
- priv = response->priv;
+ priv = E_SOAP_RESPONSE_GET_PRIVATE (response);
g_return_val_if_fail (from != NULL, NULL);
l = g_list_find (priv->parameters, (gconstpointer) from);
@@ -607,7 +609,7 @@ e_soap_response_dump_response (ESoapResponse *response, FILE *buffer)
xmlChar *xmlbuff;
gint buffersize, ret;
- ESoapResponsePrivate *priv = response->priv;
+ ESoapResponsePrivate *priv = E_SOAP_RESPONSE_GET_PRIVATE (response);
xmlDocDumpFormatMemory (priv->xmldoc, &xmlbuff, &buffersize, 1);
ret = fputs ((gchar *) xmlbuff, buffer);
diff --git a/libedataserver/e-soap-response.h b/libedataserver/e-soap-response.h
index dab7b3d..8b3dd1c 100644
--- a/libedataserver/e-soap-response.h
+++ b/libedataserver/e-soap-response.h
@@ -18,12 +18,9 @@ G_BEGIN_DECLS
#define E_IS_SOAP_RESPONSE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SOAP_RESPONSE))
#define E_SOAP_RESPONSE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_SOAP_RESPONSE, ESoapResponseClass))
-typedef struct _ESoapResponsePrivate ESoapResponsePrivate;
-
typedef struct {
GObject parent;
- ESoapResponsePrivate *priv;
} ESoapResponse;
typedef struct {
diff --git a/libedataserverui/e-categories-dialog.c b/libedataserverui/e-categories-dialog.c
index d0131a7..5428bad 100644
--- a/libedataserverui/e-categories-dialog.c
+++ b/libedataserverui/e-categories-dialog.c
@@ -30,6 +30,10 @@
#include "e-categories-dialog.h"
#include "e-category-completion.h"
+#define E_CATEGORIES_DIALOG_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CATEGORIES_DIALOG, ECategoriesDialogPrivate))
+
G_DEFINE_TYPE (ECategoriesDialog, e_categories_dialog, GTK_TYPE_DIALOG)
struct _ECategoriesDialogPrivate {
@@ -582,7 +586,7 @@ categories_dialog_dispose (GObject *object)
{
ECategoriesDialogPrivate *priv;
- priv = E_CATEGORIES_DIALOG (object)->priv;
+ priv = E_CATEGORIES_DIALOG_GET_PRIVATE (object);
g_hash_table_remove_all (priv->selected_categories);
@@ -595,7 +599,7 @@ categories_dialog_finalize (GObject *object)
{
ECategoriesDialogPrivate *priv;
- priv = E_CATEGORIES_DIALOG (object)->priv;
+ priv = E_CATEGORIES_DIALOG_GET_PRIVATE (object);
e_categories_unregister_change_listener (
G_CALLBACK (categories_dialog_listener_cb), object);
@@ -718,7 +722,7 @@ e_categories_dialog_init (ECategoriesDialog *dialog)
gtk_label_set_mnemonic_widget (GTK_LABEL (label_header), entry_categories);
gtk_label_set_mnemonic_widget (GTK_LABEL (label2), categories_list);
- dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (dialog, E_TYPE_CATEGORIES_DIALOG, ECategoriesDialogPrivate);
+ dialog->priv = E_CATEGORIES_DIALOG_GET_PRIVATE (dialog);
dialog->priv->selected_categories = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
dialog->priv->categories_entry = entry_categories;
diff --git a/libedataserverui/e-category-completion.c b/libedataserverui/e-category-completion.c
index 226e8b0..f6054df 100644
--- a/libedataserverui/e-category-completion.c
+++ b/libedataserverui/e-category-completion.c
@@ -25,6 +25,10 @@
#include <glib/gi18n-lib.h>
#include <libedataserver/e-categories.h>
+#define E_CATEGORY_COMPLETION_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CATEGORY_COMPLETION, ECategoryCompletionPrivate))
+
G_DEFINE_TYPE (ECategoryCompletion, e_category_completion, GTK_TYPE_ENTRY_COMPLETION)
struct _ECategoryCompletionPrivate {
@@ -482,7 +486,8 @@ e_category_completion_class_init (ECategoryCompletionClass *class)
static void
e_category_completion_init (ECategoryCompletion *category_completion)
{
- category_completion->priv = G_TYPE_INSTANCE_GET_PRIVATE (category_completion, E_TYPE_CATEGORY_COMPLETION, ECategoryCompletionPrivate);
+ category_completion->priv =
+ E_CATEGORY_COMPLETION_GET_PRIVATE (category_completion);
}
/**
diff --git a/libedataserverui/e-cell-renderer-color.c b/libedataserverui/e-cell-renderer-color.c
index f178b25..70c341c 100644
--- a/libedataserverui/e-cell-renderer-color.c
+++ b/libedataserverui/e-cell-renderer-color.c
@@ -27,6 +27,10 @@
#include <string.h>
#include <glib/gi18n-lib.h>
+#define E_CELL_RENDERER_COLOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CELL_RENDERER_COLOR, ECellRendererColorPrivate))
+
enum {
PROP_0,
PROP_COLOR
@@ -104,7 +108,7 @@ cell_renderer_color_render (GtkCellRenderer *cell,
guint xpad;
guint ypad;
- priv = E_CELL_RENDERER_COLOR (cell)->priv;
+ priv = E_CELL_RENDERER_COLOR_GET_PRIVATE (cell);
if (priv->color == NULL)
return;
@@ -138,7 +142,7 @@ cell_renderer_color_set_property (GObject *object,
{
ECellRendererColorPrivate *priv;
- priv = E_CELL_RENDERER_COLOR (object)->priv;
+ priv = E_CELL_RENDERER_COLOR_GET_PRIVATE (object);
switch (property_id) {
case PROP_COLOR:
@@ -159,7 +163,7 @@ cell_renderer_color_get_property (GObject *object,
{
ECellRendererColorPrivate *priv;
- priv = E_CELL_RENDERER_COLOR (object)->priv;
+ priv = E_CELL_RENDERER_COLOR_GET_PRIVATE (object);
switch (property_id) {
case PROP_COLOR:
@@ -175,7 +179,7 @@ cell_renderer_color_finalize (GObject *object)
{
ECellRendererColorPrivate *priv;
- priv = E_CELL_RENDERER_COLOR (object)->priv;
+ priv = E_CELL_RENDERER_COLOR_GET_PRIVATE (object);
if (priv->color != NULL)
gdk_color_free (priv->color);
@@ -216,7 +220,7 @@ e_cell_renderer_color_class_init (ECellRendererColorClass *class)
static void
e_cell_renderer_color_init (ECellRendererColor *cellcolor)
{
- cellcolor->priv = G_TYPE_INSTANCE_GET_PRIVATE (cellcolor, E_TYPE_CELL_RENDERER_COLOR, ECellRendererColorPrivate);
+ cellcolor->priv = E_CELL_RENDERER_COLOR_GET_PRIVATE (cellcolor);
g_object_set (cellcolor, "xpad", 4, NULL);
}
diff --git a/libedataserverui/e-contact-store.c b/libedataserverui/e-contact-store.c
index bdcdfeb..c49d72d 100644
--- a/libedataserverui/e-contact-store.c
+++ b/libedataserverui/e-contact-store.c
@@ -38,6 +38,10 @@
(iter)->user_data = GINT_TO_POINTER (index); \
} G_STMT_END
+#define E_CONTACT_STORE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_CONTACT_STORE, EContactStorePrivate))
+
struct _EContactStorePrivate {
gint stamp;
EBookQuery *query;
@@ -102,7 +106,7 @@ contact_store_dispose (GObject *object)
EContactStorePrivate *priv;
gint ii;
- priv = E_CONTACT_STORE (object)->priv;
+ priv = E_CONTACT_STORE_GET_PRIVATE (object);
/* Free sources and cached contacts */
for (ii = 0; ii < priv->contact_sources->len; ii++) {
@@ -132,7 +136,7 @@ contact_store_finalize (GObject *object)
{
EContactStorePrivate *priv;
- priv = E_CONTACT_STORE (object)->priv;
+ priv = E_CONTACT_STORE_GET_PRIVATE (object);
g_array_free (priv->contact_sources, TRUE);
@@ -176,7 +180,7 @@ e_contact_store_init (EContactStore *contact_store)
contact_sources = g_array_new (FALSE, FALSE, sizeof (ContactSource));
- contact_store->priv = G_TYPE_INSTANCE_GET_PRIVATE (contact_store, E_TYPE_CONTACT_STORE, EContactStorePrivate);
+ contact_store->priv = E_CONTACT_STORE_GET_PRIVATE (contact_store);
contact_store->priv->stamp = g_random_int ();
contact_store->priv->contact_sources = contact_sources;
}
diff --git a/libedataserverui/e-destination-store.c b/libedataserverui/e-destination-store.c
index 4e2b8ff..0397aa5 100644
--- a/libedataserverui/e-destination-store.c
+++ b/libedataserverui/e-destination-store.c
@@ -38,6 +38,10 @@
(iter)->user_data = GINT_TO_POINTER (index); \
} G_STMT_END
+#define E_DESTINATION_STORE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_DESTINATION_STORE, EDestinationStorePrivate))
+
struct _EDestinationStorePrivate {
GPtrArray *destinations;
gint stamp;
@@ -92,7 +96,7 @@ destination_store_dispose (GObject *object)
EDestinationStorePrivate *priv;
gint ii;
- priv = E_DESTINATION_STORE (object)->priv;
+ priv = E_DESTINATION_STORE_GET_PRIVATE (object);
for (ii = 0; ii < priv->destinations->len; ii++) {
EDestination *destination;
@@ -112,7 +116,7 @@ destination_store_finalize (GObject *object)
{
EDestinationStorePrivate *priv;
- priv = E_DESTINATION_STORE (object)->priv;
+ priv = E_DESTINATION_STORE_GET_PRIVATE (object);
g_ptr_array_free (priv->destinations, TRUE);
@@ -152,7 +156,8 @@ e_destination_store_tree_model_init (GtkTreeModelIface *iface)
static void
e_destination_store_init (EDestinationStore *destination_store)
{
- destination_store->priv = G_TYPE_INSTANCE_GET_PRIVATE (destination_store, E_TYPE_DESTINATION_STORE, EDestinationStorePrivate);
+ destination_store->priv =
+ E_DESTINATION_STORE_GET_PRIVATE (destination_store);
destination_store->priv->destinations = g_ptr_array_new ();
destination_store->priv->stamp = g_random_int ();
}
diff --git a/libedataserverui/e-name-selector-dialog.c b/libedataserverui/e-name-selector-dialog.c
index 3ab310f..d64e7f7 100644
--- a/libedataserverui/e-name-selector-dialog.c
+++ b/libedataserverui/e-name-selector-dialog.c
@@ -35,6 +35,10 @@
#include "e-name-selector-dialog.h"
#include "e-name-selector-entry.h"
+#define E_NAME_SELECTOR_DIALOG_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_NAME_SELECTOR_DIALOG, ENameSelectorDialogPrivate))
+
typedef struct {
gchar *name;
@@ -161,7 +165,8 @@ e_name_selector_dialog_init (ENameSelectorDialog *name_selector_dialog)
GtkWidget *status_message;
GtkWidget *source_combo;
- name_selector_dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (name_selector_dialog, E_TYPE_NAME_SELECTOR_DIALOG, ENameSelectorDialogPrivate);
+ name_selector_dialog->priv =
+ E_NAME_SELECTOR_DIALOG_GET_PRIVATE (name_selector_dialog);
name_selector_box = gtk_vbox_new (FALSE, 6);
gtk_widget_show (name_selector_box);
@@ -422,7 +427,7 @@ e_name_selector_dialog_finalize (GObject *object)
{
ENameSelectorDialogPrivate *priv;
- priv = E_NAME_SELECTOR_DIALOG (object)->priv;
+ priv = E_NAME_SELECTOR_DIALOG_GET_PRIVATE (object);
g_slist_foreach (priv->user_query_fields, (GFunc)g_free, NULL);
g_slist_free (priv->user_query_fields);
@@ -693,7 +698,7 @@ add_section (ENameSelectorDialog *name_selector_dialog,
g_assert (pretty_name != NULL);
g_assert (E_IS_DESTINATION_STORE (destination_store));
- priv = name_selector_dialog->priv;
+ priv = E_NAME_SELECTOR_DIALOG_GET_PRIVATE (name_selector_dialog);
memset (§ion, 0, sizeof (Section));
@@ -945,7 +950,7 @@ source_changed (ENameSelectorDialog *name_selector_dialog,
static void
search_changed (ENameSelectorDialog *name_selector_dialog)
{
- ENameSelectorDialogPrivate *priv = name_selector_dialog->priv;
+ ENameSelectorDialogPrivate *priv = E_NAME_SELECTOR_DIALOG_GET_PRIVATE (name_selector_dialog);
EContactStore *contact_store;
EBookQuery *book_query;
GtkWidget *combo_box;
diff --git a/libedataserverui/e-name-selector-entry.c b/libedataserverui/e-name-selector-entry.c
index 65a1581..3a6740d 100644
--- a/libedataserverui/e-name-selector-entry.c
+++ b/libedataserverui/e-name-selector-entry.c
@@ -34,6 +34,10 @@
#include "e-name-selector-entry.h"
+#define E_NAME_SELECTOR_ENTRY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_NAME_SELECTOR_ENTRY, ENameSelectorEntryPrivate))
+
struct _ENameSelectorEntryPrivate {
PangoAttrList *attr_list;
@@ -101,7 +105,7 @@ name_selector_entry_dispose (GObject *object)
{
ENameSelectorEntryPrivate *priv;
- priv = E_NAME_SELECTOR_ENTRY (object)->priv;
+ priv = E_NAME_SELECTOR_ENTRY_GET_PRIVATE (object);
if (priv->attr_list != NULL) {
pango_attr_list_unref (priv->attr_list);
@@ -150,7 +154,7 @@ name_selector_entry_realize (GtkWidget *widget)
{
ENameSelectorEntryPrivate *priv;
- priv = E_NAME_SELECTOR_ENTRY (widget)->priv;
+ priv = E_NAME_SELECTOR_ENTRY_GET_PRIVATE (widget);
/* Chain up to parent's realize() method. */
GTK_WIDGET_CLASS (e_name_selector_entry_parent_class)->realize (widget);
@@ -601,7 +605,7 @@ set_completion_query (ENameSelectorEntry *name_selector_entry, const gchar *cue_
gchar *file_as_query_str;
gchar *user_fields_str;
- priv = name_selector_entry->priv;
+ priv = E_NAME_SELECTOR_ENTRY_GET_PRIVATE (name_selector_entry);
if (!name_selector_entry->priv->contact_store)
return;
@@ -900,7 +904,7 @@ type_ahead_complete (ENameSelectorEntry *name_selector_entry)
gchar *temp_str;
ENameSelectorEntryPrivate *priv;
- priv = name_selector_entry->priv;
+ priv = E_NAME_SELECTOR_ENTRY_GET_PRIVATE (name_selector_entry);
cursor_pos = gtk_editable_get_position (GTK_EDITABLE (name_selector_entry));
if (cursor_pos < 0)
@@ -971,7 +975,7 @@ clear_completion_model (ENameSelectorEntry *name_selector_entry)
{
ENameSelectorEntryPrivate *priv;
- priv = name_selector_entry->priv;
+ priv = E_NAME_SELECTOR_ENTRY_GET_PRIVATE (name_selector_entry);
if (!name_selector_entry->priv->contact_store)
return;
@@ -1573,7 +1577,7 @@ entry_activate (ENameSelectorEntry *name_selector_entry)
if (cursor_pos < 0)
return;
- priv = name_selector_entry->priv;
+ priv = E_NAME_SELECTOR_ENTRY_GET_PRIVATE (name_selector_entry);
text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry));
if (!get_range_at_position (text, cursor_pos, &range_start, &range_end))
@@ -2822,7 +2826,8 @@ e_name_selector_entry_init (ENameSelectorEntry *name_selector_entry)
GtkCellRenderer *renderer;
GConfClient *gconf;
- name_selector_entry->priv = G_TYPE_INSTANCE_GET_PRIVATE (name_selector_entry, E_TYPE_NAME_SELECTOR_ENTRY, ENameSelectorEntryPrivate);
+ name_selector_entry->priv =
+ E_NAME_SELECTOR_ENTRY_GET_PRIVATE (name_selector_entry);
g_queue_init (&name_selector_entry->priv->cancellables);
diff --git a/libedataserverui/e-name-selector-list.c b/libedataserverui/e-name-selector-list.c
index c9d819b..796567a 100644
--- a/libedataserverui/e-name-selector-list.c
+++ b/libedataserverui/e-name-selector-list.c
@@ -37,6 +37,10 @@
#include <libedataserverui/e-name-selector-entry.h>
#include "e-name-selector-list.h"
+#define E_NAME_SELECTOR_LIST_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_NAME_SELECTOR_LIST, ENameSelectorListPrivate))
+
#define MAX_ROW 10
struct _ENameSelectorListPrivate {
@@ -620,7 +624,8 @@ e_name_selector_list_init (ENameSelectorList *list)
EDestinationStore *store;
GtkEntryCompletion *completion;
- list->priv = G_TYPE_INSTANCE_GET_PRIVATE (list, E_TYPE_NAME_SELECTOR_LIST, ENameSelectorListPrivate);
+ list->priv = E_NAME_SELECTOR_LIST_GET_PRIVATE (list);
+
list->priv->menu = NULL;
entry = E_NAME_SELECTOR_ENTRY (list);
diff --git a/libedataserverui/e-name-selector-model.c b/libedataserverui/e-name-selector-model.c
index 04681eb..0cd9e61 100644
--- a/libedataserverui/e-name-selector-model.c
+++ b/libedataserverui/e-name-selector-model.c
@@ -29,6 +29,10 @@
#include <glib/gi18n-lib.h>
#include "e-name-selector-model.h"
+#define E_NAME_SELECTOR_MODEL_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_NAME_SELECTOR_MODEL, ENameSelectorModelPrivate))
+
typedef struct {
gchar *name;
gchar *pretty_name;
@@ -70,7 +74,8 @@ G_DEFINE_TYPE (ENameSelectorModel, e_name_selector_model, G_TYPE_OBJECT)
static void
e_name_selector_model_init (ENameSelectorModel *name_selector_model)
{
- name_selector_model->priv = G_TYPE_INSTANCE_GET_PRIVATE (name_selector_model, E_TYPE_NAME_SELECTOR_MODEL, ENameSelectorModelPrivate);
+ name_selector_model->priv =
+ E_NAME_SELECTOR_MODEL_GET_PRIVATE (name_selector_model);
name_selector_model->priv->sections = g_array_new (FALSE, FALSE, sizeof (Section));
name_selector_model->priv->contact_store = e_contact_store_new ();
@@ -94,7 +99,7 @@ name_selector_model_finalize (GObject *object)
ENameSelectorModelPrivate *priv;
gint i;
- priv = E_NAME_SELECTOR_MODEL (object)->priv;
+ priv = E_NAME_SELECTOR_MODEL_GET_PRIVATE (object);
for (i = 0; i < priv->sections->len; i++)
free_section (E_NAME_SELECTOR_MODEL (object), i);
diff --git a/libedataserverui/e-name-selector.c b/libedataserverui/e-name-selector.c
index a0d265a..c537ada 100644
--- a/libedataserverui/e-name-selector.c
+++ b/libedataserverui/e-name-selector.c
@@ -35,6 +35,10 @@
#include <libedataserverui/e-book-auth-util.h>
#include "e-name-selector.h"
+#define E_NAME_SELECTOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_NAME_SELECTOR, ENameSelectorPrivate))
+
typedef struct {
gchar *name;
ENameSelectorEntry *entry;
@@ -67,7 +71,7 @@ reset_pointer_cb (gpointer data, GObject *where_was)
g_return_if_fail (E_IS_NAME_SELECTOR (name_selector));
- priv = name_selector->priv;
+ priv = E_NAME_SELECTOR_GET_PRIVATE (name_selector);
for (ii = 0; ii < priv->sections->len; ii++) {
Section *section;
@@ -186,7 +190,7 @@ name_selector_dispose (GObject *object)
ENameSelectorPrivate *priv;
guint ii;
- priv = E_NAME_SELECTOR (object)->priv;
+ priv = E_NAME_SELECTOR_GET_PRIVATE (object);
if (priv->source_list != NULL) {
g_object_unref (priv->source_list);
@@ -223,7 +227,7 @@ name_selector_finalize (GObject *object)
{
ENameSelectorPrivate *priv;
- priv = E_NAME_SELECTOR (object)->priv;
+ priv = E_NAME_SELECTOR_GET_PRIVATE (object);
g_array_free (priv->source_books, TRUE);
g_array_free (priv->sections, TRUE);
@@ -253,7 +257,7 @@ e_name_selector_init (ENameSelector *name_selector)
sections = g_array_new (FALSE, FALSE, sizeof (Section));
source_books = g_array_new (FALSE, FALSE, sizeof (SourceBook));
- name_selector->priv = G_TYPE_INSTANCE_GET_PRIVATE (name_selector, E_TYPE_NAME_SELECTOR, ENameSelectorPrivate);
+ name_selector->priv = E_NAME_SELECTOR_GET_PRIVATE (name_selector);
name_selector->priv->sections = sections;
name_selector->priv->model = e_name_selector_model_new ();
name_selector->priv->source_books = source_books;
@@ -415,7 +419,7 @@ e_name_selector_peek_section_entry (ENameSelector *name_selector, const gchar *n
g_return_val_if_fail (E_IS_NAME_SELECTOR (name_selector), NULL);
g_return_val_if_fail (name != NULL, NULL);
- priv = name_selector->priv;
+ priv = E_NAME_SELECTOR_GET_PRIVATE (name_selector);
model = e_name_selector_peek_model (name_selector);
if (!e_name_selector_model_peek_section (
@@ -483,7 +487,7 @@ e_name_selector_peek_section_list (ENameSelector *name_selector, const gchar *na
g_return_val_if_fail (E_IS_NAME_SELECTOR (name_selector), NULL);
g_return_val_if_fail (name != NULL, NULL);
- priv = name_selector->priv;
+ priv = E_NAME_SELECTOR_GET_PRIVATE (name_selector);
model = e_name_selector_peek_model (name_selector);
if (!e_name_selector_model_peek_section (
diff --git a/libedataserverui/e-source-combo-box.c b/libedataserverui/e-source-combo-box.c
index ce812e0..8bd95cb 100644
--- a/libedataserverui/e-source-combo-box.c
+++ b/libedataserverui/e-source-combo-box.c
@@ -25,6 +25,10 @@
#include "e-source-combo-box.h"
#include "e-cell-renderer-color.h"
+#define E_SOURCE_COMBO_BOX_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SOURCE_COMBO_BOX, ESourceComboBoxPrivate))
+
G_DEFINE_TYPE (ESourceComboBox, e_source_combo_box, GTK_TYPE_COMBO_BOX)
struct _ESourceComboBoxPrivate {
@@ -260,7 +264,7 @@ e_source_combo_box_dispose (GObject *object)
{
ESourceComboBoxPrivate *priv;
- priv = E_SOURCE_COMBO_BOX (object)->priv;
+ priv = E_SOURCE_COMBO_BOX_GET_PRIVATE (object);
if (priv->source_list != NULL) {
g_signal_handler_disconnect (
@@ -280,7 +284,7 @@ e_source_combo_box_finalize (GObject *object)
{
ESourceComboBoxPrivate *priv;
- priv = E_SOURCE_COMBO_BOX (object)->priv;
+ priv = E_SOURCE_COMBO_BOX_GET_PRIVATE (object);
g_hash_table_destroy (priv->uid_index);
@@ -317,7 +321,9 @@ e_source_combo_box_class_init (ESourceComboBoxClass *class)
static void
e_source_combo_box_init (ESourceComboBox *source_combo_box)
{
- source_combo_box->priv = G_TYPE_INSTANCE_GET_PRIVATE (source_combo_box, E_TYPE_SOURCE_COMBO_BOX, ESourceComboBoxPrivate);
+ source_combo_box->priv =
+ E_SOURCE_COMBO_BOX_GET_PRIVATE (source_combo_box);
+
source_combo_box->priv->uid_index =
g_hash_table_new_full (
g_str_hash, g_str_equal,
diff --git a/libedataserverui/e-source-selector.c b/libedataserverui/e-source-selector.c
index 8a02f6e..0e34f2d 100644
--- a/libedataserverui/e-source-selector.c
+++ b/libedataserverui/e-source-selector.c
@@ -30,6 +30,10 @@
#include "e-data-server-ui-marshal.h"
#include "e-source-selector.h"
+#define E_SOURCE_SELECTOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SOURCE_SELECTOR, ESourceSelectorPrivate))
+
struct _ESourceSelectorPrivate {
ESourceList *list;
@@ -1124,7 +1128,7 @@ source_selector_test_collapse_row (GtkTreeView *tree_view,
GtkTreeModel *model;
GtkTreeIter child_iter;
- priv = E_SOURCE_SELECTOR (tree_view)->priv;
+ priv = E_SOURCE_SELECTOR_GET_PRIVATE (tree_view);
/* Clear this because something else has been clicked on now */
priv->toggled_last = FALSE;
@@ -1160,7 +1164,7 @@ source_selector_row_expanded (GtkTreeView *tree_view,
GtkTreePath *child_path;
GtkTreeIter child_iter;
- priv = E_SOURCE_SELECTOR (tree_view)->priv;
+ priv = E_SOURCE_SELECTOR_GET_PRIVATE (tree_view);
if (!priv->saved_primary_selection)
return;
@@ -1299,7 +1303,7 @@ e_source_selector_init (ESourceSelector *selector)
GtkTreeStore *tree_store;
GtkTreeView *tree_view;
- selector->priv = G_TYPE_INSTANCE_GET_PRIVATE (selector, E_TYPE_SOURCE_SELECTOR, ESourceSelectorPrivate);
+ selector->priv = E_SOURCE_SELECTOR_GET_PRIVATE (selector);
priv = selector->priv;
tree_view = GTK_TREE_VIEW (selector);
diff --git a/libedataserverui/e-tree-model-generator.c b/libedataserverui/e-tree-model-generator.c
index 2c4d09a..e9846e8 100644
--- a/libedataserverui/e-tree-model-generator.c
+++ b/libedataserverui/e-tree-model-generator.c
@@ -45,6 +45,10 @@
(iter)->user_data2 = GINT_TO_POINTER (index); \
} G_STMT_END
+#define E_TREE_MODEL_GENERATOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_TREE_MODEL_GENERATOR, ETreeModelGeneratorPrivate))
+
struct _ETreeModelGeneratorPrivate {
GtkTreeModel *child_model;
GArray *root_nodes;
@@ -235,7 +239,8 @@ e_tree_model_generator_tree_model_init (GtkTreeModelIface *iface)
static void
e_tree_model_generator_init (ETreeModelGenerator *tree_model_generator)
{
- tree_model_generator->priv = G_TYPE_INSTANCE_GET_PRIVATE (tree_model_generator, E_TYPE_TREE_MODEL_GENERATOR, ETreeModelGeneratorPrivate);
+ tree_model_generator->priv =
+ E_TREE_MODEL_GENERATOR_GET_PRIVATE (tree_model_generator);
tree_model_generator->priv->stamp = g_random_int ();
tree_model_generator->priv->root_nodes = g_array_new (FALSE, FALSE, sizeof (Node));
diff --git a/servers/groupwise/soup-soap-message.c b/servers/groupwise/soup-soap-message.c
index 549e250..5918091 100644
--- a/servers/groupwise/soup-soap-message.c
+++ b/servers/groupwise/soup-soap-message.c
@@ -9,7 +9,7 @@
G_DEFINE_TYPE (SoupSoapMessage, soup_soap_message, SOUP_TYPE_MESSAGE)
-struct _SoupSoapMessagePrivate {
+typedef struct {
/* Serialization fields */
xmlDocPtr doc;
xmlNodePtr last_node;
@@ -19,12 +19,13 @@ struct _SoupSoapMessagePrivate {
xmlChar *env_uri;
gboolean body_started;
gchar *action;
-};
+} SoupSoapMessagePrivate;
+#define SOUP_SOAP_MESSAGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SOUP_TYPE_SOAP_MESSAGE, SoupSoapMessagePrivate))
static void
finalize (GObject *object)
{
- SoupSoapMessagePrivate *priv = SOUP_SOAP_MESSAGE (object)->priv;
+ SoupSoapMessagePrivate *priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (object);
if (priv->doc)
xmlFreeDoc (priv->doc);
@@ -51,18 +52,18 @@ soup_soap_message_class_init (SoupSoapMessageClass *soup_soap_message_class)
static void
soup_soap_message_init (SoupSoapMessage *msg)
{
- msg->priv = G_TYPE_INSTANCE_GET_PRIVATE (msg, SOUP_TYPE_SOAP_MESSAGE, SoupSoapMessagePrivate);
+ SoupSoapMessagePrivate *priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
/* initialize XML structures */
- msg->priv->doc = xmlNewDoc ((const xmlChar *)"1.0");
- msg->priv->doc->standalone = FALSE;
- msg->priv->doc->encoding = xmlCharStrdup ("UTF-8");
+ priv->doc = xmlNewDoc ((const xmlChar *)"1.0");
+ priv->doc->standalone = FALSE;
+ priv->doc->encoding = xmlCharStrdup ("UTF-8");
}
static xmlNsPtr
fetch_ns (SoupSoapMessage *msg, const gchar *prefix, const gchar *ns_uri)
{
- SoupSoapMessagePrivate *priv = msg->priv;
+ SoupSoapMessagePrivate *priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
xmlNsPtr ns = NULL;
if (prefix && ns_uri)
@@ -136,7 +137,7 @@ soup_soap_message_new_from_uri (const gchar *method, SoupURI *uri,
SOUP_MESSAGE_URI, uri,
NULL);
- priv = msg->priv;
+ priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
priv->doc->standalone = standalone;
@@ -165,7 +166,7 @@ soup_soap_message_start_envelope (SoupSoapMessage *msg)
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
priv->last_node = priv->doc->xmlRootNode =
xmlNewDocNode (priv->doc, NULL, (const xmlChar *)"Envelope", NULL);
@@ -223,7 +224,7 @@ soup_soap_message_start_body (SoupSoapMessage *msg)
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
if (priv->body_started)
return;
@@ -277,7 +278,7 @@ soup_soap_message_start_element (SoupSoapMessage *msg,
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
priv->last_node = xmlNewChild (priv->last_node, NULL, (const xmlChar *)name, NULL);
@@ -300,7 +301,7 @@ soup_soap_message_end_element (SoupSoapMessage *msg)
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
priv->last_node = priv->last_node->parent;
}
@@ -328,7 +329,7 @@ soup_soap_message_start_fault (SoupSoapMessage *msg,
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
priv->last_node = xmlNewChild (priv->last_node,
priv->soap_ns,
@@ -370,7 +371,7 @@ soup_soap_message_start_fault_detail (SoupSoapMessage *msg)
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
priv->last_node = xmlNewChild (priv->last_node,
priv->soap_ns,
@@ -408,7 +409,7 @@ soup_soap_message_start_header (SoupSoapMessage *msg)
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
priv->last_node = xmlNewChild (priv->last_node, priv->soap_ns,
(const xmlChar *)"Header", NULL);
@@ -449,7 +450,7 @@ soup_soap_message_start_header_element (SoupSoapMessage *msg,
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
soup_soap_message_start_element (msg, name, prefix, ns_uri);
if (actor_uri)
@@ -545,7 +546,7 @@ soup_soap_message_write_string (SoupSoapMessage *msg, const gchar *string)
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
xmlNodeAddContent (priv->last_node, (const xmlChar *)string);
}
@@ -565,7 +566,7 @@ soup_soap_message_write_buffer (SoupSoapMessage *msg, const gchar *buffer, gint
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
xmlNodeAddContentLen (priv->last_node, (const xmlChar *)buffer, len);
}
@@ -584,7 +585,7 @@ soup_soap_message_set_element_type (SoupSoapMessage *msg, const gchar *xsi_type)
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
xmlNewNsProp (priv->last_node, priv->xsi_ns, (const xmlChar *)"type", (const xmlChar *)xsi_type);
}
@@ -601,7 +602,7 @@ soup_soap_message_set_null (SoupSoapMessage *msg)
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
xmlNewNsProp (priv->last_node, priv->xsi_ns, (const xmlChar *)"null", (const xmlChar *)"1");
}
@@ -626,7 +627,7 @@ soup_soap_message_add_attribute (SoupSoapMessage *msg,
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
xmlNewNsProp (priv->last_node,
fetch_ns (msg, prefix, ns_uri),
@@ -647,7 +648,7 @@ soup_soap_message_add_namespace (SoupSoapMessage *msg, const gchar *prefix, cons
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
xmlNewNs (priv->last_node, (const xmlChar *)(ns_uri ? ns_uri : ""), (const xmlChar *)prefix);
}
@@ -683,7 +684,7 @@ soup_soap_message_set_encoding_style (SoupSoapMessage *msg, const gchar *enc_sty
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
xmlNewNsProp (priv->last_node, priv->soap_ns, (const xmlChar *)"encodingStyle", (const xmlChar *)enc_style);
}
@@ -700,7 +701,7 @@ soup_soap_message_reset (SoupSoapMessage *msg)
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
xmlFreeDoc (priv->doc);
priv->doc = xmlNewDoc ((const xmlChar *)"1.0");
@@ -733,7 +734,7 @@ soup_soap_message_persist (SoupSoapMessage *msg)
gint len;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = msg->priv;
+ priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
xmlDocDumpMemory (priv->doc, &body, &len);
@@ -760,7 +761,7 @@ soup_soap_message_get_namespace_prefix (SoupSoapMessage *msg, const gchar *ns_ur
xmlNsPtr ns = NULL;
g_return_val_if_fail (SOUP_IS_SOAP_MESSAGE (msg), NULL);
- priv = msg->priv;
+ priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
g_return_val_if_fail (ns_uri != NULL, NULL);
ns = xmlSearchNsByHref (priv->doc, priv->last_node, (const xmlChar *)ns_uri);
@@ -789,7 +790,7 @@ soup_soap_message_get_xml_doc (SoupSoapMessage *msg)
SoupSoapMessagePrivate *priv;
g_return_val_if_fail (SOUP_IS_SOAP_MESSAGE (msg), NULL);
- priv = msg->priv;
+ priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
return priv->doc;
}
diff --git a/servers/groupwise/soup-soap-message.h b/servers/groupwise/soup-soap-message.h
index 07e09a2..30caf29 100644
--- a/servers/groupwise/soup-soap-message.h
+++ b/servers/groupwise/soup-soap-message.h
@@ -20,12 +20,9 @@ G_BEGIN_DECLS
#define SOUP_IS_SOAP_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SOUP_TYPE_SOAP_MESSAGE))
#define SOUP_SOAP_MESSAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SOUP_TYPE_SOAP_MESSAGE, SoupSoapMessageClass))
-typedef struct _SoupSoapMessagePrivate SoupSoapMessagePrivate;
-
typedef struct {
SoupMessage parent;
- SoupSoapMessagePrivate *priv;
} SoupSoapMessage;
typedef struct {
diff --git a/servers/groupwise/soup-soap-response.c b/servers/groupwise/soup-soap-response.c
index 185d0f6..0bc0d40 100644
--- a/servers/groupwise/soup-soap-response.c
+++ b/servers/groupwise/soup-soap-response.c
@@ -11,7 +11,7 @@
G_DEFINE_TYPE (SoupSoapResponse, soup_soap_response, G_TYPE_OBJECT)
-struct _SoupSoapResponsePrivate {
+typedef struct {
/* the XML document */
xmlDocPtr xmldoc;
xmlNodePtr xml_root;
@@ -19,14 +19,15 @@ struct _SoupSoapResponsePrivate {
xmlNodePtr xml_method;
xmlNodePtr soap_fault;
GList *parameters;
-};
+} SoupSoapResponsePrivate;
+#define SOUP_SOAP_RESPONSE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SOUP_TYPE_SOAP_RESPONSE, SoupSoapResponsePrivate))
static xmlNode *soup_xml_real_node (xmlNode *node);
static void
finalize (GObject *object)
{
- SoupSoapResponsePrivate *priv = SOUP_SOAP_RESPONSE (object)->priv;
+ SoupSoapResponsePrivate *priv = SOUP_SOAP_RESPONSE_GET_PRIVATE (object);
if (priv->xmldoc)
xmlFreeDoc (priv->xmldoc);
@@ -49,8 +50,9 @@ soup_soap_response_class_init (SoupSoapResponseClass *soup_soap_response_class)
static void
soup_soap_response_init (SoupSoapResponse *response)
{
- response->priv = G_TYPE_INSTANCE_GET_PRIVATE (response, SOUP_TYPE_SOAP_RESPONSE, SoupSoapResponsePrivate);
- response->priv->xmldoc = xmlNewDoc ((const xmlChar *)"1.0");
+ SoupSoapResponsePrivate *priv = SOUP_SOAP_RESPONSE_GET_PRIVATE (response);
+
+ priv->xmldoc = xmlNewDoc ((const xmlChar *)"1.0");
}
/**
@@ -133,7 +135,7 @@ soup_soap_response_from_string (SoupSoapResponse *response, const gchar *xmlstr)
xmlNodePtr xml_root, xml_body, xml_method = NULL;
g_return_val_if_fail (SOUP_IS_SOAP_RESPONSE (response), FALSE);
- priv = response->priv;
+ priv = SOUP_SOAP_RESPONSE_GET_PRIVATE (response);
g_return_val_if_fail (xmlstr != NULL, FALSE);
/* clear the previous contents */
@@ -200,7 +202,7 @@ soup_soap_response_get_method_name (SoupSoapResponse *response)
SoupSoapResponsePrivate *priv;
g_return_val_if_fail (SOUP_IS_SOAP_RESPONSE (response), NULL);
- priv = response->priv;
+ priv = SOUP_SOAP_RESPONSE_GET_PRIVATE (response);
g_return_val_if_fail (priv->xml_method != NULL, NULL);
return (const gchar *) priv->xml_method->name;
@@ -219,7 +221,7 @@ soup_soap_response_set_method_name (SoupSoapResponse *response, const gchar *met
SoupSoapResponsePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_RESPONSE (response));
- priv = response->priv;
+ priv = SOUP_SOAP_RESPONSE_GET_PRIVATE (response);
g_return_if_fail (priv->xml_method != NULL);
g_return_if_fail (method_name != NULL);
@@ -429,7 +431,7 @@ soup_soap_response_get_parameters (SoupSoapResponse *response)
SoupSoapResponsePrivate *priv;
g_return_val_if_fail (SOUP_IS_SOAP_RESPONSE (response), NULL);
- priv = response->priv;
+ priv = SOUP_SOAP_RESPONSE_GET_PRIVATE (response);
return (const GList *) priv->parameters;
}
@@ -449,7 +451,7 @@ soup_soap_response_get_first_parameter (SoupSoapResponse *response)
SoupSoapResponsePrivate *priv;
g_return_val_if_fail (SOUP_IS_SOAP_RESPONSE (response), NULL);
- priv = response->priv;
+ priv = SOUP_SOAP_RESPONSE_GET_PRIVATE (response);
return priv->parameters ? priv->parameters->data : NULL;
}
@@ -473,7 +475,7 @@ soup_soap_response_get_first_parameter_by_name (SoupSoapResponse *response,
GList *l;
g_return_val_if_fail (SOUP_IS_SOAP_RESPONSE (response), NULL);
- priv = response->priv;
+ priv = SOUP_SOAP_RESPONSE_GET_PRIVATE (response);
g_return_val_if_fail (name != NULL, NULL);
for (l = priv->parameters; l != NULL; l = l->next) {
@@ -504,7 +506,7 @@ soup_soap_response_get_next_parameter (SoupSoapResponse *response,
GList *l;
g_return_val_if_fail (SOUP_IS_SOAP_RESPONSE (response), NULL);
- priv = response->priv;
+ priv = SOUP_SOAP_RESPONSE_GET_PRIVATE (response);
g_return_val_if_fail (from != NULL, NULL);
l = g_list_find (priv->parameters, (gconstpointer) from);
@@ -566,7 +568,7 @@ soup_soap_response_dump_response (SoupSoapResponse *response, FILE *buffer)
xmlChar *xmlbuff;
gint buffersize, ret;
- SoupSoapResponsePrivate *priv = response->priv;
+ SoupSoapResponsePrivate *priv = SOUP_SOAP_RESPONSE_GET_PRIVATE (response);
xmlDocDumpFormatMemory (priv->xmldoc, &xmlbuff, &buffersize, 1);
ret = fputs ((gchar *) xmlbuff, buffer);
diff --git a/servers/groupwise/soup-soap-response.h b/servers/groupwise/soup-soap-response.h
index a444f5a..8490571 100644
--- a/servers/groupwise/soup-soap-response.h
+++ b/servers/groupwise/soup-soap-response.h
@@ -18,12 +18,9 @@ G_BEGIN_DECLS
#define SOUP_IS_SOAP_RESPONSE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SOUP_TYPE_SOAP_RESPONSE))
#define SOUP_SOAP_RESPONSE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SOUP_TYPE_SOAP_RESPONSE, SoupSoapResponseClass))
-typedef struct _SoupSoapResponsePrivate SoupSoapResponsePrivate;
-
typedef struct {
GObject parent;
- SoupSoapResponsePrivate *priv;
} SoupSoapResponse;
typedef struct {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]