[evolution-data-server] Bug #614480 - Avoid using G_TYPE_INSTANCE_GET_PRIVATE repeatedly
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Bug #614480 - Avoid using G_TYPE_INSTANCE_GET_PRIVATE repeatedly
- Date: Thu, 24 Feb 2011 12:13:24 +0000 (UTC)
commit 5630aa0f4577d389658be4517db13d2f19924db4
Author: Milan Crha <mcrha redhat com>
Date: Thu Feb 24 13:12:09 2011 +0100
Bug #614480 - Avoid using G_TYPE_INSTANCE_GET_PRIVATE repeatedly
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, 603 insertions(+), 1041 deletions(-)
---
diff --git a/addressbook/libebook/e-book-view.c b/addressbook/libebook/e-book-view.c
index 93ce01b..c8e280a 100644
--- a/addressbook/libebook/e-book-view.c
+++ b/addressbook/libebook/e-book-view.c
@@ -30,9 +30,6 @@
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;
@@ -269,13 +266,10 @@ e_book_view_stop (EBookView *book_view)
static void
e_book_view_init (EBookView *book_view)
{
- EBookViewPrivate *priv = E_BOOK_VIEW_GET_PRIVATE (book_view);
-
- priv->gdbus_bookview = NULL;
- priv->book = NULL;
- priv->running = FALSE;
-
- book_view->priv = priv;
+ 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;
}
static void
diff --git a/addressbook/libebook/e-book.c b/addressbook/libebook/e-book.c
index e63cce8..8f26481 100644
--- a/addressbook/libebook/e-book.c
+++ b/addressbook/libebook/e-book.c
@@ -53,7 +53,6 @@ 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,
@@ -249,21 +248,20 @@ e_book_class_init (EBookClass *e_book_class)
static void
e_book_init (EBook *book)
{
- EBookPrivate *priv = E_BOOK_GET_PRIVATE (book);
+ book->priv = G_TYPE_INSTANCE_GET_PRIVATE (book, E_TYPE_BOOK, EBookPrivate);
LOCK_FACTORY ();
active_books++;
UNLOCK_FACTORY ();
- 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;
+ 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;
}
static void
diff --git a/addressbook/libedata-book/e-book-backend-cache.c b/addressbook/libedata-book/e-book-backend-cache.c
index df1a2c6..4d297a3 100644
--- a/addressbook/libedata-book/e-book-backend-cache.c
+++ b/addressbook/libedata-book/e-book-backend-cache.c
@@ -28,10 +28,6 @@
#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;
};
@@ -47,7 +43,7 @@ e_book_backend_cache_class_init (EBookBackendCacheClass *class)
static void
e_book_backend_cache_init (EBookBackendCache *cache)
{
- cache->priv = E_BOOK_BACKEND_CACHE_GET_PRIVATE (cache);
+ cache->priv = G_TYPE_INSTANCE_GET_PRIVATE (cache, E_TYPE_BOOK_BACKEND_CACHE, EBookBackendCachePrivate);
}
/**
diff --git a/addressbook/libedata-book/e-book-backend.c b/addressbook/libedata-book/e-book-backend.c
index 2c0be6a..17a1927 100644
--- a/addressbook/libedata-book/e-book-backend.c
+++ b/addressbook/libedata-book/e-book-backend.c
@@ -14,10 +14,6 @@
#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;
@@ -112,7 +108,7 @@ book_backend_dispose (GObject *object)
{
EBookBackendPrivate *priv;
- priv = E_BOOK_BACKEND_GET_PRIVATE (object);
+ priv = E_BOOK_BACKEND (object)->priv;
if (priv->views != NULL) {
g_object_unref (priv->views);
@@ -133,7 +129,7 @@ book_backend_finalize (GObject *object)
{
EBookBackendPrivate *priv;
- priv = E_BOOK_BACKEND_GET_PRIVATE (object);
+ priv = E_BOOK_BACKEND (object)->priv;
g_list_free (priv->clients);
@@ -183,7 +179,7 @@ e_book_backend_class_init (EBookBackendClass *class)
static void
e_book_backend_init (EBookBackend *backend)
{
- backend->priv = E_BOOK_BACKEND_GET_PRIVATE (backend);
+ backend->priv = G_TYPE_INSTANCE_GET_PRIVATE (backend, E_TYPE_BOOK_BACKEND, EBookBackendPrivate);
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 c5c6998..8308191 100644
--- a/addressbook/libedata-book/e-data-book-factory.c
+++ b/addressbook/libedata-book/e-data-book-factory.c
@@ -65,8 +65,6 @@ 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;
@@ -419,7 +417,7 @@ e_data_book_factory_init (EDataBookFactory *factory)
{
GError *error = NULL;
- factory->priv = E_DATA_BOOK_FACTORY_GET_PRIVATE (factory);
+ factory->priv = G_TYPE_INSTANCE_GET_PRIVATE (factory, E_TYPE_DATA_BOOK_FACTORY, EDataBookFactoryPrivate);
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 3b2a850..061bbbf 100644
--- a/addressbook/libedata-book/e-data-book-view.c
+++ b/addressbook/libedata-book/e-data-book-view.c
@@ -35,7 +35,6 @@ 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 */
@@ -434,7 +433,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 = E_DATA_BOOK_VIEW_GET_PRIVATE (book_view);
+ EDataBookViewPrivate *priv = book_view->priv;
if (!priv->running)
return;
@@ -493,7 +492,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 = E_DATA_BOOK_VIEW_GET_PRIVATE (book_view);
+ EDataBookViewPrivate *priv = book_view->priv;
gchar *gdbus_message = NULL;
if (!priv->running)
@@ -596,7 +595,8 @@ impl_DataBookView_dispose (EGdbusBookView *object, GDBusMethodInvocation *invoca
static void
e_data_book_view_init (EDataBookView *book_view)
{
- EDataBookViewPrivate *priv = E_DATA_BOOK_VIEW_GET_PRIVATE (book_view);
+ EDataBookViewPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (book_view, E_TYPE_DATA_BOOK_VIEW, EDataBookViewPrivate);
+
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 5de656b..bfda9c1 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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
*online = FALSE;
@@ -903,7 +903,7 @@ soup_authenticate (SoupSession *session,
ECalBackendCalDAV *cbdav;
cbdav = E_CAL_BACKEND_CALDAV (data);
- priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
/* 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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
/* FIXME: setup text_uri */
@@ -1079,7 +1079,7 @@ check_calendar_changed_on_server (ECalBackendCalDAV *cbdav)
g_return_val_if_fail (cbdav != NULL, TRUE);
- priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
/* 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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
/* 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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ ECalBackendCalDAVPrivate *priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
g_mutex_lock (priv->busy_lock);
@@ -2185,7 +2185,7 @@ get_usermail (ECalBackend *backend)
}
cbdav = E_CAL_BACKEND_CALDAV (backend);
- priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
/* 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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
g_mutex_lock (priv->busy_lock);
@@ -2545,7 +2545,7 @@ caldav_remove (ECalBackendSync *backend,
gboolean online;
cbdav = E_CAL_BACKEND_CALDAV (backend);
- priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
/* 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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
if (object)
*object = NULL;
@@ -3728,7 +3728,7 @@ extract_timezones (ECalBackendCalDAV *cbdav, icalcomponent *icomp)
return FALSE;
}
- priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav); \
+ priv = cbdav->priv; \
\
/* 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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
return priv->loaded;
}
@@ -4436,7 +4436,7 @@ caldav_get_mode (ECalBackend *backend)
ECalBackendCalDAVPrivate *priv;
cbdav = E_CAL_BACKEND_CALDAV (backend);
- priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
return priv->mode;
}
@@ -4448,7 +4448,7 @@ caldav_set_mode (ECalBackend *backend, CalMode mode)
ECalBackendCalDAVPrivate *priv;
cbdav = E_CAL_BACKEND_CALDAV (backend);
- priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
/*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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
/* 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 = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ priv = cbdav->priv;
g_mutex_free (priv->busy_lock);
g_cond_free (priv->cond);
@@ -4639,45 +4639,43 @@ e_cal_backend_caldav_finalize (GObject *object)
static void
e_cal_backend_caldav_init (ECalBackendCalDAV *cbdav)
{
- ECalBackendCalDAVPrivate *priv;
-
- priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
+ cbdav->priv = G_TYPE_INSTANCE_GET_PRIVATE (cbdav, E_TYPE_CAL_BACKEND_CALDAV, ECalBackendCalDAVPrivate);
- priv->session = soup_session_sync_new ();
- g_object_set (priv->session, SOUP_SESSION_TIMEOUT, 90, NULL);
+ cbdav->priv->session = soup_session_sync_new ();
+ g_object_set (cbdav->priv->session, SOUP_SESSION_TIMEOUT, 90, NULL);
- priv->proxy = e_proxy_new ();
- e_proxy_setup_proxy (priv->proxy);
- g_signal_connect (priv->proxy, "changed", G_CALLBACK (proxy_settings_changed), priv);
+ 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);
if (G_UNLIKELY (caldav_debug_show (DEBUG_MESSAGE)))
- caldav_debug_setup (priv->session);
+ caldav_debug_setup (cbdav->priv->session);
- priv->default_zone = icaltimezone_get_utc_timezone ();
+ cbdav->priv->default_zone = icaltimezone_get_utc_timezone ();
- priv->disposed = FALSE;
- priv->loaded = FALSE;
- priv->opened = FALSE;
+ cbdav->priv->disposed = FALSE;
+ cbdav->priv->loaded = FALSE;
+ cbdav->priv->opened = FALSE;
/* Thinks the 'getctag' extension is available the first time, but unset it when realizes it isn't. */
- priv->ctag_supported = TRUE;
- priv->ctag_to_store = NULL;
+ cbdav->priv->ctag_supported = TRUE;
+ cbdav->priv->ctag_to_store = NULL;
- priv->schedule_outbox_url = NULL;
+ cbdav->priv->schedule_outbox_url = NULL;
- priv->is_google = FALSE;
+ cbdav->priv->is_google = FALSE;
- priv->busy_lock = g_mutex_new ();
- priv->cond = g_cond_new ();
- priv->slave_gone_cond = g_cond_new ();
+ cbdav->priv->busy_lock = g_mutex_new ();
+ cbdav->priv->cond = g_cond_new ();
+ cbdav->priv->slave_gone_cond = g_cond_new ();
/* Slave control ... */
- priv->slave_cmd = SLAVE_SHOULD_SLEEP;
- priv->slave_busy = FALSE;
- priv->refresh_time.tv_usec = 0;
- priv->refresh_time.tv_sec = DEFAULT_REFRESH_TIME;
+ 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;
- g_signal_connect (priv->session, "authenticate",
+ g_signal_connect (cbdav->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 1fc24ba..9289c0f 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;
+ ECalBackendSync backend;
+
+ ECalBackendCalDAVPrivate *priv;
};
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 b3fce4d..960c70f 100644
--- a/calendar/libecal/e-cal-view.c
+++ b/calendar/libecal/e-cal-view.c
@@ -33,7 +33,6 @@
#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 {
@@ -179,7 +178,7 @@ done_cb (EGdbusCalView *gdbus_calview, /* ECalendarStatus */ guint status, const
static void
e_cal_view_init (ECalView *view)
{
- view->priv = E_CAL_VIEW_GET_PRIVATE (view);
+ view->priv = G_TYPE_INSTANCE_GET_PRIVATE (view, E_TYPE_CAL_VIEW, ECalViewPrivate);
}
static void
@@ -189,7 +188,7 @@ e_cal_view_set_property (GObject *object, guint property_id, const GValue *value
ECalViewPrivate *priv;
view = E_CAL_VIEW (object);
- priv = E_CAL_VIEW_GET_PRIVATE (view);
+ priv = view->priv;
switch (property_id) {
case PROP_VIEW:
@@ -219,7 +218,7 @@ e_cal_view_get_property (GObject *object, guint property_id, GValue *value, GPar
ECalViewPrivate *priv;
view = E_CAL_VIEW (object);
- priv = E_CAL_VIEW_GET_PRIVATE (view);
+ priv = view->priv;
switch (property_id) {
case PROP_VIEW:
@@ -415,7 +414,7 @@ e_cal_view_start (ECalView *view)
g_return_if_fail (view != NULL);
g_return_if_fail (E_IS_CAL_VIEW (view));
- priv = E_CAL_VIEW_GET_PRIVATE (view);
+ priv = view->priv;
if (priv->gdbus_calview) {
e_gdbus_cal_view_call_start_sync (priv->gdbus_calview, NULL, &error);
@@ -451,7 +450,7 @@ e_cal_view_stop (ECalView *view)
g_return_if_fail (view != NULL);
g_return_if_fail (E_IS_CAL_VIEW (view));
- priv = E_CAL_VIEW_GET_PRIVATE (view);
+ priv = view->priv;
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 d5e87e4..234e607 100644
--- a/calendar/libecal/e-cal.c
+++ b/calendar/libecal/e-cal.c
@@ -66,7 +66,6 @@ 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
@@ -411,7 +410,7 @@ e_cal_init (ECal *ecal)
active_cals++;
UNLOCK_FACTORY ();
- ecal->priv = priv = E_CAL_GET_PRIVATE (ecal);
+ ecal->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (ecal, E_TYPE_CAL, ECalPrivate);
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 04e9abe..67b82d1 100644
--- a/calendar/libedata-cal/e-cal-backend-cache.c
+++ b/calendar/libedata-cal/e-cal-backend-cache.c
@@ -30,10 +30,6 @@
#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;
};
@@ -45,7 +41,7 @@ e_cal_backend_cache_finalize (GObject *object)
{
ECalBackendCachePrivate *priv;
- priv = E_CAL_BACKEND_CACHE_GET_PRIVATE (object);
+ priv = E_CAL_BACKEND_CACHE (object)->priv;
g_hash_table_destroy (priv->timezones);
@@ -73,7 +69,7 @@ timezones_value_destroy (icaltimezone *zone)
static void
e_cal_backend_cache_init (ECalBackendCache *cache)
{
- cache->priv = E_CAL_BACKEND_CACHE_GET_PRIVATE (cache);
+ cache->priv = G_TYPE_INSTANCE_GET_PRIVATE (cache, E_TYPE_CAL_BACKEND_CACHE, ECalBackendCachePrivate);
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 7a512aa..6d8fe2a 100644
--- a/calendar/libedata-cal/e-cal-backend-file-store.c
+++ b/calendar/libedata-cal/e-cal-backend-file-store.c
@@ -29,10 +29,6 @@
#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;
@@ -111,7 +107,7 @@ put_component (ECalBackendFileStore *fstore, ECalComponent *comp)
g_return_val_if_fail (comp != NULL, FALSE);
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
+ priv = fstore->priv;
e_cal_component_get_uid (comp, &uid);
if (uid == NULL) {
@@ -151,7 +147,7 @@ remove_component (ECalBackendFileStore *fstore, const gchar *uid, const gchar *r
gboolean ret_val = TRUE;
gboolean remove_completely = FALSE;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
+ priv = fstore->priv;
g_static_rw_lock_writer_lock (&priv->lock);
@@ -186,7 +182,7 @@ get_component (ECalBackendFileStore *fstore, const gchar *uid, const gchar *rid)
FullCompObject *obj = NULL;
ECalComponent *comp = NULL;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
+ priv = fstore->priv;
g_static_rw_lock_reader_lock (&priv->lock);
@@ -223,7 +219,7 @@ e_cal_backend_file_store_has_component (ECalBackendStore *store, const gchar *ui
gboolean ret_val = FALSE;
FullCompObject *obj = NULL;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
+ priv = fstore->priv;
g_static_rw_lock_reader_lock (&priv->lock);
@@ -252,7 +248,7 @@ e_cal_backend_file_store_put_component (ECalBackendStore *store, ECalComponent *
ECalBackendFileStorePrivate *priv;
gboolean ret_val = FALSE;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
+ priv = fstore->priv;
ret_val = put_component (fstore, comp);
@@ -273,7 +269,7 @@ e_cal_backend_file_store_remove_component (ECalBackendStore *store, const gchar
ECalBackendFileStorePrivate *priv;
gboolean ret_val = FALSE;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
+ priv = fstore->priv;
ret_val = remove_component (fstore, uid, rid);
@@ -294,7 +290,7 @@ e_cal_backend_file_store_get_timezone (ECalBackendStore *store, const gchar *tzi
ECalBackendFileStorePrivate *priv;
const icaltimezone *zone = NULL;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
+ priv = fstore->priv;
g_static_rw_lock_reader_lock (&priv->lock);
zone = g_hash_table_lookup (priv->timezones, tzid);
@@ -311,7 +307,7 @@ e_cal_backend_file_store_put_timezone (ECalBackendStore *store, const icaltimezo
gboolean ret_val = FALSE;
icaltimezone *copy;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
+ priv = fstore->priv;
g_static_rw_lock_writer_lock (&priv->lock);
copy = copy_timezone ((icaltimezone *) zone);
@@ -335,7 +331,7 @@ e_cal_backend_file_store_remove_timezone (ECalBackendStore *store, const gchar *
ECalBackendFileStorePrivate *priv;
gboolean ret_val = FALSE;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
+ priv = fstore->priv;
g_static_rw_lock_writer_lock (&priv->lock);
ret_val = g_hash_table_remove (priv->timezones, tzid);
@@ -358,7 +354,7 @@ e_cal_backend_file_store_get_key_value (ECalBackendStore *store, const gchar *ke
ECalBackendFileStorePrivate *priv;
const gchar *value;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
+ priv = fstore->priv;
g_static_rw_lock_reader_lock (&priv->lock);
value = e_file_cache_get_object (priv->keys_cache, key);
@@ -374,7 +370,7 @@ e_cal_backend_file_store_put_key_value (ECalBackendStore *store, const gchar *ke
ECalBackendFileStorePrivate *priv;
gboolean ret_val = FALSE;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
+ priv = fstore->priv;
g_static_rw_lock_writer_lock (&priv->lock);
@@ -400,7 +396,7 @@ e_cal_backend_file_store_get_default_timezone (ECalBackendStore *store)
const gchar *tzid;
const icaltimezone *zone = NULL;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
+ priv = fstore->priv;
g_static_rw_lock_reader_lock (&priv->lock);
@@ -422,7 +418,7 @@ e_cal_backend_file_store_set_default_timezone (ECalBackendStore *store, const ic
icaltimezone *copy;
const gchar *key = "default-zone";
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
+ priv = fstore->priv;
g_static_rw_lock_writer_lock (&priv->lock);
@@ -446,7 +442,7 @@ e_cal_backend_file_store_thaw_changes (ECalBackendStore *store)
ECalBackendFileStore *fstore = E_CAL_BACKEND_FILE_STORE (store);
ECalBackendFileStorePrivate *priv;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
+ priv = fstore->priv;
priv->freeze_changes = FALSE;
@@ -462,7 +458,7 @@ e_cal_backend_file_store_freeze_changes (ECalBackendStore *store)
ECalBackendFileStore *fstore = E_CAL_BACKEND_FILE_STORE (store);
ECalBackendFileStorePrivate *priv;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
+ priv = fstore->priv;
priv->freeze_changes = TRUE;
e_file_cache_freeze_changes (priv->keys_cache);
@@ -486,7 +482,7 @@ e_cal_backend_file_store_get_components_by_uid (ECalBackendStore *store, const g
FullCompObject *obj = NULL;
GSList *comps = NULL;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
+ priv = fstore->priv;
g_static_rw_lock_reader_lock (&priv->lock);
@@ -528,7 +524,7 @@ e_cal_backend_file_store_get_components (ECalBackendStore *store)
ECalBackendFileStorePrivate *priv;
GSList *comps = NULL;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
+ priv = fstore->priv;
g_static_rw_lock_reader_lock (&priv->lock);
g_hash_table_foreach (priv->comp_uid_hash, (GHFunc) add_full_comp_to_slist, &comps);
@@ -570,7 +566,7 @@ e_cal_backend_file_store_get_component_ids (ECalBackendStore *store)
ECalBackendFileStorePrivate *priv;
GSList *comp_ids = NULL;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
+ priv = fstore->priv;
g_static_rw_lock_reader_lock (&priv->lock);
g_hash_table_foreach (priv->comp_uid_hash, (GHFunc) add_comp_ids_to_slist, &comp_ids);
@@ -587,7 +583,7 @@ add_timezone (ECalBackendFileStore *fstore, icalcomponent *vtzcomp)
icaltimezone *zone;
const gchar *tzid;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
+ priv = fstore->priv;
prop = icalcomponent_get_first_property (vtzcomp, ICAL_TZID_PROPERTY);
if (!prop)
@@ -691,7 +687,7 @@ e_cal_backend_file_store_load (ECalBackendStore *store)
ECalBackendFileStorePrivate *priv;
icalcomponent *icalcomp;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
+ priv = fstore->priv;
if (!priv->cache_file_name || !priv->key_file_name)
return FALSE;
@@ -721,7 +717,7 @@ e_cal_backend_file_store_remove (ECalBackendStore *store)
ECalBackendFileStore *fstore = E_CAL_BACKEND_FILE_STORE (store);
ECalBackendFileStorePrivate *priv;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
+ priv = fstore->priv;
/* This will remove all the contents in the directory */
e_file_cache_remove (priv->keys_cache);
@@ -741,7 +737,7 @@ e_cal_backend_file_store_clean (ECalBackendStore *store)
ECalBackendFileStore *fstore = E_CAL_BACKEND_FILE_STORE (store);
ECalBackendFileStorePrivate *priv;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (store);
+ priv = fstore->priv;
g_static_rw_lock_writer_lock (&priv->lock);
@@ -799,7 +795,7 @@ timeout_save_cache (gpointer user_data)
gsize len, nwrote;
FILE *f;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
+ priv = fstore->priv;
g_static_rw_lock_reader_lock (&priv->lock);
@@ -836,7 +832,7 @@ save_cache (ECalBackendFileStore *store)
{
ECalBackendFileStorePrivate *priv;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (store);
+ priv = store->priv;
if (priv->save_timeout_id) {
g_source_remove (priv->save_timeout_id);
@@ -859,7 +855,7 @@ cal_backend_file_store_finalize (GObject *object)
ECalBackendFileStore *fstore = (ECalBackendFileStore *) object;
ECalBackendFileStorePrivate *priv;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (fstore);
+ priv = fstore->priv;
if (priv->save_timeout_id) {
g_source_remove (priv->save_timeout_id);
@@ -906,7 +902,7 @@ cal_backend_file_store_constructed (GObject *object)
ECalBackendFileStorePrivate *priv;
const gchar *path;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (object);
+ priv = E_CAL_BACKEND_FILE_STORE (object)->priv;
path = e_cal_backend_store_get_path (E_CAL_BACKEND_STORE (object));
priv->cache_file_name = g_build_filename (path, CACHE_FILE_NAME, NULL);
@@ -952,7 +948,7 @@ e_cal_backend_file_store_init (ECalBackendFileStore *store)
{
ECalBackendFileStorePrivate *priv;
- priv = E_CAL_BACKEND_FILE_STORE_GET_PRIVATE (store);
+ priv = G_TYPE_INSTANCE_GET_PRIVATE (store, E_TYPE_CAL_BACKEND_FILE_STORE, ECalBackendFileStorePrivate);
store->priv = priv;
diff --git a/calendar/libedata-cal/e-cal-backend-intervaltree.c b/calendar/libedata-cal/e-cal-backend-intervaltree.c
index 172a977..7cfe417 100644
--- a/calendar/libedata-cal/e-cal-backend-intervaltree.c
+++ b/calendar/libedata-cal/e-cal-backend-intervaltree.c
@@ -39,10 +39,6 @@
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*
@@ -744,7 +740,7 @@ e_intervaltree_remove (EIntervalTree *tree,
static void
e_intervaltree_finalize (GObject *object)
{
- EIntervalTreePrivate *priv = E_INTERVALTREE_GET_PRIVATE (object);
+ EIntervalTreePrivate *priv = E_INTERVALTREE (object)->priv;
if (priv->root) {
g_free (priv->root);
@@ -780,7 +776,7 @@ e_intervaltree_init (EIntervalTree *tree)
EIntervalTreePrivate *priv;
EIntervalNode *root, *nil;
- tree->priv = E_INTERVALTREE_GET_PRIVATE (tree);
+ tree->priv = G_TYPE_INSTANCE_GET_PRIVATE (tree, E_TYPE_INTERVALTREE, EIntervalTreePrivate);
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 f0a8fbe..129a3c7 100644
--- a/calendar/libedata-cal/e-cal-backend-store.c
+++ b/calendar/libedata-cal/e-cal-backend-store.c
@@ -23,10 +23,6 @@
#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;
@@ -89,7 +85,7 @@ cal_backend_store_finalize (GObject *object)
{
ECalBackendStorePrivate *priv;
- priv = E_CAL_BACKEND_STORE_GET_PRIVATE (object);
+ priv = E_CAL_BACKEND_STORE (object)->priv;
g_free (priv->path);
if (priv->intervaltree) {
@@ -128,10 +124,8 @@ e_cal_backend_store_class_init (ECalBackendStoreClass *class)
static void
e_cal_backend_store_init (ECalBackendStore *store)
{
- ECalBackendStorePrivate *priv;
- priv = E_CAL_BACKEND_STORE_GET_PRIVATE (store);
- store->priv = priv;
- priv->intervaltree = e_intervaltree_new ();
+ store->priv = G_TYPE_INSTANCE_GET_PRIVATE (store, E_TYPE_CAL_BACKEND_STORE, ECalBackendStorePrivate);
+ store->priv->intervaltree = e_intervaltree_new ();
}
/**
@@ -159,7 +153,7 @@ e_cal_backend_store_load (ECalBackendStore *store)
g_return_val_if_fail (E_IS_CAL_BACKEND_STORE (store), FALSE);
- priv = E_CAL_BACKEND_STORE_GET_PRIVATE (store);
+ priv = store->priv;
if (priv->loaded)
return TRUE;
@@ -178,9 +172,10 @@ gboolean
e_cal_backend_store_remove (ECalBackendStore *store)
{
ECalBackendStorePrivate *priv;
+
g_return_val_if_fail (E_IS_CAL_BACKEND_STORE (store), FALSE);
- priv = E_CAL_BACKEND_STORE_GET_PRIVATE (store);
+ priv = store->priv;
/* remove interval tree */
e_intervaltree_destroy (priv->intervaltree);
priv->intervaltree = NULL;
@@ -197,9 +192,10 @@ gboolean
e_cal_backend_store_clean (ECalBackendStore *store)
{
ECalBackendStorePrivate *priv;
+
g_return_val_if_fail (E_IS_CAL_BACKEND_STORE (store), FALSE);
- priv = E_CAL_BACKEND_STORE_GET_PRIVATE (store);
+ priv = store->priv;
if (priv->intervaltree) {
e_intervaltree_destroy (priv->intervaltree);
@@ -246,10 +242,11 @@ 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 = E_CAL_BACKEND_STORE_GET_PRIVATE (store);
+ priv = store->priv;
if ((E_CAL_BACKEND_STORE_GET_CLASS (store))->put_component (store, comp)) {
if (e_intervaltree_insert (priv->intervaltree, occurence_start, occurence_end, comp))
@@ -282,10 +279,11 @@ 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 = E_CAL_BACKEND_STORE_GET_PRIVATE (store);
+ priv = store->priv;
if ((E_CAL_BACKEND_STORE_GET_CLASS (store))->remove_component (store, uid, rid)) {
if (e_intervaltree_remove (priv->intervaltree, uid, rid))
@@ -414,7 +412,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 = E_CAL_BACKEND_STORE_GET_PRIVATE (store);
+ priv = store->priv;
if (!(objects = e_intervaltree_search (priv->intervaltree, start, end)))
return NULL;
@@ -515,10 +513,11 @@ 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 = E_CAL_BACKEND_STORE_GET_PRIVATE (store);
+ priv = store->priv;
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 bff4e62..acd3f8c 100644
--- a/calendar/libedata-cal/e-cal-backend.c
+++ b/calendar/libedata-cal/e-cal-backend.c
@@ -31,10 +31,6 @@
#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))
@@ -264,7 +260,7 @@ cal_backend_finalize (GObject *object)
{
ECalBackendPrivate *priv;
- priv = E_CAL_BACKEND_GET_PRIVATE (object);
+ priv = E_CAL_BACKEND (object)->priv;
g_assert (priv->clients == NULL);
@@ -362,7 +358,7 @@ e_cal_backend_class_init (ECalBackendClass *class)
static void
e_cal_backend_init (ECalBackend *backend)
{
- backend->priv = E_CAL_BACKEND_GET_PRIVATE (backend);
+ backend->priv = G_TYPE_INSTANCE_GET_PRIVATE (backend, E_TYPE_CAL_BACKEND, ECalBackendPrivate);
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 a242c85..9013035 100644
--- a/calendar/libedata-cal/e-data-cal-factory.c
+++ b/calendar/libedata-cal/e-data-cal-factory.c
@@ -78,8 +78,6 @@ 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;
@@ -530,7 +528,7 @@ e_data_cal_factory_init (EDataCalFactory *factory)
{
GError *error = NULL;
- factory->priv = E_DATA_CAL_FACTORY_GET_PRIVATE (factory);
+ factory->priv = G_TYPE_INSTANCE_GET_PRIVATE (factory, E_TYPE_DATA_CAL_FACTORY, EDataCalFactoryPrivate);
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 a8cb142..18d7a24 100644
--- a/calendar/libedata-cal/e-data-cal-view.c
+++ b/calendar/libedata-cal/e-data-cal-view.c
@@ -64,7 +64,6 @@ 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);
@@ -391,7 +390,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 = E_DATA_CAL_VIEW_GET_PRIVATE (query);
+ EDataCalViewPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (query, E_DATA_CAL_VIEW_TYPE, EDataCalViewPrivate);
query->priv = priv;
diff --git a/calendar/libedata-cal/e-data-cal.c b/calendar/libedata-cal/e-data-cal.c
index 0a80e0b..0b48753 100644
--- a/calendar/libedata-cal/e-data-cal.c
+++ b/calendar/libedata-cal/e-data-cal.c
@@ -39,8 +39,6 @@
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)
@@ -1209,7 +1207,7 @@ e_data_cal_init (EDataCal *ecal)
{
EGdbusCal *gdbus_object;
- ecal->priv = E_DATA_CAL_GET_PRIVATE (ecal);
+ ecal->priv = G_TYPE_INSTANCE_GET_PRIVATE (ecal, E_TYPE_DATA_CAL, EDataCalPrivate);
ecal->priv->gdbus_object = e_gdbus_cal_stub_new ();
diff --git a/camel/camel-certdb.c b/camel/camel-certdb.c
index 4608e70..f2845d2 100644
--- a/camel/camel-certdb.c
+++ b/camel/camel-certdb.c
@@ -42,10 +42,6 @@
#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 */
@@ -71,7 +67,7 @@ certdb_finalize (GObject *object)
CamelCertDB *certdb = CAMEL_CERTDB (object);
CamelCertDBPrivate *priv;
- priv = CAMEL_CERTDB_GET_PRIVATE (object);
+ priv = certdb->priv;
if (certdb->flags & CAMEL_CERTDB_DIRTY)
camel_certdb_save (certdb);
@@ -118,8 +114,7 @@ camel_certdb_class_init (CamelCertDBClass *class)
static void
camel_certdb_init (CamelCertDB *certdb)
{
- certdb->priv = CAMEL_CERTDB_GET_PRIVATE (certdb);
-
+ certdb->priv = G_TYPE_INSTANCE_GET_PRIVATE (certdb, CAMEL_TYPE_CERTDB, CamelCertDBPrivate);
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 3aef8b1..2fc0a33 100644
--- a/camel/camel-cipher-context.c
+++ b/camel/camel-cipher-context.c
@@ -46,10 +46,6 @@
#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 {
@@ -152,7 +148,7 @@ cipher_context_dispose (GObject *object)
{
CamelCipherContextPrivate *priv;
- priv = CAMEL_CIPHER_CONTEXT_GET_PRIVATE (object);
+ priv = CAMEL_CIPHER_CONTEXT (object)->priv;
if (priv->session != NULL) {
g_object_unref (priv->session);
@@ -168,7 +164,7 @@ cipher_context_finalize (GObject *object)
{
CamelCipherContextPrivate *priv;
- priv = CAMEL_CIPHER_CONTEXT_GET_PRIVATE (object);
+ priv = CAMEL_CIPHER_CONTEXT (object)->priv;
g_mutex_free (priv->lock);
@@ -765,7 +761,7 @@ camel_cipher_context_class_init (CamelCipherContextClass *class)
static void
camel_cipher_context_init (CamelCipherContext *context)
{
- context->priv = CAMEL_CIPHER_CONTEXT_GET_PRIVATE (context);
+ context->priv = G_TYPE_INSTANCE_GET_PRIVATE (context, CAMEL_TYPE_CIPHER_CONTEXT, CamelCipherContextPrivate);
context->priv->lock = g_mutex_new ();
}
diff --git a/camel/camel-data-cache.c b/camel/camel-data-cache.c
index ed663d9..9e8b051 100644
--- a/camel/camel-data-cache.c
+++ b/camel/camel-data-cache.c
@@ -49,10 +49,6 @@
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;
@@ -110,7 +106,7 @@ data_cache_finalize (GObject *object)
{
CamelDataCachePrivate *priv;
- priv = CAMEL_DATA_CACHE_GET_PRIVATE (object);
+ priv = CAMEL_DATA_CACHE (object)->priv;
camel_object_bag_destroy (priv->busy_bag);
g_free (priv->path);
@@ -153,7 +149,7 @@ camel_data_cache_init (CamelDataCache *data_cache)
(CamelCopyFunc) g_strdup,
(GFreeFunc) g_free);
- data_cache->priv = CAMEL_DATA_CACHE_GET_PRIVATE (data_cache);
+ data_cache->priv = G_TYPE_INSTANCE_GET_PRIVATE (data_cache, CAMEL_TYPE_DATA_CACHE, CamelDataCachePrivate);
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 bdb485a..b775ea6 100644
--- a/camel/camel-data-wrapper.c
+++ b/camel/camel-data-wrapper.c
@@ -36,10 +36,6 @@
#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 {
@@ -475,7 +471,7 @@ camel_data_wrapper_class_init (CamelDataWrapperClass *class)
static void
camel_data_wrapper_init (CamelDataWrapper *data_wrapper)
{
- data_wrapper->priv = CAMEL_DATA_WRAPPER_GET_PRIVATE (data_wrapper);
+ data_wrapper->priv = G_TYPE_INSTANCE_GET_PRIVATE (data_wrapper, CAMEL_TYPE_DATA_WRAPPER, CamelDataWrapperPrivate);
g_static_mutex_init (&data_wrapper->priv->stream_lock);
diff --git a/camel/camel-disco-folder.c b/camel/camel-disco-folder.c
index 9283010..54bbaf6 100644
--- a/camel/camel-disco-folder.c
+++ b/camel/camel-disco-folder.c
@@ -32,10 +32,6 @@
#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;
};
@@ -474,7 +470,7 @@ camel_disco_folder_class_init (CamelDiscoFolderClass *class)
static void
camel_disco_folder_init (CamelDiscoFolder *disco_folder)
{
- disco_folder->priv = CAMEL_DISCO_FOLDER_GET_PRIVATE (disco_folder);
+ disco_folder->priv = G_TYPE_INSTANCE_GET_PRIVATE (disco_folder, CAMEL_TYPE_DISCO_FOLDER, CamelDiscoFolderPrivate);
g_signal_connect (
disco_folder, "changed",
diff --git a/camel/camel-filter-driver.c b/camel/camel-filter-driver.c
index 2c876cd..0d5d9d6 100644
--- a/camel/camel-filter-driver.c
+++ b/camel/camel-filter-driver.c
@@ -56,10 +56,6 @@
/* 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,
@@ -188,7 +184,7 @@ filter_driver_dispose (GObject *object)
{
CamelFilterDriverPrivate *priv;
- priv = CAMEL_FILTER_DRIVER_GET_PRIVATE (object);
+ priv = CAMEL_FILTER_DRIVER (object)->priv;
if (priv->defaultfolder != NULL) {
camel_folder_thaw (priv->defaultfolder);
@@ -211,7 +207,7 @@ filter_driver_finalize (GObject *object)
CamelFilterDriverPrivate *priv;
struct _filter_rule *node;
- priv = CAMEL_FILTER_DRIVER_GET_PRIVATE (object);
+ priv = CAMEL_FILTER_DRIVER (object)->priv;
/* close all folders that were opened for appending */
close_folders (CAMEL_FILTER_DRIVER (object));
@@ -253,7 +249,7 @@ camel_filter_driver_init (CamelFilterDriver *filter_driver)
{
gint ii;
- filter_driver->priv = CAMEL_FILTER_DRIVER_GET_PRIVATE (filter_driver);
+ filter_driver->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter_driver, CAMEL_TYPE_FILTER_DRIVER, CamelFilterDriverPrivate);
camel_dlist_init (&filter_driver->priv->rules);
@@ -303,94 +299,78 @@ camel_filter_driver_new (CamelSession *session)
void
camel_filter_driver_set_folder_func (CamelFilterDriver *d, CamelFilterGetFolderFunc get_folder, gpointer data)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (d);
-
- p->get_folder = get_folder;
- p->data = data;
+ d->priv->get_folder = get_folder;
+ d->priv->data = data;
}
void
camel_filter_driver_set_logfile (CamelFilterDriver *d, FILE *logfile)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (d);
-
- p->logfile = logfile;
+ d->priv->logfile = logfile;
}
void
camel_filter_driver_set_status_func (CamelFilterDriver *d, CamelFilterStatusFunc *func, gpointer data)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (d);
-
- p->statusfunc = func;
- p->statusdata = data;
+ d->priv->statusfunc = func;
+ d->priv->statusdata = data;
}
void
camel_filter_driver_set_shell_func (CamelFilterDriver *d, CamelFilterShellFunc *func, gpointer data)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (d);
-
- p->shellfunc = func;
- p->shelldata = data;
+ d->priv->shellfunc = func;
+ d->priv->shelldata = data;
}
void
camel_filter_driver_set_play_sound_func (CamelFilterDriver *d, CamelFilterPlaySoundFunc *func, gpointer data)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (d);
-
- p->playfunc = func;
- p->playdata = data;
+ d->priv->playfunc = func;
+ d->priv->playdata = data;
}
void
camel_filter_driver_set_system_beep_func (CamelFilterDriver *d, CamelFilterSystemBeepFunc *func, gpointer data)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (d);
-
- p->beep = func;
- p->beepdata = data;
+ d->priv->beep = func;
+ d->priv->beepdata = data;
}
void
camel_filter_driver_set_default_folder (CamelFilterDriver *d, CamelFolder *def)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (d);
-
- if (p->defaultfolder) {
- camel_folder_thaw (p->defaultfolder);
- g_object_unref (p->defaultfolder);
+ if (d->priv->defaultfolder) {
+ camel_folder_thaw (d->priv->defaultfolder);
+ g_object_unref (d->priv->defaultfolder);
}
- p->defaultfolder = def;
+ d->priv->defaultfolder = def;
- if (p->defaultfolder) {
- camel_folder_freeze (p->defaultfolder);
- g_object_ref (p->defaultfolder);
+ if (d->priv->defaultfolder) {
+ camel_folder_freeze (d->priv->defaultfolder);
+ g_object_ref (d->priv->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 (&p->rules, (CamelDListNode *)node);
+ camel_dlist_addtail (&d->priv->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 *) p->rules.head;
+ node = (struct _filter_rule *) d->priv->rules.head;
while (node->next) {
if (!strcmp (node->name, name)) {
camel_dlist_remove ((CamelDListNode *) node);
@@ -412,14 +392,13 @@ 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 (p->statusfunc) {
+ if (driver->priv->statusfunc) {
va_start (ap, desc);
str = g_strdup_vprintf (desc, ap);
- p->statusfunc (driver, status, pc, str, p->statusdata);
+ driver->priv->statusfunc (driver, status, pc, str, driver->priv->statusdata);
g_free (str);
}
}
@@ -428,14 +407,13 @@ 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 (p->globals, name, (gpointer)&oldkey, (gpointer)&oldvalue)) {
+ if (g_hash_table_lookup_extended (d->priv->globals, name, (gpointer)&oldkey, (gpointer)&oldvalue)) {
g_free (oldvalue);
- g_hash_table_insert (p->globals, oldkey, g_strdup (value));
+ g_hash_table_insert (d->priv->globals, oldkey, g_strdup (value));
} else {
- g_hash_table_insert (p->globals, g_strdup (name), g_strdup (value));
+ g_hash_table_insert (d->priv->globals, g_strdup (name), g_strdup (value));
}
}
#endif
@@ -443,10 +421,8 @@ 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"));
- p->deleted = TRUE;
+ driver->priv->deleted = TRUE;
camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Delete");
return NULL;
@@ -455,7 +431,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)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+ CamelFilterDriverPrivate *p = driver->priv;
d(fprintf (stderr, "marking message for forwarding\n"));
@@ -481,7 +457,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)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+ CamelFilterDriverPrivate *p = driver->priv;
gint i;
d(fprintf (stderr, "copying message...\n"));
@@ -538,7 +514,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)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+ CamelFilterDriverPrivate *p = driver->priv;
gint i;
d(fprintf (stderr, "moving message...\n"));
@@ -617,7 +593,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)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+ CamelFilterDriverPrivate *p = driver->priv;
camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Stopped processing");
d(fprintf (stderr, "terminating message processing\n"));
@@ -629,7 +605,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)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+ CamelFilterDriverPrivate *p = driver->priv;
d(fprintf (stderr, "setting label tag\n"));
if (argc > 0 && argv[0]->type == ESEXP_RES_STRING) {
@@ -661,7 +637,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)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+ CamelFilterDriverPrivate *p = driver->priv;
d(fprintf (stderr, "setting color tag\n"));
if (argc > 0 && argv[0]->type == ESEXP_RES_STRING) {
@@ -678,7 +654,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)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+ CamelFilterDriverPrivate *p = driver->priv;
d(fprintf (stderr, "setting score tag\n"));
if (argc > 0 && argv[0]->type == ESEXP_RES_INT) {
@@ -696,7 +672,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)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+ CamelFilterDriverPrivate *p = driver->priv;
d(fprintf (stderr, "adjusting score tag\n"));
if (argc > 0 && argv[0]->type == ESEXP_RES_INT) {
@@ -717,7 +693,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)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+ CamelFilterDriverPrivate *p = driver->priv;
guint32 flags;
d(fprintf (stderr, "setting flag\n"));
@@ -739,7 +715,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)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+ CamelFilterDriverPrivate *p = driver->priv;
guint32 flags;
d(fprintf (stderr, "unsetting flag\n"));
@@ -790,7 +766,7 @@ child_watch (GPid pid,
static gint
pipe_to_system (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+ CamelFilterDriverPrivate *p = driver->priv;
gint i, pipe_to_child, pipe_from_child;
CamelMimeMessage *message = NULL;
CamelMimeParser *parser;
@@ -938,7 +914,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)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+ CamelFilterDriverPrivate *p = driver->priv;
GString *command;
GPtrArray *args;
gint i;
@@ -979,7 +955,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)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+ CamelFilterDriverPrivate *p = driver->priv;
d(fprintf (stderr, "beep\n"));
@@ -994,7 +970,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)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+ CamelFilterDriverPrivate *p = driver->priv;
d(fprintf (stderr, "play sound\n"));
@@ -1009,7 +985,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)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+ CamelFilterDriverPrivate *p = driver->priv;
d(fprintf (stderr, "only once\n"));
@@ -1023,7 +999,7 @@ do_only_once (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFilt
static CamelFolder *
open_folder (CamelFilterDriver *driver, const gchar *folder_url)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+ CamelFilterDriverPrivate *p = driver->priv;
CamelFolder *camelfolder;
/* we have a lookup table of currently open folders */
@@ -1056,7 +1032,7 @@ close_folder (gpointer key, gpointer value, gpointer data)
{
CamelFolder *folder = value;
CamelFilterDriver *driver = data;
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+ CamelFilterDriverPrivate *p = driver->priv;
p->closed++;
g_free (key);
@@ -1077,7 +1053,7 @@ close_folder (gpointer key, gpointer value, gpointer data)
static gint
close_folders (CamelFilterDriver *driver)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+ CamelFilterDriverPrivate *p = driver->priv;
report_status(driver, CAMEL_FILTER_STATUS_PROGRESS, 0, _("Syncing folders"));
@@ -1101,7 +1077,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, ...)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+ CamelFilterDriverPrivate *p = driver->priv;
if (p->logfile) {
gchar *str = NULL;
@@ -1156,7 +1132,7 @@ struct _run_only_once {
static gboolean
run_only_once (gpointer key, gchar *action, struct _run_only_once *data)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (data->driver);
+ CamelFilterDriverPrivate *p = data->driver->priv;
ESExpResult *r;
d(printf ("evaluating: %s\n\n", action));
@@ -1204,7 +1180,7 @@ void
camel_filter_driver_flush (CamelFilterDriver *driver,
GError **error)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+ CamelFilterDriverPrivate *p = driver->priv;
struct _run_only_once data;
if (!p->only_once)
@@ -1261,7 +1237,7 @@ camel_filter_driver_filter_mbox (CamelFilterDriver *driver,
GCancellable *cancellable,
GError **error)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+ CamelFilterDriverPrivate *p = driver->priv;
CamelMimeParser *mp = NULL;
gchar *source_url = NULL;
gint fd = -1;
@@ -1393,7 +1369,7 @@ camel_filter_driver_filter_folder (CamelFilterDriver *driver,
GCancellable *cancellable,
GError **error)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+ CamelFilterDriverPrivate *p = driver->priv;
gboolean freeuids = FALSE;
CamelMessageInfo *info;
gchar *source_url, *service_url;
@@ -1536,7 +1512,7 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver,
GCancellable *cancellable,
GError **error)
{
- struct _CamelFilterDriverPrivate *p = CAMEL_FILTER_DRIVER_GET_PRIVATE (driver);
+ CamelFilterDriverPrivate *p = driver->priv;
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 c8a6f4e..4c62050 100644
--- a/camel/camel-folder-search.c
+++ b/camel/camel-folder-search.c
@@ -57,10 +57,6 @@
#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;
@@ -161,7 +157,7 @@ camel_folder_search_class_init (CamelFolderSearchClass *class)
static void
camel_folder_search_init (CamelFolderSearch *search)
{
- search->priv = CAMEL_FOLDER_SEARCH_GET_PRIVATE (search);
+ search->priv = G_TYPE_INSTANCE_GET_PRIVATE (search, CAMEL_TYPE_FOLDER_SEARCH, CamelFolderSearchPrivate);
search->sexp = e_sexp_new ();
}
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index a6ac654..5aaccc3 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -59,10 +59,6 @@
#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
@@ -157,7 +153,7 @@ folder_summary_dispose (GObject *object)
{
CamelFolderSummaryPrivate *priv;
- priv = CAMEL_FOLDER_SUMMARY_GET_PRIVATE (object);
+ priv = CAMEL_FOLDER_SUMMARY (object)->priv;
if (priv->filter_index != NULL) {
g_object_unref (priv->filter_index);
@@ -915,7 +911,7 @@ camel_folder_summary_class_init (CamelFolderSummaryClass *class)
static void
camel_folder_summary_init (CamelFolderSummary *summary)
{
- summary->priv = CAMEL_FOLDER_SUMMARY_GET_PRIVATE (summary);
+ summary->priv = G_TYPE_INSTANCE_GET_PRIVATE (summary, CAMEL_TYPE_FOLDER_SUMMARY, CamelFolderSummaryPrivate);
summary->priv->filter_charset = g_hash_table_new (
camel_strcase_hash, camel_strcase_equal);
@@ -1005,7 +1001,7 @@ camel_folder_summary_set_filename (CamelFolderSummary *s, const gchar *name)
void
camel_folder_summary_set_index (CamelFolderSummary *s, CamelIndex *index)
{
- struct _CamelFolderSummaryPrivate *p = CAMEL_FOLDER_SUMMARY_GET_PRIVATE (s);
+ struct _CamelFolderSummaryPrivate *p = s->priv;
if (p->index)
g_object_unref (p->index);
@@ -1730,7 +1726,7 @@ cfs_reload_from_db (CamelFolderSummary *s, GError **error)
cfs_schedule_info_release_timer (s);
- if (CAMEL_FOLDER_SUMMARY_GET_PRIVATE (s)->need_preview) {
+ if (s->priv->need_preview) {
struct _preview_update_msg *m;
m = camel_session_thread_msg_new (((CamelService *)parent_store)->session, &preview_update_ops, sizeof (*m));
@@ -1751,7 +1747,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 (CAMEL_FOLDER_SUMMARY_GET_PRIVATE (s)->preview_updates, (gchar *)info->uid, ((CamelMessageInfoBase *)info)->preview);
+ g_hash_table_insert (s->priv->preview_updates, (gchar *)info->uid, ((CamelMessageInfoBase *)info)->preview);
camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
}
@@ -2219,11 +2215,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 (CAMEL_FOLDER_SUMMARY_GET_PRIVATE (s)->need_preview && g_hash_table_size (CAMEL_FOLDER_SUMMARY_GET_PRIVATE (s)->preview_updates)) {
+ if (s->priv->need_preview && g_hash_table_size (s->priv->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 (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);
+ g_hash_table_foreach (s->priv->preview_updates, (GHFunc)msg_save_preview, s->folder);
+ g_hash_table_remove_all (s->priv->preview_updates);
camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
camel_db_end_transaction (parent_store->cdb_w, NULL);
}
@@ -2661,7 +2657,7 @@ camel_folder_summary_info_new_from_parser (CamelFolderSummary *s, CamelMimeParse
CamelMessageInfo *info = NULL;
gchar *buffer;
gsize len;
- struct _CamelFolderSummaryPrivate *p = CAMEL_FOLDER_SUMMARY_GET_PRIVATE (s);
+ CamelFolderSummaryPrivate *p = s->priv;
goffset start;
CamelIndexName *name = NULL;
@@ -2720,7 +2716,7 @@ CamelMessageInfo *
camel_folder_summary_info_new_from_message (CamelFolderSummary *s, CamelMimeMessage *msg, const gchar *bodystructure)
{
CamelMessageInfo *info;
- struct _CamelFolderSummaryPrivate *p = CAMEL_FOLDER_SUMMARY_GET_PRIVATE (s);
+ CamelFolderSummaryPrivate *p = s->priv;
CamelIndexName *name = NULL;
info = CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->message_info_new_from_message (s, msg, bodystructure);
@@ -3810,7 +3806,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;
- struct _CamelFolderSummaryPrivate *p = CAMEL_FOLDER_SUMMARY_GET_PRIVATE (s);
+ CamelFolderSummaryPrivate *p = s->priv;
CamelMimeFilter *mfc;
CamelMessageContentInfo *part;
const gchar *calendar_header;
@@ -3972,7 +3968,7 @@ summary_build_content_info_message (CamelFolderSummary *s, CamelMessageInfo *msg
{
CamelDataWrapper *containee;
gint parts, i;
- struct _CamelFolderSummaryPrivate *p = CAMEL_FOLDER_SUMMARY_GET_PRIVATE (s);
+ CamelFolderSummaryPrivate *p = s->priv;
CamelMessageContentInfo *info = NULL, *child;
CamelContentType *ct;
const struct _camel_header_raw *header;
@@ -4776,7 +4772,7 @@ camel_message_info_dump (CamelMessageInfo *mi)
void
camel_folder_summary_set_need_preview (CamelFolderSummary *summary, gboolean preview)
{
- CAMEL_FOLDER_SUMMARY_GET_PRIVATE (summary)->need_preview = preview;
+ summary->priv->need_preview = preview;
}
/**
@@ -4787,7 +4783,7 @@ camel_folder_summary_set_need_preview (CamelFolderSummary *summary, gboolean pre
gboolean
camel_folder_summary_get_need_preview (CamelFolderSummary *summary)
{
- return CAMEL_FOLDER_SUMMARY_GET_PRIVATE (summary)->need_preview;
+ return summary->priv->need_preview;
}
static gboolean
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index b30ffd1..1f57796 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -42,10 +42,6 @@
#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)
@@ -512,7 +508,7 @@ folder_finalize (GObject *object)
{
CamelFolderPrivate *priv;
- priv = CAMEL_FOLDER_GET_PRIVATE (object);
+ priv = CAMEL_FOLDER (object)->priv;
g_free (priv->name);
g_free (priv->full_name);
@@ -1645,8 +1641,7 @@ camel_folder_class_init (CamelFolderClass *class)
static void
camel_folder_init (CamelFolder *folder)
{
- folder->priv = CAMEL_FOLDER_GET_PRIVATE (folder);
-
+ folder->priv = G_TYPE_INSTANCE_GET_PRIVATE (folder, CAMEL_TYPE_FOLDER, CamelFolderPrivate);
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 dd10985..8495377 100644
--- a/camel/camel-gpg-context.c
+++ b/camel/camel-gpg-context.c
@@ -73,10 +73,6 @@
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;
};
@@ -2237,7 +2233,7 @@ camel_gpg_context_class_init (CamelGpgContextClass *class)
static void
camel_gpg_context_init (CamelGpgContext *context)
{
- context->priv = CAMEL_GPG_CONTEXT_GET_PRIVATE (context);
+ context->priv = G_TYPE_INSTANCE_GET_PRIVATE (context, CAMEL_TYPE_GPG_CONTEXT, CamelGpgContextPrivate);
}
/**
diff --git a/camel/camel-index.c b/camel/camel-index.c
index b2a23bb..ab8643c 100644
--- a/camel/camel-index.c
+++ b/camel/camel-index.c
@@ -39,10 +39,6 @@
#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;
};
@@ -78,7 +74,7 @@ camel_index_class_init (CamelIndexClass *class)
static void
camel_index_init (CamelIndex *index)
{
- index->priv = CAMEL_INDEX_GET_PRIVATE (index);
+ index->priv = G_TYPE_INSTANCE_GET_PRIVATE (index, CAMEL_TYPE_INDEX, CamelIndexPrivate);
index->version = CAMEL_INDEX_VERSION;
}
diff --git a/camel/camel-medium.c b/camel/camel-medium.c
index ef0f162..d12b61d 100644
--- a/camel/camel-medium.c
+++ b/camel/camel-medium.c
@@ -33,10 +33,6 @@
#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
@@ -90,7 +86,7 @@ medium_dispose (GObject *object)
{
CamelMediumPrivate *priv;
- priv = CAMEL_MEDIUM_GET_PRIVATE (object);
+ priv = CAMEL_MEDIUM (object)->priv;
if (priv->content != NULL) {
g_object_unref (priv->content);
@@ -166,7 +162,7 @@ camel_medium_class_init (CamelMediumClass *class)
static void
camel_medium_init (CamelMedium *medium)
{
- medium->priv = CAMEL_MEDIUM_GET_PRIVATE (medium);
+ medium->priv = G_TYPE_INSTANCE_GET_PRIVATE (medium, CAMEL_TYPE_MEDIUM, CamelMediumPrivate);
}
/**
diff --git a/camel/camel-mime-filter-basic.c b/camel/camel-mime-filter-basic.c
index b820173..68c82ff 100644
--- a/camel/camel-mime-filter-basic.c
+++ b/camel/camel-mime-filter-basic.c
@@ -24,10 +24,6 @@
#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];
@@ -50,7 +46,7 @@ mime_filter_basic_filter (CamelMimeFilter *mime_filter,
CamelMimeFilterBasicPrivate *priv;
gsize newlen;
- priv = CAMEL_MIME_FILTER_BASIC_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_BASIC (mime_filter)->priv;
switch (priv->type) {
case CAMEL_MIME_FILTER_BASIC_BASE64_ENC:
@@ -155,7 +151,7 @@ mime_filter_basic_complete (CamelMimeFilter *mime_filter,
CamelMimeFilterBasicPrivate *priv;
gsize newlen = 0;
- priv = CAMEL_MIME_FILTER_BASIC_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_BASIC (mime_filter)->priv;
switch (priv->type) {
case CAMEL_MIME_FILTER_BASIC_BASE64_ENC:
@@ -221,7 +217,7 @@ mime_filter_basic_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterBasicPrivate *priv;
- priv = CAMEL_MIME_FILTER_BASIC_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_BASIC (mime_filter)->priv;
switch (priv->type) {
case CAMEL_MIME_FILTER_BASIC_QP_ENC:
@@ -249,7 +245,7 @@ camel_mime_filter_basic_class_init (CamelMimeFilterBasicClass *class)
static void
camel_mime_filter_basic_init (CamelMimeFilterBasic *filter)
{
- filter->priv = CAMEL_MIME_FILTER_BASIC_GET_PRIVATE (filter);
+ filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_BASIC, CamelMimeFilterBasicPrivate);
}
/**
diff --git a/camel/camel-mime-filter-bestenc.c b/camel/camel-mime-filter-bestenc.c
index d868ae8..8fb6183 100644
--- a/camel/camel-mime-filter-bestenc.c
+++ b/camel/camel-mime-filter-bestenc.c
@@ -27,10 +27,6 @@
#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 */
@@ -68,7 +64,7 @@ mime_filter_bestenc_filter (CamelMimeFilter *mime_filter,
CamelMimeFilterBestencPrivate *priv;
register guchar *p, *pend;
- priv = CAMEL_MIME_FILTER_BESTENC_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_BESTENC (mime_filter)->priv;
if (len == 0)
goto donothing;
@@ -169,7 +165,7 @@ mime_filter_bestenc_complete (CamelMimeFilter *mime_filter,
{
CamelMimeFilterBestencPrivate *priv;
- priv = CAMEL_MIME_FILTER_BESTENC_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_BESTENC (mime_filter)->priv;
mime_filter_bestenc_filter (
mime_filter, in, len, prespace, out, outlen, outprespace);
@@ -184,7 +180,7 @@ mime_filter_bestenc_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterBestencPrivate *priv;
- priv = CAMEL_MIME_FILTER_BESTENC_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_BESTENC (mime_filter)->priv;
priv->count0 = 0;
priv->count8 = 0;
@@ -215,7 +211,7 @@ camel_mime_filter_bestenc_class_init (CamelMimeFilterBestencClass *class)
static void
camel_mime_filter_bestenc_init (CamelMimeFilterBestenc *filter)
{
- filter->priv = CAMEL_MIME_FILTER_BESTENC_GET_PRIVATE (filter);
+ filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_BESTENC, CamelMimeFilterBestencPrivate);
mime_filter_bestenc_reset (CAMEL_MIME_FILTER (filter));
}
@@ -257,7 +253,7 @@ camel_mime_filter_bestenc_get_best_encoding (CamelMimeFilterBestenc *filter,
CamelTransferEncoding bestenc;
gint istext;
- priv = CAMEL_MIME_FILTER_BESTENC_GET_PRIVATE (filter);
+ priv = filter->priv;
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 6143f47..9c644c3 100644
--- a/camel/camel-mime-filter-canon.c
+++ b/camel/camel-mime-filter-canon.c
@@ -31,10 +31,6 @@
#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;
};
@@ -58,7 +54,7 @@ mime_filter_canon_run (CamelMimeFilter *mime_filter,
register gchar *o;
gint lf = 0;
- priv = CAMEL_MIME_FILTER_CANON_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_CANON (mime_filter)->priv;
/* first, work out how much space we need */
inptr = (guchar *)in;
@@ -193,7 +189,7 @@ camel_mime_filter_canon_class_init (CamelMimeFilterCanonClass *class)
static void
camel_mime_filter_canon_init (CamelMimeFilterCanon *filter)
{
- filter->priv = CAMEL_MIME_FILTER_CANON_GET_PRIVATE (filter);
+ filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_CANON, CamelMimeFilterCanonPrivate);
}
/**
diff --git a/camel/camel-mime-filter-charset.c b/camel/camel-mime-filter-charset.c
index 4564970..d6a6041 100644
--- a/camel/camel-mime-filter-charset.c
+++ b/camel/camel-mime-filter-charset.c
@@ -30,10 +30,6 @@
#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)
@@ -50,7 +46,7 @@ mime_filter_charset_finalize (GObject *object)
{
CamelMimeFilterCharsetPrivate *priv;
- priv = CAMEL_MIME_FILTER_CHARSET_GET_PRIVATE (object);
+ priv = CAMEL_MIME_FILTER_CHARSET (object)->priv;
g_free (priv->from);
g_free (priv->to);
@@ -78,7 +74,7 @@ mime_filter_charset_complete (CamelMimeFilter *mime_filter,
const gchar *inbuf;
gchar *outbuf;
- priv = CAMEL_MIME_FILTER_CHARSET_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_CHARSET (mime_filter)->priv;
if (priv->ic == (iconv_t) -1)
goto noop;
@@ -161,7 +157,7 @@ mime_filter_charset_filter (CamelMimeFilter *mime_filter,
const gchar *inbuf;
gchar *outbuf;
- priv = CAMEL_MIME_FILTER_CHARSET_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_CHARSET (mime_filter)->priv;
if (priv->ic == (iconv_t) -1)
goto noop;
@@ -224,7 +220,7 @@ mime_filter_charset_reset (CamelMimeFilter *mime_filter)
gchar *buffer;
gsize outlen = 16;
- priv = CAMEL_MIME_FILTER_CHARSET_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_CHARSET (mime_filter)->priv;
/* what happens with the output bytes if this resets the state? */
if (priv->ic != (iconv_t) -1) {
@@ -253,7 +249,7 @@ camel_mime_filter_charset_class_init (CamelMimeFilterCharsetClass *class)
static void
camel_mime_filter_charset_init (CamelMimeFilterCharset *filter)
{
- filter->priv = CAMEL_MIME_FILTER_CHARSET_GET_PRIVATE (filter);
+ filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_CHARSET, CamelMimeFilterCharsetPrivate);
filter->priv->ic = (iconv_t) -1;
}
@@ -271,11 +267,11 @@ CamelMimeFilter *
camel_mime_filter_charset_new (const gchar *from_charset,
const gchar *to_charset)
{
- CamelMimeFilter *new;
+ CamelMimeFilter *res;
CamelMimeFilterCharsetPrivate *priv;
- new = g_object_new (CAMEL_TYPE_MIME_FILTER_CHARSET, NULL);
- priv = CAMEL_MIME_FILTER_CHARSET_GET_PRIVATE (new);
+ res = g_object_new (CAMEL_TYPE_MIME_FILTER_CHARSET, NULL);
+ priv = CAMEL_MIME_FILTER_CHARSET (res)->priv;
priv->ic = camel_iconv_open (to_charset, from_charset);
if (priv->ic == (iconv_t) -1) {
@@ -283,12 +279,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 (new);
- new = NULL;
+ g_object_unref (res);
+ res = NULL;
} else {
priv->from = g_strdup (from_charset);
priv->to = g_strdup (to_charset);
}
- return new;
+ return res;
}
diff --git a/camel/camel-mime-filter-crlf.c b/camel/camel-mime-filter-crlf.c
index a233dcb..c19dfb4 100644
--- a/camel/camel-mime-filter-crlf.c
+++ b/camel/camel-mime-filter-crlf.c
@@ -22,10 +22,6 @@
#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;
@@ -51,7 +47,7 @@ mime_filter_crlf_filter (CamelMimeFilter *mime_filter,
gboolean do_dots;
gchar *outptr;
- priv = CAMEL_MIME_FILTER_CRLF_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_CRLF (mime_filter)->priv;
do_dots = priv->mode == CAMEL_MIME_FILTER_CRLF_MODE_CRLF_DOTS;
@@ -147,7 +143,7 @@ mime_filter_crlf_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterCRLFPrivate *priv;
- priv = CAMEL_MIME_FILTER_CRLF_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_CRLF (mime_filter)->priv;
priv->saw_cr = FALSE;
priv->saw_lf = TRUE;
@@ -170,7 +166,7 @@ camel_mime_filter_crlf_class_init (CamelMimeFilterCRLFClass *class)
static void
camel_mime_filter_crlf_init (CamelMimeFilterCRLF *filter)
{
- filter->priv = CAMEL_MIME_FILTER_CRLF_GET_PRIVATE (filter);
+ filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_CRLF, CamelMimeFilterCRLFPrivate);
filter->priv->saw_cr = FALSE;
filter->priv->saw_lf = TRUE;
@@ -194,7 +190,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_GET_PRIVATE (filter);
+ priv = CAMEL_MIME_FILTER_CRLF (filter)->priv;
priv->direction = direction;
priv->mode = mode;
diff --git a/camel/camel-mime-filter-enriched.c b/camel/camel-mime-filter-enriched.c
index b878d82..e4c5408 100644
--- a/camel/camel-mime-filter-enriched.c
+++ b/camel/camel-mime-filter-enriched.c
@@ -30,10 +30,6 @@
#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;
@@ -228,7 +224,7 @@ enriched_to_html (CamelMimeFilter *mime_filter,
register const gchar *inptr;
register gchar *outptr;
- priv = CAMEL_MIME_FILTER_ENRICHED_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_ENRICHED (mime_filter)->priv;
camel_mime_filter_set_size (mime_filter, inlen * 2 + 6, FALSE);
@@ -519,7 +515,7 @@ mime_filter_enriched_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterEnrichedPrivate *priv;
- priv = CAMEL_MIME_FILTER_ENRICHED_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_ENRICHED (mime_filter)->priv;
priv->nofill = 0;
}
@@ -549,7 +545,7 @@ camel_mime_filter_enriched_class_init (CamelMimeFilterEnrichedClass *class)
static void
camel_mime_filter_enriched_init (CamelMimeFilterEnriched *filter)
{
- filter->priv = CAMEL_MIME_FILTER_ENRICHED_GET_PRIVATE (filter);
+ filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_ENRICHED, CamelMimeFilterEnrichedPrivate);
}
/**
@@ -564,15 +560,15 @@ camel_mime_filter_enriched_init (CamelMimeFilterEnriched *filter)
CamelMimeFilter *
camel_mime_filter_enriched_new (guint32 flags)
{
- CamelMimeFilter *new;
+ CamelMimeFilter *res;
CamelMimeFilterEnrichedPrivate *priv;
- new = g_object_new (CAMEL_TYPE_MIME_FILTER_ENRICHED, NULL);
- priv = CAMEL_MIME_FILTER_ENRICHED_GET_PRIVATE (new);
+ res = g_object_new (CAMEL_TYPE_MIME_FILTER_ENRICHED, NULL);
+ priv = CAMEL_MIME_FILTER_ENRICHED (res)->priv;
priv->flags = flags;
- return new;
+ return res;
}
/**
diff --git a/camel/camel-mime-filter-from.c b/camel/camel-mime-filter-from.c
index d774b21..f297967 100644
--- a/camel/camel-mime-filter-from.c
+++ b/camel/camel-mime-filter-from.c
@@ -27,10 +27,6 @@
#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 {
@@ -61,7 +57,7 @@ mime_filter_from_filter (CamelMimeFilter *mime_filter,
struct fromnode *head = NULL, *tail = (struct fromnode *)&head, *node;
gchar *outptr;
- priv = CAMEL_MIME_FILTER_FROM_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_FROM (mime_filter)->priv;
inptr = in;
inend = inptr+len;
@@ -164,7 +160,7 @@ camel_mime_filter_from_class_init (CamelMimeFilterFromClass *class)
static void
camel_mime_filter_from_init (CamelMimeFilterFrom *filter)
{
- filter->priv = CAMEL_MIME_FILTER_FROM_GET_PRIVATE (filter);
+ filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_FROM, CamelMimeFilterFromPrivate);
}
/**
diff --git a/camel/camel-mime-filter-gzip.c b/camel/camel-mime-filter-gzip.c
index 358bf2c..e98116b 100644
--- a/camel/camel-mime-filter-gzip.c
+++ b/camel/camel-mime-filter-gzip.c
@@ -31,10 +31,6 @@
#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 {
@@ -110,7 +106,7 @@ gzip_filter (CamelMimeFilter *mime_filter,
CamelMimeFilterGZipPrivate *priv;
gint retval;
- priv = CAMEL_MIME_FILTER_GZIP_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_GZIP (mime_filter)->priv;
if (!priv->state.zip.wrote_hdr) {
priv->hdr.v.id1 = 31;
@@ -202,7 +198,7 @@ gunzip_filter (CamelMimeFilter *mime_filter,
guint16 need, val;
gint retval;
- priv = CAMEL_MIME_FILTER_GZIP_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_GZIP (mime_filter)->priv;
if (!priv->state.unzip.got_hdr) {
if (len < 10) {
@@ -347,7 +343,7 @@ mime_filter_gzip_finalize (GObject *object)
{
CamelMimeFilterGZipPrivate *priv;
- priv = CAMEL_MIME_FILTER_GZIP_GET_PRIVATE (object);
+ priv = CAMEL_MIME_FILTER_GZIP (object)->priv;
if (priv->mode == CAMEL_MIME_FILTER_GZIP_MODE_ZIP)
deflateEnd (priv->stream);
@@ -371,7 +367,7 @@ mime_filter_gzip_filter (CamelMimeFilter *mime_filter,
{
CamelMimeFilterGZipPrivate *priv;
- priv = CAMEL_MIME_FILTER_GZIP_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_GZIP (mime_filter)->priv;
if (priv->mode == CAMEL_MIME_FILTER_GZIP_MODE_ZIP)
gzip_filter (
@@ -394,7 +390,7 @@ mime_filter_gzip_complete (CamelMimeFilter *mime_filter,
{
CamelMimeFilterGZipPrivate *priv;
- priv = CAMEL_MIME_FILTER_GZIP_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_GZIP (mime_filter)->priv;
if (priv->mode == CAMEL_MIME_FILTER_GZIP_MODE_ZIP)
gzip_filter (
@@ -412,7 +408,7 @@ mime_filter_gzip_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterGZipPrivate *priv;
- priv = CAMEL_MIME_FILTER_GZIP_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_GZIP (mime_filter)->priv;
memset (&priv->state, 0, sizeof (priv->state));
@@ -445,7 +441,7 @@ camel_mime_filter_gzip_class_init (CamelMimeFilterGZipClass *class)
static void
camel_mime_filter_gzip_init (CamelMimeFilterGZip *mime_filter)
{
- mime_filter->priv = CAMEL_MIME_FILTER_GZIP_GET_PRIVATE (mime_filter);
+ mime_filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (mime_filter, CAMEL_TYPE_MIME_FILTER_GZIP, CamelMimeFilterGZipPrivate);
mime_filter->priv->stream = g_new0 (z_stream, 1);
mime_filter->priv->crc32 = crc32 (0, Z_NULL, 0);
}
@@ -467,7 +463,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_GET_PRIVATE (new);
+ priv = CAMEL_MIME_FILTER_GZIP (new)->priv;
priv->mode = mode;
priv->level = level;
diff --git a/camel/camel-mime-filter-html.c b/camel/camel-mime-filter-html.c
index 4c6c48f..0ac795c 100644
--- a/camel/camel-mime-filter-html.c
+++ b/camel/camel-mime-filter-html.c
@@ -33,10 +33,6 @@
#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;
};
@@ -82,7 +78,7 @@ mime_filter_html_run (CamelMimeFilter *mime_filter,
camel_html_parser_t state;
gchar *outp;
- priv = CAMEL_MIME_FILTER_HTML_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_HTML (mime_filter)->priv;
d(printf("converting html:\n%.*s\n", (gint)inlen, in));
@@ -124,7 +120,7 @@ mime_filter_html_dispose (GObject *object)
{
CamelMimeFilterHTMLPrivate *priv;
- priv = CAMEL_MIME_FILTER_HTML_GET_PRIVATE (object);
+ priv = CAMEL_MIME_FILTER_HTML (object)->priv;
if (priv->ctxt != NULL) {
g_object_unref (priv->ctxt);
@@ -168,7 +164,7 @@ mime_filter_html_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterHTMLPrivate *priv;
- priv = CAMEL_MIME_FILTER_HTML_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_HTML (mime_filter)->priv;
g_object_unref (priv->ctxt);
priv->ctxt = camel_html_parser_new ();
@@ -194,7 +190,7 @@ camel_mime_filter_html_class_init (CamelMimeFilterHTMLClass *class)
static void
camel_mime_filter_html_init (CamelMimeFilterHTML *mime_filter)
{
- mime_filter->priv = CAMEL_MIME_FILTER_HTML_GET_PRIVATE (mime_filter);
+ mime_filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (mime_filter, CAMEL_TYPE_MIME_FILTER_HTML, CamelMimeFilterHTMLPrivate);
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 47c15dd..059fa80 100644
--- a/camel/camel-mime-filter-index.c
+++ b/camel/camel-mime-filter-index.c
@@ -21,10 +21,6 @@
#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;
@@ -37,7 +33,7 @@ mime_filter_index_dispose (GObject *object)
{
CamelMimeFilterIndexPrivate *priv;
- priv = CAMEL_MIME_FILTER_INDEX_GET_PRIVATE (object);
+ priv = CAMEL_MIME_FILTER_INDEX (object)->priv;
if (priv->name != NULL) {
g_object_unref (priv->name);
@@ -64,7 +60,7 @@ mime_filter_index_filter (CamelMimeFilter *mime_filter,
{
CamelMimeFilterIndexPrivate *priv;
- priv = CAMEL_MIME_FILTER_INDEX_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_INDEX (mime_filter)->priv;
if (priv->index == NULL || priv->name==NULL) {
goto donothing;
@@ -89,7 +85,7 @@ mime_filter_index_complete (CamelMimeFilter *mime_filter,
{
CamelMimeFilterIndexPrivate *priv;
- priv = CAMEL_MIME_FILTER_INDEX_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_INDEX (mime_filter)->priv;
if (priv->index == NULL || priv->name==NULL) {
goto donothing;
@@ -123,7 +119,7 @@ camel_mime_filter_index_class_init (CamelMimeFilterIndexClass *class)
static void
camel_mime_filter_index_init (CamelMimeFilterIndex *filter)
{
- filter->priv = CAMEL_MIME_FILTER_INDEX_GET_PRIVATE (filter);
+ filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_INDEX, CamelMimeFilterIndexPrivate);
}
/**
@@ -137,18 +133,17 @@ camel_mime_filter_index_init (CamelMimeFilterIndex *filter)
CamelMimeFilter *
camel_mime_filter_index_new (CamelIndex *index)
{
- CamelMimeFilter *new;
+ CamelMimeFilter *res;
CamelMimeFilterIndexPrivate *priv;
- new = g_object_new (CAMEL_TYPE_MIME_FILTER_INDEX, NULL);
+ res = g_object_new (CAMEL_TYPE_MIME_FILTER_INDEX, NULL);
- if (new) {
- priv = CAMEL_MIME_FILTER_INDEX_GET_PRIVATE (new);
- priv->index = index;
- if (index)
- g_object_ref (index);
- }
- return new;
+ priv = CAMEL_MIME_FILTER_INDEX (res)->priv;
+ priv->index = index;
+ if (index)
+ g_object_ref (index);
+
+ return res;
}
/* 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 0449d89..6d6c2ff 100644
--- a/camel/camel-mime-filter-linewrap.c
+++ b/camel/camel-mime-filter-linewrap.c
@@ -27,10 +27,6 @@
#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;
@@ -55,7 +51,7 @@ mime_filter_linewrap_filter (CamelMimeFilter *mime_filter,
const gchar *inend, *p;
gint nchars;
- priv = CAMEL_MIME_FILTER_LINEWRAP_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_LINEWRAP (mime_filter)->priv;
nchars = priv->nchars;
@@ -158,7 +154,7 @@ mime_filter_linewrap_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterLinewrapPrivate *priv;
- priv = CAMEL_MIME_FILTER_LINEWRAP_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_LINEWRAP (mime_filter)->priv;
priv->nchars = 0;
}
@@ -179,7 +175,7 @@ camel_mime_filter_linewrap_class_init (CamelMimeFilterLinewrapClass *class)
static void
camel_mime_filter_linewrap_init (CamelMimeFilterLinewrap *filter)
{
- filter->priv = CAMEL_MIME_FILTER_LINEWRAP_GET_PRIVATE (filter);
+ filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_LINEWRAP, CamelMimeFilterLinewrapPrivate);
}
CamelMimeFilter *
@@ -192,7 +188,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_GET_PRIVATE (filter);
+ priv = CAMEL_MIME_FILTER_LINEWRAP (filter)->priv;
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 c9a539a..fe868dc 100644
--- a/camel/camel-mime-filter-pgp.c
+++ b/camel/camel-mime-filter-pgp.c
@@ -32,10 +32,6 @@
#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-----"
@@ -74,7 +70,7 @@ mime_filter_pgp_run (CamelMimeFilter *mime_filter,
gboolean blank;
gsize len;
- priv = CAMEL_MIME_FILTER_PGP_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_PGP (mime_filter)->priv;
/* only need as much space as the input, we're stripping chars */
camel_mime_filter_set_size (mime_filter, inlen, FALSE);
@@ -183,7 +179,7 @@ mime_filter_pgp_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterPgpPrivate *priv;
- priv = CAMEL_MIME_FILTER_PGP_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_PGP (mime_filter)->priv;
priv->state = PGP_PREFACE;
}
@@ -204,7 +200,7 @@ camel_mime_filter_pgp_class_init (CamelMimeFilterPgpClass *class)
static void
camel_mime_filter_pgp_init (CamelMimeFilterPgp *filter)
{
- filter->priv = CAMEL_MIME_FILTER_PGP_GET_PRIVATE (filter);
+ filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_PGP, CamelMimeFilterPgpPrivate);
}
CamelMimeFilter *
diff --git a/camel/camel-mime-filter-progress.c b/camel/camel-mime-filter-progress.c
index 109b3bc..436cc8a 100644
--- a/camel/camel-mime-filter-progress.c
+++ b/camel/camel-mime-filter-progress.c
@@ -30,10 +30,6 @@
#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)
@@ -50,7 +46,7 @@ mime_filter_progress_dispose (GObject *object)
{
CamelMimeFilterProgressPrivate *priv;
- priv = CAMEL_MIME_FILTER_PROGRESS_GET_PRIVATE (object);
+ priv = CAMEL_MIME_FILTER_PROGRESS (object)->priv;
if (priv->cancellable != NULL) {
g_object_unref (priv->cancellable);
@@ -73,7 +69,7 @@ mime_filter_progress_filter (CamelMimeFilter *mime_filter,
CamelMimeFilterProgressPrivate *priv;
gdouble percent;
- priv = CAMEL_MIME_FILTER_PROGRESS_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_PROGRESS (mime_filter)->priv;
priv->count += len;
if (priv->count < priv->total)
@@ -107,7 +103,7 @@ mime_filter_progress_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterProgressPrivate *priv;
- priv = CAMEL_MIME_FILTER_PROGRESS_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_PROGRESS (mime_filter)->priv;
priv->count = 0;
}
@@ -132,7 +128,7 @@ camel_mime_filter_progress_class_init (CamelMimeFilterProgressClass *class)
static void
camel_mime_filter_progress_init (CamelMimeFilterProgress *filter)
{
- filter->priv = CAMEL_MIME_FILTER_PROGRESS_GET_PRIVATE (filter);
+ filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_PROGRESS, CamelMimeFilterProgressPrivate);
}
/**
@@ -157,7 +153,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_GET_PRIVATE (filter);
+ priv = CAMEL_MIME_FILTER_PROGRESS (filter)->priv;
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 b7092f1..4966e73 100644
--- a/camel/camel-mime-filter-save.c
+++ b/camel/camel-mime-filter-save.c
@@ -27,10 +27,6 @@
#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;
};
@@ -48,7 +44,7 @@ mime_filter_save_filter (CamelMimeFilter *mime_filter,
{
CamelMimeFilterSavePrivate *priv;
- priv = CAMEL_MIME_FILTER_SAVE_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_SAVE (mime_filter)->priv;
if (priv->stream != NULL)
camel_stream_write (priv->stream, in, len, NULL, NULL);
@@ -95,7 +91,7 @@ camel_mime_filter_save_class_init (CamelMimeFilterSaveClass *class)
static void
camel_mime_filter_save_init (CamelMimeFilterSave *filter)
{
- filter->priv = CAMEL_MIME_FILTER_SAVE_GET_PRIVATE (filter);
+ filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_SAVE, CamelMimeFilterSavePrivate);
}
/**
@@ -117,7 +113,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_GET_PRIVATE (filter);
+ priv = CAMEL_MIME_FILTER_SAVE (filter)->priv;
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 c397010..962a843 100644
--- a/camel/camel-mime-filter-tohtml.c
+++ b/camel/camel-mime-filter-tohtml.c
@@ -31,10 +31,6 @@
#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;
@@ -159,7 +155,7 @@ writeln (CamelMimeFilter *mime_filter,
CamelMimeFilterToHTMLPrivate *priv;
const guchar *inptr = in;
- priv = CAMEL_MIME_FILTER_TOHTML_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_TOHTML (mime_filter)->priv;
while (inptr < inend) {
guint32 u;
@@ -239,7 +235,7 @@ html_convert (CamelMimeFilter *mime_filter,
const gchar *inend;
gint depth;
- priv = CAMEL_MIME_FILTER_TOHTML_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_TOHTML (mime_filter)->priv;
if (inlen == 0) {
if (priv->pre_open) {
@@ -397,7 +393,7 @@ mime_filter_tohtml_finalize (GObject *object)
{
CamelMimeFilterToHTMLPrivate *priv;
- priv = CAMEL_MIME_FILTER_TOHTML_GET_PRIVATE (object);
+ priv = CAMEL_MIME_FILTER_TOHTML (object)->priv;
camel_url_scanner_free (priv->scanner);
@@ -438,7 +434,7 @@ mime_filter_tohtml_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterToHTMLPrivate *priv;
- priv = CAMEL_MIME_FILTER_TOHTML_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_TOHTML (mime_filter)->priv;
priv->column = 0;
priv->pre_open = FALSE;
@@ -464,8 +460,7 @@ camel_mime_filter_tohtml_class_init (CamelMimeFilterToHTMLClass *class)
static void
camel_mime_filter_tohtml_init (CamelMimeFilterToHTML *filter)
{
- filter->priv = CAMEL_MIME_FILTER_TOHTML_GET_PRIVATE (filter);
-
+ filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_TOHTML, CamelMimeFilterToHTMLPrivate);
filter->priv->scanner = camel_url_scanner_new ();
}
@@ -487,7 +482,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_GET_PRIVATE (filter);
+ priv = CAMEL_MIME_FILTER_TOHTML (filter)->priv;
priv->flags = flags;
priv->color = color;
diff --git a/camel/camel-mime-filter-windows.c b/camel/camel-mime-filter-windows.c
index 0f62acf..72d5bfe 100644
--- a/camel/camel-mime-filter-windows.c
+++ b/camel/camel-mime-filter-windows.c
@@ -31,10 +31,6 @@
#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)
@@ -50,7 +46,7 @@ mime_filter_windows_finalize (GObject *object)
{
CamelMimeFilterWindowsPrivate *priv;
- priv = CAMEL_MIME_FILTER_WINDOWS_GET_PRIVATE (object);
+ priv = CAMEL_MIME_FILTER_WINDOWS (object)->priv;
g_free (priv->claimed_charset);
@@ -71,7 +67,7 @@ mime_filter_windows_filter (CamelMimeFilter *mime_filter,
register guchar *inptr;
guchar *inend;
- priv = CAMEL_MIME_FILTER_WINDOWS_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_WINDOWS (mime_filter)->priv;
if (!priv->is_windows) {
inptr = (guchar *) in;
@@ -113,7 +109,7 @@ mime_filter_windows_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterWindowsPrivate *priv;
- priv = CAMEL_MIME_FILTER_WINDOWS_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_WINDOWS (mime_filter)->priv;
priv->is_windows = FALSE;
}
@@ -138,7 +134,7 @@ camel_mime_filter_windows_class_init (CamelMimeFilterWindowsClass *class)
static void
camel_mime_filter_windows_init (CamelMimeFilterWindows *filter)
{
- filter->priv = CAMEL_MIME_FILTER_WINDOWS_GET_PRIVATE (filter);
+ filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_WINDOWS, CamelMimeFilterWindowsPrivate);
}
/**
@@ -159,7 +155,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_GET_PRIVATE (filter);
+ priv = CAMEL_MIME_FILTER_WINDOWS (filter)->priv;
priv->claimed_charset = g_strdup (claimed_charset);
diff --git a/camel/camel-mime-filter-yenc.c b/camel/camel-mime-filter-yenc.c
index 2d1fc93..cf81579 100644
--- a/camel/camel-mime-filter-yenc.c
+++ b/camel/camel-mime-filter-yenc.c
@@ -28,10 +28,6 @@
#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;
@@ -58,7 +54,7 @@ mime_filter_yenc_filter (CamelMimeFilter *mime_filter,
CamelMimeFilterYencPrivate *priv;
gsize newlen = 0;
- priv = CAMEL_MIME_FILTER_YENC_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_YENC (mime_filter)->priv;
switch (priv->direction) {
case CAMEL_MIME_FILTER_YENC_DIRECTION_ENCODE:
@@ -167,7 +163,7 @@ mime_filter_yenc_complete (CamelMimeFilter *mime_filter,
CamelMimeFilterYencPrivate *priv;
gsize newlen = 0;
- priv = CAMEL_MIME_FILTER_YENC_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_YENC (mime_filter)->priv;
switch (priv->direction) {
case CAMEL_MIME_FILTER_YENC_DIRECTION_ENCODE:
@@ -209,7 +205,7 @@ mime_filter_yenc_reset (CamelMimeFilter *mime_filter)
{
CamelMimeFilterYencPrivate *priv;
- priv = CAMEL_MIME_FILTER_YENC_GET_PRIVATE (mime_filter);
+ priv = CAMEL_MIME_FILTER_YENC (mime_filter)->priv;
switch (priv->direction) {
case CAMEL_MIME_FILTER_YENC_DIRECTION_ENCODE:
@@ -240,7 +236,7 @@ camel_mime_filter_yenc_class_init (CamelMimeFilterYencClass *class)
static void
camel_mime_filter_yenc_init (CamelMimeFilterYenc *filter)
{
- filter->priv = CAMEL_MIME_FILTER_YENC_GET_PRIVATE (filter);
+ filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (filter, CAMEL_TYPE_MIME_FILTER_YENC, CamelMimeFilterYencPrivate);
filter->priv->part = 0;
filter->priv->pcrc = CAMEL_MIME_YENCODE_CRC_INIT;
@@ -262,7 +258,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_GET_PRIVATE (filter);
+ priv = CAMEL_MIME_FILTER_YENC (filter)->priv;
priv->direction = direction;
diff --git a/camel/camel-mime-filter.c b/camel/camel-mime-filter.c
index 5b0f0aa..0f98de1 100644
--- a/camel/camel-mime-filter.c
+++ b/camel/camel-mime-filter.c
@@ -29,10 +29,6 @@
#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;
@@ -86,7 +82,7 @@ camel_mime_filter_class_init (CamelMimeFilterClass *class)
static void
camel_mime_filter_init (CamelMimeFilter *mime_filter)
{
- mime_filter->priv = CAMEL_MIME_FILTER_GET_PRIVATE (mime_filter);
+ mime_filter->priv = G_TYPE_INSTANCE_GET_PRIVATE (mime_filter, CAMEL_TYPE_MIME_FILTER, CamelMimeFilterPrivate);
mime_filter->outreal = NULL;
mime_filter->outbuf = NULL;
@@ -151,7 +147,7 @@ static void filter_run (CamelMimeFilter *f,
struct _CamelMimeFilterPrivate *p;
gint newlen;
- p = CAMEL_MIME_FILTER_GET_PRIVATE (f);
+ p = f->priv;
newlen = len + prespace + f->backlen;
if (p->inlen < newlen) {
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index 5267175..f428283 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -49,10 +49,6 @@
#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 {
@@ -399,7 +395,7 @@ mime_part_finalize (GObject *object)
{
CamelMimePartPrivate *priv;
- priv = CAMEL_MIME_PART_GET_PRIVATE (object);
+ priv = CAMEL_MIME_PART (object)->priv;
g_free (priv->description);
g_free (priv->content_id);
@@ -919,7 +915,7 @@ camel_mime_part_init (CamelMimePart *mime_part)
{
CamelDataWrapper *data_wrapper;
- mime_part->priv = CAMEL_MIME_PART_GET_PRIVATE (mime_part);
+ mime_part->priv = G_TYPE_INSTANCE_GET_PRIVATE (mime_part, CAMEL_TYPE_MIME_PART, CamelMimePartPrivate);
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 c9d3026..42c3c61 100644
--- a/camel/camel-object.c
+++ b/camel/camel-object.c
@@ -35,10 +35,6 @@
#define d(x)
-#define CAMEL_OBJECT_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), CAMEL_TYPE_OBJECT, CamelObjectPrivate))
-
struct _CamelObjectPrivate {
gchar *state_filename;
};
@@ -132,7 +128,7 @@ object_finalize (GObject *object)
{
CamelObjectPrivate *priv;
- priv = CAMEL_OBJECT_GET_PRIVATE (object);
+ priv = CAMEL_OBJECT (object)->priv;
g_free (priv->state_filename);
@@ -364,7 +360,7 @@ camel_object_class_init (CamelObjectClass *class)
static void
camel_object_init (CamelObject *object)
{
- object->priv = CAMEL_OBJECT_GET_PRIVATE (object);
+ object->priv = G_TYPE_INSTANCE_GET_PRIVATE (object, CAMEL_TYPE_OBJECT, CamelObjectPrivate);
}
GQuark
diff --git a/camel/camel-offline-folder.c b/camel/camel-offline-folder.c
index c1b2901..52b23bd 100644
--- a/camel/camel-offline-folder.c
+++ b/camel/camel-offline-folder.c
@@ -33,10 +33,6 @@
#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 {
@@ -322,7 +318,7 @@ camel_offline_folder_class_init (CamelOfflineFolderClass *class)
static void
camel_offline_folder_init (CamelOfflineFolder *folder)
{
- folder->priv = CAMEL_OFFLINE_FOLDER_GET_PRIVATE (folder);
+ folder->priv = G_TYPE_INSTANCE_GET_PRIVATE (folder, CAMEL_TYPE_OFFLINE_FOLDER, CamelOfflineFolderPrivate);
g_signal_connect (
folder, "changed",
diff --git a/camel/camel-offline-store.c b/camel/camel-offline-store.c
index a93377a..6ce9c49 100644
--- a/camel/camel-offline-store.c
+++ b/camel/camel-offline-store.c
@@ -31,10 +31,6 @@
#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;
};
@@ -75,7 +71,7 @@ camel_offline_store_class_init (CamelOfflineStoreClass *class)
static void
camel_offline_store_init (CamelOfflineStore *store)
{
- store->priv = CAMEL_OFFLINE_STORE_GET_PRIVATE (store);
+ store->priv = G_TYPE_INSTANCE_GET_PRIVATE (store, CAMEL_TYPE_OFFLINE_STORE, CamelOfflineStorePrivate);
store->priv->online = TRUE;
}
diff --git a/camel/camel-operation.c b/camel/camel-operation.c
index 13626d9..cbcf34c 100644
--- a/camel/camel-operation.c
+++ b/camel/camel-operation.c
@@ -31,10 +31,6 @@
#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 */
@@ -162,7 +158,7 @@ operation_finalize (GObject *object)
{
CamelOperationPrivate *priv;
- priv = CAMEL_OPERATION_GET_PRIVATE (object);
+ priv = CAMEL_OPERATION (object)->priv;
LOCK ();
@@ -207,7 +203,7 @@ camel_operation_class_init (CamelOperationClass *class)
static void
camel_operation_init (CamelOperation *operation)
{
- operation->priv = CAMEL_OPERATION_GET_PRIVATE (operation);
+ operation->priv = G_TYPE_INSTANCE_GET_PRIVATE (operation, CAMEL_TYPE_OPERATION, CamelOperationPrivate);
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 ffd42c3..af2e2da 100644
--- a/camel/camel-partition-table.c
+++ b/camel/camel-partition-table.c
@@ -46,10 +46,6 @@
#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 */
};
@@ -92,7 +88,7 @@ camel_partition_table_class_init (CamelPartitionTableClass *class)
static void
camel_partition_table_init (CamelPartitionTable *cpi)
{
- cpi->priv = CAMEL_PARTITION_TABLE_GET_PRIVATE (cpi);
+ cpi->priv = G_TYPE_INSTANCE_GET_PRIVATE (cpi, CAMEL_TYPE_PARTITION_TABLE, CamelPartitionTablePrivate);
camel_dlist_init (&cpi->partition);
g_static_mutex_init (&cpi->priv->lock);
@@ -599,10 +595,6 @@ 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))
@@ -646,7 +638,7 @@ camel_key_table_class_init (CamelKeyTableClass *class)
static void
camel_key_table_init (CamelKeyTable *table)
{
- table->priv = CAMEL_KEY_TABLE_GET_PRIVATE (table);
+ table->priv = G_TYPE_INSTANCE_GET_PRIVATE (table, CAMEL_TYPE_KEY_TABLE, CamelKeyTablePrivate);
g_static_mutex_init (&table->priv->lock);
}
diff --git a/camel/camel-sasl-cram-md5.c b/camel/camel-sasl-cram-md5.c
index 3ce6237..acaf2ef 100644
--- a/camel/camel-sasl-cram-md5.c
+++ b/camel/camel-sasl-cram-md5.c
@@ -33,10 +33,6 @@
#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 */
};
@@ -146,5 +142,5 @@ camel_sasl_cram_md5_class_init (CamelSaslCramMd5Class *class)
static void
camel_sasl_cram_md5_init (CamelSaslCramMd5 *sasl)
{
- sasl->priv = CAMEL_SASL_CRAM_MD5_GET_PRIVATE (sasl);
+ sasl->priv = G_TYPE_INSTANCE_GET_PRIVATE (sasl, CAMEL_TYPE_SASL_CRAM_MD5, CamelSaslCramMd5Private);
}
diff --git a/camel/camel-sasl-digest-md5.c b/camel/camel-sasl-digest-md5.c
index 2338c45..7d0e19e 100644
--- a/camel/camel-sasl-digest-md5.c
+++ b/camel/camel-sasl-digest-md5.c
@@ -48,10 +48,6 @@
#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 = {
@@ -946,5 +942,5 @@ camel_sasl_digest_md5_class_init (CamelSaslDigestMd5Class *class)
static void
camel_sasl_digest_md5_init (CamelSaslDigestMd5 *sasl)
{
- sasl->priv = CAMEL_SASL_DIGEST_MD5_GET_PRIVATE (sasl);
+ sasl->priv = G_TYPE_INSTANCE_GET_PRIVATE (sasl, CAMEL_TYPE_SASL_DIGEST_MD5, CamelSaslDigestMd5Private);
}
diff --git a/camel/camel-sasl-gssapi.c b/camel/camel-sasl-gssapi.c
index ad1dff8..23f6102 100644
--- a/camel/camel-sasl-gssapi.c
+++ b/camel/camel-sasl-gssapi.c
@@ -77,10 +77,6 @@ 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"),
@@ -268,7 +264,7 @@ sasl_gssapi_challenge_sync (CamelSasl *sasl,
struct addrinfo *ai, hints;
const gchar *service_name;
- priv = CAMEL_SASL_GSSAPI_GET_PRIVATE (sasl);
+ priv = CAMEL_SASL_GSSAPI (sasl)->priv;
service = camel_sasl_get_service (sasl);
service_name = camel_sasl_get_service_name (sasl);
@@ -445,8 +441,7 @@ static void
camel_sasl_gssapi_init (CamelSaslGssapi *sasl)
{
#ifdef HAVE_KRB5
- sasl->priv = CAMEL_SASL_GSSAPI_GET_PRIVATE (sasl);
-
+ sasl->priv = G_TYPE_INSTANCE_GET_PRIVATE (sasl, CAMEL_TYPE_SASL_GSSAPI, CamelSaslGssapiPrivate);
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 8615ae3..f3ca3d2 100644
--- a/camel/camel-sasl-login.c
+++ b/camel/camel-sasl-login.c
@@ -31,10 +31,6 @@
#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"),
@@ -67,7 +63,7 @@ sasl_login_challenge_sync (CamelSasl *sasl,
CamelService *service;
CamelURL *url;
- priv = CAMEL_SASL_LOGIN_GET_PRIVATE (sasl);
+ priv = CAMEL_SASL_LOGIN (sasl)->priv;
service = camel_sasl_get_service (sasl);
url = service->url;
@@ -114,5 +110,5 @@ camel_sasl_login_class_init (CamelSaslLoginClass *class)
static void
camel_sasl_login_init (CamelSaslLogin *sasl)
{
- sasl->priv = CAMEL_SASL_LOGIN_GET_PRIVATE (sasl);
+ sasl->priv = G_TYPE_INSTANCE_GET_PRIVATE (sasl, CAMEL_TYPE_SASL_LOGIN, CamelSaslLoginPrivate);
}
diff --git a/camel/camel-sasl-ntlm.c b/camel/camel-sasl-ntlm.c
index a683d4b..94d50d5 100644
--- a/camel/camel-sasl-ntlm.c
+++ b/camel/camel-sasl-ntlm.c
@@ -29,10 +29,6 @@
#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 */
};
@@ -736,5 +732,5 @@ camel_sasl_ntlm_class_init (CamelSaslNTLMClass *class)
static void
camel_sasl_ntlm_init (CamelSaslNTLM *sasl)
{
- sasl->priv = CAMEL_SASL_NTLM_GET_PRIVATE (sasl);
+ sasl->priv = G_TYPE_INSTANCE_GET_PRIVATE (sasl, CAMEL_TYPE_SASL_NTLM, CamelSaslNTLMPrivate);
}
diff --git a/camel/camel-sasl-plain.c b/camel/camel-sasl-plain.c
index 39b6571..a4b0049 100644
--- a/camel/camel-sasl-plain.c
+++ b/camel/camel-sasl-plain.c
@@ -31,10 +31,6 @@
#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 */
};
@@ -91,5 +87,5 @@ camel_sasl_plain_class_init (CamelSaslPlainClass *class)
static void
camel_sasl_plain_init (CamelSaslPlain *sasl)
{
- sasl->priv = CAMEL_SASL_PLAIN_GET_PRIVATE (sasl);
+ sasl->priv = G_TYPE_INSTANCE_GET_PRIVATE (sasl, CAMEL_TYPE_SASL_PLAIN, CamelSaslPlainPrivate);
}
diff --git a/camel/camel-sasl-popb4smtp.c b/camel/camel-sasl-popb4smtp.c
index 8bfc5b0..eb90afa 100644
--- a/camel/camel-sasl-popb4smtp.c
+++ b/camel/camel-sasl-popb4smtp.c
@@ -34,10 +34,6 @@
#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 */
};
@@ -152,5 +148,5 @@ camel_sasl_popb4smtp_class_init (CamelSaslPOPB4SMTPClass *class)
static void
camel_sasl_popb4smtp_init (CamelSaslPOPB4SMTP *sasl)
{
- sasl->priv = CAMEL_SASL_POPB4SMTP_GET_PRIVATE (sasl);
+ sasl->priv = G_TYPE_INSTANCE_GET_PRIVATE (sasl, CAMEL_TYPE_SASL_POPB4SMTP, CamelSaslPOPB4SMTPPrivate);
}
diff --git a/camel/camel-sasl.c b/camel/camel-sasl.c
index a433e2f..d4290fe 100644
--- a/camel/camel-sasl.c
+++ b/camel/camel-sasl.c
@@ -40,10 +40,6 @@
#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 {
@@ -193,7 +189,7 @@ sasl_dispose (GObject *object)
{
CamelSaslPrivate *priv;
- priv = CAMEL_SASL_GET_PRIVATE (object);
+ priv = CAMEL_SASL (object)->priv;
if (priv->service != NULL) {
g_object_unref (priv->service);
@@ -209,7 +205,7 @@ sasl_finalize (GObject *object)
{
CamelSaslPrivate *priv;
- priv = CAMEL_SASL_GET_PRIVATE (object);
+ priv = CAMEL_SASL (object)->priv;
g_free (priv->mechanism);
g_free (priv->service_name);
@@ -354,7 +350,7 @@ camel_sasl_class_init (CamelSaslClass *class)
static void
camel_sasl_init (CamelSasl *sasl)
{
- sasl->priv = CAMEL_SASL_GET_PRIVATE (sasl);
+ sasl->priv = G_TYPE_INSTANCE_GET_PRIVATE (sasl, CAMEL_TYPE_SASL, CamelSaslPrivate);
}
/**
diff --git a/camel/camel-service.c b/camel/camel-service.c
index fb78026..5bb7e7d 100644
--- a/camel/camel-service.c
+++ b/camel/camel-service.c
@@ -42,10 +42,6 @@
#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 */
@@ -228,7 +224,7 @@ camel_service_class_init (CamelServiceClass *class)
static void
camel_service_init (CamelService *service)
{
- service->priv = CAMEL_SERVICE_GET_PRIVATE (service);
+ service->priv = G_TYPE_INSTANCE_GET_PRIVATE (service, CAMEL_TYPE_SERVICE, CamelServicePrivate);
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 d5b16fb..306ca18 100644
--- a/camel/camel-session.c
+++ b/camel/camel-session.c
@@ -49,10 +49,6 @@
#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 */
@@ -429,8 +425,7 @@ camel_session_class_init (CamelSessionClass *class)
static void
camel_session_init (CamelSession *session)
{
- session->priv = CAMEL_SESSION_GET_PRIVATE (session);
-
+ session->priv = G_TYPE_INSTANCE_GET_PRIVATE (session, CAMEL_TYPE_SESSION, CamelSessionPrivate);
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 0f34fbe..47e22fa 100644
--- a/camel/camel-smime-context.c
+++ b/camel/camel-smime-context.c
@@ -61,10 +61,6 @@
#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;
@@ -1289,8 +1285,7 @@ camel_smime_context_class_init (CamelSMIMEContextClass *class)
static void
camel_smime_context_init (CamelSMIMEContext *smime_context)
{
- smime_context->priv = CAMEL_SMIME_CONTEXT_GET_PRIVATE (smime_context);
-
+ smime_context->priv = G_TYPE_INSTANCE_GET_PRIVATE (smime_context, CAMEL_TYPE_SMIME_CONTEXT, CamelSMIMEContextPrivate);
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 a7549da..2105b89 100644
--- a/camel/camel-store-summary.c
+++ b/camel/camel-store-summary.c
@@ -51,10 +51,6 @@
/* 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 */
@@ -320,8 +316,7 @@ camel_store_summary_class_init (CamelStoreSummaryClass *class)
static void
camel_store_summary_init (CamelStoreSummary *summary)
{
- summary->priv = CAMEL_STORE_SUMMARY_GET_PRIVATE (summary);
-
+ summary->priv = G_TYPE_INSTANCE_GET_PRIVATE (summary, CAMEL_TYPE_STORE_SUMMARY, CamelStoreSummaryPrivate);
summary->store_info_size = sizeof (CamelStoreInfo);
summary->store_info_chunks = NULL;
diff --git a/camel/camel-store.c b/camel/camel-store.c
index c2f26c9..07f7b47 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -44,10 +44,6 @@
#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;
@@ -1365,7 +1361,7 @@ camel_store_class_init (CamelStoreClass *class)
static void
camel_store_init (CamelStore *store)
{
- store->priv = CAMEL_STORE_GET_PRIVATE (store);
+ store->priv = G_TYPE_INSTANCE_GET_PRIVATE (store, CAMEL_TYPE_STORE, CamelStorePrivate);
/* 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 6881276..a8cb54c 100644
--- a/camel/camel-stream-buffer.c
+++ b/camel/camel-stream-buffer.c
@@ -33,10 +33,6 @@
#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;
@@ -89,7 +85,7 @@ set_vbuf (CamelStreamBuffer *stream,
{
CamelStreamBufferPrivate *priv;
- priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
+ priv = CAMEL_STREAM_BUFFER (stream)->priv;
if (priv->buf && !(priv->flags & BUF_USER))
g_free (priv->buf);
@@ -113,7 +109,7 @@ stream_buffer_dispose (GObject *object)
{
CamelStreamBufferPrivate *priv;
- priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (object);
+ priv = CAMEL_STREAM_BUFFER (object)->priv;
if (priv->stream != NULL) {
g_object_unref (priv->stream);
@@ -129,7 +125,7 @@ stream_buffer_finalize (GObject *object)
{
CamelStreamBufferPrivate *priv;
- priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (object);
+ priv = CAMEL_STREAM_BUFFER (object)->priv;
if (!(priv->flags & BUF_USER))
g_free (priv->buf);
@@ -153,7 +149,7 @@ stream_buffer_read (CamelStream *stream,
gchar *bptr = buffer;
GError *local_error = NULL;
- priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
+ priv = CAMEL_STREAM_BUFFER (stream)->priv;
g_return_val_if_fail (
(priv->mode & CAMEL_STREAM_BUFFER_MODE) ==
@@ -225,7 +221,7 @@ stream_buffer_write (CamelStream *stream,
gssize total = n;
gssize left, todo;
- priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
+ priv = CAMEL_STREAM_BUFFER (stream)->priv;
g_return_val_if_fail (
(priv->mode & CAMEL_STREAM_BUFFER_MODE) ==
@@ -273,7 +269,7 @@ stream_buffer_flush (CamelStream *stream,
{
CamelStreamBufferPrivate *priv;
- priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
+ priv = CAMEL_STREAM_BUFFER (stream)->priv;
if ((priv->mode & CAMEL_STREAM_BUFFER_MODE) == CAMEL_STREAM_BUFFER_WRITE) {
gsize len = priv->ptr - priv->buf;
@@ -298,7 +294,7 @@ stream_buffer_close (CamelStream *stream,
{
CamelStreamBufferPrivate *priv;
- priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
+ priv = CAMEL_STREAM_BUFFER (stream)->priv;
if (stream_buffer_flush (stream, cancellable, error) == -1)
return -1;
@@ -311,7 +307,7 @@ stream_buffer_eos (CamelStream *stream)
{
CamelStreamBufferPrivate *priv;
- priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
+ priv = CAMEL_STREAM_BUFFER (stream)->priv;
return camel_stream_eos (priv->stream) && priv->ptr == priv->end;
}
@@ -325,7 +321,7 @@ stream_buffer_init_vbuf (CamelStreamBuffer *stream,
{
CamelStreamBufferPrivate *priv;
- priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
+ priv = CAMEL_STREAM_BUFFER (stream)->priv;
set_vbuf (stream, buf, mode, size);
@@ -369,8 +365,7 @@ camel_stream_buffer_class_init (CamelStreamBufferClass *class)
static void
camel_stream_buffer_init (CamelStreamBuffer *stream)
{
- stream->priv = CAMEL_STREAM_BUFFER_GET_PRIVATE (stream);
-
+ stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream, CAMEL_TYPE_STREAM_BUFFER, CamelStreamBufferPrivate);
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 0a67e8d..e29694f 100644
--- a/camel/camel-stream-filter.c
+++ b/camel/camel-stream-filter.c
@@ -35,10 +35,6 @@
/*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;
@@ -99,7 +95,7 @@ stream_filter_read (CamelStream *stream,
gssize size;
struct _filter *f;
- priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
+ priv = CAMEL_STREAM_FILTER (stream)->priv;
priv->last_was_read = TRUE;
@@ -178,7 +174,7 @@ stream_filter_write (CamelStream *stream,
gsize presize, len, left = n;
gchar *buffer, realbuffer[READ_SIZE+READ_PAD];
- priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
+ priv = CAMEL_STREAM_FILTER (stream)->priv;
priv->last_was_read = FALSE;
@@ -230,7 +226,7 @@ stream_filter_flush (CamelStream *stream,
gsize presize;
gsize len;
- priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
+ priv = CAMEL_STREAM_FILTER (stream)->priv;
if (priv->last_was_read)
return 0;
@@ -267,7 +263,7 @@ stream_filter_close (CamelStream *stream,
{
CamelStreamFilterPrivate *priv;
- priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
+ priv = CAMEL_STREAM_FILTER (stream)->priv;
/* Ignore errors while flushing. */
if (!priv->last_was_read)
@@ -281,7 +277,7 @@ stream_filter_eos (CamelStream *stream)
{
CamelStreamFilterPrivate *priv;
- priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
+ priv = CAMEL_STREAM_FILTER (stream)->priv;
if (priv->filteredlen > 0)
return FALSE;
@@ -299,7 +295,7 @@ stream_filter_reset (CamelStream *stream,
CamelStreamFilterPrivate *priv;
struct _filter *f;
- priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
+ priv = CAMEL_STREAM_FILTER (stream)->priv;
priv->filteredlen = 0;
priv->flushed = FALSE;
@@ -337,8 +333,7 @@ camel_stream_filter_class_init (CamelStreamFilterClass *class)
static void
camel_stream_filter_init (CamelStreamFilter *stream)
{
- stream->priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
-
+ stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream, CAMEL_TYPE_STREAM_FILTER, CamelStreamFilterPrivate);
stream->priv->realbuffer = g_malloc (READ_SIZE + READ_PAD);
stream->priv->buffer = stream->priv->realbuffer + READ_PAD;
stream->priv->last_was_read = TRUE;
@@ -363,7 +358,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_GET_PRIVATE (stream);
+ priv = CAMEL_STREAM_FILTER (stream)->priv;
priv->source = g_object_ref (source);
@@ -407,7 +402,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 = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
+ priv = stream->priv;
fn = g_malloc (sizeof (*fn));
fn->id = priv->filterid++;
@@ -438,7 +433,7 @@ camel_stream_filter_remove (CamelStreamFilter *stream,
g_return_if_fail (CAMEL_IS_STREAM_FILTER (stream));
- priv = CAMEL_STREAM_FILTER_GET_PRIVATE (stream);
+ priv = stream->priv;
f = (struct _filter *)&priv->filters;
while (f && f->next) {
diff --git a/camel/camel-stream-fs.c b/camel/camel-stream-fs.c
index 146eac8..54af8f6 100644
--- a/camel/camel-stream-fs.c
+++ b/camel/camel-stream-fs.c
@@ -39,10 +39,6 @@
#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 */
};
@@ -59,7 +55,7 @@ stream_fs_finalize (GObject *object)
{
CamelStreamFsPrivate *priv;
- priv = CAMEL_STREAM_FS_GET_PRIVATE (object);
+ priv = CAMEL_STREAM_FS (object)->priv;
if (priv->fd != -1)
close (priv->fd);
@@ -78,7 +74,7 @@ stream_fs_read (CamelStream *stream,
CamelStreamFsPrivate *priv;
gssize nread;
- priv = CAMEL_STREAM_FS_GET_PRIVATE (stream);
+ priv = CAMEL_STREAM_FS (stream)->priv;
nread = camel_read (priv->fd, buffer, n, cancellable, error);
@@ -97,7 +93,7 @@ stream_fs_write (CamelStream *stream,
{
CamelStreamFsPrivate *priv;
- priv = CAMEL_STREAM_FS_GET_PRIVATE (stream);
+ priv = CAMEL_STREAM_FS (stream)->priv;
return camel_write (priv->fd, buffer, n, cancellable, error);
}
@@ -109,7 +105,7 @@ stream_fs_flush (CamelStream *stream,
{
CamelStreamFsPrivate *priv;
- priv = CAMEL_STREAM_FS_GET_PRIVATE (stream);
+ priv = CAMEL_STREAM_FS (stream)->priv;
if (g_cancellable_set_error_if_cancelled (cancellable, error))
return -1;
@@ -132,7 +128,7 @@ stream_fs_close (CamelStream *stream,
{
CamelStreamFsPrivate *priv;
- priv = CAMEL_STREAM_FS_GET_PRIVATE (stream);
+ priv = CAMEL_STREAM_FS (stream)->priv;
if (g_cancellable_set_error_if_cancelled (cancellable, error))
return -1;
@@ -155,7 +151,7 @@ stream_fs_tell (GSeekable *seekable)
{
CamelStreamFsPrivate *priv;
- priv = CAMEL_STREAM_FS_GET_PRIVATE (seekable);
+ priv = CAMEL_STREAM_FS (seekable)->priv;
return (goffset) lseek (priv->fd, 0, SEEK_CUR);
}
@@ -176,7 +172,7 @@ stream_fs_seek (GSeekable *seekable,
CamelStreamFsPrivate *priv;
goffset real = 0;
- priv = CAMEL_STREAM_FS_GET_PRIVATE (seekable);
+ priv = CAMEL_STREAM_FS (seekable)->priv;
switch (type) {
case G_SEEK_SET:
@@ -262,7 +258,7 @@ camel_stream_fs_seekable_init (GSeekableIface *interface)
static void
camel_stream_fs_init (CamelStreamFs *stream)
{
- stream->priv = CAMEL_STREAM_FS_GET_PRIVATE (stream);
+ stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream, CAMEL_TYPE_STREAM_FS, CamelStreamFsPrivate);
stream->priv->fd = -1;
}
@@ -286,7 +282,7 @@ camel_stream_fs_new_with_fd (gint fd)
return NULL;
stream = g_object_new (CAMEL_TYPE_STREAM_FS, NULL);
- priv = CAMEL_STREAM_FS_GET_PRIVATE (stream);
+ priv = CAMEL_STREAM_FS (stream)->priv;
priv->fd = fd;
diff --git a/camel/camel-stream-mem.c b/camel/camel-stream-mem.c
index fbd5324..e3ed3ed 100644
--- a/camel/camel-stream-mem.c
+++ b/camel/camel-stream-mem.c
@@ -34,10 +34,6 @@
#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?
@@ -77,7 +73,7 @@ stream_mem_finalize (GObject *object)
{
CamelStreamMemPrivate *priv;
- priv = CAMEL_STREAM_MEM_GET_PRIVATE (object);
+ priv = CAMEL_STREAM_MEM (object)->priv;
if (priv->buffer && priv->owner) {
/* TODO: we need our own bytearray type since we don't know
@@ -101,7 +97,7 @@ stream_mem_read (CamelStream *stream,
CamelStreamMemPrivate *priv;
gssize nread;
- priv = CAMEL_STREAM_MEM_GET_PRIVATE (stream);
+ priv = CAMEL_STREAM_MEM (stream)->priv;
nread = MIN (n, priv->buffer->len - priv->position);
if (nread > 0) {
@@ -123,7 +119,7 @@ stream_mem_write (CamelStream *stream,
CamelStreamMemPrivate *priv;
gssize nwrite = n;
- priv = CAMEL_STREAM_MEM_GET_PRIVATE (stream);
+ priv = CAMEL_STREAM_MEM (stream)->priv;
/* FIXME: we shouldn't use g_byte_arrays or g_malloc perhaps? */
if (priv->position == priv->buffer->len) {
@@ -142,7 +138,7 @@ stream_mem_eos (CamelStream *stream)
{
CamelStreamMemPrivate *priv;
- priv = CAMEL_STREAM_MEM_GET_PRIVATE (stream);
+ priv = CAMEL_STREAM_MEM (stream)->priv;
return priv->buffer->len <= priv->position;
}
@@ -152,7 +148,7 @@ stream_mem_tell (GSeekable *seekable)
{
CamelStreamMemPrivate *priv;
- priv = CAMEL_STREAM_MEM_GET_PRIVATE (seekable);
+ priv = CAMEL_STREAM_MEM (seekable)->priv;
return priv->position;
}
@@ -173,7 +169,7 @@ stream_mem_seek (GSeekable *seekable,
CamelStreamMemPrivate *priv;
goffset position;
- priv = CAMEL_STREAM_MEM_GET_PRIVATE (seekable);
+ priv = CAMEL_STREAM_MEM (seekable)->priv;
switch (type) {
case G_SEEK_SET:
@@ -254,7 +250,7 @@ camel_stream_mem_seekable_init (GSeekableIface *interface)
static void
camel_stream_mem_init (CamelStreamMem *stream)
{
- stream->priv = CAMEL_STREAM_MEM_GET_PRIVATE (stream);
+ stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream, CAMEL_TYPE_STREAM_MEM, CamelStreamMemPrivate);
}
/**
@@ -317,7 +313,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_GET_PRIVATE (stream);
+ priv = CAMEL_STREAM_MEM (stream)->priv;
priv->buffer = buffer;
priv->owner = TRUE;
diff --git a/camel/camel-tcp-stream-raw.c b/camel/camel-tcp-stream-raw.c
index ab1407e..4074519 100644
--- a/camel/camel-tcp-stream-raw.c
+++ b/camel/camel-tcp-stream-raw.c
@@ -1281,10 +1281,6 @@ _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)
{
@@ -1317,7 +1313,7 @@ camel_tcp_stream_raw_init (CamelTcpStreamRaw *stream)
{
CamelTcpStreamRawPrivate *priv;
- stream->priv = CAMEL_TCP_STREAM_RAW_GET_PRIVATE (stream);
+ stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream, CAMEL_TYPE_TCP_STREAM_RAW, CamelTcpStreamRawPrivate);
priv = stream->priv;
priv->sockfd = NULL;
diff --git a/camel/camel-tcp-stream-ssl.c b/camel/camel-tcp-stream-ssl.c
index 58c3b8d..0411d19 100644
--- a/camel/camel-tcp-stream-ssl.c
+++ b/camel/camel-tcp-stream-ssl.c
@@ -70,10 +70,6 @@
#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;
@@ -88,7 +84,7 @@ tcp_stream_ssl_dispose (GObject *object)
{
CamelTcpStreamSSLPrivate *priv;
- priv = CAMEL_TCP_STREAM_SSL_GET_PRIVATE (object);
+ priv = CAMEL_TCP_STREAM_SSL (object)->priv;
if (priv->session != NULL) {
g_object_unref (priv->session);
@@ -104,7 +100,7 @@ tcp_stream_ssl_finalize (GObject *object)
{
CamelTcpStreamSSLPrivate *priv;
- priv = CAMEL_TCP_STREAM_SSL_GET_PRIVATE (object);
+ priv = CAMEL_TCP_STREAM_SSL (object)->priv;
g_free (priv->expected_host);
@@ -766,7 +762,7 @@ camel_tcp_stream_ssl_class_init (CamelTcpStreamSSLClass *class)
static void
camel_tcp_stream_ssl_init (CamelTcpStreamSSL *stream)
{
- stream->priv = CAMEL_TCP_STREAM_SSL_GET_PRIVATE (stream);
+ stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream, CAMEL_TYPE_TCP_STREAM_SSL, CamelTcpStreamSSLPrivate);
}
/**
diff --git a/camel/camel-tcp-stream.c b/camel/camel-tcp-stream.c
index 682418f..ee40a8e 100644
--- a/camel/camel-tcp-stream.c
+++ b/camel/camel-tcp-stream.c
@@ -36,10 +36,6 @@
#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;
@@ -71,7 +67,7 @@ camel_tcp_stream_class_init (CamelTcpStreamClass *class)
static void
camel_tcp_stream_init (CamelTcpStream *tcp_stream)
{
- tcp_stream->priv = CAMEL_TCP_STREAM_GET_PRIVATE (tcp_stream);
+ tcp_stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (tcp_stream, CAMEL_TYPE_TCP_STREAM, CamelTcpStreamPrivate);
}
/**
diff --git a/camel/camel-text-index.c b/camel/camel-text-index.c
index d178cc2..0d20b2c 100644
--- a/camel/camel-text-index.c
+++ b/camel/camel-text-index.c
@@ -60,10 +60,6 @@ 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;
@@ -74,10 +70,6 @@ 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;
@@ -94,10 +86,6 @@ 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;
@@ -114,10 +102,6 @@ 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;
@@ -175,7 +159,7 @@ text_index_dispose (GObject *object)
{
CamelTextIndexPrivate *priv;
- priv = CAMEL_TEXT_INDEX_GET_PRIVATE (object);
+ priv = CAMEL_TEXT_INDEX (object)->priv;
/* Only run this the first time. */
if (priv->word_index != NULL)
@@ -220,7 +204,7 @@ text_index_finalize (GObject *object)
{
CamelTextIndexPrivate *priv;
- priv = CAMEL_TEXT_INDEX_GET_PRIVATE (object);
+ priv = CAMEL_TEXT_INDEX (object)->priv;
g_assert (camel_dlist_empty (&priv->word_cache));
g_assert (g_hash_table_size (priv->words) == 0);
@@ -240,7 +224,7 @@ text_index_add_name_to_word (CamelIndex *idx,
camel_key_t nameid)
{
struct _CamelTextIndexWord *w, *wp, *ww;
- CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
+ CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
camel_key_t wordid;
camel_block_t data;
struct _CamelTextIndexRoot *rb = (struct _CamelTextIndexRoot *)p->blocks->root;
@@ -325,7 +309,7 @@ text_index_add_name_to_word (CamelIndex *idx,
static gint
text_index_sync (CamelIndex *idx)
{
- CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
+ CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
struct _CamelTextIndexWord *ww;
struct _CamelTextIndexRoot *rb;
gint ret = 0, wfrag, nfrag;
@@ -458,8 +442,8 @@ text_index_compress_nosync (CamelIndex *idx)
if (newidx == NULL)
return -1;
- newp = CAMEL_TEXT_INDEX_GET_PRIVATE (newidx);
- oldp = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
+ newp = CAMEL_TEXT_INDEX (newidx)->priv;
+ oldp = CAMEL_TEXT_INDEX (idx)->priv;
CAMEL_TEXT_INDEX_LOCK (idx, lock);
@@ -600,7 +584,7 @@ fail:
static gint
text_index_delete (CamelIndex *idx)
{
- CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
+ CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
gint ret = 0;
if (camel_block_file_delete (p->blocks) == -1)
@@ -614,7 +598,7 @@ text_index_delete (CamelIndex *idx)
static gint
text_index_rename (CamelIndex *idx, const gchar *path)
{
- CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
+ CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
gchar *newlink, *newblock;
gint err, ret;
@@ -650,7 +634,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_GET_PRIVATE (idx);
+ CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
return camel_partition_table_lookup (p->name_hash, name) != 0;
}
@@ -658,7 +642,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_GET_PRIVATE (idx);
+ CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
camel_key_t keyid;
CamelIndexName *idn;
struct _CamelTextIndexRoot *rb = (struct _CamelTextIndexRoot *)p->blocks->root;
@@ -736,7 +720,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_GET_PRIVATE (idx);
+ CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
camel_key_t keyid;
struct _CamelTextIndexRoot *rb = (struct _CamelTextIndexRoot *)p->blocks->root;
@@ -760,7 +744,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_GET_PRIVATE (idx);
+ CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
camel_key_t keyid;
camel_block_t data = 0;
guint flags;
@@ -786,7 +770,7 @@ text_index_find (CamelIndex *idx, const gchar *word)
static CamelIndexCursor *
text_index_words (CamelIndex *idx)
{
- CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
+ CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
return (CamelIndexCursor *)camel_text_index_key_cursor_new ((CamelTextIndex *)idx, p->word_index);
}
@@ -794,7 +778,7 @@ text_index_words (CamelIndex *idx)
static CamelIndexCursor *
text_index_names (CamelIndex *idx)
{
- CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
+ CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
return (CamelIndexCursor *)camel_text_index_key_cursor_new ((CamelTextIndex *)idx, p->name_index);
}
@@ -829,7 +813,7 @@ camel_text_index_class_init (CamelTextIndexClass *class)
static void
camel_text_index_init (CamelTextIndex *text_index)
{
- text_index->priv = CAMEL_TEXT_INDEX_GET_PRIVATE (text_index);
+ text_index->priv = G_TYPE_INSTANCE_GET_PRIVATE (text_index, CAMEL_TYPE_TEXT_INDEX, CamelTextIndexPrivate);
camel_dlist_init (&text_index->priv->word_cache);
text_index->priv->words = g_hash_table_new (g_str_hash, g_str_equal);
@@ -859,7 +843,7 @@ CamelTextIndex *
camel_text_index_new (const gchar *path, gint flags)
{
CamelTextIndex *idx = g_object_new (CAMEL_TYPE_TEXT_INDEX, NULL);
- CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
+ CamelTextIndexPrivate *p = idx->priv;
struct _CamelTextIndexRoot *rb;
gchar *link;
CamelBlock *bl;
@@ -1029,7 +1013,7 @@ camel_text_index_remove (const gchar *old)
void
camel_text_index_info (CamelTextIndex *idx)
{
- CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
+ CamelTextIndexPrivate *p = idx->priv;
struct _CamelTextIndexRoot *rb = (struct _CamelTextIndexRoot *)p->blocks->root;
gint frag;
@@ -1228,7 +1212,7 @@ dump_raw (GHashTable *map, gchar *path)
void
camel_text_index_dump (CamelTextIndex *idx)
{
- CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
+ CamelTextIndexPrivate *p = idx->priv;
#ifndef DUMP_RAW
camel_key_t keyid;
gchar *word;
@@ -1287,7 +1271,7 @@ camel_text_index_dump (CamelTextIndex *idx)
void
camel_text_index_validate (CamelTextIndex *idx)
{
- CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX_GET_PRIVATE (idx);
+ CamelTextIndexPrivate *p = idx->priv;
camel_key_t keyid;
gchar *word;
const gchar *name;
@@ -1418,7 +1402,7 @@ text_index_name_finalize (GObject *object)
{
CamelTextIndexNamePrivate *priv;
- priv = CAMEL_TEXT_INDEX_NAME_GET_PRIVATE (object);
+ priv = CAMEL_TEXT_INDEX_NAME (object)->priv;
g_hash_table_destroy (CAMEL_TEXT_INDEX_NAME (object)->parent.words);
@@ -1508,7 +1492,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_GET_PRIVATE (idn);
+ CamelTextIndexNamePrivate *p = CAMEL_TEXT_INDEX_NAME (idn)->priv;
const guchar *ptr, *ptrend;
guint32 c;
gchar utf8[8];
@@ -1562,8 +1546,7 @@ camel_text_index_name_class_init (CamelTextIndexNameClass *class)
static void
camel_text_index_name_init (CamelTextIndexName *text_index_name)
{
- text_index_name->priv =
- CAMEL_TEXT_INDEX_NAME_GET_PRIVATE (text_index_name);
+ text_index_name->priv = G_TYPE_INSTANCE_GET_PRIVATE (text_index_name, CAMEL_TYPE_TEXT_INDEX_NAME, CamelTextIndexNamePrivate);
text_index_name->parent.words = g_hash_table_new (
g_str_hash, g_str_equal);
@@ -1578,7 +1561,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 = CAMEL_TEXT_INDEX_NAME_GET_PRIVATE (idn);
+ CamelTextIndexNamePrivate *p = idn->priv;
cin->index = g_object_ref (idx);
cin->name = camel_mempool_strdup (p->pool, name);
@@ -1598,7 +1581,7 @@ text_index_cursor_finalize (GObject *object)
{
CamelTextIndexCursorPrivate *priv;
- priv = CAMEL_TEXT_INDEX_CURSOR_GET_PRIVATE (object);
+ priv = CAMEL_TEXT_INDEX_CURSOR (object)->priv;
g_free (priv->records);
g_free (priv->current);
@@ -1610,8 +1593,8 @@ text_index_cursor_finalize (GObject *object)
static const gchar *
text_index_cursor_next (CamelIndexCursor *idc)
{
- CamelTextIndexCursorPrivate *p = CAMEL_TEXT_INDEX_CURSOR_GET_PRIVATE (idc);
- CamelTextIndexPrivate *tip = CAMEL_TEXT_INDEX_GET_PRIVATE (idc->index);
+ CamelTextIndexCursorPrivate *p = CAMEL_TEXT_INDEX_CURSOR (idc)->priv;
+ CamelTextIndexPrivate *tip = CAMEL_TEXT_INDEX (idc->index)->priv;
guint flags;
c (printf ("Going to next cursor for word with data '%08x' next %08x\n", p->first, p->next));
@@ -1645,7 +1628,7 @@ text_index_cursor_next (CamelIndexCursor *idc)
static void
text_index_cursor_reset (CamelIndexCursor *idc)
{
- CamelTextIndexCursorPrivate *p = CAMEL_TEXT_INDEX_CURSOR_GET_PRIVATE (idc);
+ CamelTextIndexCursorPrivate *p = CAMEL_TEXT_INDEX_CURSOR (idc)->priv;
g_free (p->records);
p->records = NULL;
@@ -1675,8 +1658,7 @@ camel_text_index_cursor_class_init (CamelTextIndexCursorClass *class)
static void
camel_text_index_cursor_init (CamelTextIndexCursor *text_index_cursor)
{
- text_index_cursor->priv =
- CAMEL_TEXT_INDEX_CURSOR_GET_PRIVATE (text_index_cursor);
+ text_index_cursor->priv = G_TYPE_INSTANCE_GET_PRIVATE (text_index_cursor, CAMEL_TYPE_TEXT_INDEX_CURSOR, CamelTextIndexCursorPrivate);
}
CamelTextIndexCursor *
@@ -1684,7 +1666,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 = CAMEL_TEXT_INDEX_CURSOR_GET_PRIVATE (idc);
+ CamelTextIndexCursorPrivate *p = idc->priv;
cic->index = g_object_ref (idx);
p->first = data;
@@ -1706,7 +1688,7 @@ text_index_key_cursor_dispose (GObject *object)
{
CamelTextIndexKeyCursorPrivate *priv;
- priv = CAMEL_TEXT_INDEX_KEY_CURSOR_GET_PRIVATE (object);
+ priv = CAMEL_TEXT_INDEX_KEY_CURSOR (object)->priv;
if (priv->table != NULL) {
g_object_unref (priv->table);
@@ -1722,7 +1704,7 @@ text_index_key_cursor_finalize (GObject *object)
{
CamelTextIndexKeyCursorPrivate *priv;
- priv = CAMEL_TEXT_INDEX_KEY_CURSOR_GET_PRIVATE (object);
+ priv = CAMEL_TEXT_INDEX_KEY_CURSOR (object)->priv;
g_free (priv->current);
@@ -1733,7 +1715,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_GET_PRIVATE (idc);
+ CamelTextIndexKeyCursorPrivate *p = CAMEL_TEXT_INDEX_KEY_CURSOR (idc)->priv;
c (printf ("Going to next cursor for keyid %08x\n", p->keyid));
@@ -1755,7 +1737,7 @@ text_index_key_cursor_next (CamelIndexCursor *idc)
static void
text_index_key_cursor_reset (CamelIndexCursor *idc)
{
- CamelTextIndexKeyCursorPrivate *p = CAMEL_TEXT_INDEX_KEY_CURSOR_GET_PRIVATE (idc);
+ CamelTextIndexKeyCursorPrivate *p = CAMEL_TEXT_INDEX_KEY_CURSOR (idc)->priv;
p->keyid = 0;
p->flags = 0;
@@ -1784,9 +1766,7 @@ 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 =
- CAMEL_TEXT_INDEX_KEY_CURSOR_GET_PRIVATE (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->keyid = 0;
text_index_key_cursor->priv->flags = 0;
text_index_key_cursor->priv->data = 0;
@@ -1798,7 +1778,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 = CAMEL_TEXT_INDEX_KEY_CURSOR_GET_PRIVATE (idc);
+ CamelTextIndexKeyCursorPrivate *p = idc->priv;
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 aa31fc4..97e0970 100644
--- a/camel/camel-transport.c
+++ b/camel/camel-transport.c
@@ -32,10 +32,6 @@
#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 {
@@ -71,7 +67,7 @@ transport_finalize (GObject *object)
{
CamelTransportPrivate *priv;
- priv = CAMEL_TRANSPORT_GET_PRIVATE (object);
+ priv = CAMEL_TRANSPORT (object)->priv;
g_mutex_free (priv->send_lock);
@@ -164,7 +160,7 @@ camel_transport_class_init (CamelTransportClass *class)
static void
camel_transport_init (CamelTransport *transport)
{
- transport->priv = CAMEL_TRANSPORT_GET_PRIVATE (transport);
+ transport->priv = G_TYPE_INSTANCE_GET_PRIVATE (transport, CAMEL_TYPE_TRANSPORT, CamelTransportPrivate);
transport->priv->send_lock = g_mutex_new ();
}
diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c
index 21ff8ca..7257988 100644
--- a/camel/camel-vee-folder.c
+++ b/camel/camel-vee-folder.c
@@ -44,10 +44,6 @@
#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 */
@@ -336,7 +332,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 (CAMEL_VEE_FOLDER_GET_PRIVATE (vf)->folders, sub) == NULL) {
+ if (g_list_find (vf->priv->folders, sub) == NULL) {
camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
return;
}
@@ -756,7 +752,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 = CAMEL_VEE_FOLDER_GET_PRIVATE (vf);
+ CamelVeeFolderPrivate *p = vf->priv;
node = p->folders;
while (node) {
@@ -856,7 +852,7 @@ vee_folder_stop_folder (CamelVeeFolder *vf,
CamelFolder *sub,
GCancellable *cancellable)
{
- CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vf);
+ CamelVeeFolderPrivate *p = vf->priv;
gint i;
CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
@@ -886,7 +882,7 @@ vee_folder_stop_folder (CamelVeeFolder *vf,
camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
if (folder_unmatched != NULL) {
- CamelVeeFolderPrivate *up = CAMEL_VEE_FOLDER_GET_PRIVATE (folder_unmatched);
+ CamelVeeFolderPrivate *up = folder_unmatched->priv;
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 */
@@ -1006,7 +1002,7 @@ vee_folder_search_by_expression (CamelFolder *folder,
GPtrArray *matches, *result = g_ptr_array_new ();
gchar *expr;
CamelVeeFolder *vf = (CamelVeeFolder *)folder;
- CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vf);
+ CamelVeeFolderPrivate *p = vf->priv;
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;
@@ -1068,7 +1064,7 @@ vee_folder_search_by_uids (CamelFolder *folder,
GPtrArray *folder_uids = g_ptr_array_new ();
gchar *expr;
CamelVeeFolder *vf = (CamelVeeFolder *)folder;
- CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vf);
+ CamelVeeFolderPrivate *p = vf->priv;
GHashTable *searched = g_hash_table_new (NULL, NULL);
camel_vee_folder_lock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
@@ -1130,7 +1126,7 @@ vee_folder_count_by_expression (CamelFolder *folder,
gchar *expr;
guint32 count = 0;
CamelVeeFolder *vf = (CamelVeeFolder *)folder;
- CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vf);
+ CamelVeeFolderPrivate *p = vf->priv;
GHashTable *searched = g_hash_table_new (NULL, NULL);
CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
@@ -1160,7 +1156,7 @@ vee_folder_count_by_expression (CamelFolder *folder,
static void
vee_folder_delete (CamelFolder *folder)
{
- CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (folder);
+ CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER (folder)->priv;
/* NB: this is never called on UNMTACHED */
@@ -1185,7 +1181,7 @@ static void
vee_folder_freeze (CamelFolder *folder)
{
CamelVeeFolder *vfolder = (CamelVeeFolder *)folder;
- CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vfolder);
+ CamelVeeFolderPrivate *p = vfolder->priv;
GList *node;
camel_vee_folder_lock (vfolder, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
@@ -1208,7 +1204,7 @@ static void
vee_folder_thaw (CamelFolder *folder)
{
CamelVeeFolder *vfolder = (CamelVeeFolder *)folder;
- CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vfolder);
+ CamelVeeFolderPrivate *p = vfolder->priv;
GList *node;
camel_vee_folder_lock (vfolder, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
@@ -1286,7 +1282,7 @@ vee_folder_refresh_info_sync (CamelFolder *folder,
GError **error)
{
CamelVeeFolder *vf = (CamelVeeFolder *)folder;
- CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vf);
+ CamelVeeFolderPrivate *p = vf->priv;
GList *node, *list;
gboolean success = TRUE;
@@ -1319,7 +1315,7 @@ vee_folder_synchronize_sync (CamelFolder *folder,
GError **error)
{
CamelVeeFolder *vf = (CamelVeeFolder *)folder;
- CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vf);
+ CamelVeeFolderPrivate *p = vf->priv;
GList *node;
if (((CamelVeeSummary *)folder->summary)->fake_visible_count)
@@ -1409,7 +1405,7 @@ static void
vee_folder_set_expression (CamelVeeFolder *vee_folder,
const gchar *query)
{
- CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vee_folder);
+ CamelVeeFolderPrivate *p = vee_folder->priv;
GList *node;
camel_vee_folder_lock (vee_folder, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
@@ -1492,7 +1488,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 (CAMEL_VEE_FOLDER_GET_PRIVATE (folder_unmatched)->folders, source) != NULL;
+ still = g_list_find (folder_unmatched->priv->folders, source) != NULL;
camel_vee_folder_unlock (folder_unmatched, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
camel_vee_folder_hash_folder (source, hash);
}
@@ -1892,7 +1888,7 @@ vee_folder_folder_changed (CamelVeeFolder *vee_folder,
CamelFolder *sub,
CamelFolderChangeInfo *changes)
{
- CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vee_folder);
+ CamelVeeFolderPrivate *p = vee_folder->priv;
struct _folder_changed_msg *m;
CamelStore *parent_store;
CamelSession *session;
@@ -1970,7 +1966,7 @@ camel_vee_folder_init (CamelVeeFolder *vee_folder)
{
CamelFolder *folder = CAMEL_FOLDER (vee_folder);
- vee_folder->priv = CAMEL_VEE_FOLDER_GET_PRIVATE (vee_folder);
+ vee_folder->priv = G_TYPE_INSTANCE_GET_PRIVATE (vee_folder, CAMEL_TYPE_VEE_FOLDER, CamelVeeFolderPrivate);
folder->folder_flags |= (CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY |
CAMEL_FOLDER_HAS_SEARCH_CAPABILITY);
@@ -2076,7 +2072,7 @@ camel_vee_folder_set_expression (CamelVeeFolder *vf, const gchar *query)
void
camel_vee_folder_add_folder (CamelVeeFolder *vf, CamelFolder *sub)
{
- CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vf);
+ CamelVeeFolderPrivate *p = vf->priv;
gint i;
CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
@@ -2101,7 +2097,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 = CAMEL_VEE_FOLDER_GET_PRIVATE (folder_unmatched);
+ CamelVeeFolderPrivate *up = folder_unmatched->priv;
up->folders = g_list_append (
up->folders, g_object_ref (sub));
@@ -2142,7 +2138,7 @@ void
camel_vee_folder_remove_folder (CamelVeeFolder *vf,
CamelFolder *sub)
{
- CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vf);
+ CamelVeeFolderPrivate *p = vf->priv;
gint i;
CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
@@ -2172,7 +2168,7 @@ camel_vee_folder_remove_folder (CamelVeeFolder *vf,
camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
if (folder_unmatched != NULL) {
- CamelVeeFolderPrivate *up = CAMEL_VEE_FOLDER_GET_PRIVATE (folder_unmatched);
+ CamelVeeFolderPrivate *up = folder_unmatched->priv;
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 */
@@ -2245,7 +2241,7 @@ remove_folders (CamelFolder *folder,
void
camel_vee_folder_set_folders (CamelVeeFolder *vf, GList *folders)
{
- CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vf);
+ CamelVeeFolderPrivate *p = vf->priv;
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 7c8f5eb..fdbcd35 100644
--- a/camel/providers/groupwise/camel-groupwise-folder.c
+++ b/camel/providers/groupwise/camel-groupwise-folder.c
@@ -61,10 +61,6 @@ 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
@@ -3054,7 +3050,7 @@ camel_groupwise_folder_init (CamelGroupwiseFolder *gw_folder)
{
CamelFolder *folder = CAMEL_FOLDER (gw_folder);
- gw_folder->priv = CAMEL_GROUPWISE_FOLDER_GET_PRIVATE (gw_folder);
+ gw_folder->priv = G_TYPE_INSTANCE_GET_PRIVATE (gw_folder, CAMEL_TYPE_GROUPWISE_FOLDER, CamelGroupwiseFolderPrivate);
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 3afd18c..11fcfe7 100644
--- a/camel/providers/groupwise/camel-groupwise-store.c
+++ b/camel/providers/groupwise/camel-groupwise-store.c
@@ -53,10 +53,6 @@
#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 {
@@ -1590,8 +1586,7 @@ camel_groupwise_store_class_init (CamelGroupwiseStoreClass *class)
static void
camel_groupwise_store_init (CamelGroupwiseStore *groupwise_store)
{
- groupwise_store->priv =
- CAMEL_GROUPWISE_STORE_GET_PRIVATE (groupwise_store);
+ groupwise_store->priv = G_TYPE_INSTANCE_GET_PRIVATE (groupwise_store, CAMEL_TYPE_GROUPWISE_STORE, CamelGroupwiseStorePrivate);
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 acb4caf..b02b5e0 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -58,10 +58,6 @@
* 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 {
@@ -304,7 +300,7 @@ camel_imap_folder_init (CamelImapFolder *imap_folder)
{
CamelFolder *folder = CAMEL_FOLDER (imap_folder);
- imap_folder->priv = CAMEL_IMAP_FOLDER_GET_PRIVATE (imap_folder);
+ imap_folder->priv = G_TYPE_INSTANCE_GET_PRIVATE (imap_folder, CAMEL_TYPE_IMAP_FOLDER, CamelImapFolderPrivate);
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 f0218f2..91b03d1 100644
--- a/camel/providers/imap/camel-imap-wrapper.c
+++ b/camel/providers/imap/camel-imap-wrapper.c
@@ -31,10 +31,6 @@
#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;
};
@@ -148,7 +144,7 @@ camel_imap_wrapper_class_init (CamelImapWrapperClass *class)
static void
camel_imap_wrapper_init (CamelImapWrapper *imap_wrapper)
{
- imap_wrapper->priv = CAMEL_IMAP_WRAPPER_GET_PRIVATE (imap_wrapper);
+ imap_wrapper->priv = G_TYPE_INSTANCE_GET_PRIVATE (imap_wrapper, CAMEL_TYPE_IMAP_WRAPPER, CamelImapWrapperPrivate);
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 b1b0728..f979f82 100644
--- a/camel/providers/imapx/camel-imapx-conn-manager.c
+++ b/camel/providers/imapx/camel-imapx-conn-manager.c
@@ -25,10 +25,6 @@
#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))
@@ -100,10 +96,7 @@ camel_imapx_conn_manager_class_init (CamelIMAPXConnManagerClass *class)
static void
camel_imapx_conn_manager_init (CamelIMAPXConnManager *con_man)
{
- CamelIMAPXConnManagerPrivate *priv;
-
- priv = g_new0 (CamelIMAPXConnManagerPrivate, 1);
- con_man->priv = priv;
+ con_man->priv = G_TYPE_INSTANCE_GET_PRIVATE (con_man, CAMEL_TYPE_OBJECT, CamelIMAPXConnManagerPrivate);
/* 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 c6bfbcb..90d0bf8 100644
--- a/camel/providers/local/camel-local-folder.c
+++ b/camel/providers/local/camel-local-folder.c
@@ -51,10 +51,6 @@
#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 {
@@ -478,7 +474,7 @@ camel_local_folder_init (CamelLocalFolder *local_folder)
{
CamelFolder *folder = CAMEL_FOLDER (local_folder);
- local_folder->priv = CAMEL_LOCAL_FOLDER_GET_PRIVATE (local_folder);
+ local_folder->priv = G_TYPE_INSTANCE_GET_PRIVATE (local_folder, CAMEL_TYPE_LOCAL_FOLDER, CamelLocalFolderPrivate);
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 9f324ea..cb97661 100644
--- a/camel/providers/local/camel-maildir-summary.c
+++ b/camel/providers/local/camel-maildir-summary.c
@@ -42,10 +42,6 @@
#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);
@@ -74,7 +70,7 @@ maildir_summary_finalize (GObject *object)
{
CamelMaildirSummaryPrivate *priv;
- priv = CAMEL_MAILDIR_SUMMARY_GET_PRIVATE (object);
+ priv = CAMEL_MAILDIR_SUMMARY (object)->priv;
g_free (priv->hostname);
g_mutex_free (priv->summary_lock);
@@ -120,8 +116,7 @@ camel_maildir_summary_init (CamelMaildirSummary *maildir_summary)
folder_summary = CAMEL_FOLDER_SUMMARY (maildir_summary);
- maildir_summary->priv =
- CAMEL_MAILDIR_SUMMARY_GET_PRIVATE (maildir_summary);
+ maildir_summary->priv = G_TYPE_INSTANCE_GET_PRIVATE (maildir_summary, CAMEL_TYPE_MAILDIR_SUMMARY, CamelMaildirSummaryPrivate);
/* 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 fa693e8..34a09c1 100644
--- a/camel/providers/local/camel-mh-summary.c
+++ b/camel/providers/local/camel-mh-summary.c
@@ -41,10 +41,6 @@
#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);*/
@@ -78,7 +74,7 @@ camel_mh_summary_init (CamelMhSummary *mh_summary)
{
CamelFolderSummary *folder_summary;
- mh_summary->priv = CAMEL_MH_SUMMARY_GET_PRIVATE (mh_summary);
+ mh_summary->priv = G_TYPE_INSTANCE_GET_PRIVATE (mh_summary, CAMEL_TYPE_MH_SUMMARY, CamelMhSummaryPrivate);
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 c8a663f..b464e53 100644
--- a/camel/providers/nntp/camel-nntp-folder.c
+++ b/camel/providers/nntp/camel-nntp-folder.c
@@ -39,10 +39,6 @@
#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
@@ -643,7 +639,7 @@ camel_nntp_folder_class_init (CamelNNTPFolderClass *class)
static void
camel_nntp_folder_init (CamelNNTPFolder *nntp_folder)
{
- nntp_folder->priv = CAMEL_NNTP_FOLDER_GET_PRIVATE (nntp_folder);
+ nntp_folder->priv = G_TYPE_INSTANCE_GET_PRIVATE (nntp_folder, CAMEL_TYPE_NNTP_FOLDER, CamelNNTPFolderPrivate);
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 0dd5edd..4ebc59e 100644
--- a/camel/providers/nntp/camel-nntp-store.c
+++ b/camel/providers/nntp/camel-nntp-store.c
@@ -54,10 +54,6 @@
#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
@@ -1388,7 +1384,7 @@ camel_nntp_store_init (CamelNNTPStore *nntp_store)
nntp_store->mem = (CamelStreamMem *)camel_stream_mem_new ();
- nntp_store->priv = CAMEL_NNTP_STORE_GET_PRIVATE (nntp_store);
+ nntp_store->priv = G_TYPE_INSTANCE_GET_PRIVATE (nntp_store, CAMEL_TYPE_NNTP_STORE, CamelNNTPStorePrivate);
}
/* Enter owning lock */
diff --git a/camel/providers/nntp/camel-nntp-summary.c b/camel/providers/nntp/camel-nntp-summary.c
index 82cf030..b6491d3 100644
--- a/camel/providers/nntp/camel-nntp-summary.c
+++ b/camel/providers/nntp/camel-nntp-summary.c
@@ -44,10 +44,6 @@
#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;
@@ -87,7 +83,7 @@ camel_nntp_summary_init (CamelNNTPSummary *nntp_summary)
{
CamelFolderSummary *summary = CAMEL_FOLDER_SUMMARY (nntp_summary);
- nntp_summary->priv = CAMEL_NNTP_SUMMARY_GET_PRIVATE (nntp_summary);
+ nntp_summary->priv = G_TYPE_INSTANCE_GET_PRIVATE (nntp_summary, CAMEL_TYPE_NNTP_SUMMARY, CamelNNTPSummaryPrivate);
/* and a unique file version */
summary->version += CAMEL_NNTP_SUMMARY_VERSION;
diff --git a/libedataserver/e-proxy.c b/libedataserver/e-proxy.c
index d743840..85af8bf 100644
--- a/libedataserver/e-proxy.c
+++ b/libedataserver/e-proxy.c
@@ -97,10 +97,6 @@ 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 */
@@ -161,7 +157,7 @@ e_proxy_dispose (GObject *object)
EProxyPrivate *priv;
GConfClient* client;
- priv = E_PROXY_GET_PRIVATE (object);
+ priv = E_PROXY (object)->priv;
client = gconf_client_get_default ();
@@ -228,7 +224,7 @@ e_proxy_class_init (EProxyClass *class)
static void
e_proxy_init (EProxy *proxy)
{
- proxy->priv = E_PROXY_GET_PRIVATE (proxy);
+ proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, E_TYPE_PROXY, EProxyPrivate);
proxy->priv->type = PROXY_TYPE_SYSTEM;
}
diff --git a/libedataserver/e-soap-message.c b/libedataserver/e-soap-message.c
index 32587b3..1fd1a26 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)
-typedef struct {
+struct _ESoapMessagePrivate {
/* Serialization fields */
xmlDocPtr doc;
xmlNodePtr last_node;
@@ -19,13 +19,12 @@ typedef struct {
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_GET_PRIVATE (object);
+ ESoapMessagePrivate *priv = E_SOAP_MESSAGE (object)->priv;
if (priv->doc)
xmlFreeDoc (priv->doc);
@@ -52,18 +51,18 @@ e_soap_message_class_init (ESoapMessageClass *e_soap_message_class)
static void
e_soap_message_init (ESoapMessage *msg)
{
- ESoapMessagePrivate *priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
+ msg->priv = G_TYPE_INSTANCE_GET_PRIVATE (msg, E_TYPE_SOAP_MESSAGE, ESoapMessagePrivate);
/* initialize XML structures */
- priv->doc = xmlNewDoc ((const xmlChar *)"1.0");
- priv->doc->standalone = FALSE;
- priv->doc->encoding = xmlCharStrdup ("UTF-8");
+ msg->priv->doc = xmlNewDoc ((const xmlChar *)"1.0");
+ msg->priv->doc->standalone = FALSE;
+ msg->priv->doc->encoding = xmlCharStrdup ("UTF-8");
}
static xmlNsPtr
fetch_ns (ESoapMessage *msg, const gchar *prefix, const gchar *ns_uri)
{
- ESoapMessagePrivate *priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
+ ESoapMessagePrivate *priv = msg->priv;
xmlNsPtr ns = NULL;
if (prefix && ns_uri)
@@ -141,7 +140,7 @@ e_soap_message_new_from_uri (const gchar *method, SoupURI *uri,
SOUP_MESSAGE_URI, uri,
NULL);
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
priv->doc->standalone = standalone;
@@ -172,7 +171,7 @@ e_soap_message_start_envelope (ESoapMessage *msg)
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
priv->last_node = priv->doc->xmlRootNode =
xmlNewDocNode (priv->doc, NULL, (const xmlChar *)"Envelope", NULL);
@@ -234,7 +233,7 @@ e_soap_message_start_body (ESoapMessage *msg)
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
if (priv->body_started)
return;
@@ -292,7 +291,7 @@ e_soap_message_start_element (ESoapMessage *msg,
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
priv->last_node = xmlNewChild (priv->last_node, NULL, (const xmlChar *)name, NULL);
@@ -317,7 +316,7 @@ e_soap_message_end_element (ESoapMessage *msg)
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
priv->last_node = priv->last_node->parent;
}
@@ -347,7 +346,7 @@ e_soap_message_start_fault (ESoapMessage *msg,
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
priv->last_node = xmlNewChild (priv->last_node,
priv->soap_ns,
@@ -393,7 +392,7 @@ e_soap_message_start_fault_detail (ESoapMessage *msg)
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
priv->last_node = xmlNewChild (priv->last_node,
priv->soap_ns,
@@ -435,7 +434,7 @@ e_soap_message_start_header (ESoapMessage *msg)
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
priv->last_node = xmlNewChild (priv->last_node, priv->soap_ns,
(const xmlChar *)"Header", NULL);
@@ -480,7 +479,7 @@ e_soap_message_start_header_element (ESoapMessage *msg,
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
e_soap_message_start_element (msg, name, prefix, ns_uri);
if (actor_uri)
@@ -588,7 +587,7 @@ e_soap_message_write_string (ESoapMessage *msg, const gchar *string)
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
xmlNodeAddContent (priv->last_node, (const xmlChar *)string);
}
@@ -610,7 +609,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 = E_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
xmlNodeAddContentLen (priv->last_node, (const xmlChar *)buffer, len);
}
@@ -631,7 +630,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 = E_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
xmlNewNsProp (priv->last_node, priv->xsi_ns, (const xmlChar *)"type", (const xmlChar *)xsi_type);
}
@@ -650,7 +649,7 @@ e_soap_message_set_null (ESoapMessage *msg)
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
xmlNewNsProp (priv->last_node, priv->xsi_ns, (const xmlChar *)"null", (const xmlChar *)"1");
}
@@ -677,7 +676,7 @@ e_soap_message_add_attribute (ESoapMessage *msg,
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
xmlNewNsProp (priv->last_node,
fetch_ns (msg, prefix, ns_uri),
@@ -700,7 +699,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 = E_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
xmlNewNs (priv->last_node, (const xmlChar *)(ns_uri ? ns_uri : ""), (const xmlChar *)prefix);
}
@@ -740,7 +739,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 = E_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
xmlNewNsProp (priv->last_node, priv->soap_ns, (const xmlChar *)"encodingStyle", (const xmlChar *)enc_style);
}
@@ -759,7 +758,7 @@ e_soap_message_reset (ESoapMessage *msg)
ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
xmlFreeDoc (priv->doc);
priv->doc = xmlNewDoc ((const xmlChar *)"1.0");
@@ -794,7 +793,7 @@ e_soap_message_persist (ESoapMessage *msg)
gint len;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
xmlDocDumpMemory (priv->doc, &body, &len);
@@ -823,7 +822,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 = E_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
g_return_val_if_fail (ns_uri != NULL, NULL);
ns = xmlSearchNsByHref (priv->doc, priv->last_node, (const xmlChar *)ns_uri);
@@ -854,7 +853,7 @@ e_soap_message_get_xml_doc (ESoapMessage *msg)
ESoapMessagePrivate *priv;
g_return_val_if_fail (E_IS_SOAP_MESSAGE (msg), NULL);
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
return priv->doc;
}
diff --git a/libedataserver/e-soap-message.h b/libedataserver/e-soap-message.h
index 053f169..bc92009 100644
--- a/libedataserver/e-soap-message.h
+++ b/libedataserver/e-soap-message.h
@@ -20,9 +20,12 @@ 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 ae59f63..3941571 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)
-typedef struct {
+struct _ESoapResponsePrivate {
/* the XML document */
xmlDocPtr xmldoc;
xmlNodePtr xml_root;
@@ -19,15 +19,14 @@ typedef struct {
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_GET_PRIVATE (object);
+ ESoapResponsePrivate *priv = E_SOAP_RESPONSE (object)->priv;
if (priv->xmldoc)
xmlFreeDoc (priv->xmldoc);
@@ -50,9 +49,8 @@ e_soap_response_class_init (ESoapResponseClass *e_soap_response_class)
static void
e_soap_response_init (ESoapResponse *response)
{
- ESoapResponsePrivate *priv = E_SOAP_RESPONSE_GET_PRIVATE (response);
-
- priv->xmldoc = xmlNewDoc ((const xmlChar *)"1.0");
+ response->priv = G_TYPE_INSTANCE_GET_PRIVATE (response, E_TYPE_SOAP_RESPONSE, ESoapResponsePrivate);
+ response->priv->xmldoc = xmlNewDoc ((const xmlChar *)"1.0");
}
/**
@@ -141,7 +139,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 = E_SOAP_RESPONSE_GET_PRIVATE (response);
+ priv = response->priv;
g_return_val_if_fail (xmlstr != NULL, FALSE);
/* clear the previous contents */
@@ -210,7 +208,7 @@ e_soap_response_get_method_name (ESoapResponse *response)
ESoapResponsePrivate *priv;
g_return_val_if_fail (E_IS_SOAP_RESPONSE (response), NULL);
- priv = E_SOAP_RESPONSE_GET_PRIVATE (response);
+ priv = response->priv;
g_return_val_if_fail (priv->xml_method != NULL, NULL);
return (const gchar *) priv->xml_method->name;
@@ -231,7 +229,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 = E_SOAP_RESPONSE_GET_PRIVATE (response);
+ priv = response->priv;
g_return_if_fail (priv->xml_method != NULL);
g_return_if_fail (method_name != NULL);
@@ -459,7 +457,7 @@ e_soap_response_get_parameters (ESoapResponse *response)
ESoapResponsePrivate *priv;
g_return_val_if_fail (E_IS_SOAP_RESPONSE (response), NULL);
- priv = E_SOAP_RESPONSE_GET_PRIVATE (response);
+ priv = response->priv;
return (const GList *) priv->parameters;
}
@@ -481,7 +479,7 @@ e_soap_response_get_first_parameter (ESoapResponse *response)
ESoapResponsePrivate *priv;
g_return_val_if_fail (E_IS_SOAP_RESPONSE (response), NULL);
- priv = E_SOAP_RESPONSE_GET_PRIVATE (response);
+ priv = response->priv;
return priv->parameters ? priv->parameters->data : NULL;
}
@@ -507,7 +505,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 = E_SOAP_RESPONSE_GET_PRIVATE (response);
+ priv = response->priv;
g_return_val_if_fail (name != NULL, NULL);
for (l = priv->parameters; l != NULL; l = l->next) {
@@ -540,7 +538,7 @@ e_soap_response_get_next_parameter (ESoapResponse *response,
GList *l;
g_return_val_if_fail (E_IS_SOAP_RESPONSE (response), NULL);
- priv = E_SOAP_RESPONSE_GET_PRIVATE (response);
+ priv = response->priv;
g_return_val_if_fail (from != NULL, NULL);
l = g_list_find (priv->parameters, (gconstpointer) from);
@@ -609,7 +607,7 @@ e_soap_response_dump_response (ESoapResponse *response, FILE *buffer)
xmlChar *xmlbuff;
gint buffersize, ret;
- ESoapResponsePrivate *priv = E_SOAP_RESPONSE_GET_PRIVATE (response);
+ ESoapResponsePrivate *priv = response->priv;
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 8b3dd1c..dab7b3d 100644
--- a/libedataserver/e-soap-response.h
+++ b/libedataserver/e-soap-response.h
@@ -18,9 +18,12 @@ 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 5428bad..d0131a7 100644
--- a/libedataserverui/e-categories-dialog.c
+++ b/libedataserverui/e-categories-dialog.c
@@ -30,10 +30,6 @@
#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 {
@@ -586,7 +582,7 @@ categories_dialog_dispose (GObject *object)
{
ECategoriesDialogPrivate *priv;
- priv = E_CATEGORIES_DIALOG_GET_PRIVATE (object);
+ priv = E_CATEGORIES_DIALOG (object)->priv;
g_hash_table_remove_all (priv->selected_categories);
@@ -599,7 +595,7 @@ categories_dialog_finalize (GObject *object)
{
ECategoriesDialogPrivate *priv;
- priv = E_CATEGORIES_DIALOG_GET_PRIVATE (object);
+ priv = E_CATEGORIES_DIALOG (object)->priv;
e_categories_unregister_change_listener (
G_CALLBACK (categories_dialog_listener_cb), object);
@@ -722,7 +718,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 = E_CATEGORIES_DIALOG_GET_PRIVATE (dialog);
+ dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (dialog, E_TYPE_CATEGORIES_DIALOG, ECategoriesDialogPrivate);
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 f6054df..226e8b0 100644
--- a/libedataserverui/e-category-completion.c
+++ b/libedataserverui/e-category-completion.c
@@ -25,10 +25,6 @@
#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 {
@@ -486,8 +482,7 @@ e_category_completion_class_init (ECategoryCompletionClass *class)
static void
e_category_completion_init (ECategoryCompletion *category_completion)
{
- category_completion->priv =
- E_CATEGORY_COMPLETION_GET_PRIVATE (category_completion);
+ category_completion->priv = G_TYPE_INSTANCE_GET_PRIVATE (category_completion, E_TYPE_CATEGORY_COMPLETION, ECategoryCompletionPrivate);
}
/**
diff --git a/libedataserverui/e-cell-renderer-color.c b/libedataserverui/e-cell-renderer-color.c
index 70c341c..f178b25 100644
--- a/libedataserverui/e-cell-renderer-color.c
+++ b/libedataserverui/e-cell-renderer-color.c
@@ -27,10 +27,6 @@
#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
@@ -108,7 +104,7 @@ cell_renderer_color_render (GtkCellRenderer *cell,
guint xpad;
guint ypad;
- priv = E_CELL_RENDERER_COLOR_GET_PRIVATE (cell);
+ priv = E_CELL_RENDERER_COLOR (cell)->priv;
if (priv->color == NULL)
return;
@@ -142,7 +138,7 @@ cell_renderer_color_set_property (GObject *object,
{
ECellRendererColorPrivate *priv;
- priv = E_CELL_RENDERER_COLOR_GET_PRIVATE (object);
+ priv = E_CELL_RENDERER_COLOR (object)->priv;
switch (property_id) {
case PROP_COLOR:
@@ -163,7 +159,7 @@ cell_renderer_color_get_property (GObject *object,
{
ECellRendererColorPrivate *priv;
- priv = E_CELL_RENDERER_COLOR_GET_PRIVATE (object);
+ priv = E_CELL_RENDERER_COLOR (object)->priv;
switch (property_id) {
case PROP_COLOR:
@@ -179,7 +175,7 @@ cell_renderer_color_finalize (GObject *object)
{
ECellRendererColorPrivate *priv;
- priv = E_CELL_RENDERER_COLOR_GET_PRIVATE (object);
+ priv = E_CELL_RENDERER_COLOR (object)->priv;
if (priv->color != NULL)
gdk_color_free (priv->color);
@@ -220,7 +216,7 @@ e_cell_renderer_color_class_init (ECellRendererColorClass *class)
static void
e_cell_renderer_color_init (ECellRendererColor *cellcolor)
{
- cellcolor->priv = E_CELL_RENDERER_COLOR_GET_PRIVATE (cellcolor);
+ cellcolor->priv = G_TYPE_INSTANCE_GET_PRIVATE (cellcolor, E_TYPE_CELL_RENDERER_COLOR, ECellRendererColorPrivate);
g_object_set (cellcolor, "xpad", 4, NULL);
}
diff --git a/libedataserverui/e-contact-store.c b/libedataserverui/e-contact-store.c
index c49d72d..bdcdfeb 100644
--- a/libedataserverui/e-contact-store.c
+++ b/libedataserverui/e-contact-store.c
@@ -38,10 +38,6 @@
(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;
@@ -106,7 +102,7 @@ contact_store_dispose (GObject *object)
EContactStorePrivate *priv;
gint ii;
- priv = E_CONTACT_STORE_GET_PRIVATE (object);
+ priv = E_CONTACT_STORE (object)->priv;
/* Free sources and cached contacts */
for (ii = 0; ii < priv->contact_sources->len; ii++) {
@@ -136,7 +132,7 @@ contact_store_finalize (GObject *object)
{
EContactStorePrivate *priv;
- priv = E_CONTACT_STORE_GET_PRIVATE (object);
+ priv = E_CONTACT_STORE (object)->priv;
g_array_free (priv->contact_sources, TRUE);
@@ -180,7 +176,7 @@ e_contact_store_init (EContactStore *contact_store)
contact_sources = g_array_new (FALSE, FALSE, sizeof (ContactSource));
- contact_store->priv = E_CONTACT_STORE_GET_PRIVATE (contact_store);
+ contact_store->priv = G_TYPE_INSTANCE_GET_PRIVATE (contact_store, E_TYPE_CONTACT_STORE, EContactStorePrivate);
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 0397aa5..4e2b8ff 100644
--- a/libedataserverui/e-destination-store.c
+++ b/libedataserverui/e-destination-store.c
@@ -38,10 +38,6 @@
(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;
@@ -96,7 +92,7 @@ destination_store_dispose (GObject *object)
EDestinationStorePrivate *priv;
gint ii;
- priv = E_DESTINATION_STORE_GET_PRIVATE (object);
+ priv = E_DESTINATION_STORE (object)->priv;
for (ii = 0; ii < priv->destinations->len; ii++) {
EDestination *destination;
@@ -116,7 +112,7 @@ destination_store_finalize (GObject *object)
{
EDestinationStorePrivate *priv;
- priv = E_DESTINATION_STORE_GET_PRIVATE (object);
+ priv = E_DESTINATION_STORE (object)->priv;
g_ptr_array_free (priv->destinations, TRUE);
@@ -156,8 +152,7 @@ e_destination_store_tree_model_init (GtkTreeModelIface *iface)
static void
e_destination_store_init (EDestinationStore *destination_store)
{
- destination_store->priv =
- E_DESTINATION_STORE_GET_PRIVATE (destination_store);
+ destination_store->priv = G_TYPE_INSTANCE_GET_PRIVATE (destination_store, E_TYPE_DESTINATION_STORE, EDestinationStorePrivate);
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 d64e7f7..3ab310f 100644
--- a/libedataserverui/e-name-selector-dialog.c
+++ b/libedataserverui/e-name-selector-dialog.c
@@ -35,10 +35,6 @@
#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;
@@ -165,8 +161,7 @@ e_name_selector_dialog_init (ENameSelectorDialog *name_selector_dialog)
GtkWidget *status_message;
GtkWidget *source_combo;
- name_selector_dialog->priv =
- E_NAME_SELECTOR_DIALOG_GET_PRIVATE (name_selector_dialog);
+ name_selector_dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (name_selector_dialog, E_TYPE_NAME_SELECTOR_DIALOG, ENameSelectorDialogPrivate);
name_selector_box = gtk_vbox_new (FALSE, 6);
gtk_widget_show (name_selector_box);
@@ -427,7 +422,7 @@ e_name_selector_dialog_finalize (GObject *object)
{
ENameSelectorDialogPrivate *priv;
- priv = E_NAME_SELECTOR_DIALOG_GET_PRIVATE (object);
+ priv = E_NAME_SELECTOR_DIALOG (object)->priv;
g_slist_foreach (priv->user_query_fields, (GFunc)g_free, NULL);
g_slist_free (priv->user_query_fields);
@@ -698,7 +693,7 @@ add_section (ENameSelectorDialog *name_selector_dialog,
g_assert (pretty_name != NULL);
g_assert (E_IS_DESTINATION_STORE (destination_store));
- priv = E_NAME_SELECTOR_DIALOG_GET_PRIVATE (name_selector_dialog);
+ priv = name_selector_dialog->priv;
memset (§ion, 0, sizeof (Section));
@@ -950,7 +945,7 @@ source_changed (ENameSelectorDialog *name_selector_dialog,
static void
search_changed (ENameSelectorDialog *name_selector_dialog)
{
- ENameSelectorDialogPrivate *priv = E_NAME_SELECTOR_DIALOG_GET_PRIVATE (name_selector_dialog);
+ ENameSelectorDialogPrivate *priv = name_selector_dialog->priv;
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 3a6740d..65a1581 100644
--- a/libedataserverui/e-name-selector-entry.c
+++ b/libedataserverui/e-name-selector-entry.c
@@ -34,10 +34,6 @@
#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;
@@ -105,7 +101,7 @@ name_selector_entry_dispose (GObject *object)
{
ENameSelectorEntryPrivate *priv;
- priv = E_NAME_SELECTOR_ENTRY_GET_PRIVATE (object);
+ priv = E_NAME_SELECTOR_ENTRY (object)->priv;
if (priv->attr_list != NULL) {
pango_attr_list_unref (priv->attr_list);
@@ -154,7 +150,7 @@ name_selector_entry_realize (GtkWidget *widget)
{
ENameSelectorEntryPrivate *priv;
- priv = E_NAME_SELECTOR_ENTRY_GET_PRIVATE (widget);
+ priv = E_NAME_SELECTOR_ENTRY (widget)->priv;
/* Chain up to parent's realize() method. */
GTK_WIDGET_CLASS (e_name_selector_entry_parent_class)->realize (widget);
@@ -605,7 +601,7 @@ set_completion_query (ENameSelectorEntry *name_selector_entry, const gchar *cue_
gchar *file_as_query_str;
gchar *user_fields_str;
- priv = E_NAME_SELECTOR_ENTRY_GET_PRIVATE (name_selector_entry);
+ priv = name_selector_entry->priv;
if (!name_selector_entry->priv->contact_store)
return;
@@ -904,7 +900,7 @@ type_ahead_complete (ENameSelectorEntry *name_selector_entry)
gchar *temp_str;
ENameSelectorEntryPrivate *priv;
- priv = E_NAME_SELECTOR_ENTRY_GET_PRIVATE (name_selector_entry);
+ priv = name_selector_entry->priv;
cursor_pos = gtk_editable_get_position (GTK_EDITABLE (name_selector_entry));
if (cursor_pos < 0)
@@ -975,7 +971,7 @@ clear_completion_model (ENameSelectorEntry *name_selector_entry)
{
ENameSelectorEntryPrivate *priv;
- priv = E_NAME_SELECTOR_ENTRY_GET_PRIVATE (name_selector_entry);
+ priv = name_selector_entry->priv;
if (!name_selector_entry->priv->contact_store)
return;
@@ -1577,7 +1573,7 @@ entry_activate (ENameSelectorEntry *name_selector_entry)
if (cursor_pos < 0)
return;
- priv = E_NAME_SELECTOR_ENTRY_GET_PRIVATE (name_selector_entry);
+ priv = name_selector_entry->priv;
text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry));
if (!get_range_at_position (text, cursor_pos, &range_start, &range_end))
@@ -2826,8 +2822,7 @@ e_name_selector_entry_init (ENameSelectorEntry *name_selector_entry)
GtkCellRenderer *renderer;
GConfClient *gconf;
- name_selector_entry->priv =
- E_NAME_SELECTOR_ENTRY_GET_PRIVATE (name_selector_entry);
+ name_selector_entry->priv = G_TYPE_INSTANCE_GET_PRIVATE (name_selector_entry, E_TYPE_NAME_SELECTOR_ENTRY, ENameSelectorEntryPrivate);
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 796567a..c9d819b 100644
--- a/libedataserverui/e-name-selector-list.c
+++ b/libedataserverui/e-name-selector-list.c
@@ -37,10 +37,6 @@
#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 {
@@ -624,8 +620,7 @@ e_name_selector_list_init (ENameSelectorList *list)
EDestinationStore *store;
GtkEntryCompletion *completion;
- list->priv = E_NAME_SELECTOR_LIST_GET_PRIVATE (list);
-
+ list->priv = G_TYPE_INSTANCE_GET_PRIVATE (list, E_TYPE_NAME_SELECTOR_LIST, ENameSelectorListPrivate);
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 0cd9e61..04681eb 100644
--- a/libedataserverui/e-name-selector-model.c
+++ b/libedataserverui/e-name-selector-model.c
@@ -29,10 +29,6 @@
#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;
@@ -74,8 +70,7 @@ 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 =
- E_NAME_SELECTOR_MODEL_GET_PRIVATE (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->sections = g_array_new (FALSE, FALSE, sizeof (Section));
name_selector_model->priv->contact_store = e_contact_store_new ();
@@ -99,7 +94,7 @@ name_selector_model_finalize (GObject *object)
ENameSelectorModelPrivate *priv;
gint i;
- priv = E_NAME_SELECTOR_MODEL_GET_PRIVATE (object);
+ priv = E_NAME_SELECTOR_MODEL (object)->priv;
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 c537ada..a0d265a 100644
--- a/libedataserverui/e-name-selector.c
+++ b/libedataserverui/e-name-selector.c
@@ -35,10 +35,6 @@
#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;
@@ -71,7 +67,7 @@ reset_pointer_cb (gpointer data, GObject *where_was)
g_return_if_fail (E_IS_NAME_SELECTOR (name_selector));
- priv = E_NAME_SELECTOR_GET_PRIVATE (name_selector);
+ priv = name_selector->priv;
for (ii = 0; ii < priv->sections->len; ii++) {
Section *section;
@@ -190,7 +186,7 @@ name_selector_dispose (GObject *object)
ENameSelectorPrivate *priv;
guint ii;
- priv = E_NAME_SELECTOR_GET_PRIVATE (object);
+ priv = E_NAME_SELECTOR (object)->priv;
if (priv->source_list != NULL) {
g_object_unref (priv->source_list);
@@ -227,7 +223,7 @@ name_selector_finalize (GObject *object)
{
ENameSelectorPrivate *priv;
- priv = E_NAME_SELECTOR_GET_PRIVATE (object);
+ priv = E_NAME_SELECTOR (object)->priv;
g_array_free (priv->source_books, TRUE);
g_array_free (priv->sections, TRUE);
@@ -257,7 +253,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 = E_NAME_SELECTOR_GET_PRIVATE (name_selector);
+ name_selector->priv = G_TYPE_INSTANCE_GET_PRIVATE (name_selector, E_TYPE_NAME_SELECTOR, ENameSelectorPrivate);
name_selector->priv->sections = sections;
name_selector->priv->model = e_name_selector_model_new ();
name_selector->priv->source_books = source_books;
@@ -419,7 +415,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 = E_NAME_SELECTOR_GET_PRIVATE (name_selector);
+ priv = name_selector->priv;
model = e_name_selector_peek_model (name_selector);
if (!e_name_selector_model_peek_section (
@@ -487,7 +483,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 = E_NAME_SELECTOR_GET_PRIVATE (name_selector);
+ priv = name_selector->priv;
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 8bd95cb..ce812e0 100644
--- a/libedataserverui/e-source-combo-box.c
+++ b/libedataserverui/e-source-combo-box.c
@@ -25,10 +25,6 @@
#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 {
@@ -264,7 +260,7 @@ e_source_combo_box_dispose (GObject *object)
{
ESourceComboBoxPrivate *priv;
- priv = E_SOURCE_COMBO_BOX_GET_PRIVATE (object);
+ priv = E_SOURCE_COMBO_BOX (object)->priv;
if (priv->source_list != NULL) {
g_signal_handler_disconnect (
@@ -284,7 +280,7 @@ e_source_combo_box_finalize (GObject *object)
{
ESourceComboBoxPrivate *priv;
- priv = E_SOURCE_COMBO_BOX_GET_PRIVATE (object);
+ priv = E_SOURCE_COMBO_BOX (object)->priv;
g_hash_table_destroy (priv->uid_index);
@@ -321,9 +317,7 @@ e_source_combo_box_class_init (ESourceComboBoxClass *class)
static void
e_source_combo_box_init (ESourceComboBox *source_combo_box)
{
- source_combo_box->priv =
- E_SOURCE_COMBO_BOX_GET_PRIVATE (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->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 0e34f2d..8a02f6e 100644
--- a/libedataserverui/e-source-selector.c
+++ b/libedataserverui/e-source-selector.c
@@ -30,10 +30,6 @@
#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;
@@ -1128,7 +1124,7 @@ source_selector_test_collapse_row (GtkTreeView *tree_view,
GtkTreeModel *model;
GtkTreeIter child_iter;
- priv = E_SOURCE_SELECTOR_GET_PRIVATE (tree_view);
+ priv = E_SOURCE_SELECTOR (tree_view)->priv;
/* Clear this because something else has been clicked on now */
priv->toggled_last = FALSE;
@@ -1164,7 +1160,7 @@ source_selector_row_expanded (GtkTreeView *tree_view,
GtkTreePath *child_path;
GtkTreeIter child_iter;
- priv = E_SOURCE_SELECTOR_GET_PRIVATE (tree_view);
+ priv = E_SOURCE_SELECTOR (tree_view)->priv;
if (!priv->saved_primary_selection)
return;
@@ -1303,7 +1299,7 @@ e_source_selector_init (ESourceSelector *selector)
GtkTreeStore *tree_store;
GtkTreeView *tree_view;
- selector->priv = E_SOURCE_SELECTOR_GET_PRIVATE (selector);
+ selector->priv = G_TYPE_INSTANCE_GET_PRIVATE (selector, E_TYPE_SOURCE_SELECTOR, ESourceSelectorPrivate);
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 e9846e8..2c4d09a 100644
--- a/libedataserverui/e-tree-model-generator.c
+++ b/libedataserverui/e-tree-model-generator.c
@@ -45,10 +45,6 @@
(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;
@@ -239,8 +235,7 @@ e_tree_model_generator_tree_model_init (GtkTreeModelIface *iface)
static void
e_tree_model_generator_init (ETreeModelGenerator *tree_model_generator)
{
- tree_model_generator->priv =
- E_TREE_MODEL_GENERATOR_GET_PRIVATE (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->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 5918091..549e250 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)
-typedef struct {
+struct _SoupSoapMessagePrivate {
/* Serialization fields */
xmlDocPtr doc;
xmlNodePtr last_node;
@@ -19,13 +19,12 @@ typedef struct {
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_GET_PRIVATE (object);
+ SoupSoapMessagePrivate *priv = SOUP_SOAP_MESSAGE (object)->priv;
if (priv->doc)
xmlFreeDoc (priv->doc);
@@ -52,18 +51,18 @@ soup_soap_message_class_init (SoupSoapMessageClass *soup_soap_message_class)
static void
soup_soap_message_init (SoupSoapMessage *msg)
{
- SoupSoapMessagePrivate *priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
+ msg->priv = G_TYPE_INSTANCE_GET_PRIVATE (msg, SOUP_TYPE_SOAP_MESSAGE, SoupSoapMessagePrivate);
/* initialize XML structures */
- priv->doc = xmlNewDoc ((const xmlChar *)"1.0");
- priv->doc->standalone = FALSE;
- priv->doc->encoding = xmlCharStrdup ("UTF-8");
+ msg->priv->doc = xmlNewDoc ((const xmlChar *)"1.0");
+ msg->priv->doc->standalone = FALSE;
+ msg->priv->doc->encoding = xmlCharStrdup ("UTF-8");
}
static xmlNsPtr
fetch_ns (SoupSoapMessage *msg, const gchar *prefix, const gchar *ns_uri)
{
- SoupSoapMessagePrivate *priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
+ SoupSoapMessagePrivate *priv = msg->priv;
xmlNsPtr ns = NULL;
if (prefix && ns_uri)
@@ -137,7 +136,7 @@ soup_soap_message_new_from_uri (const gchar *method, SoupURI *uri,
SOUP_MESSAGE_URI, uri,
NULL);
- priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
priv->doc->standalone = standalone;
@@ -166,7 +165,7 @@ soup_soap_message_start_envelope (SoupSoapMessage *msg)
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
priv->last_node = priv->doc->xmlRootNode =
xmlNewDocNode (priv->doc, NULL, (const xmlChar *)"Envelope", NULL);
@@ -224,7 +223,7 @@ soup_soap_message_start_body (SoupSoapMessage *msg)
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
if (priv->body_started)
return;
@@ -278,7 +277,7 @@ soup_soap_message_start_element (SoupSoapMessage *msg,
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
priv->last_node = xmlNewChild (priv->last_node, NULL, (const xmlChar *)name, NULL);
@@ -301,7 +300,7 @@ soup_soap_message_end_element (SoupSoapMessage *msg)
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
priv->last_node = priv->last_node->parent;
}
@@ -329,7 +328,7 @@ soup_soap_message_start_fault (SoupSoapMessage *msg,
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
priv->last_node = xmlNewChild (priv->last_node,
priv->soap_ns,
@@ -371,7 +370,7 @@ soup_soap_message_start_fault_detail (SoupSoapMessage *msg)
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
priv->last_node = xmlNewChild (priv->last_node,
priv->soap_ns,
@@ -409,7 +408,7 @@ soup_soap_message_start_header (SoupSoapMessage *msg)
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
priv->last_node = xmlNewChild (priv->last_node, priv->soap_ns,
(const xmlChar *)"Header", NULL);
@@ -450,7 +449,7 @@ soup_soap_message_start_header_element (SoupSoapMessage *msg,
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
soup_soap_message_start_element (msg, name, prefix, ns_uri);
if (actor_uri)
@@ -546,7 +545,7 @@ soup_soap_message_write_string (SoupSoapMessage *msg, const gchar *string)
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
xmlNodeAddContent (priv->last_node, (const xmlChar *)string);
}
@@ -566,7 +565,7 @@ soup_soap_message_write_buffer (SoupSoapMessage *msg, const gchar *buffer, gint
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
xmlNodeAddContentLen (priv->last_node, (const xmlChar *)buffer, len);
}
@@ -585,7 +584,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 = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
xmlNewNsProp (priv->last_node, priv->xsi_ns, (const xmlChar *)"type", (const xmlChar *)xsi_type);
}
@@ -602,7 +601,7 @@ soup_soap_message_set_null (SoupSoapMessage *msg)
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
xmlNewNsProp (priv->last_node, priv->xsi_ns, (const xmlChar *)"null", (const xmlChar *)"1");
}
@@ -627,7 +626,7 @@ soup_soap_message_add_attribute (SoupSoapMessage *msg,
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
xmlNewNsProp (priv->last_node,
fetch_ns (msg, prefix, ns_uri),
@@ -648,7 +647,7 @@ soup_soap_message_add_namespace (SoupSoapMessage *msg, const gchar *prefix, cons
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
xmlNewNs (priv->last_node, (const xmlChar *)(ns_uri ? ns_uri : ""), (const xmlChar *)prefix);
}
@@ -684,7 +683,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 = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
xmlNewNsProp (priv->last_node, priv->soap_ns, (const xmlChar *)"encodingStyle", (const xmlChar *)enc_style);
}
@@ -701,7 +700,7 @@ soup_soap_message_reset (SoupSoapMessage *msg)
SoupSoapMessagePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
xmlFreeDoc (priv->doc);
priv->doc = xmlNewDoc ((const xmlChar *)"1.0");
@@ -734,7 +733,7 @@ soup_soap_message_persist (SoupSoapMessage *msg)
gint len;
g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
- priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
xmlDocDumpMemory (priv->doc, &body, &len);
@@ -761,7 +760,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 = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
g_return_val_if_fail (ns_uri != NULL, NULL);
ns = xmlSearchNsByHref (priv->doc, priv->last_node, (const xmlChar *)ns_uri);
@@ -790,7 +789,7 @@ soup_soap_message_get_xml_doc (SoupSoapMessage *msg)
SoupSoapMessagePrivate *priv;
g_return_val_if_fail (SOUP_IS_SOAP_MESSAGE (msg), NULL);
- priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
+ priv = msg->priv;
return priv->doc;
}
diff --git a/servers/groupwise/soup-soap-message.h b/servers/groupwise/soup-soap-message.h
index 30caf29..07e09a2 100644
--- a/servers/groupwise/soup-soap-message.h
+++ b/servers/groupwise/soup-soap-message.h
@@ -20,9 +20,12 @@ 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 0bc0d40..185d0f6 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)
-typedef struct {
+struct _SoupSoapResponsePrivate {
/* the XML document */
xmlDocPtr xmldoc;
xmlNodePtr xml_root;
@@ -19,15 +19,14 @@ typedef struct {
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_GET_PRIVATE (object);
+ SoupSoapResponsePrivate *priv = SOUP_SOAP_RESPONSE (object)->priv;
if (priv->xmldoc)
xmlFreeDoc (priv->xmldoc);
@@ -50,9 +49,8 @@ soup_soap_response_class_init (SoupSoapResponseClass *soup_soap_response_class)
static void
soup_soap_response_init (SoupSoapResponse *response)
{
- SoupSoapResponsePrivate *priv = SOUP_SOAP_RESPONSE_GET_PRIVATE (response);
-
- priv->xmldoc = xmlNewDoc ((const xmlChar *)"1.0");
+ response->priv = G_TYPE_INSTANCE_GET_PRIVATE (response, SOUP_TYPE_SOAP_RESPONSE, SoupSoapResponsePrivate);
+ response->priv->xmldoc = xmlNewDoc ((const xmlChar *)"1.0");
}
/**
@@ -135,7 +133,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 = SOUP_SOAP_RESPONSE_GET_PRIVATE (response);
+ priv = response->priv;
g_return_val_if_fail (xmlstr != NULL, FALSE);
/* clear the previous contents */
@@ -202,7 +200,7 @@ soup_soap_response_get_method_name (SoupSoapResponse *response)
SoupSoapResponsePrivate *priv;
g_return_val_if_fail (SOUP_IS_SOAP_RESPONSE (response), NULL);
- priv = SOUP_SOAP_RESPONSE_GET_PRIVATE (response);
+ priv = response->priv;
g_return_val_if_fail (priv->xml_method != NULL, NULL);
return (const gchar *) priv->xml_method->name;
@@ -221,7 +219,7 @@ soup_soap_response_set_method_name (SoupSoapResponse *response, const gchar *met
SoupSoapResponsePrivate *priv;
g_return_if_fail (SOUP_IS_SOAP_RESPONSE (response));
- priv = SOUP_SOAP_RESPONSE_GET_PRIVATE (response);
+ priv = response->priv;
g_return_if_fail (priv->xml_method != NULL);
g_return_if_fail (method_name != NULL);
@@ -431,7 +429,7 @@ soup_soap_response_get_parameters (SoupSoapResponse *response)
SoupSoapResponsePrivate *priv;
g_return_val_if_fail (SOUP_IS_SOAP_RESPONSE (response), NULL);
- priv = SOUP_SOAP_RESPONSE_GET_PRIVATE (response);
+ priv = response->priv;
return (const GList *) priv->parameters;
}
@@ -451,7 +449,7 @@ soup_soap_response_get_first_parameter (SoupSoapResponse *response)
SoupSoapResponsePrivate *priv;
g_return_val_if_fail (SOUP_IS_SOAP_RESPONSE (response), NULL);
- priv = SOUP_SOAP_RESPONSE_GET_PRIVATE (response);
+ priv = response->priv;
return priv->parameters ? priv->parameters->data : NULL;
}
@@ -475,7 +473,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 = SOUP_SOAP_RESPONSE_GET_PRIVATE (response);
+ priv = response->priv;
g_return_val_if_fail (name != NULL, NULL);
for (l = priv->parameters; l != NULL; l = l->next) {
@@ -506,7 +504,7 @@ soup_soap_response_get_next_parameter (SoupSoapResponse *response,
GList *l;
g_return_val_if_fail (SOUP_IS_SOAP_RESPONSE (response), NULL);
- priv = SOUP_SOAP_RESPONSE_GET_PRIVATE (response);
+ priv = response->priv;
g_return_val_if_fail (from != NULL, NULL);
l = g_list_find (priv->parameters, (gconstpointer) from);
@@ -568,7 +566,7 @@ soup_soap_response_dump_response (SoupSoapResponse *response, FILE *buffer)
xmlChar *xmlbuff;
gint buffersize, ret;
- SoupSoapResponsePrivate *priv = SOUP_SOAP_RESPONSE_GET_PRIVATE (response);
+ SoupSoapResponsePrivate *priv = response->priv;
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 8490571..a444f5a 100644
--- a/servers/groupwise/soup-soap-response.h
+++ b/servers/groupwise/soup-soap-response.h
@@ -18,9 +18,12 @@ 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]