[evolution-data-server] Coding style and whitespace cleanup.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Coding style and whitespace cleanup.
- Date: Sun, 19 Aug 2012 18:17:34 +0000 (UTC)
commit 93b1561553eab1f5feac068e182d6c5dda0a8aa9
Author: Matthew Barnes <mbarnes redhat com>
Date: Thu Jul 12 08:12:33 2012 -0400
Coding style and whitespace cleanup.
addressbook/backends/file/e-book-backend-file.c | 28 +-
.../backends/google/e-book-backend-google.c | 6 +-
addressbook/backends/ldap/e-book-backend-ldap.c | 106 ++++----
addressbook/backends/vcf/e-book-backend-vcf.c | 24 +-
.../backends/webdav/e-book-backend-webdav.c | 62 ++--
addressbook/libebook/e-address-western.c | 2 +-
addressbook/libebook/e-book-view.c | 12 +-
addressbook/libebook/e-contact.c | 26 +-
addressbook/libebook/e-destination.c | 60 ++--
addressbook/libebook/e-vcard.c | 16 +-
addressbook/libedata-book/e-book-backend-cache.c | 2 +-
.../libedata-book/e-book-backend-db-cache.c | 2 +-
addressbook/libedata-book/e-book-backend-sexp.c | 4 +-
.../libedata-book/e-book-backend-sqlitedb.c | 40 ++--
addressbook/libegdbus/e-gdbus-book-factory.c | 7 +-
addressbook/libegdbus/e-gdbus-book-view.c | 99 +++++--
addressbook/libegdbus/e-gdbus-book.c | 228 ++++++++++++---
calendar/backends/caldav/e-cal-backend-caldav.c | 12 +-
.../backends/contacts/e-cal-backend-contacts.c | 8 +-
calendar/backends/file/e-cal-backend-file.c | 18 +-
calendar/backends/http/e-cal-backend-http.c | 14 +-
calendar/backends/weather/e-cal-backend-weather.c | 4 +-
calendar/backends/weather/e-weather-source.c | 12 +-
calendar/libecal/e-cal-check-timezones.c | 22 +-
calendar/libecal/e-cal-component.c | 4 +-
calendar/libecal/e-cal-recur.c | 2 +-
calendar/libecal/e-cal-system-timezone.c | 30 +-
calendar/libecal/e-cal.c | 4 +-
calendar/libedata-cal/e-cal-backend-intervaltree.c | 10 +-
calendar/libedata-cal/e-cal-backend-sexp.c | 8 +-
calendar/libedata-cal/e-cal-backend.c | 2 +-
calendar/libedata-cal/e-data-cal-view.c | 2 +-
calendar/libedata-cal/e-data-cal.c | 2 +-
calendar/libegdbus/e-gdbus-cal-factory.c | 7 +-
calendar/libegdbus/e-gdbus-cal-view.c | 97 +++++-
calendar/libegdbus/e-gdbus-cal.c | 315 ++++++++++++++++----
camel/camel-block-file.c | 54 ++--
camel/camel-data-cache.c | 4 +-
camel/camel-db.c | 48 ++--
camel/camel-debug.c | 10 +-
camel/camel-disco-diary.c | 12 +-
camel/camel-disco-folder.c | 2 +-
camel/camel-disco-store.c | 2 +-
camel/camel-filter-driver.c | 66 ++--
camel/camel-filter-search.c | 20 +-
camel/camel-folder-search.c | 166 +++++-----
camel/camel-folder-summary.c | 184 ++++++------
camel/camel-folder-thread.c | 64 ++--
camel/camel-gpg-context.c | 74 +++---
camel/camel-html-parser.c | 28 +-
camel/camel-iconv.c | 30 +-
camel/camel-imapx-command.c | 22 +-
camel/camel-imapx-conn-manager.c | 6 +-
camel/camel-imapx-folder.c | 4 +-
camel/camel-imapx-server.c | 302 ++++++++++----------
camel/camel-imapx-server.h | 2 +-
camel/camel-imapx-settings.c | 22 +-
camel/camel-imapx-store-summary.c | 32 +-
camel/camel-imapx-store.c | 28 +-
camel/camel-imapx-stream.c | 46 ++--
camel/camel-imapx-summary.c | 8 +-
camel/camel-imapx-utils.c | 86 +++---
camel/camel-index-control.c | 48 ++--
camel/camel-internet-address.c | 26 +-
camel/camel-lock-client.c | 32 +-
camel/camel-lock-helper.c | 24 +-
camel/camel-lock.c | 78 +++---
camel/camel-memchunk.c | 58 ++--
camel/camel-mime-filter-bestenc.c | 10 +-
camel/camel-mime-filter-canon.c | 4 +-
camel/camel-mime-filter-charset.c | 2 +-
camel/camel-mime-filter-from.c | 14 +-
camel/camel-mime-filter-html.c | 4 +-
camel/camel-mime-filter-tohtml.c | 6 +-
camel/camel-mime-filter-windows.c | 2 +-
camel/camel-mime-filter.c | 6 +-
camel/camel-mime-message.c | 38 ++--
camel/camel-mime-parser.c | 172 ++++++------
camel/camel-mime-part-utils.c | 18 +-
camel/camel-mime-part.c | 22 +-
camel/camel-mime-utils.c | 244 ++++++++--------
camel/camel-movemail.c | 32 +-
camel/camel-multipart-signed.c | 24 +-
camel/camel-multipart.c | 4 +-
camel/camel-net-utils.c | 16 +-
camel/camel-nntp-address.c | 4 +-
camel/camel-object.c | 2 +-
camel/camel-offline-folder.c | 2 +-
camel/camel-offline-settings.c | 4 +-
camel/camel-partition-table.c | 4 +-
camel/camel-provider.c | 4 +-
camel/camel-sasl-digest-md5.c | 4 +-
camel/camel-sasl-gssapi.c | 2 +-
camel/camel-sasl.c | 2 +-
camel/camel-search-private.c | 14 +-
camel/camel-search-sql-sexp.c | 156 +++++-----
camel/camel-sexp.c | 150 +++++-----
camel/camel-smime-context.c | 2 +-
camel/camel-store-settings.c | 2 +-
camel/camel-store.c | 16 +-
camel/camel-stream-filter.c | 24 +-
camel/camel-tcp-stream-ssl.c | 42 ++--
camel/camel-text-index.c | 12 +-
camel/camel-trie.c | 2 +-
camel/camel-url.c | 6 +-
camel/camel-utf8.c | 12 +-
camel/camel-vee-data-cache.c | 10 +-
camel/camel-vee-data-cache.h | 2 +-
camel/camel-vee-folder.c | 10 +-
camel/camel-vee-store.c | 4 +-
camel/camel-vee-summary.c | 8 +-
camel/camel.c | 6 +-
camel/db-scrap-tools/db.c | 28 +-
camel/providers/imap/camel-imap-command.c | 14 +-
camel/providers/imap/camel-imap-folder.c | 42 ++--
camel/providers/imap/camel-imap-journal.c | 14 +-
camel/providers/imap/camel-imap-message-cache.c | 2 +-
camel/providers/imap/camel-imap-search.c | 26 +-
camel/providers/imap/camel-imap-settings.c | 20 +-
camel/providers/imap/camel-imap-store-summary.c | 32 +-
camel/providers/imap/camel-imap-store.c | 62 ++--
camel/providers/imap/camel-imap-summary.c | 6 +-
camel/providers/imap/camel-imap-utils.c | 20 +-
camel/providers/imapx/camel-imapx-provider.c | 6 +-
camel/providers/local/camel-local-folder.c | 17 +-
camel/providers/local/camel-local-folder.h | 10 +-
camel/providers/local/camel-local-private.c | 3 +-
camel/providers/local/camel-local-private.h | 6 +-
camel/providers/local/camel-local-provider.c | 4 +-
camel/providers/local/camel-local-store.c | 33 +-
camel/providers/local/camel-local-summary.c | 64 ++--
camel/providers/local/camel-maildir-folder.c | 14 +-
camel/providers/local/camel-maildir-store.c | 56 ++--
camel/providers/local/camel-maildir-summary.c | 54 ++--
camel/providers/local/camel-mbox-folder.c | 16 +-
camel/providers/local/camel-mbox-store.c | 85 ++++--
camel/providers/local/camel-mbox-summary.c | 108 ++++----
camel/providers/local/camel-mh-folder.c | 14 +-
camel/providers/local/camel-mh-settings.c | 2 +-
camel/providers/local/camel-mh-store.c | 10 +-
camel/providers/local/camel-mh-summary.c | 26 +-
camel/providers/local/camel-mh-summary.h | 7 +-
camel/providers/local/camel-spool-folder.c | 3 +-
camel/providers/local/camel-spool-settings.c | 2 +-
camel/providers/local/camel-spool-store.c | 18 +-
camel/providers/local/camel-spool-summary.c | 26 +-
camel/providers/nntp/camel-nntp-folder.c | 2 +-
camel/providers/nntp/camel-nntp-provider.c | 3 +-
camel/providers/nntp/camel-nntp-settings.c | 6 +-
camel/providers/nntp/camel-nntp-store-summary.c | 12 +-
camel/providers/nntp/camel-nntp-store.c | 26 +-
camel/providers/nntp/camel-nntp-stream.c | 20 +-
camel/providers/pop3/camel-pop3-engine.c | 16 +-
camel/providers/pop3/camel-pop3-engine.h | 8 +-
camel/providers/pop3/camel-pop3-folder.c | 54 ++--
camel/providers/pop3/camel-pop3-folder.h | 9 +-
camel/providers/pop3/camel-pop3-provider.c | 19 +-
camel/providers/pop3/camel-pop3-settings.c | 12 +-
camel/providers/pop3/camel-pop3-store.c | 30 ++-
camel/providers/pop3/camel-pop3-stream.c | 23 +-
camel/providers/sendmail/camel-sendmail-provider.c | 3 +-
.../providers/sendmail/camel-sendmail-transport.c | 18 +-
camel/providers/smtp/camel-smtp-transport.c | 57 ++--
camel/providers/smtp/camel-smtp-transport.h | 3 +-
camel/tests/folder/test1.c | 4 +-
camel/tests/folder/test11.c | 12 +-
camel/tests/folder/test2.c | 8 +-
camel/tests/folder/test3.c | 34 +-
camel/tests/folder/test4.c | 6 +-
camel/tests/folder/test5.c | 8 +-
camel/tests/folder/test6.c | 10 +-
camel/tests/folder/test7.c | 10 +-
camel/tests/folder/test8.c | 8 +-
camel/tests/folder/test9.c | 6 +-
camel/tests/lib/addresses.c | 4 +-
camel/tests/lib/camel-test-provider.c | 6 +-
camel/tests/lib/camel-test.c | 28 +-
camel/tests/lib/folders.c | 8 +-
camel/tests/lib/messages.c | 4 +-
camel/tests/message/test1.c | 50 ++--
camel/tests/message/test2.c | 114 ++++----
camel/tests/message/test3.c | 90 +++---
camel/tests/mime-filter/test-tohtml.c | 14 +-
camel/tests/misc/split.c | 12 +-
camel/tests/misc/test1.c | 8 +-
camel/tests/misc/test2.c | 12 +-
libebackend/e-authentication-session.c | 9 +-
libebackend/e-collection-backend.c | 3 +-
libebackend/e-extension.c | 3 +-
libebackend/e-server-side-source.c | 8 +-
libedataserver/e-categories.c | 24 +-
libedataserver/e-data-server-util.c | 21 +-
libedataserver/e-debug-log.c | 112 ++++---
libedataserver/e-iterator.c | 16 +-
libedataserver/e-memory.c | 70 +++--
libedataserver/e-proxy.c | 50 ++--
libedataserver/e-sexp.c | 258 +++++++++-------
libedataserver/e-source-alarms.c | 2 +-
libedataserver/e-source-authenticator.c | 14 +-
libedataserver/e-source-autocomplete.c | 2 +-
libedataserver/e-source-collection.c | 6 +-
libedataserver/e-source-mail-composition.c | 2 +-
libedataserver/e-source-offline.c | 2 +-
libedataserver/e-source-openpgp.c | 6 +-
libedataserver/e-source-refresh.c | 3 -
libedataserver/e-source-selectable.c | 2 +-
libedataserver/e-source-smime.c | 10 +-
libedataserver/e-source-webdav.c | 6 +-
libedataserver/e-source.c | 6 +-
libedataserver/e-time-utils.c | 68 +++--
libedataserver/e-uid.c | 17 +-
libedataserver/e-url.c | 27 +-
libedataserver/e-xml-hash-utils.c | 17 +-
libedataserverui/e-categories-editor.c | 3 +-
libedataserverui/e-categories-selector.c | 12 +-
libedataserverui/e-category-editor.c | 2 +-
libedataserverui/e-contact-store.c | 61 ++--
libedataserverui/e-destination-store.c | 19 +-
libedataserverui/e-name-selector-dialog.c | 137 ++++++----
libedataserverui/e-name-selector-entry.c | 245 +++++++++------
libedataserverui/e-name-selector-list.c | 99 ++++---
libedataserverui/e-name-selector-model.c | 48 ++--
libedataserverui/e-passwords.c | 6 +-
libedataserverui/e-tree-model-generator.c | 49 ++--
tests/libebook/client/client-test-utils.c | 6 +-
tests/libebook/client/test-client-get-revision.c | 4 +-
tests/libebook/client/test-client-photo-is-uri.c | 2 +-
tests/libebook/client/test-client-revision-view.c | 6 +-
tests/libebook/client/test-client-uid-only-view.c | 6 +-
tests/libebook/ebook-test-utils.c | 126 ++++----
tests/libebook/test-categories.c | 6 +-
tests/libebook/test-changes.c | 2 +-
tests/libebook/test-ebook-async.c | 2 +-
tests/libebook/test-ebook-get-book-view.c | 8 +-
tests/libebook/test-ebook-remove-contact.c | 2 +-
tests/libebook/test-ebook-remove-contacts.c | 2 +-
tests/libebook/test-ebook.c | 2 +-
tests/libebook/test-stress-bookviews.c | 8 +-
tests/libecal/client/test-client-get-revision.c | 4 +-
tests/libecal/client/test-client-get-view.c | 8 +-
tests/libecal/client/test-client-revision-view.c | 12 +-
tests/libecal/ecal-test-utils.c | 132 ++++----
tests/libecal/test-ecal-create-object--2.c | 2 +-
tests/libecal/test-ecal-get-query.c | 10 +-
tests/libecal/test-ecal-receive-objects.c | 2 +-
tests/libecal/test-ecal-send-objects.c | 4 +-
246 files changed, 4120 insertions(+), 3317 deletions(-)
---
diff --git a/addressbook/backends/file/e-book-backend-file.c b/addressbook/backends/file/e-book-backend-file.c
index 2da5059..b90a38a 100644
--- a/addressbook/backends/file/e-book-backend-file.c
+++ b/addressbook/backends/file/e-book-backend-file.c
@@ -161,7 +161,7 @@ create_directory (const gchar *dirname,
else
g_propagate_error (error,
e_data_book_create_error_fmt (E_DATA_BOOK_STATUS_OTHER_ERROR,
- _("Failed to make directory %s: %s"),
+ _("Failed to make directory %s: %s"),
dirname, g_strerror (errno)));
return FALSE;
}
@@ -267,7 +267,7 @@ maybe_delete_uri (EBookBackendFile *bf,
if (bf->priv->photo_dirname &&
!strncmp (bf->priv->photo_dirname, filename, strlen (bf->priv->photo_dirname))) {
- d(g_print ("Deleting uri file: %s\n", filename));
+ d (g_print ("Deleting uri file: %s\n", filename));
/* Deleting uris should not cause the backend to fail to update
* a contact so the best we can do from here is log warnings
@@ -534,7 +534,7 @@ maybe_transform_vcard_field_for_photo (EBookBackendFile *bf,
e_contact_set (contact, field, new_photo);
- d(g_print ("Backend modified incomming binary blob to be %s:\n", uri));
+ d (g_print ("Backend modified incomming binary blob to be %s:\n", uri));
status = STATUS_MODIFIED;
@@ -609,7 +609,7 @@ maybe_transform_vcard_field_for_photo (EBookBackendFile *bf,
e_contact_set (contact, field, new_photo);
- d(g_print ("Backend modified incomming shared uri to be %s:\n", new_uri));
+ d (g_print ("Backend modified incomming shared uri to be %s:\n", new_uri));
e_contact_photo_free (new_photo);
status = STATUS_MODIFIED;
@@ -755,7 +755,7 @@ e_book_backend_file_create_unique_id (void)
* it's doubtful 2^32 id's will be created in a second, so we
* should be okay. */
static guint c = 0;
- return g_strdup_printf (PAS_ID_PREFIX "%08lX%08X", time(NULL), c++);
+ return g_strdup_printf (PAS_ID_PREFIX "%08lX%08X", time (NULL), c++);
}
static gchar *
@@ -1281,7 +1281,7 @@ e_book_backend_file_get_contact_list (EBookBackendSync *backend,
gboolean searched_summary = FALSE;
gboolean with_all_required_fields = FALSE;
- d(printf ("e_book_backend_file_get_contact_list (%s)\n", search));
+ d (printf ("e_book_backend_file_get_contact_list (%s)\n", search));
if (!db) {
g_propagate_error (perror, EDB_NOT_OPENED_ERROR);
@@ -1403,7 +1403,7 @@ e_book_backend_file_get_contact_list_uids (EBookBackendSync *backend,
GSList *uids = NULL;
gboolean searched = FALSE;
- d(printf ("e_book_backend_file_get_contact_list (%s)\n", search));
+ d (printf ("e_book_backend_file_get_contact_list (%s)\n", search));
if (!db) {
g_propagate_error (perror, EDB_NOT_OPENED_ERROR);
@@ -1484,7 +1484,7 @@ typedef struct {
static void
closure_destroy (FileBackendSearchClosure *closure)
{
- d(printf ("destroying search closure\n"));
+ d (printf ("destroying search closure\n"));
e_flag_free (closure->running);
g_free (closure);
}
@@ -1549,7 +1549,7 @@ book_view_thread (gpointer data)
}
bf = closure->bf;
- d(printf ("starting initial population of book view\n"));
+ d (printf ("starting initial population of book view\n"));
/* ref the book view because it'll be removed and unrefed
* when/if it's stopped */
@@ -1573,7 +1573,7 @@ book_view_thread (gpointer data)
allcontacts = FALSE;
}
- d(printf ("signalling parent thread\n"));
+ d (printf ("signalling parent thread\n"));
e_flag_set (closure->running);
summary_list = e_book_backend_sqlitedb_search (bf->priv->sqlitedb,
@@ -1660,7 +1660,7 @@ book_view_thread (gpointer data)
e_data_book_view_unref (book_view);
- d(printf ("finished population of book view\n"));
+ d (printf ("finished population of book view\n"));
return NULL;
}
@@ -1671,13 +1671,13 @@ e_book_backend_file_start_book_view (EBookBackend *backend,
{
FileBackendSearchClosure *closure = init_closure (book_view, E_BOOK_BACKEND_FILE (backend));
- d(printf ("starting book view thread\n"));
+ d (printf ("starting book view thread\n"));
closure->thread = g_thread_create (book_view_thread, book_view, TRUE, NULL);
e_flag_wait (closure->running);
/* at this point we know the book view thread is actually running */
- d(printf ("returning from start_book_view\n"));
+ d (printf ("returning from start_book_view\n"));
}
static void
@@ -1690,7 +1690,7 @@ e_book_backend_file_stop_book_view (EBookBackend *backend,
if (!closure)
return;
- d(printf ("stopping query\n"));
+ d (printf ("stopping query\n"));
need_join = e_flag_is_set (closure->running);
e_flag_clear (closure->running);
diff --git a/addressbook/backends/google/e-book-backend-google.c b/addressbook/backends/google/e-book-backend-google.c
index f23fa8b..0131c81 100644
--- a/addressbook/backends/google/e-book-backend-google.c
+++ b/addressbook/backends/google/e-book-backend-google.c
@@ -1272,7 +1272,7 @@ e_book_backend_google_create_contacts (EBookBackend *backend,
if (vcards->next != NULL) {
e_data_book_respond_create_contacts (book, opid,
EDB_ERROR_EX (NOT_SUPPORTED,
- _("The backend does not support bulk additions")),
+ _("The backend does not support bulk additions")),
NULL);
return;
}
@@ -1393,7 +1393,7 @@ e_book_backend_google_remove_contacts (EBookBackend *backend,
if (id_list->next != NULL) {
e_data_book_respond_remove_contacts (book, opid,
EDB_ERROR_EX (NOT_SUPPORTED,
- _("The backend does not support bulk removals")),
+ _("The backend does not support bulk removals")),
NULL);
return;
}
@@ -1671,7 +1671,7 @@ e_book_backend_google_modify_contacts (EBookBackend *backend,
if (vcards->next != NULL) {
e_data_book_respond_modify_contacts (book, opid,
EDB_ERROR_EX (NOT_SUPPORTED,
- _("The backend does not support bulk modifications")),
+ _("The backend does not support bulk modifications")),
NULL);
return;
}
diff --git a/addressbook/backends/ldap/e-book-backend-ldap.c b/addressbook/backends/ldap/e-book-backend-ldap.c
index 46df283..a85a7a5 100644
--- a/addressbook/backends/ldap/e-book-backend-ldap.c
+++ b/addressbook/backends/ldap/e-book-backend-ldap.c
@@ -385,30 +385,30 @@ static struct prop_info {
/* addresses */
COMPLEX_PROP (E_CONTACT_ADDRESS_LABEL_WORK, "postalAddress", work_address_populate, work_address_ber, work_address_compare),
- ADDRESS_STRING_PROP(E_CONTACT_ADDRESS_WORK, "l", work_city_populate),
- ADDRESS_STRING_PROP(E_CONTACT_ADDRESS_WORK, "st", work_state_populate),
- ADDRESS_STRING_PROP(E_CONTACT_ADDRESS_WORK, "postofficebox", work_po_populate),
- ADDRESS_STRING_PROP(E_CONTACT_ADDRESS_WORK, "postalcode", work_zip_populate),
- ADDRESS_STRING_PROP(E_CONTACT_ADDRESS_WORK, "c", work_country_populate),
+ ADDRESS_STRING_PROP (E_CONTACT_ADDRESS_WORK, "l", work_city_populate),
+ ADDRESS_STRING_PROP (E_CONTACT_ADDRESS_WORK, "st", work_state_populate),
+ ADDRESS_STRING_PROP (E_CONTACT_ADDRESS_WORK, "postofficebox", work_po_populate),
+ ADDRESS_STRING_PROP (E_CONTACT_ADDRESS_WORK, "postalcode", work_zip_populate),
+ ADDRESS_STRING_PROP (E_CONTACT_ADDRESS_WORK, "c", work_country_populate),
COMPLEX_PROP (E_CONTACT_ADDRESS_LABEL_HOME, "homePostalAddress", home_address_populate, home_address_ber, home_address_compare),
- ADDRESS_STRING_PROP(E_CONTACT_ADDRESS_HOME, "mozillaHomeLocalityName", home_city_populate),
- ADDRESS_STRING_PROP(E_CONTACT_ADDRESS_HOME, "mozillaHomeState", home_state_populate),
- ADDRESS_STRING_PROP(E_CONTACT_ADDRESS_HOME, "mozillaHomePostalCode", home_zip_populate),
- ADDRESS_STRING_PROP(E_CONTACT_ADDRESS_HOME, "mozillaHomeCountryName", home_country_populate),
+ ADDRESS_STRING_PROP (E_CONTACT_ADDRESS_HOME, "mozillaHomeLocalityName", home_city_populate),
+ ADDRESS_STRING_PROP (E_CONTACT_ADDRESS_HOME, "mozillaHomeState", home_state_populate),
+ ADDRESS_STRING_PROP (E_CONTACT_ADDRESS_HOME, "mozillaHomePostalCode", home_zip_populate),
+ ADDRESS_STRING_PROP (E_CONTACT_ADDRESS_HOME, "mozillaHomeCountryName", home_country_populate),
- E_COMPLEX_PROP(E_CONTACT_ADDRESS_LABEL_OTHER, "otherPostalAddress", other_address_populate, other_address_ber, other_address_compare),
+ E_COMPLEX_PROP (E_CONTACT_ADDRESS_LABEL_OTHER, "otherPostalAddress", other_address_populate, other_address_ber, other_address_compare),
/* photos */
BINARY_PROP (E_CONTACT_PHOTO, "jpegPhoto", photo_populate, photo_ber, photo_compare),
/* certificate foo. */
- BINARY_PROP (E_CONTACT_X509_CERT, "userCertificate", cert_populate, NULL/*XXX*/, NULL/*XXX*/),
+ BINARY_PROP (E_CONTACT_X509_CERT, "userCertificate", cert_populate, NULL/*XXX */, NULL/*XXX */),
#if 0
/* hm, which do we use? the inetOrgPerson schema says that
* userSMIMECertificate should be used in favor of
* userCertificate for S/MIME applications. */
- BINARY_PROP (E_CONTACT_X509_CERT, "userSMIMECertificate", cert_populate, NULL/*XXX*/, NULL/*XXX*/),
+ BINARY_PROP (E_CONTACT_X509_CERT, "userSMIMECertificate", cert_populate, NULL/*XXX */, NULL/*XXX */),
#endif
/* misc fields */
@@ -1021,7 +1021,7 @@ e_book_backend_ldap_connect (EBookBackendLDAP *bl,
g_get_current_time (&end);
diff = end.tv_sec * 1000 + end.tv_usec / 1000;
diff -= start.tv_sec * 1000 + start.tv_usec / 1000;
- printf("e_book_backend_ldap_connect took %ld.%03ld seconds\n",
+ printf ("e_book_backend_ldap_connect took %ld.%03ld seconds\n",
diff / 1000,diff % 1000);
}
return TRUE;
@@ -1110,7 +1110,7 @@ e_book_backend_ldap_reconnect (EBookBackendLDAP *bl,
g_get_current_time (&end);
diff = end.tv_sec * 1000 + end.tv_usec / 1000;
diff -= start.tv_sec * 1000 + start.tv_usec / 1000;
- printf("e_book_backend_ldap_reconnect took %ld.%03ld seconds\n",
+ printf ("e_book_backend_ldap_reconnect took %ld.%03ld seconds\n",
diff / 1000,diff % 1000);
}
@@ -1652,7 +1652,7 @@ e_book_backend_ldap_create_contacts (EBookBackend *backend,
if (vcards->next != NULL) {
e_data_book_respond_create_contacts (book, opid,
EDB_ERROR_EX (NOT_SUPPORTED,
- _("The backend does not support bulk additions")),
+ _("The backend does not support bulk additions")),
NULL);
return;
}
@@ -2019,7 +2019,7 @@ modify_contact_search_handler (LDAPOp *op,
if (!e) {
e_data_book_respond_modify_contacts (op->book,
op->opid,
- e_data_book_create_error_fmt (E_DATA_BOOK_STATUS_OTHER_ERROR, "%s: NULL returned from ldap_first_entry", G_STRFUNC),
+ e_data_book_create_error_fmt (E_DATA_BOOK_STATUS_OTHER_ERROR, "%s: NULL returned from ldap_first_entry", G_STRFUNC),
NULL);
ldap_op_finished (op);
return;
@@ -2309,7 +2309,7 @@ e_book_backend_ldap_modify_contacts (EBookBackend *backend,
if (vcards->next != NULL) {
e_data_book_respond_modify_contacts (book, opid,
EDB_ERROR_EX (NOT_SUPPORTED,
- _("The backend does not support bulk modifications")),
+ _("The backend does not support bulk modifications")),
NULL);
return;
}
@@ -2509,7 +2509,7 @@ e_book_backend_ldap_get_contact (EBookBackend *backend,
}
if (enable_debug) {
- printf("e_book_backend_ldap_get_contact ... \n");
+ printf ("e_book_backend_ldap_get_contact ... \n");
g_get_current_time (&start);
}
@@ -2518,7 +2518,7 @@ e_book_backend_ldap_get_contact (EBookBackend *backend,
g_static_rec_mutex_unlock (&eds_ldap_handler_lock);
e_data_book_respond_get_contact (book, opid, EDB_ERROR_NOT_CONNECTED (), NULL);
if (enable_debug)
- printf("e_book_backend_ldap_get_contact ... ldap handler is NULL\n");
+ printf ("e_book_backend_ldap_get_contact ... ldap handler is NULL\n");
return;
}
g_static_rec_mutex_unlock (&eds_ldap_handler_lock);
@@ -2543,11 +2543,11 @@ e_book_backend_ldap_get_contact (EBookBackend *backend,
get_contact_handler, get_contact_dtor);
if (enable_debug) {
- printf("e_book_backend_ldap_get_contact invoked get_contact_handler\n");
+ printf ("e_book_backend_ldap_get_contact invoked get_contact_handler\n");
g_get_current_time (&end);
diff = end.tv_sec * 1000 + end.tv_usec / 1000;
diff -= start.tv_sec * 1000 + start.tv_usec / 1000;
- printf("and took %ld.%03ld seconds\n",
+ printf ("and took %ld.%03ld seconds\n",
diff / 1000, diff % 1000);
}
} else {
@@ -2662,7 +2662,7 @@ contact_list_handler (LDAPOp *op,
g_get_current_time (&end);
diff = end.tv_sec * 1000 + end.tv_usec / 1000;
diff -= start.tv_sec * 1000 + start.tv_usec / 1000;
- printf("and took %ld.%03ld seconds\n", diff/1000, diff%1000);
+ printf ("and took %ld.%03ld seconds\n", diff / 1000, diff % 1000);
}
}
else {
@@ -2777,7 +2777,7 @@ e_book_backend_ldap_get_contact_list (EBookBackend *backend,
diff -= start.tv_sec * 1000 + start.tv_usec / 1000;
printf ("e_book_backend_ldap_get_contact_list invoked contact_list_handler ");
- printf ("and took %ld.%03ld seconds\n", diff/1000, diff%1000);
+ printf ("and took %ld.%03ld seconds\n", diff / 1000, diff % 1000);
}
} else {
e_data_book_respond_get_contact_list (book,
@@ -2876,7 +2876,7 @@ contact_list_uids_handler (LDAPOp *op,
g_get_current_time (&end);
diff = end.tv_sec * 1000 + end.tv_usec / 1000;
diff -= start.tv_sec * 1000 + start.tv_usec / 1000;
- printf("and took %ld.%03ld seconds\n", diff/1000, diff%1000);
+ printf ("and took %ld.%03ld seconds\n", diff / 1000, diff % 1000);
}
}
else {
@@ -2989,7 +2989,7 @@ e_book_backend_ldap_get_contact_list_uids (EBookBackend *backend,
diff -= start.tv_sec * 1000 + start.tv_usec / 1000;
printf ("e_book_backend_ldap_get_contact_list_uids invoked contact_list_uids_handler ");
- printf ("and took %ld.%03ld seconds\n", diff/1000, diff%1000);
+ printf ("and took %ld.%03ld seconds\n", diff / 1000, diff % 1000);
}
} else {
e_data_book_respond_get_contact_list_uids (book, opid, ldap_error_to_response (ldap_error), NULL);
@@ -3089,7 +3089,7 @@ member_populate (EContact *contact,
for (i = 0; values[i]; i++) {
EVCardAttribute *attr;
- member_info = g_strsplit (values [i], ";", -1);
+ member_info = g_strsplit (values[i], ";", -1);
attr = e_vcard_attribute_new (NULL, EVC_EMAIL);
e_vcard_attribute_add_param_with_value (attr, e_vcard_attribute_param_new (EVC_X_DEST_CONTACT_UID), member_info[1]);
@@ -3098,10 +3098,10 @@ member_populate (EContact *contact,
gint len = strlen (member_info[2]);
gchar *value;
- if (member_info [2][0] == '\"' && member_info [2][len - 1] == '\"')
- value = g_strdup_printf ("%s <%s>", member_info [2], member_info [0]);
+ if (member_info[2][0] == '\"' && member_info[2][len - 1] == '\"')
+ value = g_strdup_printf ("%s <%s>", member_info[2], member_info[0]);
else
- value = g_strdup_printf ("\"%s\" <%s>", member_info [2], member_info [0]);
+ value = g_strdup_printf ("\"%s\" <%s>", member_info[2], member_info[0]);
e_vcard_attribute_add_value (attr, value);
g_free (value);
@@ -3970,7 +3970,7 @@ func_and (struct _ESExp *f,
strings = g_new0 (gchar *, argc + 3);
strings[0] = g_strdup ("(&");
- strings[argc+3 - 2] = g_strdup (")");
+ strings[argc + 3 - 2] = g_strdup (")");
empty = 0;
for (i = 0; i < argc; i++) {
@@ -4016,7 +4016,7 @@ func_or (struct _ESExp *f,
strings = g_new0 (gchar *, argc + 3);
strings[0] = g_strdup ("(|");
- strings[argc+3 - 2] = g_strdup (")");
+ strings[argc + 3 - 2] = g_strdup (")");
empty = 0;
for (i = 0; i < argc; i++) {
@@ -4059,7 +4059,7 @@ func_not (struct _ESExp *f,
/* just replace the head of the list with the NOT of it. */
if (argc > 0) {
gchar *term = ldap_data->list->data;
- ldap_data->list->data = g_strdup_printf("(!%s)", term);
+ ldap_data->list->data = g_strdup_printf ("(!%s)", term);
g_free (term);
}
@@ -4107,7 +4107,7 @@ func_contains (struct _ESExp *f,
query_length = 3; /* strlen ("(|") + strlen (")") */
for (i = 0; i < G_N_ELEMENTS (prop_info); i++) {
- query_length += 1 /* strlen ("(") */ + strlen(prop_info[i].ldap_attr) + strlen (match_str);
+ query_length += 1 /* strlen ("(") */ + strlen (prop_info[i].ldap_attr) + strlen (match_str);
}
big_query = g_malloc0 (query_length + 1);
@@ -4128,7 +4128,7 @@ func_contains (struct _ESExp *f,
if (ldap_attr)
ldap_data->list = g_list_prepend (ldap_data->list,
- g_strdup_printf("(%s=*%s%s)",
+ g_strdup_printf ("(%s=*%s%s)",
ldap_attr,
str,
one_star ? "" : "*"));
@@ -4161,13 +4161,13 @@ func_is (struct _ESExp *f,
if (ldap_attr)
ldap_data->list = g_list_prepend (ldap_data->list,
- g_strdup_printf("(%s=%s)",
+ g_strdup_printf ("(%s=%s)",
ldap_attr, str));
else {
g_warning ("unknown query property\n");
/* we want something that'll always be false */
ldap_data->list = g_list_prepend (ldap_data->list,
- g_strdup("objectClass=MyBarnIsBiggerThanYourBarn"));
+ g_strdup ("objectClass=MyBarnIsBiggerThanYourBarn"));
}
g_free (str);
@@ -4218,15 +4218,15 @@ func_beginswith (struct _ESExp *f,
else if (!strcmp (ldap_attr, "fileAs")) {
if (ldap_data->bl->priv->evolutionPersonSupported)
ldap_data->list = g_list_prepend (ldap_data->list,
- g_strdup_printf("(|(fileAs=%s*)(&(!(fileAs=*))(sn=%s*)))",
+ g_strdup_printf ("(|(fileAs=%s*)(&(!(fileAs=*))(sn=%s*)))",
str, str));
else
ldap_data->list = g_list_prepend (ldap_data->list,
- g_strdup_printf("(sn=%s*)", str));
+ g_strdup_printf ("(sn=%s*)", str));
}
else {
ldap_data->list = g_list_prepend (ldap_data->list,
- g_strdup_printf("(%s=%s*)",
+ g_strdup_printf ("(%s=%s*)",
ldap_attr,
str));
}
@@ -4259,7 +4259,7 @@ func_endswith (struct _ESExp *f,
if (ldap_attr)
ldap_data->list = g_list_prepend (ldap_data->list,
- g_strdup_printf("(%s=*%s)",
+ g_strdup_printf ("(%s=*%s)",
ldap_attr,
str));
g_free (str);
@@ -4290,12 +4290,12 @@ func_exists (struct _ESExp *f,
gchar *big_query;
gchar *match_str;
- match_str = g_strdup("=*)");
+ match_str = g_strdup ("=*)");
query_length = 3; /* strlen ("(|") + strlen (")") */
for (i = 0; i < G_N_ELEMENTS (prop_info); i++) {
- query_length += 1 /* strlen ("(") */ + strlen(prop_info[i].ldap_attr) + strlen (match_str);
+ query_length += 1 /* strlen ("(") */ + strlen (prop_info[i].ldap_attr) + strlen (match_str);
}
big_query = g_malloc0 (query_length + 1);
@@ -4316,7 +4316,7 @@ func_exists (struct _ESExp *f,
if (ldap_attr)
ldap_data->list = g_list_prepend (ldap_data->list,
- g_strdup_printf("(%s=*)", ldap_attr));
+ g_strdup_printf ("(%s=*)", ldap_attr));
}
}
@@ -4560,7 +4560,7 @@ build_contact_from_entry (EBookBackendLDAP *bl,
/* get the email id for the given dn */
/* set base to DN and scope to base */
if (enable_debug)
- printf ("value (dn) = %s \n", values [j]);
+ printf ("value (dn) = %s \n", values[j]);
do {
g_static_rec_mutex_lock (&eds_ldap_handler_lock);
if ((ldap_error = ldap_search_ext_s (bl->priv->ldap,
@@ -4684,7 +4684,7 @@ poll_ldap (EBookBackendLDAP *bl)
g_static_rec_mutex_lock (&bl->priv->op_hash_mutex);
op = g_hash_table_lookup (bl->priv->id_to_op, &msgid);
- d(printf ("looked up msgid %d, got op %p\n", msgid, op));
+ d (printf ("looked up msgid %d, got op %p\n", msgid, op));
if (op && op->handler)
op->handler (op, res);
@@ -4714,7 +4714,7 @@ ldap_search_handler (LDAPOp *op,
GTimeVal start, end;
gulong diff;
- d(printf ("ldap_search_handler (%p)\n", view));
+ d (printf ("ldap_search_handler (%p)\n", view));
if (enable_debug)
g_get_current_time (&start);
@@ -4794,7 +4794,7 @@ ldap_search_handler (LDAPOp *op,
diff = end.tv_sec * 1000 + end.tv_usec / 1000;
diff -= start.tv_sec * 1000 + start.tv_usec / 1000;
printf ("ldap_search_handler... completed with error code %d ", ldap_error);
- printf ("and took %ld.%03ld seconds\n", diff/1000, diff%1000);
+ printf ("and took %ld.%03ld seconds\n", diff / 1000, diff % 1000);
}
}
else {
@@ -4811,7 +4811,7 @@ ldap_search_dtor (LDAPOp *op)
{
LDAPSearchOp *search_op = (LDAPSearchOp *) op;
- d(printf ("ldap_search_dtor (%p)\n", search_op->view));
+ d (printf ("ldap_search_dtor (%p)\n", search_op->view));
/* unhook us from our EDataBookView */
g_object_set_data (G_OBJECT (search_op->view), "EBookBackendLDAP.BookView::search_op", NULL);
@@ -4909,7 +4909,7 @@ e_book_backend_ldap_search (EBookBackendLDAP *bl,
} else {
LDAPSearchOp *op = g_new0 (LDAPSearchOp, 1);
- d(printf ("adding search_op (%p, %d)\n", view, search_msgid));
+ d (printf ("adding search_op (%p, %d)\n", view, search_msgid));
op->view = view;
op->aborted = FALSE;
@@ -4924,7 +4924,7 @@ e_book_backend_ldap_search (EBookBackendLDAP *bl,
g_get_current_time (&end);
diff = end.tv_sec * 1000 + end.tv_usec / 1000;
diff -= start.tv_sec * 1000 + start.tv_usec / 1000;
- printf("and took %ld.%03ld seconds\n", diff/1000,diff%1000);
+ printf ("and took %ld.%03ld seconds\n", diff / 1000,diff % 1000);
}
g_object_set_data (G_OBJECT (view), "EBookBackendLDAP.BookView::search_op", op);
@@ -4944,7 +4944,7 @@ e_book_backend_ldap_start_book_view (EBookBackend *backend,
{
EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (backend);
- d(printf ("start_book_view (%p)\n", view));
+ d (printf ("start_book_view (%p)\n", view));
e_book_backend_ldap_search (bl, NULL /* XXX ugh */, view);
}
@@ -4955,7 +4955,7 @@ e_book_backend_ldap_stop_book_view (EBookBackend *backend,
{
LDAPSearchOp *op;
- d(printf ("stop_book_view (%p)\n", view));
+ d (printf ("stop_book_view (%p)\n", view));
op = g_object_get_data (G_OBJECT (view), "EBookBackendLDAP.BookView::search_op");
if (op) {
@@ -5109,7 +5109,7 @@ generate_cache (EBookBackendLDAP *book_backend_ldap)
g_get_current_time (&end);
diff = end.tv_sec * 1000 + end.tv_usec / 1000;
diff -= start.tv_sec * 1000 + start.tv_usec / 1000;
- printf("and took %ld.%03ld seconds\n", diff/1000, diff%1000);
+ printf ("and took %ld.%03ld seconds\n", diff / 1000, diff % 1000);
}
} else {
generate_cache_dtor ((LDAPOp *) contact_list_op);
diff --git a/addressbook/backends/vcf/e-book-backend-vcf.c b/addressbook/backends/vcf/e-book-backend-vcf.c
index f115f9a..bb61b86 100644
--- a/addressbook/backends/vcf/e-book-backend-vcf.c
+++ b/addressbook/backends/vcf/e-book-backend-vcf.c
@@ -75,7 +75,7 @@ e_book_backend_vcf_create_unique_id (void)
* it's doubtful 2^32 id's will be created in a second, so we
* should be okay. */
static guint c = 0;
- return g_strdup_printf (PAS_ID_PREFIX "%08lX%08X", time(NULL), c++);
+ return g_strdup_printf (PAS_ID_PREFIX "%08lX%08X", time (NULL), c++);
}
static void
@@ -178,7 +178,7 @@ save_file (EBookBackendVCF *vcf)
}
if (0 > g_rename (new_path, vcf->priv->filename)) {
- g_warning ("Failed to rename %s: %s\n", vcf->priv->filename, g_strerror(errno));
+ g_warning ("Failed to rename %s: %s\n", vcf->priv->filename, g_strerror (errno));
g_unlink (new_path);
goto out;
}
@@ -284,7 +284,7 @@ e_book_backend_vcf_create_contacts (EBookBackendSync *backend,
if (vcards->next != NULL) {
g_propagate_error (perror,
EDB_ERROR_EX (NOT_SUPPORTED,
- _("The backend does not support bulk additions")));
+ _("The backend does not support bulk additions")));
return;
}
@@ -316,7 +316,7 @@ e_book_backend_vcf_remove_contacts (EBookBackendSync *backend,
if (id_list->next != NULL) {
g_propagate_error (perror,
EDB_ERROR_EX (NOT_SUPPORTED,
- _("The backend does not support bulk removals")));
+ _("The backend does not support bulk removals")));
return;
}
@@ -364,7 +364,7 @@ e_book_backend_vcf_modify_contacts (EBookBackendSync *backend,
if (vcards->next != NULL) {
g_propagate_error (perror,
EDB_ERROR_EX (NOT_SUPPORTED,
- _("The backend does not support bulk modifications")));
+ _("The backend does not support bulk modifications")));
return;
}
@@ -462,7 +462,7 @@ typedef struct {
static void
closure_destroy (VCFBackendSearchClosure *closure)
{
- d(printf ("destroying search closure\n"));
+ d (printf ("destroying search closure\n"));
e_flag_free (closure->running);
g_free (closure);
}
@@ -509,7 +509,7 @@ book_view_thread (gpointer data)
else
e_data_book_view_notify_progress (book_view, -1, _("Searching..."));
- d(printf ("signalling parent thread\n"));
+ d (printf ("signalling parent thread\n"));
e_flag_set (closure->running);
for (l = closure->bvcf->priv->contact_list; l; l = l->next) {
@@ -528,7 +528,7 @@ book_view_thread (gpointer data)
/* unref the book view */
e_data_book_view_unref (book_view);
- d(printf ("finished initial population of book view\n"));
+ d (printf ("finished initial population of book view\n"));
return NULL;
}
@@ -539,13 +539,13 @@ e_book_backend_vcf_start_book_view (EBookBackend *backend,
{
VCFBackendSearchClosure *closure = init_closure (book_view, E_BOOK_BACKEND_VCF (backend));
- d(printf ("starting book view thread\n"));
+ d (printf ("starting book view thread\n"));
closure->thread = g_thread_create (book_view_thread, book_view, TRUE, NULL);
e_flag_wait (closure->running);
/* at this point we know the book view thread is actually running */
- d(printf ("returning from start_book_view\n"));
+ d (printf ("returning from start_book_view\n"));
}
@@ -556,7 +556,7 @@ e_book_backend_vcf_stop_book_view (EBookBackend *backend,
VCFBackendSearchClosure *closure = get_closure (book_view);
gboolean need_join;
- d(printf ("stopping query\n"));
+ d (printf ("stopping query\n"));
need_join = e_flag_is_set (closure->running);
e_flag_clear (closure->running);
@@ -638,7 +638,7 @@ e_book_backend_vcf_open (EBookBackendSync *backend,
if (fd == -1) {
g_warning ("Failed to open addressbook at `%s'", dirname);
- g_warning ("error == %s", g_strerror(errno));
+ g_warning ("error == %s", g_strerror (errno));
g_propagate_error (
perror, e_data_book_create_error_fmt (
E_DATA_BOOK_STATUS_OTHER_ERROR,
diff --git a/addressbook/backends/webdav/e-book-backend-webdav.c b/addressbook/backends/webdav/e-book-backend-webdav.c
index 49ad65d..4f8d2ab 100644
--- a/addressbook/backends/webdav/e-book-backend-webdav.c
+++ b/addressbook/backends/webdav/e-book-backend-webdav.c
@@ -151,13 +151,13 @@ download_contact (EBookBackendWebdav *webdav,
status = soup_session_send_message (webdav->priv->session, message);
if (status != 200) {
- g_warning("Couldn't load '%s' (http status %d)", uri, status);
+ g_warning ("Couldn't load '%s' (http status %d)", uri, status);
g_object_unref (message);
return NULL;
}
if (message->response_body == NULL) {
- g_message("no response body after requesting '%s'", uri);
+ g_message ("no response body after requesting '%s'", uri);
g_object_unref (message);
return NULL;
}
@@ -167,12 +167,12 @@ download_contact (EBookBackendWebdav *webdav,
return NULL;
}
- etag = soup_message_headers_get(message->response_headers, "ETag");
+ etag = soup_message_headers_get (message->response_headers, "ETag");
/* we use our URI as UID */
contact = e_contact_new_from_vcard_with_uid (message->response_body->data, uri);
if (contact == NULL) {
- g_warning("Invalid vcard at '%s'", uri);
+ g_warning ("Invalid vcard at '%s'", uri);
g_object_unref (message);
return NULL;
}
@@ -211,7 +211,7 @@ upload_contact (EBookBackendWebdav *webdav,
uri = e_contact_get (contact, E_CONTACT_UID);
if (uri == NULL) {
- g_warning("can't upload contact without UID");
+ g_warning ("can't upload contact without UID");
return 400;
}
@@ -230,7 +230,7 @@ upload_contact (EBookBackendWebdav *webdav,
soup_message_headers_append (message->request_headers,
"If-None-Match", "*");
} else if (etag[0] == 'W' && etag[1] == '/') {
- g_warning("we only have a weak ETag, don't use If-Match synchronisation");
+ g_warning ("we only have a weak ETag, don't use If-Match synchronisation");
} else {
soup_message_headers_append (message->request_headers,
"If-Match", etag);
@@ -243,11 +243,11 @@ upload_contact (EBookBackendWebdav *webdav,
e_contact_set (contact, E_CONTACT_UID, NULL);
e_contact_set (contact, E_CONTACT_REV, NULL);
request = e_vcard_to_string (E_VCARD (contact), EVC_FORMAT_VCARD_30);
- soup_message_set_request(message, "text/vcard", SOUP_MEMORY_TEMPORARY,
+ soup_message_set_request (message, "text/vcard", SOUP_MEMORY_TEMPORARY,
request, strlen (request));
status = soup_session_send_message (webdav->priv->session, message);
- new_etag = soup_message_headers_get(message->response_headers, "ETag");
+ new_etag = soup_message_headers_get (message->response_headers, "ETag");
redir_uri = soup_message_headers_get (message->response_headers, "Location");
@@ -323,7 +323,7 @@ e_book_backend_webdav_create_contacts (EBookBackend *backend,
if (vcards->next != NULL) {
e_data_book_respond_create_contacts (book, opid,
EDB_ERROR_EX (NOT_SUPPORTED,
- _("The backend does not support bulk additions")),
+ _("The backend does not support bulk additions")),
NULL);
return;
}
@@ -335,7 +335,7 @@ e_book_backend_webdav_create_contacts (EBookBackend *backend,
/* do 3 rand() calls to construct a unique ID... poor way but should be
* good enough for us */
- uid = g_strdup_printf("%s%08X-%08X-%08X.vcf", priv->uri, rand(), rand(),
+ uid = g_strdup_printf ("%s%08X-%08X-%08X.vcf", priv->uri, rand (), rand (),
rand ());
contact = e_contact_new_from_vcard_with_uid (vcard, uid);
@@ -351,7 +351,7 @@ e_book_backend_webdav_create_contacts (EBookBackend *backend,
} else {
e_data_book_respond_create_contacts (book, opid,
e_data_book_create_error_fmt (E_DATA_BOOK_STATUS_OTHER_ERROR,
- _("Create resource '%s' failed with HTTP status: %d (%s)"), uid, status, status_reason),
+ _("Create resource '%s' failed with HTTP status: %d (%s)"), uid, status, status_reason),
NULL);
}
g_free (uid);
@@ -366,7 +366,7 @@ e_book_backend_webdav_create_contacts (EBookBackend *backend,
const gchar *new_uid;
EContact *new_contact;
- g_warning("Server didn't return etag for new address resource");
+ g_warning ("Server didn't return etag for new address resource");
new_uid = e_contact_get_const (contact, E_CONTACT_UID);
new_contact = download_contact (webdav, new_uid);
g_object_unref (contact);
@@ -430,7 +430,7 @@ e_book_backend_webdav_remove_contacts (EBookBackend *backend,
if (id_list->next != NULL) {
e_data_book_respond_remove_contacts (book, opid,
EDB_ERROR_EX (NOT_SUPPORTED,
- _("The backend does not support bulk removals")),
+ _("The backend does not support bulk removals")),
NULL);
return;
}
@@ -441,10 +441,10 @@ e_book_backend_webdav_remove_contacts (EBookBackend *backend,
e_data_book_respond_remove_contacts (book, opid,
webdav_handle_auth_request (webdav), NULL);
} else {
- g_warning("DELETE failed with HTTP status %d", status);
+ g_warning ("DELETE failed with HTTP status %d", status);
e_data_book_respond_remove_contacts (book, opid,
e_data_book_create_error_fmt (E_DATA_BOOK_STATUS_OTHER_ERROR,
- "DELETE failed with HTTP status %d", status),
+ "DELETE failed with HTTP status %d", status),
NULL);
}
return;
@@ -484,7 +484,7 @@ e_book_backend_webdav_modify_contacts (EBookBackend *backend,
if (vcards->next != NULL) {
e_data_book_respond_modify_contacts (book, opid,
EDB_ERROR_EX (NOT_SUPPORTED,
- _("The backend does not support bulk modifications")),
+ _("The backend does not support bulk modifications")),
NULL);
return;
}
@@ -529,7 +529,7 @@ e_book_backend_webdav_modify_contacts (EBookBackend *backend,
if (etag == NULL || (etag[0] == 'W' && etag[1] == '/')) {
EContact *new_contact;
- g_warning("Server didn't return etag for modified address resource");
+ g_warning ("Server didn't return etag for modified address resource");
new_contact = download_contact (webdav, uid);
if (new_contact != NULL) {
contact = new_contact;
@@ -653,7 +653,7 @@ parse_response_tag (const parser_strings_t *strings,
}
if (href == NULL) {
- g_warning("webdav returned response element without href");
+ g_warning ("webdav returned response element without href");
return NULL;
}
@@ -673,13 +673,13 @@ parse_propfind_response (xmlTextReaderPtr reader)
/* get internalized versions of some strings to avoid strcmp while
* parsing */
strings.multistatus
- = xmlTextReaderConstString(reader, BAD_CAST "multistatus");
- strings.dav = xmlTextReaderConstString(reader, BAD_CAST "DAV:");
- strings.href = xmlTextReaderConstString(reader, BAD_CAST "href");
- strings.response = xmlTextReaderConstString(reader, BAD_CAST "response");
- strings.propstat = xmlTextReaderConstString(reader, BAD_CAST "propstat");
- strings.prop = xmlTextReaderConstString(reader, BAD_CAST "prop");
- strings.getetag = xmlTextReaderConstString(reader, BAD_CAST "getetag");
+ = xmlTextReaderConstString (reader, BAD_CAST "multistatus");
+ strings.dav = xmlTextReaderConstString (reader, BAD_CAST "DAV:");
+ strings.href = xmlTextReaderConstString (reader, BAD_CAST "href");
+ strings.response = xmlTextReaderConstString (reader, BAD_CAST "response");
+ strings.propstat = xmlTextReaderConstString (reader, BAD_CAST "propstat");
+ strings.prop = xmlTextReaderConstString (reader, BAD_CAST "prop");
+ strings.getetag = xmlTextReaderConstString (reader, BAD_CAST "getetag");
while (xmlTextReaderRead (reader)
&& xmlTextReaderNodeType (reader) != XML_READER_TYPE_ELEMENT) {
@@ -687,7 +687,7 @@ parse_propfind_response (xmlTextReaderPtr reader)
if (xmlTextReaderConstLocalName (reader) != strings.multistatus
|| xmlTextReaderConstNamespaceUri (reader) != strings.dav) {
- g_warning("webdav PROPFIND result is not <DAV:multistatus>");
+ g_warning ("webdav PROPFIND result is not <DAV:multistatus>");
return NULL;
}
@@ -727,8 +727,8 @@ send_propfind (EBookBackendWebdav *webdav)
message = soup_message_new (SOUP_METHOD_PROPFIND, priv->uri);
soup_message_headers_append (message->request_headers, "User-Agent", USERAGENT);
soup_message_headers_append (message->request_headers, "Connection", "close");
- soup_message_headers_append(message->request_headers, "Depth", "1");
- soup_message_set_request(message, "text/xml", SOUP_MEMORY_TEMPORARY,
+ soup_message_headers_append (message->request_headers, "Depth", "1");
+ soup_message_set_request (message, "text/xml", SOUP_MEMORY_TEMPORARY,
(gchar *) request, strlen (request));
soup_session_send_message (priv->session, message);
@@ -853,7 +853,7 @@ check_addressbook_changed (EBookBackendWebdav *webdav,
if (txt && *txt) {
gint len = strlen (txt);
- if (*txt == '\"' && len > 2 && txt [len - 1] == '\"') {
+ if (*txt == '\"' && len > 2 && txt[len - 1] == '\"') {
/* dequote */
*new_ctag = g_strndup (txt + 1, len - 2);
} else {
@@ -943,7 +943,7 @@ download_contacts (EBookBackendWebdav *webdav,
return error;
}
if (message->response_body == NULL) {
- g_warning("No response body in webdav PROPFIND result");
+ g_warning ("No response body in webdav PROPFIND result");
g_object_unref (message);
g_free (new_ctag);
return e_data_book_create_error_fmt (E_DATA_BOOK_STATUS_OTHER_ERROR, "No response body in webdav PROPFIND result");
@@ -977,7 +977,7 @@ download_contacts (EBookBackendWebdav *webdav,
if (book_view != NULL) {
gfloat percent = 100.0 / count * i;
gchar buf[100];
- snprintf(buf, sizeof(buf), "Loading Contacts (%d%%)", (gint)percent);
+ snprintf (buf, sizeof (buf), "Loading Contacts (%d%%)", (gint) percent);
e_data_book_view_notify_progress (book_view, -1, buf);
}
diff --git a/addressbook/libebook/e-address-western.c b/addressbook/libebook/e-address-western.c
index ce57ea4..66034c4 100644
--- a/addressbook/libebook/e-address-western.c
+++ b/addressbook/libebook/e-address-western.c
@@ -203,7 +203,7 @@ e_address_western_extract_locality (gchar *line)
gint index;
/* Everything before the comma is the locality. */
- index = strcspn(line, ",");
+ index = strcspn (line, ",");
if (index == 0)
return NULL;
diff --git a/addressbook/libebook/e-book-view.c b/addressbook/libebook/e-book-view.c
index f24fc26..7db435f 100644
--- a/addressbook/libebook/e-book-view.c
+++ b/addressbook/libebook/e-book-view.c
@@ -314,21 +314,21 @@ e_book_view_class_init (EBookViewClass *class)
g_type_class_add_private (class, sizeof (EBookViewPrivate));
- signals [CONTACTS_CHANGED] = g_signal_new ("contacts_changed",
+ signals[CONTACTS_CHANGED] = g_signal_new ("contacts_changed",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EBookViewClass, contacts_changed),
NULL, NULL,
e_book_marshal_NONE__POINTER,
G_TYPE_NONE, 1, G_TYPE_POINTER);
- signals [CONTACTS_REMOVED] = g_signal_new ("contacts_removed",
+ signals[CONTACTS_REMOVED] = g_signal_new ("contacts_removed",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EBookViewClass, contacts_removed),
NULL, NULL,
e_book_marshal_NONE__POINTER,
G_TYPE_NONE, 1, G_TYPE_POINTER);
- signals [CONTACTS_ADDED] = g_signal_new ("contacts_added",
+ signals[CONTACTS_ADDED] = g_signal_new ("contacts_added",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EBookViewClass, contacts_added),
@@ -336,21 +336,21 @@ e_book_view_class_init (EBookViewClass *class)
e_book_marshal_NONE__POINTER,
G_TYPE_NONE, 1, G_TYPE_POINTER);
/* XXX The "sequence-complete" signal is deprecated. */
- signals [SEQUENCE_COMPLETE] = g_signal_new ("sequence_complete",
+ signals[SEQUENCE_COMPLETE] = g_signal_new ("sequence_complete",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EBookViewClass, sequence_complete),
NULL, NULL,
e_book_marshal_NONE__INT,
G_TYPE_NONE, 1, G_TYPE_UINT);
- signals [VIEW_COMPLETE] = g_signal_new ("view_complete",
+ signals[VIEW_COMPLETE] = g_signal_new ("view_complete",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EBookViewClass, view_complete),
NULL, NULL,
e_book_marshal_NONE__UINT_STRING,
G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING);
- signals [STATUS_MESSAGE] = g_signal_new ("status_message",
+ signals[STATUS_MESSAGE] = g_signal_new ("status_message",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EBookViewClass, status_message),
diff --git a/addressbook/libebook/e-contact.c b/addressbook/libebook/e-contact.c
index acab6fc..ebcfa9e 100644
--- a/addressbook/libebook/e-contact.c
+++ b/addressbook/libebook/e-contact.c
@@ -463,7 +463,7 @@ photo_getter (EContact *contact,
values = e_vcard_attribute_get_param (attr, EVC_TYPE);
if (values && values->data)
- photo->data.inlined.mime_type = g_strdup_printf("image/%s", (gchar *)values->data);
+ photo->data.inlined.mime_type = g_strdup_printf ("image/%s", (gchar *) values->data);
return photo;
}
}
@@ -696,7 +696,7 @@ n_setter (EContact *contact,
if (name->given && *name->given)
*(stringptr++) = name->given;
*stringptr = NULL;
- string = g_strjoinv(", ", strings);
+ string = g_strjoinv (", ", strings);
e_vcard_attribute_add_value (attr, string);
g_free (string);
@@ -1029,7 +1029,7 @@ e_contact_set_property (GObject *object,
if (!sval || !*sval)
return;
- d(printf ("adding new %s\n", info->vcard_field_name));
+ d (printf ("adding new %s\n", info->vcard_field_name));
attr = e_vcard_attribute_new (NULL, info->vcard_field_name);
e_vcard_append_attribute (E_VCARD (contact), attr);
@@ -1079,7 +1079,7 @@ e_contact_set_property (GObject *object,
e_vcard_attribute_add_value (attr, str);
}
else {
- d(printf ("removing %s\n", info->vcard_field_name));
+ d (printf ("removing %s\n", info->vcard_field_name));
e_vcard_remove_attribute (E_VCARD (contact), attr);
}
@@ -1098,7 +1098,7 @@ e_contact_set_property (GObject *object,
if (attr) {
if ((info->t & E_CONTACT_FIELD_TYPE_STRUCT && data)
|| (data && *(gchar *) data)) {
- d(printf ("overwriting existing %s\n", info->vcard_field_name));
+ d (printf ("overwriting existing %s\n", info->vcard_field_name));
/* remove all existing values and parameters.
* the setter will add the correct ones */
e_vcard_attribute_remove_values (attr);
@@ -1107,14 +1107,14 @@ e_contact_set_property (GObject *object,
info->struct_setter (contact, attr, data);
}
else {
- d(printf ("removing %s\n", info->vcard_field_name));
+ d (printf ("removing %s\n", info->vcard_field_name));
e_vcard_remove_attribute (E_VCARD (contact), attr);
}
}
else if ((info->t & E_CONTACT_FIELD_TYPE_STRUCT && data)
|| (data && *(gchar *) data)) {
- d(printf ("adding new %s\n", info->vcard_field_name));
+ d (printf ("adding new %s\n", info->vcard_field_name));
attr = e_vcard_attribute_new (NULL, info->vcard_field_name);
e_vcard_append_attribute (E_VCARD (contact), attr);
@@ -1128,7 +1128,7 @@ e_contact_set_property (GObject *object,
/* first we search for an attribute we can overwrite */
attr = e_vcard_get_attribute (E_VCARD (contact), info->vcard_field_name);
if (attr) {
- d(printf ("setting %s to `%s'\n", info->vcard_field_name, g_value_get_string (value)));
+ d (printf ("setting %s to `%s'\n", info->vcard_field_name, g_value_get_string (value)));
e_vcard_attribute_remove_values (attr);
e_vcard_attribute_add_value (attr, g_value_get_boolean (value) ? "TRUE" : "FALSE");
}
@@ -1155,13 +1155,13 @@ e_contact_set_property (GObject *object,
}
if (attr) {
- d(printf ("setting %s to `%s'\n", info->vcard_field_name, sval));
+ d (printf ("setting %s to `%s'\n", info->vcard_field_name, sval));
e_vcard_attribute_remove_values (attr);
if (sval) {
e_vcard_attribute_add_value (attr, sval);
}
else {
- d(printf ("removing %s\n", info->vcard_field_name));
+ d (printf ("removing %s\n", info->vcard_field_name));
e_vcard_remove_attribute (E_VCARD (contact), attr);
}
@@ -1519,7 +1519,7 @@ e_contact_get (EContact *contact,
if (attr) {
GList *v = e_vcard_attribute_get_values (attr);
- rv = v && v->data && !g_ascii_strcasecmp ((gchar *)v->data, "true");
+ rv = v && v->data && !g_ascii_strcasecmp ((gchar *) v->data, "true");
return rv ? (gpointer) "1" : NULL;
}
}
@@ -1738,7 +1738,7 @@ e_contact_set (EContact *contact,
EContactField field_id,
gconstpointer value)
{
- d(printf ("e_contact_set (%p, %d, %p)\n", contact, field_id, value));
+ d (printf ("e_contact_set (%p, %d, %p)\n", contact, field_id, value));
g_return_if_fail (contact && E_IS_CONTACT (contact));
g_return_if_fail (field_id >= 1 && field_id < E_CONTACT_FIELD_LAST);
@@ -1860,7 +1860,7 @@ e_contact_name_to_string (const EContactName *name)
if (name->suffixes && *name->suffixes)
*(stringptr++) = name->suffixes;
*stringptr = NULL;
- return g_strjoinv(" ", strings);
+ return g_strjoinv (" ", strings);
}
/**
diff --git a/addressbook/libebook/e-destination.c b/addressbook/libebook/e-destination.c
index 533eb67..96582d1 100644
--- a/addressbook/libebook/e-destination.c
+++ b/addressbook/libebook/e-destination.c
@@ -1321,34 +1321,34 @@ e_destination_xml_encode (const EDestination *dest)
g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
- dest_node = xmlNewNode (NULL, (xmlChar*)"destination");
+ dest_node = xmlNewNode (NULL, (xmlChar *)"destination");
str = e_destination_get_name (dest);
if (str)
- xmlNewTextChild (dest_node, NULL, (xmlChar*)"name", (xmlChar*)str);
+ xmlNewTextChild (dest_node, NULL, (xmlChar *)"name", (xmlChar *) str);
if (!e_destination_is_evolution_list (dest)) {
str = e_destination_get_email (dest);
if (str)
- xmlNewTextChild (dest_node, NULL, (xmlChar*)"email", (xmlChar*)str);
+ xmlNewTextChild (dest_node, NULL, (xmlChar *)"email", (xmlChar *) str);
} else {
GList *iter = dest->priv->list_dests;
while (iter) {
EDestination *list_dest = E_DESTINATION (iter->data);
- xmlNodePtr list_node = xmlNewNode (NULL, (xmlChar*)"list_entry");
+ xmlNodePtr list_node = xmlNewNode (NULL, (xmlChar *)"list_entry");
str = e_destination_get_name (list_dest);
if (str) {
xmlChar *escaped = xmlEncodeEntitiesReentrant (NULL, (xmlChar *) str);
- xmlNewTextChild (list_node, NULL, (xmlChar*)"name", escaped);
+ xmlNewTextChild (list_node, NULL, (xmlChar *)"name", escaped);
xmlFree (escaped);
}
str = e_destination_get_email (list_dest);
if (str) {
xmlChar *escaped = xmlEncodeEntitiesReentrant (NULL, (xmlChar *) str);
- xmlNewTextChild (list_node, NULL, (xmlChar*)"email", escaped);
+ xmlNewTextChild (list_node, NULL, (xmlChar *)"email", escaped);
xmlFree (escaped);
}
@@ -1357,15 +1357,15 @@ e_destination_xml_encode (const EDestination *dest)
iter = g_list_next (iter);
}
- xmlNewProp (dest_node, (xmlChar*)"is_list", (xmlChar*)"yes");
- xmlNewProp (dest_node, (xmlChar*)"show_addresses",
- e_destination_list_show_addresses (dest) ? (xmlChar*)"yes" : (xmlChar*)"no");
+ xmlNewProp (dest_node, (xmlChar *)"is_list", (xmlChar *)"yes");
+ xmlNewProp (dest_node, (xmlChar *)"show_addresses",
+ e_destination_list_show_addresses (dest) ? (xmlChar *)"yes" : (xmlChar *)"no");
}
str = e_destination_get_source_uid (dest);
if (str) {
xmlChar *escaped = xmlEncodeEntitiesReentrant (NULL, (xmlChar *) str);
- xmlNewTextChild (dest_node, NULL, (xmlChar*)"source_uid", escaped);
+ xmlNewTextChild (dest_node, NULL, (xmlChar *)"source_uid", escaped);
xmlFree (escaped);
}
@@ -1373,15 +1373,15 @@ e_destination_xml_encode (const EDestination *dest)
if (str) {
gchar buf[16];
- xmlNodePtr uri_node = xmlNewTextChild (dest_node, NULL, (xmlChar*)"card_uid", (xmlChar*)str);
+ xmlNodePtr uri_node = xmlNewTextChild (dest_node, NULL, (xmlChar *)"card_uid", (xmlChar *) str);
g_snprintf (buf, 16, "%d", e_destination_get_email_num (dest));
- xmlNewProp (uri_node, (xmlChar*)"email_num", (xmlChar*)buf);
+ xmlNewProp (uri_node, (xmlChar *)"email_num", (xmlChar *) buf);
}
- xmlNewProp (dest_node, (xmlChar*)"html_mail", e_destination_get_html_mail_pref (dest) ? (xmlChar*)"yes" : (xmlChar*)"no");
+ xmlNewProp (dest_node, (xmlChar *)"html_mail", e_destination_get_html_mail_pref (dest) ? (xmlChar *)"yes" : (xmlChar *)"no");
- xmlNewProp (dest_node, (xmlChar*)"auto_recipient",
- e_destination_is_auto_recipient (dest) ? (xmlChar*)"yes" : (xmlChar*)"no");
+ xmlNewProp (dest_node, (xmlChar *)"auto_recipient",
+ e_destination_is_auto_recipient (dest) ? (xmlChar *)"yes" : (xmlChar *)"no");
return dest_node;
}
@@ -1410,28 +1410,28 @@ e_destination_xml_decode (EDestination *dest,
g_return_val_if_fail (dest && E_IS_DESTINATION (dest), FALSE);
g_return_val_if_fail (node != NULL, FALSE);
- if (strcmp ((gchar *)node->name, "destination"))
+ if (strcmp ((gchar *) node->name, "destination"))
return FALSE;
- tmp = (gchar *)xmlGetProp (node, (xmlChar*)"html_mail");
+ tmp = (gchar *) xmlGetProp (node, (xmlChar *)"html_mail");
if (tmp) {
html_mail = !strcmp (tmp, "yes");
xmlFree (tmp);
}
- tmp = (gchar *)xmlGetProp (node, (xmlChar*)"is_list");
+ tmp = (gchar *) xmlGetProp (node, (xmlChar *)"is_list");
if (tmp) {
is_list = !strcmp (tmp, "yes");
xmlFree (tmp);
}
- tmp = (gchar *)xmlGetProp (node, (xmlChar*)"show_addresses");
+ tmp = (gchar *) xmlGetProp (node, (xmlChar *)"show_addresses");
if (tmp) {
show_addr = !strcmp (tmp, "yes");
xmlFree (tmp);
}
- tmp = (gchar *)xmlGetProp (node, (xmlChar*)"auto_recipient");
+ tmp = (gchar *) xmlGetProp (node, (xmlChar *)"auto_recipient");
if (tmp) {
auto_recip = !strcmp (tmp, "yes");
xmlFree (tmp);
@@ -1439,27 +1439,27 @@ e_destination_xml_decode (EDestination *dest,
node = node->xmlChildrenNode;
while (node) {
- if (!strcmp ((gchar *)node->name, "name")) {
+ if (!strcmp ((gchar *) node->name, "name")) {
tmp = (gchar *) xmlNodeGetContent (node);
g_free (name);
name = g_strdup (tmp);
xmlFree (tmp);
- } else if (!is_list && !strcmp ((gchar *)node->name, "email")) {
+ } else if (!is_list && !strcmp ((gchar *) node->name, "email")) {
tmp = (gchar *) xmlNodeGetContent (node);
g_free (email);
email = g_strdup (tmp);
xmlFree (tmp);
- } else if (is_list && !strcmp ((gchar *)node->name, "list_entry")) {
+ } else if (is_list && !strcmp ((gchar *) node->name, "list_entry")) {
xmlNodePtr subnode = node->xmlChildrenNode;
gchar *list_name = NULL, *list_email = NULL;
while (subnode) {
- if (!strcmp ((gchar *)subnode->name, "name")) {
+ if (!strcmp ((gchar *) subnode->name, "name")) {
tmp = (gchar *) xmlNodeGetContent (subnode);
g_free (list_name);
list_name = g_strdup (tmp);
xmlFree (tmp);
- } else if (!strcmp ((gchar *)subnode->name, "email")) {
+ } else if (!strcmp ((gchar *) subnode->name, "email")) {
tmp = (gchar *) xmlNodeGetContent (subnode);
g_free (list_email);
list_email = g_strdup (tmp);
@@ -1482,18 +1482,18 @@ e_destination_xml_decode (EDestination *dest,
list_dests = g_list_append (list_dests, list_dest);
}
- } else if (!strcmp ((gchar *)node->name, "source_uid")) {
+ } else if (!strcmp ((gchar *) node->name, "source_uid")) {
tmp = (gchar *) xmlNodeGetContent (node);
g_free (source_uid);
source_uid = g_strdup (tmp);
xmlFree (tmp);
- } else if (!strcmp ((gchar *)node->name, "card_uid")) {
+ } else if (!strcmp ((gchar *) node->name, "card_uid")) {
tmp = (gchar *) xmlNodeGetContent (node);
g_free (card_uid);
card_uid = g_strdup (tmp);
xmlFree (tmp);
- tmp = (gchar *)xmlGetProp (node, (xmlChar*)"email_num");
+ tmp = (gchar *) xmlGetProp (node, (xmlChar *)"email_num");
email_num = atoi (tmp);
xmlFree (tmp);
}
@@ -1654,7 +1654,7 @@ e_destination_exportv (EDestination **destv)
return NULL;
destv_doc = xmlNewDoc ((xmlChar *) XML_DEFAULT_VERSION);
- destv_node = xmlNewNode (NULL, (xmlChar*)"destinations");
+ destv_node = xmlNewNode (NULL, (xmlChar *)"destinations");
xmlDocSetRootElement (destv_doc, destv_node);
for (i = 0; destv[i]; i++) {
@@ -1701,7 +1701,7 @@ e_destination_importv (const gchar *str)
node = destv_doc->xmlRootNode;
- if (strcmp ((gchar *)node->name, "destinations"))
+ if (strcmp ((gchar *) node->name, "destinations"))
goto finished;
node = node->xmlChildrenNode;
diff --git a/addressbook/libebook/e-vcard.c b/addressbook/libebook/e-vcard.c
index a52370c..7bd5b81 100644
--- a/addressbook/libebook/e-vcard.c
+++ b/addressbook/libebook/e-vcard.c
@@ -659,9 +659,9 @@ parse (EVCard *evc,
buf = make_valid_utf8 (str);
- d(printf ("BEFORE FOLDING:\n"));
+ d (printf ("BEFORE FOLDING:\n"));
d (printf (str));
- d(printf ("\n\nAFTER FOLDING:\n"));
+ d (printf ("\n\nAFTER FOLDING:\n"));
d (printf (buf));
p = buf;
@@ -935,7 +935,7 @@ e_vcard_qp_encode (const gchar *txt)
count = 1; /* 1 for space needed for folding */
}
- g_string_append_printf (escaped, "=%2.2X", (unsigned char) *p++);
+ g_string_append_printf (escaped, "=%2.2X", (guchar) *p++);
count += 3;
}
@@ -1309,7 +1309,7 @@ e_vcard_dump_structure (EVCard *evc)
}
printf (" +- values=\n");
for (v = attr->values, i = 0; v; v = v->next, i++) {
- printf (" [%d] = `%s'\n", i, (gchar *)v->data);
+ printf (" [%d] = `%s'\n", i, (gchar *) v->data);
}
}
}
@@ -1668,8 +1668,8 @@ e_vcard_attribute_add_value_decoded (EVCardAttribute *attr,
/* make sure the decoded list is up to date */
e_vcard_attribute_get_values_decoded (attr);
- d(printf ("base64 encoded value: %s\n", b64_data));
- d(printf ("original length: %d\n", len));
+ d (printf ("base64 encoded value: %s\n", b64_data));
+ d (printf ("original length: %d\n", len));
attr->values = g_list_append (attr->values, b64_data);
attr->decoded_values = g_list_append (attr->decoded_values, decoded);
@@ -1965,8 +1965,8 @@ e_vcard_attribute_add_param (EVCardAttribute *attr,
}
if (param->values && param->values->data) {
- if (!g_ascii_strcasecmp ((gchar *)param->values->data, "b") ||
- !g_ascii_strcasecmp ((gchar *)param->values->data, "BASE64"))
+ if (!g_ascii_strcasecmp ((gchar *) param->values->data, "b") ||
+ !g_ascii_strcasecmp ((gchar *) param->values->data, "BASE64"))
attr->encoding = EVC_ENCODING_BASE64;
else if (!g_ascii_strcasecmp ((gchar *) param->values->data, EVC_QUOTEDPRINTABLE))
attr->encoding = EVC_ENCODING_QP;
diff --git a/addressbook/libedata-book/e-book-backend-cache.c b/addressbook/libedata-book/e-book-backend-cache.c
index 5e09b43..105ef77 100644
--- a/addressbook/libedata-book/e-book-backend-cache.c
+++ b/addressbook/libedata-book/e-book-backend-cache.c
@@ -212,7 +212,7 @@ e_book_backend_cache_get_contacts (EBookBackendCache *cache,
for (; l != NULL; l = g_slist_next (l)) {
vcard_str = l->data;
- if (vcard_str && !strncmp (vcard_str, "BEGIN:VCARD", 11)) {
+ if (vcard_str && !strncmp (vcard_str, "BEGIN:VCARD", 11)) {
contact = e_contact_new_from_vcard (vcard_str);
uid = e_contact_get_const (contact, E_CONTACT_UID);
if (contact && uid && *uid &&(query && e_book_backend_sexp_match_contact (sexp, contact)))
diff --git a/addressbook/libedata-book/e-book-backend-db-cache.c b/addressbook/libedata-book/e-book-backend-db-cache.c
index 3e7086d..61ff3d7 100644
--- a/addressbook/libedata-book/e-book-backend-db-cache.c
+++ b/addressbook/libedata-book/e-book-backend-db-cache.c
@@ -171,7 +171,7 @@ e_book_backend_db_cache_add_contact (DB *db,
uid = e_contact_get_const (contact, E_CONTACT_UID);
if (!uid) {
printf ("no uid\n");
- printf("name:%s, email:%s\n",
+ printf ("name:%s, email:%s\n",
(gchar *) e_contact_get (contact, E_CONTACT_GIVEN_NAME),
(gchar *) e_contact_get (contact, E_CONTACT_EMAIL_1));
return FALSE;
diff --git a/addressbook/libedata-book/e-book-backend-sexp.c b/addressbook/libedata-book/e-book-backend-sexp.c
index b5416ba..3947712 100644
--- a/addressbook/libedata-book/e-book-backend-sexp.c
+++ b/addressbook/libedata-book/e-book-backend-sexp.c
@@ -397,7 +397,7 @@ entry_compare (SearchContext *ctx,
propname = argv[0]->value.string;
- any_field = !strcmp(propname, "x-evolution-any-field");
+ any_field = !strcmp (propname, "x-evolution-any-field");
for (i = 0; i < G_N_ELEMENTS (prop_info_table); i++) {
if (any_field
|| !strcmp (prop_info_table[i].query_prop, propname)) {
@@ -420,7 +420,7 @@ entry_compare (SearchContext *ctx,
if (prop && compare (prop, argv[1]->value.string)) {
truth = TRUE;
}
- if ((!prop) && compare("", argv[1]->value.string)) {
+ if ((!prop) && compare ("", argv[1]->value.string)) {
truth = TRUE;
}
}
diff --git a/addressbook/libedata-book/e-book-backend-sqlitedb.c b/addressbook/libedata-book/e-book-backend-sqlitedb.c
index 7968a31..be37497 100644
--- a/addressbook/libedata-book/e-book-backend-sqlitedb.c
+++ b/addressbook/libedata-book/e-book-backend-sqlitedb.c
@@ -259,7 +259,7 @@ book_backend_sql_exec (sqlite3 *db,
}
if (ret != SQLITE_OK) {
- d(g_print ("Error in SQL EXEC statement: %s [%s].\n", stmt, errmsg));
+ d (g_print ("Error in SQL EXEC statement: %s [%s].\n", stmt, errmsg));
g_set_error (
error, E_BOOK_SDB_ERROR,
0, "%s", errmsg);
@@ -456,7 +456,7 @@ create_contacts_table (EBookBackendSqliteDB *ebsdb,
* rely on this. Assuming that the frequency of matching on these would be higher than
* on the other fields like email_2, surname etc. email_1 should be the primary email */
if (!err) {
- tmp = g_strdup_printf("FNINDEX-%s", folderid);
+ tmp = g_strdup_printf ("FNINDEX-%s", folderid);
stmt = sqlite3_mprintf ("CREATE INDEX IF NOT EXISTS %Q ON %Q (full_name)", tmp, folderid);
ret = book_backend_sql_exec (ebsdb->priv->db, stmt, NULL, NULL, &err);
g_free (tmp);
@@ -464,7 +464,7 @@ create_contacts_table (EBookBackendSqliteDB *ebsdb,
}
if (!err) {
- tmp = g_strdup_printf("EMINDEX-%s", folderid);
+ tmp = g_strdup_printf ("EMINDEX-%s", folderid);
stmt = sqlite3_mprintf ("CREATE INDEX IF NOT EXISTS %Q ON %Q (email_1)", tmp, folderid);
ret = book_backend_sql_exec (ebsdb->priv->db, stmt, NULL, NULL, &err);
g_free (tmp);
@@ -501,7 +501,7 @@ book_backend_sqlitedb_load (EBookBackendSqliteDB *ebsdb,
} else {
const gchar *errmsg;
errmsg = sqlite3_errmsg (priv->db);
- d(g_print("Can't open database %s: %s\n", path, errmsg));
+ d (g_print ("Can't open database %s: %s\n", path, errmsg));
g_set_error (
error, E_BOOK_SDB_ERROR,
0, "%s", errmsg);
@@ -566,7 +566,7 @@ e_book_backend_sqlitedb_new (const gchar *path,
}
}
- ebsdb = g_object_new (E_TYPE_BOOK_BACKEND_SQLITEDB, NULL);
+ ebsdb = g_object_new (E_TYPE_BOOK_BACKEND_SQLITEDB, NULL);
ebsdb->priv->path = g_strdup (path);
ebsdb->priv->store_vcard = store_vcard;
if (g_mkdir_with_parents (path, 0777) < 0) {
@@ -1202,7 +1202,7 @@ func_and (ESExp *f,
GString *string;
gint i;
- string = g_string_new("( ");
+ string = g_string_new ("( ");
for (i = 0; i < argc; i++) {
r1 = e_sexp_term_eval (f, argv[i]);
@@ -1211,14 +1211,14 @@ func_and (ESExp *f,
continue;
}
if (r1->value.string && *r1->value.string)
- g_string_append_printf(string, "%s%s", r1->value.string, ((argc>1) && (i != argc-1)) ? " AND ":"");
+ g_string_append_printf (string, "%s%s", r1->value.string, ((argc > 1) && (i != argc - 1)) ? " AND ":"");
e_sexp_result_free (f, r1);
}
- g_string_append(string, " )");
+ g_string_append (string, " )");
r = e_sexp_result_new (f, ESEXP_RES_STRING);
if (strlen (string->str) == 4) {
- r->value.string = g_strdup("");
+ r->value.string = g_strdup ("");
g_string_free (string, TRUE);
} else {
r->value.string = g_string_free (string, FALSE);
@@ -1237,7 +1237,7 @@ func_or (ESExp *f,
GString *string;
gint i;
- string = g_string_new("( ");
+ string = g_string_new ("( ");
for (i = 0; i < argc; i++) {
r1 = e_sexp_term_eval (f, argv[i]);
@@ -1246,14 +1246,14 @@ func_or (ESExp *f,
continue;
}
if (r1->value.string && *r1->value.string)
- g_string_append_printf(string, "%s%s", r1->value.string, ((argc>1) && (i != argc-1)) ? " OR ":"");
+ g_string_append_printf (string, "%s%s", r1->value.string, ((argc > 1) && (i != argc - 1)) ? " OR ":"");
e_sexp_result_free (f, r1);
}
- g_string_append(string, " )");
+ g_string_append (string, " )");
r = e_sexp_result_new (f, ESEXP_RES_STRING);
if (strlen (string->str) == 4) {
- r->value.string = g_strdup("");
+ r->value.string = g_strdup ("");
g_string_free (string, TRUE);
} else {
r->value.string = g_string_free (string, FALSE);
@@ -1302,10 +1302,10 @@ convert_match_exp (struct _ESExp *f,
if (!strcmp (field, "full_name")) {
gchar *full, *sur, *given, *nick;
- full = g_strdup_printf("(full_name IS NOT NULL AND full_name LIKE %s)",value);
- sur = g_strdup_printf("(family_name IS NOT NULL AND family_name LIKE %s)",value);
- given = g_strdup_printf("(given_name IS NOT NULL AND given_name LIKE %s)",value);
- nick = g_strdup_printf("(nickname IS NOT NULL AND nickname LIKE %s)",value);
+ full = g_strdup_printf ("(full_name IS NOT NULL AND full_name LIKE %s)",value);
+ sur = g_strdup_printf ("(family_name IS NOT NULL AND family_name LIKE %s)",value);
+ given = g_strdup_printf ("(given_name IS NOT NULL AND given_name LIKE %s)",value);
+ nick = g_strdup_printf ("(nickname IS NOT NULL AND nickname LIKE %s)",value);
str = g_strdup_printf (" %s OR %s OR %s OR %s ", full, sur, given, nick);
@@ -1326,7 +1326,7 @@ convert_match_exp (struct _ESExp *f,
str = emails->str;
g_string_free (emails, FALSE);
} else
- str = g_strdup_printf("(%s IS NOT NULL AND %s LIKE %s)", field, field, value);
+ str = g_strdup_printf ("(%s IS NOT NULL AND %s LIKE %s)", field, field, value);
g_free (value);
}
}
@@ -1509,7 +1509,7 @@ store_data_to_vcard (gpointer ref,
if (found)
continue;
- if (!strcmp (name [i], "bdata"))
+ if (!strcmp (name[i], "bdata"))
search_data->bdata = g_strdup (cols[i]);
}
@@ -1754,7 +1754,7 @@ get_uids_and_rev_cb (gpointer user_data,
GHashTable *uids_and_rev = user_data;
if (col == 2 && cols[0])
- g_hash_table_insert (uids_and_rev, g_strdup (cols [0]), g_strdup (cols [1] ? cols [1] : ""));
+ g_hash_table_insert (uids_and_rev, g_strdup (cols[0]), g_strdup (cols[1] ? cols[1] : ""));
return 0;
}
diff --git a/addressbook/libegdbus/e-gdbus-book-factory.c b/addressbook/libegdbus/e-gdbus-book-factory.c
index fbb0cf0..c84e3ff 100644
--- a/addressbook/libegdbus/e-gdbus-book-factory.c
+++ b/addressbook/libegdbus/e-gdbus-book-factory.c
@@ -107,7 +107,12 @@ e_gdbus_book_factory_complete_get_book (EGdbusBookFactory *object,
e_gdbus_complete_sync_method_string (object, invocation, out_path, error);
}
-E_DECLARE_GDBUS_SYNC_METHOD_1_WITH_RETURN (book_factory, get_book, source, "s", path, "s")
+E_DECLARE_GDBUS_SYNC_METHOD_1_WITH_RETURN (book_factory,
+ get_book,
+ source,
+ "s",
+ path,
+ "s")
static const GDBusMethodInfo * const e_gdbus_book_factory_method_info_pointers[] =
{
diff --git a/addressbook/libegdbus/e-gdbus-book-view.c b/addressbook/libegdbus/e-gdbus-book-view.c
index a78ef99..c3dc758 100644
--- a/addressbook/libegdbus/e-gdbus-book-view.c
+++ b/addressbook/libegdbus/e-gdbus-book-view.c
@@ -103,18 +103,58 @@ e_gdbus_book_view_default_init (EGdbusBookViewIface *iface)
_signal_name_to_type = g_hash_table_new (g_str_hash, g_str_equal);
/* GObject signals definitions for D-Bus signals: */
- E_INIT_GDBUS_SIGNAL_STRV (EGdbusBookViewIface, "objects_added", objects_added, __OBJECTS_ADDED_SIGNAL)
- E_INIT_GDBUS_SIGNAL_STRV (EGdbusBookViewIface, "objects_modified", objects_modified, __OBJECTS_MODIFIED_SIGNAL)
- E_INIT_GDBUS_SIGNAL_STRV (EGdbusBookViewIface, "objects_removed", objects_removed, __OBJECTS_REMOVED_SIGNAL)
- E_INIT_GDBUS_SIGNAL_UINT_STRING (EGdbusBookViewIface, "progress", progress, __PROGRESS_SIGNAL)
- E_INIT_GDBUS_SIGNAL_STRV (EGdbusBookViewIface, "complete", complete, __COMPLETE_SIGNAL)
+ E_INIT_GDBUS_SIGNAL_STRV (
+ EGdbusBookViewIface,
+ "objects_added",
+ objects_added,
+ __OBJECTS_ADDED_SIGNAL)
+ E_INIT_GDBUS_SIGNAL_STRV (
+ EGdbusBookViewIface,
+ "objects_modified",
+ objects_modified,
+ __OBJECTS_MODIFIED_SIGNAL)
+ E_INIT_GDBUS_SIGNAL_STRV (
+ EGdbusBookViewIface,
+ "objects_removed",
+ objects_removed,
+ __OBJECTS_REMOVED_SIGNAL)
+ E_INIT_GDBUS_SIGNAL_UINT_STRING (
+ EGdbusBookViewIface,
+ "progress",
+ progress,
+ __PROGRESS_SIGNAL)
+ E_INIT_GDBUS_SIGNAL_STRV (
+ EGdbusBookViewIface,
+ "complete",
+ complete,
+ __COMPLETE_SIGNAL)
/* GObject signals definitions for D-Bus methods: */
- E_INIT_GDBUS_METHOD_VOID (EGdbusBookViewIface, "start", start, __START_METHOD)
- E_INIT_GDBUS_METHOD_VOID (EGdbusBookViewIface, "stop", stop, __STOP_METHOD)
- E_INIT_GDBUS_METHOD_VOID (EGdbusBookViewIface, "dispose", dispose, __DISPOSE_METHOD)
- E_INIT_GDBUS_METHOD_UINT (EGdbusBookViewIface, "set_flags", set_flags, __SET_FLAGS_METHOD)
- E_INIT_GDBUS_METHOD_STRV (EGdbusBookViewIface, "set_fields_of_interest", set_fields_of_interest, __SET_FIELDS_OF_INTEREST_METHOD)
+ E_INIT_GDBUS_METHOD_VOID (
+ EGdbusBookViewIface,
+ "start",
+ start,
+ __START_METHOD)
+ E_INIT_GDBUS_METHOD_VOID (
+ EGdbusBookViewIface,
+ "stop",
+ stop,
+ __STOP_METHOD)
+ E_INIT_GDBUS_METHOD_VOID (
+ EGdbusBookViewIface,
+ "dispose",
+ dispose,
+ __DISPOSE_METHOD)
+ E_INIT_GDBUS_METHOD_UINT (
+ EGdbusBookViewIface,
+ "set_flags",
+ set_flags,
+ __SET_FLAGS_METHOD)
+ E_INIT_GDBUS_METHOD_STRV (
+ EGdbusBookViewIface,
+ "set_fields_of_interest",
+ set_fields_of_interest,
+ __SET_FIELDS_OF_INTEREST_METHOD)
}
void
@@ -174,7 +214,7 @@ e_gdbus_book_view_call_set_flags (GDBusProxy *proxy,
GAsyncReadyCallback callback,
gpointer user_data)
{
- e_gdbus_proxy_method_call_uint ("set_flags", proxy, in_flags, cancellable, callback, user_data);
+ e_gdbus_proxy_method_call_uint ("set_flags", proxy, in_flags, cancellable, callback, user_data);
}
gboolean
@@ -282,11 +322,28 @@ e_gdbus_book_view_emit_complete (EGdbusBookView *object,
g_signal_emit (object, signals[__COMPLETE_SIGNAL], 0, arg_error);
}
-E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (book_view, objects_added, objects, "as")
-E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (book_view, objects_modified, objects, "as")
-E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (book_view, objects_removed, uids, "as")
-E_DECLARE_GDBUS_NOTIFY_SIGNAL_2 (book_view, progress, percent, "u", message, "s")
-E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (book_view, complete, error, "as")
+E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (book_view,
+ objects_added,
+ objects,
+ "as")
+E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (book_view,
+ objects_modified,
+ objects,
+ "as")
+E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (book_view,
+ objects_removed,
+ uids,
+ "as")
+E_DECLARE_GDBUS_NOTIFY_SIGNAL_2 (book_view,
+ progress,
+ percent,
+ "u",
+ message,
+ "s")
+E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (book_view,
+ complete,
+ error,
+ "as")
E_DECLARE_GDBUS_SYNC_METHOD_0 (book_view,
start)
@@ -294,8 +351,14 @@ E_DECLARE_GDBUS_SYNC_METHOD_0 (book_view,
stop)
E_DECLARE_GDBUS_SYNC_METHOD_0 (book_view,
dispose)
-E_DECLARE_GDBUS_SYNC_METHOD_1 (book_view, set_flags, flags, "u")
-E_DECLARE_GDBUS_SYNC_METHOD_1 (book_view, set_fields_of_interest, fields_of_interest, "as")
+E_DECLARE_GDBUS_SYNC_METHOD_1 (book_view,
+ set_flags,
+ flags,
+ "u")
+E_DECLARE_GDBUS_SYNC_METHOD_1 (book_view,
+ set_fields_of_interest,
+ fields_of_interest,
+ "as")
static const GDBusMethodInfo * const e_gdbus_book_view_method_info_pointers[] =
{
diff --git a/addressbook/libegdbus/e-gdbus-book.c b/addressbook/libegdbus/e-gdbus-book.c
index e81e076..0018ec8 100644
--- a/addressbook/libegdbus/e-gdbus-book.c
+++ b/addressbook/libegdbus/e-gdbus-book.c
@@ -159,28 +159,120 @@ e_gdbus_book_default_init (EGdbusBookIface *iface)
_signal_name_to_type = g_hash_table_new (g_str_hash, g_str_equal);
/* GObject signals definitions for D-Bus signals: */
- E_INIT_GDBUS_SIGNAL_STRING (EGdbusBookIface, "backend_error", backend_error, __BACKEND_ERROR_SIGNAL)
- E_INIT_GDBUS_SIGNAL_BOOLEAN (EGdbusBookIface, "readonly", readonly, __READONLY_SIGNAL)
- E_INIT_GDBUS_SIGNAL_BOOLEAN (EGdbusBookIface, "online", online, __ONLINE_SIGNAL)
- E_INIT_GDBUS_SIGNAL_STRV (EGdbusBookIface, "opened", opened, __OPENED_SIGNAL)
- E_INIT_GDBUS_SIGNAL_STRV (EGdbusBookIface, "backend_property_changed", backend_property_changed, __BACKEND_PROPERTY_CHANGED_SIGNAL)
+ E_INIT_GDBUS_SIGNAL_STRING (
+ EGdbusBookIface,
+ "backend_error",
+ backend_error,
+ __BACKEND_ERROR_SIGNAL)
+ E_INIT_GDBUS_SIGNAL_BOOLEAN (
+ EGdbusBookIface,
+ "readonly",
+ readonly,
+ __READONLY_SIGNAL)
+ E_INIT_GDBUS_SIGNAL_BOOLEAN (
+ EGdbusBookIface,
+ "online",
+ online,
+ __ONLINE_SIGNAL)
+ E_INIT_GDBUS_SIGNAL_STRV (
+ EGdbusBookIface,
+ "opened",
+ opened,
+ __OPENED_SIGNAL)
+ E_INIT_GDBUS_SIGNAL_STRV (
+ EGdbusBookIface,
+ "backend_property_changed",
+ backend_property_changed,
+ __BACKEND_PROPERTY_CHANGED_SIGNAL)
/* GObject signals definitions for D-Bus methods: */
- E_INIT_GDBUS_METHOD_ASYNC_BOOLEAN__VOID (EGdbusBookIface, "open", open, __OPEN_METHOD, __OPEN_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_VOID__VOID (EGdbusBookIface, "remove", remove, __REMOVE_METHOD, __REMOVE_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_VOID__VOID (EGdbusBookIface, "refresh", refresh, __REFRESH_METHOD, __REFRESH_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_STRING__STRING(EGdbusBookIface, "get_contact", get_contact, __GET_CONTACT_METHOD, __GET_CONTACT_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_STRING__STRV (EGdbusBookIface, "get_contact_list", get_contact_list, __GET_CONTACT_LIST_METHOD, __GET_CONTACT_LIST_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_STRING__STRV (EGdbusBookIface, "get_contact_list_uids", get_contact_list_uids, __GET_CONTACT_LIST_UIDS_METHOD, __GET_CONTACT_LIST_UIDS_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_STRV__STRV (EGdbusBookIface, "add_contacts", add_contacts, __ADD_CONTACTS_METHOD, __ADD_CONTACTS_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_STRV__VOID (EGdbusBookIface, "remove_contacts", remove_contacts, __REMOVE_CONTACTS_METHOD, __REMOVE_CONTACTS_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_STRV__VOID (EGdbusBookIface, "modify_contacts", modify_contacts, __MODIFY_CONTACTS_METHOD, __MODIFY_CONTACTS_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_STRING__STRING(EGdbusBookIface, "get_backend_property", get_backend_property, __GET_BACKEND_PROPERTY_METHOD, __GET_BACKEND_PROPERTY_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_STRV__VOID (EGdbusBookIface, "set_backend_property", set_backend_property, __SET_BACKEND_PROPERTY_METHOD, __SET_BACKEND_PROPERTY_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_STRING__STRING(EGdbusBookIface, "get_view", get_view, __GET_VIEW_METHOD, __GET_VIEW_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_UINT (EGdbusBookIface, "cancel_operation", cancel_operation, __CANCEL_OPERATION_METHOD)
- E_INIT_GDBUS_METHOD_VOID (EGdbusBookIface, "cancel_all", cancel_all, __CANCEL_ALL_METHOD)
- E_INIT_GDBUS_METHOD_VOID (EGdbusBookIface, "close", close, __CLOSE_METHOD)
+ E_INIT_GDBUS_METHOD_ASYNC_BOOLEAN__VOID (
+ EGdbusBookIface,
+ "open",
+ open,
+ __OPEN_METHOD,
+ __OPEN_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_VOID__VOID (
+ EGdbusBookIface,
+ "remove",
+ remove,
+ __REMOVE_METHOD,
+ __REMOVE_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_VOID__VOID (
+ EGdbusBookIface,
+ "refresh",
+ refresh,
+ __REFRESH_METHOD,
+ __REFRESH_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_STRING__STRING (
+ EGdbusBookIface,
+ "get_contact",
+ get_contact,
+ __GET_CONTACT_METHOD,
+ __GET_CONTACT_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_STRING__STRV (
+ EGdbusBookIface,
+ "get_contact_list",
+ get_contact_list,
+ __GET_CONTACT_LIST_METHOD,
+ __GET_CONTACT_LIST_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_STRING__STRV (
+ EGdbusBookIface,
+ "get_contact_list_uids",
+ get_contact_list_uids,
+ __GET_CONTACT_LIST_UIDS_METHOD,
+ __GET_CONTACT_LIST_UIDS_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_STRV__STRV (
+ EGdbusBookIface,
+ "add_contacts",
+ add_contacts,
+ __ADD_CONTACTS_METHOD,
+ __ADD_CONTACTS_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_STRV__VOID (
+ EGdbusBookIface,
+ "remove_contacts",
+ remove_contacts,
+ __REMOVE_CONTACTS_METHOD,
+ __REMOVE_CONTACTS_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_STRV__VOID (
+ EGdbusBookIface,
+ "modify_contacts",
+ modify_contacts,
+ __MODIFY_CONTACTS_METHOD,
+ __MODIFY_CONTACTS_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_STRING__STRING (
+ EGdbusBookIface,
+ "get_backend_property",
+ get_backend_property,
+ __GET_BACKEND_PROPERTY_METHOD,
+ __GET_BACKEND_PROPERTY_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_STRV__VOID (
+ EGdbusBookIface,
+ "set_backend_property",
+ set_backend_property,
+ __SET_BACKEND_PROPERTY_METHOD,
+ __SET_BACKEND_PROPERTY_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_STRING__STRING (
+ EGdbusBookIface,
+ "get_view",
+ get_view,
+ __GET_VIEW_METHOD,
+ __GET_VIEW_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_UINT (
+ EGdbusBookIface,
+ "cancel_operation",
+ cancel_operation,
+ __CANCEL_OPERATION_METHOD)
+ E_INIT_GDBUS_METHOD_VOID (
+ EGdbusBookIface,
+ "cancel_all",
+ cancel_all,
+ __CANCEL_ALL_METHOD)
+ E_INIT_GDBUS_METHOD_VOID (
+ EGdbusBookIface,
+ "close",
+ close,
+ __CLOSE_METHOD)
}
void
@@ -716,28 +808,88 @@ e_gdbus_book_emit_backend_property_changed (EGdbusBook *object,
g_signal_emit (object, signals[__BACKEND_PROPERTY_CHANGED_SIGNAL], 0, arg_name_value);
}
-E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (book, backend_error, message, "s")
-E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (book, readonly, is_readonly, "b")
-E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (book, online, is_online, "b")
-E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (book, opened, error, "as")
-E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (book, backend_property_changed, name_value, "as")
-
-E_DECLARE_GDBUS_ASYNC_METHOD_1 (book, open, only_if_exists, "b")
+E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (book,
+ backend_error,
+ message,
+ "s")
+E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (book,
+ readonly,
+ is_readonly,
+ "b")
+E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (book,
+ online,
+ is_online,
+ "b")
+E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (book,
+ opened,
+ error,
+ "as")
+E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (book,
+ backend_property_changed,
+ name_value,
+ "as")
+
+E_DECLARE_GDBUS_ASYNC_METHOD_1 (book,
+ open,
+ only_if_exists,
+ "b")
E_DECLARE_GDBUS_ASYNC_METHOD_0 (book,
remove)
E_DECLARE_GDBUS_ASYNC_METHOD_0 (book,
refresh)
-E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (book, get_contact, uid, "s", vcard, "s")
-E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (book, get_contact_list, query, "s", vcards, "as")
-E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (book, get_contact_list_uids, query, "s", uids, "as")
-E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (book, add_contacts, vcards, "as", uids, "as")
-E_DECLARE_GDBUS_ASYNC_METHOD_1 (book, remove_contacts, list, "as")
-E_DECLARE_GDBUS_ASYNC_METHOD_1 (book, modify_contacts, vcard, "as")
-E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (book, get_backend_property, prop_name, "s", prop_value, "s")
-E_DECLARE_GDBUS_ASYNC_METHOD_1 (book, set_backend_property, prop_name_value, "as")
-E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (book, get_view, query, "s", view, "s")
-
-E_DECLARE_GDBUS_SYNC_METHOD_1 (book, cancel_operation, opid, "u")
+E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (book,
+ get_contact,
+ uid,
+ "s",
+ vcard,
+ "s")
+E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (book,
+ get_contact_list,
+ query,
+ "s",
+ vcards,
+ "as")
+E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (book,
+ get_contact_list_uids,
+ query,
+ "s",
+ uids,
+ "as")
+E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (book,
+ add_contacts,
+ vcards,
+ "as",
+ uids,
+ "as")
+E_DECLARE_GDBUS_ASYNC_METHOD_1 (book,
+ remove_contacts,
+ list,
+ "as")
+E_DECLARE_GDBUS_ASYNC_METHOD_1 (book,
+ modify_contacts,
+ vcard,
+ "as")
+E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (book,
+ get_backend_property,
+ prop_name,
+ "s",
+ prop_value,
+ "s")
+E_DECLARE_GDBUS_ASYNC_METHOD_1 (book,
+ set_backend_property,
+ prop_name_value,
+ "as")
+E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (book,
+ get_view,
+ query,
+ "s",
+ view,
+ "s")
+
+E_DECLARE_GDBUS_SYNC_METHOD_1 (book,
+ cancel_operation,
+ opid,
+ "u")
E_DECLARE_GDBUS_SYNC_METHOD_0 (book,
cancel_all)
E_DECLARE_GDBUS_SYNC_METHOD_0 (book,
diff --git a/calendar/backends/caldav/e-cal-backend-caldav.c b/calendar/backends/caldav/e-cal-backend-caldav.c
index 28e0dba..e98e7f2 100644
--- a/calendar/backends/caldav/e-cal-backend-caldav.c
+++ b/calendar/backends/caldav/e-cal-backend-caldav.c
@@ -170,7 +170,7 @@ add_debug_key (const gchar *start,
debug_key,
debug_value);
- d(g_debug ("Adding %s to enabled debugging keys", debug_key));
+ d (g_debug ("Adding %s to enabled debugging keys", debug_key));
}
static gpointer
@@ -183,7 +183,7 @@ caldav_debug_init_once (gpointer data)
if (dbg) {
const gchar *ptr;
- d(g_debug ("Got debug env variable: [%s]", dbg));
+ d (g_debug ("Got debug env variable: [%s]", dbg));
caldav_debug_table = g_hash_table_new (g_str_hash,
g_str_equal);
@@ -608,7 +608,7 @@ status_code_to_result (SoupMessage *message,
break;
default:
- d(g_debug ("CalDAV:%s: Unhandled status code %d\n", G_STRFUNC, status_code));
+ d (g_debug ("CalDAV:%s: Unhandled status code %d\n", G_STRFUNC, status_code));
g_propagate_error (perror,
e_data_cal_create_error_fmt (
OtherError,
@@ -942,7 +942,7 @@ parse_propfind_response (SoupMessage *message,
if (txt && *txt) {
gint len = strlen (txt);
- if (*txt == '\"' && len > 2 && txt [len - 1] == '\"') {
+ if (*txt == '\"' && len > 2 && txt[len - 1] == '\"') {
/* dequote */
*value = g_strndup (txt + 1, len - 2);
} else {
@@ -1168,7 +1168,7 @@ caldav_unref_in_thread (ECalBackendCalDAV *cbdav)
static gboolean
caldav_authenticate (ECalBackendCalDAV *cbdav,
- gboolean ref_cbdav,
+ gboolean ref_cbdav,
GCancellable *cancellable,
GError **error)
{
@@ -4654,7 +4654,7 @@ caldav_get_free_busy (ECalBackendSync *backend,
for (u = users; u; u = u->next) {
ECalComponentAttendee *ca;
- gchar *temp = g_strconcat ("mailto:", (const gchar *)u->data, NULL);
+ gchar *temp = g_strconcat ("mailto:", (const gchar *) u->data, NULL);
ca = g_new0 (ECalComponentAttendee, 1);
diff --git a/calendar/backends/contacts/e-cal-backend-contacts.c b/calendar/backends/contacts/e-cal-backend-contacts.c
index 2c34579..786b13d 100644
--- a/calendar/backends/contacts/e-cal-backend-contacts.c
+++ b/calendar/backends/contacts/e-cal-backend-contacts.c
@@ -885,7 +885,7 @@ create_component (ECalBackendContacts *cbc,
e_cal_component_set_icalcomponent (cal_comp, ical_comp);
/* Set uid */
- d(g_message ("Creating UID: %s", uid));
+ d (g_message ("Creating UID: %s", uid));
e_cal_component_set_uid (cal_comp, uid);
/* Set all-day event's date from contact data */
@@ -1068,18 +1068,18 @@ e_cal_backend_contacts_get_object (ECalBackendSync *backend,
if (record->comp_birthday && g_str_has_suffix (uid, BIRTHDAY_UID_EXT)) {
*object = e_cal_component_get_as_string (record->comp_birthday);
- d(g_message ("Return birthday: %s", *object));
+ d (g_message ("Return birthday: %s", *object));
return;
}
if (record->comp_anniversary && g_str_has_suffix (uid, ANNIVERSARY_UID_EXT)) {
*object = e_cal_component_get_as_string (record->comp_anniversary);
- d(g_message ("Return anniversary: %s", *object));
+ d (g_message ("Return anniversary: %s", *object));
return;
}
- d(g_message ("Returning nothing for uid: %s", uid));
+ d (g_message ("Returning nothing for uid: %s", uid));
g_propagate_error (perror, EDC_ERROR (ObjectNotFound));
}
diff --git a/calendar/backends/file/e-cal-backend-file.c b/calendar/backends/file/e-cal-backend-file.c
index 491324c..3e14e4d 100644
--- a/calendar/backends/file/e-cal-backend-file.c
+++ b/calendar/backends/file/e-cal-backend-file.c
@@ -526,7 +526,7 @@ resolve_tzid (const gchar *tzid,
if (!tzid || !tzid[0])
return NULL;
- else if (!strcmp (tzid, "UTC"))
+ else if (!strcmp (tzid, "UTC"))
return icaltimezone_get_utc_timezone ();
zone = icaltimezone_get_builtin_timezone_from_tzid (tzid);
@@ -576,7 +576,7 @@ check_dup_uid (ECalBackendFile *cbfile,
goto done;
}
- d(g_message (G_STRLOC ": Got object with duplicated UID `%s' and rid `%s', changing it...",
+ d (g_message (G_STRLOC ": Got object with duplicated UID `%s' and rid `%s', changing it...",
uid,
rid ? rid : ""));
@@ -1630,7 +1630,7 @@ e_cal_backend_file_get_object_list (ECalBackendSync *backend,
cbfile = E_CAL_BACKEND_FILE (backend);
priv = cbfile->priv;
- d(g_message (G_STRLOC ": Getting object list (%s)", sexp));
+ d (g_message (G_STRLOC ": Getting object list (%s)", sexp));
match_data.search_needed = TRUE;
match_data.query = sexp;
@@ -1816,7 +1816,7 @@ e_cal_backend_file_start_view (ECalBackend *backend,
cbfile = E_CAL_BACKEND_FILE (backend);
priv = cbfile->priv;
- d(g_message (G_STRLOC ": Starting query (%s)", e_data_cal_view_get_text (query)));
+ d (g_message (G_STRLOC ": Starting query (%s)", e_data_cal_view_get_text (query)));
/* try to match all currently existing objects */
match_data.search_needed = TRUE;
@@ -1849,7 +1849,7 @@ e_cal_backend_file_start_view (ECalBackend *backend,
g_hash_table_foreach (priv->comp_uid_hash, (GHFunc) match_object_sexp,
&match_data);
- e_debug_log(FALSE, E_DEBUG_LOG_DOMAIN_CAL_QUERIES, "---;%p;QUERY-ITEMS;%s;%s;%d", query,
+ e_debug_log (FALSE, E_DEBUG_LOG_DOMAIN_CAL_QUERIES, "---;%p;QUERY-ITEMS;%s;%s;%d", query,
e_data_cal_view_get_text (query), G_OBJECT_TYPE_NAME (backend),
g_hash_table_size (priv->comp_uid_hash));
} else {
@@ -1860,7 +1860,7 @@ e_cal_backend_file_start_view (ECalBackend *backend,
g_list_foreach (objs_occuring_in_tw, (GFunc) match_object_sexp_to_component,
&match_data);
- e_debug_log(FALSE, E_DEBUG_LOG_DOMAIN_CAL_QUERIES, "---;%p;QUERY-ITEMS;%s;%s;%d", query,
+ e_debug_log (FALSE, E_DEBUG_LOG_DOMAIN_CAL_QUERIES, "---;%p;QUERY-ITEMS;%s;%s;%d", query,
e_data_cal_view_get_text (query), G_OBJECT_TYPE_NAME (backend),
g_list_length (objs_occuring_in_tw));
}
@@ -3612,8 +3612,8 @@ get_difference_of_lists (ECalBackendFile *cbfile,
icaltimezone_get_utc_timezone (),
e_cal_backend_get_kind (E_CAL_BACKEND (cbfile)));
- d (printf ("start %s\n", asctime(gmtime(&time_start))));
- d (printf ("end %s\n", asctime(gmtime(&time_end))));
+ d (printf ("start %s\n", asctime (gmtime (&time_start))));
+ d (printf ("end %s\n", asctime (gmtime (&time_end))));
}
g_object_unref (comp);
@@ -3772,7 +3772,7 @@ main (gint argc,
exit (1);
}
- calendar_fname = g_strdup("calendar.ics");
+ calendar_fname = g_strdup ("calendar.ics");
if (!calendar_fname)
{
diff --git a/calendar/backends/http/e-cal-backend-http.c b/calendar/backends/http/e-cal-backend-http.c
index 4103d73..0c2f371 100644
--- a/calendar/backends/http/e-cal-backend-http.c
+++ b/calendar/backends/http/e-cal-backend-http.c
@@ -511,7 +511,7 @@ cal_backend_http_load (ECalBackendHttp *backend,
newuri = soup_message_headers_get (
soup_message->response_headers, "Location");
- d(g_message ("Redirected from %s to %s\n", async_context->uri, newuri));
+ d (g_message ("Redirected from %s to %s\n", async_context->uri, newuri));
if (newuri != NULL) {
gchar *redirected_uri;
@@ -749,7 +749,7 @@ begin_retrieval_cb (GIOSchedulerJob *job,
if (backend->priv->is_loading)
return FALSE;
- d(g_message ("Starting retrieval...\n"));
+ d (g_message ("Starting retrieval...\n"));
backend->priv->is_loading = TRUE;
@@ -774,7 +774,7 @@ begin_retrieval_cb (GIOSchedulerJob *job,
g_error_free (error);
}
- d(g_message ("Retrieval really done.\n"));
+ d (g_message ("Retrieval really done.\n"));
return FALSE;
}
@@ -789,7 +789,7 @@ reload_cb (ECalBackendHttp *cbhttp)
if (priv->is_loading)
return TRUE;
- d(g_message ("Reload!\n"));
+ d (g_message ("Reload!\n"));
priv->reload_timeout_id = 0;
@@ -813,7 +813,7 @@ maybe_start_reload_timeout (ECalBackendHttp *cbhttp)
priv = cbhttp->priv;
- d(g_message ("Setting reload timeout.\n"));
+ d (g_message ("Setting reload timeout.\n"));
if (priv->reload_timeout_id)
return;
@@ -1162,7 +1162,7 @@ e_cal_backend_http_start_view (ECalBackend *backend,
cbhttp = E_CAL_BACKEND_HTTP (backend);
priv = cbhttp->priv;
- d(g_message (G_STRLOC ": Starting query (%s)", e_data_cal_view_get_text (query)));
+ d (g_message (G_STRLOC ": Starting query (%s)", e_data_cal_view_get_text (query)));
if (!priv->store) {
GError *error = EDC_ERROR (NoSuchCal);
@@ -1283,7 +1283,7 @@ create_user_free_busy (ECalBackendHttp *cbhttp,
/* add all objects in the given interval */
iso_start = isodate_from_time_t (start);
iso_end = isodate_from_time_t (end);
- query = g_strdup_printf ("occur-in-time-range? (make-time \"%s\") (make-time \"%s\")",
+ query = g_strdup_printf ("occur-in-time-range? (make-time \"%s\") (make-time \"%s\")",
iso_start, iso_end);
obj_sexp = e_cal_backend_sexp_new (query);
g_free (query);
diff --git a/calendar/backends/weather/e-cal-backend-weather.c b/calendar/backends/weather/e-cal-backend-weather.c
index 527ffce..f31e3d5 100644
--- a/calendar/backends/weather/e-cal-backend-weather.c
+++ b/calendar/backends/weather/e-cal-backend-weather.c
@@ -339,8 +339,8 @@ create_weather (ECalBackendWeather *cbw,
/* use timezone of the location to determine date for which this is set */
location = gweather_info_get_location (report);
- if (location && (w_timezone = gweather_location_get_timezone ((GWeatherLocation *)location)))
- update_zone = icaltimezone_get_builtin_timezone (gweather_timezone_get_tzid ((GWeatherTimezone*)w_timezone));
+ if (location && (w_timezone = gweather_location_get_timezone ((GWeatherLocation *) location)))
+ update_zone = icaltimezone_get_builtin_timezone (gweather_timezone_get_tzid ((GWeatherTimezone *) w_timezone));
if (!update_zone)
update_zone = icaltimezone_get_utc_timezone ();
diff --git a/calendar/backends/weather/e-weather-source.c b/calendar/backends/weather/e-weather-source.c
index 2da852a..eabb1a0 100644
--- a/calendar/backends/weather/e-weather-source.c
+++ b/calendar/backends/weather/e-weather-source.c
@@ -26,7 +26,7 @@ G_DEFINE_TYPE (EWeatherSource, e_weather_source, G_TYPE_OBJECT)
static void
parse_done (GWeatherInfo *info,
- gpointer data)
+ gpointer data)
{
EWeatherSource *source = (EWeatherSource *) data;
@@ -42,9 +42,9 @@ parse_done (GWeatherInfo *info,
}
void
-e_weather_source_parse (EWeatherSource *source,
- EWeatherSourceFinished done,
- gpointer data)
+e_weather_source_parse (EWeatherSource *source,
+ EWeatherSourceFinished done,
+ gpointer data)
{
source->finished_data = data;
source->done = done;
@@ -60,7 +60,7 @@ e_weather_source_parse (EWeatherSource *source,
static void
e_weather_source_finalize (GObject *object)
{
- EWeatherSource *self = (EWeatherSource*) object;
+ EWeatherSource *self = (EWeatherSource *) object;
if (self->location)
gweather_location_unref (self->location);
@@ -88,7 +88,7 @@ e_weather_source_new (const gchar *location)
{
GWeatherLocation *world, *glocation;
EWeatherSource *source;
- char **tokens;
+ gchar **tokens;
/* Old location is formatted as ccf/AAA[/BBB] - AAA is the 3-letter station
* code for identifying the providing station (subdirectory within the crh data
diff --git a/calendar/libecal/e-cal-check-timezones.c b/calendar/libecal/e-cal-check-timezones.c
index a32b0cb..39f82aa 100644
--- a/calendar/libecal/e-cal-check-timezones.c
+++ b/calendar/libecal/e-cal-check-timezones.c
@@ -129,7 +129,7 @@ e_cal_match_tzid (const gchar *tzid)
/* TODO: lookup table for Exchange TZIDs */
done:
- if (systzid && !strcmp(systzid, "UTC")) {
+ if (systzid && !strcmp (systzid, "UTC")) {
/*
* UTC is special: it doesn't have a real VTIMEZONE in
* EDS. Matching some pseudo VTTIMEZONE with UTC in the TZID
@@ -330,7 +330,7 @@ e_cal_check_timezones (icalcomponent *comp,
if (counter) {
g_free (value);
- value = g_strdup_printf("%s %d", tzid, counter);
+ value = g_strdup_printf ("%s %d", tzid, counter);
}
existing_zone = tzlookup (
counter ? value : tzid,
@@ -346,8 +346,8 @@ e_cal_check_timezones (icalcomponent *comp,
buffer = icalcomponent_as_ical_string_r (icaltimezone_get_component (existing_zone));
if (counter) {
- gchar *fulltzid = g_strdup_printf("TZID:%s", value);
- gsize baselen = strlen("TZID:") + strlen(tzid);
+ gchar *fulltzid = g_strdup_printf ("TZID:%s", value);
+ gsize baselen = strlen ("TZID:") + strlen (tzid);
gsize fulllen = strlen (fulltzid);
gchar *tzidprop;
/*
@@ -385,7 +385,7 @@ e_cal_check_timezones (icalcomponent *comp,
icalproperty *prop = icalcomponent_get_first_property (
subcomp, ICAL_TZID_PROPERTY);
while (prop) {
- icalproperty_set_value_from_string(prop, value, "NO");
+ icalproperty_set_value_from_string (prop, value, "NO");
prop = icalcomponent_get_next_property (
subcomp, ICAL_ANY_PROPERTY);
}
@@ -437,7 +437,7 @@ e_cal_check_timezones (icalcomponent *comp,
/* set gerror for "out of memory" if possible, otherwise abort via g_error() */
*error = g_error_new(E_CALENDAR_ERROR, E_CALENDAR_STATUS_OTHER_ERROR, "out of memory");
if (!*error) {
- g_error("e_cal_check_timezones(): out of memory, cannot proceed - sorry!");
+ g_error ("e_cal_check_timezones(): out of memory, cannot proceed - sorry!");
}
failed:
/* gerror should have been set already */
@@ -650,7 +650,7 @@ e_cal_client_check_timezones (icalcomponent *comp,
if (counter) {
g_free (value);
- value = g_strdup_printf("%s %d", tzid, counter);
+ value = g_strdup_printf ("%s %d", tzid, counter);
}
existing_zone = tzlookup (counter ? value : tzid, ecalclient, cancellable, error);
if (!existing_zone) {
@@ -664,8 +664,8 @@ e_cal_client_check_timezones (icalcomponent *comp,
buffer = icalcomponent_as_ical_string_r (icaltimezone_get_component (existing_zone));
if (counter) {
- gchar *fulltzid = g_strdup_printf("TZID:%s", value);
- gsize baselen = strlen("TZID:") + strlen(tzid);
+ gchar *fulltzid = g_strdup_printf ("TZID:%s", value);
+ gsize baselen = strlen ("TZID:") + strlen (tzid);
gsize fulllen = strlen (fulltzid);
gchar *tzidprop;
/*
@@ -701,7 +701,7 @@ e_cal_client_check_timezones (icalcomponent *comp,
/* timezone renamed */
icalproperty *prop = icalcomponent_get_first_property (subcomp, ICAL_TZID_PROPERTY);
while (prop) {
- icalproperty_set_value_from_string(prop, value, "NO");
+ icalproperty_set_value_from_string (prop, value, "NO");
prop = icalcomponent_get_next_property (subcomp, ICAL_ANY_PROPERTY);
}
g_free (key);
@@ -749,7 +749,7 @@ e_cal_client_check_timezones (icalcomponent *comp,
/* set gerror for "out of memory" if possible, otherwise abort via g_error() */
*error = g_error_new (E_CLIENT_ERROR, E_CLIENT_ERROR_OTHER_ERROR, "out of memory");
if (!*error) {
- g_error("e_cal_check_timezones(): out of memory, cannot proceed - sorry!");
+ g_error ("e_cal_check_timezones(): out of memory, cannot proceed - sorry!");
}
failed:
/* gerror should have been set already */
diff --git a/calendar/libecal/e-cal-component.c b/calendar/libecal/e-cal-component.c
index 14ad046..3c709af 100644
--- a/calendar/libecal/e-cal-component.c
+++ b/calendar/libecal/e-cal-component.c
@@ -3824,14 +3824,14 @@ e_cal_component_get_recurid_as_string (ECalComponent *comp)
e_cal_component_get_recurid (comp, &range);
if (!range.datetime.value) {
e_cal_component_free_range (&range);
- return g_strdup ("0");
+ return g_strdup ("0");
}
tt = *range.datetime.value;
e_cal_component_free_range (&range);
return icaltime_is_valid_time (tt) && !icaltime_is_null_time (tt) ?
- icaltime_as_ical_string_r (tt) : g_strdup ("0");
+ icaltime_as_ical_string_r (tt) : g_strdup ("0");
}
/**
diff --git a/calendar/libecal/e-cal-recur.c b/calendar/libecal/e-cal-recur.c
index ec7baf3..1b99666 100644
--- a/calendar/libecal/e-cal-recur.c
+++ b/calendar/libecal/e-cal-recur.c
@@ -1002,7 +1002,7 @@ e_cal_recur_from_icalproperty (icalproperty *prop,
r->freq = ir.freq;
if (G_UNLIKELY (ir.interval < 1)) {
- g_warning("Invalid interval in rule %s - using 1\n",
+ g_warning ("Invalid interval in rule %s - using 1\n",
icalrecurrencetype_as_string (&ir));
r->interval = 1;
} else {
diff --git a/calendar/libecal/e-cal-system-timezone.c b/calendar/libecal/e-cal-system-timezone.c
index d211ea3..e3b7919 100644
--- a/calendar/libecal/e-cal-system-timezone.c
+++ b/calendar/libecal/e-cal-system-timezone.c
@@ -85,11 +85,11 @@ system_timezone_read_etc_timezone (GHashTable *ical_zones)
GString *reading;
gint c;
- etc_timezone = g_fopen (ETC_TIMEZONE, "r");
+ etc_timezone = g_fopen (ETC_TIMEZONE, "r");
if (!etc_timezone)
return NULL;
- reading = g_string_new ("");
+ reading = g_string_new ("");
c = fgetc (etc_timezone);
/* only get the first line, we'll validate the value later */
@@ -122,11 +122,11 @@ system_timezone_read_key_file (const gchar *filename,
if (!g_file_test (filename, G_FILE_TEST_IS_REGULAR))
return NULL;
- channel = g_io_channel_new_file (filename, "r", NULL);
+ channel = g_io_channel_new_file (filename, "r", NULL);
if (!channel)
return NULL;
- key_eq = g_strdup_printf ("%s=", key);
+ key_eq = g_strdup_printf ("%s=", key);
retval = NULL;
while (g_io_channel_read_line (channel, &line, NULL,
@@ -172,7 +172,7 @@ static gchar *
system_timezone_read_etc_sysconfig_clock (GHashTable *ical_zones)
{
return system_timezone_read_key_file (ETC_SYSCONFIG_CLOCK,
- "ZONE");
+ "ZONE");
}
/* This works for openSUSE */
@@ -180,7 +180,7 @@ static gchar *
system_timezone_read_etc_sysconfig_clock_alt (GHashTable *ical_zones)
{
return system_timezone_read_key_file (ETC_SYSCONFIG_CLOCK,
- "TIMEZONE");
+ "TIMEZONE");
}
/* This works for Solaris/OpenSolaris */
@@ -188,7 +188,7 @@ static gchar *
system_timezone_read_etc_TIMEZONE (GHashTable *ical_zones)
{
return system_timezone_read_key_file (ETC_TIMEZONE_MAJ,
- "TZ");
+ "TZ");
}
/* This works for Arch Linux */
@@ -196,7 +196,7 @@ static gchar *
system_timezone_read_etc_rc_conf (GHashTable *ical_zones)
{
return system_timezone_read_key_file (ETC_RC_CONF,
- "TIMEZONE");
+ "TIMEZONE");
}
/* This works for old Gentoo */
@@ -204,7 +204,7 @@ static gchar *
system_timezone_read_etc_conf_d_clock (GHashTable *ical_zones)
{
return system_timezone_read_key_file (ETC_CONF_D_CLOCK,
- "TIMEZONE");
+ "TIMEZONE");
}
static void
@@ -557,8 +557,8 @@ system_timezone_find (void)
config_tz = NULL;
/* read correct timezone name from config file; checking
- on /etc/localtime content can pick wrong timezone name,
- even the file is same
+ * on /etc/localtime content can pick wrong timezone name,
+ * even the file is same
*/
for (ii = 0; get_system_timezone_methods_config[ii] != NULL; ii++) {
config_tz = get_system_timezone_methods_config[ii] (ical_zones);
@@ -597,8 +597,8 @@ system_timezone_find (void)
g_hash_table_destroy (ical_zones);
/* corresponding file name to config_tz matches /etc/localtime,
- thus that's the correct one - return it as system timezone;
- bonus is that it might match configured system timezone name too
+ * thus that's the correct one - return it as system timezone;
+ * bonus is that it might match configured system timezone name too
*/
return config_tz;
}
@@ -835,7 +835,7 @@ system_timezone_win32_query_registry (void)
res = RegOpenKeyExA (HKEY_LOCAL_MACHINE,
"SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation", 0, KEY_READ, ®_key);
if (res != ERROR_SUCCESS) {
- g_debug("Could not find system timezone! (1)\n");
+ g_debug ("Could not find system timezone! (1)\n");
return NULL;
}
@@ -926,7 +926,7 @@ e_cal_system_timezone_get_location (void)
g_free (windows_timezone_string);
if (!olson_timezone_string)
return NULL;
- g_debug("Olson Timezone String: %s\n", olson_timezone_string);
+ g_debug ("Olson Timezone String: %s\n", olson_timezone_string);
return olson_timezone_string;
#endif
}
diff --git a/calendar/libecal/e-cal.c b/calendar/libecal/e-cal.c
index d1e8d57..b3d8033 100644
--- a/calendar/libecal/e-cal.c
+++ b/calendar/libecal/e-cal.c
@@ -923,7 +923,7 @@ e_cal_new (ESource *source,
if (!e_cal_activate (&error)) {
unwrap_gerror (&error);
- g_warning("Cannot activate ECal: %s\n", error ? error->message : "Unknown error");
+ g_warning ("Cannot activate ECal: %s\n", error ? error->message : "Unknown error");
if (error)
g_error_free (error);
return NULL;
@@ -3788,7 +3788,7 @@ e_cal_get_timezone (ECal *ecal,
ICAL_ANY_PROPERTY);
while (!found && prop) {
if (icalproperty_isa (prop) == ICAL_TZID_PROPERTY) {
- icalproperty_set_value_from_string(prop, tzid, "NO");
+ icalproperty_set_value_from_string (prop, tzid, "NO");
found = TRUE;
}
prop = icalcomponent_get_next_property (icalcomp,
diff --git a/calendar/libedata-cal/e-cal-backend-intervaltree.c b/calendar/libedata-cal/e-cal-backend-intervaltree.c
index e653bde..d23ac18 100644
--- a/calendar/libedata-cal/e-cal-backend-intervaltree.c
+++ b/calendar/libedata-cal/e-cal-backend-intervaltree.c
@@ -97,9 +97,9 @@ component_key (const gchar *uid,
const gchar *rid)
{
if (rid)
- return g_strdup_printf("%s_%s", uid, rid);
+ return g_strdup_printf ("%s_%s", uid, rid);
else
- return g_strdup_printf("%s", uid);
+ return g_strdup_printf ("%s", uid);
}
/**
@@ -607,8 +607,8 @@ e_intervaltree_node_dump (EIntervalTree *tree,
*
localtime_r (&node->start, &tm_start_time);
localtime_r (&node->end, &tm_end_time);
- strftime(start_time, sizeof (start_time), "%Y-%m-%d T%H:%M:%S", &tm_start_time);
- strftime(end_time, sizeof (end_time), "%Y-%m-%d T%H:%M:%S", &tm_end_time);
+ strftime (start_time, sizeof (start_time), "%Y-%m-%d T%H:%M:%S", &tm_start_time);
+ strftime (end_time, sizeof (end_time), "%Y-%m-%d T%H:%M:%S", &tm_end_time);
g_print ("%*s[%s - %s]\n", indent, "", start_time, end_time);
*/
EIntervalTreePrivate *priv = tree->priv;
@@ -617,7 +617,7 @@ e_intervaltree_node_dump (EIntervalTree *tree,
node->end, node->min, node->max, node->red);
else
{
- g_print ("%*s[ - ]\n", indent, "");
+ g_print ("%*s[ - ]\n", indent, "");
return;
}
diff --git a/calendar/libedata-cal/e-cal-backend-sexp.c b/calendar/libedata-cal/e-cal-backend-sexp.c
index 5c7e5d3..cc55cdd 100644
--- a/calendar/libedata-cal/e-cal-backend-sexp.c
+++ b/calendar/libedata-cal/e-cal-backend-sexp.c
@@ -362,7 +362,7 @@ resolve_tzid (const gchar *tzid,
if (!tzid || !tzid[0])
return NULL;
- else if (!strcmp (tzid, "UTC"))
+ else if (!strcmp (tzid, "UTC"))
return icaltimezone_get_utc_timezone ();
return e_cal_backend_internal_get_timezone (ctx->backend, tzid);
@@ -1356,7 +1356,7 @@ entry_compare (SearchContext *ctx,
propname = argv[0]->value.string;
- any_field = !strcmp(propname, "x-evolution-any-field");
+ any_field = !strcmp (propname, "x-evolution-any-field");
for (i = 0; i < G_N_ELEMENTS (prop_info_table); i++) {
if (any_field
|| !strcmp (prop_info_table[i].query_prop, propname)) {
@@ -1372,7 +1372,7 @@ entry_compare (SearchContext *ctx,
if (prop && compare (prop, argv[1]->value.string)) {
truth = TRUE;
}
- if ((!prop) && compare("", argv[1]->value.string)) {
+ if ((!prop) && compare ("", argv[1]->value.string)) {
truth = TRUE;
}
g_free (prop);
@@ -1389,7 +1389,7 @@ entry_compare (SearchContext *ctx,
if (prop && compare (prop, argv[1]->value.string)) {
truth = TRUE;
}
- if ((!prop) && compare("", argv[1]->value.string)) {
+ if ((!prop) && compare ("", argv[1]->value.string)) {
truth = TRUE;
}
}
diff --git a/calendar/libedata-cal/e-cal-backend.c b/calendar/libedata-cal/e-cal-backend.c
index 647f654..03b0900 100644
--- a/calendar/libedata-cal/e-cal-backend.c
+++ b/calendar/libedata-cal/e-cal-backend.c
@@ -2078,7 +2078,7 @@ e_cal_backend_empty_cache (ECalBackend *backend,
e_cal_backend_cache_remove_component (cache, id->uid, id->rid);
- e_cal_backend_notify_component_removed (backend, id, comp, NULL);
+ e_cal_backend_notify_component_removed (backend, id, comp, NULL);
e_cal_component_free_id (id);
g_object_unref (comp);
diff --git a/calendar/libedata-cal/e-data-cal-view.c b/calendar/libedata-cal/e-data-cal-view.c
index a6a2455..7915245 100644
--- a/calendar/libedata-cal/e-data-cal-view.c
+++ b/calendar/libedata-cal/e-data-cal-view.c
@@ -442,7 +442,7 @@ impl_DataCalView_start (EGdbusCalView *object,
if (!priv->started) {
priv->started = TRUE;
- e_debug_log(FALSE, E_DEBUG_LOG_DOMAIN_CAL_QUERIES, "---;%p;VIEW-START;%s;%s", view, e_data_cal_view_get_text (view), G_OBJECT_TYPE_NAME(priv->backend));
+ e_debug_log (FALSE, E_DEBUG_LOG_DOMAIN_CAL_QUERIES, "---;%p;VIEW-START;%s;%s", view, e_data_cal_view_get_text (view), G_OBJECT_TYPE_NAME (priv->backend));
e_cal_backend_start_view (priv->backend, view);
}
diff --git a/calendar/libedata-cal/e-data-cal.c b/calendar/libedata-cal/e-data-cal.c
index 174880e..7ffc40e 100644
--- a/calendar/libedata-cal/e-data-cal.c
+++ b/calendar/libedata-cal/e-data-cal.c
@@ -156,7 +156,7 @@ static gchar *
construct_calview_path (void)
{
static guint counter = 1;
- return g_strdup_printf ("/org/gnome/evolution/dataserver/CalendarView/%d/%d", getpid(), counter++);
+ return g_strdup_printf ("/org/gnome/evolution/dataserver/CalendarView/%d/%d", getpid (), counter++);
}
static void
diff --git a/calendar/libegdbus/e-gdbus-cal-factory.c b/calendar/libegdbus/e-gdbus-cal-factory.c
index c911da0..a2b25ee 100644
--- a/calendar/libegdbus/e-gdbus-cal-factory.c
+++ b/calendar/libegdbus/e-gdbus-cal-factory.c
@@ -166,7 +166,12 @@ e_gdbus_cal_factory_complete_get_cal (EGdbusCalFactory *object,
e_gdbus_complete_sync_method_string (object, invocation, out_path, error);
}
-E_DECLARE_GDBUS_SYNC_METHOD_1_WITH_RETURN (cal_factory, get_cal, source_type, "as", path, "s")
+E_DECLARE_GDBUS_SYNC_METHOD_1_WITH_RETURN (cal_factory,
+ get_cal,
+ source_type,
+ "as",
+ path,
+ "s")
static const GDBusMethodInfo * const e_gdbus_cal_factory_method_info_pointers[] =
{
diff --git a/calendar/libegdbus/e-gdbus-cal-view.c b/calendar/libegdbus/e-gdbus-cal-view.c
index b96cc42..d8cc323 100644
--- a/calendar/libegdbus/e-gdbus-cal-view.c
+++ b/calendar/libegdbus/e-gdbus-cal-view.c
@@ -103,18 +103,58 @@ e_gdbus_cal_view_default_init (EGdbusCalViewIface *iface)
_signal_name_to_type = g_hash_table_new (g_str_hash, g_str_equal);
/* GObject signals definitions for D-Bus signals: */
- E_INIT_GDBUS_SIGNAL_STRV (EGdbusCalViewIface, "objects_added", objects_added, __OBJECTS_ADDED_SIGNAL)
- E_INIT_GDBUS_SIGNAL_STRV (EGdbusCalViewIface, "objects_modified",objects_modified, __OBJECTS_MODIFIED_SIGNAL)
- E_INIT_GDBUS_SIGNAL_STRV (EGdbusCalViewIface, "objects_removed", objects_removed, __OBJECTS_REMOVED_SIGNAL)
- E_INIT_GDBUS_SIGNAL_UINT_STRING (EGdbusCalViewIface, "progress", progress, __PROGRESS_SIGNAL)
- E_INIT_GDBUS_SIGNAL_STRV (EGdbusCalViewIface, "complete", complete, __COMPLETE_SIGNAL)
+ E_INIT_GDBUS_SIGNAL_STRV (
+ EGdbusCalViewIface,
+ "objects_added",
+ objects_added,
+ __OBJECTS_ADDED_SIGNAL)
+ E_INIT_GDBUS_SIGNAL_STRV (
+ EGdbusCalViewIface,
+ "objects_modified",
+ objects_modified,
+ __OBJECTS_MODIFIED_SIGNAL)
+ E_INIT_GDBUS_SIGNAL_STRV (
+ EGdbusCalViewIface,
+ "objects_removed",
+ objects_removed,
+ __OBJECTS_REMOVED_SIGNAL)
+ E_INIT_GDBUS_SIGNAL_UINT_STRING (
+ EGdbusCalViewIface,
+ "progress",
+ progress,
+ __PROGRESS_SIGNAL)
+ E_INIT_GDBUS_SIGNAL_STRV (
+ EGdbusCalViewIface,
+ "complete",
+ complete,
+ __COMPLETE_SIGNAL)
/* GObject signals definitions for D-Bus methods: */
- E_INIT_GDBUS_METHOD_VOID (EGdbusCalViewIface, "start", start, __START_METHOD)
- E_INIT_GDBUS_METHOD_VOID (EGdbusCalViewIface, "stop", stop, __STOP_METHOD)
- E_INIT_GDBUS_METHOD_UINT (EGdbusCalViewIface, "set_flags", set_flags, __SET_FLAGS_METHOD)
- E_INIT_GDBUS_METHOD_VOID (EGdbusCalViewIface, "dispose", dispose, __DISPOSE_METHOD)
- E_INIT_GDBUS_METHOD_STRV (EGdbusCalViewIface, "set_fields_of_interest", set_fields_of_interest, __SET_FIELDS_OF_INTEREST_METHOD)
+ E_INIT_GDBUS_METHOD_VOID (
+ EGdbusCalViewIface,
+ "start",
+ start,
+ __START_METHOD)
+ E_INIT_GDBUS_METHOD_VOID (
+ EGdbusCalViewIface,
+ "stop",
+ stop,
+ __STOP_METHOD)
+ E_INIT_GDBUS_METHOD_UINT (
+ EGdbusCalViewIface,
+ "set_flags",
+ set_flags,
+ __SET_FLAGS_METHOD)
+ E_INIT_GDBUS_METHOD_VOID (
+ EGdbusCalViewIface,
+ "dispose",
+ dispose,
+ __DISPOSE_METHOD)
+ E_INIT_GDBUS_METHOD_STRV (
+ EGdbusCalViewIface,
+ "set_fields_of_interest",
+ set_fields_of_interest,
+ __SET_FIELDS_OF_INTEREST_METHOD)
}
void
@@ -282,11 +322,28 @@ e_gdbus_cal_view_emit_complete (EGdbusCalView *object,
g_signal_emit (object, signals[__COMPLETE_SIGNAL], 0, arg_error);
}
-E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (cal_view, objects_added, objects, "as")
-E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (cal_view, objects_modified, objects, "as")
-E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (cal_view, objects_removed, uids, "as")
-E_DECLARE_GDBUS_NOTIFY_SIGNAL_2 (cal_view, progress, percent, "u", message, "s")
-E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (cal_view, complete, error, "as")
+E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (cal_view,
+ objects_added,
+ objects,
+ "as")
+E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (cal_view,
+ objects_modified,
+ objects,
+ "as")
+E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (cal_view,
+ objects_removed,
+ uids,
+ "as")
+E_DECLARE_GDBUS_NOTIFY_SIGNAL_2 (cal_view,
+ progress,
+ percent,
+ "u",
+ message,
+ "s")
+E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (cal_view,
+ complete,
+ error,
+ "as")
E_DECLARE_GDBUS_SYNC_METHOD_0 (cal_view,
start)
@@ -294,8 +351,14 @@ E_DECLARE_GDBUS_SYNC_METHOD_0 (cal_view,
stop)
E_DECLARE_GDBUS_SYNC_METHOD_0 (cal_view,
dispose)
-E_DECLARE_GDBUS_SYNC_METHOD_1 (cal_view, set_flags, flags, "u")
-E_DECLARE_GDBUS_SYNC_METHOD_1 (cal_view, set_fields_of_interest, fields_of_interest, "as")
+E_DECLARE_GDBUS_SYNC_METHOD_1 (cal_view,
+ set_flags,
+ flags,
+ "u")
+E_DECLARE_GDBUS_SYNC_METHOD_1 (cal_view,
+ set_fields_of_interest,
+ fields_of_interest,
+ "as")
static const GDBusMethodInfo * const e_gdbus_cal_view_method_info_pointers[] =
{
diff --git a/calendar/libegdbus/e-gdbus-cal.c b/calendar/libegdbus/e-gdbus-cal.c
index b390c39..dbd0b96 100644
--- a/calendar/libegdbus/e-gdbus-cal.c
+++ b/calendar/libegdbus/e-gdbus-cal.c
@@ -193,35 +193,161 @@ e_gdbus_cal_default_init (EGdbusCalIface *iface)
_signal_name_to_type = g_hash_table_new (g_str_hash, g_str_equal);
/* GObject signals definitions for D-Bus signals: */
- E_INIT_GDBUS_SIGNAL_STRING (EGdbusCalIface, "backend_error", backend_error, __BACKEND_ERROR_SIGNAL)
- E_INIT_GDBUS_SIGNAL_BOOLEAN (EGdbusCalIface, "readonly", readonly, __READONLY_SIGNAL)
- E_INIT_GDBUS_SIGNAL_BOOLEAN (EGdbusCalIface, "online", online, __ONLINE_SIGNAL)
- E_INIT_GDBUS_SIGNAL_STRV (EGdbusCalIface, "opened", opened, __OPENED_SIGNAL)
- E_INIT_GDBUS_SIGNAL_STRV (EGdbusCalIface, "free_busy_data", free_busy_data, __FREE_BUSY_DATA_SIGNAL)
- E_INIT_GDBUS_SIGNAL_STRV (EGdbusCalIface, "backend_property_changed", backend_property_changed, __BACKEND_PROPERTY_CHANGED_SIGNAL)
+ E_INIT_GDBUS_SIGNAL_STRING (
+ EGdbusCalIface,
+ "backend_error",
+ backend_error,
+ __BACKEND_ERROR_SIGNAL)
+ E_INIT_GDBUS_SIGNAL_BOOLEAN (
+ EGdbusCalIface,
+ "readonly",
+ readonly,
+ __READONLY_SIGNAL)
+ E_INIT_GDBUS_SIGNAL_BOOLEAN (
+ EGdbusCalIface,
+ "online",
+ online,
+ __ONLINE_SIGNAL)
+ E_INIT_GDBUS_SIGNAL_STRV (
+ EGdbusCalIface,
+ "opened",
+ opened,
+ __OPENED_SIGNAL)
+ E_INIT_GDBUS_SIGNAL_STRV (
+ EGdbusCalIface,
+ "free_busy_data",
+ free_busy_data,
+ __FREE_BUSY_DATA_SIGNAL)
+ E_INIT_GDBUS_SIGNAL_STRV (
+ EGdbusCalIface,
+ "backend_property_changed",
+ backend_property_changed,
+ __BACKEND_PROPERTY_CHANGED_SIGNAL)
/* GObject signals definitions for D-Bus methods: */
- E_INIT_GDBUS_METHOD_ASYNC_BOOLEAN__VOID (EGdbusCalIface, "open", open, __OPEN_METHOD, __OPEN_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_VOID__VOID (EGdbusCalIface, "remove", remove, __REMOVE_METHOD, __REMOVE_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_VOID__VOID (EGdbusCalIface, "refresh", refresh, __REFRESH_METHOD, __REFRESH_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_STRING__STRING(EGdbusCalIface, "get_backend_property", get_backend_property, __GET_BACKEND_PROPERTY_METHOD, __GET_BACKEND_PROPERTY_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_STRV__VOID (EGdbusCalIface, "set_backend_property", set_backend_property, __SET_BACKEND_PROPERTY_METHOD, __SET_BACKEND_PROPERTY_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_STRV__STRING (EGdbusCalIface, "get_object", get_object, __GET_OBJECT_METHOD, __GET_OBJECT_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_STRING__STRV (EGdbusCalIface, "get_object_list", get_object_list, __GET_OBJECT_LIST_METHOD, __GET_OBJECT_LIST_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_STRV__VOID (EGdbusCalIface, "get_free_busy", get_free_busy, __GET_FREE_BUSY_METHOD, __GET_FREE_BUSY_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_STRV__STRV (EGdbusCalIface, "create_objects", create_objects, __CREATE_OBJECTS_METHOD, __CREATE_OBJECTS_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_STRV__VOID (EGdbusCalIface, "modify_objects", modify_objects, __MODIFY_OBJECTS_METHOD, __MODIFY_OBJECTS_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_STRV__VOID (EGdbusCalIface, "remove_objects", remove_objects, __REMOVE_OBJECTS_METHOD, __REMOVE_OBJECTS_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_STRING__VOID (EGdbusCalIface, "receive_objects", receive_objects, __RECEIVE_OBJECTS_METHOD, __RECEIVE_OBJECTS_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_STRING__STRV (EGdbusCalIface, "send_objects", send_objects, __SEND_OBJECTS_METHOD, __SEND_OBJECTS_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_STRV__STRV (EGdbusCalIface, "get_attachment_uris", get_attachment_uris, __GET_ATTACHMENT_URIS_METHOD, __GET_ATTACHMENT_URIS_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_STRV__VOID (EGdbusCalIface, "discard_alarm", discard_alarm, __DISCARD_ALARM_METHOD, __DISCARD_ALARM_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_STRING__STRING(EGdbusCalIface, "get_view", get_view, __GET_VIEW_METHOD, __GET_VIEW_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_STRING__STRING(EGdbusCalIface, "get_timezone", get_timezone, __GET_TIMEZONE_METHOD, __GET_TIMEZONE_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_ASYNC_STRING__VOID (EGdbusCalIface, "add_timezone", add_timezone, __ADD_TIMEZONE_METHOD, __ADD_TIMEZONE_DONE_SIGNAL)
- E_INIT_GDBUS_METHOD_UINT (EGdbusCalIface, "cancel_operation", cancel_operation, __CANCEL_OPERATION_METHOD)
- E_INIT_GDBUS_METHOD_VOID (EGdbusCalIface, "cancel_all", cancel_all, __CANCEL_ALL_METHOD)
- E_INIT_GDBUS_METHOD_VOID (EGdbusCalIface, "close", close, __CLOSE_METHOD)
+ E_INIT_GDBUS_METHOD_ASYNC_BOOLEAN__VOID (
+ EGdbusCalIface,
+ "open",
+ open,
+ __OPEN_METHOD,
+ __OPEN_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_VOID__VOID (
+ EGdbusCalIface,
+ "remove",
+ remove,
+ __REMOVE_METHOD,
+ __REMOVE_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_VOID__VOID (
+ EGdbusCalIface,
+ "refresh",
+ refresh,
+ __REFRESH_METHOD,
+ __REFRESH_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_STRING__STRING (
+ EGdbusCalIface,
+ "get_backend_property",
+ get_backend_property,
+ __GET_BACKEND_PROPERTY_METHOD,
+ __GET_BACKEND_PROPERTY_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_STRV__VOID (
+ EGdbusCalIface,
+ "set_backend_property",
+ set_backend_property,
+ __SET_BACKEND_PROPERTY_METHOD,
+ __SET_BACKEND_PROPERTY_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_STRV__STRING (
+ EGdbusCalIface,
+ "get_object",
+ get_object,
+ __GET_OBJECT_METHOD,
+ __GET_OBJECT_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_STRING__STRV (
+ EGdbusCalIface,
+ "get_object_list",
+ get_object_list,
+ __GET_OBJECT_LIST_METHOD,
+ __GET_OBJECT_LIST_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_STRV__VOID (
+ EGdbusCalIface,
+ "get_free_busy",
+ get_free_busy,
+ __GET_FREE_BUSY_METHOD,
+ __GET_FREE_BUSY_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_STRV__STRV (
+ EGdbusCalIface,
+ "create_objects",
+ create_objects,
+ __CREATE_OBJECTS_METHOD,
+ __CREATE_OBJECTS_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_STRV__VOID (
+ EGdbusCalIface,
+ "modify_objects",
+ modify_objects,
+ __MODIFY_OBJECTS_METHOD,
+ __MODIFY_OBJECTS_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_STRV__VOID (
+ EGdbusCalIface,
+ "remove_objects",
+ remove_objects,
+ __REMOVE_OBJECTS_METHOD,
+ __REMOVE_OBJECTS_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_STRING__VOID (
+ EGdbusCalIface,
+ "receive_objects",
+ receive_objects,
+ __RECEIVE_OBJECTS_METHOD,
+ __RECEIVE_OBJECTS_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_STRING__STRV (
+ EGdbusCalIface,
+ "send_objects",
+ send_objects,
+ __SEND_OBJECTS_METHOD,
+ __SEND_OBJECTS_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_STRV__STRV (
+ EGdbusCalIface,
+ "get_attachment_uris",
+ get_attachment_uris,
+ __GET_ATTACHMENT_URIS_METHOD,
+ __GET_ATTACHMENT_URIS_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_STRV__VOID (
+ EGdbusCalIface,
+ "discard_alarm",
+ discard_alarm,
+ __DISCARD_ALARM_METHOD,
+ __DISCARD_ALARM_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_STRING__STRING (
+ EGdbusCalIface,
+ "get_view",
+ get_view,
+ __GET_VIEW_METHOD,
+ __GET_VIEW_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_STRING__STRING (
+ EGdbusCalIface,
+ "get_timezone",
+ get_timezone,
+ __GET_TIMEZONE_METHOD,
+ __GET_TIMEZONE_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_STRING__VOID (
+ EGdbusCalIface,
+ "add_timezone",
+ add_timezone,
+ __ADD_TIMEZONE_METHOD,
+ __ADD_TIMEZONE_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_UINT (
+ EGdbusCalIface,
+ "cancel_operation",
+ cancel_operation,
+ __CANCEL_OPERATION_METHOD)
+ E_INIT_GDBUS_METHOD_VOID (
+ EGdbusCalIface,
+ "cancel_all",
+ cancel_all,
+ __CANCEL_ALL_METHOD)
+ E_INIT_GDBUS_METHOD_VOID (
+ EGdbusCalIface,
+ "close",
+ close,
+ __CLOSE_METHOD)
}
void
@@ -1233,35 +1359,120 @@ e_gdbus_cal_emit_backend_property_changed (EGdbusCal *object,
g_signal_emit (object, signals[__BACKEND_PROPERTY_CHANGED_SIGNAL], 0, arg_name_value);
}
-E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (cal, backend_error, message, "s")
-E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (cal, readonly, is_readonly, "b")
-E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (cal, online, is_online, "b")
-E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (cal, opened, error, "as")
-E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (cal, free_busy_data, free_busy_data, "as")
-E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (cal, backend_property_changed, name_value, "as")
-
-E_DECLARE_GDBUS_ASYNC_METHOD_1 (cal, open, only_if_exists, "b")
+E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (cal,
+ backend_error,
+ message,
+ "s")
+E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (cal,
+ readonly,
+ is_readonly,
+ "b")
+E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (cal,
+ online,
+ is_online,
+ "b")
+E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (cal,
+ opened,
+ error,
+ "as")
+E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (cal,
+ free_busy_data,
+ free_busy_data,
+ "as")
+E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (cal,
+ backend_property_changed,
+ name_value,
+ "as")
+
+E_DECLARE_GDBUS_ASYNC_METHOD_1 (cal,
+ open,
+ only_if_exists,
+ "b")
E_DECLARE_GDBUS_ASYNC_METHOD_0 (cal,
remove)
E_DECLARE_GDBUS_ASYNC_METHOD_0 (cal,
refresh)
-E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (cal, get_backend_property, propname, "s", propvalue, "s")
-E_DECLARE_GDBUS_ASYNC_METHOD_1 (cal, set_backend_property, propnamevalue, "as")
-E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (cal, get_object, uid_rid, "as", object, "s")
-E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (cal, get_object_list, sexp, "s", objects, "as")
-E_DECLARE_GDBUS_ASYNC_METHOD_1 (cal, get_free_busy, start_stop_users, "as")
-E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (cal, create_objects, objects, "as", uids, "as")
-E_DECLARE_GDBUS_ASYNC_METHOD_1 (cal, modify_objects, object_mod, "as")
-E_DECLARE_GDBUS_ASYNC_METHOD_1 (cal, remove_objects, mod_ids, "as")
-E_DECLARE_GDBUS_ASYNC_METHOD_1 (cal, receive_objects, object, "s")
-E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (cal, send_objects, object, "s", object_users, "as")
-E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (cal, get_attachment_uris, uid_rid, "as", attachments, "as")
-E_DECLARE_GDBUS_ASYNC_METHOD_1 (cal, discard_alarm, uid_rid_auid, "as")
-E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (cal, get_view, sexp, "s", view_path, "s")
-E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (cal, get_timezone, tzid, "s", tzobject, "s")
-E_DECLARE_GDBUS_ASYNC_METHOD_1 (cal, add_timezone, tzobject, "s")
-
-E_DECLARE_GDBUS_SYNC_METHOD_1 (cal, cancel_operation, opid, "u")
+E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (cal,
+ get_backend_property,
+ propname,
+ "s",
+ propvalue,
+ "s")
+E_DECLARE_GDBUS_ASYNC_METHOD_1 (cal,
+ set_backend_property,
+ propnamevalue,
+ "as")
+E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (cal,
+ get_object,
+ uid_rid,
+ "as",
+ object,
+ "s")
+E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (cal,
+ get_object_list,
+ sexp,
+ "s",
+ objects,
+ "as")
+E_DECLARE_GDBUS_ASYNC_METHOD_1 (cal,
+ get_free_busy,
+ start_stop_users,
+ "as")
+E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (cal,
+ create_objects,
+ objects,
+ "as",
+ uids,
+ "as")
+E_DECLARE_GDBUS_ASYNC_METHOD_1 (cal,
+ modify_objects,
+ object_mod,
+ "as")
+E_DECLARE_GDBUS_ASYNC_METHOD_1 (cal,
+ remove_objects,
+ mod_ids,
+ "as")
+E_DECLARE_GDBUS_ASYNC_METHOD_1 (cal,
+ receive_objects,
+ object,
+ "s")
+E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (cal,
+ send_objects,
+ object,
+ "s",
+ object_users,
+ "as")
+E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (cal,
+ get_attachment_uris,
+ uid_rid,
+ "as",
+ attachments,
+ "as")
+E_DECLARE_GDBUS_ASYNC_METHOD_1 (cal,
+ discard_alarm,
+ uid_rid_auid,
+ "as")
+E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (cal,
+ get_view,
+ sexp,
+ "s",
+ view_path,
+ "s")
+E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (cal,
+ get_timezone,
+ tzid,
+ "s",
+ tzobject,
+ "s")
+E_DECLARE_GDBUS_ASYNC_METHOD_1 (cal,
+ add_timezone,
+ tzobject,
+ "s")
+
+E_DECLARE_GDBUS_SYNC_METHOD_1 (cal,
+ cancel_operation,
+ opid,
+ "u")
E_DECLARE_GDBUS_SYNC_METHOD_0 (cal,
cancel_all)
E_DECLARE_GDBUS_SYNC_METHOD_0 (cal,
diff --git a/camel/camel-block-file.c b/camel/camel-block-file.c
index b96b3cf..cba9be0 100644
--- a/camel/camel-block-file.c
+++ b/camel/camel-block-file.c
@@ -82,15 +82,15 @@ block_file_validate_root (CamelBlockFile *bs)
retval = fstat (bs->fd, &st);
- d(printf("Validate root: '%s'\n", bs->path));
- d(printf("version: %.8s (%.8s)\n", bs->root->version, bs->version));
- d(printf("block size: %d (%d)%s\n", br->block_size, bs->block_size,
+ d (printf ("Validate root: '%s'\n", bs->path));
+ d (printf ("version: %.8s (%.8s)\n", bs->root->version, bs->version));
+ d (printf ("block size: %d (%d)%s\n", br->block_size, bs->block_size,
br->block_size != bs->block_size ? " BAD":" OK"));
- d(printf("free: %ld (%d add size < %ld)%s\n", (glong)br->free, br->free / bs->block_size * bs->block_size, (glong)st.st_size,
+ d (printf ("free: %ld (%d add size < %ld)%s\n", (glong) br->free, br->free / bs->block_size * bs->block_size, (glong) st.st_size,
(br->free > st.st_size) || (br->free % bs->block_size) != 0 ? " BAD":" OK"));
- d(printf("last: %ld (%d and size: %ld)%s\n", (glong)br->last, br->last / bs->block_size * bs->block_size, (glong)st.st_size,
+ d (printf ("last: %ld (%d and size: %ld)%s\n", (glong) br->last, br->last / bs->block_size * bs->block_size, (glong) st.st_size,
(br->last != st.st_size) || ((br->last % bs->block_size) != 0) ? " BAD": " OK"));
- d(printf("flags: %s\n", (br->flags & CAMEL_BLOCK_FILE_SYNC)?"SYNC":"unSYNC"));
+ d (printf ("flags: %s\n", (br->flags & CAMEL_BLOCK_FILE_SYNC)?"SYNC":"unSYNC"));
if (br->last == 0
|| memcmp (bs->root->version, bs->version, 8) != 0
@@ -103,15 +103,15 @@ block_file_validate_root (CamelBlockFile *bs)
|| (br->flags & CAMEL_BLOCK_FILE_SYNC) == 0) {
#if 0
if (retval != -1 && st.st_size > 0) {
- g_warning("Invalid root: '%s'", bs->path);
- g_warning("version: %.8s (%.8s)", bs->root->version, bs->version);
- g_warning("block size: %d (%d)%s", br->block_size, bs->block_size,
+ g_warning ("Invalid root: '%s'", bs->path);
+ g_warning ("version: %.8s (%.8s)", bs->root->version, bs->version);
+ g_warning ("block size: %d (%d)%s", br->block_size, bs->block_size,
br->block_size != bs->block_size ? " BAD":" OK");
- g_warning("free: %ld (%d add size < %ld)%s", (glong)br->free, br->free / bs->block_size * bs->block_size, (glong)st.st_size,
+ g_warning ("free: %ld (%d add size < %ld)%s", (glong) br->free, br->free / bs->block_size * bs->block_size, (glong) st.st_size,
(br->free > st.st_size) || (br->free % bs->block_size) != 0 ? " BAD":" OK");
- g_warning("last: %ld (%d and size: %ld)%s", (glong)br->last, br->last / bs->block_size * bs->block_size, (glong)st.st_size,
+ g_warning ("last: %ld (%d and size: %ld)%s", (glong) br->last, br->last / bs->block_size * bs->block_size, (glong) st.st_size,
(br->last != st.st_size) || ((br->last % bs->block_size) != 0) ? " BAD": " OK");
- g_warning("flags: %s", (br->flags & CAMEL_BLOCK_FILE_SYNC)?"SYNC":"unSYNC");
+ g_warning ("flags: %s", (br->flags & CAMEL_BLOCK_FILE_SYNC)?"SYNC":"unSYNC");
}
#endif
return -1;
@@ -160,7 +160,7 @@ block_file_finalize (GObject *object)
while ((bl = g_queue_pop_head (&bs->block_cache)) != NULL) {
if (bl->refcount != 0)
- g_warning("Block '%u' still referenced", bl->id);
+ g_warning ("Block '%u' still referenced", bl->id);
g_free (bl);
}
@@ -250,7 +250,7 @@ block_file_use (CamelBlockFile *bs)
errno = ENOENT;
return -1;
} else {
- d(printf("Turning block file online: %s\n", bs->path));
+ d (printf ("Turning block file online: %s\n", bs->path));
}
if ((bs->fd = g_open (bs->path, bs->flags | O_BINARY, 0600)) == -1) {
@@ -283,7 +283,7 @@ block_file_use (CamelBlockFile *bs)
if (CAMEL_BLOCK_FILE_TRYLOCK (bf, root_lock)) {
if (CAMEL_BLOCK_FILE_TRYLOCK (bf, cache_lock)) {
if (CAMEL_BLOCK_FILE_TRYLOCK (bf, io_lock)) {
- d(printf("[%d] Turning block file offline: %s\n", block_file_count-1, bf->path));
+ d (printf ("[%d] Turning block file offline: %s\n", block_file_count - 1, bf->path));
sync_nolock (bf);
close (bf->fd);
bf->fd = -1;
@@ -370,7 +370,7 @@ camel_block_file_new (const gchar *path,
/* Do we need to init the root block? */
if (class->validate_root (bs) == -1) {
- d(printf("Initialise root block: %.8s\n", version));
+ d (printf ("Initialise root block: %.8s\n", version));
class->init_root (bs);
camel_block_file_touch_block (bs, bs->root_block);
@@ -553,7 +553,7 @@ camel_block_file_get_block (CamelBlockFile *bs,
bl = g_hash_table_lookup (bs->blocks, GUINT_TO_POINTER (id));
- d(printf("Get block %08x: %s\n", id, bl?"cached":"must read"));
+ d (printf ("Get block %08x: %s\n", id, bl?"cached":"must read"));
if (bl == NULL) {
GQueue trash = G_QUEUE_INIT;
@@ -612,7 +612,7 @@ camel_block_file_get_block (CamelBlockFile *bs,
CAMEL_BLOCK_FILE_UNLOCK (bs, cache_lock);
- d(printf("Got block %08x\n", id));
+ d (printf ("Got block %08x\n", id));
return bl;
}
@@ -687,7 +687,7 @@ camel_block_file_touch_block (CamelBlockFile *bs,
bl->flags |= CAMEL_BLOCK_DIRTY;
if ((bs->root->flags & CAMEL_BLOCK_FILE_SYNC) && bl != bs->root_block) {
- d(printf("turning off sync flag\n"));
+ d (printf ("turning off sync flag\n"));
bs->root->flags &= ~CAMEL_BLOCK_FILE_SYNC;
bs->root_block->flags |= CAMEL_BLOCK_DIRTY;
camel_block_file_sync_block (bs, bs->root_block);
@@ -729,7 +729,7 @@ static gint
sync_block_nolock (CamelBlockFile *bs,
CamelBlock *bl)
{
- d(printf("Sync block %08x: %s\n", bl->id, (bl->flags & CAMEL_BLOCK_DIRTY)?"dirty":"clean"));
+ d (printf ("Sync block %08x: %s\n", bl->id, (bl->flags & CAMEL_BLOCK_DIRTY)?"dirty":"clean"));
if (bl->flags & CAMEL_BLOCK_DIRTY) {
if (lseek (bs->fd, bl->id, SEEK_SET) == -1
@@ -765,7 +765,7 @@ sync_nolock (CamelBlockFile *bs)
&& (bs->root->flags & CAMEL_BLOCK_FILE_SYNC) != 0)
return 0;
- d(printf("turning on sync flag\n"));
+ d (printf ("turning on sync flag\n"));
bs->root->flags |= CAMEL_BLOCK_FILE_SYNC;
bs->root_block->flags |= CAMEL_BLOCK_DIRTY;
@@ -938,7 +938,7 @@ key_file_use (CamelKeyFile *bs)
errno = ENOENT;
return -1;
} else {
- d(printf("Turning key file online: '%s'\n", bs->path));
+ d (printf ("Turning key file online: '%s'\n", bs->path));
}
if ((bs->flags & O_ACCMODE) == O_RDONLY)
@@ -976,7 +976,7 @@ key_file_use (CamelKeyFile *bs)
/* Need to trylock, as any of these lock levels might be trying
* to lock the key_file_lock, so we need to check and abort if so */
if (CAMEL_BLOCK_FILE_TRYLOCK (bf, lock)) {
- d(printf("Turning key file offline: %s\n", bf->path));
+ d (printf ("Turning key file offline: %s\n", bf->path));
fclose (bf->fp);
bf->fp = NULL;
key_file_count--;
@@ -1029,7 +1029,7 @@ camel_key_file_new (const gchar *path,
goffset last;
gint err;
- d(printf("New key file '%s'\n", path));
+ d (printf ("New key file '%s'\n", path));
kf = g_object_new (CAMEL_TYPE_KEY_FILE, NULL);
kf->path = g_strdup (path);
@@ -1149,10 +1149,10 @@ camel_key_file_write (CamelKeyFile *kf,
g_return_val_if_fail (parent != NULL, -1);
g_return_val_if_fail (records != NULL, -1);
- d(printf("write key %08x len = %d\n", *parent, len));
+ d (printf ("write key %08x len = %d\n", *parent, len));
if (len == 0) {
- d(printf(" new parent = %08x\n", *parent));
+ d (printf (" new parent = %08x\n", *parent));
return 0;
}
@@ -1180,7 +1180,7 @@ camel_key_file_write (CamelKeyFile *kf,
/* UNLOCK */
key_file_unuse (kf);
- d(printf(" new parent = %08x\n", *parent));
+ d (printf (" new parent = %08x\n", *parent));
return ret;
}
diff --git a/camel/camel-data-cache.c b/camel/camel-data-cache.c
index 7e58d9d..e824f86 100644
--- a/camel/camel-data-cache.c
+++ b/camel/camel-data-cache.c
@@ -330,7 +330,7 @@ data_cache_path (CamelDataCache *cdc,
hash = g_str_hash (key);
hash = (hash >> 5) &CAMEL_DATA_CACHE_MASK;
dir = alloca (strlen (cdc->priv->path) + strlen (path) + 8);
- sprintf(dir, "%s/%s/%02x", cdc->priv->path, path, hash);
+ sprintf (dir, "%s/%s/%02x", cdc->priv->path, path, hash);
if (g_access (dir, F_OK) == -1) {
if (create)
@@ -347,7 +347,7 @@ data_cache_path (CamelDataCache *cdc,
}
tmp = camel_file_util_safe_filename (key);
- real = g_strdup_printf("%s/%s", dir, tmp);
+ real = g_strdup_printf ("%s/%s", dir, tmp);
g_free (tmp);
return real;
diff --git a/camel/camel-db.c b/camel/camel-db.c
index c8ef256..87fac3d 100644
--- a/camel/camel-db.c
+++ b/camel/camel-db.c
@@ -403,7 +403,7 @@ cdb_sql_exec (sqlite3 *db,
gchar *errmsg = NULL;
gint ret = -1;
- d(g_print("Camel SQL Exec:\n%s\n", stmt));
+ d (g_print ("Camel SQL Exec:\n%s\n", stmt));
ret = sqlite3_exec (db, stmt, callback, data, &errmsg);
while (ret == SQLITE_BUSY || ret == SQLITE_LOCKED || ret == -1) {
@@ -415,7 +415,7 @@ cdb_sql_exec (sqlite3 *db,
}
if (ret != SQLITE_OK) {
- d(g_print ("Error in SQL EXEC statement: %s [%s].\n", stmt, errmsg));
+ d (g_print ("Error in SQL EXEC statement: %s [%s].\n", stmt, errmsg));
g_set_error (
error, CAMEL_ERROR,
CAMEL_ERROR_GENERIC, "%s", errmsg);
@@ -504,7 +504,7 @@ camel_db_open (const gchar *path,
} else {
const gchar *errmsg;
errmsg = sqlite3_errmsg (db);
- d(g_print("Can't open database %s: %s\n", path, errmsg));
+ d (g_print ("Can't open database %s: %s\n", path, errmsg));
g_set_error (
error, CAMEL_ERROR,
CAMEL_ERROR_GENERIC, "%s", errmsg);
@@ -519,22 +519,22 @@ camel_db_open (const gchar *path,
cdb->priv->file_name = g_strdup (path);
g_static_rw_lock_init (&cdb->priv->rwlock);
cdb->priv->timer = NULL;
- d(g_print ("\nDatabase succesfully opened \n"));
+ d (g_print ("\nDatabase succesfully opened \n"));
sqlite3_create_function (db, "MATCH", 2, SQLITE_UTF8, NULL, cdb_match_func, NULL, NULL);
/* Which is big / costlier ? A Stack frame or a pointer */
- if (g_getenv("CAMEL_SQLITE_DEFAULT_CACHE_SIZE")!=NULL) {
+ if (g_getenv ("CAMEL_SQLITE_DEFAULT_CACHE_SIZE") != NULL) {
gchar *cache = NULL;
- cache = g_strdup_printf ("PRAGMA cache_size=%s", g_getenv("CAMEL_SQLITE_DEFAULT_CACHE_SIZE"));
+ cache = g_strdup_printf ("PRAGMA cache_size=%s", g_getenv ("CAMEL_SQLITE_DEFAULT_CACHE_SIZE"));
camel_db_command (cdb, cache, NULL);
g_free (cache);
}
camel_db_command (cdb, "ATTACH DATABASE ':memory:' AS mem", NULL);
- if (g_getenv("CAMEL_SQLITE_IN_MEMORY") != NULL) {
+ if (g_getenv ("CAMEL_SQLITE_IN_MEMORY") != NULL) {
/* Optionally turn off Journaling, this gets over fsync issues, but could be risky */
camel_db_command (cdb, "PRAGMA main.journal_mode = off", NULL);
camel_db_command (cdb, "PRAGMA temp_store = memory", NULL);
@@ -571,7 +571,7 @@ camel_db_close (CamelDB *cdb)
g_free (cdb->priv->file_name);
g_free (cdb->priv);
g_free (cdb);
- d(g_print ("\nDatabase succesfully closed \n"));
+ d (g_print ("\nDatabase succesfully closed \n"));
}
}
@@ -592,7 +592,7 @@ camel_db_set_collate (CamelDB *cdb,
return 0;
WRITER_LOCK (cdb);
- d(g_print("Creating Collation %s on %s with %p\n", collate, col, (gpointer) func));
+ d (g_print ("Creating Collation %s on %s with %p\n", collate, col, (gpointer) func));
if (collate && func)
ret = sqlite3_create_collation (cdb->db, collate, SQLITE_UTF8, NULL, func);
WRITER_UNLOCK (cdb);
@@ -639,7 +639,7 @@ camel_db_begin_transaction (CamelDB *cdb,
return -1;
WRITER_LOCK (cdb);
- STARTTS("BEGIN");
+ STARTTS ("BEGIN");
cdb->priv->transaction_is_on = TRUE;
@@ -725,7 +725,7 @@ camel_db_transaction_command (CamelDB *cdb,
WRITER_LOCK (cdb);
- STARTTS("BEGIN");
+ STARTTS ("BEGIN");
ret = cdb_sql_exec (cdb->db, "BEGIN", NULL, NULL, error);
if (ret)
goto end;
@@ -754,7 +754,7 @@ count_cb (gpointer data,
gint i;
for (i = 0; i < argc; i++) {
- if (strstr(azColName[i], "COUNT")) {
+ if (strstr (azColName[i], "COUNT")) {
*(guint32 *)data = argv [i] ? strtoul (argv [i], NULL, 10) : 0;
}
}
@@ -981,7 +981,7 @@ camel_db_select (CamelDB *cdb,
if (!cdb)
return ret;
- d(g_print ("\n%s:\n%s \n", G_STRFUNC, stmt));
+ d (g_print ("\n%s:\n%s \n", G_STRFUNC, stmt));
READER_LOCK (cdb);
START (stmt);
@@ -1044,7 +1044,7 @@ camel_db_get_folder_uids (CamelDB *db,
gchar *sel_query;
gint ret;
- sel_query = sqlite3_mprintf("SELECT uid,flags FROM %Q%s%s%s%s", folder_name, sort_by ? " order by " : "", sort_by ? sort_by: "", (sort_by && collate) ? " collate " : "", (sort_by && collate) ? collate : "");
+ sel_query = sqlite3_mprintf ("SELECT uid,flags FROM %Q%s%s%s%s", folder_name, sort_by ? " order by " : "", sort_by ? sort_by: "", (sort_by && collate) ? " collate " : "", (sort_by && collate) ? collate : "");
ret = camel_db_select (db, sel_query, read_uids_to_hash_callback, hash, error);
sqlite3_free (sel_query);
@@ -1066,7 +1066,7 @@ camel_db_get_folder_junk_uids (CamelDB *db,
gint ret;
GPtrArray *array = g_ptr_array_new ();
- sel_query = sqlite3_mprintf("SELECT uid FROM %Q where junk=1", folder_name);
+ sel_query = sqlite3_mprintf ("SELECT uid FROM %Q where junk=1", folder_name);
ret = camel_db_select (db, sel_query, read_uids_callback, array, error);
@@ -1093,7 +1093,7 @@ camel_db_get_folder_deleted_uids (CamelDB *db,
gint ret;
GPtrArray *array = g_ptr_array_new ();
- sel_query = sqlite3_mprintf("SELECT uid FROM %Q where deleted=1", folder_name);
+ sel_query = sqlite3_mprintf ("SELECT uid FROM %Q where deleted=1", folder_name);
ret = camel_db_select (db, sel_query, read_uids_callback, array, error);
sqlite3_free (sel_query);
@@ -1194,7 +1194,7 @@ camel_db_write_preview_record (CamelDB *db,
gchar *query;
gint ret;
- query = sqlite3_mprintf("INSERT OR REPLACE INTO '%q_preview' VALUES(%Q,%Q)", folder_name, uid, msg);
+ query = sqlite3_mprintf ("INSERT OR REPLACE INTO '%q_preview' VALUES(%Q,%Q)", folder_name, uid, msg);
ret = camel_db_add_to_transaction (db, query, error);
sqlite3_free (query);
@@ -1239,35 +1239,35 @@ camel_db_create_message_info_table (CamelDB *cdb,
sqlite3_free (table_creation_query);
/* FIXME: sqlize folder_name before you create the index */
- safe_index = g_strdup_printf("SINDEX-%s", folder_name);
+ safe_index = g_strdup_printf ("SINDEX-%s", folder_name);
table_creation_query = sqlite3_mprintf ("DROP INDEX IF EXISTS %Q", safe_index);
ret = camel_db_add_to_transaction (cdb, table_creation_query, error);
g_free (safe_index);
sqlite3_free (table_creation_query);
/* INDEX on preview */
- safe_index = g_strdup_printf("SINDEX-%s-preview", folder_name);
+ safe_index = g_strdup_printf ("SINDEX-%s-preview", folder_name);
table_creation_query = sqlite3_mprintf ("CREATE INDEX IF NOT EXISTS %Q ON '%q_preview' (uid, preview)", safe_index, folder_name);
ret = camel_db_add_to_transaction (cdb, table_creation_query, error);
g_free (safe_index);
sqlite3_free (table_creation_query);
/* Index on deleted*/
- safe_index = g_strdup_printf("DELINDEX-%s", folder_name);
+ safe_index = g_strdup_printf ("DELINDEX-%s", folder_name);
table_creation_query = sqlite3_mprintf ("CREATE INDEX IF NOT EXISTS %Q ON %Q (deleted)", safe_index, folder_name);
ret = camel_db_add_to_transaction (cdb, table_creation_query, error);
g_free (safe_index);
sqlite3_free (table_creation_query);
/* Index on Junk*/
- safe_index = g_strdup_printf("JUNKINDEX-%s", folder_name);
+ safe_index = g_strdup_printf ("JUNKINDEX-%s", folder_name);
table_creation_query = sqlite3_mprintf ("CREATE INDEX IF NOT EXISTS %Q ON %Q (junk)", safe_index, folder_name);
ret = camel_db_add_to_transaction (cdb, table_creation_query, error);
g_free (safe_index);
sqlite3_free (table_creation_query);
/* Index on unread*/
- safe_index = g_strdup_printf("READINDEX-%s", folder_name);
+ safe_index = g_strdup_printf ("READINDEX-%s", folder_name);
table_creation_query = sqlite3_mprintf ("CREATE INDEX IF NOT EXISTS %Q ON %Q (read)", safe_index, folder_name);
ret = camel_db_add_to_transaction (cdb, table_creation_query, error);
g_free (safe_index);
@@ -1642,7 +1642,7 @@ read_fir_callback (gpointer ref,
struct ReadFirData *rfd = ref;
gint i;
- d(g_print ("\nread_fir_callback called \n"));
+ d (g_print ("\nread_fir_callback called \n"));
for (i = 0; i < ncol; ++i) {
if (!name[i] || !cols[i])
@@ -1872,7 +1872,7 @@ cdb_delete_ids (CamelDB *cdb,
iterator = uids;
while (iterator) {
- gchar *foo = g_strdup_printf("%s%s", uid_prefix, (gchar *) iterator->data);
+ gchar *foo = g_strdup_printf ("%s%s", uid_prefix, (gchar *) iterator->data);
tmp = sqlite3_mprintf ("%Q", foo);
g_free (foo);
iterator = iterator->next;
diff --git a/camel/camel-debug.c b/camel/camel-debug.c
index 4f35e1b..47e80e1 100644
--- a/camel/camel-debug.c
+++ b/camel/camel-debug.c
@@ -59,7 +59,7 @@ camel_debug_init (void)
{
gchar *d;
- d = g_strdup(getenv("CAMEL_DEBUG"));
+ d = g_strdup (getenv ("CAMEL_DEBUG"));
if (d) {
gchar *p;
@@ -74,7 +74,7 @@ camel_debug_init (void)
d = p;
}
- if (g_hash_table_lookup(debug_table, "all"))
+ if (g_hash_table_lookup (debug_table, "all"))
camel_verbose_debug = 1;
}
}
@@ -138,7 +138,7 @@ camel_debug_start (const gchar *mode)
{
if (camel_debug (mode)) {
g_static_mutex_lock (&debug_lock);
- printf ("Thread %p >\n", g_thread_self());
+ printf ("Thread %p >\n", g_thread_self ());
return TRUE;
}
@@ -154,7 +154,7 @@ camel_debug_start (const gchar *mode)
void
camel_debug_end (void)
{
- printf ("< %p >\n", g_thread_self());
+ printf ("< %p >\n", g_thread_self ());
g_static_mutex_unlock (&debug_lock);
}
@@ -603,7 +603,7 @@ dump_left_at_exit_cb (void)
**/
void
camel_pointer_tracker_track_with_info (gpointer ptr,
- const gchar *info)
+ const gchar *info)
{
struct pt_data *ptd;
diff --git a/camel/camel-disco-diary.c b/camel/camel-disco-diary.c
index 1bc2312..86126b0 100644
--- a/camel/camel-disco-diary.c
+++ b/camel/camel-disco-diary.c
@@ -120,7 +120,7 @@ camel_disco_diary_log (CamelDiscoDiary *diary,
va_list ap;
gint status;
- d(printf("diary log: %s\n", diary->file?"ok":"no file!"));
+ d (printf ("diary log: %s\n", diary->file?"ok":"no file!"));
/* You may already be a loser. */
if (!diary || !diary->file)
@@ -138,7 +138,7 @@ camel_disco_diary_log (CamelDiscoDiary *diary,
GPtrArray *uids = va_arg (ap, GPtrArray *);
const gchar *full_name;
- d(printf(" folder expunge '%s'\n", folder->full_name));
+ d (printf (" folder expunge '%s'\n", folder->full_name));
full_name = camel_folder_get_full_name (folder);
status = camel_file_util_encode_string (diary->file, full_name);
@@ -153,7 +153,7 @@ camel_disco_diary_log (CamelDiscoDiary *diary,
gchar *uid = va_arg (ap, gchar *);
const gchar *full_name;
- d(printf(" folder append '%s'\n", folder->full_name));
+ d (printf (" folder append '%s'\n", folder->full_name));
full_name = camel_folder_get_full_name (folder);
status = camel_file_util_encode_string (diary->file, full_name);
@@ -299,7 +299,7 @@ camel_disco_diary_replay (CamelDiscoDiary *diary,
goffset size;
GError *local_error = NULL;
- d(printf("disco diary replay\n"));
+ d (printf ("disco diary replay\n"));
fseek (diary->file, 0, SEEK_END);
size = ftell (diary->file);
@@ -445,7 +445,7 @@ camel_disco_diary_new (CamelDiscoStore *store,
diary = g_object_new (CAMEL_TYPE_DISCO_DIARY, NULL);
diary->store = store;
- d(printf("diary log file '%s'\n", filename));
+ d (printf ("diary log file '%s'\n", filename));
/* Note that the linux man page says:
*
@@ -473,7 +473,7 @@ camel_disco_diary_new (CamelDiscoStore *store,
fseek (diary->file, 0, SEEK_END);
- d(printf(" is at %ld\n", ftell(diary->file)));
+ d (printf (" is at %ld\n", ftell (diary->file)));
return diary;
}
diff --git a/camel/camel-disco-folder.c b/camel/camel-disco-folder.c
index 368854f..ee72f8a 100644
--- a/camel/camel-disco-folder.c
+++ b/camel/camel-disco-folder.c
@@ -527,7 +527,7 @@ camel_disco_folder_set_offline_sync (CamelDiscoFolder *disco_folder,
{
g_return_if_fail (CAMEL_IS_DISCO_FOLDER (disco_folder));
- if ((disco_folder->priv->offline_sync ? 1 : 0) == (offline_sync ? 1 : 0))
+ if (disco_folder->priv->offline_sync == offline_sync)
return;
disco_folder->priv->offline_sync = offline_sync;
diff --git a/camel/camel-disco-store.c b/camel/camel-disco-store.c
index f13ca90..60a0fd6 100644
--- a/camel/camel-disco-store.c
+++ b/camel/camel-disco-store.c
@@ -109,7 +109,7 @@ disco_store_connect_sync (CamelService *service,
if (!store->diary)
return TRUE;
- d(printf(" diary is %s\n", camel_disco_diary_empty(store->diary)?"empty":"not empty"));
+ d (printf (" diary is %s\n", camel_disco_diary_empty (store->diary)?"empty":"not empty"));
if (camel_disco_diary_empty (store->diary))
return TRUE;
diff --git a/camel/camel-filter-driver.c b/camel/camel-filter-driver.c
index c3ab346..34c4a66 100644
--- a/camel/camel-filter-driver.c
+++ b/camel/camel-filter-driver.c
@@ -459,7 +459,7 @@ do_delete (struct _CamelSExp *f,
struct _CamelSExpResult **argv,
CamelFilterDriver *driver)
{
- d(fprintf (stderr, "doing delete\n"));
+ d (fprintf (stderr, "doing delete\n"));
driver->priv->deleted = TRUE;
camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Delete");
@@ -472,7 +472,7 @@ do_forward_to (struct _CamelSExp *f,
struct _CamelSExpResult **argv,
CamelFilterDriver *driver)
{
- d(fprintf (stderr, "marking message for forwarding\n"));
+ d (fprintf (stderr, "marking message for forwarding\n"));
/* requires one parameter, string with a destination address */
if (argc < 1 || argv[0]->type != CAMEL_SEXP_RES_STRING)
@@ -514,7 +514,7 @@ do_copy (struct _CamelSExp *f,
{
gint i;
- d(fprintf (stderr, "copying message...\n"));
+ d (fprintf (stderr, "copying message...\n"));
for (i = 0; i < argc; i++) {
if (argv[i]->type == CAMEL_SEXP_RES_STRING) {
@@ -583,7 +583,7 @@ do_move (struct _CamelSExp *f,
{
gint i;
- d(fprintf (stderr, "moving message...\n"));
+ d (fprintf (stderr, "moving message...\n"));
for (i = 0; i < argc; i++) {
if (argv[i]->type == CAMEL_SEXP_RES_STRING) {
@@ -663,7 +663,7 @@ do_stop (struct _CamelSExp *f,
CamelFilterDriver *driver)
{
camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Stopped processing");
- d(fprintf (stderr, "terminating message processing\n"));
+ d (fprintf (stderr, "terminating message processing\n"));
driver->priv->terminated = TRUE;
return NULL;
@@ -675,7 +675,7 @@ do_label (struct _CamelSExp *f,
struct _CamelSExpResult **argv,
CamelFilterDriver *driver)
{
- d(fprintf (stderr, "setting label tag\n"));
+ d (fprintf (stderr, "setting label tag\n"));
if (argc > 0 && argv[0]->type == CAMEL_SEXP_RES_STRING) {
/* This is a list of new labels, we should used these in case of passing in old names.
* This all is required only because backward compatibility. */
@@ -708,7 +708,7 @@ do_color (struct _CamelSExp *f,
struct _CamelSExpResult **argv,
CamelFilterDriver *driver)
{
- d(fprintf (stderr, "setting color tag\n"));
+ d (fprintf (stderr, "setting color tag\n"));
if (argc > 0 && argv[0]->type == CAMEL_SEXP_RES_STRING) {
const gchar *color = argv[0]->value.string;
@@ -718,7 +718,7 @@ do_color (struct _CamelSExp *f,
if (driver->priv->source && driver->priv->uid && camel_folder_has_summary_capability (driver->priv->source))
camel_folder_set_message_user_tag (driver->priv->source, driver->priv->uid, "color", color);
else
- camel_message_info_set_user_tag(driver->priv->info, "color", color);
+ camel_message_info_set_user_tag (driver->priv->info, "color", color);
camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Set color to %s", color ? color : "None");
}
@@ -731,12 +731,12 @@ do_score (struct _CamelSExp *f,
struct _CamelSExpResult **argv,
CamelFilterDriver *driver)
{
- d(fprintf (stderr, "setting score tag\n"));
+ d (fprintf (stderr, "setting score tag\n"));
if (argc > 0 && argv[0]->type == CAMEL_SEXP_RES_INT) {
gchar *value;
value = g_strdup_printf ("%d", argv[0]->value.number);
- camel_message_info_set_user_tag(driver->priv->info, "score", value);
+ camel_message_info_set_user_tag (driver->priv->info, "score", value);
camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Set score to %d", argv[0]->value.number);
g_free (value);
}
@@ -750,15 +750,15 @@ do_adjust_score (struct _CamelSExp *f,
struct _CamelSExpResult **argv,
CamelFilterDriver *driver)
{
- d(fprintf (stderr, "adjusting score tag\n"));
+ d (fprintf (stderr, "adjusting score tag\n"));
if (argc > 0 && argv[0]->type == CAMEL_SEXP_RES_INT) {
gchar *value;
gint old;
- value = (gchar *)camel_message_info_user_tag(driver->priv->info, "score");
+ value = (gchar *) camel_message_info_user_tag (driver->priv->info, "score");
old = value ? atoi (value) : 0;
- value = g_strdup_printf ("%d", old+argv[0]->value.number);
- camel_message_info_set_user_tag(driver->priv->info, "score", value);
+ value = g_strdup_printf ("%d", old + argv[0]->value.number);
+ camel_message_info_set_user_tag (driver->priv->info, "score", value);
camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Adjust score (%d) to %s", argv[0]->value.number, value);
g_free (value);
}
@@ -774,7 +774,7 @@ set_flag (struct _CamelSExp *f,
{
guint32 flags;
- d(fprintf (stderr, "setting flag\n"));
+ d (fprintf (stderr, "setting flag\n"));
if (argc == 1 && argv[0]->type == CAMEL_SEXP_RES_STRING) {
flags = camel_system_flag (argv[0]->value.string);
if (driver->priv->source && driver->priv->uid && camel_folder_has_summary_capability (driver->priv->source))
@@ -798,7 +798,7 @@ unset_flag (struct _CamelSExp *f,
{
guint32 flags;
- d(fprintf (stderr, "unsetting flag\n"));
+ d (fprintf (stderr, "unsetting flag\n"));
if (argc == 1 && argv[0]->type == CAMEL_SEXP_RES_STRING) {
flags = camel_system_flag (argv[0]->value.string);
if (driver->priv->source && driver->priv->uid && camel_folder_has_summary_capability (driver->priv->source))
@@ -1007,7 +1007,7 @@ do_shell (struct _CamelSExp *f,
GPtrArray *args;
gint i;
- d(fprintf (stderr, "executing shell command\n"));
+ d (fprintf (stderr, "executing shell command\n"));
command = g_string_new ("");
@@ -1046,7 +1046,7 @@ do_beep (struct _CamelSExp *f,
struct _CamelSExpResult **argv,
CamelFilterDriver *driver)
{
- d(fprintf (stderr, "beep\n"));
+ d (fprintf (stderr, "beep\n"));
if (driver->priv->beep) {
driver->priv->beep (driver, driver->priv->beepdata);
@@ -1062,7 +1062,7 @@ play_sound (struct _CamelSExp *f,
struct _CamelSExpResult **argv,
CamelFilterDriver *driver)
{
- d(fprintf (stderr, "play sound\n"));
+ d (fprintf (stderr, "play sound\n"));
if (driver->priv->playfunc && argc == 1 && argv[0]->type == CAMEL_SEXP_RES_STRING) {
driver->priv->playfunc (driver, argv[0]->value.string, driver->priv->playdata);
@@ -1078,7 +1078,7 @@ do_only_once (struct _CamelSExp *f,
struct _CamelSExpResult **argv,
CamelFilterDriver *driver)
{
- d(fprintf (stderr, "only once\n"));
+ d (fprintf (stderr, "only once\n"));
if (argc == 2 && !g_hash_table_lookup (driver->priv->only_once, argv[0]->value.string))
g_hash_table_insert (driver->priv->only_once, g_strdup (argv[0]->value.string),
@@ -1138,14 +1138,14 @@ close_folder (gpointer key,
g_object_unref (folder);
}
- report_status(driver, CAMEL_FILTER_STATUS_PROGRESS, g_hash_table_size(driver->priv->folders)* 100 / driver->priv->closed, _("Syncing folders"));
+ report_status (driver, CAMEL_FILTER_STATUS_PROGRESS, g_hash_table_size (driver->priv->folders)* 100 / driver->priv->closed, _("Syncing folders"));
}
/* flush/close all folders */
static gint
close_folders (CamelFilterDriver *driver)
{
- report_status(driver, CAMEL_FILTER_STATUS_PROGRESS, 0, _("Syncing folders"));
+ report_status (driver, CAMEL_FILTER_STATUS_PROGRESS, 0, _("Syncing folders"));
driver->priv->closed = 0;
g_hash_table_foreach (driver->priv->folders, close_folder, driver);
@@ -1231,7 +1231,7 @@ run_only_once (gpointer key,
CamelFilterDriver *driver = data->driver;
CamelSExpResult *r;
- d(printf ("evaluating: %s\n\n", action));
+ d (printf ("evaluating: %s\n\n", action));
camel_sexp_input_text (driver->priv->eval, action, strlen (action));
if (camel_sexp_parse (driver->priv->eval) == -1) {
@@ -1390,7 +1390,7 @@ camel_filter_driver_filter_mbox (CamelFilterDriver *driver,
info = camel_message_info_new_from_header (NULL, mime_part->headers);
/* Try and see if it has X-Evolution headers */
- xev = camel_header_raw_find(&mime_part->headers, "X-Evolution", NULL);
+ xev = camel_header_raw_find (&mime_part->headers, "X-Evolution", NULL);
if (xev)
decode_flags_from_xev (xev, (CamelMessageInfoBase *) info);
@@ -1420,7 +1420,7 @@ camel_filter_driver_filter_mbox (CamelFilterDriver *driver,
}
if (driver->priv->defaultfolder) {
- report_status(driver, CAMEL_FILTER_STATUS_PROGRESS, 100, _("Syncing folder"));
+ report_status (driver, CAMEL_FILTER_STATUS_PROGRESS, 100, _("Syncing folder"));
camel_folder_synchronize_sync (
driver->priv->defaultfolder, FALSE, cancellable, NULL);
}
@@ -1484,7 +1484,7 @@ camel_filter_driver_filter_folder (CamelFilterDriver *driver,
gint pc = (100 * i) / uids->len;
GError *local_error = NULL;
- report_status (driver, CAMEL_FILTER_STATUS_START, pc, _("Getting message %d of %d"), i+1,
+ report_status (driver, CAMEL_FILTER_STATUS_START, pc, _("Getting message %d of %d"), i + 1,
uids->len);
if (camel_folder_has_summary_capability (folder))
@@ -1676,7 +1676,7 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver,
if (driver->priv->terminated)
break;
- d(printf("applying rule %s\naction %s\n", rule->match, rule->action));
+ d (printf ("applying rule %s\naction %s\n", rule->match, rule->action));
data.priv = p;
data.store_uid = original_store_uid;
@@ -1695,9 +1695,9 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver,
filtered = TRUE;
camel_filter_driver_log (driver, FILTER_LOG_START, "%s", rule->name);
- if (camel_debug(":filter"))
- printf("filtering '%s' applying rule %s\n",
- camel_message_info_subject(info)?camel_message_info_subject(info):"?no subject?", rule->name);
+ if (camel_debug (":filter"))
+ printf ("filtering '%s' applying rule %s\n",
+ camel_message_info_subject (info) ? camel_message_info_subject (info):"?no subject?", rule->name);
/* perform necessary filtering actions */
camel_sexp_input_text (driver->priv->eval, rule->action, strlen (rule->action));
@@ -1745,9 +1745,9 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver,
filtered = TRUE;
camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Copy to default folder");
- if (camel_debug(":filter"))
- printf("filtering '%s' copy %s to default folder\n",
- camel_message_info_subject(info)?camel_message_info_subject(info):"?no subject?",
+ if (camel_debug (":filter"))
+ printf ("filtering '%s' copy %s to default folder\n",
+ camel_message_info_subject (info) ? camel_message_info_subject (info):"?no subject?",
driver->priv->modified?"modified message":"");
if (!driver->priv->modified && driver->priv->uid && driver->priv->source && camel_folder_has_summary_capability (driver->priv->source)) {
diff --git a/camel/camel-filter-search.c b/camel/camel-filter-search.c
index c38f2d5..b3727f3 100644
--- a/camel/camel-filter-search.c
+++ b/camel/camel-filter-search.c
@@ -214,7 +214,7 @@ check_header (struct _CamelSExp *f,
for (i = 1; i < argc && !matched; i++)
matched = argv[i]->type == CAMEL_SEXP_RES_STRING && argv[i]->value.string[0] == 0;
- if (g_ascii_strcasecmp(name, "x-camel-mlist") == 0) {
+ if (g_ascii_strcasecmp (name, "x-camel-mlist") == 0) {
const gchar *list = camel_message_info_mlist (fms->info);
if (list) {
@@ -235,7 +235,7 @@ check_header (struct _CamelSExp *f,
mime_part = CAMEL_MIME_PART (message);
/* FIXME: what about Resent-To, Resent-Cc and Resent-From? */
- if (g_ascii_strcasecmp("to", name) == 0 || g_ascii_strcasecmp("cc", name) == 0 || g_ascii_strcasecmp("from", name) == 0)
+ if (g_ascii_strcasecmp ("to", name) == 0 || g_ascii_strcasecmp ("cc", name) == 0 || g_ascii_strcasecmp ("from", name) == 0)
type = CAMEL_SEARCH_TYPE_ADDRESS_ENCODED;
else if (message) {
ct = camel_mime_part_get_content_type (mime_part);
@@ -509,7 +509,7 @@ system_flag (struct _CamelSExp *f,
CamelSExpResult *r;
if (argc != 1 || argv[0]->type != CAMEL_SEXP_RES_STRING)
- camel_sexp_fatal_error(f, _("Invalid arguments to (system-flag)"));
+ camel_sexp_fatal_error (f, _("Invalid arguments to (system-flag)"));
r = camel_sexp_result_new (f, CAMEL_SEXP_RES_BOOL);
r->value.boolean = camel_system_flag_get (camel_message_info_flags (fms->info), argv[0]->value.string);
@@ -527,7 +527,7 @@ user_tag (struct _CamelSExp *f,
const gchar *tag;
if (argc != 1 || argv[0]->type != CAMEL_SEXP_RES_STRING)
- camel_sexp_fatal_error(f, _("Invalid arguments to (user-tag)"));
+ camel_sexp_fatal_error (f, _("Invalid arguments to (user-tag)"));
tag = camel_message_info_user_tag (fms->info, argv[0]->value.string);
@@ -846,7 +846,7 @@ junk_test (struct _CamelSExp *f,
junk_filter = camel_session_get_junk_filter (fms->session);
- d(printf("doing junk test for message from '%s'\n", camel_message_info_from (fms->info)));
+ d (printf ("doing junk test for message from '%s'\n", camel_message_info_from (fms->info)));
if (junk_filter != NULL && (camel_message_info_flags (info) & (CAMEL_MESSAGE_JUNK | CAMEL_MESSAGE_NOTJUNK)) == 0) {
const GHashTable *ht = camel_session_get_junk_headers (fms->session);
const struct _camel_header_param *node = camel_message_info_headers (info);
@@ -854,7 +854,7 @@ junk_test (struct _CamelSExp *f,
while (node && !retval) {
if (node->name) {
gchar *value = (gchar *) g_hash_table_lookup ((GHashTable *) ht, node->name);
- d(printf("JunkCheckMatch: %s %s %s\n", node->name, node->value, value));
+ d (printf ("JunkCheckMatch: %s %s %s\n", node->name, node->value, value));
if (value)
retval = camel_strstrcase (node->value, value) != NULL;
@@ -862,18 +862,18 @@ junk_test (struct _CamelSExp *f,
node = node->next;
}
if (camel_debug ("junk"))
- printf("filtered based on junk header ? %d\n", retval);
+ printf ("filtered based on junk header ? %d\n", retval);
if (!retval) {
retval = camel_session_lookup_addressbook (fms->session, camel_message_info_from (info)) != TRUE;
if (camel_debug ("junk"))
- printf("Sender '%s' in book? %d\n", camel_message_info_from (info), !retval);
+ printf ("Sender '%s' in book? %d\n", camel_message_info_from (info), !retval);
if (retval) /* Not in book. Could be spam. So check for it */ {
CamelMimeMessage *message;
CamelJunkStatus status;
gboolean success;
- d(printf("filtering message\n"));
+ d (printf ("filtering message\n"));
message = camel_filter_search_get_message (fms, f);
success = camel_junk_filter_classify (junk_filter, message, &status, NULL, NULL);
retval = success && (status == CAMEL_JUNK_STATUS_MESSAGE_IS_JUNK);
@@ -881,7 +881,7 @@ junk_test (struct _CamelSExp *f,
}
if (camel_debug ("junk"))
- printf("junk filter => %s\n", retval ? "*JUNK*" : "clean");
+ printf ("junk filter => %s\n", retval ? "*JUNK*" : "clean");
} else if (junk_filter != NULL && camel_debug ("junk")) {
if (camel_message_info_flags (info) & CAMEL_MESSAGE_JUNK)
printf ("Message has a Junk flag set already, skipping junk test...\n");
diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c
index 88a5946..bd2442b 100644
--- a/camel/camel-folder-search.c
+++ b/camel/camel-folder-search.c
@@ -173,38 +173,38 @@ static struct {
gint flags; /* 0x02 = immediate, 0x01 = always enter */
} builtins[] = {
/* these have default implementations in e-sexp */
- { "and", G_STRUCT_OFFSET(CamelFolderSearchClass, and_), 2 },
- { "or", G_STRUCT_OFFSET(CamelFolderSearchClass, or_), 2 },
+ { "and", G_STRUCT_OFFSET (CamelFolderSearchClass, and_), 2 },
+ { "or", G_STRUCT_OFFSET (CamelFolderSearchClass, or_), 2 },
/* we need to override this one though to implement an 'array not' */
- { "not", G_STRUCT_OFFSET(CamelFolderSearchClass, not_), 0 },
- { "<", G_STRUCT_OFFSET(CamelFolderSearchClass, lt), 2 },
- { ">", G_STRUCT_OFFSET(CamelFolderSearchClass, gt), 2 },
- { "=", G_STRUCT_OFFSET(CamelFolderSearchClass, eq), 2 },
+ { "not", G_STRUCT_OFFSET (CamelFolderSearchClass, not_), 0 },
+ { "<", G_STRUCT_OFFSET (CamelFolderSearchClass, lt), 2 },
+ { ">", G_STRUCT_OFFSET (CamelFolderSearchClass, gt), 2 },
+ { "=", G_STRUCT_OFFSET (CamelFolderSearchClass, eq), 2 },
/* these we have to use our own default if there is none */
/* they should all be defined in the language? so it parses, or should they not?? */
- { "match-all", G_STRUCT_OFFSET(CamelFolderSearchClass, match_all), 3 },
- { "match-threads", G_STRUCT_OFFSET(CamelFolderSearchClass, match_threads), 3 },
- { "body-contains", G_STRUCT_OFFSET(CamelFolderSearchClass, body_contains), 1 },
- { "body-regex", G_STRUCT_OFFSET(CamelFolderSearchClass, body_regex), 1 },
- { "header-contains", G_STRUCT_OFFSET(CamelFolderSearchClass, header_contains), 1 },
- { "header-matches", G_STRUCT_OFFSET(CamelFolderSearchClass, header_matches), 1 },
- { "header-starts-with", G_STRUCT_OFFSET(CamelFolderSearchClass, header_starts_with), 1 },
- { "header-ends-with", G_STRUCT_OFFSET(CamelFolderSearchClass, header_ends_with), 1 },
- { "header-exists", G_STRUCT_OFFSET(CamelFolderSearchClass, header_exists), 1 },
- { "header-soundex", G_STRUCT_OFFSET(CamelFolderSearchClass, header_soundex), 1 },
- { "header-regex", G_STRUCT_OFFSET(CamelFolderSearchClass, header_regex), 1 },
- { "header-full-regex", G_STRUCT_OFFSET(CamelFolderSearchClass, header_full_regex), 1 },
- { "user-tag", G_STRUCT_OFFSET(CamelFolderSearchClass, user_tag), 1 },
- { "user-flag", G_STRUCT_OFFSET(CamelFolderSearchClass, user_flag), 1 },
- { "system-flag", G_STRUCT_OFFSET(CamelFolderSearchClass, system_flag), 1 },
- { "get-sent-date", G_STRUCT_OFFSET(CamelFolderSearchClass, get_sent_date), 1 },
- { "get-received-date", G_STRUCT_OFFSET(CamelFolderSearchClass, get_received_date), 1 },
- { "get-current-date", G_STRUCT_OFFSET(CamelFolderSearchClass, get_current_date), 1 },
- { "get-relative-months", G_STRUCT_OFFSET(CamelFolderSearchClass, get_relative_months), 1 },
- { "get-size", G_STRUCT_OFFSET(CamelFolderSearchClass, get_size), 1 },
- { "uid", G_STRUCT_OFFSET(CamelFolderSearchClass, uid), 1 },
- { "message-location", G_STRUCT_OFFSET(CamelFolderSearchClass, message_location), 1 },
+ { "match-all", G_STRUCT_OFFSET (CamelFolderSearchClass, match_all), 3 },
+ { "match-threads", G_STRUCT_OFFSET (CamelFolderSearchClass, match_threads), 3 },
+ { "body-contains", G_STRUCT_OFFSET (CamelFolderSearchClass, body_contains), 1 },
+ { "body-regex", G_STRUCT_OFFSET (CamelFolderSearchClass, body_regex), 1 },
+ { "header-contains", G_STRUCT_OFFSET (CamelFolderSearchClass, header_contains), 1 },
+ { "header-matches", G_STRUCT_OFFSET (CamelFolderSearchClass, header_matches), 1 },
+ { "header-starts-with", G_STRUCT_OFFSET (CamelFolderSearchClass, header_starts_with), 1 },
+ { "header-ends-with", G_STRUCT_OFFSET (CamelFolderSearchClass, header_ends_with), 1 },
+ { "header-exists", G_STRUCT_OFFSET (CamelFolderSearchClass, header_exists), 1 },
+ { "header-soundex", G_STRUCT_OFFSET (CamelFolderSearchClass, header_soundex), 1 },
+ { "header-regex", G_STRUCT_OFFSET (CamelFolderSearchClass, header_regex), 1 },
+ { "header-full-regex", G_STRUCT_OFFSET (CamelFolderSearchClass, header_full_regex), 1 },
+ { "user-tag", G_STRUCT_OFFSET (CamelFolderSearchClass, user_tag), 1 },
+ { "user-flag", G_STRUCT_OFFSET (CamelFolderSearchClass, user_flag), 1 },
+ { "system-flag", G_STRUCT_OFFSET (CamelFolderSearchClass, system_flag), 1 },
+ { "get-sent-date", G_STRUCT_OFFSET (CamelFolderSearchClass, get_sent_date), 1 },
+ { "get-received-date", G_STRUCT_OFFSET (CamelFolderSearchClass, get_received_date), 1 },
+ { "get-current-date", G_STRUCT_OFFSET (CamelFolderSearchClass, get_current_date), 1 },
+ { "get-relative-months", G_STRUCT_OFFSET (CamelFolderSearchClass, get_relative_months), 1 },
+ { "get-size", G_STRUCT_OFFSET (CamelFolderSearchClass, get_size), 1 },
+ { "uid", G_STRUCT_OFFSET (CamelFolderSearchClass, uid), 1 },
+ { "message-location", G_STRUCT_OFFSET (CamelFolderSearchClass, message_location), 1 },
};
void
@@ -220,7 +220,7 @@ camel_folder_search_construct (CamelFolderSearch *search)
/* c is sure messy sometimes */
func = *((gpointer *)(((gchar *) class) + builtins[i].offset));
if (func == NULL && builtins[i].flags&1) {
- g_warning("Search class doesn't implement '%s' method: %s", builtins[i].name, G_OBJECT_TYPE_NAME (search));
+ g_warning ("Search class doesn't implement '%s' method: %s", builtins[i].name, G_OBJECT_TYPE_NAME (search));
func = (gpointer) search_dummy;
}
if (func != NULL) {
@@ -436,12 +436,12 @@ camel_folder_search_count (CamelFolderSearch *search,
/* now create a folder summary to return?? */
if (r->type == CAMEL_SEXP_RES_ARRAY_PTR) {
- d(printf("got result\n"));
+ d (printf ("got result\n"));
/* reorder result in summary order */
results = g_hash_table_new (g_str_hash, g_str_equal);
for (i = 0; i < r->value.ptrarray->len; i++) {
- d(printf("adding match: %s\n", (gchar *)g_ptr_array_index(r->value.ptrarray, i)));
+ d (printf ("adding match: %s\n", (gchar *) g_ptr_array_index (r->value.ptrarray, i)));
g_hash_table_insert (results, g_ptr_array_index (r->value.ptrarray, i), GINT_TO_POINTER (1));
}
@@ -466,20 +466,20 @@ camel_folder_search_count (CamelFolderSearch *search,
/* Sync the db, so that we search the db for changes */
camel_folder_summary_save_to_db (search->folder->summary, error);
- dd(printf ("sexp is : [%s]\n", expr));
+ dd (printf ("sexp is : [%s]\n", expr));
sql_query = camel_sexp_to_sql_sexp (expr);
tmp1 = camel_db_sqlize_string (full_name);
- tmp = g_strdup_printf ("SELECT COUNT (*) FROM %s %s %s", tmp1, sql_query ? "WHERE":"", sql_query?sql_query:"");
+ tmp = g_strdup_printf ("SELECT COUNT (*) FROM %s %s %s", tmp1, sql_query ? "WHERE":"", sql_query ? sql_query:"");
camel_db_free_sqlized_string (tmp1);
g_free (sql_query);
- dd(printf("Equivalent sql %s\n", tmp));
+ dd (printf ("Equivalent sql %s\n", tmp));
cdb = (CamelDB *) (parent_store->cdb_r);
camel_db_count_message_info (cdb, tmp, &count, &local_error);
if (local_error != NULL) {
const gchar *message = local_error->message;
- if (strncmp(message, "no such table", 13) == 0) {
- d(g_warning ("Error during searching %s: %s\n", tmp, message));
+ if (strncmp (message, "no such table", 13) == 0) {
+ d (g_warning ("Error during searching %s: %s\n", tmp, message));
/* Suppress no such table */
g_clear_error (&local_error);
}
@@ -605,12 +605,12 @@ camel_folder_search_search (CamelFolderSearch *search,
/* now create a folder summary to return?? */
if (r->type == CAMEL_SEXP_RES_ARRAY_PTR) {
- d(printf("got result\n"));
+ d (printf ("got result\n"));
/* reorder result in summary order */
results = g_hash_table_new (g_str_hash, g_str_equal);
for (i = 0; i < r->value.ptrarray->len; i++) {
- d(printf("adding match: %s\n", (gchar *)g_ptr_array_index(r->value.ptrarray, i)));
+ d (printf ("adding match: %s\n", (gchar *) g_ptr_array_index (r->value.ptrarray, i)));
g_hash_table_insert (results, g_ptr_array_index (r->value.ptrarray, i), GINT_TO_POINTER (1));
}
@@ -635,13 +635,13 @@ camel_folder_search_search (CamelFolderSearch *search,
/* Sync the db, so that we search the db for changes */
camel_folder_summary_save_to_db (search->folder->summary, error);
- dd(printf ("sexp is : [%s]\n", expr));
+ dd (printf ("sexp is : [%s]\n", expr));
sql_query = camel_sexp_to_sql_sexp (expr);
tmp1 = camel_db_sqlize_string (full_name);
- tmp = g_strdup_printf ("SELECT uid FROM %s %s %s", tmp1, sql_query ? "WHERE":"", sql_query?sql_query:"");
+ tmp = g_strdup_printf ("SELECT uid FROM %s %s %s", tmp1, sql_query ? "WHERE":"", sql_query ? sql_query:"");
camel_db_free_sqlized_string (tmp1);
g_free (sql_query);
- dd(printf("Equivalent sql %s\n", tmp));
+ dd (printf ("Equivalent sql %s\n", tmp));
matches = g_ptr_array_new ();
cdb = (CamelDB *) (parent_store->cdb_r);
@@ -650,8 +650,8 @@ camel_folder_search_search (CamelFolderSearch *search,
read_uid_callback, matches, &local_error);
if (local_error != NULL) {
const gchar *message = local_error->message;
- if (strncmp(message, "no such table", 13) == 0) {
- d(g_warning ("Error during searching %s: %s\n", tmp, message));
+ if (strncmp (message, "no such table", 13) == 0) {
+ d (g_warning ("Error during searching %s: %s\n", tmp, message));
/* Suppress no such table */
g_clear_error (&local_error);
} else
@@ -692,7 +692,7 @@ fail:
void
camel_folder_search_free_result (CamelFolderSearch *search,
- GPtrArray *result)
+ GPtrArray *result)
{
if (!result)
return;
@@ -752,7 +752,7 @@ search_not (struct _CamelSExp *f,
if (!found)
g_ptr_array_add (r->value.ptrarray, (gchar *) uid);
} else if (search->summary == NULL) {
- g_warning("No summary set, 'not' against an array requires a summary");
+ g_warning ("No summary set, 'not' against an array requires a summary");
} else {
/* 'not' against the whole summary */
GHashTable *have = g_hash_table_new (g_str_hash, g_str_equal);
@@ -802,12 +802,12 @@ search_match_all (struct _CamelSExp *f,
GPtrArray *v;
if (argc > 1) {
- g_warning("match-all only takes a single argument, other arguments ignored");
+ g_warning ("match-all only takes a single argument, other arguments ignored");
}
/* we are only matching a single message? or already inside a match-all? */
if (search->current) {
- d(printf("matching against 1 message: %s\n", camel_message_info_subject(search->current)));
+ d (printf ("matching against 1 message: %s\n", camel_message_info_subject (search->current)));
r = camel_sexp_result_new (f, CAMEL_SEXP_RES_BOOL);
r->value.boolean = FALSE;
@@ -817,9 +817,9 @@ search_match_all (struct _CamelSExp *f,
if (r1->type == CAMEL_SEXP_RES_BOOL) {
r->value.boolean = r1->value.boolean;
} else {
- g_warning("invalid syntax, matches require a single bool result");
+ g_warning ("invalid syntax, matches require a single bool result");
/* Translators: The '%s' is an element type name, part of an expressing language */
- error_msg = g_strdup_printf(_("(%s) requires a single bool result"), "match-all");
+ error_msg = g_strdup_printf (_("(%s) requires a single bool result"), "match-all");
camel_sexp_fatal_error (f, error_msg);
g_free (error_msg);
}
@@ -835,7 +835,7 @@ search_match_all (struct _CamelSExp *f,
if (search->summary == NULL) {
/* TODO: make it work - e.g. use the folder and so forth for a slower search */
- g_warning("No summary supplied, match-all doesn't work with no summary");
+ g_warning ("No summary supplied, match-all doesn't work with no summary");
g_assert (0);
return r;
}
@@ -860,9 +860,9 @@ search_match_all (struct _CamelSExp *f,
if (r1->value.boolean)
g_ptr_array_add (r->value.ptrarray, (gchar *) uid);
} else {
- g_warning("invalid syntax, matches require a single bool result");
+ g_warning ("invalid syntax, matches require a single bool result");
/* Translators: The '%s' is an element type name, part of an expressing language */
- error_msg = g_strdup_printf(_("(%s) requires a single bool result"), "match-all");
+ error_msg = g_strdup_printf (_("(%s) requires a single bool result"), "match-all");
camel_sexp_fatal_error (f, error_msg);
g_free (error_msg);
}
@@ -929,14 +929,14 @@ search_match_threads (struct _CamelSExp *f,
/* not supported in match-all */
if (search->current) {
/* Translators: Each '%s' is an element type name, part of an expressing language */
- error_msg = g_strdup_printf(_("(%s) not allowed inside %s"), "match-threads", "match-all");
+ error_msg = g_strdup_printf (_("(%s) not allowed inside %s"), "match-threads", "match-all");
camel_sexp_fatal_error (f, error_msg);
g_free (error_msg);
}
if (argc == 0) {
/* Translators: The '%s' is an element type name, part of an expressing language */
- error_msg = g_strdup_printf(_("(%s) requires a match type string"), "match-threads");
+ error_msg = g_strdup_printf (_("(%s) requires a match type string"), "match-threads");
camel_sexp_fatal_error (f, error_msg);
g_free (error_msg);
}
@@ -944,21 +944,21 @@ search_match_threads (struct _CamelSExp *f,
r = camel_sexp_term_eval (f, argv[0]);
if (r->type != CAMEL_SEXP_RES_STRING) {
/* Translators: The '%s' is an element type name, part of an expressing language */
- error_msg = g_strdup_printf(_("(%s) requires a match type string"), "match-threads");
+ error_msg = g_strdup_printf (_("(%s) requires a match type string"), "match-threads");
camel_sexp_fatal_error (f, error_msg);
g_free (error_msg);
}
type = 0;
- if (!strcmp(r->value.string, "none"))
+ if (!strcmp (r->value.string, "none"))
type = 0;
- else if (!strcmp(r->value.string, "all"))
+ else if (!strcmp (r->value.string, "all"))
type = 1;
- else if (!strcmp(r->value.string, "replies"))
+ else if (!strcmp (r->value.string, "replies"))
type = 2;
- else if (!strcmp(r->value.string, "replies_parents"))
+ else if (!strcmp (r->value.string, "replies_parents"))
type = 3;
- else if (!strcmp(r->value.string, "single"))
+ else if (!strcmp (r->value.string, "single"))
type = 4;
camel_sexp_result_free (f, r);
@@ -972,7 +972,7 @@ search_match_threads (struct _CamelSExp *f,
if (r == NULL || r->type != CAMEL_SEXP_RES_ARRAY_PTR) {
/* Translators: The '%s' is an element type name, part of an expressing language */
- error_msg = g_strdup_printf(_("(%s) expects an array result"), "match-threads");
+ error_msg = g_strdup_printf (_("(%s) expects an array result"), "match-threads");
camel_sexp_fatal_error (f, error_msg);
g_free (error_msg);
}
@@ -982,7 +982,7 @@ search_match_threads (struct _CamelSExp *f,
if (search->folder == NULL) {
/* Translators: The '%s' is an element type name, part of an expressing language */
- error_msg = g_strdup_printf(_("(%s) requires the folder set"), "match-threads");
+ error_msg = g_strdup_printf (_("(%s) requires the folder set"), "match-threads");
camel_sexp_fatal_error (f, error_msg);
g_free (error_msg);
}
@@ -1057,7 +1057,7 @@ check_header (struct _CamelSExp *f,
CamelSExpResult *r;
gint truth = FALSE;
- r(printf("executing check-header %d\n", how));
+ r (printf ("executing check-header %d\n", how));
/* are we inside a match-all? */
if (search->current && argc > 1
@@ -1074,22 +1074,22 @@ check_header (struct _CamelSExp *f,
/* only a subset of headers are supported .. */
headername = argv[0]->value.string;
- if (!g_ascii_strcasecmp(headername, "subject")) {
+ if (!g_ascii_strcasecmp (headername, "subject")) {
header = camel_message_info_subject (search->current);
- } else if (!g_ascii_strcasecmp(headername, "date")) {
+ } else if (!g_ascii_strcasecmp (headername, "date")) {
/* FIXME: not a very useful form of the date */
- sprintf(strbuf, "%d", (gint)camel_message_info_date_sent(search->current));
+ sprintf (strbuf, "%d", (gint) camel_message_info_date_sent (search->current));
header = strbuf;
- } else if (!g_ascii_strcasecmp(headername, "from")) {
+ } else if (!g_ascii_strcasecmp (headername, "from")) {
header = camel_message_info_from (search->current);
type = CAMEL_SEARCH_TYPE_ADDRESS;
- } else if (!g_ascii_strcasecmp(headername, "to")) {
+ } else if (!g_ascii_strcasecmp (headername, "to")) {
header = camel_message_info_to (search->current);
type = CAMEL_SEARCH_TYPE_ADDRESS;
- } else if (!g_ascii_strcasecmp(headername, "cc")) {
+ } else if (!g_ascii_strcasecmp (headername, "cc")) {
header = camel_message_info_cc (search->current);
type = CAMEL_SEARCH_TYPE_ADDRESS;
- } else if (!g_ascii_strcasecmp(headername, "x-camel-mlist")) {
+ } else if (!g_ascii_strcasecmp (headername, "x-camel-mlist")) {
header = camel_message_info_mlist (search->current);
type = CAMEL_SEARCH_TYPE_MLIST;
} else {
@@ -1158,7 +1158,7 @@ check_header (struct _CamelSExp *f,
static void
l_printf (gchar *node)
{
-printf("%s\t", node);
+printf ("%s\t", node);
}
*/
@@ -1206,7 +1206,7 @@ search_header_exists (struct _CamelSExp *f,
{
CamelSExpResult *r;
- r(printf ("executing header-exists\n"));
+ r (printf ("executing header-exists\n"));
if (search->current) {
r = camel_sexp_result_new (f, CAMEL_SEXP_RES_BOOL);
@@ -1390,7 +1390,7 @@ match_message_index (CamelIndex *idx,
static GPtrArray *
match_words_index (CamelFolderSearch *search,
struct _camel_search_words *words,
- GCancellable *cancellable,
+ GCancellable *cancellable,
GError **error)
{
GPtrArray *result = g_ptr_array_new ();
@@ -1465,7 +1465,7 @@ match_words_1message (CamelDataWrapper *object,
} else if (CAMEL_IS_MIME_MESSAGE (containee)) {
/* for messages we only look at its contents */
truth = match_words_1message ((CamelDataWrapper *) containee, words, mask, cancellable);
- } else if (camel_content_type_is(CAMEL_DATA_WRAPPER (containee)->mime_type, "text", "*")) {
+ } else if (camel_content_type_is (CAMEL_DATA_WRAPPER (containee)->mime_type, "text", "*")) {
/* for all other text parts, we look inside, otherwise we dont care */
CamelStream *stream;
GByteArray *byte_array;
@@ -1702,7 +1702,7 @@ search_user_flag (struct _CamelSExp *f,
CamelSExpResult *r;
gint i;
- r(printf("executing user-flag\n"));
+ r (printf ("executing user-flag\n"));
/* are we inside a match-all? */
if (search->current) {
@@ -1733,7 +1733,7 @@ search_system_flag (struct _CamelSExp *f,
{
CamelSExpResult *r;
- r(printf ("executing system-flag\n"));
+ r (printf ("executing system-flag\n"));
if (search->current) {
gboolean truth = FALSE;
@@ -1760,7 +1760,7 @@ search_user_tag (struct _CamelSExp *f,
const gchar *value = NULL;
CamelSExpResult *r;
- r(printf("executing user-tag\n"));
+ r (printf ("executing user-tag\n"));
if (search->current && argc == 1)
value = camel_message_info_user_tag (search->current, argv[0]->value.string);
@@ -1779,7 +1779,7 @@ search_get_sent_date (struct _CamelSExp *f,
{
CamelSExpResult *r;
- r(printf("executing get-sent-date\n"));
+ r (printf ("executing get-sent-date\n"));
/* are we inside a match-all? */
if (s->current) {
@@ -1802,7 +1802,7 @@ search_get_received_date (struct _CamelSExp *f,
{
CamelSExpResult *r;
- r(printf("executing get-received-date\n"));
+ r (printf ("executing get-received-date\n"));
/* are we inside a match-all? */
if (s->current) {
@@ -1825,7 +1825,7 @@ search_get_current_date (struct _CamelSExp *f,
{
CamelSExpResult *r;
- r(printf("executing get-current-date\n"));
+ r (printf ("executing get-current-date\n"));
r = camel_sexp_result_new (f, CAMEL_SEXP_RES_INT);
r->value.number = time (NULL);
@@ -1840,7 +1840,7 @@ search_get_relative_months (struct _CamelSExp *f,
{
CamelSExpResult *r;
- r(printf("executing get-relative-months\n"));
+ r (printf ("executing get-relative-months\n"));
if (argc != 1 || argv[0]->type != CAMEL_SEXP_RES_INT) {
r = camel_sexp_result_new (f, CAMEL_SEXP_RES_BOOL);
@@ -1863,7 +1863,7 @@ search_get_size (struct _CamelSExp *f,
{
CamelSExpResult *r;
- r(printf("executing get-size\n"));
+ r (printf ("executing get-size\n"));
/* are we inside a match-all? */
if (s->current) {
@@ -1886,7 +1886,7 @@ search_uid (struct _CamelSExp *f,
CamelSExpResult *r;
gint i;
- r(printf("executing uid\n"));
+ r (printf ("executing uid\n"));
/* are we inside a match-all? */
if (search->current) {
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index 4fc3e29..d1564d5 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -169,8 +169,8 @@ G_DEFINE_TYPE (CamelFolderSummary, camel_folder_summary, CAMEL_TYPE_OBJECT)
static gboolean
remove_each_item (gpointer uid,
- gpointer mi,
- gpointer user_data)
+ gpointer mi,
+ gpointer user_data)
{
GSList **to_remove_infos = user_data;
@@ -216,7 +216,7 @@ folder_summary_dispose (GObject *object)
if (priv->timeout_handle) {
/* this should not happen, because the release timer
- holds a reference on object */
+ * holds a reference on object */
g_source_remove (priv->timeout_handle);
priv->timeout_handle = 0;
}
@@ -447,7 +447,7 @@ folder_summary_update_counts_by_flags (CamelFolderSummary *summary,
if (flags & CAMEL_MESSAGE_JUNK)
junk = subtract ? -1 : 1;
- dd(printf("%p: %d %d %d | %d %d %d \n", (gpointer) summary, unread, deleted, junk, summary->priv->unread_count, summary->priv->visible_count, summary->priv->saved_count));
+ dd (printf ("%p: %d %d %d | %d %d %d \n", (gpointer) summary, unread, deleted, junk, summary->priv->unread_count, summary->priv->visible_count, summary->priv->saved_count));
g_object_freeze_notify (summary_object);
@@ -497,7 +497,7 @@ folder_summary_update_counts_by_flags (CamelFolderSummary *summary,
g_object_thaw_notify (summary_object);
- dd(printf("%p: %d %d %d | %d %d %d\n", (gpointer) summary, unread, deleted, junk, summary->priv->unread_count, summary->priv->visible_count, summary->priv->saved_count));
+ dd (printf ("%p: %d %d %d | %d %d %d\n", (gpointer) summary, unread, deleted, junk, summary->priv->unread_count, summary->priv->visible_count, summary->priv->saved_count));
return changed;
}
@@ -506,7 +506,7 @@ static gboolean
summary_header_from_db (CamelFolderSummary *summary,
CamelFIRecord *record)
{
- io(printf("Loading header from db \n"));
+ io (printf ("Loading header from db \n"));
summary->version = record->version;
@@ -514,15 +514,15 @@ summary_header_from_db (CamelFolderSummary *summary,
#if 0
/* Legacy version check, before version 12 we have no upgrade knowledge */
if ((summary->version > 0xff) && (summary->version & 0xff) < 12) {
- io(printf ("Summary header version mismatch"));
+ io (printf ("Summary header version mismatch"));
errno = EINVAL;
return FALSE;
}
if (!(summary->version < 0x100 && summary->version >= 13))
- io(printf("Loading legacy summary\n"));
+ io (printf ("Loading legacy summary\n"));
else
- io(printf("loading new-format summary\n"));
+ io (printf ("loading new-format summary\n"));
#endif
summary->flags = record->flags;
@@ -554,7 +554,7 @@ summary_header_to_db (CamelFolderSummary *summary,
parent_store = camel_folder_get_parent_store (summary->priv->folder);
db = parent_store->cdb_w;
- io(printf("Savining header to db\n"));
+ io (printf ("Savining header to db\n"));
record->folder_name = g_strdup (table_name);
@@ -600,7 +600,7 @@ message_info_from_db (CamelFolderSummary *summary,
mi = (CamelMessageInfoBase *) camel_message_info_new (summary);
- io(printf("Loading message info from db\n"));
+ io (printf ("Loading message info from db\n"));
mi->flags = record->flags;
mi->size = record->size;
@@ -702,19 +702,19 @@ message_info_to_db (CamelFolderSummary *summary,
record->cc = (gchar *) camel_pstring_strdup (camel_message_info_cc (mi));
record->mlist = (gchar *) camel_pstring_strdup (camel_message_info_mlist (mi));
- record->followup_flag = (gchar *) camel_pstring_strdup(camel_message_info_user_tag(info, "follow-up"));
- record->followup_completed_on = (gchar *) camel_pstring_strdup(camel_message_info_user_tag(info, "completed-on"));
- record->followup_due_by = (gchar *) camel_pstring_strdup(camel_message_info_user_tag(info, "due-by"));
+ record->followup_flag = (gchar *) camel_pstring_strdup (camel_message_info_user_tag (info, "follow-up"));
+ record->followup_completed_on = (gchar *) camel_pstring_strdup (camel_message_info_user_tag (info, "completed-on"));
+ record->followup_due_by = (gchar *) camel_pstring_strdup (camel_message_info_user_tag (info, "due-by"));
record->bodystructure = mi->bodystructure ? g_strdup (mi->bodystructure) : NULL;
tmp = g_string_new (NULL);
if (mi->references) {
- g_string_append_printf (tmp, "%lu %lu %lu", (gulong)mi->message_id.id.part.hi, (gulong)mi->message_id.id.part.lo, (gulong)mi->references->size);
+ g_string_append_printf (tmp, "%lu %lu %lu", (gulong) mi->message_id.id.part.hi, (gulong) mi->message_id.id.part.lo, (gulong) mi->references->size);
for (i = 0; i < mi->references->size; i++)
- g_string_append_printf (tmp, " %lu %lu", (gulong)mi->references->references[i].id.part.hi, (gulong)mi->references->references[i].id.part.lo);
+ g_string_append_printf (tmp, " %lu %lu", (gulong) mi->references->references[i].id.part.hi, (gulong) mi->references->references[i].id.part.lo);
} else {
- g_string_append_printf (tmp, "%lu %lu %lu", (gulong)mi->message_id.id.part.hi, (gulong)mi->message_id.id.part.lo, (gulong) 0);
+ g_string_append_printf (tmp, "%lu %lu %lu", (gulong) mi->message_id.id.part.hi, (gulong) mi->message_id.id.part.lo, (gulong) 0);
}
record->part = tmp->str;
g_string_free (tmp, FALSE);
@@ -735,11 +735,11 @@ message_info_to_db (CamelFolderSummary *summary,
tmp = g_string_new (NULL);
count = camel_tag_list_size (&mi->user_tags);
- g_string_append_printf (tmp, "%lu", (gulong)count);
+ g_string_append_printf (tmp, "%lu", (gulong) count);
tag = mi->user_tags;
while (tag) {
/* FIXME: Should we handle empty tags? Can it be empty? If it potential crasher ahead*/
- g_string_append_printf (tmp, " %lu-%s %lu-%s", (gulong)strlen(tag->name), tag->name, (gulong)strlen(tag->value), tag->value);
+ g_string_append_printf (tmp, " %lu-%s %lu-%s", (gulong) strlen (tag->name), tag->name, (gulong) strlen (tag->value), tag->value);
tag = tag->next;
}
record->usertags = tmp->str;
@@ -758,7 +758,7 @@ content_info_from_db (CamelFolderSummary *summary,
CamelContentType *ct;
gchar *part = record->cinfo;
- io(printf("Loading content info from db\n"));
+ io (printf ("Loading content info from db\n"));
if (!part)
return NULL;
@@ -808,7 +808,7 @@ content_info_to_db (CamelFolderSummary *summary,
GString *str = g_string_new (NULL);
gchar *oldr;
- io(printf("Saving content info to db\n"));
+ io (printf ("Saving content info to db\n"));
ct = ci->type;
if (ct) {
@@ -820,15 +820,15 @@ content_info_to_db (CamelFolderSummary *summary,
g_string_append_printf (str, " %d-%s", (gint) strlen (ct->subtype), ct->subtype);
else
g_string_append_printf (str, " 0-");
- g_string_append_printf (str, " %d", my_list_size((struct _node **)&ct->params));
+ g_string_append_printf (str, " %d", my_list_size ((struct _node **) &ct->params));
hp = ct->params;
while (hp) {
if (hp->name)
- g_string_append_printf (str, " %d-%s", (gint)strlen(hp->name), hp->name);
+ g_string_append_printf (str, " %d-%s", (gint) strlen (hp->name), hp->name);
else
g_string_append_printf (str, " 0-");
if (hp->value)
- g_string_append_printf (str, " %d-%s", (gint)strlen (hp->value), hp->value);
+ g_string_append_printf (str, " %d-%s", (gint) strlen (hp->value), hp->value);
else
g_string_append_printf (str, " 0-");
hp = hp->next;
@@ -840,15 +840,15 @@ content_info_to_db (CamelFolderSummary *summary,
}
if (ci->id)
- g_string_append_printf (str, " %d-%s", (gint)strlen (ci->id), ci->id);
+ g_string_append_printf (str, " %d-%s", (gint) strlen (ci->id), ci->id);
else
g_string_append_printf (str, " 0-");
if (ci->description)
- g_string_append_printf (str, " %d-%s", (gint)strlen (ci->description), ci->description);
+ g_string_append_printf (str, " %d-%s", (gint) strlen (ci->description), ci->description);
else
g_string_append_printf (str, " 0-");
if (ci->encoding)
- g_string_append_printf (str, " %d-%s", (gint)strlen (ci->encoding), ci->encoding);
+ g_string_append_printf (str, " %d-%s", (gint) strlen (ci->encoding), ci->encoding);
else
g_string_append_printf (str, " 0-");
g_string_append_printf (str, " %u", ci->size);
@@ -1570,7 +1570,7 @@ camel_folder_summary_set_build_content (CamelFolderSummary *summary,
{
g_return_if_fail (CAMEL_IS_FOLDER_SUMMARY (summary));
- if ((summary->priv->build_content ? 1 : 0) == (state ? 1 : 0))
+ if (summary->priv->build_content == state)
return;
summary->priv->build_content = state;
@@ -1996,7 +1996,7 @@ perform_content_info_load_from_db (CamelFolderSummary *summary,
my_list_append ((struct _node **) &ci->childs, (struct _node *) pci);
pci->parent = ci;
} else {
- d(fprintf (stderr, "Summary file format messed up?"));
+ d (fprintf (stderr, "Summary file format messed up?"));
camel_folder_summary_content_info_free (summary, ci);
return NULL;
}
@@ -2286,7 +2286,7 @@ cfs_reload_from_db (CamelFolderSummary *summary,
/* FIXME[disk-summary] baseclass this, and vfolders we may have to
* load better. */
- d(printf ("\ncamel_folder_summary_reload_from_db called \n"));
+ d (printf ("\ncamel_folder_summary_reload_from_db called \n"));
if (is_in_memory_summary (summary))
return 0;
@@ -2391,7 +2391,7 @@ camel_folder_summary_load_from_db (CamelFolderSummary *summary,
camel_folder_summary_save_to_db (summary, NULL);
/* struct _db_pass_data data; */
- d(printf ("\ncamel_folder_summary_load_from_db called \n"));
+ d (printf ("\ncamel_folder_summary_load_from_db called \n"));
full_name = camel_folder_get_full_name (summary->priv->folder);
parent_store = camel_folder_get_parent_store (summary->priv->folder);
@@ -2593,7 +2593,7 @@ perform_content_info_save_to_db (CamelFolderSummary *summary,
return FALSE;
oldr = record->cinfo;
- record->cinfo = g_strdup_printf ("%s %d", oldr, my_list_size ((struct _node **)&ci->childs));
+ record->cinfo = g_strdup_printf ("%s %d", oldr, my_list_size ((struct _node **) &ci->childs));
g_free (oldr);
part = ci->childs;
@@ -2752,7 +2752,7 @@ camel_folder_summary_save_to_db (CamelFolderSummary *summary,
camel_folder_summary_lock (summary, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
- d(printf ("\ncamel_folder_summary_save_to_db called \n"));
+ d (printf ("\ncamel_folder_summary_save_to_db called \n"));
if (summary->priv->need_preview && g_hash_table_size (summary->priv->preview_updates)) {
camel_db_begin_transaction (parent_store->cdb_w, NULL);
g_hash_table_foreach (summary->priv->preview_updates, (GHFunc) msg_save_preview, summary->priv->folder);
@@ -2846,7 +2846,7 @@ camel_folder_summary_header_save_to_db (CamelFolderSummary *summary,
cdb = parent_store->cdb_w;
camel_folder_summary_lock (summary, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
- d(printf ("\ncamel_folder_summary_header_save_to_db called \n"));
+ d (printf ("\ncamel_folder_summary_header_save_to_db called \n"));
record = CAMEL_FOLDER_SUMMARY_GET_CLASS (summary)->summary_header_to_db (summary, error);
if (!record) {
@@ -2887,7 +2887,7 @@ camel_folder_summary_header_load_from_db (CamelFolderSummary *summary,
CamelFIRecord *record;
gboolean ret = FALSE;
- d(printf ("\ncamel_folder_summary_header_load_from_db called \n"));
+ d (printf ("\ncamel_folder_summary_header_load_from_db called \n"));
if (is_in_memory_summary (summary))
return TRUE;
@@ -2933,7 +2933,7 @@ summary_assign_uid (CamelFolderSummary *summary,
if (mi == info)
return FALSE;
- d(printf ("Trying to insert message with clashing uid (%s). new uid re-assigned", camel_message_info_uid (info)));
+ d (printf ("Trying to insert message with clashing uid (%s). new uid re-assigned", camel_message_info_uid (info)));
camel_pstring_free (info->uid);
uid = info->uid = camel_pstring_add (camel_folder_summary_next_uid_string (summary), TRUE);
@@ -3538,7 +3538,7 @@ message_info_new_from_parser (CamelFolderSummary *summary,
mi = CAMEL_FOLDER_SUMMARY_GET_CLASS (summary)->message_info_new_from_header (summary, camel_mime_parser_headers_raw (mp));
break;
default:
- g_error("Invalid parser state");
+ g_error ("Invalid parser state");
}
return mi;
@@ -3563,7 +3563,7 @@ content_info_new_from_parser (CamelFolderSummary *summary,
}
break;
default:
- g_error("Invalid parser state");
+ g_error ("Invalid parser state");
}
return ci;
@@ -3683,18 +3683,18 @@ message_info_new_from_header (CamelFolderSummary *summary,
mi = (CamelMessageInfoBase *) camel_message_info_new (summary);
- if ((content = camel_header_raw_find(&h, "Content-Type", NULL))
+ if ((content = camel_header_raw_find (&h, "Content-Type", NULL))
&& (ct = camel_content_type_decode (content))
- && (charset = camel_content_type_param(ct, "charset"))
- && (g_ascii_strcasecmp(charset, "us-ascii") == 0))
+ && (charset = camel_content_type_param (ct, "charset"))
+ && (g_ascii_strcasecmp (charset, "us-ascii") == 0))
charset = NULL;
charset = charset ? camel_iconv_charset_name (charset) : NULL;
- subject = summary_format_string(h, "subject", charset);
- from = summary_format_address(h, "from", charset);
- to = summary_format_address(h, "to", charset);
- cc = summary_format_address(h, "cc", charset);
+ subject = summary_format_string (h, "subject", charset);
+ from = summary_format_address (h, "from", charset);
+ to = summary_format_address (h, "to", charset);
+ cc = summary_format_address (h, "cc", charset);
mlist = camel_header_raw_check_mailing_list (&h);
if (ct)
@@ -3714,7 +3714,7 @@ message_info_new_from_header (CamelFolderSummary *summary,
else
mi->date_sent = 0;
- received = camel_header_raw_find(&h, "received", NULL);
+ received = camel_header_raw_find (&h, "received", NULL);
if (received)
received = strrchr (received, ';');
if (received)
@@ -3722,7 +3722,7 @@ message_info_new_from_header (CamelFolderSummary *summary,
else
mi->date_received = 0;
- msgid = camel_header_msgid_decode(camel_header_raw_find(&h, "message-id", NULL));
+ msgid = camel_header_msgid_decode (camel_header_raw_find (&h, "message-id", NULL));
if (msgid) {
GChecksum *checksum;
@@ -3823,7 +3823,7 @@ content_info_new_from_header (CamelFolderSummary *summary,
ci->id = camel_header_msgid_decode (camel_header_raw_find (&h, "content-id", NULL));
ci->description = camel_header_decode_string (camel_header_raw_find (&h, "content-description", NULL), charset);
ci->encoding = camel_content_transfer_encoding_decode (camel_header_raw_find (&h, "content-transfer-encoding", NULL));
- ci->type = camel_content_type_decode(camel_header_raw_find(&h, "content-type", NULL));
+ ci->type = camel_content_type_decode (camel_header_raw_find (&h, "content-type", NULL));
return ci;
}
@@ -3846,7 +3846,7 @@ content_info_free (CamelFolderSummary *summary,
static gchar *
next_uid_string (CamelFolderSummary *summary)
{
- return g_strdup_printf("%u", camel_folder_summary_next_uid(summary));
+ return g_strdup_printf ("%u", camel_folder_summary_next_uid (summary));
}
/*
@@ -3872,7 +3872,7 @@ summary_build_content_info (CamelFolderSummary *summary,
CamelMessageContentInfo *part;
const gchar *calendar_header;
- d(printf("building content info\n"));
+ d (printf ("building content info\n"));
/* start of this part */
state = camel_mime_parser_step (mp, &buffer, &len);
@@ -3885,10 +3885,10 @@ summary_build_content_info (CamelFolderSummary *summary,
/* check content type for indexing, then read body */
ct = camel_mime_parser_content_type (mp);
/* update attachments flag as we go */
- if (camel_content_type_is(ct, "application", "pgp-signature")
+ if (camel_content_type_is (ct, "application", "pgp-signature")
#ifdef ENABLE_SMIME
- || camel_content_type_is(ct, "application", "x-pkcs7-signature")
- || camel_content_type_is(ct, "application", "pkcs7-signature")
+ || camel_content_type_is (ct, "application", "x-pkcs7-signature")
+ || camel_content_type_is (ct, "application", "pkcs7-signature")
#endif
)
camel_message_info_set_flags (msginfo, CAMEL_MESSAGE_SECURE, CAMEL_MESSAGE_SECURE);
@@ -3903,46 +3903,46 @@ summary_build_content_info (CamelFolderSummary *summary,
if (calendar_header || camel_content_type_is (ct, "text", "calendar"))
camel_message_info_set_user_flag (msginfo, "$has_cal", TRUE);
- if (p->index && camel_content_type_is(ct, "text", "*")) {
+ if (p->index && camel_content_type_is (ct, "text", "*")) {
gchar *encoding;
const gchar *charset;
- d(printf("generating index:\n"));
+ d (printf ("generating index:\n"));
- encoding = camel_content_transfer_encoding_decode(camel_mime_parser_header(mp, "content-transfer-encoding", NULL));
+ encoding = camel_content_transfer_encoding_decode (camel_mime_parser_header (mp, "content-transfer-encoding", NULL));
if (encoding) {
- if (!g_ascii_strcasecmp(encoding, "base64")) {
- d(printf(" decoding base64\n"));
+ if (!g_ascii_strcasecmp (encoding, "base64")) {
+ d (printf (" decoding base64\n"));
if (p->filter_64 == NULL)
p->filter_64 = camel_mime_filter_basic_new (CAMEL_MIME_FILTER_BASIC_BASE64_DEC);
else
camel_mime_filter_reset (p->filter_64);
enc_id = camel_mime_parser_filter_add (mp, p->filter_64);
- } else if (!g_ascii_strcasecmp(encoding, "quoted-printable")) {
- d(printf(" decoding quoted-printable\n"));
+ } else if (!g_ascii_strcasecmp (encoding, "quoted-printable")) {
+ d (printf (" decoding quoted-printable\n"));
if (p->filter_qp == NULL)
p->filter_qp = camel_mime_filter_basic_new (CAMEL_MIME_FILTER_BASIC_QP_DEC);
else
camel_mime_filter_reset (p->filter_qp);
enc_id = camel_mime_parser_filter_add (mp, p->filter_qp);
} else if (!g_ascii_strcasecmp (encoding, "x-uuencode")) {
- d(printf(" decoding x-uuencode\n"));
+ d (printf (" decoding x-uuencode\n"));
if (p->filter_uu == NULL)
p->filter_uu = camel_mime_filter_basic_new (CAMEL_MIME_FILTER_BASIC_UU_DEC);
else
camel_mime_filter_reset (p->filter_uu);
enc_id = camel_mime_parser_filter_add (mp, p->filter_uu);
} else {
- d(printf(" ignoring encoding %s\n", encoding));
+ d (printf (" ignoring encoding %s\n", encoding));
}
g_free (encoding);
}
- charset = camel_content_type_param(ct, "charset");
+ charset = camel_content_type_param (ct, "charset");
if (charset != NULL
- && !(g_ascii_strcasecmp(charset, "us-ascii")==0
- || g_ascii_strcasecmp(charset, "utf-8")==0)) {
- d(printf(" Adding conversion filter from %s to UTF-8\n", charset));
+ && !(g_ascii_strcasecmp (charset, "us-ascii") == 0
+ || g_ascii_strcasecmp (charset, "utf-8") == 0)) {
+ d (printf (" Adding conversion filter from %s to UTF-8\n", charset));
mfc = g_hash_table_lookup (p->filter_charset, charset);
if (mfc == NULL) {
mfc = camel_mime_filter_charset_new (charset, "UTF-8");
@@ -3954,13 +3954,13 @@ summary_build_content_info (CamelFolderSummary *summary,
if (mfc) {
chr_id = camel_mime_parser_filter_add (mp, mfc);
} else {
- w(g_warning("Cannot convert '%s' to 'UTF-8', message index may be corrupt", charset));
+ w (g_warning ("Cannot convert '%s' to 'UTF-8', message index may be corrupt", charset));
}
}
/* we do charset conversions before this filter, which isn't strictly correct,
* but works in most cases */
- if (camel_content_type_is(ct, "text", "html")) {
+ if (camel_content_type_is (ct, "text", "html")) {
if (p->filter_html == NULL)
p->filter_html = camel_mime_filter_html_new ();
else
@@ -3981,13 +3981,13 @@ summary_build_content_info (CamelFolderSummary *summary,
camel_mime_parser_filter_remove (mp, idx_id);
break;
case CAMEL_MIME_PARSER_STATE_MULTIPART:
- d(printf("Summarising multipart\n"));
+ d (printf ("Summarising multipart\n"));
/* update attachments flag as we go */
ct = camel_mime_parser_content_type (mp);
- if (camel_content_type_is(ct, "multipart", "mixed"))
+ if (camel_content_type_is (ct, "multipart", "mixed"))
camel_message_info_set_flags (msginfo, CAMEL_MESSAGE_ATTACHMENTS, CAMEL_MESSAGE_ATTACHMENTS);
- if (camel_content_type_is(ct, "multipart", "signed")
- || camel_content_type_is(ct, "multipart", "encrypted"))
+ if (camel_content_type_is (ct, "multipart", "signed")
+ || camel_content_type_is (ct, "multipart", "encrypted"))
camel_message_info_set_flags (msginfo, CAMEL_MESSAGE_SECURE, CAMEL_MESSAGE_SECURE);
while (camel_mime_parser_step (mp, &buffer, &len) != CAMEL_MIME_PARSER_STATE_MULTIPART_END) {
@@ -4000,7 +4000,7 @@ summary_build_content_info (CamelFolderSummary *summary,
}
break;
case CAMEL_MIME_PARSER_STATE_MESSAGE:
- d(printf("Summarising message\n"));
+ d (printf ("Summarising message\n"));
/* update attachments flag as we go */
camel_message_info_set_flags (msginfo, CAMEL_MESSAGE_ATTACHMENTS, CAMEL_MESSAGE_ATTACHMENTS);
@@ -4011,13 +4011,13 @@ summary_build_content_info (CamelFolderSummary *summary,
}
state = camel_mime_parser_step (mp, &buffer, &len);
if (state != CAMEL_MIME_PARSER_STATE_MESSAGE_END) {
- g_error("Bad parser state: Expecing MESSAGE_END or MESSAGE_EOF, got: %d", state);
+ g_error ("Bad parser state: Expecing MESSAGE_END or MESSAGE_EOF, got: %d", state);
camel_mime_parser_unstep (mp);
}
break;
}
- d(printf("finished building content info\n"));
+ d (printf ("finished building content info\n"));
return info;
}
@@ -4049,16 +4049,16 @@ summary_build_content_info_message (CamelFolderSummary *summary,
/* check for attachments */
ct = ((CamelDataWrapper *) containee)->mime_type;
- if (camel_content_type_is(ct, "multipart", "*")) {
- if (camel_content_type_is(ct, "multipart", "mixed"))
+ if (camel_content_type_is (ct, "multipart", "*")) {
+ if (camel_content_type_is (ct, "multipart", "mixed"))
camel_message_info_set_flags (msginfo, CAMEL_MESSAGE_ATTACHMENTS, CAMEL_MESSAGE_ATTACHMENTS);
- if (camel_content_type_is(ct, "multipart", "signed")
- || camel_content_type_is(ct, "multipart", "encrypted"))
+ if (camel_content_type_is (ct, "multipart", "signed")
+ || camel_content_type_is (ct, "multipart", "encrypted"))
camel_message_info_set_flags (msginfo, CAMEL_MESSAGE_SECURE, CAMEL_MESSAGE_SECURE);
- } else if (camel_content_type_is(ct, "application", "pgp-signature")
+ } else if (camel_content_type_is (ct, "application", "pgp-signature")
#ifdef ENABLE_SMIME
- || camel_content_type_is(ct, "application", "x-pkcs7-signature")
- || camel_content_type_is(ct, "application", "pkcs7-signature")
+ || camel_content_type_is (ct, "application", "x-pkcs7-signature")
+ || camel_content_type_is (ct, "application", "pkcs7-signature")
#endif
) {
camel_message_info_set_flags (msginfo, CAMEL_MESSAGE_SECURE, CAMEL_MESSAGE_SECURE);
@@ -4101,11 +4101,11 @@ summary_build_content_info_message (CamelFolderSummary *summary,
my_list_append ((struct _node **) &info->childs, (struct _node *) child);
}
} else if (p->filter_stream
- && camel_content_type_is(ct, "text", "*")) {
+ && camel_content_type_is (ct, "text", "*")) {
gint html_id = -1, idx_id = -1;
/* pre-attach html filter if required, otherwise just index filter */
- if (camel_content_type_is(ct, "text", "html")) {
+ if (camel_content_type_is (ct, "text", "html")) {
if (p->filter_html == NULL)
p->filter_html = camel_mime_filter_html_new ();
else
@@ -4837,17 +4837,17 @@ void
camel_message_info_dump (CamelMessageInfo *mi)
{
if (mi == NULL) {
- printf("No message?\n");
+ printf ("No message?\n");
return;
}
- printf("Subject: %s\n", camel_message_info_subject(mi));
- printf("To: %s\n", camel_message_info_to(mi));
- printf("Cc: %s\n", camel_message_info_cc(mi));
- printf("mailing list: %s\n", camel_message_info_mlist(mi));
- printf("From: %s\n", camel_message_info_from(mi));
- printf("UID: %s\n", camel_message_info_uid(mi));
- printf("Flags: %04x\n", camel_message_info_flags(mi));
+ printf ("Subject: %s\n", camel_message_info_subject (mi));
+ printf ("To: %s\n", camel_message_info_to (mi));
+ printf ("Cc: %s\n", camel_message_info_cc (mi));
+ printf ("mailing list: %s\n", camel_message_info_mlist (mi));
+ printf ("From: %s\n", camel_message_info_from (mi));
+ printf ("UID: %s\n", camel_message_info_uid (mi));
+ printf ("Flags: %04x\n", camel_message_info_flags (mi));
camel_content_info_dump (((CamelMessageInfoBase *) mi)->content, 0);
}
diff --git a/camel/camel-folder-thread.c b/camel/camel-folder-thread.c
index d8d5586..aebbe7e 100644
--- a/camel/camel-folder-thread.c
+++ b/camel/camel-folder-thread.c
@@ -48,7 +48,7 @@ static void
container_add_child (CamelFolderThreadNode *node,
CamelFolderThreadNode *child)
{
- d(printf("\nAdding child %p to parent %p \n", child, node));
+ d (printf ("\nAdding child %p to parent %p \n", child, node));
child->next = node->child;
node->child = child;
child->parent = node;
@@ -81,11 +81,11 @@ container_parent_child (CamelFolderThreadNode *parent,
/* else remove child from its existing parent, and reparent */
node = child->parent;
c = (CamelFolderThreadNode *) &node->child;
- d(printf("scanning children:\n"));
+ d (printf ("scanning children:\n"));
while (c->next) {
- d(printf(" %p\n", c));
+ d (printf (" %p\n", c));
if (c->next == child) {
- d(printf("found node %p\n", child));
+ d (printf ("found node %p\n", child));
c->next = c->next->next;
child->parent = NULL;
container_add_child (parent, child);
@@ -94,7 +94,7 @@ container_parent_child (CamelFolderThreadNode *parent,
c = c->next;
}
- printf("DAMN, we shouldn't be here!\n");
+ printf ("DAMN, we shouldn't be here!\n");
}
static void
@@ -109,19 +109,19 @@ prune_empty (CamelFolderThread *thread,
c = lastc->next;
prune_empty (thread, &c->child);
- d(printf("checking message %p %p (%08x%08x)\n", c,
+ d (printf ("checking message %p %p (%08x%08x)\n", c,
c->message, c->message ? c->message->message_id.id.part.hi : 0,
c->message ? c->message->message_id.id.part.lo : 0));
if (c->message == NULL) {
if (c->child == NULL) {
- d(printf("removing empty node\n"));
+ d (printf ("removing empty node\n"));
lastc->next = c->next;
m (memset (c, 0xfe, sizeof (*c)));
camel_memchunk_free (thread->node_chunks, c);
continue;
}
if (c->parent || c->child->next == NULL) {
- d(printf("promoting child\n"));
+ d (printf ("promoting child\n"));
lastc->next = c->next; /* remove us */
child = c->child;
while (child) {
@@ -227,7 +227,7 @@ remove_node (CamelFolderThreadNode **list,
c = c->next;
}
- printf("ERROR: removing node %p failed\n", (gpointer) node);
+ printf ("ERROR: removing node %p failed\n", (gpointer) node);
}
static void
@@ -238,7 +238,7 @@ group_root_set (CamelFolderThread *thread,
CamelFolderThreadNode *c, *clast, *scan, *container;
/* gather subject lines */
- d(printf("gathering subject lines\n"));
+ d (printf ("gathering subject lines\n"));
clast = (CamelFolderThreadNode *) cp;
c = clast->next;
while (c) {
@@ -258,13 +258,13 @@ group_root_set (CamelFolderThread *thread,
clast = (CamelFolderThreadNode *) cp;
while (clast->next) {
c = clast->next;
- d(printf("checking %p %s\n", c, c->root_subject));
+ d (printf ("checking %p %s\n", c, c->root_subject));
if (c->root_subject
&& (container = g_hash_table_lookup (subject_table, c->root_subject))
&& (container != c)) {
- d(printf(" matching %p %s\n", container, container->root_subject));
+ d (printf (" matching %p %s\n", container, container->root_subject));
if (c->message == NULL && container->message == NULL) {
- d(printf("merge containers children\n"));
+ d (printf ("merge containers children\n"));
/* steal the children from c onto container, and unlink c */
scan = (CamelFolderThreadNode *) &container->child;
while (scan->next)
@@ -275,25 +275,25 @@ group_root_set (CamelFolderThread *thread,
camel_memchunk_free (thread->node_chunks, c);
continue;
} if (c->message == NULL && container->message != NULL) {
- d(printf("container is non-empty parent\n"));
+ d (printf ("container is non-empty parent\n"));
remove_node (cp, container, &clast);
container_add_child (c, container);
} else if (c->message != NULL && container->message == NULL) {
- d(printf("container is empty child\n"));
+ d (printf ("container is empty child\n"));
clast->next = c->next;
container_add_child (container, c);
continue;
} else if (c->re && !container->re) {
- d(printf("container is re\n"));
+ d (printf ("container is re\n"));
clast->next = c->next;
container_add_child (container, c);
continue;
} else if (!c->re && container->re) {
- d(printf("container is not re\n"));
+ d (printf ("container is not re\n"));
remove_node (cp, container, &clast);
container_add_child (c, container);
} else {
- d(printf("subjects are common %p and %p\n", c, container));
+ d (printf ("subjects are common %p and %p\n", c, container));
/* build a phantom node */
remove_node (cp, container, &clast);
@@ -335,16 +335,16 @@ dump_tree_rec (struct _tree_info *info,
while (c) {
if (g_hash_table_lookup (info->visited, c)) {
- printf("WARNING: NODE REVISITED: %p\n", (gpointer) c);
+ printf ("WARNING: NODE REVISITED: %p\n", (gpointer) c);
} else {
g_hash_table_insert (info->visited, c, c);
}
if (c->message) {
- printf("%s %p Subject: %s <%08x%08x>\n", p, (gpointer) c, camel_message_info_subject(c->message),
+ printf ("%s %p Subject: %s <%08x%08x>\n", p, (gpointer) c, camel_message_info_subject (c->message),
camel_message_info_message_id (c->message)->id.part.hi, camel_message_info_message_id (c->message)->id.part.lo);
count += 1;
} else {
- printf("%s %p <empty>\n", p, (gpointer) c);
+ printf ("%s %p <empty>\n", p, (gpointer) c);
}
if (c->child)
count += dump_tree_rec (info, c->child, depth + 1);
@@ -468,16 +468,16 @@ thread_summary (CamelFolderThread *thread,
if (c && c->order) {
/* if duplicate, just make out it is a no-id message, but try and insert it
* into the right spot in the tree */
- d(printf("doing: (duplicate message id)\n"));
+ d (printf ("doing: (duplicate message id)\n"));
c = camel_memchunk_alloc0 (thread->node_chunks);
g_hash_table_insert (no_id_table, (gpointer) mi, c);
} else if (!c) {
- d(printf("doing : %08x%08x (%s)\n", mid->id.part.hi, mid->id.part.lo, camel_message_info_subject(mi)));
+ d (printf ("doing : %08x%08x (%s)\n", mid->id.part.hi, mid->id.part.lo, camel_message_info_subject (mi)));
c = camel_memchunk_alloc0 (thread->node_chunks);
g_hash_table_insert (id_table, (gpointer) mid, c);
}
} else {
- d(printf("doing : (no message id)\n"));
+ d (printf ("doing : (no message id)\n"));
c = camel_memchunk_alloc0 (thread->node_chunks);
g_hash_table_insert (no_id_table, (gpointer) mi, c);
}
@@ -488,7 +488,7 @@ thread_summary (CamelFolderThread *thread,
if (references) {
gint j;
- d(printf("%s (%s) references:\n", G_STRLOC, G_STRFUNC); )
+ d (printf ("%s (%s) references:\n", G_STRLOC, G_STRFUNC); )
for (j = 0; j < references->size; j++) {
gboolean found = FALSE;
@@ -498,7 +498,7 @@ thread_summary (CamelFolderThread *thread,
c = g_hash_table_lookup (id_table, &references->references[j]);
if (c == NULL) {
- d(printf("%s (%s) not found\n", G_STRLOC, G_STRFUNC));
+ d (printf ("%s (%s) not found\n", G_STRLOC, G_STRFUNC));
c = camel_memchunk_alloc0 (thread->node_chunks);
g_hash_table_insert (id_table, (gpointer) &references->references[j], c);
} else
@@ -516,7 +516,7 @@ thread_summary (CamelFolderThread *thread,
}
}
- d(printf("\n\n"));
+ d (printf ("\n\n"));
/* build a list of root messages (no parent) */
head = NULL;
g_hash_table_foreach (id_table, hashloop, &head);
@@ -533,9 +533,9 @@ thread_summary (CamelFolderThread *thread,
group_root_set (thread, &head);
#if 0
- printf("finished\n");
+ printf ("finished\n");
i = camel_folder_threaded_messages_dump (head);
- printf("%d count, %d items in tree\n", summary->len, i);
+ printf ("%d count, %d items in tree\n", summary->len, i);
#endif
sort_thread (&head);
@@ -578,9 +578,9 @@ thread_summary (CamelFolderThread *thread,
while (c->next) {
c = c->next;
if (c->message == NULL)
- g_warning("threading missed removing a pseudo node: %s\n", c->root_subject);
+ g_warning ("threading missed removing a pseudo node: %s\n", c->root_subject);
if (c->parent != NULL)
- g_warning("base node has a non-null parent: %s\n", c->root_subject);
+ g_warning ("base node has a non-null parent: %s\n", c->root_subject);
}
thread->tree = head;
@@ -589,7 +589,7 @@ thread_summary (CamelFolderThread *thread,
gettimeofday (&end, NULL);
diff = end.tv_sec * 1000 + end.tv_usec / 1000;
diff -= start.tv_sec * 1000 + start.tv_usec / 1000;
- printf("Message threading %d messages took %ld.%03ld seconds\n",
+ printf ("Message threading %d messages took %ld.%03ld seconds\n",
summary->len, diff / 1000, diff % 1000);
#endif
}
diff --git a/camel/camel-gpg-context.c b/camel/camel-gpg-context.c
index 1763c02..11afa3d 100644
--- a/camel/camel-gpg-context.c
+++ b/camel/camel-gpg-context.c
@@ -720,7 +720,7 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg,
*inptr++ = '\0';
status = gpg->statusbuf;
- if (camel_debug("gpg:status"))
+ if (camel_debug ("gpg:status"))
printf ("status: %s\n", status);
if (strncmp ((const gchar *) status, "[GNUPG:] ", 9) != 0) {
@@ -1182,7 +1182,7 @@ gpg_ctx_op_step (struct _GpgCtx *gpg,
gchar buffer[4096];
gssize nread;
- d(printf ("reading from gpg's status-fd...\n"));
+ d (printf ("reading from gpg's status-fd...\n"));
do {
nread = read (gpg->status_fd, buffer, sizeof (buffer));
@@ -1204,7 +1204,7 @@ gpg_ctx_op_step (struct _GpgCtx *gpg,
gchar buffer[4096];
gssize nread;
- d(printf ("reading gpg's stdout...\n"));
+ d (printf ("reading gpg's stdout...\n"));
do {
nread = read (gpg->stdout_fd, buffer, sizeof (buffer));
@@ -1229,7 +1229,7 @@ gpg_ctx_op_step (struct _GpgCtx *gpg,
gchar buffer[4096];
gssize nread;
- d(printf ("reading gpg's stderr...\n"));
+ d (printf ("reading gpg's stderr...\n"));
do {
nread = read (gpg->stderr_fd, buffer, sizeof (buffer));
@@ -1250,7 +1250,7 @@ gpg_ctx_op_step (struct _GpgCtx *gpg,
gssize w, nwritten = 0;
gsize n;
- d(printf ("sending gpg our passphrase...\n"));
+ d (printf ("sending gpg our passphrase...\n"));
/* send the passphrase to gpg */
n = strlen (gpg->passwd);
@@ -1278,7 +1278,7 @@ gpg_ctx_op_step (struct _GpgCtx *gpg,
gchar buffer[4096];
gssize nread;
- d(printf ("writing to gpg's stdin...\n"));
+ d (printf ("writing to gpg's stdin...\n"));
/* write our stream to gpg's stdin */
nread = camel_stream_read (
@@ -1299,12 +1299,12 @@ gpg_ctx_op_step (struct _GpgCtx *gpg,
if (w == -1)
goto exception;
- d(printf ("wrote %d (out of %d) bytes to gpg's stdin\n", nwritten, nread));
+ d (printf ("wrote %d (out of %d) bytes to gpg's stdin\n", nwritten, nread));
wrote_data = TRUE;
}
if (camel_stream_eos (gpg->istream)) {
- d(printf ("closing gpg's stdin\n"));
+ d (printf ("closing gpg's stdin\n"));
close (gpg->stdin_fd);
gpg->stdin_fd = -1;
}
@@ -1593,14 +1593,14 @@ gpg_sign_sync (CamelCipherContext *context,
}
#ifdef GPG_LOG
- if (camel_debug_start("gpg:sign")) {
+ if (camel_debug_start ("gpg:sign")) {
gchar *name;
CamelStream *out;
- name = g_strdup_printf("camel-gpg.%d.sign-data", logid++);
+ name = g_strdup_printf ("camel-gpg.%d.sign-data", logid++);
out = camel_stream_fs_new_with_name (name, O_CREAT | O_TRUNC | O_WRONLY, 0666);
if (out) {
- printf("Writing gpg signing data to '%s'\n", name);
+ printf ("Writing gpg signing data to '%s'\n", name);
camel_stream_write_to_stream (istream, out);
g_seekable_seek (
G_SEEKABLE (istream), 0,
@@ -1650,20 +1650,20 @@ gpg_sign_sync (CamelCipherContext *context,
dw, ostream, NULL, NULL);
sigpart = camel_mime_part_new ();
- ct = camel_content_type_new("application", "pgp-signature");
- camel_content_type_set_param(ct, "name", "signature.asc");
+ ct = camel_content_type_new ("application", "pgp-signature");
+ camel_content_type_set_param (ct, "name", "signature.asc");
camel_data_wrapper_set_mime_type_field (dw, ct);
camel_content_type_unref (ct);
camel_medium_set_content ((CamelMedium *) sigpart, dw);
g_object_unref (dw);
- camel_mime_part_set_description(sigpart, "This is a digitally signed message part");
+ camel_mime_part_set_description (sigpart, "This is a digitally signed message part");
mps = camel_multipart_signed_new ();
- ct = camel_content_type_new("multipart", "signed");
- camel_content_type_set_param(ct, "micalg", camel_cipher_context_hash_to_id (context, hash == CAMEL_CIPHER_HASH_DEFAULT ? gpg->hash : hash));
- camel_content_type_set_param(ct, "protocol", class->sign_protocol);
+ ct = camel_content_type_new ("multipart", "signed");
+ camel_content_type_set_param (ct, "micalg", camel_cipher_context_hash_to_id (context, hash == CAMEL_CIPHER_HASH_DEFAULT ? gpg->hash : hash));
+ camel_content_type_set_param (ct, "protocol", class->sign_protocol);
camel_data_wrapper_set_mime_type_field ((CamelDataWrapper *) mps, ct);
camel_content_type_unref (ct);
camel_multipart_set_boundary ((CamelMultipart *) mps, NULL);
@@ -1706,11 +1706,11 @@ gpg_verify_sync (CamelCipherContext *context,
ct = ((CamelDataWrapper *) mps)->mime_type;
/* Inline signature (using our fake mime type) or PGP/Mime signature */
- if (camel_content_type_is(ct, "multipart", "signed")) {
+ if (camel_content_type_is (ct, "multipart", "signed")) {
/* PGP/Mime Signature */
const gchar *tmp;
- tmp = camel_content_type_param(ct, "protocol");
+ tmp = camel_content_type_param (ct, "protocol");
if (!CAMEL_IS_MULTIPART_SIGNED (mps)
|| tmp == NULL
|| g_ascii_strcasecmp (tmp, class->sign_protocol) != 0) {
@@ -1737,7 +1737,7 @@ gpg_verify_sync (CamelCipherContext *context,
g_object_unref (istream);
return NULL;
}
- } else if (camel_content_type_is(ct, "application", "x-inlinepgp-signed")) {
+ } else if (camel_content_type_is (ct, "application", "x-inlinepgp-signed")) {
/* Inline Signed */
CamelDataWrapper *content;
content = camel_medium_get_content ((CamelMedium *) ipart);
@@ -1759,14 +1759,14 @@ gpg_verify_sync (CamelCipherContext *context,
/* Now start the real work of verifying the message */
#ifdef GPG_LOG
- if (camel_debug_start("gpg:sign")) {
+ if (camel_debug_start ("gpg:sign")) {
gchar *name;
CamelStream *out;
- name = g_strdup_printf("camel-gpg.%d.verify.data", logid);
+ name = g_strdup_printf ("camel-gpg.%d.verify.data", logid);
out = camel_stream_fs_new_with_name (name, O_CREAT | O_TRUNC | O_WRONLY, 0666);
if (out) {
- printf("Writing gpg verify data to '%s'\n", name);
+ printf ("Writing gpg verify data to '%s'\n", name);
camel_stream_write_to_stream (istream, out);
g_seekable_seek (
G_SEEKABLE (istream),
@@ -1777,10 +1777,10 @@ gpg_verify_sync (CamelCipherContext *context,
g_free (name);
if (sigpart) {
- name = g_strdup_printf("camel-gpg.%d.verify.signature", logid++);
+ name = g_strdup_printf ("camel-gpg.%d.verify.signature", logid++);
out = camel_stream_fs_new_with_name (name, O_CREAT | O_TRUNC | O_WRONLY, 0666);
if (out) {
- printf("Writing gpg verify signature to '%s'\n", name);
+ printf ("Writing gpg verify signature to '%s'\n", name);
camel_data_wrapper_write_to_stream ((CamelDataWrapper *) sigpart, out);
g_object_unref (out);
}
@@ -1962,15 +1962,15 @@ gpg_encrypt_sync (CamelCipherContext *context,
dw, ostream, NULL, NULL);
encpart = camel_mime_part_new ();
- ct = camel_content_type_new("application", "octet-stream");
- camel_content_type_set_param(ct, "name", "encrypted.asc");
+ ct = camel_content_type_new ("application", "octet-stream");
+ camel_content_type_set_param (ct, "name", "encrypted.asc");
camel_data_wrapper_set_mime_type_field (dw, ct);
camel_content_type_unref (ct);
camel_medium_set_content ((CamelMedium *) encpart, dw);
g_object_unref (dw);
- camel_mime_part_set_description(encpart, _("This is a digitally encrypted message part"));
+ camel_mime_part_set_description (encpart, _("This is a digitally encrypted message part"));
vstream = camel_stream_mem_new ();
camel_stream_write_string (vstream, "Version: 1\n", NULL, NULL);
@@ -1986,8 +1986,8 @@ gpg_encrypt_sync (CamelCipherContext *context,
g_object_unref (dw);
mpe = camel_multipart_encrypted_new ();
- ct = camel_content_type_new("multipart", "encrypted");
- camel_content_type_set_param(ct, "protocol", class->encrypt_protocol);
+ ct = camel_content_type_new ("multipart", "encrypted");
+ camel_content_type_set_param (ct, "protocol", class->encrypt_protocol);
camel_data_wrapper_set_mime_type_field ((CamelDataWrapper *) mpe, ct);
camel_content_type_unref (ct);
camel_multipart_set_boundary ((CamelMultipart *) mpe, NULL);
@@ -2043,7 +2043,7 @@ gpg_decrypt_sync (CamelCipherContext *context,
ct = camel_data_wrapper_get_mime_type_field (content);
/* Encrypted part (using our fake mime type) or PGP/Mime multipart */
- if (camel_content_type_is(ct, "multipart", "encrypted")) {
+ if (camel_content_type_is (ct, "multipart", "encrypted")) {
mp = (CamelMultipart *) camel_medium_get_content ((CamelMedium *) ipart);
if (!(encrypted = camel_multipart_get_part (mp, CAMEL_MULTIPART_ENCRYPTED_CONTENT))) {
g_set_error (
@@ -2054,7 +2054,7 @@ gpg_decrypt_sync (CamelCipherContext *context,
}
content = camel_medium_get_content ((CamelMedium *) encrypted);
- } else if (camel_content_type_is(ct, "application", "x-inlinepgp-encrypted")) {
+ } else if (camel_content_type_is (ct, "application", "x-inlinepgp-encrypted")) {
content = camel_medium_get_content ((CamelMedium *) ipart);
} else {
/* Invalid Mimetype */
@@ -2104,7 +2104,7 @@ gpg_decrypt_sync (CamelCipherContext *context,
g_seekable_seek (G_SEEKABLE (ostream), 0, G_SEEK_SET, NULL, NULL);
- if (camel_content_type_is(ct, "multipart", "encrypted")) {
+ if (camel_content_type_is (ct, "multipart", "encrypted")) {
CamelDataWrapper *dw;
CamelStream *null = camel_stream_null_new ();
@@ -2130,16 +2130,16 @@ gpg_decrypt_sync (CamelCipherContext *context,
dw = camel_data_wrapper_new ();
success = camel_data_wrapper_construct_from_stream_sync (
dw, ostream, NULL, error);
- camel_data_wrapper_set_mime_type(dw, "application/octet-stream");
+ camel_data_wrapper_set_mime_type (dw, "application/octet-stream");
camel_medium_set_content ((CamelMedium *) opart, dw);
g_object_unref (dw);
/* Set mime/type of this new part to application/octet-stream to force type snooping */
- camel_mime_part_set_content_type(opart, "application/octet-stream");
+ camel_mime_part_set_content_type (opart, "application/octet-stream");
}
if (success) {
valid = camel_cipher_validity_new ();
- valid->encrypt.description = g_strdup(_("Encrypted content"));
+ valid->encrypt.description = g_strdup (_("Encrypted content"));
valid->encrypt.status = CAMEL_CIPHER_VALIDITY_ENCRYPT_ENCRYPTED;
if (gpg->hadsig) {
@@ -2346,7 +2346,7 @@ camel_gpg_context_set_always_trust (CamelGpgContext *context,
{
g_return_if_fail (CAMEL_IS_GPG_CONTEXT (context));
- if ((context->priv->always_trust ? 1 : 0) == (always_trust ? 1 : 0))
+ if (context->priv->always_trust == always_trust)
return;
context->priv->always_trust = always_trust;
diff --git a/camel/camel-html-parser.c b/camel/camel-html-parser.c
index c222d4e..9bcce24 100644
--- a/camel/camel-html-parser.c
+++ b/camel/camel-html-parser.c
@@ -459,8 +459,8 @@ static CamelHTMLParserPrivate *tokenize_init (void)
p->attr = 0;
p->attrs = g_ptr_array_new ();
p->values = g_ptr_array_new ();
- p->tag = g_string_new("");
- p->ent = g_string_new("");
+ p->tag = g_string_new ("");
+ p->ent = g_string_new ("");
p->charset = NULL;
if (entities == NULL)
@@ -505,10 +505,10 @@ static void dump_tag (CamelHTMLParserPrivate *p)
{
gint i;
- printf("got tag: %s\n", p->tag->str);
- printf("%d attributes:\n", p->attr);
+ printf ("got tag: %s\n", p->tag->str);
+ printf ("%d attributes:\n", p->attr);
for (i = 0; i < p->attr; i++) {
- printf(" %s = '%s'\n", ((GString *)p->attrs->pdata[i])->str, ((GString *)p->values->pdata[i])->str);
+ printf (" %s = '%s'\n", ((GString *) p->attrs->pdata[i])->str, ((GString *) p->values->pdata[i])->str);
}
}
#endif
@@ -521,7 +521,7 @@ static gint tokenize_step (CamelHTMLParserPrivate *p, gchar **datap, gint *lenp)
gint state = p->state, ret, len;
gchar *start = p->inptr;
- d(printf("Tokenise step\n"));
+ d (printf ("Tokenise step\n"));
while (in < inend) {
c = *in++;
@@ -532,7 +532,7 @@ static gint tokenize_step (CamelHTMLParserPrivate *p, gchar **datap, gint *lenp)
state = CAMEL_HTML_PARSER_TAG;
p->attr = 0;
g_string_truncate (p->tag, 0);
- d(printf("got data '%.*s'\n", in-start-1, start));
+ d (printf ("got data '%.*s'\n", in - start - 1, start));
*datap = start;
*lenp = in-start-1;
goto done;
@@ -541,7 +541,7 @@ static gint tokenize_step (CamelHTMLParserPrivate *p, gchar **datap, gint *lenp)
state = CAMEL_HTML_PARSER_ENT;
g_string_truncate (p->ent, 0);
g_string_append_c (p->ent, c);
- d(printf("got data '%.*s'\n", in-start-1, start));
+ d (printf ("got data '%.*s'\n", in - start - 1, start));
*datap = start;
*lenp = in-start-1;
goto done;
@@ -558,7 +558,7 @@ static gint tokenize_step (CamelHTMLParserPrivate *p, gchar **datap, gint *lenp)
*lenp = p->ent->len;
goto done;
} else {
- d(printf("got entity: %s = %s\n", p->ent->str, p->ent_utf8));
+ d (printf ("got entity: %s = %s\n", p->ent->str, p->ent_utf8));
ret = state;
state = CAMEL_HTML_PARSER_DATA;
*datap = p->ent_utf8;
@@ -637,8 +637,8 @@ static gint tokenize_step (CamelHTMLParserPrivate *p, gchar **datap, gint *lenp)
} else if (c == ' ' || c == '\n' || c == '\t') {
} else {
if (p->attrs->len <= p->attr) {
- g_ptr_array_add(p->attrs, g_string_new(""));
- g_ptr_array_add(p->values, g_string_new(""));
+ g_ptr_array_add (p->attrs, g_string_new (""));
+ g_ptr_array_add (p->values, g_string_new (""));
} else {
g_string_truncate (p->attrs->pdata[p->attr], 0);
g_string_truncate (p->values->pdata[p->attr], 0);
@@ -664,7 +664,7 @@ static gint tokenize_step (CamelHTMLParserPrivate *p, gchar **datap, gint *lenp)
break;
case CAMEL_HTML_PARSER_VAL0:
if (c == '>') {
- d(printf("value truncated\n"));
+ d (printf ("value truncated\n"));
d (dump_tag (p));
ret = CAMEL_HTML_PARSER_ELEMENT;
state = CAMEL_HTML_PARSER_DATA;
@@ -683,7 +683,7 @@ static gint tokenize_step (CamelHTMLParserPrivate *p, gchar **datap, gint *lenp)
do_val:
if (p->quote) {
if (c == '>') {
- d(printf("value truncated\n"));
+ d (printf ("value truncated\n"));
d (dump_tag (p));
ret = CAMEL_HTML_PARSER_ELEMENT;
state = CAMEL_HTML_PARSER_DATA;
@@ -723,7 +723,7 @@ static gint tokenize_step (CamelHTMLParserPrivate *p, gchar **datap, gint *lenp)
g_string_append (p->values->pdata[p->attr], p->ent->str);
g_string_append_c (p->values->pdata[p->attr], ';');
} else {
- d(printf("got entity: %s = %s\n", p->ent->str, p->ent_utf8));
+ d (printf ("got entity: %s = %s\n", p->ent->str, p->ent_utf8));
g_string_append_len (p->values->pdata[p->attr], p->ent_utf8, len);
}
} else if (isalnum (c) || c=='#') { /* FIXME: right type */
diff --git a/camel/camel-iconv.c b/camel/camel-iconv.c
index ed1bff5..f7de2e9 100644
--- a/camel/camel-iconv.c
+++ b/camel/camel-iconv.c
@@ -298,7 +298,7 @@ camel_iconv_charset_name (const gchar *charset)
}
/* Unknown, try canonicalise some basic charset types to something that should work */
- if (strncmp(name, "iso", 3) == 0) {
+ if (strncmp (name, "iso", 3) == 0) {
/* Convert iso-nnnn-n or isonnnn-n or iso_nnnn-n to iso-nnnn-n or isonnnn-n */
gint iso, codepage;
gchar *p;
@@ -332,18 +332,18 @@ camel_iconv_charset_name (const gchar *charset)
ret = g_strdup_printf (ICONV_ISO_S_FORMAT, iso, p);
}
}
- } else if (strncmp(name, "windows-", 8) == 0) {
+ } else if (strncmp (name, "windows-", 8) == 0) {
/* Convert windows-nnnnn or windows-cpnnnnn to cpnnnn */
tmp = name + 8;
- if (!strncmp(tmp, "cp", 2))
+ if (!strncmp (tmp, "cp", 2))
tmp+=2;
- ret = g_strdup_printf("CP%s", tmp);
- } else if (strncmp(name, "microsoft-", 10) == 0) {
+ ret = g_strdup_printf ("CP%s", tmp);
+ } else if (strncmp (name, "microsoft-", 10) == 0) {
/* Convert microsoft-nnnnn or microsoft-cpnnnnn to cpnnnn */
tmp = name + 10;
- if (!strncmp(tmp, "cp", 2))
+ if (!strncmp (tmp, "cp", 2))
tmp+=2;
- ret = g_strdup_printf("CP%s", tmp);
+ ret = g_strdup_printf ("CP%s", tmp);
} else {
/* Just assume its ok enough as is, case and all */
ret = g_strdup (charset);
@@ -392,7 +392,7 @@ camel_iconv_open (const gchar *oto,
to = camel_iconv_charset_name (oto);
from = camel_iconv_charset_name (ofrom);
tofrom = g_alloca (strlen (to) + strlen (from) + 2);
- sprintf(tofrom, "%s%%%s", to, from);
+ sprintf (tofrom, "%s%%%s", to, from);
G_LOCK (iconv);
@@ -411,7 +411,7 @@ camel_iconv_open (const gchar *oto,
in = g_queue_peek_head (&ic->open);
if (in != NULL && !in->busy) {
- cd(printf("Flushing iconv converter '%s'\n", ic->conv));
+ cd (printf ("Flushing iconv converter '%s'\n", ic->conv));
g_queue_delete_link (&iconv_cache_list, link);
g_hash_table_remove (iconv_cache, ic->conv);
flush_entry (ic);
@@ -425,7 +425,7 @@ camel_iconv_open (const gchar *oto,
ic->conv = g_strdup (tofrom);
g_hash_table_insert (iconv_cache, ic->conv, ic);
- cd(printf("Creating iconv converter '%s'\n", ic->conv));
+ cd (printf ("Creating iconv converter '%s'\n", ic->conv));
}
g_queue_push_head (&iconv_cache_list, ic);
@@ -433,7 +433,7 @@ camel_iconv_open (const gchar *oto,
/* If we have a free iconv, use it */
in = g_queue_peek_tail (&ic->open);
if (in != NULL && !in->busy) {
- cd(printf("using existing iconv converter '%s'\n", ic->conv));
+ cd (printf ("using existing iconv converter '%s'\n", ic->conv));
ip = in->ip;
if (ip != (iconv_t) - 1) {
/* work around some broken iconv implementations
@@ -449,7 +449,7 @@ camel_iconv_open (const gchar *oto,
g_queue_push_head (&ic->open, in);
}
} else {
- cd(printf("creating new iconv converter '%s'\n", ic->conv));
+ cd (printf ("creating new iconv converter '%s'\n", ic->conv));
ip = iconv_open (to, from);
in = g_malloc (sizeof (*in));
in->ip = ip;
@@ -460,7 +460,7 @@ camel_iconv_open (const gchar *oto,
in->busy = TRUE;
} else {
errnosav = errno;
- g_warning("Could not open converter for '%s' to '%s' charset", from, to);
+ g_warning ("Could not open converter for '%s' to '%s' charset", from, to);
in->busy = FALSE;
errno = errnosav;
}
@@ -492,12 +492,12 @@ camel_iconv_close (iconv_t ip)
G_LOCK (iconv);
in = g_hash_table_lookup (iconv_cache_open, ip);
if (in) {
- cd(printf("closing iconv converter '%s'\n", in->parent->conv));
+ cd (printf ("closing iconv converter '%s'\n", in->parent->conv));
g_queue_remove (&in->parent->open, in);
in->busy = FALSE;
g_queue_push_tail (&in->parent->open, in);
} else {
- g_warning("trying to close iconv i dont know about: %p", ip);
+ g_warning ("trying to close iconv i dont know about: %p", ip);
iconv_close (ip);
}
G_UNLOCK (iconv);
diff --git a/camel/camel-imapx-command.c b/camel/camel-imapx-command.c
index 8afcc4e..b866412 100644
--- a/camel/camel-imapx-command.c
+++ b/camel/camel-imapx-command.c
@@ -261,7 +261,7 @@ camel_imapx_command_addv (CamelIMAPXCommand *ic,
g_return_if_fail (CAMEL_IS_IMAPX_COMMAND (ic));
- c(ic->is->tagprefix, "adding command, format = '%s'\n", format);
+ c (ic->is->tagprefix, "adding command, format = '%s'\n", format);
buffer = ((CamelIMAPXRealCommand *) ic)->buffer;
@@ -311,17 +311,17 @@ camel_imapx_command_addv (CamelIMAPXCommand *ic,
break;
case 'S': /* stream */
S = va_arg (ap, CamelStream *);
- c(ic->is->tagprefix, "got stream '%p'\n", S);
+ c (ic->is->tagprefix, "got stream '%p'\n", S);
camel_imapx_command_add_part (ic, CAMEL_IMAPX_COMMAND_STREAM, S);
break;
case 'D': /* datawrapper */
D = va_arg (ap, CamelDataWrapper *);
- c(ic->is->tagprefix, "got data wrapper '%p'\n", D);
+ c (ic->is->tagprefix, "got data wrapper '%p'\n", D);
camel_imapx_command_add_part (ic, CAMEL_IMAPX_COMMAND_DATAWRAPPER, D);
break;
case 'P': /* filename path */
P = va_arg (ap, gchar *);
- c(ic->is->tagprefix, "got file path '%s'\n", P);
+ c (ic->is->tagprefix, "got file path '%s'\n", P);
camel_imapx_command_add_part (ic, CAMEL_IMAPX_COMMAND_FILE, P);
break;
case 't': /* token */
@@ -330,7 +330,7 @@ camel_imapx_command_addv (CamelIMAPXCommand *ic,
break;
case 's': /* simple string */
s = va_arg (ap, gchar *);
- c(ic->is->tagprefix, "got string '%s'\n", g_str_has_prefix (format, "LOGIN") ? "***" : s);
+ c (ic->is->tagprefix, "got string '%s'\n", g_str_has_prefix (format, "LOGIN") ? "***" : s);
output_string:
if (s && *s) {
guchar mask = imapx_is_mask (s);
@@ -366,7 +366,7 @@ camel_imapx_command_addv (CamelIMAPXCommand *ic,
case 'f': /* imap folder name */
folder = va_arg (ap, CamelFolder *);
full_name = camel_folder_get_full_name (folder);
- c(ic->is->tagprefix, "got folder '%s'\n", full_name);
+ c (ic->is->tagprefix, "got folder '%s'\n", full_name);
parent_store = camel_folder_get_parent_store (folder);
fname = camel_imapx_store_summary_full_from_path (((CamelIMAPXStore *) parent_store)->summary, full_name);
if (fname) {
@@ -396,19 +396,19 @@ camel_imapx_command_addv (CamelIMAPXCommand *ic,
case 'u':
if (llong == 1) {
l = va_arg (ap, glong);
- c(ic->is->tagprefix, "got glong '%d'\n", (gint)l);
+ c (ic->is->tagprefix, "got glong '%d'\n", (gint) l);
memcpy (literal_format, start, p - start);
literal_format[p - start] = 0;
g_string_append_printf (buffer, literal_format, l);
} else if (llong == 2) {
guint64 i64 = va_arg (ap, guint64);
- c(ic->is->tagprefix, "got guint64 '%d'\n", (gint)i64);
+ c (ic->is->tagprefix, "got guint64 '%d'\n", (gint) i64);
memcpy (literal_format, start, p - start);
literal_format[p - start] = 0;
g_string_append_printf (buffer, literal_format, i64);
} else {
d = va_arg (ap, gint);
- c(ic->is->tagprefix, "got gint '%d'\n", d);
+ c (ic->is->tagprefix, "got gint '%d'\n", d);
memcpy (literal_format, start, p - start);
literal_format[p - start] = 0;
g_string_append_printf (buffer, literal_format, d);
@@ -535,9 +535,9 @@ camel_imapx_command_close (CamelIMAPXCommand *ic)
buffer = ((CamelIMAPXRealCommand *) ic)->buffer;
if (buffer->len > 5 && g_ascii_strncasecmp (buffer->str, "LOGIN", 5) == 0) {
- c(ic->is->tagprefix, "completing command buffer is [%d] 'LOGIN...'\n", (gint) buffer->len);
+ c (ic->is->tagprefix, "completing command buffer is [%d] 'LOGIN...'\n", (gint) buffer->len);
} else {
- c(ic->is->tagprefix, "completing command buffer is [%d] '%.*s'\n", (gint) buffer->len, (gint) buffer->len, buffer->str);
+ c (ic->is->tagprefix, "completing command buffer is [%d] '%.*s'\n", (gint) buffer->len, (gint) buffer->len, buffer->str);
}
if (buffer->len > 0)
camel_imapx_command_add_part (ic, CAMEL_IMAPX_COMMAND_SIMPLE, NULL);
diff --git a/camel/camel-imapx-conn-manager.c b/camel/camel-imapx-conn-manager.c
index 916ef78..51f7758 100644
--- a/camel/camel-imapx-conn-manager.c
+++ b/camel/camel-imapx-conn-manager.c
@@ -464,7 +464,7 @@ imapx_conn_update_select (CamelIMAPXServer *is,
jinfo = camel_imapx_server_get_job_queue_info (is);
if (!g_hash_table_lookup (jinfo->folders, old_selected_folder)) {
connection_info_remove_folder_name (cinfo, old_selected_folder);
- c(is->tagprefix, "Removed folder %s from connection folder list - select changed \n", old_selected_folder);
+ c (is->tagprefix, "Removed folder %s from connection folder list - select changed \n", old_selected_folder);
}
camel_imapx_destroy_job_queue_info (jinfo);
@@ -628,7 +628,7 @@ imapx_create_new_connection_unlocked (CamelIMAPXConnManager *con_man,
con_man->priv->connections = g_list_prepend (
con_man->priv->connections, cinfo);
- c(is->tagprefix, "Created new connection for %s and total connections %d \n", folder_name, g_list_length (con_man->priv->connections));
+ c (is->tagprefix, "Created new connection for %s and total connections %d \n", folder_name, g_list_length (con_man->priv->connections));
return is;
}
@@ -718,7 +718,7 @@ camel_imapx_conn_manager_update_con_info (CamelIMAPXConnManager *con_man,
jinfo = camel_imapx_server_get_job_queue_info (cinfo->is);
if (!g_hash_table_lookup (jinfo->folders, folder_name)) {
connection_info_remove_folder_name (cinfo, folder_name);
- c(is->tagprefix, "Removed folder %s from connection folder list - op done \n", folder_name);
+ c (is->tagprefix, "Removed folder %s from connection folder list - op done \n", folder_name);
}
camel_imapx_destroy_job_queue_info (jinfo);
diff --git a/camel/camel-imapx-folder.c b/camel/camel-imapx-folder.c
index 089ff01..2d14ff9 100644
--- a/camel/camel-imapx-folder.c
+++ b/camel/camel-imapx-folder.c
@@ -66,7 +66,7 @@ camel_imapx_folder_new (CamelStore *store,
gboolean filter_junk;
gboolean filter_junk_inbox;
- d("opening imap folder '%s'\n", folder_dir);
+ d ("opening imap folder '%s'\n", folder_dir);
service = CAMEL_SERVICE (store);
@@ -164,7 +164,7 @@ imapx_folder_set_apply_filters (CamelIMAPXFolder *folder,
g_return_if_fail (folder != NULL);
g_return_if_fail (CAMEL_IS_IMAPX_FOLDER (folder));
- if ((folder->apply_filters ? 1 : 0) == (apply_filters ? 1 : 0))
+ if (folder->apply_filters == apply_filters)
return;
folder->apply_filters = apply_filters;
diff --git a/camel/camel-imapx-server.c b/camel/camel-imapx-server.c
index bf5561e..cf1e318 100644
--- a/camel/camel-imapx-server.c
+++ b/camel/camel-imapx-server.c
@@ -241,11 +241,11 @@ static const CamelIMAPXUntaggedRespHandlerDesc _untagged_descr[] = {
{CAMEL_IMAPX_UNTAGGED_FETCH, imapx_untagged_fetch, NULL, TRUE},
{CAMEL_IMAPX_UNTAGGED_FLAGS, imapx_untagged_flags, NULL, TRUE},
{CAMEL_IMAPX_UNTAGGED_LIST, imapx_untagged_list, NULL, TRUE},
- {CAMEL_IMAPX_UNTAGGED_LSUB, imapx_untagged_lsub, CAMEL_IMAPX_UNTAGGED_LIST, TRUE /*overridden*/ },
+ {CAMEL_IMAPX_UNTAGGED_LSUB, imapx_untagged_lsub, CAMEL_IMAPX_UNTAGGED_LIST, TRUE /*overridden */ },
{CAMEL_IMAPX_UNTAGGED_NAMESPACE, imapx_untagged_namespace, NULL, FALSE},
{CAMEL_IMAPX_UNTAGGED_NO, imapx_untagged_ok_no_bad, NULL, FALSE},
{CAMEL_IMAPX_UNTAGGED_OK, imapx_untagged_ok_no_bad, NULL, FALSE},
- {CAMEL_IMAPX_UNTAGGED_PREAUTH, imapx_untagged_preauth, CAMEL_IMAPX_UNTAGGED_OK, TRUE /*overridden*/ },
+ {CAMEL_IMAPX_UNTAGGED_PREAUTH, imapx_untagged_preauth, CAMEL_IMAPX_UNTAGGED_OK, TRUE /*overridden */ },
{CAMEL_IMAPX_UNTAGGED_RECENT, imapx_untagged_recent, NULL, TRUE},
{CAMEL_IMAPX_UNTAGGED_STATUS, imapx_untagged_status, NULL, TRUE},
{CAMEL_IMAPX_UNTAGGED_VANISHED, imapx_untagged_vanished, NULL, TRUE},
@@ -389,9 +389,9 @@ struct _CamelIMAPXServerPrivate {
#define CAMEL_IMAPX_SERVER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CAMEL_TYPE_IMAPX_SERVER, CamelIMAPXServerPrivate))
G_DEFINE_TYPE (CamelIMAPXServer, camel_imapx_server, CAMEL_TYPE_OBJECT)
-static const CamelIMAPXUntaggedRespHandlerDesc*
+static const CamelIMAPXUntaggedRespHandlerDesc *
replace_untagged_descriptor (GHashTable *untagged_handlers,
- const gchar* key,
+ const gchar *key,
const CamelIMAPXUntaggedRespHandlerDesc *descr)
{
const CamelIMAPXUntaggedRespHandlerDesc *prev = NULL;
@@ -402,8 +402,8 @@ replace_untagged_descriptor (GHashTable *untagged_handlers,
prev = g_hash_table_lookup (untagged_handlers, key);
g_hash_table_replace (untagged_handlers,
- g_strdup (key),
- (const gpointer) descr);
+ g_strdup (key),
+ (gconstpointer) descr);
return prev;
}
@@ -419,19 +419,19 @@ add_initial_untagged_descriptor (GHashTable *untagged_handlers,
cur = &(_untagged_descr[untagged_id]);
prev = replace_untagged_descriptor (untagged_handlers,
- cur->untagged_response,
- cur);
+ cur->untagged_response,
+ cur);
/* there must not be any previous handler here */
g_return_if_fail (prev == NULL);
}
-static GHashTable*
+static GHashTable *
create_initial_untagged_handler_table (void)
{
GHashTable *uh = g_hash_table_new_full (g_str_hash,
- g_str_equal,
- g_free,
- NULL);
+ g_str_equal,
+ g_free,
+ NULL);
guint32 ii = 0;
/* CamelIMAPXServer predefined handlers*/
@@ -616,21 +616,21 @@ imapx_uidset_add (struct _uidset_state *ss,
ss->uids++;
- e(ic->is->tagprefix, "uidset add '%s'\n", uid);
+ e (ic->is->tagprefix, "uidset add '%s'\n", uid);
if (ss->last == 0) {
- e(ic->is->tagprefix, " start\n");
+ e (ic->is->tagprefix, " start\n");
camel_imapx_command_add (ic, "%d", uidn);
ss->entries++;
ss->start = uidn;
} else {
if (ss->last != uidn - 1) {
if (ss->last == ss->start) {
- e(ic->is->tagprefix, " ,next\n");
+ e (ic->is->tagprefix, " ,next\n");
camel_imapx_command_add (ic, ",%d", uidn);
ss->entries++;
} else {
- e(ic->is->tagprefix, " :range\n");
+ e (ic->is->tagprefix, " :range\n");
camel_imapx_command_add (ic, ":%d,%d", ss->last, uidn);
ss->entries+=2;
}
@@ -642,7 +642,7 @@ imapx_uidset_add (struct _uidset_state *ss,
if ((ss->limit && ss->entries >= ss->limit)
|| (ss->total && ss->uids >= ss->total)) {
- e(ic->is->tagprefix, " done, %d entries, %d uids\n", ss->entries, ss->uids);
+ e (ic->is->tagprefix, " done, %d entries, %d uids\n", ss->entries, ss->uids);
if (!imapx_uidset_done (ss, ic))
return -1;
return 1;
@@ -684,7 +684,7 @@ imapx_command_start (CamelIMAPXServer *is,
g_static_rec_mutex_lock (&is->ostream_lock);
- c(is->tagprefix, "Starting command (active=%d,%s) %c%05u %s\r\n", camel_imapx_command_queue_get_length (is->active), is->literal?" literal":"", is->tagprefix, ic->tag, cp->data && g_str_has_prefix (cp->data, "LOGIN") ? "LOGIN..." : cp->data);
+ c (is->tagprefix, "Starting command (active=%d,%s) %c%05u %s\r\n", camel_imapx_command_queue_get_length (is->active), is->literal?" literal":"", is->tagprefix, ic->tag, cp->data && g_str_has_prefix (cp->data, "LOGIN") ? "LOGIN..." : cp->data);
if (is->stream != NULL) {
gchar *string;
@@ -746,7 +746,7 @@ duplicate_fetch_or_refresh (CamelIMAPXServer *is,
return FALSE;
if (imapx_match_active_job (is, IMAPX_JOB_FETCH_NEW_MESSAGES | IMAPX_JOB_REFRESH_INFO | IMAPX_JOB_FETCH_MESSAGES, NULL)) {
- c(is->tagprefix, "Not yet sending duplicate fetch/refresh %s command\n", ic->name);
+ c (is->tagprefix, "Not yet sending duplicate fetch/refresh %s command\n", ic->name);
return TRUE;
}
@@ -779,9 +779,9 @@ imapx_command_start_next (CamelIMAPXServer *is,
CamelIMAPXCommand *first_ic;
gint min_pri = -128;
- c(is->tagprefix, "** Starting next command\n");
+ c (is->tagprefix, "** Starting next command\n");
if (is->literal) {
- c(is->tagprefix, "* no; waiting for literal '%s'\n", is->literal->name);
+ c (is->tagprefix, "* no; waiting for literal '%s'\n", is->literal->name);
return;
}
@@ -789,7 +789,7 @@ imapx_command_start_next (CamelIMAPXServer *is,
GQueue start = G_QUEUE_INIT;
GList *head, *link;
- c(is->tagprefix, "-- Checking job queue for non-folder jobs\n");
+ c (is->tagprefix, "-- Checking job queue for non-folder jobs\n");
head = camel_imapx_command_queue_peek_head_link (is->queue);
@@ -800,9 +800,9 @@ imapx_command_start_next (CamelIMAPXServer *is,
if (ic->pri < min_pri)
break;
- c(is->tagprefix, "-- %3d '%s'?\n", (gint)ic->pri, ic->name);
+ c (is->tagprefix, "-- %3d '%s'?\n", (gint) ic->pri, ic->name);
if (!ic->select) {
- c(is->tagprefix, "--> starting '%s'\n", ic->name);
+ c (is->tagprefix, "--> starting '%s'\n", ic->name);
min_pri = ic->pri;
g_queue_push_tail (&start, link);
}
@@ -812,7 +812,7 @@ imapx_command_start_next (CamelIMAPXServer *is,
}
if (g_queue_is_empty (&start))
- c(is->tagprefix, "* no, waiting for pending select '%s'\n", camel_folder_get_full_name (is->select_pending));
+ c (is->tagprefix, "* no, waiting for pending select '%s'\n", camel_folder_get_full_name (is->select_pending));
/* Start the tagged commands.
*
@@ -840,18 +840,18 @@ imapx_command_start_next (CamelIMAPXServer *is,
* DONE to exit IDLE mode, or there was an error.
* Either way, we do nothing more right now. */
if (imapx_stop_idle (is, error)) {
- c(is->tagprefix, "waiting for idle to stop \n");
+ c (is->tagprefix, "waiting for idle to stop \n");
return;
}
} else if (empty && !imapx_in_idle (is)) {
imapx_start_idle (is);
- c(is->tagprefix, "starting idle \n");
+ c (is->tagprefix, "starting idle \n");
return;
}
}
if (camel_imapx_command_queue_is_empty (is->queue)) {
- c(is->tagprefix, "* no, no jobs\n");
+ c (is->tagprefix, "* no, no jobs\n");
return;
}
@@ -861,7 +861,7 @@ imapx_command_start_next (CamelIMAPXServer *is,
GList *head, *link;
gboolean commands_started = FALSE;
- c(is->tagprefix, "- we're selected on '%s', current jobs?\n",
+ c (is->tagprefix, "- we're selected on '%s', current jobs?\n",
camel_folder_get_full_name (is->select_folder));
head = camel_imapx_command_queue_peek_head_link (is->active);
@@ -871,15 +871,15 @@ imapx_command_start_next (CamelIMAPXServer *is,
CamelIMAPXCommand *ic = link->data;
min_pri = MAX (min_pri, ic->pri);
- c(is->tagprefix, "- %3d '%s'\n", (gint)ic->pri, ic->name);
+ c (is->tagprefix, "- %3d '%s'\n", (gint) ic->pri, ic->name);
}
if (camel_imapx_command_queue_get_length (is->active) >= MAX_COMMANDS) {
- c(is->tagprefix, "** too many jobs busy, waiting for results for now\n");
+ c (is->tagprefix, "** too many jobs busy, waiting for results for now\n");
return;
}
- c(is->tagprefix, "-- Checking job queue\n");
+ c (is->tagprefix, "-- Checking job queue\n");
head = camel_imapx_command_queue_peek_head_link (is->queue);
@@ -893,10 +893,10 @@ imapx_command_start_next (CamelIMAPXServer *is,
if (ic->pri < min_pri)
break;
- c(is->tagprefix, "-- %3d '%s'?\n", (gint)ic->pri, ic->name);
+ c (is->tagprefix, "-- %3d '%s'?\n", (gint) ic->pri, ic->name);
if (!ic->select || ((ic->select == is->select_folder) &&
!duplicate_fetch_or_refresh (is, ic))) {
- c(is->tagprefix, "--> starting '%s'\n", ic->name);
+ c (is->tagprefix, "--> starting '%s'\n", ic->name);
min_pri = ic->pri;
g_queue_push_tail (&start, link);
} else {
@@ -934,7 +934,7 @@ imapx_command_start_next (CamelIMAPXServer *is,
/* If we need to select a folder for the first command, do it now,
* once it is complete it will re-call us if it succeeded. */
if (first_ic->select) {
- c(is->tagprefix, "Selecting folder '%s' for command '%s'(%p)\n",
+ c (is->tagprefix, "Selecting folder '%s' for command '%s'(%p)\n",
camel_folder_get_full_name (first_ic->select),
first_ic->name, first_ic);
imapx_select (is, first_ic->select, FALSE, cancellable, error);
@@ -958,7 +958,7 @@ imapx_command_start_next (CamelIMAPXServer *is,
if (!ic->select || (ic->select == is->select_folder &&
!duplicate_fetch_or_refresh (is, ic))) {
- c(is->tagprefix, "* queueing job %3d '%s'\n", (gint)ic->pri, ic->name);
+ c (is->tagprefix, "* queueing job %3d '%s'\n", (gint) ic->pri, ic->name);
min_pri = ic->pri;
g_queue_push_tail (&start, link);
}
@@ -1008,12 +1008,12 @@ imapx_command_queue (CamelIMAPXServer *is,
camel_imapx_command_close (ic);
- c(is->tagprefix, "enqueue job '%.*s'\n", ((CamelIMAPXCommandPart *)ic->parts.head->data)->data_size, ((CamelIMAPXCommandPart *)ic->parts.head->data)->data);
+ c (is->tagprefix, "enqueue job '%.*s'\n", ((CamelIMAPXCommandPart *) ic->parts.head->data)->data_size, ((CamelIMAPXCommandPart *) ic->parts.head->data)->data);
QUEUE_LOCK (is);
if (is->state == IMAPX_SHUTDOWN) {
- c(is->tagprefix, "refuse to queue job on disconnected server\n");
+ c (is->tagprefix, "refuse to queue job on disconnected server\n");
if (job->error == NULL)
g_set_error (
&job->error, CAMEL_IMAPX_ERROR, 1,
@@ -1252,7 +1252,7 @@ imapx_untagged_capability (CamelIMAPXServer *is,
is->cinfo = imapx_parse_capability (is->stream, cancellable, error);
if (is->cinfo == NULL)
return FALSE;
- c(is->tagprefix, "got capability flags %08x\n", is->cinfo->capa);
+ c (is->tagprefix, "got capability flags %08x\n", is->cinfo->capa);
return TRUE;
}
@@ -1278,7 +1278,7 @@ imapx_untagged_expunge (CamelIMAPXServer *is,
if (job)
return TRUE;
- c(is->tagprefix, "expunged: %d\n", priv->context->id);
+ c (is->tagprefix, "expunged: %d\n", priv->context->id);
if (is->select_folder) {
gchar *uid = NULL;
@@ -1331,7 +1331,7 @@ imapx_untagged_vanished (CamelIMAPXServer *is,
CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *) is->select_folder;
if (ifolder->exists_on_server < uids->len) {
- c(is->tagprefix, "Error: exists_on_folder %d is fewer than vanished %d\n",
+ c (is->tagprefix, "Error: exists_on_folder %d is fewer than vanished %d\n",
ifolder->exists_on_server, uids->len);
ifolder->exists_on_server = 0;
} else
@@ -1341,9 +1341,9 @@ imapx_untagged_vanished (CamelIMAPXServer *is,
is->changes = camel_folder_change_info_new ();
for (i = 0; i < uids->len; i++) {
- gchar *uid = g_strdup_printf("%u", GPOINTER_TO_UINT(g_ptr_array_index (uids, i)));
+ gchar *uid = g_strdup_printf ("%u", GPOINTER_TO_UINT (g_ptr_array_index (uids, i)));
- c(is->tagprefix, "vanished: %s\n", uid);
+ c (is->tagprefix, "vanished: %s\n", uid);
uid_list = g_list_append (uid_list, uid);
camel_folder_change_info_remove_uid (is->changes, uid);
@@ -1399,7 +1399,7 @@ imapx_untagged_exists (CamelIMAPXServer *is,
priv = CAMEL_IMAPX_SERVER_GET_PRIVATE (is);
- c(is->tagprefix, "exists: %d\n", priv->context->id);
+ c (is->tagprefix, "exists: %d\n", priv->context->id);
is->exists = priv->context->id;
if (is->select_folder)
@@ -1425,7 +1425,7 @@ imapx_untagged_flags (CamelIMAPXServer *is,
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
imapx_parse_flags (is->stream, &flags, NULL, cancellable, error);
- c(is->tagprefix, "flags: %08x\n", flags);
+ c (is->tagprefix, "flags: %08x\n", flags);
return TRUE;
}
@@ -1469,7 +1469,7 @@ imapx_untagged_fetch (CamelIMAPXServer *is,
data->body_len = camel_stream_write_to_stream (finfo->body, data->stream, job->cancellable, &job->error);
if (data->body_len == -1)
g_prefix_error (&job->error,
- _("Error writing to cache stream: "));
+ _("Error writing to cache stream: "));
}
}
@@ -1504,7 +1504,7 @@ imapx_untagged_fetch (CamelIMAPXServer *is,
g_object_ref (is->select_folder);
folder = is->select_folder;
- c(is->tagprefix, "flag changed: %d\n", priv->context->id);
+ c (is->tagprefix, "flag changed: %d\n", priv->context->id);
if (finfo->got & FETCH_UID) {
uid = finfo->uid;
@@ -1522,7 +1522,7 @@ imapx_untagged_fetch (CamelIMAPXServer *is,
} else {
/* This (UID + FLAGS for previously unknown message) might
* happen during a SELECT (QRESYNC). We should use it. */
- c(is->tagprefix, "flags changed for unknown uid %s\n.", uid);
+ c (is->tagprefix, "flags changed for unknown uid %s\n.", uid);
}
finfo->user_flags = NULL;
}
@@ -1625,10 +1625,10 @@ imapx_untagged_fetch (CamelIMAPXServer *is,
guint64 uidl = strtoull (mi->uid, NULL, 10);
if (uidl >= ifolder->uidnext_on_server) {
- c(is->tagprefix, "Updating unread count for new message %s\n", mi->uid);
+ c (is->tagprefix, "Updating unread count for new message %s\n", mi->uid);
((CamelIMAPXFolder *) job->folder)->unread_on_server++;
} else {
- c(is->tagprefix, "Not updating unread count for new message %s\n", mi->uid);
+ c (is->tagprefix, "Not updating unread count for new message %s\n", mi->uid);
}
}
@@ -1715,9 +1715,9 @@ imapx_untagged_list (CamelIMAPXServer *is,
// TODO: we want to make sure the names match?
if (data->flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED) {
- c(is->tagprefix, "lsub: '%s' (%c)\n", linfo->name, linfo->separator);
+ c (is->tagprefix, "lsub: '%s' (%c)\n", linfo->name, linfo->separator);
} else {
- c(is->tagprefix, "list: '%s' (%c)\n", linfo->name, linfo->separator);
+ c (is->tagprefix, "list: '%s' (%c)\n", linfo->name, linfo->separator);
}
if (job && g_hash_table_lookup (data->folders, linfo->name) == NULL) {
@@ -1725,7 +1725,7 @@ imapx_untagged_list (CamelIMAPXServer *is,
linfo->flags |= CAMEL_FOLDER_SUBSCRIBED;
g_hash_table_insert (data->folders, linfo->name, linfo);
} else {
- g_warning("got list response but no current listing job happening?\n");
+ g_warning ("got list response but no current listing job happening?\n");
imapx_free_list (linfo);
}
@@ -1745,7 +1745,7 @@ imapx_untagged_recent (CamelIMAPXServer *is,
priv = CAMEL_IMAPX_SERVER_GET_PRIVATE (is);
- c(is->tagprefix, "recent: %d\n", priv->context->id);
+ c (is->tagprefix, "recent: %d\n", priv->context->id);
is->recent = priv->context->id;
return TRUE;
@@ -1774,7 +1774,7 @@ imapx_untagged_status (CamelIMAPXServer *is,
gchar *path_name;
path_name = camel_imapx_store_summary_full_to_path (s, sinfo->name, ns->sep);
- c(is->tagprefix, "Got folder path '%s' for full '%s'\n", path_name, sinfo->name);
+ c (is->tagprefix, "Got folder path '%s' for full '%s'\n", path_name, sinfo->name);
if (path_name) {
ifolder = (gpointer) camel_store_get_folder_sync (is->store, path_name, 0, cancellable, error);
g_free (path_name);
@@ -1791,7 +1791,7 @@ imapx_untagged_status (CamelIMAPXServer *is,
if (sinfo->uidvalidity && sinfo->uidvalidity != ((CamelIMAPXSummary *) cfolder->summary)->validity)
invalidate_local_cache (ifolder, sinfo->uidvalidity);
} else {
- c(is->tagprefix, "Received STATUS for unknown folder '%s'\n", sinfo->name);
+ c (is->tagprefix, "Received STATUS for unknown folder '%s'\n", sinfo->name);
}
g_free (sinfo->name);
@@ -1813,9 +1813,9 @@ imapx_untagged_bye (CamelIMAPXServer *is,
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
if (camel_imapx_stream_text (is->stream, &token, cancellable, NULL)) {
- c(is->tagprefix, "BYE: %s\n", token);
+ c (is->tagprefix, "BYE: %s\n", token);
g_set_error (error, CAMEL_IMAPX_ERROR, 1,
- "IMAP server said BYE: %s", token);
+ "IMAP server said BYE: %s", token);
}
is->state = IMAPX_SHUTDOWN;
@@ -1831,7 +1831,7 @@ imapx_untagged_preauth (CamelIMAPXServer *is,
/* cancellable may be NULL */
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- c(is->tagprefix, "preauthenticated\n");
+ c (is->tagprefix, "preauthenticated\n");
if (is->state < IMAPX_AUTHENTICATED)
is->state = IMAPX_AUTHENTICATED;
@@ -1854,26 +1854,26 @@ imapx_untagged_ok_no_bad (CamelIMAPXServer *is,
/* TODO: validate which ones of these can happen as unsolicited responses */
/* TODO: handle bye/preauth differently */
camel_imapx_stream_ungettoken (is->stream,
- priv->context->tok,
- priv->context->token,
- priv->context->len);
+ priv->context->tok,
+ priv->context->token,
+ priv->context->len);
priv->context->sinfo = imapx_parse_status (is->stream, cancellable, error);
if (priv->context->sinfo == NULL)
return FALSE;
switch (priv->context->sinfo->condition) {
case IMAPX_CLOSED:
- c(is->tagprefix, "previously selected folder is now closed\n");
+ c (is->tagprefix, "previously selected folder is now closed\n");
if (is->select_pending && !is->select_folder) {
is->select_folder = is->select_pending;
}
break;
case IMAPX_READ_WRITE:
is->mode = IMAPX_MODE_READ | IMAPX_MODE_WRITE;
- c(is->tagprefix, "folder is read-write\n");
+ c (is->tagprefix, "folder is read-write\n");
break;
case IMAPX_READ_ONLY:
is->mode = IMAPX_MODE_READ;
- c(is->tagprefix, "folder is read-only\n");
+ c (is->tagprefix, "folder is read-only\n");
break;
case IMAPX_UIDVALIDITY:
is->uidvalidity = priv->context->sinfo->u.uidvalidity;
@@ -1891,10 +1891,10 @@ imapx_untagged_ok_no_bad (CamelIMAPXServer *is,
is->uidnext = priv->context->sinfo->u.uidnext;
break;
case IMAPX_ALERT:
- c(is->tagprefix, "ALERT!: %s\n", priv->context->sinfo->text);
+ c (is->tagprefix, "ALERT!: %s\n", priv->context->sinfo->text);
break;
case IMAPX_PARSE:
- c(is->tagprefix, "PARSE: %s\n", priv->context->sinfo->text);
+ c (is->tagprefix, "PARSE: %s\n", priv->context->sinfo->text);
break;
case IMAPX_CAPABILITY:
if (priv->context->sinfo->u.cinfo) {
@@ -1903,7 +1903,7 @@ imapx_untagged_ok_no_bad (CamelIMAPXServer *is,
priv->context->sinfo->u.cinfo = NULL;
if (cinfo)
imapx_free_capability (cinfo);
- c(is->tagprefix, "got capability flags %08x\n", is->cinfo->capa);
+ c (is->tagprefix, "got capability flags %08x\n", is->cinfo->capa);
}
break;
default:
@@ -1946,23 +1946,23 @@ imapx_untagged (CamelIMAPXServer *is,
g_object_unref (settings);
- e(is->tagprefix, "got untagged response\n");
+ e (is->tagprefix, "got untagged response\n");
priv->context->id = 0;
priv->context->tok = camel_imapx_stream_token (is->stream,
- &(priv->context->token),
- &(priv->context->len),
- cancellable,
- error);
+ &(priv->context->token),
+ &(priv->context->len),
+ cancellable,
+ error);
if (priv->context->tok < 0)
goto exit;
if (priv->context->tok == IMAPX_TOK_INT) {
priv->context->id = strtoul ((gchar *) priv->context->token, NULL, 10);
priv->context->tok = camel_imapx_stream_token (is->stream,
- &(priv->context->token),
- &(priv->context->len),
- cancellable,
- error);
+ &(priv->context->token),
+ &(priv->context->len),
+ cancellable,
+ error);
if (priv->context->tok < 0)
goto exit;
}
@@ -1973,31 +1973,31 @@ imapx_untagged (CamelIMAPXServer *is,
goto exit;
}
- e(is->tagprefix, "Have token '%s' id %d\n", priv->context->token, priv->context->id);
+ e (is->tagprefix, "Have token '%s' id %d\n", priv->context->token, priv->context->id);
p = priv->context->token;
while ((c = *p))
*p++ = toupper((gchar) c);
- token = (const gchar*) priv->context->token; /* FIXME need 'guchar *token' here */
+ token = (const gchar *) priv->context->token; /* FIXME need 'guchar *token' here */
while (token != NULL) {
CamelIMAPXUntaggedRespHandlerDesc *desc = NULL;
desc = g_hash_table_lookup (priv->untagged_handlers,
- token);
+ token);
if (desc == NULL) {
/* unknown response, just ignore it */
- c(is->tagprefix, "unknown token: %s\n", priv->context->token);
+ c (is->tagprefix, "unknown token: %s\n", priv->context->token);
break;
}
if (desc->handler == NULL) {
/* no handler function, ignore token */
- c(is->tagprefix, "no handler for token: %s\n", priv->context->token);
+ c (is->tagprefix, "no handler for token: %s\n", priv->context->token);
break;
}
/* call the handler function */
ok = desc->handler (is, cancellable, error);
- if (! ok)
+ if (!ok)
goto exit;
/* is there another handler next-in-line? */
@@ -2015,7 +2015,7 @@ imapx_untagged (CamelIMAPXServer *is,
continue;
}
- if (! desc->skip_stream_when_done)
+ if (!desc->skip_stream_when_done)
goto exit;
}
@@ -2046,7 +2046,7 @@ imapx_continuation (CamelIMAPXServer *is,
if (imapx_idle_supported (is) && imapx_in_idle (is)) {
camel_imapx_stream_skip (is->stream, cancellable, error);
- c(is->tagprefix, "Got continuation response for IDLE \n");
+ c (is->tagprefix, "Got continuation response for IDLE \n");
IDLE_LOCK (is->idle);
/* We might have actually sent the DONE already! */
if (is->idle->state == IMAPX_IDLE_ISSUED)
@@ -2061,7 +2061,7 @@ imapx_continuation (CamelIMAPXServer *is,
}
is->idle->state = IMAPX_IDLE_OFF;
} else {
- c(is->tagprefix, "idle starts in wrong state %d\n",
+ c (is->tagprefix, "idle starts in wrong state %d\n",
is->idle->state);
}
IDLE_UNLOCK (is->idle);
@@ -2078,12 +2078,12 @@ imapx_continuation (CamelIMAPXServer *is,
if (!litplus) {
if (ic == NULL) {
camel_imapx_stream_skip (is->stream, cancellable, error);
- c(is->tagprefix, "got continuation response with no outstanding continuation requests?\n");
+ c (is->tagprefix, "got continuation response with no outstanding continuation requests?\n");
return TRUE;
}
- c(is->tagprefix, "got continuation response for data\n");
+ c (is->tagprefix, "got continuation response for data\n");
} else {
- c(is->tagprefix, "sending LITERAL+ continuation\n");
+ c (is->tagprefix, "sending LITERAL+ continuation\n");
}
link = ic->current_part;
@@ -2092,11 +2092,11 @@ imapx_continuation (CamelIMAPXServer *is,
switch (cp->type & CAMEL_IMAPX_COMMAND_MASK) {
case CAMEL_IMAPX_COMMAND_DATAWRAPPER:
- c(is->tagprefix, "writing data wrapper to literal\n");
+ c (is->tagprefix, "writing data wrapper to literal\n");
camel_data_wrapper_write_to_stream_sync ((CamelDataWrapper *) cp->ob, (CamelStream *) is->stream, cancellable, NULL);
break;
case CAMEL_IMAPX_COMMAND_STREAM:
- c(is->tagprefix, "writing stream to literal\n");
+ c (is->tagprefix, "writing stream to literal\n");
camel_stream_write_to_stream ((CamelStream *) cp->ob, (CamelStream *) is->stream, cancellable, NULL);
break;
case CAMEL_IMAPX_COMMAND_AUTH: {
@@ -2112,7 +2112,7 @@ imapx_continuation (CamelIMAPXServer *is,
g_free (token);
if (resp == NULL)
return FALSE;
- c(is->tagprefix, "got auth continuation, feeding token '%s' back to auth mech\n", resp);
+ c (is->tagprefix, "got auth continuation, feeding token '%s' back to auth mech\n", resp);
camel_stream_write ((CamelStream *) is->stream, resp, strlen (resp), cancellable, NULL);
g_free (resp);
@@ -2125,7 +2125,7 @@ imapx_continuation (CamelIMAPXServer *is,
case CAMEL_IMAPX_COMMAND_FILE: {
CamelStream *file;
- c(is->tagprefix, "writing file '%s' to literal\n", (gchar *)cp->ob);
+ c (is->tagprefix, "writing file '%s' to literal\n", (gchar *) cp->ob);
// FIXME: errors
if (cp->ob && (file = camel_stream_fs_new_with_name (cp->ob, O_RDONLY, 0, NULL))) {
@@ -2156,7 +2156,7 @@ noskip:
ic->current_part = link;
cp = (CamelIMAPXCommandPart *) link->data;
- c(is->tagprefix, "next part of command \"%c%05u: %s\"\n", is->tagprefix, ic->tag, cp->data);
+ c (is->tagprefix, "next part of command \"%c%05u: %s\"\n", is->tagprefix, ic->tag, cp->data);
camel_stream_write_string ((CamelStream *) is->stream, cp->data, cancellable, NULL);
camel_stream_write_string ((CamelStream *) is->stream, "\r\n", cancellable, NULL);
if (cp->type & (CAMEL_IMAPX_COMMAND_CONTINUATION | CAMEL_IMAPX_COMMAND_LITERAL_PLUS)) {
@@ -2165,8 +2165,8 @@ noskip:
g_assert (g_list_next (link) == NULL);
}
} else {
- c(is->tagprefix, "%p: queueing continuation\n", ic);
- camel_stream_write_string((CamelStream *)is->stream, "\r\n", cancellable, NULL);
+ c (is->tagprefix, "%p: queueing continuation\n", ic);
+ camel_stream_write_string ((CamelStream *) is->stream, "\r\n", cancellable, NULL);
}
QUEUE_LOCK (is);
@@ -2208,7 +2208,7 @@ imapx_completion (CamelIMAPXServer *is,
return FALSE;
}
- c(is->tagprefix, "Got completion response for command %05u '%s'\n", ic->tag, ic->name);
+ c (is->tagprefix, "Got completion response for command %05u '%s'\n", ic->tag, ic->name);
if (camel_folder_change_info_changed (is->changes)) {
camel_folder_summary_save_to_db (is->select_folder->summary, NULL);
@@ -2440,11 +2440,11 @@ static gboolean
imapx_command_idle_stop (CamelIMAPXServer *is,
GError **error)
{
- if (!is->stream || camel_stream_write_string ((CamelStream *)is->stream, "DONE\r\n", NULL, NULL) == -1) {
+ if (!is->stream || camel_stream_write_string ((CamelStream *) is->stream, "DONE\r\n", NULL, NULL) == -1) {
g_set_error (
error, CAMEL_IMAPX_ERROR, 1,
"Unable to issue DONE");
- c(is->tagprefix, "Failed to issue DONE to terminate IDLE\n");
+ c (is->tagprefix, "Failed to issue DONE to terminate IDLE\n");
is->state = IMAPX_SHUTDOWN;
is->parser_quit = TRUE;
if (is->cancellable)
@@ -2662,7 +2662,7 @@ imapx_stop_idle (CamelIMAPXServer *is,
break;
idle->state = IMAPX_IDLE_OFF;
- c(is->tagprefix, "Stopping idle after %ld seconds\n",
+ c (is->tagprefix, "Stopping idle after %ld seconds\n",
(long)(now - idle->started));
case IMAPX_IDLE_PENDING:
idle->state = IMAPX_IDLE_OFF;
@@ -2788,7 +2788,7 @@ imapx_command_select_done (CamelIMAPXServer *is,
GQueue trash = G_QUEUE_INIT;
GList *link;
- c(is->tagprefix, "Select failed\n");
+ c (is->tagprefix, "Select failed\n");
QUEUE_LOCK (is);
@@ -2799,7 +2799,7 @@ imapx_command_select_done (CamelIMAPXServer *is,
CamelIMAPXCommand *cw = link->data;
if (cw->select && cw->select == is->select_pending) {
- c(is->tagprefix, "Cancelling command '%s'(%p) for folder '%s'\n",
+ c (is->tagprefix, "Cancelling command '%s'(%p) for folder '%s'\n",
cw->name, cw, camel_folder_get_full_name (cw->select));
g_queue_push_tail (&trash, link);
}
@@ -2858,7 +2858,7 @@ imapx_command_select_done (CamelIMAPXServer *is,
CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *) is->select_pending;
CamelFolder *cfolder = is->select_pending;
- c(is->tagprefix, "Select ok!\n");
+ c (is->tagprefix, "Select ok!\n");
if (!is->select_folder) {
/* This could have been done earlier by a [CLOSED] status */
@@ -2877,7 +2877,7 @@ imapx_command_select_done (CamelIMAPXServer *is,
RefreshInfoData *data = camel_imapx_job_get_data (job);
if (data->scan_changes) {
- c(is->tagprefix, "Will not fetch_new_messages when already in scan_changes\n");
+ c (is->tagprefix, "Will not fetch_new_messages when already in scan_changes\n");
goto no_fetch_new;
}
}
@@ -2897,7 +2897,7 @@ imapx_command_select_done (CamelIMAPXServer *is,
#if 0
/* This should trigger a new messages scan */
if (is->exists != is->select_folder->summary->root_view->total_count)
- g_warning("exists is %d our summary is %d and summary exists is %d\n", is->exists,
+ g_warning ("exists is %d our summary is %d and summary exists is %d\n", is->exists,
is->select_folder->summary->root_view->total_count,
((CamelIMAPXSummary *) is->select_folder->summary)->exists);
#endif
@@ -2979,7 +2979,7 @@ imapx_select (CamelIMAPXServer *is,
firstuid = imapx_get_uid_from_index (folder->summary, 0);
lastuid = imapx_get_uid_from_index (folder->summary, total - 1);
- c(is->tagprefix, "SELECT QRESYNC %" G_GUINT64_FORMAT
+ c (is->tagprefix, "SELECT QRESYNC %" G_GUINT64_FORMAT
" %" G_GUINT64_FORMAT "\n",
ifolder->uidvalidity_on_server, isum->modseq);
@@ -2998,8 +2998,8 @@ imapx_select (CamelIMAPXServer *is,
gint i;
GString *seqs, *uids;
- seqs = g_string_new(" ");
- uids = g_string_new(")");
+ seqs = g_string_new (" ");
+ uids = g_string_new (")");
/* Include some seq/uid pairs to avoid a huge VANISHED list
* (see RFC5162 Â3.1). Work backwards exponentially from the
@@ -3014,23 +3014,23 @@ imapx_select (CamelIMAPXServer *is,
i = total;
if (i != 9) { /* If not the first time */
- g_string_prepend(seqs, ",");
- g_string_prepend(uids, ",");
+ g_string_prepend (seqs, ",");
+ g_string_prepend (uids, ",");
}
/* IMAP sequence numbers are one higher than the corresponding
* indices in our folder summary -- they start from one, while
* the summary starts from zero. */
- sprintf(buf, "%d", total - i + 1);
+ sprintf (buf, "%d", total - i + 1);
g_string_prepend (seqs, buf);
uid = imapx_get_uid_from_index (folder->summary, total - i);
g_string_prepend (uids, uid);
g_free (uid);
} while (i < total);
- g_string_prepend(seqs, " (");
+ g_string_prepend (seqs, " (");
- c(is->tagprefix, "adding QRESYNC seq/uidset %s%s\n", seqs->str, uids->str);
+ c (is->tagprefix, "adding QRESYNC seq/uidset %s%s\n", seqs->str, uids->str);
camel_imapx_command_add (ic, seqs->str);
camel_imapx_command_add (ic, uids->str);
@@ -3095,22 +3095,22 @@ connect_to_server_process (CamelIMAPXServer *is,
camel_url_set_port (&url, port);
camel_url_set_user (&url, user);
buf = camel_url_to_string (&url, 0);
- child_env[i++] = g_strdup_printf("URL=%s", buf);
+ child_env[i++] = g_strdup_printf ("URL=%s", buf);
g_free (buf);
- child_env[i++] = g_strdup_printf("URLHOST=%s", host);
+ child_env[i++] = g_strdup_printf ("URLHOST=%s", host);
if (port)
- child_env[i++] = g_strdup_printf("URLPORT=%u", port);
+ child_env[i++] = g_strdup_printf ("URLPORT=%u", port);
if (user)
- child_env[i++] = g_strdup_printf("URLUSER=%s", user);
+ child_env[i++] = g_strdup_printf ("URLUSER=%s", user);
if (password)
- child_env[i++] = g_strdup_printf("URLPASSWD=%s", password);
+ child_env[i++] = g_strdup_printf ("URLPASSWD=%s", password);
child_env[i] = NULL;
/* Now do %h, %u, etc. substitution in cmd */
buf = cmd_copy = g_strdup (cmd);
- full_cmd = g_strdup("");
+ full_cmd = g_strdup ("");
for (;;) {
gchar *pc;
@@ -3121,7 +3121,7 @@ connect_to_server_process (CamelIMAPXServer *is,
pc = strchr (buf, '%');
ignore:
if (!pc) {
- tmp = g_strdup_printf("%s%s", full_cmd, buf);
+ tmp = g_strdup_printf ("%s%s", full_cmd, buf);
g_free (full_cmd);
full_cmd = tmp;
break;
@@ -3145,7 +3145,7 @@ connect_to_server_process (CamelIMAPXServer *is,
pc = strchr (pc + 1, '%');
goto ignore;
}
- tmp = g_strdup_printf("%s%.*s%s", full_cmd, len, buf, var);
+ tmp = g_strdup_printf ("%s%.*s%s", full_cmd, len, buf, var);
g_free (full_cmd);
full_cmd = tmp;
buf = pc + 2;
@@ -3289,7 +3289,7 @@ imapx_connect_to_server (CamelIMAPXServer *is,
success = FALSE;
goto exit;
}
- e(is->tagprefix, "Got unexpected line before greeting: '%s'\n", token);
+ e (is->tagprefix, "Got unexpected line before greeting: '%s'\n", token);
g_free (token);
}
@@ -3352,7 +3352,7 @@ imapx_connect_to_server (CamelIMAPXServer *is,
if (ic->status->condition == IMAPX_CAPABILITY) {
is->cinfo = ic->status->u.cinfo;
ic->status->u.cinfo = NULL;
- c(is->tagprefix, "got capability flags %08x\n", is->cinfo->capa);
+ c (is->tagprefix, "got capability flags %08x\n", is->cinfo->capa);
}
camel_imapx_command_unref (ic);
@@ -3497,7 +3497,7 @@ camel_imapx_server_authenticate (CamelIMAPXServer *is,
if (ic->status->condition == IMAPX_CAPABILITY) {
is->cinfo = ic->status->u.cinfo;
ic->status->u.cinfo = NULL;
- c(is->tagprefix, "got capability flags %08x\n", is->cinfo->capa);
+ c (is->tagprefix, "got capability flags %08x\n", is->cinfo->capa);
}
}
@@ -3997,7 +3997,7 @@ imapx_command_append_message_done (CamelIMAPXServer *is,
success = FALSE;
} else if (ic->status && ic->status->condition == IMAPX_APPENDUID) {
- c(is->tagprefix, "Got appenduid %d %d\n", (gint)ic->status->u.appenduid.uidvalidity, (gint)ic->status->u.appenduid.uid);
+ c (is->tagprefix, "Got appenduid %d %d\n", (gint) ic->status->u.appenduid.uidvalidity, (gint) ic->status->u.appenduid.uid);
if (ic->status->u.appenduid.uidvalidity == ifolder->uidvalidity_on_server) {
CamelFolderChangeInfo *changes;
@@ -4129,7 +4129,7 @@ imapx_index_next (GPtrArray *uids,
if (info && (strchr (camel_message_info_uid (info), '-') != NULL)) {
camel_message_info_free (info);
- e('?', "Ignoring offline uid '%s'\n", camel_message_info_uid(info));
+ e ('?', "Ignoring offline uid '%s'\n", camel_message_info_uid (info));
} else {
camel_message_info_free (info);
break;
@@ -4179,7 +4179,7 @@ imapx_command_step_fetch_done (CamelIMAPXServer *is,
i = data->index;
- //printf("%s: Mobile mode: %d Fetch Count %d\n", camel_folder_get_display_name (job->folder), mobile_mode, batch_count);
+ //printf ("%s: Mobile mode: %d Fetch Count %d\n", camel_folder_get_display_name (job->folder), mobile_mode, batch_count);
if (camel_imapx_command_set_error_if_failed (ic, error)) {
g_prefix_error (
error, "%s: ",
@@ -4208,12 +4208,12 @@ imapx_command_step_fetch_done (CamelIMAPXServer *is,
camel_imapx_command_set_job (ic, job);
ic->pri = job->pri - 1;
- //printf("Total: %d: %d, %d, %d\n", total, fetch_limit, i, data->last_index);
+ //printf ("Total: %d: %d, %d, %d\n", total, fetch_limit, i, data->last_index);
data->last_index = i;
/* If its mobile client and when total=0 (new account setup) fetch only one batch of mails,
* on futher attempts download all new mails as per the limit. */
- //printf("Total: %d: %d\n", total, fetch_limit);
+ //printf ("Total: %d: %d\n", total, fetch_limit);
for (; i < data->infos->len && (!mobile_mode || (total && i == 0) || ((fetch_limit != -1 && i < fetch_limit) || (fetch_limit == -1 && i < batch_count))); i++) {
gint res;
@@ -4230,7 +4230,7 @@ imapx_command_step_fetch_done (CamelIMAPXServer *is,
}
}
- //printf("Existing : %d Gonna fetch in %s for %d/%d\n", total, camel_folder_get_full_name(job->folder), i, data->infos->len);
+ //printf ("Existing : %d Gonna fetch in %s for %d/%d\n", total, camel_folder_get_full_name (job->folder), i, data->infos->len);
data->index = data->infos->len;
if (imapx_uidset_done (&data->uidset, ic)) {
camel_imapx_command_add (ic, " (RFC822.SIZE RFC822.HEADER)");
@@ -4249,7 +4249,7 @@ imapx_command_step_fetch_done (CamelIMAPXServer *is,
uidl++;
if (uidl > ifolder->uidnext_on_server) {
- c(is->tagprefix, "Updating uidnext_on_server for '%s' to %" G_GUINT64_FORMAT "\n",
+ c (is->tagprefix, "Updating uidnext_on_server for '%s' to %" G_GUINT64_FORMAT "\n",
camel_folder_get_full_name (job->folder), uidl);
ifolder->uidnext_on_server = uidl;
}
@@ -4413,7 +4413,7 @@ imapx_job_scan_changes_done (CamelIMAPXServer *is,
continue;
}
- e(is->tagprefix, "Message %s vanished\n", s_minfo->uid);
+ e (is->tagprefix, "Message %s vanished\n", s_minfo->uid);
removed = g_list_prepend (removed, (gpointer) g_strdup (s_minfo->uid));
camel_message_info_free (s_minfo);
j++;
@@ -4507,7 +4507,7 @@ imapx_job_scan_changes_start (CamelIMAPXJob *job,
_("Scanning for changed messages in '%s'"),
camel_folder_get_display_name (job->folder));
- e('E', "Scanning from %s in %s\n", uid ? uid : "start",
+ e ('E', "Scanning from %s in %s\n", uid ? uid : "start",
camel_folder_get_full_name (job->folder));
ic = camel_imapx_command_new (
@@ -4568,7 +4568,7 @@ imapx_command_fetch_new_messages_done (CamelIMAPXServer *is,
uidl++;
if (uidl > ifolder->uidnext_on_server) {
- c(is->tagprefix, "Updating uidnext_on_server for '%s' to %" G_GUINT64_FORMAT "\n",
+ c (is->tagprefix, "Updating uidnext_on_server for '%s' to %" G_GUINT64_FORMAT "\n",
camel_folder_get_full_name (job->folder), uidl);
ifolder->uidnext_on_server = uidl;
}
@@ -4646,7 +4646,7 @@ imapx_job_fetch_new_messages_start (CamelIMAPXJob *job,
uid = imapx_get_uid_from_index (folder->summary, total - 1);
uidl = strtoull (uid, NULL, 10);
g_free (uid);
- uid = g_strdup_printf ("%" G_GUINT64_FORMAT, uidl+1);
+ uid = g_strdup_printf ("%" G_GUINT64_FORMAT, uidl + 1);
} else
uid = g_strdup ("1");
@@ -4657,7 +4657,7 @@ imapx_job_fetch_new_messages_start (CamelIMAPXJob *job,
_("Fetching summary information for new messages in '%s'"),
camel_folder_get_display_name (folder));
- //printf("Fetch order: %d/%d\n", fetch_order, CAMEL_SORT_DESCENDING);
+ //printf ("Fetch order: %d/%d\n", fetch_order, CAMEL_SORT_DESCENDING);
if (diff > uidset_size || fetch_order == CAMEL_SORT_DESCENDING) {
ic = camel_imapx_command_new (
is, "FETCH", job->folder,
@@ -4729,7 +4729,7 @@ imapx_job_fetch_messages_start (CamelIMAPXJob *job,
if (total > 0) {
/* This means that we are fetching limited number of new mails */
- uid = g_strdup_printf("%d", total);
+ uid = g_strdup_printf ("%d", total);
} else {
/* For empty accounts, we always fetch the specified number of new mails independent of
* being asked to fetch old or new.
@@ -4793,7 +4793,7 @@ imapx_job_fetch_messages_start (CamelIMAPXJob *job,
guint64 uidl;
start_uid = imapx_get_uid_from_index (folder->summary, 0);
uidl = strtoull (start_uid, NULL, 10);
- end_uid = g_strdup_printf ("%" G_GINT64_MODIFIER "d", (((int)uidl)-fetch_limit > 0) ? (uidl-fetch_limit) : 1);
+ end_uid = g_strdup_printf ("%" G_GINT64_MODIFIER "d", (((gint) uidl) - fetch_limit > 0) ? (uidl - fetch_limit) : 1);
camel_operation_push_message (
job->cancellable, ngettext (
@@ -4977,7 +4977,7 @@ imapx_job_refresh_info_start (CamelIMAPXJob *job,
if (is->use_qresync && isum->modseq && ifolder->uidvalidity_on_server)
can_qresync = TRUE;
- e(is->tagprefix, "folder %s is %sselected, total %u / %u, unread %u / %u, modseq %" G_GUINT64_FORMAT " / %" G_GUINT64_FORMAT ", uidnext %u / %u: will %srescan\n",
+ e (is->tagprefix, "folder %s is %sselected, total %u / %u, unread %u / %u, modseq %" G_GUINT64_FORMAT " / %" G_GUINT64_FORMAT ", uidnext %u / %u: will %srescan\n",
full_name, is_selected?"": "not ", total, ifolder->exists_on_server,
camel_folder_summary_get_unread_count (folder->summary), ifolder->unread_on_server,
(guint64) isum->modseq, (guint64) ifolder->modseq_on_server,
@@ -5013,12 +5013,12 @@ imapx_job_refresh_info_start (CamelIMAPXJob *job,
if (total != ifolder->exists_on_server ||
camel_folder_summary_get_unread_count (folder->summary) != ifolder->unread_on_server ||
(isum->modseq != ifolder->modseq_on_server)) {
- c(is->tagprefix, "Eep, after QRESYNC we're out of sync. total %u / %u, unread %u / %u, modseq %" G_GUINT64_FORMAT " / %" G_GUINT64_FORMAT "\n",
+ c (is->tagprefix, "Eep, after QRESYNC we're out of sync. total %u / %u, unread %u / %u, modseq %" G_GUINT64_FORMAT " / %" G_GUINT64_FORMAT "\n",
total, ifolder->exists_on_server,
camel_folder_summary_get_unread_count (folder->summary), ifolder->unread_on_server,
isum->modseq, ifolder->modseq_on_server);
} else {
- c(is->tagprefix, "OK, after QRESYNC we're still in sync. total %u / %u, unread %u / %u, modseq %" G_GUINT64_FORMAT " / %" G_GUINT64_FORMAT "\n",
+ c (is->tagprefix, "OK, after QRESYNC we're still in sync. total %u / %u, unread %u / %u, modseq %" G_GUINT64_FORMAT " / %" G_GUINT64_FORMAT "\n",
total, ifolder->exists_on_server,
camel_folder_summary_get_unread_count (folder->summary), ifolder->unread_on_server,
isum->modseq, ifolder->modseq_on_server);
@@ -5633,7 +5633,7 @@ imapx_job_sync_changes_start (CamelIMAPXJob *job,
if ((orset & flag) == 0)
continue;
- c(is->tagprefix, "checking/storing %s flags '%s'\n", on?"on":"off", flags_table[j].name);
+ c (is->tagprefix, "checking/storing %s flags '%s'\n", on?"on":"off", flags_table[j].name);
imapx_uidset_init (&ss, 0, 100);
for (i = 0; i < uids->len; i++) {
CamelIMAPXMessageInfo *info = (CamelIMAPXMessageInfo *) camel_folder_summary_get
@@ -6451,7 +6451,7 @@ camel_imapx_server_refresh_info (CamelIMAPXServer *is,
job->folder = folder;
job->pri = IMAPX_PRIORITY_REFRESH_INFO;
- if (g_ascii_strcasecmp(full_name, "INBOX") == 0)
+ if (g_ascii_strcasecmp (full_name, "INBOX") == 0)
job->pri += 10;
camel_imapx_job_set_data (
@@ -6714,8 +6714,8 @@ camel_imapx_server_expunge (CamelIMAPXServer *is,
static guint
imapx_name_hash (gconstpointer key)
{
- if (g_ascii_strcasecmp(key, "INBOX") == 0)
- return g_str_hash("INBOX");
+ if (g_ascii_strcasecmp (key, "INBOX") == 0)
+ return g_str_hash ("INBOX");
else
return g_str_hash (key);
}
@@ -6726,9 +6726,9 @@ imapx_name_equal (gconstpointer a,
{
gconstpointer aname = a, bname = b;
- if (g_ascii_strcasecmp(a, "INBOX") == 0)
+ if (g_ascii_strcasecmp (a, "INBOX") == 0)
aname = "INBOX";
- if (g_ascii_strcasecmp(b, "INBOX") == 0)
+ if (g_ascii_strcasecmp (b, "INBOX") == 0)
bname = "INBOX";
return g_str_equal (aname, bname);
}
@@ -6942,7 +6942,7 @@ camel_imapx_server_fetch_messages (CamelIMAPXServer *is,
full_name = camel_folder_get_full_name (folder);
- if (g_ascii_strcasecmp(full_name, "INBOX") == 0)
+ if (g_ascii_strcasecmp (full_name, "INBOX") == 0)
job->pri += 10;
camel_imapx_job_set_data (
@@ -7060,7 +7060,7 @@ camel_imapx_server_get_job_queue_info (CamelIMAPXServer *is)
*
* Since: 3.6
*/
-const CamelIMAPXUntaggedRespHandlerDesc*
+const CamelIMAPXUntaggedRespHandlerDesc *
camel_imapx_server_register_untagged_handler (CamelIMAPXServer *is,
const gchar *untagged_response,
const CamelIMAPXUntaggedRespHandlerDesc *desc)
@@ -7075,8 +7075,8 @@ camel_imapx_server_register_untagged_handler (CamelIMAPXServer *is,
priv = CAMEL_IMAPX_SERVER_GET_PRIVATE (is);
previous = replace_untagged_descriptor (priv->untagged_handlers,
- untagged_response,
- desc);
+ untagged_response,
+ desc);
return previous;
}
diff --git a/camel/camel-imapx-server.h b/camel/camel-imapx-server.h
index 759c313..b214da2 100644
--- a/camel/camel-imapx-server.h
+++ b/camel/camel-imapx-server.h
@@ -267,7 +267,7 @@ gboolean camel_imapx_server_rename_folder
struct _IMAPXJobQueueInfo *
camel_imapx_server_get_job_queue_info
(CamelIMAPXServer *is);
-const CamelIMAPXUntaggedRespHandlerDesc*
+const CamelIMAPXUntaggedRespHandlerDesc *
camel_imapx_server_register_untagged_handler
(CamelIMAPXServer *is,
const gchar *untagged_response,
diff --git a/camel/camel-imapx-settings.c b/camel/camel-imapx-settings.c
index faf3f63..44214c4 100644
--- a/camel/camel-imapx-settings.c
+++ b/camel/camel-imapx-settings.c
@@ -719,7 +719,7 @@ camel_imapx_settings_set_check_all (CamelIMAPXSettings *settings,
{
g_return_if_fail (CAMEL_IS_IMAPX_SETTINGS (settings));
- if ((settings->priv->check_all ? 1 : 0) == (check_all ? 1 : 0))
+ if (settings->priv->check_all == check_all)
return;
settings->priv->check_all = check_all;
@@ -762,7 +762,7 @@ camel_imapx_settings_set_check_subscribed (CamelIMAPXSettings *settings,
{
g_return_if_fail (CAMEL_IS_IMAPX_SETTINGS (settings));
- if ((settings->priv->check_subscribed ? 1 : 0) == (check_subscribed ? 1 : 0))
+ if (settings->priv->check_subscribed == check_subscribed)
return;
settings->priv->check_subscribed = check_subscribed;
@@ -898,7 +898,7 @@ camel_imapx_settings_set_filter_all (CamelIMAPXSettings *settings,
{
g_return_if_fail (CAMEL_IS_IMAPX_SETTINGS (settings));
- if ((settings->priv->filter_all ? 1 : 0) == (filter_all ? 1 : 0))
+ if (settings->priv->filter_all == filter_all)
return;
settings->priv->filter_all = filter_all;
@@ -941,7 +941,7 @@ camel_imapx_settings_set_filter_junk (CamelIMAPXSettings *settings,
{
g_return_if_fail (CAMEL_IS_IMAPX_SETTINGS (settings));
- if ((settings->priv->filter_junk ? 1 : 0) == (filter_junk ? 1 : 0))
+ if (settings->priv->filter_junk == filter_junk)
return;
settings->priv->filter_junk = filter_junk;
@@ -984,7 +984,7 @@ camel_imapx_settings_set_filter_junk_inbox (CamelIMAPXSettings *settings,
{
g_return_if_fail (CAMEL_IS_IMAPX_SETTINGS (settings));
- if ((settings->priv->filter_junk_inbox ? 1 : 0) == (filter_junk_inbox ? 1 : 0))
+ if (settings->priv->filter_junk_inbox == filter_junk_inbox)
return;
settings->priv->filter_junk_inbox = filter_junk_inbox;
@@ -1025,7 +1025,7 @@ camel_imapx_settings_set_mobile_mode (CamelIMAPXSettings *settings,
{
g_return_if_fail (CAMEL_IS_IMAPX_SETTINGS (settings));
- if ((settings->priv->use_mobile_mode ? 1 : 0) == (mobile_mode ? 1 : 0))
+ if (settings->priv->use_mobile_mode == mobile_mode)
return;
settings->priv->use_mobile_mode = mobile_mode;
@@ -1249,7 +1249,7 @@ camel_imapx_settings_set_use_idle (CamelIMAPXSettings *settings,
{
g_return_if_fail (CAMEL_IS_IMAPX_SETTINGS (settings));
- if ((settings->priv->use_idle ? 1 : 0) == (use_idle ? 1 : 0))
+ if (settings->priv->use_idle == use_idle)
return;
settings->priv->use_idle = use_idle;
@@ -1292,7 +1292,7 @@ camel_imapx_settings_set_use_namespace (CamelIMAPXSettings *settings,
{
g_return_if_fail (CAMEL_IS_IMAPX_SETTINGS (settings));
- if ((settings->priv->use_namespace ? 1 : 0) == (use_namespace ? 1 : 0))
+ if (settings->priv->use_namespace == use_namespace)
return;
settings->priv->use_namespace = use_namespace;
@@ -1337,7 +1337,7 @@ camel_imapx_settings_set_use_qresync (CamelIMAPXSettings *settings,
{
g_return_if_fail (CAMEL_IS_IMAPX_SETTINGS (settings));
- if ((settings->priv->use_qresync ? 1 : 0) == (use_qresync ? 1 : 0))
+ if (settings->priv->use_qresync == use_qresync)
return;
settings->priv->use_qresync = use_qresync;
@@ -1395,7 +1395,7 @@ camel_imapx_settings_set_use_shell_command (CamelIMAPXSettings *settings,
{
g_return_if_fail (CAMEL_IS_IMAPX_SETTINGS (settings));
- if ((settings->priv->use_shell_command ? 1 : 0) == (use_shell_command ? 1 : 0))
+ if (settings->priv->use_shell_command == use_shell_command)
return;
settings->priv->use_shell_command = use_shell_command;
@@ -1438,7 +1438,7 @@ camel_imapx_settings_set_use_subscriptions (CamelIMAPXSettings *settings,
{
g_return_if_fail (CAMEL_IS_IMAPX_SETTINGS (settings));
- if ((settings->priv->use_subscriptions ? 1 : 0) == (use_subscriptions ? 1 : 0))
+ if (settings->priv->use_subscriptions == use_subscriptions)
return;
settings->priv->use_subscriptions = use_subscriptions;
diff --git a/camel/camel-imapx-store-summary.c b/camel/camel-imapx-store-summary.c
index 6e8021c..96889fb 100644
--- a/camel/camel-imapx-store-summary.c
+++ b/camel/camel-imapx-store-summary.c
@@ -212,12 +212,12 @@ camel_imapx_store_summary_path_to_full (CamelIMAPXStoreSummary *s,
/* merge old path part if required */
f = full;
if (si) {
- full = g_strdup_printf("%s%s", camel_imapx_store_info_full_name(s, si), f);
+ full = g_strdup_printf ("%s%s", camel_imapx_store_info_full_name (s, si), f);
g_free (f);
camel_store_summary_info_free ((CamelStoreSummary *) s, si);
f = full;
} else if (ns) {
- full = g_strdup_printf("%s%s", ns->full_name, f);
+ full = g_strdup_printf ("%s%s", ns->full_name, f);
g_free (f);
f = full;
}
@@ -236,7 +236,7 @@ camel_imapx_store_summary_add_from_full (CamelIMAPXStoreSummary *s,
gchar *full_name;
CamelIMAPXStoreNamespace *ns;
- d("adding full name '%s' '%c'\n", full, dir_sep);
+ d ("adding full name '%s' '%c'\n", full, dir_sep);
len = strlen (full);
full_name = alloca (len + 1);
@@ -247,13 +247,13 @@ camel_imapx_store_summary_add_from_full (CamelIMAPXStoreSummary *s,
info = camel_imapx_store_summary_full_name (s, full_name);
if (info) {
camel_store_summary_info_free ((CamelStoreSummary *) s, (CamelStoreInfo *) info);
- d(" already there\n");
+ d (" already there\n");
return info;
}
ns = camel_imapx_store_summary_namespace_find_full (s, full_name);
if (ns) {
- d("(found namespace for '%s' ns '%s') ", full_name, ns->path);
+ d ("(found namespace for '%s' ns '%s') ", full_name, ns->path);
len = strlen (ns->full_name);
if (len >= strlen (full_name)) {
pathu8 = g_strdup (ns->path);
@@ -269,21 +269,21 @@ camel_imapx_store_summary_add_from_full (CamelIMAPXStoreSummary *s,
pathu8 = prefix;
}
}
- d(" (pathu8 = '%s')", pathu8);
+ d (" (pathu8 = '%s')", pathu8);
} else {
- d("(Cannot find namespace for '%s')\n", full_name);
+ d ("(Cannot find namespace for '%s')\n", full_name);
pathu8 = camel_imapx_store_summary_full_to_path (s, full_name, dir_sep);
}
info = (CamelIMAPXStoreInfo *) camel_store_summary_add_from_path ((CamelStoreSummary *) s, pathu8);
if (info) {
- d(" '%s' -> '%s'\n", pathu8, full_name);
+ d (" '%s' -> '%s'\n", pathu8, full_name);
camel_store_info_set_string ((CamelStoreSummary *) s, (CamelStoreInfo *) info, CAMEL_IMAPX_STORE_INFO_FULL_NAME, full_name);
- if (!g_ascii_strcasecmp(full_name, "inbox"))
+ if (!g_ascii_strcasecmp (full_name, "inbox"))
info->info.flags |= CAMEL_FOLDER_SYSTEM | CAMEL_FOLDER_TYPE_INBOX;
} else {
- d(" failed\n");
+ d (" failed\n");
}
g_free (pathu8);
@@ -304,7 +304,7 @@ camel_imapx_store_summary_full_from_path (CamelIMAPXStoreSummary *s,
if (ns)
name = camel_imapx_store_summary_path_to_full (s, path, ns->sep);
- d("looking up path %s -> %s\n", path, name?name:"not found");
+ d ("looking up path %s -> %s\n", path, name ? name:"not found");
return name;
}
@@ -341,7 +341,7 @@ camel_imapx_store_summary_namespace_new (CamelIMAPXStoreSummary *s,
void camel_imapx_store_summary_namespace_set (CamelIMAPXStoreSummary *s, CamelIMAPXStoreNamespace *ns)
{
- d("Setting namesapce to '%s' '%c' -> '%s'\n", ns->full_name, ns->sep, ns->path);
+ d ("Setting namesapce to '%s' '%c' -> '%s'\n", ns->full_name, ns->sep, ns->path);
/* CHEN not needed */
camel_store_summary_touch ((CamelStoreSummary *) s);
@@ -383,7 +383,7 @@ camel_imapx_store_summary_namespace_find_full (CamelIMAPXStoreSummary *s,
while (ns) {
if (ns->full_name)
len = strlen (ns->full_name);
- d("find_full: comparing namespace '%s' to name '%s'\n", ns->full_name, full);
+ d ("find_full: comparing namespace '%s' to name '%s'\n", ns->full_name, full);
if (len == 0
|| (strncmp (ns->full_name, full, len) == 0
&& (full[len] == ns->sep || full[len] == 0)))
@@ -523,7 +523,7 @@ summary_header_load (CamelStoreSummary *s,
is->version = version;
if (version < CAMEL_IMAPX_STORE_SUMMARY_VERSION_0) {
- g_warning("Store summary header version too low");
+ g_warning ("Store summary header version too low");
return -1;
}
@@ -575,7 +575,7 @@ store_info_load (CamelStoreSummary *s,
mi = NULL;
} else {
/* NB: this is done again for compatability */
- if (g_ascii_strcasecmp(mi->full_name, "inbox") == 0)
+ if (g_ascii_strcasecmp (mi->full_name, "inbox") == 0)
mi->info.flags |= CAMEL_FOLDER_SYSTEM | CAMEL_FOLDER_TYPE_INBOX;
}
}
@@ -649,7 +649,7 @@ store_info_set_string (CamelStoreSummary *s,
switch (type) {
case CAMEL_IMAPX_STORE_INFO_FULL_NAME:
- d("Set full name %s -> %s\n", isi->full_name, str);
+ d ("Set full name %s -> %s\n", isi->full_name, str);
camel_store_summary_lock (s, CAMEL_STORE_SUMMARY_SUMMARY_LOCK);
g_free (isi->full_name);
isi->full_name = g_strdup (str);
diff --git a/camel/camel-imapx-store.c b/camel/camel-imapx-store.c
index f482217..061eb32 100644
--- a/camel/camel-imapx-store.c
+++ b/camel/camel-imapx-store.c
@@ -76,8 +76,8 @@ G_DEFINE_TYPE_WITH_CODE (
static guint
imapx_name_hash (gconstpointer key)
{
- if (g_ascii_strcasecmp(key, "INBOX") == 0)
- return g_str_hash("INBOX");
+ if (g_ascii_strcasecmp (key, "INBOX") == 0)
+ return g_str_hash ("INBOX");
else
return g_str_hash (key);
}
@@ -88,9 +88,9 @@ imapx_name_equal (gconstpointer a,
{
gconstpointer aname = a, bname = b;
- if (g_ascii_strcasecmp(a, "INBOX") == 0)
+ if (g_ascii_strcasecmp (a, "INBOX") == 0)
aname = "INBOX";
- if (g_ascii_strcasecmp(b, "INBOX") == 0)
+ if (g_ascii_strcasecmp (b, "INBOX") == 0)
bname = "INBOX";
return g_str_equal (aname, bname);
}
@@ -430,7 +430,7 @@ folder_hash (gconstpointer ap)
{
const gchar *a = ap;
- if (g_ascii_strcasecmp(a, "INBOX") == 0)
+ if (g_ascii_strcasecmp (a, "INBOX") == 0)
a = "INBOX";
return g_str_hash (a);
@@ -443,9 +443,9 @@ folder_eq (gconstpointer ap,
const gchar *a = ap;
const gchar *b = bp;
- if (g_ascii_strcasecmp(a, "INBOX") == 0)
+ if (g_ascii_strcasecmp (a, "INBOX") == 0)
a = "INBOX";
- if (g_ascii_strcasecmp(b, "INBOX") == 0)
+ if (g_ascii_strcasecmp (b, "INBOX") == 0)
b = "INBOX";
return g_str_equal (a, b);
@@ -657,7 +657,7 @@ rename_folder_info (CamelIMAPXStore *istore,
path = camel_store_info_path (istore->summary, si);
if (strncmp (path, old_name, olen) == 0) {
if (strlen (path) > olen)
- npath = g_strdup_printf("%s/%s", new_name, path+olen+1);
+ npath = g_strdup_printf ("%s/%s", new_name, path + olen + 1);
else
npath = g_strdup (new_name);
nfull = camel_imapx_store_summary_path_to_full (istore->summary, npath, istore->dir_sep);
@@ -728,7 +728,7 @@ get_folder_info_offline (CamelStore *store,
name = g_strdup (imapx_store->summary->namespaces->personal->full_name);
top = imapx_store->summary->namespaces->personal->path;
} else
- name = g_strdup("");
+ name = g_strdup ("");
g_free (namespace);
} else {
@@ -737,7 +737,7 @@ get_folder_info_offline (CamelStore *store,
name = camel_imapx_store_summary_path_to_full (imapx_store->summary, top, imapx_store->dir_sep);
}
- pattern = imapx_concat(imapx_store, name, "*");
+ pattern = imapx_concat (imapx_store, name, "*");
/* folder_info_build will insert parent nodes as necessary and mark
* them as noselect, which is information we actually don't have at
@@ -780,7 +780,7 @@ get_folder_info_offline (CamelStore *store,
fi->flags = (fi->flags & ~CAMEL_FOLDER_NOINFERIORS) | CAMEL_FOLDER_NOCHILDREN;
/* blah, this gets lost somewhere, i can't be bothered finding out why */
- if (!g_ascii_strcasecmp(fi->full_name, "inbox")) {
+ if (!g_ascii_strcasecmp (fi->full_name, "inbox")) {
fi->flags = (fi->flags & ~CAMEL_FOLDER_TYPE_MASK) | CAMEL_FOLDER_TYPE_INBOX;
fi->flags |= CAMEL_FOLDER_SYSTEM;
}
@@ -846,7 +846,7 @@ add_folders_to_summary (CamelIMAPXStore *istore,
fi = camel_folder_info_new ();
fi->full_name = g_strdup (camel_store_info_path (istore->summary, si));
- if (!g_ascii_strcasecmp(fi->full_name, "inbox")) {
+ if (!g_ascii_strcasecmp (fi->full_name, "inbox")) {
li->flags |= CAMEL_FOLDER_SYSTEM | CAMEL_FOLDER_TYPE_INBOX;
fi->display_name = g_strdup (_("Inbox"));
} else
@@ -1107,7 +1107,7 @@ discover_inbox (CamelStore *store,
CamelStoreInfo *si;
CamelIMAPXStore *istore = (CamelIMAPXStore *) store;
- si = camel_store_summary_path((CamelStoreSummary *) istore->summary, "INBOX");
+ si = camel_store_summary_path ((CamelStoreSummary *) istore->summary, "INBOX");
if (si == NULL || (si->flags & CAMEL_FOLDER_SUBSCRIBED) == 0) {
if (imapx_subscribe_folder (store, "INBOX", FALSE, cancellable, NULL) && !si)
sync_folders (istore, "INBOX", TRUE, cancellable, NULL);
@@ -1526,7 +1526,7 @@ imapx_store_rename_folder_sync (CamelStore *store,
/* Use INBOX connection as the implementation would try to select inbox to ensure
* we are not selected on the folder being renamed */
- server = camel_imapx_store_get_server(istore, "INBOX", cancellable, error);
+ server = camel_imapx_store_get_server (istore, "INBOX", cancellable, error);
if (server) {
success = camel_imapx_server_rename_folder (
server, old, new, cancellable, error);
diff --git a/camel/camel-imapx-stream.c b/camel/camel-imapx-stream.c
index 449fb10..d7e20a4 100644
--- a/camel/camel-imapx-stream.c
+++ b/camel/camel-imapx-stream.c
@@ -59,10 +59,10 @@ imapx_stream_fill (CamelIMAPXStream *is,
cancellable, error);
if (left > 0) {
is->end += left;
- io(is->tagprefix, "camel_imapx_read: buffer is '%.*s'\n", (gint)(is->end - is->ptr), is->ptr);
+ io (is->tagprefix, "camel_imapx_read: buffer is '%.*s'\n", (gint)(is->end - is->ptr), is->ptr);
return is->end - is->ptr;
} else {
- io(is->tagprefix, "camel_imapx_read: -1\n");
+ io (is->tagprefix, "camel_imapx_read: -1\n");
/* If returning zero, camel_stream_read() doesn't consider
* that to be an error. But we do -- we should only be here
* if we *know* there are data to receive. So set the error
@@ -74,7 +74,7 @@ imapx_stream_fill (CamelIMAPXStream *is,
}
}
- io(is->tagprefix, "camel_imapx_read: -1\n");
+ io (is->tagprefix, "camel_imapx_read: -1\n");
g_set_error (
error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
@@ -135,7 +135,7 @@ imapx_stream_read (CamelStream *stream,
return max;
}
- io(is->tagprefix, "camel_imapx_read(literal): '%.*s'\n", (gint)max, buffer);
+ io (is->tagprefix, "camel_imapx_read(literal): '%.*s'\n", (gint) max, buffer);
is->literal -= max;
@@ -152,9 +152,9 @@ imapx_stream_write (CamelStream *stream,
CamelIMAPXStream *is = (CamelIMAPXStream *) stream;
if (g_strstr_len (buffer, n, "LOGIN")) {
- io(is->tagprefix, "camel_imapx_write: 'LOGIN...'\n");
+ io (is->tagprefix, "camel_imapx_write: 'LOGIN...'\n");
} else {
- io(is->tagprefix, "camel_imapx_write: '%.*s'\n", (gint)n, buffer);
+ io (is->tagprefix, "camel_imapx_write: '%.*s'\n", (gint) n, buffer);
}
return camel_stream_write (is->source, buffer, n, cancellable, error);
@@ -222,7 +222,7 @@ static void camel_imapx_stream_grow (CamelIMAPXStream *is, guint len, guchar **b
is->bufsize <<= 1;
} while (is->bufsize <= len);
- io(is->tagprefix, "Grow imapx buffers to %d bytes\n", is->bufsize);
+ io (is->tagprefix, "Grow imapx buffers to %d bytes\n", is->bufsize);
is->tokenbuf = g_realloc (is->tokenbuf, is->bufsize + 1);
if (tokptr)
@@ -230,11 +230,11 @@ static void camel_imapx_stream_grow (CamelIMAPXStream *is, guint len, guchar **b
if (is->unget)
is->unget_token = is->tokenbuf + (is->unget_token - oldtok);
- //io(is->tagprefix, "buf was %p, ptr %p end %p\n", is->buf, is->ptr, is->end);
+ //io (is->tagprefix, "buf was %p, ptr %p end %p\n", is->buf, is->ptr, is->end);
is->buf = g_realloc (is->buf, is->bufsize + 1);
is->ptr = is->buf + (is->ptr - oldbuf);
is->end = is->buf + (is->end - oldbuf);
- //io(is->tagprefix, "buf now %p, ptr %p end %p\n", is->buf, is->ptr, is->end);
+ //io (is->tagprefix, "buf now %p, ptr %p end %p\n", is->buf, is->ptr, is->end);
if (bufptr)
*bufptr = is->buf + (*bufptr - oldbuf);
}
@@ -338,7 +338,7 @@ camel_imapx_stream_atom (CamelIMAPXStream *is,
g_set_error (error, CAMEL_IMAPX_ERROR, 1, "expecting atom");
else
g_propagate_error (error, local_error);
- io(is->tagprefix, "expecting atom!\n");
+ io (is->tagprefix, "expecting atom!\n");
return IMAPX_TOK_PROTOCOL;
}
}
@@ -385,7 +385,7 @@ camel_imapx_stream_astring (CamelIMAPXStream *is,
g_set_error (error, CAMEL_IMAPX_ERROR, 1, "expecting astring");
else
g_propagate_error (error, local_error);
- io(is->tagprefix, "expecting astring!\n");
+ io (is->tagprefix, "expecting astring!\n");
return IMAPX_TOK_PROTOCOL;
}
}
@@ -531,7 +531,7 @@ camel_imapx_stream_text (CamelIMAPXStream *is,
case IMAPX_TOK_STRING:
case IMAPX_TOK_INT:
g_byte_array_append (build, (guint8 *) is->unget_token, is->unget_len);
- g_byte_array_append(build, (guint8 *) " ", 1);
+ g_byte_array_append (build, (guint8 *) " ", 1);
default: /* invalid, but we'll ignore */
break;
}
@@ -549,7 +549,7 @@ camel_imapx_stream_text (CamelIMAPXStream *is,
g_byte_array_append (build, token, len);
} while (tok > 0);
- g_byte_array_append(build, (guint8 *) "", 1);
+ g_byte_array_append (build, (guint8 *) "", 1);
*text = build->data;
g_byte_array_free (build, FALSE);
@@ -579,7 +579,7 @@ camel_imapx_stream_token (CamelIMAPXStream *is,
}
if (is->literal > 0)
- g_warning("stream_token called with literal %d", is->literal);
+ g_warning ("stream_token called with literal %d", is->literal);
p = is->ptr;
e = is->end;
@@ -599,7 +599,7 @@ camel_imapx_stream_token (CamelIMAPXStream *is,
/*strchr("\n*()[]+", c)*/
if (imapx_is_token_char (c)) {
is->ptr = p;
- t(is->tagprefix, "token '%c'\n", c);
+ t (is->tagprefix, "token '%c'\n", c);
return c;
} else if (c == '{') {
literal = 0;
@@ -617,7 +617,7 @@ camel_imapx_stream_token (CamelIMAPXStream *is,
*len = literal;
is->ptr = p;
is->literal = literal;
- t(is->tagprefix, "token LITERAL %d\n", literal);
+ t (is->tagprefix, "token LITERAL %d\n", literal);
return IMAPX_TOK_LITERAL;
}
}
@@ -629,9 +629,9 @@ camel_imapx_stream_token (CamelIMAPXStream *is,
}
} else {
if (isdigit (c)) {
- io(is->tagprefix, "Protocol error: literal too big\n");
+ io (is->tagprefix, "Protocol error: literal too big\n");
} else {
- io(is->tagprefix, "Protocol error: literal contains invalid gchar %02x '%c'\n", c, isprint(c)?c:c);
+ io (is->tagprefix, "Protocol error: literal contains invalid gchar %02x '%c'\n", c, isprint (c) ? c : c);
}
goto protocol_error;
}
@@ -662,11 +662,11 @@ camel_imapx_stream_token (CamelIMAPXStream *is,
*o = 0;
*data = is->tokenbuf;
*len = o - is->tokenbuf;
- t(is->tagprefix, "token STRING '%s'\n", is->tokenbuf);
+ t (is->tagprefix, "token STRING '%s'\n", is->tokenbuf);
return IMAPX_TOK_STRING;
}
if (c == '\n' || c == '\r') {
- io(is->tagprefix, "Protocol error: truncated string\n");
+ io (is->tagprefix, "Protocol error: truncated string\n");
goto protocol_error;
}
if (o >= oe) {
@@ -699,7 +699,7 @@ camel_imapx_stream_token (CamelIMAPXStream *is,
*o = 0;
*data = is->tokenbuf;
*len = o - is->tokenbuf;
- t(is->tagprefix, "token TOKEN '%s'\n", is->tokenbuf);
+ t (is->tagprefix, "token TOKEN '%s'\n", is->tokenbuf);
return digits ? IMAPX_TOK_INT : IMAPX_TOK_TOKEN;
}
@@ -721,7 +721,7 @@ camel_imapx_stream_token (CamelIMAPXStream *is,
/* Protocol error, skip until next lf? */
protocol_error:
- io(is->tagprefix, "Got protocol error\n");
+ io (is->tagprefix, "Got protocol error\n");
if (c == '\n')
is->ptr = p - 1;
@@ -829,7 +829,7 @@ camel_imapx_stream_skip (CamelIMAPXStream *is,
if (tok == IMAPX_TOK_LITERAL) {
camel_imapx_stream_set_literal (is, len);
while ((tok = camel_imapx_stream_getl (is, &token, &len, cancellable, error)) > 0) {
- io(is->tagprefix, "Skip literal data '%.*s'\n", (gint)len, token);
+ io (is->tagprefix, "Skip literal data '%.*s'\n", (gint) len, token);
}
}
} while (tok != '\n' && tok >= 0);
diff --git a/camel/camel-imapx-summary.c b/camel/camel-imapx-summary.c
index 9552e61..ee2530d 100644
--- a/camel/camel-imapx-summary.c
+++ b/camel/camel-imapx-summary.c
@@ -144,7 +144,7 @@ camel_imapx_summary_new (CamelFolder *folder)
/* Don't do DB sort. Its pretty slow to load */
if (folder && 0) {
- camel_db_set_collate (parent_store->cdb_r, "uid", "imapx_uid_sort", (CamelDBCollate)sort_uid_cmp);
+ camel_db_set_collate (parent_store->cdb_r, "uid", "imapx_uid_sort", (CamelDBCollate) sort_uid_cmp);
summary->sort_by = "uid";
summary->collate = "imapx_uid_sort";
}
@@ -188,7 +188,7 @@ summary_header_from_db (CamelFolderSummary *s,
}
if (ims->version > CAMEL_IMAPX_SUMMARY_VERSION) {
- g_warning("Unknown summary version\n");
+ g_warning ("Unknown summary version\n");
errno = EINVAL;
return FALSE;
}
@@ -314,12 +314,12 @@ content_info_to_db (CamelFolderSummary *s,
if (info->type) {
oldr = mir->cinfo;
- mir->cinfo = oldr ? g_strdup_printf("%s 1", oldr) : g_strdup ("1");
+ mir->cinfo = oldr ? g_strdup_printf ("%s 1", oldr) : g_strdup ("1");
g_free (oldr);
return folder_summary_class->content_info_to_db (s, info, mir);
} else {
oldr = mir->cinfo;
- mir->cinfo = oldr ? g_strdup_printf("%s 0", oldr) : g_strdup ("0");
+ mir->cinfo = oldr ? g_strdup_printf ("%s 0", oldr) : g_strdup ("0");
g_free (oldr);
return TRUE;
}
diff --git a/camel/camel-imapx-utils.c b/camel/camel-imapx-utils.c
index 408f760..ec56289 100644
--- a/camel/camel-imapx-utils.c
+++ b/camel/camel-imapx-utils.c
@@ -39,13 +39,13 @@ extern gint camel_verbose_debug;
#define debug_set_flag(flag) do { \
if ((CAMEL_IMAPX_DEBUG_ALL & CAMEL_IMAPX_DEBUG_ ## flag) && \
- camel_debug("imapx:" #flag)) \
+ camel_debug ("imapx:" #flag)) \
camel_imapx_debug_flags |= CAMEL_IMAPX_DEBUG_ ## flag; \
} while (0)
static void camel_imapx_set_debug_flags (void)
{
- if (camel_verbose_debug || camel_debug("imapx")) {
+ if (camel_verbose_debug || camel_debug ("imapx")) {
camel_imapx_debug_flags = CAMEL_IMAPX_DEBUG_ALL;
return;
}
@@ -389,14 +389,14 @@ create_initial_capabilities_table (void)
* to free hash table
*/
capa_htable = g_hash_table_new_full (g_str_hash,
- g_str_equal,
- g_free,
- NULL);
+ g_str_equal,
+ g_free,
+ NULL);
for (i = 0; i < G_N_ELEMENTS (capa_table); i++) {
g_hash_table_insert (capa_htable,
- g_strdup (capa_table[i].name),
- GUINT_TO_POINTER (capa_table[i].flag));
+ g_strdup (capa_table[i].name),
+ GUINT_TO_POINTER (capa_table[i].flag));
}
}
@@ -425,7 +425,7 @@ imapx_parse_capability (CamelIMAPXStream *stream,
camel_imapx_stream_ungettoken (stream, tok, token, len);
return cinfo;
case 43:
- token = (guchar *) g_strconcat ((gchar *)token, "+", NULL);
+ token = (guchar *) g_strconcat ((gchar *) token, "+", NULL);
free_token = TRUE;
case IMAPX_TOK_TOKEN:
case IMAPX_TOK_STRING:
@@ -439,10 +439,10 @@ imapx_parse_capability (CamelIMAPXStream *stream,
break;
}
case IMAPX_TOK_INT:
- d(stream->tagprefix, " cap: '%s'\n", token);
+ d (stream->tagprefix, " cap: '%s'\n", token);
g_mutex_lock (&capa_htable_lock);
pp = g_hash_table_lookup (capa_htable,
- (gchar*) token);
+ (gchar *) token);
g_mutex_unlock (&capa_htable_lock);
if (pp != NULL) {
guint32 capa_id = GPOINTER_TO_UINT (pp);
@@ -492,7 +492,7 @@ imapx_register_capability (const gchar *capability)
* invalid value
*/
capa_id = GPOINTER_TO_UINT (g_hash_table_lookup (capa_htable,
- capability));
+ capability));
if (capa_id > 0)
goto exit;
@@ -514,8 +514,8 @@ imapx_register_capability (const gchar *capability)
/* insert */
g_hash_table_insert (capa_htable,
- g_strdup (capability),
- GUINT_TO_POINTER (capa_id));
+ g_strdup (capability),
+ GUINT_TO_POINTER (capa_id));
exit:
g_mutex_unlock (&capa_htable_lock);
@@ -780,7 +780,7 @@ imapx_parse_param_list (CamelIMAPXStream *is,
guchar *token;
gchar *param;
- p(is->tagprefix, "body_fld_param\n");
+ p (is->tagprefix, "body_fld_param\n");
/* body_fld_param ::= "(" 1#(string SPACE string) ")" / nil */
tok = camel_imapx_stream_token (is, &token, &len, cancellable, NULL);
@@ -841,14 +841,14 @@ imapx_parse_ext_optional (CamelIMAPXStream *is,
dinfo->disposition = g_strdup ((gchar *) token);
imapx_parse_param_list (is, &dinfo->params, cancellable, NULL);
case IMAPX_TOK_TOKEN:
- d(is->tagprefix, "body_fld_dsp: NIL\n");
+ d (is->tagprefix, "body_fld_dsp: NIL\n");
break;
default:
g_set_error (error, CAMEL_IMAPX_ERROR, 1, "body_fld_disp: expecting nil or list");
return NULL;
}
- p(is->tagprefix, "body_fld_lang\n");
+ p (is->tagprefix, "body_fld_lang\n");
/* body_fld_lang ::= nstring / "(" 1#string ")" */
@@ -869,7 +869,7 @@ imapx_parse_ext_optional (CamelIMAPXStream *is,
}
break;
case IMAPX_TOK_TOKEN:
- d(is->tagprefix, "body_fld_lang = nil\n");
+ d (is->tagprefix, "body_fld_lang = nil\n");
/* treat as 'nil' */
break;
case IMAPX_TOK_STRING:
@@ -879,7 +879,7 @@ imapx_parse_ext_optional (CamelIMAPXStream *is,
/* we have a literal string */
camel_imapx_stream_set_literal (is, len);
while (camel_imapx_stream_getl (is, &token, &len, cancellable, NULL) > 0) {
- d(is->tagprefix, "Skip literal data '%.*s'\n", (gint)len, token);
+ d (is->tagprefix, "Skip literal data '%.*s'\n", (gint) len, token);
}
break;
@@ -909,7 +909,7 @@ imapx_parse_body_fields (CamelIMAPXStream *is,
* body_fld_desc SPACE body_fld_enc SPACE
* body_fld_octets */
- p(is->tagprefix, "body_fields\n");
+ p (is->tagprefix, "body_fields\n");
cinfo = g_malloc0 (sizeof (*cinfo));
@@ -1006,7 +1006,7 @@ imapx_parse_address_list (CamelIMAPXStream *is,
if (mbox == NULL) {
group = NULL;
} else {
- d(is->tagprefix, "adding group '%s'\n", mbox);
+ d (is->tagprefix, "adding group '%s'\n", mbox);
g_free (addr->name);
addr->name = mbox;
addr->type = CAMEL_HEADER_ADDRESS_GROUP;
@@ -1016,7 +1016,7 @@ imapx_parse_address_list (CamelIMAPXStream *is,
} else {
addr->v.addr = g_strdup_printf ("%s %s", mbox? mbox :"", (const gchar *) host);
g_free (mbox);
- d(is->tagprefix, "adding address '%s'\n", addr->v.addr);
+ d (is->tagprefix, "adding address '%s'\n", addr->v.addr);
if (group != NULL)
camel_header_address_add_member (group, addr);
else
@@ -1027,7 +1027,7 @@ imapx_parse_address_list (CamelIMAPXStream *is,
} while (tok != ')');
}
} else {
- d(is->tagprefix, "empty, nil '%s'\n", token);
+ d (is->tagprefix, "empty, nil '%s'\n", token);
}
/* CHEN TODO handle exception at required places */
@@ -1055,7 +1055,7 @@ imapx_parse_envelope (CamelIMAPXStream *is,
* SPACE env_cc SPACE env_bcc SPACE env_in_reply_to
* SPACE env_message_id ")" */
- p(is->tagprefix, "envelope\n");
+ p (is->tagprefix, "envelope\n");
minfo = (CamelMessageInfoBase *) camel_message_info_new (NULL);
@@ -1170,7 +1170,7 @@ imapx_parse_body (CamelIMAPXStream *is,
/* body ::= "(" body_type_1part / body_type_mpart ")" */
- p(is->tagprefix, "body\n");
+ p (is->tagprefix, "body\n");
tok = camel_imapx_stream_token (is, &token, &len, cancellable, &local_error);
if (tok != '(') {
@@ -1196,10 +1196,10 @@ imapx_parse_body (CamelIMAPXStream *is,
camel_imapx_stream_ungettoken (is, tok, token, len);
} while (tok == '(');
- d(is->tagprefix, "media_subtype\n");
+ d (is->tagprefix, "media_subtype\n");
camel_imapx_stream_astring (is, &token, cancellable, &local_error);
- cinfo->type = camel_content_type_new("multipart", (gchar *) token);
+ cinfo->type = camel_content_type_new ("multipart", (gchar *) token);
/* body_ext_mpart ::= body_fld_param
* [SPACE body_fld_dsp SPACE body_fld_lang
@@ -1207,7 +1207,7 @@ imapx_parse_body (CamelIMAPXStream *is,
* ;; MUST NOT be returned on non-extensible
* ;; "BODY" fetch */
- d(is->tagprefix, "body_ext_mpart\n");
+ d (is->tagprefix, "body_ext_mpart\n");
tok = camel_imapx_stream_token (is, &token, &len, cancellable, &local_error);
camel_imapx_stream_ungettoken (is, tok, token, len);
@@ -1234,11 +1234,11 @@ imapx_parse_body (CamelIMAPXStream *is,
* body_type_msg ::= media_message SPACE body_fields SPACE envelope
* SPACE body SPACE body_fld_lines */
- d(is->tagprefix, "Single part body\n");
+ d (is->tagprefix, "Single part body\n");
cinfo = imapx_parse_body_fields (is, cancellable, &local_error);
- d(is->tagprefix, "envelope?\n");
+ d (is->tagprefix, "envelope?\n");
/* do we have an envelope following */
tok = camel_imapx_stream_token (is, &token, &len, cancellable, &local_error);
@@ -1252,15 +1252,15 @@ imapx_parse_body (CamelIMAPXStream *is,
//((CamelMessageInfoBase *) minfo)->content = imapx_parse_body (is);
camel_message_info_free (minfo);
minfo = NULL;
- d(is->tagprefix, "Scanned envelope - what do i do with it?\n");
+ d (is->tagprefix, "Scanned envelope - what do i do with it?\n");
}
- d(is->tagprefix, "fld_lines?\n");
+ d (is->tagprefix, "fld_lines?\n");
/* do we have fld_lines following? */
tok = camel_imapx_stream_token (is, &token, &len, cancellable, &local_error);
if (tok == IMAPX_TOK_INT) {
- d(is->tagprefix, "field lines: %s\n", token);
+ d (is->tagprefix, "field lines: %s\n", token);
tok = camel_imapx_stream_token (is, &token, &len, cancellable, &local_error);
}
camel_imapx_stream_ungettoken (is, tok, token, len);
@@ -1271,12 +1271,12 @@ imapx_parse_body (CamelIMAPXStream *is,
* ;; MUST NOT be returned on non - extensible
* ;; "BODY" fetch */
- d(is->tagprefix, "extension data?\n");
+ d (is->tagprefix, "extension data?\n");
if (tok != ')') {
camel_imapx_stream_nstring (is, &token, cancellable, &local_error);
- d(is->tagprefix, "md5: %s\n", token?(gchar *)token:"NIL");
+ d (is->tagprefix, "md5: %s\n", token ? (gchar *) token:"NIL");
/* body_fld_dsp ::= "(" string SPACE body_fld_param ")" / nil */
@@ -1294,7 +1294,7 @@ imapx_parse_body (CamelIMAPXStream *is,
do {
tok = camel_imapx_stream_token (is, &token, &len, cancellable, &local_error);
if (tok != ')') {
- d(is->tagprefix, "Dropping extension data '%s'\n", token);
+ d (is->tagprefix, "Dropping extension data '%s'\n", token);
}
} while (tok != ')');
@@ -1346,7 +1346,7 @@ imapx_parse_section (CamelIMAPXStream *is,
if (tok == IMAPX_TOK_INT || tok == IMAPX_TOK_TOKEN)
section = g_strdup ((gchar *) token);
else if (tok == ']') {
- section = g_strdup("");
+ section = g_strdup ("");
camel_imapx_stream_ungettoken (is, tok, token, len);
} else {
g_set_error (error, CAMEL_IMAPX_ERROR, 1, "section: expecting token");
@@ -1439,9 +1439,9 @@ imapx_dump_fetch (struct _fetch_info *finfo)
gchar *string;
gint fd;
- d('?', "Fetch info:\n");
+ d ('?', "Fetch info:\n");
if (finfo == NULL) {
- d('?', "Empty\n");
+ d ('?', "Empty\n");
return;
}
@@ -1711,8 +1711,8 @@ imapx_parse_uids (CamelIMAPXStream *is,
str_len = g_strv_length (splits);
for (i = 0; i < str_len; i++) {
- if (g_strstr_len (splits [i], -1, ":")) {
- gchar **seq = g_strsplit (splits [i], ":", -1);
+ if (g_strstr_len (splits[i], -1, ":")) {
+ gchar **seq = g_strsplit (splits[i], ":", -1);
guint32 uid1 = strtoul ((gchar *) seq[0], NULL, 10);
guint32 uid2 = strtoul ((gchar *) seq[1], NULL, 10);
@@ -1820,7 +1820,7 @@ imapx_parse_status (CamelIMAPXStream *is,
break;
default:
sinfo->condition = IMAPX_UNKNOWN;
- d(is->tagprefix, "Got unknown response code: %s: ignored\n", token);
+ d (is->tagprefix, "Got unknown response code: %s: ignored\n", token);
}
/* ignore anything we dont know about */
@@ -1959,7 +1959,7 @@ imapx_list_get_path (struct _list_info *li)
if (c == li->separator)
*p++ = '/';
else if (c == '/' || c == '%')
- p += sprintf(p, "%%%02X", c);
+ p += sprintf (p, "%%%02X", c);
else
*p++ = c;
}
@@ -2110,7 +2110,7 @@ imapx_path_to_physical (const gchar *prefix,
p = vpath;
while ((c = *p++)) {
if (c == '/') {
- g_string_append(out, "/" SUBFOLDER_DIR_NAME "/");
+ g_string_append (out, "/" SUBFOLDER_DIR_NAME "/");
while (*p == '/')
p++;
} else
diff --git a/camel/camel-index-control.c b/camel/camel-index-control.c
index 5933f78..df75daa 100644
--- a/camel/camel-index-control.c
+++ b/camel/camel-index-control.c
@@ -23,10 +23,10 @@ extern gint camel_init (const gchar *certdb_dir, gboolean nss_init);
G_GNUC_NORETURN static void
do_usage (gchar *argv0)
{
- fprintf(stderr, "Usage: %s [ compress | dump | info ] file(s) ...\n", argv0);
- fprintf(stderr, " compress - compress (an) index file(s)\n");
- fprintf(stderr, " dump - dump (an) index file's content to stdout\n");
- fprintf(stderr, " info - dump summary info to stdout\n");
+ fprintf (stderr, "Usage: %s [ compress | dump | info ] file(s) ...\n", argv0);
+ fprintf (stderr, " compress - compress (an) index file(s)\n");
+ fprintf (stderr, " dump - dump (an) index file's content to stdout\n");
+ fprintf (stderr, " info - dump summary info to stdout\n");
exit (1);
}
@@ -38,17 +38,17 @@ do_compress (gint argc,
CamelIndex *idx;
for (i = 2; i < argc; i++) {
- printf("Opening index file: %s\n", argv[i]);
+ printf ("Opening index file: %s\n", argv[i]);
idx = (CamelIndex *) camel_text_index_new (argv[i], O_RDWR);
if (idx) {
- printf(" Compressing ...\n");
+ printf (" Compressing ...\n");
if (camel_index_compress (idx) == -1) {
g_object_unref (idx);
return 1;
}
g_object_unref (idx);
} else {
- printf(" Failed: %s\n", g_strerror (errno));
+ printf (" Failed: %s\n", g_strerror (errno));
return 1;
}
}
@@ -63,14 +63,14 @@ do_dump (gint argc,
CamelIndex *idx;
for (i = 2; i < argc; i++) {
- printf("Opening index file: %s\n", argv[i]);
+ printf ("Opening index file: %s\n", argv[i]);
idx = (CamelIndex *) camel_text_index_new (argv[i], O_RDONLY);
if (idx) {
- printf(" Dumping ...\n");
+ printf (" Dumping ...\n");
camel_text_index_dump ((CamelTextIndex *) idx);
g_object_unref (idx);
} else {
- printf(" Failed: %s\n", g_strerror (errno));
+ printf (" Failed: %s\n", g_strerror (errno));
return 1;
}
}
@@ -85,13 +85,13 @@ do_info (gint argc,
CamelIndex *idx;
for (i = 2; i < argc; i++) {
- printf("Opening index file: %s\n", argv[i]);
+ printf ("Opening index file: %s\n", argv[i]);
idx = (CamelIndex *) camel_text_index_new (argv[i], O_RDONLY);
if (idx) {
camel_text_index_info ((CamelTextIndex *) idx);
g_object_unref (idx);
} else {
- printf(" Failed: %s\n", g_strerror (errno));
+ printf (" Failed: %s\n", g_strerror (errno));
return 0;
}
}
@@ -106,13 +106,13 @@ do_check (gint argc,
CamelIndex *idx;
for (i = 2; i < argc; i++) {
- printf("Opening index file: %s\n", argv[i]);
+ printf ("Opening index file: %s\n", argv[i]);
idx = (CamelIndex *) camel_text_index_new (argv[i], O_RDONLY);
if (idx) {
camel_text_index_validate ((CamelTextIndex *) idx);
g_object_unref (idx);
} else {
- printf(" Failed: %s\n", g_strerror (errno));
+ printf (" Failed: %s\n", g_strerror (errno));
return 0;
}
}
@@ -128,15 +128,15 @@ gint main (gint argc, gchar **argv)
camel_init (NULL, 0);
- if (!strcmp(argv[1], "compress"))
+ if (!strcmp (argv[1], "compress"))
return do_compress (argc, argv);
- else if (!strcmp(argv[1], "dump"))
+ else if (!strcmp (argv[1], "dump"))
return do_dump (argc, argv);
- else if (!strcmp(argv[1], "info"))
+ else if (!strcmp (argv[1], "info"))
return do_info (argc, argv);
- else if (!strcmp(argv[1], "check"))
+ else if (!strcmp (argv[1], "check"))
return do_check (argc, argv);
- else if (!strcmp(argv[1], "perf"))
+ else if (!strcmp (argv[1], "perf"))
return do_perf (argc, argv);
do_usage (argv[0]);
@@ -164,14 +164,14 @@ do_perf (gint argc,
dir = opendir (path);
if (dir == NULL) {
- perror("open dir");
+ perror ("open dir");
return 1;
}
idx = (CamelIndex *) camel_text_index_new (
- "/tmp/index", O_TRUNC|O_CREAT|O_RDWR);
+ "/tmp/index", O_TRUNC | O_CREAT | O_RDWR);
if (idx == NULL) {
- perror("open index");
+ perror ("open index");
closedir (dir);
return 1;
}
@@ -183,12 +183,12 @@ do_perf (gint argc,
camel_stream_filter_add ((CamelStreamFilter *) filter, filter_index);
while ((d = readdir (dir))) {
- printf("indexing '%s'\n", d->d_name);
+ printf ("indexing '%s'\n", d->d_name);
idn = camel_index_add_name (idx, d->d_name);
camel_mime_filter_index_set_name (
CAMEL_MIME_FILTER_INDEX (filter_index), idn);
- name = g_strdup_printf("%s/%s", path, d->d_name);
+ name = g_strdup_printf ("%s/%s", path, d->d_name);
stream = camel_stream_fs_new_with_name (name, O_RDONLY, 0, NULL);
camel_stream_write_to_stream (stream, filter, NULL, NULL);
g_object_unref (stream);
diff --git a/camel/camel-internet-address.c b/camel/camel-internet-address.c
index 3d02d0a..39307ea 100644
--- a/camel/camel-internet-address.c
+++ b/camel/camel-internet-address.c
@@ -75,14 +75,14 @@ internet_address_encode (CamelAddress *a)
if (a->addresses->len == 0)
return NULL;
- out = g_string_new("");
+ out = g_string_new ("");
for (i = 0; i < a->addresses->len; i++) {
struct _address *addr = g_ptr_array_index (a->addresses, i);
gchar *enc;
if (i != 0)
- g_string_append(out, ", ");
+ g_string_append (out, ", ");
enc = camel_internet_address_encode_address (&len, addr->name, addr->address);
g_string_append (out, enc);
@@ -106,7 +106,7 @@ internet_address_unformat (CamelAddress *a,
if (raw == NULL)
return 0;
- d(printf("unformatting address: %s\n", raw));
+ d (printf ("unformatting address: %s\n", raw));
/* we copy, so we can modify as we go */
buffer = g_strdup (raw);
@@ -148,7 +148,7 @@ internet_address_unformat (CamelAddress *a,
name = g_strstrip (name);
addr = g_strstrip (addr);
if (addr[0]) {
- d(printf("found address: '%s' <%s>\n", name, addr));
+ d (printf ("found address: '%s' <%s>\n", name, addr));
camel_internet_address_add ((CamelInternetAddress *) a, name, addr);
}
name = NULL;
@@ -172,14 +172,14 @@ internet_address_format (CamelAddress *a)
if (a->addresses->len == 0)
return NULL;
- out = g_string_new("");
+ out = g_string_new ("");
for (i = 0; i < a->addresses->len; i++) {
struct _address *addr = g_ptr_array_index (a->addresses, i);
gchar *enc;
if (i != 0)
- g_string_append(out, ", ");
+ g_string_append (out, ", ");
enc = camel_internet_address_format_address (addr->name, addr->address);
g_string_append (out, enc);
@@ -442,7 +442,7 @@ camel_internet_address_encode_address (gint *inlen,
gchar *name = camel_header_encode_phrase ((const guchar *) real);
gchar *ret = NULL;
gint len = 0;
- GString *out = g_string_new("");
+ GString *out = g_string_new ("");
g_assert (addr);
@@ -472,17 +472,17 @@ camel_internet_address_encode_address (gint *inlen,
* that will probably not handle this case, we will just move
* the whole address to its own line. */
if (inlen != NULL && (strlen (addr) + len) > CAMEL_FOLD_SIZE) {
- g_string_append(out, "\n\t");
+ g_string_append (out, "\n\t");
len = 1;
}
len -= out->len;
if (name && name[0])
- g_string_append_printf(out, " <");
+ g_string_append_printf (out, " <");
cia_encode_addrspec (out, addr);
if (name && name[0])
- g_string_append_printf(out, ">");
+ g_string_append_printf (out, ">");
len += out->len;
@@ -527,12 +527,12 @@ camel_internet_address_format_address (const gchar *name,
if (c != '\"')
*o++ = c;
*o++ = '\"';
- sprintf(o, " <%s>", addr);
- d(printf("encoded '%s' => '%s'\n", name, ret));
+ sprintf (o, " <%s>", addr);
+ d (printf ("encoded '%s' => '%s'\n", name, ret));
return ret;
}
}
- ret = g_strdup_printf("%s <%s>", name, addr);
+ ret = g_strdup_printf ("%s <%s>", name, addr);
} else
ret = g_strdup (addr);
diff --git a/camel/camel-lock-client.c b/camel/camel-lock-client.c
index 07c230f..88aacb6 100644
--- a/camel/camel-lock-client.c
+++ b/camel/camel-lock-client.c
@@ -141,7 +141,7 @@ lock_helper_init (GError **error)
close (lock_stdout_pipe[1]);
for (i = 3; i < 255; i++)
close (i);
- execl(CAMEL_LIBEXECDIR "/camel-lock-helper-" API_VERSION, "camel-lock-helper", NULL);
+ execl (CAMEL_LIBEXECDIR "/camel-lock-helper-" API_VERSION, "camel-lock-helper", NULL);
/* it'll pick this up when it tries to use us */
exit (255);
default:
@@ -204,7 +204,7 @@ again:
if (msg->magic != CAMEL_LOCK_HELPER_RETURN_MAGIC
|| msg->seq > lock_sequence) {
res = CAMEL_LOCK_HELPER_STATUS_PROTOCOL;
- d(printf("lock child protocol error\n"));
+ d (printf ("lock child protocol error\n"));
g_set_error (
error, CAMEL_ERROR,
CAMEL_ERROR_GENERIC,
@@ -217,7 +217,7 @@ again:
if (msg->seq == lock_sequence) {
switch (msg->id) {
case CAMEL_LOCK_HELPER_STATUS_OK:
- d(printf("lock child locked ok, id is %d\n", msg->data));
+ d (printf ("lock child locked ok, id is %d\n", msg->data));
res = msg->data;
break;
default:
@@ -225,11 +225,11 @@ again:
error, CAMEL_ERROR,
CAMEL_ERROR_GENERIC,
_("Could not lock '%s'"), path);
- d(printf("locking failed ! status = %d\n", msg->id));
+ d (printf ("locking failed ! status = %d\n", msg->id));
break;
}
} else if (retry > 0) {
- d(printf("sequence failure, lost message? retry?\n"));
+ d (printf ("sequence failure, lost message? retry?\n"));
retry--;
goto again;
} else {
@@ -255,7 +255,7 @@ gint camel_lock_helper_unlock (gint lockid)
gint retry = 3;
gint len;
- d(printf("unlocking lock id %d\n", lockid));
+ d (printf ("unlocking lock id %d\n", lockid));
LOCK ();
@@ -299,15 +299,15 @@ again:
if (msg->seq == lock_sequence) {
switch (msg->id) {
case CAMEL_LOCK_HELPER_STATUS_OK:
- d(printf("lock child unlocked ok\n"));
+ d (printf ("lock child unlocked ok\n"));
res = 0;
break;
default:
- d(printf("locking failed !\n"));
+ d (printf ("locking failed !\n"));
break;
}
} else if (retry > 0) {
- d(printf("sequence failure, lost message? retry?\n"));
+ d (printf ("sequence failure, lost message? retry?\n"));
lock_sequence++;
retry--;
goto again;
@@ -326,22 +326,22 @@ gint main (gint argc, gchar **argv)
{
gint id1, id2;
- d(printf("locking started\n"));
+ d (printf ("locking started\n"));
lock_helper_init ();
- id1 = camel_lock_helper_lock("1 path 1");
+ id1 = camel_lock_helper_lock ("1 path 1");
if (id1 != -1) {
- d(printf("lock ok, unlock\n"));
+ d (printf ("lock ok, unlock\n"));
camel_lock_helper_unlock (id1);
}
- id1 = camel_lock_helper_lock("2 path 1");
- id2 = camel_lock_helper_lock("2 path 2");
+ id1 = camel_lock_helper_lock ("2 path 1");
+ id2 = camel_lock_helper_lock ("2 path 2");
camel_lock_helper_unlock (id2);
camel_lock_helper_unlock (id1);
- id1 = camel_lock_helper_lock("3 path 1");
- id2 = camel_lock_helper_lock("3 path 2");
+ id1 = camel_lock_helper_lock ("3 path 1");
+ id2 = camel_lock_helper_lock ("3 path 2");
camel_lock_helper_unlock (id1);
}
#endif
diff --git a/camel/camel-lock-helper.c b/camel/camel-lock-helper.c
index f151e05..0863922 100644
--- a/camel/camel-lock-helper.c
+++ b/camel/camel-lock-helper.c
@@ -114,7 +114,7 @@ static gint lock_path (const gchar *path, guint32 *lockid)
gint res = CAMEL_LOCK_HELPER_STATUS_OK;
struct stat st;
- d(fprintf(stderr, "locking path '%s' id = %d\n", path, lock_id));
+ d (fprintf (stderr, "locking path '%s' id = %d\n", path, lock_id));
/* check to see if we have it locked already, make the lock 'recursive' */
/* we could also error i suppose, but why bother */
@@ -180,11 +180,11 @@ static gint lock_path (const gchar *path, guint32 *lockid)
lock_id++;
- d(fprintf(stderr, "lock ok\n"));
+ d (fprintf (stderr, "lock ok\n"));
return res;
fail:
- d(fprintf(stderr, "lock failed\n"));
+ d (fprintf (stderr, "lock failed\n"));
if (info)
free (info);
@@ -196,13 +196,13 @@ static gint unlock_id (guint32 lockid)
{
struct _lock_info *info, *p;
- d(fprintf(stderr, "unlocking id '%d'\n", lockid));
+ d (fprintf (stderr, "unlocking id '%d'\n", lockid));
p = (struct _lock_info *) &lock_info_list;
info = p->next;
while (info) {
if (info->id == lockid) {
- d(fprintf(stderr, "found id %d path '%s'\n", lockid, info->path));
+ d (fprintf (stderr, "found id %d path '%s'\n", lockid, info->path));
info->depth--;
if (info->depth <= 0) {
#ifdef SETEUID_SAVES
@@ -224,7 +224,7 @@ static gint unlock_id (guint32 lockid)
info = info->next;
}
- d(fprintf(stderr, "unknown id asked to be unlocked %d\n", lockid));
+ d (fprintf (stderr, "unknown id asked to be unlocked %d\n", lockid));
return CAMEL_LOCK_HELPER_STATUS_PROTOCOL;
}
@@ -235,9 +235,9 @@ static void lock_touch (const gchar *path)
/* we could also check that we haven't had our lock stolen from us here */
name = alloca (strlen (path) + 10);
- sprintf(name, "%s.lock", path);
+ sprintf (name, "%s.lock", path);
- d(fprintf(stderr, "Updating lock %s\n", name));
+ d (fprintf (stderr, "Updating lock %s\n", name));
utime (name, NULL);
}
@@ -306,7 +306,7 @@ gint main (gint argc, gchar **argv)
tv.tv_usec = 0;
}
- d(fprintf(stderr, "lock helper waiting for input\n"));
+ d (fprintf (stderr, "lock helper waiting for input\n"));
if (select (STDIN_FILENO + 1, &rset, NULL, NULL, lock_info_list ? &tv : NULL) == -1) {
if (errno == EINTR)
break;
@@ -319,7 +319,7 @@ gint main (gint argc, gchar **argv)
time_t now = time (NULL);
time_t left;
- d(fprintf(stderr, "Got a timeout, checking locks\n"));
+ d (fprintf (stderr, "Got a timeout, checking locks\n"));
info = lock_info_list;
while (info) {
@@ -360,13 +360,13 @@ gint main (gint argc, gchar **argv)
break;
}
}
- d(fprintf(stderr, "returning result %d\n", res));
+ d (fprintf (stderr, "returning result %d\n", res));
msg.id = res;
msg.magic = CAMEL_LOCK_HELPER_RETURN_MAGIC;
write_n (STDOUT_FILENO, &msg, sizeof (msg));
} while (1);
- d(fprintf(stderr, "parent exited, clsoing down remaining id's\n"));
+ d (fprintf (stderr, "parent exited, clsoing down remaining id's\n"));
while (lock_info_list)
unlock_id (lock_info_list->id);
diff --git a/camel/camel-lock.c b/camel/camel-lock.c
index c64b116..9695541 100644
--- a/camel/camel-lock.c
+++ b/camel/camel-lock.c
@@ -82,18 +82,18 @@ camel_lock_dot (const gchar *path,
* Does it matter? We will normally also use fcntl too ... */
/* use alloca, save cleaning up afterwards */
- lock = alloca(strlen(path) + strlen(".lock") + 1);
- sprintf(lock, "%s.lock", path);
- locktmp = alloca(strlen(path) + strlen("XXXXXX") + 1);
+ lock = alloca (strlen (path) + strlen (".lock") + 1);
+ sprintf (lock, "%s.lock", path);
+ locktmp = alloca (strlen (path) + strlen ("XXXXXX") + 1);
while (retry < CAMEL_LOCK_DOT_RETRY) {
- d(printf("trying to lock '%s', attempt %d\n", lock, retry));
+ d (printf ("trying to lock '%s', attempt %d\n", lock, retry));
if (retry > 0)
sleep (CAMEL_LOCK_DOT_DELAY);
- sprintf(locktmp, "%sXXXXXX", path);
+ sprintf (locktmp, "%sXXXXXX", path);
fdtmp = g_mkstemp (locktmp);
if (fdtmp == -1) {
g_set_error (
@@ -110,13 +110,13 @@ camel_lock_dot (const gchar *path,
/* but we check stat instead (again, see link(2)) */
if (g_stat (locktmp, &st) == -1) {
- d(printf("Our lock file %s vanished!?\n", locktmp));
+ d (printf ("Our lock file %s vanished!?\n", locktmp));
/* well that was unexpected, try cleanup/retry */
unlink (locktmp);
unlink (lock);
} else {
- d(printf("tmp lock created, link count is %d\n", st.st_nlink));
+ d (printf ("tmp lock created, link count is %d\n", st.st_nlink));
unlink (locktmp);
@@ -128,9 +128,9 @@ camel_lock_dot (const gchar *path,
/* check for stale lock, kill it */
if (g_stat (lock, &st) == 0) {
time_t now = time (NULL);
- (printf("There is an existing lock %ld seconds old\n", now-st.st_ctime));
+ (printf ("There is an existing lock %ld seconds old\n", now - st.st_ctime));
if (st.st_ctime < now - CAMEL_LOCK_DOT_STALE) {
- d(printf("Removing it now\n"));
+ d (printf ("Removing it now\n"));
unlink (lock);
}
}
@@ -138,7 +138,7 @@ camel_lock_dot (const gchar *path,
retry++;
}
- d(printf("failed to get lock after %d retries\n", retry));
+ d (printf ("failed to get lock after %d retries\n", retry));
g_set_error (
error, G_IO_ERROR, G_IO_ERROR_FAILED,
@@ -162,9 +162,9 @@ camel_unlock_dot (const gchar *path)
#ifdef USE_DOT
gchar *lock;
- lock = alloca(strlen(path) + strlen(".lock") + 1);
- sprintf(lock, "%s.lock", path);
- d(printf("unlocking %s\n", lock));
+ lock = alloca (strlen (path) + strlen (".lock") + 1);
+ sprintf (lock, "%s.lock", path);
+ d (printf ("unlocking %s\n", lock));
(void) unlink (lock);
#endif
}
@@ -190,7 +190,7 @@ camel_lock_fcntl (gint fd,
#ifdef USE_FCNTL
struct flock lock;
- d(printf("fcntl locking %d\n", fd));
+ d (printf ("fcntl locking %d\n", fd));
memset (&lock, 0, sizeof (lock));
lock.l_type = type == CAMEL_LOCK_READ ? F_RDLCK : F_WRLCK;
@@ -209,7 +209,7 @@ camel_lock_fcntl (gint fd,
static gint failed = 0;
if (failed == 0)
- fprintf(stderr, "fcntl(2) locking appears not to work on this filesystem");
+ fprintf (stderr, "fcntl(2) locking appears not to work on this filesystem");
failed++;
}
}
@@ -229,7 +229,7 @@ camel_unlock_fcntl (gint fd)
#ifdef USE_FCNTL
struct flock lock;
- d(printf("fcntl unlocking %d\n", fd));
+ d (printf ("fcntl unlocking %d\n", fd));
memset (&lock, 0, sizeof (lock));
lock.l_type = F_UNLCK;
@@ -258,7 +258,7 @@ camel_lock_flock (gint fd,
#ifdef USE_FLOCK
gint op;
- d(printf("flock locking %d\n", fd));
+ d (printf ("flock locking %d\n", fd));
if (type == CAMEL_LOCK_READ)
op = LOCK_SH | LOCK_NB;
@@ -287,7 +287,7 @@ void
camel_unlock_flock (gint fd)
{
#ifdef USE_FLOCK
- d(printf("flock unlocking %d\n", fd));
+ d (printf ("flock unlocking %d\n", fd));
(void) flock (fd, LOCK_UN);
#endif
@@ -356,76 +356,76 @@ main (gint argc,
gint fd1, fd2;
#if 0
- if (camel_lock_dot("mylock", &error) == 0) {
- if (camel_lock_dot("mylock", &error) == 0) {
- printf("Got lock twice?\n");
+ if (camel_lock_dot ("mylock", &error) == 0) {
+ if (camel_lock_dot ("mylock", &error) == 0) {
+ printf ("Got lock twice?\n");
} else {
- printf("failed to get lock 2: %s\n", error->message);
+ printf ("failed to get lock 2: %s\n", error->message);
}
- camel_unlock_dot("mylock");
+ camel_unlock_dot ("mylock");
} else {
- printf("failed to get lock 1: %s\n", error->message);
+ printf ("failed to get lock 1: %s\n", error->message);
}
if (error != NULL)
g_clear_error (&error);
#endif
- fd1 = open("mylock", O_RDWR);
+ fd1 = open ("mylock", O_RDWR);
if (fd1 == -1) {
- printf("Could not open lock file (mylock): %s", g_strerror (errno));
+ printf ("Could not open lock file (mylock): %s", g_strerror (errno));
return 1;
}
- fd2 = open("mylock", O_RDWR);
+ fd2 = open ("mylock", O_RDWR);
if (fd2 == -1) {
- printf("Could not open lock file (mylock): %s", g_strerror (errno));
+ printf ("Could not open lock file (mylock): %s", g_strerror (errno));
close (fd1);
return 1;
}
if (camel_lock_fcntl (fd1, CAMEL_LOCK_WRITE, &error) == 0) {
- printf("got fcntl write lock once\n");
+ printf ("got fcntl write lock once\n");
g_usleep (5000000);
if (camel_lock_fcntl (fd2, CAMEL_LOCK_WRITE, &error) == 0) {
- printf("got fcntl write lock twice!\n");
+ printf ("got fcntl write lock twice!\n");
} else {
- printf("failed to get write lock: %s\n", error->message);
+ printf ("failed to get write lock: %s\n", error->message);
}
if (error != NULL)
g_clear_error (&error);
if (camel_lock_fcntl (fd2, CAMEL_LOCK_READ, &error) == 0) {
- printf("got fcntl read lock as well?\n");
+ printf ("got fcntl read lock as well?\n");
camel_unlock_fcntl (fd2);
} else {
- printf("failed to get read lock: %s\n", error->message);
+ printf ("failed to get read lock: %s\n", error->message);
}
if (error != NULL)
g_clear_error (&error);
camel_unlock_fcntl (fd1);
} else {
- printf("failed to get write lock at all: %s\n", error->message);
+ printf ("failed to get write lock at all: %s\n", error->message);
}
if (camel_lock_fcntl (fd1, CAMEL_LOCK_READ, &error) == 0) {
- printf("got fcntl read lock once\n");
+ printf ("got fcntl read lock once\n");
g_usleep (5000000);
if (camel_lock_fcntl (fd2, CAMEL_LOCK_WRITE, &error) == 0) {
- printf("got fcntl write lock too?!\n");
+ printf ("got fcntl write lock too?!\n");
} else {
- printf("failed to get write lock: %s\n", error->message);
+ printf ("failed to get write lock: %s\n", error->message);
}
if (error != NULL)
g_clear_error (&error);
if (camel_lock_fcntl (fd2, CAMEL_LOCK_READ, &error) == 0) {
- printf("got fcntl read lock twice\n");
+ printf ("got fcntl read lock twice\n");
camel_unlock_fcntl (fd2);
} else {
- printf("failed to get read lock: %s\n", error->message);
+ printf ("failed to get read lock: %s\n", error->message);
}
if (error != NULL)
diff --git a/camel/camel-memchunk.c b/camel/camel-memchunk.c
index ffa562a..5b095eb 100644
--- a/camel/camel-memchunk.c
+++ b/camel/camel-memchunk.c
@@ -36,7 +36,7 @@ static void
time_start (const gchar *desc)
{
gettimeofday (&timeit_start, NULL);
- printf("starting: %s\n", desc);
+ printf ("starting: %s\n", desc);
}
static void
@@ -48,7 +48,7 @@ time_end (const gchar *desc)
gettimeofday (&end, NULL);
diff = end.tv_sec * 1000 + end.tv_usec / 1000;
diff -= timeit_start.tv_sec * 1000 + timeit_start.tv_usec / 1000;
- printf("%s took %ld.%03ld seconds\n",
+ printf ("%s took %ld.%03ld seconds\n",
desc, diff / 1000, diff % 1000);
}
#else
@@ -294,7 +294,7 @@ camel_memchunk_clean (CamelMemChunk *memchunk)
if (ci) {
ci->count += f->atoms;
} else {
- g_warning("error, can't find free node in memory block\n");
+ g_warning ("error, can't find free node in memory block\n");
}
f = f->next;
}
@@ -369,45 +369,45 @@ main ()
struct _EStrv *s;
s = strv_new (8);
- s = strv_set(s, 1, "Testing 1");
- s = strv_set(s, 2, "Testing 2");
- s = strv_set(s, 3, "Testing 3");
- s = strv_set(s, 4, "Testing 4");
- s = strv_set(s, 5, "Testing 5");
- s = strv_set(s, 6, "Testing 7");
+ s = strv_set (s, 1, "Testing 1");
+ s = strv_set (s, 2, "Testing 2");
+ s = strv_set (s, 3, "Testing 3");
+ s = strv_set (s, 4, "Testing 4");
+ s = strv_set (s, 5, "Testing 5");
+ s = strv_set (s, 6, "Testing 7");
for (i = 0; i < 8; i++) {
- printf("s[%d] = %s\n", i, strv_get(s, i));
+ printf ("s[%d] = %s\n", i, strv_get (s, i));
}
s (sleep (5));
- printf("packing ...\n");
+ printf ("packing ...\n");
s = strv_pack (s);
for (i = 0; i < 8; i++) {
- printf("s[%d] = %s\n", i, strv_get(s, i));
+ printf ("s[%d] = %s\n", i, strv_get (s, i));
}
- printf("setting ...\n");
+ printf ("setting ...\n");
- s = strv_set_ref(s, 1, "Testing 1 x");
+ s = strv_set_ref (s, 1, "Testing 1 x");
for (i = 0; i < 8; i++) {
- printf("s[%d] = %s\n", i, strv_get(s, i));
+ printf ("s[%d] = %s\n", i, strv_get (s, i));
}
- printf("packing ...\n");
+ printf ("packing ...\n");
s = strv_pack (s);
for (i = 0; i < 8; i++) {
- printf("s[%d] = %s\n", i, strv_get(s, i));
+ printf ("s[%d] = %s\n", i, strv_get (s, i));
}
strv_free (s);
#if 0
- time_start("Using memchunks");
+ time_start ("Using memchunks");
mc = memchunk_new (CHUNK_COUNT, CHUNK_SIZE);
for (i = 0; i < 1000000; i++) {
mem = memchunk_alloc (mc);
@@ -416,10 +416,10 @@ main ()
}
s (sleep (10));
memchunk_destroy (mc);
- time_end("allocating 1000000 memchunks, freeing 500k");
+ time_end ("allocating 1000000 memchunks, freeing 500k");
- time_start("Using gmemchunks");
- gmc = g_mem_chunk_new("memchunk", CHUNK_SIZE, CHUNK_SIZE*CHUNK_COUNT, G_ALLOC_AND_FREE);
+ time_start ("Using gmemchunks");
+ gmc = g_mem_chunk_new ("memchunk", CHUNK_SIZE, CHUNK_SIZE * CHUNK_COUNT, G_ALLOC_AND_FREE);
for (i = 0; i < 1000000; i++) {
mem = g_mem_chunk_alloc (gmc);
if ((i & 1) == 0)
@@ -427,31 +427,31 @@ main ()
}
s (sleep (10));
g_mem_chunk_destroy (gmc);
- time_end("allocating 1000000 gmemchunks, freeing 500k");
+ time_end ("allocating 1000000 gmemchunks, freeing 500k");
- time_start("Using memchunks");
+ time_start ("Using memchunks");
mc = memchunk_new (CHUNK_COUNT, CHUNK_SIZE);
for (i = 0; i < 1000000; i++) {
mem = memchunk_alloc (mc);
}
s (sleep (10));
memchunk_destroy (mc);
- time_end("allocating 1000000 memchunks");
+ time_end ("allocating 1000000 memchunks");
- time_start("Using gmemchunks");
- gmc = g_mem_chunk_new("memchunk", CHUNK_SIZE, CHUNK_COUNT*CHUNK_SIZE, G_ALLOC_ONLY);
+ time_start ("Using gmemchunks");
+ gmc = g_mem_chunk_new ("memchunk", CHUNK_SIZE, CHUNK_COUNT * CHUNK_SIZE, G_ALLOC_ONLY);
for (i = 0; i < 1000000; i++) {
mem = g_mem_chunk_alloc (gmc);
}
s (sleep (10));
g_mem_chunk_destroy (gmc);
- time_end("allocating 1000000 gmemchunks");
+ time_end ("allocating 1000000 gmemchunks");
- time_start("Using malloc");
+ time_start ("Using malloc");
for (i = 0; i < 1000000; i++) {
malloc (CHUNK_SIZE);
}
- time_end("allocating 1000000 malloc");
+ time_end ("allocating 1000000 malloc");
#endif
}
diff --git a/camel/camel-mime-filter-bestenc.c b/camel/camel-mime-filter-bestenc.c
index 57e6c1e..2f6dc95 100644
--- a/camel/camel-mime-filter-bestenc.c
+++ b/camel/camel-mime-filter-bestenc.c
@@ -86,7 +86,7 @@ mime_filter_bestenc_filter (CamelMimeFilter *mime_filter,
&& (priv->fromcount > 0 || priv->startofline)) {
if (priv->fromcount + len >=5) {
memcpy (&priv->fromsave[priv->fromcount], in, 5 - priv->fromcount);
- priv->hadfrom = strncmp(priv->fromsave, "From ", 5) == 0;
+ priv->hadfrom = strncmp (priv->fromsave, "From ", 5) == 0;
priv->fromcount = 0;
} else {
memcpy (&priv->fromsave[priv->fromcount], in, len);
@@ -125,7 +125,7 @@ mime_filter_bestenc_filter (CamelMimeFilter *mime_filter,
/* Check for "^From " lines */
if ((priv->flags & CAMEL_BESTENC_NO_FROM) && !priv->hadfrom) {
if (pend - p >= 5) {
- priv->hadfrom = strncmp((gchar *) p, (gchar *) "From ", 5) == 0;
+ priv->hadfrom = strncmp ((gchar *) p, (gchar *) "From ", 5) == 0;
} else if (pend - p == 0) {
priv->startofline = TRUE;
} else {
@@ -263,9 +263,9 @@ camel_mime_filter_bestenc_get_best_encoding (CamelMimeFilterBestenc *filter,
required = required & ~CAMEL_BESTENC_TEXT;
#if 0
- printf("count0 = %d, count8 = %d, total = %d\n", priv->count0, priv->count8, priv->total);
- printf("maxline = %d, crlfnoorder = %s\n", priv->maxline, priv->crlfnoorder?"TRUE":"FALSE");
- printf(" %d%% require encoding?\n", (priv->count0+priv->count8)*100 / priv->total);
+ printf ("count0 = %d, count8 = %d, total = %d\n", priv->count0, priv->count8, priv->total);
+ printf ("maxline = %d, crlfnoorder = %s\n", priv->maxline, priv->crlfnoorder?"TRUE":"FALSE");
+ printf (" %d%% require encoding?\n", (priv->count0 + priv->count8) * 100 / priv->total);
#endif
/* if we're not allowed to have From lines and we had one, use an encoding
diff --git a/camel/camel-mime-filter-canon.c b/camel/camel-mime-filter-canon.c
index dfaad1b..9626f58 100644
--- a/camel/camel-mime-filter-canon.c
+++ b/camel/camel-mime-filter-canon.c
@@ -86,8 +86,8 @@ mime_filter_canon_run (CamelMimeFilter *mime_filter,
if (priv->flags & CAMEL_MIME_FILTER_CANON_FROM && c == 'F') {
inptr++;
if (inptr < inend - 4) {
- if (strncmp((gchar *)inptr, "rom ", 4) == 0) {
- strcpy(o, "=46rom ");
+ if (strncmp ((gchar *) inptr, "rom ", 4) == 0) {
+ strcpy (o, "=46rom ");
inptr+=4;
o+= 7;
} else
diff --git a/camel/camel-mime-filter-charset.c b/camel/camel-mime-filter-charset.c
index 386a678..02a2936 100644
--- a/camel/camel-mime-filter-charset.c
+++ b/camel/camel-mime-filter-charset.c
@@ -287,7 +287,7 @@ camel_mime_filter_charset_new (const gchar *from_charset,
priv->ic = camel_iconv_open (to_charset, from_charset);
if (priv->ic == (iconv_t) -1) {
- w(g_warning ("Cannot create charset conversion from %s to %s: %s",
+ w (g_warning ("Cannot create charset conversion from %s to %s: %s",
from_charset ? from_charset : "(null)",
to_charset ? to_charset : "(null)",
g_strerror (errno)));
diff --git a/camel/camel-mime-filter-from.c b/camel/camel-mime-filter-from.c
index 00c2fc4..37b89e9 100644
--- a/camel/camel-mime-filter-from.c
+++ b/camel/camel-mime-filter-from.c
@@ -66,7 +66,7 @@ mime_filter_from_filter (CamelMimeFilter *mime_filter,
inptr = in;
inend = inptr + len;
- d(printf("Filtering '%.*s'\n", len, in));
+ d (printf ("Filtering '%.*s'\n", len, in));
/* first, see if we need to escape any from's */
while (inptr < inend) {
@@ -88,7 +88,7 @@ mime_filter_from_filter (CamelMimeFilter *mime_filter,
break;
}
} else {
- if (!strncmp(inptr, "From ", 5)) {
+ if (!strncmp (inptr, "From ", 5)) {
fromcount++;
/* yes, we do alloc them on the stack ... at most we're going to get
* len / 7 of them anyway */
@@ -125,13 +125,13 @@ mime_filter_from_filter (CamelMimeFilter *mime_filter,
*outlen = outptr - mime_filter->outbuf;
*outprespace = mime_filter->outbuf - mime_filter->outreal;
- d(printf("Filtered '%.*s'\n", *outlen, *out));
+ d (printf ("Filtered '%.*s'\n", *outlen, *out));
} else {
*out = (gchar *) in;
*outlen = inend - in;
*outprespace = prespace;
- d(printf("Filtered '%.*s'\n", *outlen, *out));
+ d (printf ("Filtered '%.*s'\n", *outlen, *out));
}
}
@@ -198,14 +198,14 @@ gint main (gint argc, gchar **argv)
len = strlen (buffer);
prespace = 0;
- printf("input = '%.*s'\n", len, buffer);
+ printf ("input = '%.*s'\n", len, buffer);
camel_mime_filter_filter (f, buffer, len, prespace, &buffer, &len, &prespace);
- printf("output = '%.*s'\n", len, buffer);
+ printf ("output = '%.*s'\n", len, buffer);
buffer = "";
len = 0;
prespace = 0;
camel_mime_filter_complete (f, buffer, len, prespace, &buffer, &len, &prespace);
- printf("complete = '%.*s'\n", len, buffer);
+ printf ("complete = '%.*s'\n", len, buffer);
return 0;
}
diff --git a/camel/camel-mime-filter-html.c b/camel/camel-mime-filter-html.c
index 4c6c48f..4c2acf1 100644
--- a/camel/camel-mime-filter-html.c
+++ b/camel/camel-mime-filter-html.c
@@ -84,7 +84,7 @@ mime_filter_html_run (CamelMimeFilter *mime_filter,
priv = CAMEL_MIME_FILTER_HTML_GET_PRIVATE (mime_filter);
- d(printf("converting html:\n%.*s\n", (gint)inlen, in));
+ d (printf ("converting html:\n%.*s\n", (gint) inlen, in));
/* We should generally shrink the data, but this'll do */
camel_mime_filter_set_size (mime_filter, inlen * 2 + 256, FALSE);
@@ -116,7 +116,7 @@ mime_filter_html_run (CamelMimeFilter *mime_filter,
*outlenptr = outp - mime_filter->outbuf;
*outprespace = mime_filter->outbuf - mime_filter->outreal;
- d(printf("converted html end:\n%.*s\n", (gint)*outlenptr, *out));
+ d (printf ("converted html end:\n%.*s\n", (gint) * outlenptr, *out));
}
static void
diff --git a/camel/camel-mime-filter-tohtml.c b/camel/camel-mime-filter-tohtml.c
index 3314f1a..044326f 100644
--- a/camel/camel-mime-filter-tohtml.c
+++ b/camel/camel-mime-filter-tohtml.c
@@ -170,7 +170,7 @@ writeln (CamelMimeFilter *mime_filter,
u = camel_utf8_getc_limit (&inptr, inend);
switch (u) {
case 0xffff:
- g_warning("Truncated utf8 buffer");
+ g_warning ("Truncated utf8 buffer");
return outptr;
case '<':
outptr = g_stpcpy (outptr, "<");
@@ -213,7 +213,7 @@ writeln (CamelMimeFilter *mime_filter,
if (priv->flags & CAMEL_MIME_FILTER_TOHTML_ESCAPE_8BIT)
*outptr++ = '?';
else
- outptr += sprintf(outptr, "&#%u;", u);
+ outptr += sprintf (outptr, "&#%u;", u);
}
priv->column++;
break;
@@ -290,7 +290,7 @@ html_convert (CamelMimeFilter *mime_filter,
/* FIXME: we could easily support multiple color depths here */
outptr = check_size (mime_filter, outptr, &outend, 25);
- outptr += sprintf(outptr, "<font color=\"#%06x\">", (priv->color & 0xffffff));
+ outptr += sprintf (outptr, "<font color=\"#%06x\">", (priv->color & 0xffffff));
}
#if FOOLISHLY_UNMUNGE_FROM
else if (*start == '>') {
diff --git a/camel/camel-mime-filter-windows.c b/camel/camel-mime-filter-windows.c
index 0f62acf..145b01e 100644
--- a/camel/camel-mime-filter-windows.c
+++ b/camel/camel-mime-filter-windows.c
@@ -81,7 +81,7 @@ mime_filter_windows_filter (CamelMimeFilter *mime_filter,
register guchar c = *inptr++;
if (c >= 128 && c <= 159) {
- w(g_warning ("Encountered Windows charset masquerading as %s",
+ w (g_warning ("Encountered Windows charset masquerading as %s",
priv->claimed_charset));
priv->is_windows = TRUE;
break;
diff --git a/camel/camel-mime-filter.c b/camel/camel-mime-filter.c
index a170518..a4bea13 100644
--- a/camel/camel-mime-filter.c
+++ b/camel/camel-mime-filter.c
@@ -119,13 +119,13 @@ checkmem (gpointer p)
switch (status) {
case MCHECK_HEAD:
- printf("Memory underrun at %p\n", p);
+ printf ("Memory underrun at %p\n", p);
abort ();
case MCHECK_TAIL:
- printf("Memory overrun at %p\n", p);
+ printf ("Memory overrun at %p\n", p);
abort ();
case MCHECK_FREE:
- printf("Double free %p\n", p);
+ printf ("Double free %p\n", p);
abort ();
}
}
diff --git a/camel/camel-mime-message.c b/camel/camel-mime-message.c
index 72e4328..ea1b0b1 100644
--- a/camel/camel-mime-message.c
+++ b/camel/camel-mime-message.c
@@ -228,9 +228,9 @@ mime_message_write_to_stream_sync (CamelDataWrapper *data_wrapper,
if (mm->from == NULL) {
/* FIXME: should we just abort? Should we make one up? */
g_warning ("No from set for message");
- camel_medium_set_header ((CamelMedium *)mm, "From", "");
+ camel_medium_set_header ((CamelMedium *) mm, "From", "");
}
- if (!camel_medium_get_header ((CamelMedium *)mm, "Date"))
+ if (!camel_medium_get_header ((CamelMedium *) mm, "Date"))
camel_mime_message_set_date (mm, CAMEL_MESSAGE_DATE_CURRENT, 0);
if (mm->subject == NULL)
@@ -241,8 +241,8 @@ mime_message_write_to_stream_sync (CamelDataWrapper *data_wrapper,
/* FIXME: "To" header needs to be set explicitly as well ... */
- if (!camel_medium_get_header ((CamelMedium *)mm, "Mime-Version"))
- camel_medium_set_header ((CamelMedium *)mm, "Mime-Version", "1.0");
+ if (!camel_medium_get_header ((CamelMedium *) mm, "Mime-Version"))
+ camel_medium_set_header ((CamelMedium *) mm, "Mime-Version", "1.0");
/* Chain up to parent's write_to_stream_sync() method. */
data_wrapper_class = CAMEL_DATA_WRAPPER_CLASS (
@@ -439,7 +439,7 @@ camel_mime_message_set_date (CamelMimeMessage *message,
message->date_offset = offset;
datestr = camel_header_format_date (date, offset);
- CAMEL_MEDIUM_CLASS (camel_mime_message_parent_class)->set_header ((CamelMedium *)message, "Date", datestr);
+ CAMEL_MEDIUM_CLASS (camel_mime_message_parent_class)->set_header ((CamelMedium *) message, "Date", datestr);
g_free (datestr);
}
@@ -478,7 +478,7 @@ camel_mime_message_get_date_received (CamelMimeMessage *msg,
if (msg->date_received == CAMEL_MESSAGE_DATE_CURRENT) {
const gchar *received;
- received = camel_medium_get_header ((CamelMedium *)msg, "received");
+ received = camel_medium_get_header ((CamelMedium *) msg, "received");
if (received)
received = strrchr (received, ';');
if (received)
@@ -663,13 +663,13 @@ camel_mime_message_set_from (CamelMimeMessage *msg,
}
if (from == NULL || camel_address_length ((CamelAddress *) from) == 0) {
- CAMEL_MEDIUM_CLASS(camel_mime_message_parent_class)->remove_header(CAMEL_MEDIUM(msg), "From");
+ CAMEL_MEDIUM_CLASS (camel_mime_message_parent_class)->remove_header (CAMEL_MEDIUM (msg), "From");
return;
}
msg->from = (CamelInternetAddress *) camel_address_new_clone ((CamelAddress *) from);
addr = camel_address_encode ((CamelAddress *) msg->from);
- CAMEL_MEDIUM_CLASS (camel_mime_message_parent_class)->set_header(CAMEL_MEDIUM(msg), "From", addr);
+ CAMEL_MEDIUM_CLASS (camel_mime_message_parent_class)->set_header (CAMEL_MEDIUM (msg), "From", addr);
g_free (addr);
}
@@ -898,7 +898,7 @@ find_best_encoding (CamelMimePart *part,
* not have to read the whole lot into memory - although i have a feeling
* it would make things a fair bit simpler to do so ... */
- d(printf("starting to check part\n"));
+ d (printf ("starting to check part\n"));
content = camel_medium_get_content ((CamelMedium *) part);
if (content == NULL) {
@@ -939,7 +939,7 @@ find_best_encoding (CamelMimePart *part,
bestenc = camel_mime_filter_bestenc_new (flags);
idb = camel_stream_filter_add (
CAMEL_STREAM_FILTER (filter), bestenc);
- d(printf("writing to checking stream\n"));
+ d (printf ("writing to checking stream\n"));
camel_data_wrapper_decode_to_stream_sync (content, filter, NULL, NULL);
camel_stream_filter_remove (CAMEL_STREAM_FILTER (filter), idb);
if (idc != -1) {
@@ -951,7 +951,7 @@ find_best_encoding (CamelMimePart *part,
if (istext && (required & CAMEL_BESTENC_GET_CHARSET) != 0) {
charsetin = camel_mime_filter_bestenc_get_best_charset (
CAMEL_MIME_FILTER_BESTENC (bestenc));
- d(printf("best charset = %s\n", charsetin ? charsetin : "(null)"));
+ d (printf ("best charset = %s\n", charsetin ? charsetin : "(null)"));
charset = g_strdup (charsetin);
charsetin = camel_content_type_param (content->mime_type, "charset");
@@ -961,7 +961,7 @@ find_best_encoding (CamelMimePart *part,
/* if we have US-ASCII, or we're not doing text, we dont need to bother with the rest */
if (istext && charsetin && charset && (required & CAMEL_BESTENC_GET_CHARSET) != 0) {
- d(printf("have charset, trying conversion/etc\n"));
+ d (printf ("have charset, trying conversion/etc\n"));
/* now that 'bestenc' has told us what the best encoding is, we can use that to create
* a charset conversion filter as well, and then re-add the bestenc to filter the
@@ -997,7 +997,7 @@ find_best_encoding (CamelMimePart *part,
g_object_unref (bestenc);
g_object_unref (null);
- d(printf("done, best encoding = %d\n", encoding));
+ d (printf ("done, best encoding = %d\n", encoding));
if (charsetp)
*charsetp = charset;
@@ -1042,7 +1042,7 @@ best_encoding (CamelMimeMessage *msg,
charset ? charset : "us-ascii");
newct = camel_content_type_format (((CamelDataWrapper *) part)->mime_type);
if (newct) {
- d(printf("Setting content-type to %s\n", newct));
+ d (printf ("Setting content-type to %s\n", newct));
camel_mime_part_set_content_type (part, newct);
g_free (newct);
@@ -1170,7 +1170,7 @@ gchar *
camel_mime_message_build_mbox_from (CamelMimeMessage *message)
{
struct _camel_header_raw *header = ((CamelMimePart *) message)->headers;
- GString *out = g_string_new("From ");
+ GString *out = g_string_new ("From ");
gchar *ret;
const gchar *tmp;
time_t thetime;
@@ -1283,16 +1283,16 @@ cmm_dump_rec (CamelMimeMessage *msg,
memset (s, ' ', depth);
s[depth] = 0;
/* yes this leaks, so what its only debug stuff */
- printf("%sclass: %s\n", s, G_OBJECT_TYPE_NAME (part));
- printf("%smime-type: %s\n", s, camel_content_type_format(((CamelDataWrapper *)part)->mime_type));
+ printf ("%sclass: %s\n", s, G_OBJECT_TYPE_NAME (part));
+ printf ("%smime-type: %s\n", s, camel_content_type_format (((CamelDataWrapper *) part)->mime_type));
containee = camel_medium_get_content ((CamelMedium *) part);
if (containee == NULL)
return;
- printf("%scontent class: %s\n", s, G_OBJECT_TYPE_NAME (containee));
- printf("%scontent mime-type: %s\n", s, camel_content_type_format(((CamelDataWrapper *)containee)->mime_type));
+ printf ("%scontent class: %s\n", s, G_OBJECT_TYPE_NAME (containee));
+ printf ("%scontent mime-type: %s\n", s, camel_content_type_format (((CamelDataWrapper *) containee)->mime_type));
/* using the object types is more accurate than using the mime/types */
if (CAMEL_IS_MULTIPART (containee)) {
diff --git a/camel/camel-mime-parser.c b/camel/camel-mime-parser.c
index 2e95fa2..bb88ac7 100644
--- a/camel/camel-mime-parser.c
+++ b/camel/camel-mime-parser.c
@@ -352,7 +352,7 @@ byte_array_to_string (GByteArray *array)
return NULL;
if (array->len == 0 || array->data[array->len - 1] != '\0')
- g_byte_array_append(array, (guint8 *) "", 1);
+ g_byte_array_append (array, (guint8 *) "", 1);
return (const gchar *) array->data;
}
@@ -609,7 +609,7 @@ camel_mime_parser_step (CamelMimeParser *parser,
{
struct _header_scan_state *s = _PRIVATE (parser);
- d(printf("OLD STATE: '%s' :\n", states[s->state]));
+ d (printf ("OLD STATE: '%s' :\n", states[s->state]));
if (s->unstep <= 0) {
gchar *dummy;
@@ -624,7 +624,7 @@ camel_mime_parser_step (CamelMimeParser *parser,
} else
s->unstep--;
- d(printf("NEW STATE: '%s' :\n", states[s->state]));
+ d (printf ("NEW STATE: '%s' :\n", states[s->state]));
return s->state;
}
@@ -662,10 +662,10 @@ camel_mime_parser_read (CamelMimeParser *parser,
if (len == 0)
return 0;
- d(printf("parser::read() reading %d bytes\n", len));
+ d (printf ("parser::read() reading %d bytes\n", len));
there = MIN (s->inend - s->inptr, len);
- d(printf("parser::read() there = %d bytes\n", there));
+ d (printf ("parser::read() there = %d bytes\n", there));
if (there > 0) {
*databuffer = s->inptr;
s->inptr += there;
@@ -683,7 +683,7 @@ camel_mime_parser_read (CamelMimeParser *parser,
}
there = MIN (s->inend - s->inptr, len);
- d(printf("parser::read() had to re-read, now there = %d bytes\n", there));
+ d (printf ("parser::read() had to re-read, now there = %d bytes\n", there));
*databuffer = s->inptr;
s->inptr += there;
@@ -848,7 +848,7 @@ camel_mime_parser_push_state (CamelMimeParser *mp,
h->boundarylen = strlen (boundary) + 2;
h->boundarylenfinal = h->boundarylen + 2;
h->boundary = g_malloc (h->boundarylen + 3);
- sprintf(h->boundary, "--%s--", boundary);
+ sprintf (h->boundary, "--%s--", boundary);
folder_push_part (s, h);
s->state = newstate;
}
@@ -933,14 +933,14 @@ folder_read (struct _header_scan_state *s)
} else {
len = read (s->fd, s->inbuf + inoffset, SCAN_BUF - inoffset);
}
- r(printf("read %d bytes, offset = %d\n", len, inoffset));
+ r (printf ("read %d bytes, offset = %d\n", len, inoffset));
if (len >= 0) {
/* add on the last read block */
s->seek += s->inptr - s->inbuf;
s->inptr = s->inbuf;
s->inend = s->inbuf + len + inoffset;
s->eof = (len == 0);
- r(printf("content = %d '%.*s'\n",s->inend - s->inptr, s->inend - s->inptr, s->inptr));
+ r (printf ("content = %d '%.*s'\n",s->inend - s->inptr, s->inend - s->inptr, s->inptr));
} else {
s->ioerrno = errno ? errno : EIO;
}
@@ -948,9 +948,9 @@ folder_read (struct _header_scan_state *s)
g_assert (s->inptr <= s->inend);
#ifdef PURIFY
inend_id = purify_watch (&s->inend);
- inbuffer_id = purify_watch_n(s->inend+1, SCAN_HEAD-1, "rw");
+ inbuffer_id = purify_watch_n (s->inend + 1, SCAN_HEAD - 1, "rw");
#endif
- r(printf("content = %d '%.*s'\n", s->inend - s->inptr, s->inend - s->inptr, s->inptr));
+ r (printf ("content = %d '%.*s'\n", s->inend - s->inptr, s->inend - s->inptr, s->inptr));
/* set a sentinal, for the inner loops to check against */
s->inend[0] = '\n';
return s->inend - s->inptr;
@@ -1003,7 +1003,7 @@ folder_seek (struct _header_scan_state *s,
}
#ifdef PURIFY
inend_id = purify_watch (&s->inend);
- inbuffer_id = purify_watch_n(s->inend+1, SCAN_HEAD-1, "rw");
+ inbuffer_id = purify_watch_n (s->inend + 1, SCAN_HEAD - 1, "rw");
#endif
return newoffset;
}
@@ -1044,7 +1044,7 @@ folder_pull_part (struct _header_scan_state *s)
g_byte_array_free (h->from_line, TRUE);
g_free (h);
} else {
- g_warning("Header stack underflow!\n");
+ g_warning ("Header stack underflow!\n");
}
}
@@ -1058,7 +1058,7 @@ folder_scan_skip_line (struct _header_scan_state *s,
s->atleast = 1;
- d(printf("skipping line\n"));
+ d (printf ("skipping line\n"));
while ( (len = folder_read (s)) > 0 && len > s->atleast) { /* ensure we have at least enough room here */
inptr = s->inptr;
@@ -1067,7 +1067,7 @@ folder_scan_skip_line (struct _header_scan_state *s,
c = -1;
while (inptr < inend
&& (c = *inptr++) != '\n') {
- d(printf("(%2x,%c)", c, isprint(c)?c:'.'));
+ d (printf ("(%2x,%c)", c, isprint (c) ? c : '.'));
;
}
@@ -1082,7 +1082,7 @@ folder_scan_skip_line (struct _header_scan_state *s,
}
}
- d(printf("couldn't find end of line?\n"));
+ d (printf ("couldn't find end of line?\n"));
s->atleast = atleast;
@@ -1098,15 +1098,15 @@ folder_boundary_check (struct _header_scan_state *s,
struct _header_scan_stack *part;
gint len = s->inend - boundary; /* make sure we dont access past the buffer */
- h(printf("checking boundary marker upto %d bytes\n", len));
+ h (printf ("checking boundary marker upto %d bytes\n", len));
part = s->parts;
while (part) {
- h(printf(" boundary: %s\n", part->boundary));
- h(printf(" against: '%.*s'\n", part->boundarylen, boundary));
+ h (printf (" boundary: %s\n", part->boundary));
+ h (printf (" against: '%.*s'\n", part->boundarylen, boundary));
if (part->boundary
&& part->boundarylen <= len
&& memcmp (boundary, part->boundary, part->boundarylen) == 0) {
- h(printf("matched boundary: %s\n", part->boundary));
+ h (printf ("matched boundary: %s\n", part->boundary));
/* again, make sure we're in range */
if (part->boundarylenfinal <= len) {
gint extra = part->boundarylenfinal - part->boundarylen;
@@ -1119,9 +1119,9 @@ folder_boundary_check (struct _header_scan_state *s,
} else {
*lastone = TRUE;
}
- h(printf("checking lastone = %s\n", *lastone?"TRUE":"FALSE"));
+ h (printf ("checking lastone = %s\n", *lastone?"TRUE":"FALSE"));
} else {
- h(printf("not enough room to check last one?\n"));
+ h (printf ("not enough room to check last one?\n"));
*lastone = FALSE;
}
/*printf("ok, we found it! : %s \n", (*lastone)?"Last one":"More to come?");*/
@@ -1213,7 +1213,7 @@ folder_scan_header (struct _header_scan_state *s,
gchar *inend;
register gchar *inptr;
- h(printf("scanning first bit\n"));
+ h (printf ("scanning first bit\n"));
h = g_malloc0 (sizeof (*h));
#ifdef MEMPOOL
@@ -1229,7 +1229,7 @@ folder_scan_header (struct _header_scan_state *s,
do {
s->atleast = newatleast;
- h(printf("atleast = %d\n", s->atleast));
+ h (printf ("atleast = %d\n", s->atleast));
while ((len = folder_read (s))>0 && len >= s->atleast) { /* ensure we have at least enough room here */
inptr = s->inptr;
@@ -1254,13 +1254,13 @@ folder_scan_header (struct _header_scan_state *s,
/* check for sentinal or real end of line */
if (inptr > inend) {
- h(printf("not at end of line yet, going further\n"));
+ h (printf ("not at end of line yet, going further\n"));
/* didn't find end of line within our allowed area */
inptr = inend;
s->midline = TRUE;
header_append (s, start, inptr);
} else {
- h(printf("got line part: '%.*s'\n", inptr-1-start, start));
+ h (printf ("got line part: '%.*s'\n", inptr - 1 - start, start));
/* got a line, strip and add it, process it */
s->midline = FALSE;
header_append (s, start, inptr - 1);
@@ -1271,7 +1271,7 @@ folder_scan_header (struct _header_scan_state *s,
/* check for continuation/compress headers, we have atleast 1 gchar here to work with */
if (inptr[0] == ' ' || inptr[0] == '\t') {
- h(printf("continuation\n"));
+ h (printf ("continuation\n"));
#ifdef PRESERVE_HEADERS
if (inptr - 1 >= start) {
@@ -1292,7 +1292,7 @@ folder_scan_header (struct _header_scan_state *s,
/* otherwise, complete header, add it */
s->outptr[0] = 0;
- h(printf("header '%s' at %d\n", s->outbuf, (gint)s->header_start));
+ h (printf ("header '%s' at %d\n", s->outbuf, (gint) s->header_start));
header_raw_append_parse (&h->headers, s->outbuf, s->header_start);
s->outptr = s->outbuf;
@@ -1302,7 +1302,7 @@ folder_scan_header (struct _header_scan_state *s,
}
s->inptr = inptr;
}
- h(printf("end of file? read %d bytes\n", len));
+ h (printf ("end of file? read %d bytes\n", len));
newatleast = 1;
} while (s->atleast > 1);
@@ -1351,7 +1351,7 @@ folder_scan_content (struct _header_scan_state *s,
struct _header_scan_stack *part;
gint onboundary = FALSE;
- c(printf("scanning content\n"));
+ c (printf ("scanning content\n"));
part = s->parts;
if (part)
@@ -1360,7 +1360,7 @@ folder_scan_content (struct _header_scan_state *s,
newatleast = 1;
*lastone = FALSE;
- c(printf("atleast = %d\n", newatleast));
+ c (printf ("atleast = %d\n", newatleast));
do {
s->atleast = newatleast;
@@ -1373,7 +1373,7 @@ folder_scan_content (struct _header_scan_state *s,
inend = s->inend - s->atleast + 1;
start = inptr;
- c(printf("inptr = %p, inend = %p\n", inptr, inend));
+ c (printf ("inptr = %p, inend = %p\n", inptr, inend));
while (inptr < inend) {
if (!s->midline
@@ -1402,14 +1402,14 @@ folder_scan_content (struct _header_scan_state *s,
}
}
- c(printf("ran out of input, dumping what i have (%d) bytes midline = %s\n",
- inptr-start, s->midline?"TRUE":"FALSE"));
+ c (printf ("ran out of input, dumping what i have (%d) bytes midline = %s\n",
+ inptr - start, s->midline?"TRUE":"FALSE"));
goto content;
}
newatleast = 1;
} while (s->atleast > 1);
- c(printf("length read = %d\n", len));
+ c (printf ("length read = %d\n", len));
if (s->inend > s->inptr) {
start = s->inptr;
@@ -1574,20 +1574,20 @@ folder_scan_step (struct _header_scan_state *s,
tail_recurse:
d ({
- printf("\nSCAN STACK:\n");
- printf(" '%s' :\n", states[s->state]);
+ printf ("\nSCAN STACK:\n");
+ printf (" '%s' :\n", states[s->state]);
hb = s->parts;
while (hb) {
- printf(" '%s' : %s ", states[hb->savestate], hb->boundary);
+ printf (" '%s' : %s ", states[hb->savestate], hb->boundary);
if (hb->content_type) {
- printf("(%s/%s)", hb->content_type->type, hb->content_type->subtype);
+ printf ("(%s/%s)", hb->content_type->type, hb->content_type->subtype);
} else {
- printf("(default)");
+ printf ("(default)");
}
- printf("\n");
+ printf ("\n");
hb = hb->parent;
}
- printf("\n");
+ printf ("\n");
});
switch (s->state) {
@@ -1596,7 +1596,7 @@ tail_recurse:
case CAMEL_MIME_PARSER_STATE_INITIAL:
if (s->scan_from) {
h = g_malloc0 (sizeof (*h));
- h->boundary = g_strdup("From ");
+ h->boundary = g_strdup ("From ");
h->boundarylen = strlen (h->boundary);
h->boundarylenfinal = h->boundarylen;
h->from_line = g_byte_array_new ();
@@ -1613,13 +1613,13 @@ tail_recurse:
do {
hb = folder_scan_content (s, &state, databuffer, datalength);
if (s->scan_pre_from && *datalength > 0) {
- d(printf("got pre-from content %d bytes\n", *datalength));
+ d (printf ("got pre-from content %d bytes\n", *datalength));
return;
}
} while (hb == h && *datalength > 0);
if (*datalength == 0 && hb == h) {
- d(printf("found 'From '\n"));
+ d (printf ("found 'From '\n"));
s->start_of_from = folder_tell (s);
folder_scan_skip_line (s, h->from_line);
h->savestate = CAMEL_MIME_PARSER_STATE_INITIAL;
@@ -1648,27 +1648,27 @@ tail_recurse:
/* FIXME: should this check for MIME-Version: 1.0 as well? */
type = CAMEL_MIME_PARSER_STATE_HEADER;
- if ((content = camel_header_raw_find(&h->headers, "Content-Type", NULL))
+ if ((content = camel_header_raw_find (&h->headers, "Content-Type", NULL))
&& (ct = camel_content_type_decode (content))) {
- if (!g_ascii_strcasecmp(ct->type, "multipart")) {
- if (!camel_content_type_is(ct, "multipart", "signed")
- && (bound = camel_content_type_param(ct, "boundary"))) {
- d(printf("multipart, boundary = %s\n", bound));
+ if (!g_ascii_strcasecmp (ct->type, "multipart")) {
+ if (!camel_content_type_is (ct, "multipart", "signed")
+ && (bound = camel_content_type_param (ct, "boundary"))) {
+ d (printf ("multipart, boundary = %s\n", bound));
h->boundarylen = strlen (bound) + 2;
h->boundarylenfinal = h->boundarylen + 2;
h->boundary = g_malloc (h->boundarylen + 3);
- sprintf(h->boundary, "--%s--", bound);
+ sprintf (h->boundary, "--%s--", bound);
type = CAMEL_MIME_PARSER_STATE_MULTIPART;
} else {
/*camel_content_type_unref(ct);
- ct = camel_content_type_decode("text/plain");*/
+ ct = camel_content_type_decode ("text/plain");*/
/* We can't quite do this, as it will mess up all the offsets ... */
/* camel_header_raw_replace(&h->headers, "Content-Type", "text/plain", offset); */
/*g_warning("Multipart with no boundary, treating as text/plain");*/
}
- } else if (!g_ascii_strcasecmp(ct->type, "message")) {
- if (!g_ascii_strcasecmp(ct->subtype, "rfc822")
- || !g_ascii_strcasecmp(ct->subtype, "news")
+ } else if (!g_ascii_strcasecmp (ct->type, "message")) {
+ if (!g_ascii_strcasecmp (ct->subtype, "rfc822")
+ || !g_ascii_strcasecmp (ct->subtype, "news")
/*|| !g_ascii_strcasecmp(ct->subtype, "partial")*/) {
type = CAMEL_MIME_PARSER_STATE_MESSAGE;
}
@@ -1676,14 +1676,14 @@ tail_recurse:
} else {
/* make the default type for multipart/digest be message/rfc822 */
if ((s->parts
- && camel_content_type_is(s->parts->content_type, "multipart", "digest"))) {
- ct = camel_content_type_decode("message/rfc822");
+ && camel_content_type_is (s->parts->content_type, "multipart", "digest"))) {
+ ct = camel_content_type_decode ("message/rfc822");
type = CAMEL_MIME_PARSER_STATE_MESSAGE;
- d(printf("parent was multipart/digest, autoupgrading to message/rfc822?\n"));
+ d (printf ("parent was multipart/digest, autoupgrading to message/rfc822?\n"));
/* maybe we should do this too?
* header_raw_append_parse(&h->headers, "Content-Type: message/rfc822", -1);*/
} else {
- ct = camel_content_type_decode("text/plain");
+ ct = camel_content_type_decode ("text/plain");
}
}
h->content_type = ct;
@@ -1703,16 +1703,16 @@ tail_recurse:
do {
hb = folder_scan_content (s, &state, databuffer, datalength);
- d(printf ("\n\nOriginal content: '"));
+ d (printf ("\n\nOriginal content: '"));
d (fwrite (*databuffer, sizeof (gchar), *datalength, stdout));
- d(printf("'\n"));
+ d (printf ("'\n"));
if (*datalength > 0) {
while (f) {
camel_mime_filter_filter (f->filter, *databuffer, *datalength, presize,
databuffer, datalength, &presize);
d (fwrite (*databuffer, sizeof (gchar), *datalength, stdout));
- d(printf("'\n"));
+ d (printf ("'\n"));
f = f->next;
}
return;
@@ -1748,8 +1748,8 @@ tail_recurse:
if (*datalength > 0) {
/* instead of a new state, we'll just store it locally and provide
* an accessor function */
- d(printf("Multipart %s Content %p: '%.*s'\n",
- h->prestage>0?"post":"pre", h, *datalength, *databuffer));
+ d (printf ("Multipart %s Content %p: '%.*s'\n",
+ h->prestage > 0?"post":"pre", h, *datalength, *databuffer));
if (h->prestage > 0) {
if (h->posttext == NULL)
h->posttext = g_byte_array_new ();
@@ -1763,7 +1763,7 @@ tail_recurse:
} while (hb == h && *datalength > 0);
h->prestage++;
if (*datalength == 0 && hb == h && !seenlast) {
- d(printf("got boundary: %s last=%d\n", hb->boundary, state));
+ d (printf ("got boundary: %s last=%d\n", hb->boundary, state));
s->start_of_boundary = folder_tell (s);
folder_scan_skip_line (s, NULL);
if (!state) {
@@ -1861,18 +1861,18 @@ gint main (gint argc, gchar **argv)
if (argc == 2)
name = argv[1];
- printf("opening: %s", name);
+ printf ("opening: %s", name);
for (i = 1; i < argc; i++) {
const gchar *encoding = NULL, *charset = NULL;
gchar *attachname;
name = argv[i];
- printf("opening: %s", name);
+ printf ("opening: %s", name);
fd = g_open (name, O_RDONLY | O_BINARY, 0);
if (fd==-1) {
- perror("Cannot open mailbox");
+ perror ("Cannot open mailbox");
exit (1);
}
s = folder_scan_init ();
@@ -1885,14 +1885,14 @@ gint main (gint argc, gchar **argv)
#endif
while (s->state != CAMEL_MIME_PARSER_STATE_EOF) {
folder_scan_step (s, &data, &len);
- printf("\n -- PARSER STEP RETURN -- %d '%s'\n\n", s->state, states[s->state]);
+ printf ("\n -- PARSER STEP RETURN -- %d '%s'\n\n", s->state, states[s->state]);
switch (s->state) {
case CAMEL_MIME_PARSER_STATE_HEADER:
if (s->parts->content_type
- && (charset = camel_content_type_param(s->parts->content_type, "charset"))) {
- if (g_ascii_strcasecmp(charset, "us-ascii")) {
+ && (charset = camel_content_type_param (s->parts->content_type, "charset"))) {
+ if (g_ascii_strcasecmp (charset, "us-ascii")) {
#if 0
- folder_push_filter_charset(s, "UTF-8", charset);
+ folder_push_filter_charset (s, "UTF-8", charset);
#endif
} else {
charset = NULL;
@@ -1901,11 +1901,11 @@ gint main (gint argc, gchar **argv)
charset = NULL;
}
- encoding = camel_header_raw_find(&s->parts->headers, "Content-transfer-encoding", 0);
- printf("encoding = '%s'\n", encoding);
- if (encoding && !g_ascii_strncasecmp(encoding, " base64", 7)) {
- printf("adding base64 filter\n");
- attachname = g_strdup_printf("attach.%d.%d", i, attach++);
+ encoding = camel_header_raw_find (&s->parts->headers, "Content-transfer-encoding", 0);
+ printf ("encoding = '%s'\n", encoding);
+ if (encoding && !g_ascii_strncasecmp (encoding, " base64", 7)) {
+ printf ("adding base64 filter\n");
+ attachname = g_strdup_printf ("attach.%d.%d", i, attach++);
#if 0
folder_push_filter_save (s, attachname);
#endif
@@ -1914,9 +1914,9 @@ gint main (gint argc, gchar **argv)
folder_push_filter_mime (s, 0);
#endif
}
- if (encoding && !g_ascii_strncasecmp(encoding, " quoted-printable", 17)) {
- printf("adding quoted-printable filter\n");
- attachname = g_strdup_printf("attach.%d.%d", i, attach++);
+ if (encoding && !g_ascii_strncasecmp (encoding, " quoted-printable", 17)) {
+ printf ("adding quoted-printable filter\n");
+ attachname = g_strdup_printf ("attach.%d.%d", i, attach++);
#if 0
folder_push_filter_save (s, attachname);
#endif
@@ -1928,19 +1928,19 @@ gint main (gint argc, gchar **argv)
break;
case CAMEL_MIME_PARSER_STATE_BODY:
- printf("got body %d '%.*s'\n", len, len, data);
+ printf ("got body %d '%.*s'\n", len, len, data);
break;
case CAMEL_MIME_PARSER_STATE_BODY_END:
- printf("end body %d '%.*s'\n", len, len, data);
- if (encoding && !g_ascii_strncasecmp(encoding, " base64", 7)) {
- printf("removing filters\n");
+ printf ("end body %d '%.*s'\n", len, len, data);
+ if (encoding && !g_ascii_strncasecmp (encoding, " base64", 7)) {
+ printf ("removing filters\n");
#if 0
folder_filter_pull (s);
folder_filter_pull (s);
#endif
}
- if (encoding && !g_ascii_strncasecmp(encoding, " quoted-printable", 17)) {
- printf("removing filters\n");
+ if (encoding && !g_ascii_strncasecmp (encoding, " quoted-printable", 17)) {
+ printf ("removing filters\n");
#if 0
folder_filter_pull (s);
folder_filter_pull (s);
diff --git a/camel/camel-mime-part-utils.c b/camel/camel-mime-part-utils.c
index 7c08c82..a9c4b73 100644
--- a/camel/camel-mime-part-utils.c
+++ b/camel/camel-mime-part-utils.c
@@ -64,16 +64,16 @@ simple_data_wrapper_construct_from_parser (CamelDataWrapper *dw,
gsize len;
gboolean success;
- d(printf ("simple_data_wrapper_construct_from_parser()\n"));
+ d (printf ("simple_data_wrapper_construct_from_parser()\n"));
/* read in the entire content */
buffer = g_byte_array_new ();
while (camel_mime_parser_step (mp, &buf, &len) != CAMEL_MIME_PARSER_STATE_BODY_END) {
- d(printf("appending o/p data: %d: %.*s\n", len, len, buf));
+ d (printf ("appending o/p data: %d: %.*s\n", len, len, buf));
g_byte_array_append (buffer, (guint8 *) buf, len);
}
- d(printf("message part kept in memory!\n"));
+ d (printf ("message part kept in memory!\n"));
mem = camel_stream_mem_new_with_byte_array (buffer);
success = camel_data_wrapper_construct_from_stream_sync (
@@ -107,7 +107,7 @@ camel_mime_part_construct_content_from_parser (CamelMimePart *dw,
switch (camel_mime_parser_state (mp)) {
case CAMEL_MIME_PARSER_STATE_HEADER:
- d(printf("Creating body part\n"));
+ d (printf ("Creating body part\n"));
/* multipart/signed is some type that we must treat as binary data. */
if (camel_content_type_is (ct, "multipart", "signed")) {
content = (CamelDataWrapper *) camel_multipart_signed_new ();
@@ -119,13 +119,13 @@ camel_mime_part_construct_content_from_parser (CamelMimePart *dw,
}
break;
case CAMEL_MIME_PARSER_STATE_MESSAGE:
- d(printf("Creating message part\n"));
+ d (printf ("Creating message part\n"));
content = (CamelDataWrapper *) camel_mime_message_new ();
success = camel_mime_part_construct_from_parser_sync (
(CamelMimePart *) content, mp, cancellable, error);
break;
case CAMEL_MIME_PARSER_STATE_MULTIPART:
- d(printf("Creating multi-part\n"));
+ d (printf ("Creating multi-part\n"));
if (camel_content_type_is (ct, "multipart", "encrypted"))
content = (CamelDataWrapper *) camel_multipart_encrypted_new ();
else if (camel_content_type_is (ct, "multipart", "signed"))
@@ -134,10 +134,10 @@ camel_mime_part_construct_content_from_parser (CamelMimePart *dw,
content = (CamelDataWrapper *) camel_multipart_new ();
camel_multipart_construct_from_parser ((CamelMultipart *) content, mp);
- d(printf("Created multi-part\n"));
+ d (printf ("Created multi-part\n"));
break;
default:
- g_warning("Invalid state encountered???: %u", camel_mime_parser_state (mp));
+ g_warning ("Invalid state encountered???: %u", camel_mime_parser_state (mp));
}
if (content) {
@@ -207,7 +207,7 @@ camel_mime_message_build_preview (CamelMimePart *msg,
while ((line = camel_stream_buffer_read_line ((CamelStreamBuffer *) bstream, NULL, NULL)) && str->len < 200) {
gchar *tmp = line;
- if (*line == '>' || strstr(line, "wrote:")) {
+ if (*line == '>' || strstr (line, "wrote:")) {
g_free (tmp);
continue;
}
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index 3ce19fe..f39c8d3 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -534,7 +534,7 @@ mime_part_write_to_stream_sync (CamelDataWrapper *dw,
gssize count;
gint errnosav;
- d(printf("mime_part::write_to_stream\n"));
+ d (printf ("mime_part::write_to_stream\n"));
/* FIXME: something needs to be done about this ... */
/* TODO: content-languages header? */
@@ -542,7 +542,7 @@ mime_part_write_to_stream_sync (CamelDataWrapper *dw,
if (mp->headers) {
struct _camel_header_raw *h = mp->headers;
gchar *val;
- gssize (*writefn) (CamelStream *stream,
+ gssize (*writefn) (CamelStream *stream,
const gchar *name,
const gchar *value,
GCancellable *cancellable,
@@ -553,7 +553,7 @@ mime_part_write_to_stream_sync (CamelDataWrapper *dw,
while (h) {
val = h->value;
if (val == NULL) {
- g_warning("h->value is NULL here for %s", h->name);
+ g_warning ("h->value is NULL here for %s", h->name);
count = 0;
} else if ((writefn = g_hash_table_lookup (header_formatted_table, h->name)) == NULL) {
val = camel_header_fold (val, strlen (h->name));
@@ -693,7 +693,7 @@ mime_part_write_to_stream_sync (CamelDataWrapper *dw,
total += count;
}
} else {
- g_warning("No content for medium, nothing to write");
+ g_warning ("No content for medium, nothing to write");
}
return total;
@@ -708,7 +708,7 @@ mime_part_construct_from_stream_sync (CamelDataWrapper *dw,
CamelMimeParser *parser;
gboolean success;
- d(printf("mime_part::construct_from_stream()\n"));
+ d (printf ("mime_part::construct_from_stream()\n"));
parser = camel_mime_parser_new ();
if (camel_mime_parser_init_with_stream (parser, stream, error) == -1) {
@@ -748,14 +748,14 @@ mime_part_construct_from_parser_sync (CamelMimePart *mime_part,
headers = camel_mime_parser_headers_raw (parser);
/* if content-type exists, process it first, set for fallback charset in headers */
- content = camel_header_raw_find(&headers, "content-type", NULL);
+ content = camel_header_raw_find (&headers, "content-type", NULL);
if (content)
- mime_part_process_header((CamelMedium *)dw, "content-type", content);
+ mime_part_process_header ((CamelMedium *) dw, "content-type", content);
while (headers) {
- if (g_ascii_strcasecmp(headers->name, "content-type") == 0
+ if (g_ascii_strcasecmp (headers->name, "content-type") == 0
&& headers->value != content)
- camel_medium_add_header((CamelMedium *)dw, "X-Invalid-Content-Type", headers->value);
+ camel_medium_add_header ((CamelMedium *) dw, "X-Invalid-Content-Type", headers->value);
else
camel_medium_add_header ((CamelMedium *) dw, headers->name, headers->value);
headers = headers->next;
@@ -765,7 +765,7 @@ mime_part_construct_from_parser_sync (CamelMimePart *mime_part,
mime_part, parser, cancellable, error);
break;
default:
- g_warning("Invalid state encountered???: %u", camel_mime_parser_state(parser));
+ g_warning ("Invalid state encountered???: %u", camel_mime_parser_state (parser));
}
err = camel_mime_parser_errno (parser);
@@ -1381,7 +1381,7 @@ camel_mime_part_set_filename (CamelMimePart *mime_part,
if (mime_part->priv->disposition == NULL)
mime_part->priv->disposition =
- camel_content_disposition_decode("attachment");
+ camel_content_disposition_decode ("attachment");
camel_header_set_param (
&mime_part->priv->disposition->params, "filename", filename);
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index 16e08a5..c00a720 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -633,7 +633,7 @@ camel_quoted_decode_step (guchar *in,
inend = in + len;
outptr = out;
- d(printf("quoted-printable, decoding text '%.*s'\n", len, in));
+ d (printf ("quoted-printable, decoding text '%.*s'\n", len, in));
state = *savestate;
save = *saveme;
@@ -729,7 +729,7 @@ quoted_decode (const guchar *in,
inend = in + len;
outptr = out;
- d(printf("decoding text '%.*s'\n", len, in));
+ d (printf ("decoding text '%.*s'\n", len, in));
inptr = in;
while (inptr < inend) {
@@ -786,7 +786,7 @@ quoted_encode (const guchar *in,
}
}
- d(printf("encoding '%.*s' = '%.*s'\n", len, in, outptr-out, out));
+ d (printf ("encoding '%.*s' = '%.*s'\n", len, in, outptr - out, out));
return (outptr - out);
}
@@ -797,14 +797,14 @@ header_decode_lwsp (const gchar **in)
const gchar *inptr = *in;
gchar c;
- d2(printf("is ws: '%s'\n", *in));
+ d2 (printf ("is ws: '%s'\n", *in));
while ((camel_mime_is_lwsp (*inptr) || *inptr =='(') && *inptr != '\0') {
while (camel_mime_is_lwsp (*inptr) && *inptr != '\0') {
- d2(printf("(%c)", *inptr));
+ d2 (printf ("(%c)", *inptr));
inptr++;
}
- d2(printf("\n"));
+ d2 (printf ("\n"));
/* check for comments */
if (*inptr == '(') {
@@ -906,7 +906,7 @@ camel_iconv_strndup (iconv_t cd,
errnosav = errno;
- w(g_warning ("camel_iconv_strndup: %s at byte %lu", g_strerror (errno), n - inleft));
+ w (g_warning ("camel_iconv_strndup: %s at byte %lu", g_strerror (errno), n - inleft));
g_free (out);
@@ -1115,12 +1115,12 @@ rfc2047_decode_word (const gchar *in,
declen = quoted_decode (inptr, inend - inptr, decoded);
if (declen == -1) {
- d(fprintf (stderr, "encountered broken 'Q' encoding\n"));
+ d (fprintf (stderr, "encountered broken 'Q' encoding\n"));
return NULL;
}
break;
default:
- d(fprintf (stderr, "unknown encoding\n"));
+ d (fprintf (stderr, "unknown encoding\n"));
return NULL;
}
@@ -1162,7 +1162,7 @@ rfc2047_decode_word (const gchar *in,
charset = camel_iconv_charset_name (charset);
if (!charset[0] || (cd = camel_iconv_open ("UTF-8", charset)) == (iconv_t) -1) {
- w(g_warning ("Cannot convert from %s to UTF-8, header display may "
+ w (g_warning ("Cannot convert from %s to UTF-8, header display may "
"be corrupt: %s", charset[0] ? charset : "unspecified charset",
g_strerror (errno)));
@@ -1175,7 +1175,7 @@ rfc2047_decode_word (const gchar *in,
if (buf != NULL)
return buf;
- w(g_warning ("Failed to convert \"%.*s\" to UTF-8, display may be "
+ w (g_warning ("Failed to convert \"%.*s\" to UTF-8, display may be "
"corrupt: %s", declen, decoded, g_strerror (errno)));
return decode_8bit ((gchar *) decoded, declen, charset);
@@ -1223,7 +1223,7 @@ append_8bit (GString *out,
outbuf = outbase = g_malloc (outlen);
if (camel_iconv (ic, &inbuf, &inlen, &outbuf, &outlen) == (gsize) -1) {
- w(g_warning("Conversion to '%s' failed: %s", charset, g_strerror (errno)));
+ w (g_warning ("Conversion to '%s' failed: %s", charset, g_strerror (errno)));
g_free (outbase);
camel_iconv_close (ic);
return FALSE;
@@ -1436,7 +1436,7 @@ rfc2047_encode_word (GString *outstring,
const gchar *inptr, *p;
gint first = 1;
- d(printf("Converting [%d] '%.*s' to %s\n", len, len, in, type));
+ d (printf ("Converting [%d] '%.*s' to %s\n", len, len, in, type));
/* convert utf8->encoding */
bufflen = len * 6 + 16;
@@ -1468,7 +1468,7 @@ rfc2047_encode_word (GString *outstring,
proclen = -1;
p = inptr;
i = 0;
- while (p < (in+len) && convlen < (75 - strlen("=?utf-8?q?\?="))) {
+ while (p < (in + len) && convlen < (75 - strlen ("=?utf-8?q?\?="))) {
guchar c = *p++;
if (c >= 0xc0)
@@ -1482,12 +1482,12 @@ rfc2047_encode_word (GString *outstring,
convlen += 3;
}
- if (proclen >= 0 && proclen < i && convlen < (75 - strlen("=?utf-8?q?\?=")))
+ if (proclen >= 0 && proclen < i && convlen < (75 - strlen ("=?utf-8?q?\?=")))
proclen = i;
/* well, we probably have broken utf8, just copy it anyway what the heck */
if (proclen == -1) {
- w(g_warning("Appear to have truncated utf8 sequence"));
+ w (g_warning ("Appear to have truncated utf8 sequence"));
proclen = inlen;
}
@@ -1501,7 +1501,7 @@ rfc2047_encode_word (GString *outstring,
convlen = MIN (inlen, CAMEL_FOLD_PREENCODED);
p = inptr;
if (camel_iconv (ic, &inptr, (gsize *) &convlen, &out, &outlen) == (gsize) -1 && errno != EINVAL) {
- w(g_warning("Conversion problem: conversion truncated: %s", g_strerror (errno)));
+ w (g_warning ("Conversion problem: conversion truncated: %s", g_strerror (errno)));
/* blah, we include it anyway, better than infinite loop ... */
inptr += convlen;
} else {
@@ -1524,7 +1524,7 @@ rfc2047_encode_word (GString *outstring,
out += quoted_encode ((guchar *) buffer, enclen, (guchar *) out, safemask);
sprintf (out, "?=");
- d(printf("converted part = %s\n", ascii));
+ d (printf ("converted part = %s\n", ascii));
g_string_append (outstring, ascii);
}
@@ -1575,7 +1575,7 @@ header_encode_string_rfc2047 (const guchar *in,
newinptr = g_utf8_next_char (inptr);
c = g_utf8_get_char ((gchar *) inptr);
if (newinptr == NULL || !g_unichar_validate (c)) {
- w(g_warning ("Invalid UTF-8 sequence encountered (pos %d, gchar '%c'): %s",
+ w (g_warning ("Invalid UTF-8 sequence encountered (pos %d, gchar '%c'): %s",
(inptr - in), inptr[0], in));
inptr++;
continue;
@@ -1755,7 +1755,7 @@ header_encode_phrase_get_words (const guchar *in)
c = g_utf8_get_char ((gchar *) inptr);
if (!g_unichar_validate (c)) {
- w(g_warning ("Invalid UTF-8 sequence encountered (pos %d, gchar '%c'): %s",
+ w (g_warning ("Invalid UTF-8 sequence encountered (pos %d, gchar '%c'): %s",
(inptr - in), inptr[0], in));
inptr++;
continue;
@@ -2065,10 +2065,10 @@ header_decode_value (const gchar **in)
header_decode_lwsp (&inptr);
if (*inptr == '"') {
- d(printf("decoding quoted string\n"));
+ d (printf ("decoding quoted string\n"));
return header_decode_quoted_string (in);
} else if (camel_mime_is_ttoken (*inptr)) {
- d(printf("decoding token\n"));
+ d (printf ("decoding token\n"));
/* this may not have the right specials for all params? */
return decode_token (in);
}
@@ -2191,7 +2191,7 @@ rfc2184_decode (const gchar *in,
return NULL;
decword = hex_decode (inptr, inend - inptr);
- decoded = header_convert("UTF-8", charset, decword, strlen(decword));
+ decoded = header_convert ("UTF-8", charset, decword, strlen (decword));
g_free (decword);
return decoded;
@@ -2322,16 +2322,16 @@ camel_content_type_is (CamelContentType *ct,
{
/* no type == text/plain or text/"*" */
if (ct == NULL || (ct->type == NULL && ct->subtype == NULL)) {
- return (!g_ascii_strcasecmp(type, "text")
- && (!g_ascii_strcasecmp(subtype, "plain")
- || !strcmp(subtype, "*")));
+ return (!g_ascii_strcasecmp (type, "text")
+ && (!g_ascii_strcasecmp (subtype, "plain")
+ || !strcmp (subtype, "*")));
}
return (ct->type != NULL
&& (!g_ascii_strcasecmp (ct->type, type)
&& ((ct->subtype != NULL
&& !g_ascii_strcasecmp (ct->subtype, subtype))
- || !strcmp("*", subtype))));
+ || !strcmp ("*", subtype))));
}
/**
@@ -2420,7 +2420,7 @@ header_decode_domain (const gchar **in)
const gchar *inptr = *in;
gint go = TRUE;
gchar *ret;
- GString *domain = g_string_new("");
+ GString *domain = g_string_new ("");
/* domain ref | domain literal */
header_decode_lwsp (&inptr);
@@ -2437,7 +2437,7 @@ header_decode_domain (const gchar **in)
domain = g_string_append_c (domain, ']');
inptr++;
} else {
- w(g_warning("closing ']' not found in domain: %s", *in));
+ w (g_warning ("closing ']' not found in domain: %s", *in));
}
} else {
gchar *a = header_decode_atom (&inptr);
@@ -2445,7 +2445,7 @@ header_decode_domain (const gchar **in)
domain = g_string_append (domain, a);
g_free (a);
} else {
- w(g_warning("missing atom from domain-ref"));
+ w (g_warning ("missing atom from domain-ref"));
break;
}
}
@@ -2470,7 +2470,7 @@ header_decode_addrspec (const gchar **in)
{
const gchar *inptr = *in;
gchar *word;
- GString *addr = g_string_new("");
+ GString *addr = g_string_new ("");
header_decode_lwsp (&inptr);
@@ -2489,7 +2489,7 @@ header_decode_addrspec (const gchar **in)
header_decode_lwsp (&inptr);
g_free (word);
} else {
- w(g_warning("Invalid address spec: %s", *in));
+ w (g_warning ("Invalid address spec: %s", *in));
}
}
if (*inptr == '@') {
@@ -2500,13 +2500,13 @@ header_decode_addrspec (const gchar **in)
addr = g_string_append (addr, word);
g_free (word);
} else {
- w(g_warning("Invalid address, missing domain: %s", *in));
+ w (g_warning ("Invalid address, missing domain: %s", *in));
}
} else {
- w(g_warning("Invalid addr-spec, missing @: %s", *in));
+ w (g_warning ("Invalid addr-spec, missing @: %s", *in));
}
} else {
- w(g_warning("invalid addr-spec, no local part"));
+ w (g_warning ("invalid addr-spec, no local part"));
g_string_free (addr, TRUE);
return NULL;
@@ -2545,7 +2545,7 @@ header_decode_mailbox (const gchar **in,
struct _camel_header_address *address = NULL;
const gchar *comment = NULL;
- addr = g_string_new("");
+ addr = g_string_new ("");
/* for each address */
pre = header_decode_word (&inptr);
@@ -2578,7 +2578,7 @@ header_decode_mailbox (const gchar **in,
/* Fix for stupidly-broken-mailers that like to put '.''s in names unquoted */
/* see bug #8147 */
while (!pre && *inptr && *inptr != '<') {
- w(g_warning("Working around stupid mailer bug #5: unescaped characters in names"));
+ w (g_warning ("Working around stupid mailer bug #5: unescaped characters in names"));
name = g_string_append_c (name, *inptr++);
pre = header_decode_word (&inptr);
}
@@ -2604,20 +2604,20 @@ header_decode_mailbox (const gchar **in,
if (*inptr == ':') {
inptr++;
} else {
- w(g_warning("broken route-address, missing ':': %s", *in));
+ w (g_warning ("broken route-address, missing ':': %s", *in));
}
}
pre = header_decode_word (&inptr);
/*header_decode_lwsp(&inptr);*/
} else {
- w(g_warning("broken address? %s", *in));
+ w (g_warning ("broken address? %s", *in));
}
}
if (pre) {
addr = g_string_append (addr, pre);
} else {
- w(g_warning("No local-part for email address: %s", *in));
+ w (g_warning ("No local-part for email address: %s", *in));
}
/* should be at word '.' localpart */
@@ -2651,8 +2651,8 @@ header_decode_mailbox (const gchar **in,
const gchar *name_part;
gboolean in_quote;
- w(g_warning("We didn't get an '@' where we expected in '%s', trying again", *in));
- w(g_warning("Name is '%s', Addr is '%s' we're at '%s'\n", name?name->str:"<UNSET>", addr->str, inptr));
+ w (g_warning ("We didn't get an '@' where we expected in '%s', trying again", *in));
+ w (g_warning ("Name is '%s', Addr is '%s' we're at '%s'\n", name ? name->str:"<UNSET>", addr->str, inptr));
/* need to keep *inptr, as try_address_again will drop the current character */
if (*inptr == '<')
@@ -2687,7 +2687,7 @@ header_decode_mailbox (const gchar **in,
text = camel_header_decode_string (addr->str, charset);
if (name == NULL) {
name = addr;
- addr = g_string_new("");
+ addr = g_string_new ("");
if (text) {
g_string_truncate (name, 0);
g_string_append (name, text);
@@ -2707,7 +2707,7 @@ header_decode_mailbox (const gchar **in,
goto try_address_again;
}
- w(g_warning("invalid address, no '@' domain part at %c: %s", *inptr, *in));
+ w (g_warning ("invalid address, no '@' domain part at %c: %s", *inptr, *in));
}
if (closeme) {
@@ -2715,7 +2715,7 @@ header_decode_mailbox (const gchar **in,
if (*inptr == '>') {
inptr++;
} else {
- w(g_warning("invalid route address, no closing '>': %s", *in));
+ w (g_warning ("invalid route address, no closing '>': %s", *in));
}
} else if (name == NULL && comment != NULL && inptr>comment) { /* check for comment after address */
gchar *text, *tmp;
@@ -2726,7 +2726,7 @@ header_decode_mailbox (const gchar **in,
/* FIXME: This wont detect comments inside the domain itself,
* but nobody seems to use that feature anyway ... */
- d(printf("checking for comment from '%s'\n", comment));
+ d (printf ("checking for comment from '%s'\n", comment));
comstart = strchr (comment, '(');
if (comstart) {
@@ -2737,7 +2737,7 @@ header_decode_mailbox (const gchar **in,
comend--;
if (comend > comstart) {
- d(printf(" looking at subset '%.*s'\n", comend-comstart, comstart));
+ d (printf (" looking at subset '%.*s'\n", comend - comstart, comstart));
tmp = g_strndup (comstart, comend - comstart);
text = camel_header_decode_string (tmp, charset);
name = g_string_new (text);
@@ -2779,10 +2779,10 @@ header_decode_mailbox (const gchar **in,
}
- address = camel_header_address_new_name(name ? name->str : "", addr->str);
+ address = camel_header_address_new_name (name ? name->str : "", addr->str);
}
- d(printf("got mailbox: %s\n", addr->str));
+ d (printf ("got mailbox: %s\n", addr->str));
g_string_free (addr, TRUE);
if (name)
@@ -2797,19 +2797,19 @@ header_decode_address (const gchar **in,
{
const gchar *inptr = *in;
gchar *pre;
- GString *group = g_string_new("");
+ GString *group = g_string_new ("");
struct _camel_header_address *addr = NULL, *member;
/* pre-scan, trying to work out format, discard results */
header_decode_lwsp (&inptr);
while ((pre = header_decode_word (&inptr))) {
group = g_string_append (group, pre);
- group = g_string_append(group, " ");
+ group = g_string_append (group, " ");
g_free (pre);
}
header_decode_lwsp (&inptr);
if (*inptr == ':') {
- d(printf("group detected: %s\n", group->str));
+ d (printf ("group detected: %s\n", group->str));
addr = camel_header_address_new_group (group->str);
/* that was a group spec, scan mailbox's */
inptr++;
@@ -2830,7 +2830,7 @@ header_decode_address (const gchar **in,
if (*inptr == ';') {
inptr++;
} else {
- w(g_warning("Invalid group spec, missing closing ';': %s", *in));
+ w (g_warning ("Invalid group spec, missing closing ';': %s", *in));
}
} else {
inptr++;
@@ -2851,7 +2851,7 @@ header_msgid_decode_internal (const gchar **in)
const gchar *inptr = *in;
gchar *msgid = NULL;
- d(printf("decoding Message-ID: '%s'\n", *in));
+ d (printf ("decoding Message-ID: '%s'\n", *in));
header_decode_lwsp (&inptr);
if (*inptr == '<') {
@@ -2863,13 +2863,13 @@ header_msgid_decode_internal (const gchar **in)
if (*inptr == '>') {
inptr++;
} else {
- w(g_warning("Missing closing '>' on message id: %s", *in));
+ w (g_warning ("Missing closing '>' on message id: %s", *in));
}
} else {
- w(g_warning("Cannot find message id in: %s", *in));
+ w (g_warning ("Cannot find message id in: %s", *in));
}
} else {
- w(g_warning("missing opening '<' on message id: %s", *in));
+ w (g_warning ("missing opening '<' on message id: %s", *in));
}
*in = inptr;
@@ -2909,7 +2909,7 @@ camel_header_contentid_decode (const gchar *in)
GString *addr;
gchar *buf;
- d(printf("decoding Content-ID: '%s'\n", in));
+ d (printf ("decoding Content-ID: '%s'\n", in));
header_decode_lwsp (&inptr);
@@ -3098,7 +3098,7 @@ camel_header_address_decode (const gchar *in,
const gchar *inptr = in, *last;
struct _camel_header_address *list = NULL, *addr;
- d(printf("decoding To: '%s'\n", in));
+ d (printf ("decoding To: '%s'\n", in));
if (in == NULL)
return NULL;
@@ -3120,11 +3120,11 @@ camel_header_address_decode (const gchar *in,
} while (inptr != last);
if (*inptr) {
- w(g_warning("Invalid input detected at %c (%d): %s\n or at: %s", *inptr, inptr-in, in, inptr));
+ w (g_warning ("Invalid input detected at %c (%d): %s\n or at: %s", *inptr, inptr - in, in, inptr));
}
if (inptr == last) {
- w(g_warning("detected invalid input loop at : %s", last));
+ w (g_warning ("detected invalid input loop at : %s", last));
}
return list;
@@ -3212,7 +3212,7 @@ camel_header_mime_decode (const gchar *in,
const gchar *inptr = in;
gint major=-1, minor=-1;
- d(printf("decoding MIME-Version: '%s'\n", in));
+ d (printf ("decoding MIME-Version: '%s'\n", in));
if (in != NULL) {
header_decode_lwsp (&inptr);
@@ -3233,7 +3233,7 @@ camel_header_mime_decode (const gchar *in,
if (min)
*min = minor;
- d(printf("major = %d, minor = %d\n", major, minor));
+ d (printf ("major = %d, minor = %d\n", major, minor));
}
struct _rfc2184_param {
@@ -3276,13 +3276,13 @@ header_append_param (struct _camel_header_param *last,
last->next = node;
node->next = NULL;
node->name = name;
- if (strncmp(value, "=?", 2) == 0
+ if (strncmp (value, "=?", 2) == 0
&& (node->value = header_decode_text (value, FALSE, NULL))) {
g_free (value);
- } else if (g_ascii_strcasecmp (name, "boundary") != 0 && !g_utf8_validate(value, -1, NULL)) {
+ } else if (g_ascii_strcasecmp (name, "boundary") != 0 && !g_utf8_validate (value, -1, NULL)) {
const gchar *charset = camel_iconv_locale_charset ();
- if ((node->value = header_convert("UTF-8", charset?charset:"ISO-8859-1", value, strlen(value)))) {
+ if ((node->value = header_convert ("UTF-8", charset ? charset:"ISO-8859-1", value, strlen (value)))) {
g_free (value);
} else {
node->value = value;
@@ -3357,7 +3357,7 @@ header_decode_param_list (const gchar **in)
/* Rejoin any RFC 2184 split parameters in the proper order */
/* Parameters with the same index will be concatenated in undefined order */
if (split) {
- GString *value = g_string_new("");
+ GString *value = g_string_new ("");
struct _rfc2184_param *first;
gint i;
@@ -3448,8 +3448,8 @@ header_encode_param (const guchar *in,
return g_strdup ((gchar *) in);
}
- if (g_ascii_strcasecmp(charset, "UTF-8") != 0) {
- if ((outbuf = (guchar *) header_convert(charset, "UTF-8", (const gchar *) in, strlen((gchar *) in))))
+ if (g_ascii_strcasecmp (charset, "UTF-8") != 0) {
+ if ((outbuf = (guchar *) header_convert (charset, "UTF-8", (const gchar *) in, strlen ((gchar *) in))))
inptr = outbuf;
else
return g_strdup ((gchar *) in);
@@ -3457,7 +3457,7 @@ header_encode_param (const guchar *in,
/* FIXME: set the 'language' as well, assuming we can get that info...? */
out = g_string_new (charset);
- g_string_append(out, "''");
+ g_string_append (out, "''");
while ((c = *inptr++)) {
if (camel_mime_is_attrchar (c))
@@ -3502,7 +3502,7 @@ camel_header_param_list_format_append (GString *out,
value = header_encode_param ((guchar *) p->value, &encoded, is_filename);
if (!value) {
- w(g_warning ("appending parameter %s=%s violates rfc2184", p->name, p->value));
+ w (g_warning ("appending parameter %s=%s violates rfc2184", p->name, p->value));
value = g_strdup (p->value);
}
@@ -3563,7 +3563,7 @@ camel_header_param_list_format_append (GString *out,
else
quote_word (out, TRUE, inptr, ptr - inptr);
- d(printf ("wrote: %s\n", out->str + here));
+ d (printf ("wrote: %s\n", out->str + here));
used += (out->len - here);
@@ -3592,7 +3592,7 @@ camel_header_param_list_format_append (GString *out,
gchar *
camel_header_param_list_format (struct _camel_header_param *p)
{
- GString *out = g_string_new("");
+ GString *out = g_string_new ("");
gchar *ret;
camel_header_param_list_format_append (out, p);
@@ -3618,12 +3618,12 @@ camel_content_type_decode (const gchar *in)
inptr++;
subtype = decode_token (&inptr);
}
- if (subtype == NULL && (!g_ascii_strcasecmp(type, "text"))) {
- w(g_warning("text type with no subtype, resorting to text/plain: %s", in));
- subtype = g_strdup("plain");
+ if (subtype == NULL && (!g_ascii_strcasecmp (type, "text"))) {
+ w (g_warning ("text type with no subtype, resorting to text/plain: %s", in));
+ subtype = g_strdup ("plain");
}
if (subtype == NULL) {
- w(g_warning("MIME type with no subtype: %s", in));
+ w (g_warning ("MIME type with no subtype: %s", in));
}
t = camel_content_type_new (type, subtype);
@@ -3632,7 +3632,7 @@ camel_content_type_decode (const gchar *in)
g_free (subtype);
} else {
g_free (type);
- d(printf("cannot find MIME type in header (2) '%s'", in));
+ d (printf ("cannot find MIME type in header (2) '%s'", in));
}
return t;
}
@@ -3642,20 +3642,20 @@ camel_content_type_dump (CamelContentType *ct)
{
struct _camel_header_param *p;
- printf("Content-Type: ");
+ printf ("Content-Type: ");
if (ct == NULL) {
- printf("<NULL>\n");
+ printf ("<NULL>\n");
return;
}
- printf("%s / %s", ct->type, ct->subtype);
+ printf ("%s / %s", ct->type, ct->subtype);
p = ct->params;
if (p) {
while (p) {
- printf(";\n\t%s=\"%s\"", p->name, p->value);
+ printf (";\n\t%s=\"%s\"", p->name, p->value);
p = p->next;
}
}
- printf("\n");
+ printf ("\n");
}
gchar *
@@ -3670,9 +3670,9 @@ camel_content_type_format (CamelContentType *ct)
out = g_string_new ("");
if (ct->type == NULL) {
g_string_append_printf (out, "text/plain");
- w(g_warning ("Content-Type with no main type"));
+ w (g_warning ("Content-Type with no main type"));
} else if (ct->subtype == NULL) {
- w(g_warning ("Content-Type with no sub type: %s", ct->type));
+ w (g_warning ("Content-Type with no sub type: %s", ct->type));
if (!g_ascii_strcasecmp (ct->type, "multipart"))
g_string_append_printf (out, "%s/mixed", ct->type);
else
@@ -3692,10 +3692,10 @@ gchar *
camel_content_type_simple (CamelContentType *ct)
{
if (ct->type == NULL) {
- w(g_warning ("Content-Type with no main type"));
+ w (g_warning ("Content-Type with no main type"));
return g_strdup ("text/plain");
} else if (ct->subtype == NULL) {
- w(g_warning ("Content-Type with no sub type: %s", ct->type));
+ w (g_warning ("Content-Type with no sub type: %s", ct->type));
if (!g_ascii_strcasecmp (ct->type, "multipart"))
return g_strdup_printf ("%s/mixed", ct->type);
else
@@ -3726,7 +3726,7 @@ camel_content_disposition_decode (const gchar *in)
d->refcount = 1;
d->disposition = decode_token (&inptr);
if (d->disposition == NULL) {
- w(g_warning("Empty disposition type"));
+ w (g_warning ("Empty disposition type"));
}
d->params = header_decode_param_list (&inptr);
return d;
@@ -3762,11 +3762,11 @@ camel_content_disposition_format (CamelContentDisposition *d)
if (d == NULL)
return NULL;
- out = g_string_new("");
+ out = g_string_new ("");
if (d->disposition)
out = g_string_append (out, d->disposition);
else
- out = g_string_append(out, "attachment");
+ out = g_string_append (out, "attachment");
camel_header_param_list_format_append (out, d->params);
ret = out->str;
@@ -3856,17 +3856,17 @@ camel_header_format_date (time_t date,
{
struct tm tm;
- d(printf("offset = %d\n", tz_offset));
+ d (printf ("offset = %d\n", tz_offset));
- d(printf("converting date %s", ctime(&date)));
+ d (printf ("converting date %s", ctime (&date)));
date += ((tz_offset / 100) * (60 * 60)) + (tz_offset % 100) * 60;
- d(printf("converting date %s", ctime(&date)));
+ d (printf ("converting date %s", ctime (&date)));
gmtime_r (&date, &tm);
- return g_strdup_printf("%s, %02d %s %04d %02d:%02d:%02d %+05d",
+ return g_strdup_printf ("%s, %02d %s %04d %02d:%02d:%02d %+05d",
tm_days[tm.tm_wday],
tm.tm_mday, tm_months[tm.tm_mon],
tm.tm_year + 1900,
@@ -4241,7 +4241,7 @@ parse_broken_date (struct _date_token *tokens,
while (token) {
if (is_weekday (token) && !got_wday) {
if ((n = get_wday (token->start, token->len)) != -1) {
- d(printf ("weekday; "));
+ d (printf ("weekday; "));
got_wday = TRUE;
tm.tm_wday = n;
goto next;
@@ -4250,7 +4250,7 @@ parse_broken_date (struct _date_token *tokens,
if (is_month (token) && !got_month) {
if ((n = get_month (token->start, token->len)) != -1) {
- d(printf ("month; "));
+ d (printf ("month; "));
got_month = TRUE;
tm.tm_mon = n;
goto next;
@@ -4259,7 +4259,7 @@ parse_broken_date (struct _date_token *tokens,
if (is_time (token) && !tm.tm_hour && !tm.tm_min && !tm.tm_sec) {
if (get_time (token->start, token->len, &hour, &min, &sec)) {
- d(printf ("time; "));
+ d (printf ("time; "));
tm.tm_hour = hour;
tm.tm_min = min;
tm.tm_sec = sec;
@@ -4279,7 +4279,7 @@ parse_broken_date (struct _date_token *tokens,
struct _date_token *t = token;
if ((n = get_tzone (&t)) != -1) {
- d(printf ("tzone; "));
+ d (printf ("tzone; "));
got_tzone = TRUE;
offset = n;
goto next;
@@ -4289,7 +4289,7 @@ parse_broken_date (struct _date_token *tokens,
if (is_numeric (token)) {
if (token->len == 4 && !tm.tm_year) {
if ((n = get_year (token->start, token->len)) != -1) {
- d(printf ("year; "));
+ d (printf ("year; "));
tm.tm_year = n - 1900;
goto next;
}
@@ -4299,19 +4299,19 @@ parse_broken_date (struct _date_token *tokens,
if ((n = decode_int (token->start, token->len)) > 12) {
goto mday;
} else if (n > 0) {
- d(printf ("mon; "));
+ d (printf ("mon; "));
got_month = TRUE;
tm.tm_mon = n - 1;
}
goto next;
} else if (!tm.tm_mday && (n = get_mday (token->start, token->len)) != -1) {
mday:
- d(printf ("mday; "));
+ d (printf ("mday; "));
tm.tm_mday = n;
goto next;
} else if (!tm.tm_year) {
if ((n = get_year (token->start, token->len)) != -1) {
- d(printf ("2-digit year; "));
+ d (printf ("2-digit year; "));
tm.tm_year = n - 1900;
}
goto next;
@@ -4319,14 +4319,14 @@ parse_broken_date (struct _date_token *tokens,
}
}
- d(printf ("???; "));
+ d (printf ("???; "));
next:
token = token->next;
}
- d(printf ("\n"));
+ d (printf ("\n"));
t = camel_mktime_utc (&tm);
@@ -4387,7 +4387,7 @@ gchar *
camel_header_location_decode (const gchar *in)
{
gint quote = 0;
- GString *out = g_string_new("");
+ GString *out = g_string_new ("");
gchar c, *res;
/* Sigh. RFC2557 says:
@@ -4438,7 +4438,7 @@ check_header (struct _camel_header_raw *header)
cp = (guchar *) header->value;
while (cp && *cp) {
if (!isascii (*cp)) {
- w(g_warning("Appending header violates rfc: %s: %s", header->name, header->value));
+ w (g_warning ("Appending header violates rfc: %s: %s", header->name, header->value));
return;
}
cp++;
@@ -4462,7 +4462,7 @@ camel_header_raw_append_parse (struct _camel_header_raw **list,
while (camel_mime_is_lwsp (*in))
in++;
if (fieldlen == 0 || header[fieldlen] != ':') {
- printf("Invalid header line: '%s'\n", header);
+ printf ("Invalid header line: '%s'\n", header);
return;
}
name = g_alloca (fieldlen + 1);
@@ -4480,7 +4480,7 @@ camel_header_raw_append (struct _camel_header_raw **list,
{
struct _camel_header_raw *l, *n;
- d(printf("Header: %s: %s\n", name, value));
+ d (printf ("Header: %s: %s\n", name, value));
n = g_malloc (sizeof (*n));
n->next = NULL;
@@ -4498,14 +4498,14 @@ camel_header_raw_append (struct _camel_header_raw **list,
/* debug */
#if 0
- if (!g_ascii_strcasecmp(name, "To")) {
- printf("- Decoding To\n");
+ if (!g_ascii_strcasecmp (name, "To")) {
+ printf ("- Decoding To\n");
camel_header_to_decode (value);
- } else if (!g_ascii_strcasecmp(name, "Content-type")) {
- printf("- Decoding content-type\n");
+ } else if (!g_ascii_strcasecmp (name, "Content-type")) {
+ printf ("- Decoding content-type\n");
camel_content_type_dump (camel_content_type_decode (value));
- } else if (!g_ascii_strcasecmp(name, "MIME-Version")) {
- printf("- Decoding mime version\n");
+ } else if (!g_ascii_strcasecmp (name, "MIME-Version")) {
+ printf ("- Decoding mime version\n");
camel_header_mime_decode (value);
}
#endif
@@ -4715,7 +4715,7 @@ mailing_list_init (gpointer param)
errstr = g_malloc0 (len + 1);
regerror (errcode, &mail_list_magic[i].regex, errstr, len);
- g_warning("Internal error, compiling regex failed: %s: %s", mail_list_magic[i].pattern, errstr);
+ g_warning ("Internal error, compiling regex failed: %s: %s", mail_list_magic[i].pattern, errstr);
g_free (errstr);
failed++;
}
@@ -4846,7 +4846,7 @@ camel_header_address_set_addr (struct _camel_header_address *h,
g_free (h->v.addr);
h->v.addr = g_strdup (addr);
} else {
- g_warning("Trying to set the address on a group");
+ g_warning ("Trying to set the address on a group");
}
}
}
@@ -4863,7 +4863,7 @@ camel_header_address_set_members (struct _camel_header_address *h,
/* should this ref them? */
h->v.members = group;
} else {
- g_warning("Trying to set the members on a name, not group");
+ g_warning ("Trying to set the members on a name, not group");
}
}
}
@@ -5044,10 +5044,10 @@ camel_header_address_fold (const gchar *in,
len = strlen (inptr);
}
- d(printf("next word '%.*s'\n", len, inptr));
+ d (printf ("next word '%.*s'\n", len, inptr));
if (outlen + len > CAMEL_FOLD_SIZE) {
- d(printf("outlen = %d wordlen = %d\n", outlen, len));
+ d (printf ("outlen = %d wordlen = %d\n", outlen, len));
/* strip trailing space */
if (out->len > 0 && out->str[out->len - 1] == ' ')
g_string_truncate (out, out->len - 1);
@@ -5112,7 +5112,7 @@ camel_header_fold (const gchar *in,
if (needunfold)
inptr = in = camel_header_unfold (in);
- out = g_string_new("");
+ out = g_string_new ("");
outlen = headerlen + 2;
while (*inptr) {
space = inptr;
@@ -5124,9 +5124,9 @@ camel_header_fold (const gchar *in,
else
len = space - inptr;
- d(printf("next word '%.*s'\n", len, inptr));
+ d (printf ("next word '%.*s'\n", len, inptr));
if (outlen + len > CAMEL_FOLD_SIZE) {
- d(printf("outlen = %d wordlen = %d\n", outlen, len));
+ d (printf ("outlen = %d wordlen = %d\n", outlen, len));
/* strip trailing space */
if (out->len > 0 && (out->str[out->len - 1] == ' ' || out->str[out->len - 1] == '\t')) {
spc = out->str[out->len - 1];
diff --git a/camel/camel-movemail.c b/camel/camel-movemail.c
index bec2874..e69df29 100644
--- a/camel/camel-movemail.c
+++ b/camel/camel-movemail.c
@@ -306,7 +306,7 @@ camel_movemail_copy (gint fromfd,
gchar buffer[4096];
gint written = 0;
- d(printf("writing %d bytes ... ", bytes));
+ d (printf ("writing %d bytes ... ", bytes));
if (lseek (fromfd, start, SEEK_SET) != start)
return -1;
@@ -328,7 +328,7 @@ camel_movemail_copy (gint fromfd,
/* check for 'end of file' */
if (towrite == 0) {
- d(printf("end of file?\n"));
+ d (printf ("end of file?\n"));
break;
}
@@ -343,7 +343,7 @@ camel_movemail_copy (gint fromfd,
bytes -= toread;
}
- d(printf("written %d bytes\n", written));
+ d (printf ("written %d bytes\n", written));
return written;
}
@@ -364,7 +364,7 @@ camel_movemail_copy_filter (gint fromfd,
gchar *filterbuffer;
gint filterlen, filterpre;
- d(printf("writing %d bytes ... ", bytes));
+ d (printf ("writing %d bytes ... ", bytes));
camel_mime_filter_reset (filter);
@@ -386,11 +386,11 @@ camel_movemail_copy_filter (gint fromfd,
if (towrite == -1)
return -1;
- d(printf("read %d unfiltered bytes\n", towrite));
+ d (printf ("read %d unfiltered bytes\n", towrite));
/* check for 'end of file' */
if (towrite == 0) {
- d(printf("end of file?\n"));
+ d (printf ("end of file?\n"));
camel_mime_filter_complete (filter, buffer + PRE_SIZE, towrite, PRE_SIZE,
&filterbuffer, &filterlen, &filterpre);
towrite = filterlen;
@@ -402,7 +402,7 @@ camel_movemail_copy_filter (gint fromfd,
towrite = filterlen;
}
- d(printf("writing %d filtered bytes\n", towrite));
+ d (printf ("writing %d filtered bytes\n", towrite));
do {
toread = write (tofd, filterbuffer, towrite);
@@ -415,7 +415,7 @@ camel_movemail_copy_filter (gint fromfd,
bytes -= toread;
}
- d(printf("written %d bytes\n", written));
+ d (printf ("written %d bytes\n", written));
return written;
}
@@ -429,13 +429,13 @@ solaris_header_write (gint fd,
struct iovec iv[4];
gint outlen = 0, len;
- iv[1].iov_base = ":";
+ iv[1].iov_base = ":";
iv[1].iov_len = 1;
- iv[3].iov_base = "\n";
+ iv[3].iov_base = "\n";
iv[3].iov_len = 1;
while (header) {
- if (g_ascii_strcasecmp(header->name, "Content-Length")) {
+ if (g_ascii_strcasecmp (header->name, "Content-Length")) {
iv[0].iov_base = header->name;
iv[0].iov_len = strlen (header->name);
iv[2].iov_base = header->value;
@@ -453,7 +453,7 @@ solaris_header_write (gint fd,
}
do {
- len = write(fd, "\n", 1);
+ len = write (fd, "\n", 1);
} while (len == -1 && errno == EINTR);
if (len == -1)
@@ -461,7 +461,7 @@ solaris_header_write (gint fd,
outlen += 1;
- d(printf("Wrote %d bytes of headers\n", outlen));
+ d (printf ("Wrote %d bytes of headers\n", outlen));
return outlen;
}
@@ -520,9 +520,9 @@ camel_movemail_solaris (gint oldsfd,
if (solaris_header_write (dfd, camel_mime_parser_headers_raw (mp)) == -1)
goto fail;
- cl = camel_mime_parser_header(mp, "content-length", NULL);
+ cl = camel_mime_parser_header (mp, "content-length", NULL);
if (cl == NULL) {
- g_warning("Required Content-Length header is missing from solaris mail box @ %d", (gint)camel_mime_parser_tell(mp));
+ g_warning ("Required Content-Length header is missing from solaris mail box @ %d", (gint) camel_mime_parser_tell (mp));
camel_mime_parser_drop_step (mp);
camel_mime_parser_drop_step (mp);
camel_mime_parser_step (mp, &buffer, &len);
@@ -541,7 +541,7 @@ camel_movemail_solaris (gint oldsfd,
if (newpos != -1)
camel_mime_parser_seek (mp, newpos, SEEK_SET);
} else {
- g_error("Inalid parser state: %d", camel_mime_parser_state(mp));
+ g_error ("Inalid parser state: %d", camel_mime_parser_state (mp));
}
g_free (from);
}
diff --git a/camel/camel-multipart-signed.c b/camel/camel-multipart-signed.c
index 57c8a76..e17584d 100644
--- a/camel/camel-multipart-signed.c
+++ b/camel/camel-multipart-signed.c
@@ -110,7 +110,7 @@ multipart_signed_skip_content (CamelMimeParser *cmp)
multipart_signed_skip_content (cmp);
break;
default:
- g_warning("Invalid state encountered???: %u", camel_mime_parser_state (cmp));
+ g_warning ("Invalid state encountered???: %u", camel_mime_parser_state (cmp));
}
return 0;
@@ -165,7 +165,7 @@ multipart_signed_parse_content (CamelMultipartSigned *mps)
if (mps->end1 > mps->start1 && byte_array->data[mps->end1 - 1] == '\r')
mps->end1--;
} else {
- g_warning("multipart/signed has more than 2 parts, remaining parts ignored");
+ g_warning ("multipart/signed has more than 2 parts, remaining parts ignored");
state = CAMEL_MIME_PARSER_STATE_MULTIPART_END;
break;
}
@@ -250,11 +250,11 @@ multipart_signed_set_mime_type_field (CamelDataWrapper *data_wrapper,
if (mime_type) {
const gchar *micalg, *protocol;
- protocol = camel_content_type_param(mime_type, "protocol");
+ protocol = camel_content_type_param (mime_type, "protocol");
g_free (mps->protocol);
mps->protocol = g_strdup (protocol);
- micalg = camel_content_type_param(mime_type, "micalg");
+ micalg = camel_content_type_param (mime_type, "micalg");
g_free (mps->micalg);
mps->micalg = g_strdup (micalg);
}
@@ -415,7 +415,7 @@ static void
multipart_signed_add_part (CamelMultipart *multipart,
CamelMimePart *part)
{
- g_warning("Cannot add parts to a signed part using add_part");
+ g_warning ("Cannot add parts to a signed part using add_part");
}
static void
@@ -423,21 +423,21 @@ multipart_signed_add_part_at (CamelMultipart *multipart,
CamelMimePart *part,
guint index)
{
- g_warning("Cannot add parts to a signed part using add_part_at");
+ g_warning ("Cannot add parts to a signed part using add_part_at");
}
static void
multipart_signed_remove_part (CamelMultipart *multipart,
CamelMimePart *part)
{
- g_warning("Cannot remove parts from a signed part using remove_part");
+ g_warning ("Cannot remove parts from a signed part using remove_part");
}
static CamelMimePart *
multipart_signed_remove_part_at (CamelMultipart *multipart,
guint index)
{
- g_warning("Cannot remove parts from a signed part using remove_part");
+ g_warning ("Cannot remove parts from a signed part using remove_part");
return NULL;
}
@@ -465,7 +465,7 @@ multipart_signed_get_part (CamelMultipart *multipart,
} else if (mps->start1 == -1
&& multipart_signed_parse_content (mps) == -1
&& byte_array->len == 0) {
- g_warning("Trying to get content on an invalid multipart/signed");
+ g_warning ("Trying to get content on an invalid multipart/signed");
return NULL;
} else if (byte_array->len == 0) {
return NULL;
@@ -489,7 +489,7 @@ multipart_signed_get_part (CamelMultipart *multipart,
return mps->signature;
if (mps->start1 == -1
&& multipart_signed_parse_content (mps) == -1) {
- g_warning("Trying to get signature on invalid multipart/signed");
+ g_warning ("Trying to get signature on invalid multipart/signed");
return NULL;
} else if (byte_array->len == 0) {
return NULL;
@@ -505,7 +505,7 @@ multipart_signed_get_part (CamelMultipart *multipart,
g_object_unref (stream);
return mps->signature;
default:
- g_warning("trying to get object out of bounds for multipart");
+ g_warning ("trying to get object out of bounds for multipart");
}
return NULL;
@@ -554,7 +554,7 @@ multipart_signed_construct_from_parser (CamelMultipart *multipart,
/* All we do is copy it to a memstream */
content_type = camel_mime_parser_content_type (mp);
- camel_multipart_set_boundary(multipart, camel_content_type_param(content_type, "boundary"));
+ camel_multipart_set_boundary (multipart, camel_content_type_param (content_type, "boundary"));
data_wrapper = CAMEL_DATA_WRAPPER (multipart);
byte_array = camel_data_wrapper_get_byte_array (data_wrapper);
diff --git a/camel/camel-multipart.c b/camel/camel-multipart.c
index 8da13a6..272af89 100644
--- a/camel/camel-multipart.c
+++ b/camel/camel-multipart.c
@@ -300,11 +300,11 @@ multipart_construct_from_parser (CamelMultipart *multipart,
g_assert (camel_mime_parser_state (mp) == CAMEL_MIME_PARSER_STATE_MULTIPART);
/* FIXME: we should use a came-mime-mutlipart, not jsut a camel-multipart, but who cares */
- d(printf("Creating multi-part\n"));
+ d (printf ("Creating multi-part\n"));
content_type = camel_mime_parser_content_type (mp);
camel_multipart_set_boundary (multipart,
- camel_content_type_param(content_type, "boundary"));
+ camel_content_type_param (content_type, "boundary"));
while (camel_mime_parser_step (mp, &buf, &len) != CAMEL_MIME_PARSER_STATE_MULTIPART_END) {
camel_mime_parser_unstep (mp);
diff --git a/camel/camel-net-utils.c b/camel/camel-net-utils.c
index efb9aa1..6c98fd5 100644
--- a/camel/camel-net-utils.c
+++ b/camel/camel-net-utils.c
@@ -482,7 +482,7 @@ cs_waitinfo (gpointer (worker)(gpointer),
polls[1].fd = cancel_fd;
polls[1].events = G_IO_IN;
- d(printf("waiting for name return/cancellation in main process\n"));
+ d (printf ("waiting for name return/cancellation in main process\n"));
do {
polls[0].revents = 0;
polls[1].revents = 0;
@@ -524,16 +524,16 @@ cs_waitinfo (gpointer (worker)(gpointer),
/* We cancel so if the thread impl is decent it causes immediate exit.
* We check the reply port incase we had a reply in the mean time, which we free later */
- d(printf("Canceling lookup thread and leaving it\n"));
+ d (printf ("Canceling lookup thread and leaving it\n"));
msg->cancelled = 1;
g_thread_join (thread);
cancel = 1;
} else {
struct _addrinfo_msg *reply;
- d(printf("waiting for child to exit\n"));
+ d (printf ("waiting for child to exit\n"));
g_thread_join (thread);
- d(printf("child done\n"));
+ d (printf ("child done\n"));
reply = (struct _addrinfo_msg *) camel_msgport_try_pop (reply_port);
if (reply != msg)
@@ -665,9 +665,9 @@ cs_getaddrinfo (gpointer data)
* Use the port as the service name directly. */
if (info->result && info->service) {
if (strcmp (info->service, "http") == 0)
- info->result = getaddrinfo(info->name, "80", info->hints, info->res);
+ info->result = getaddrinfo (info->name, "80", info->hints, info->res);
else if (strcmp (info->service, "https") == 0)
- info->result = getaddrinfo(info->name, "443", info->hints, info->res);
+ info->result = getaddrinfo (info->name, "443", info->hints, info->res);
}
if (!info->cancelled)
@@ -800,13 +800,13 @@ cs_getnameinfo (gpointer data)
guchar *in = (guchar *) &sin->sin_addr;
/* sin_addr is always network order which is big-endian */
- msg->host = g_strdup_printf("%u.%u.%u.%u", in[0], in[1], in[2], in[3]);
+ msg->host = g_strdup_printf ("%u.%u.%u.%u", in[0], in[1], in[2], in[3]);
}
}
/* we never actually use this anyway */
if (msg->serv)
- sprintf(msg->serv, "%d", sin->sin_port);
+ sprintf (msg->serv, "%d", sin->sin_port);
if (!msg->cancelled)
camel_msgport_reply ((CamelMsg *) msg);
diff --git a/camel/camel-nntp-address.c b/camel/camel-nntp-address.c
index ab09fde..09878d5 100644
--- a/camel/camel-nntp-address.c
+++ b/camel/camel-nntp-address.c
@@ -63,11 +63,11 @@ nntp_address_encode (CamelAddress *address)
if (address->addresses->len == 0)
return NULL;
- out = g_string_new("");
+ out = g_string_new ("");
for (i = 0; i < address->addresses->len; i++) {
if (i != 0)
- g_string_append(out, ", ");
+ g_string_append (out, ", ");
g_string_append (out, g_ptr_array_index (address->addresses, i));
}
diff --git a/camel/camel-object.c b/camel/camel-object.c
index 0a791fa..d13cd7b 100644
--- a/camel/camel-object.c
+++ b/camel/camel-object.c
@@ -457,7 +457,7 @@ camel_object_state_write (CamelObject *object)
fclose (fp);
}
} else {
- g_warning("Could not save object state file to '%s': %s", savename, g_strerror(errno));
+ g_warning ("Could not save object state file to '%s': %s", savename, g_strerror (errno));
}
g_free (savename);
diff --git a/camel/camel-offline-folder.c b/camel/camel-offline-folder.c
index 0a4af88..139a0ee 100644
--- a/camel/camel-offline-folder.c
+++ b/camel/camel-offline-folder.c
@@ -374,7 +374,7 @@ camel_offline_folder_set_offline_sync (CamelOfflineFolder *folder,
{
g_return_if_fail (CAMEL_IS_OFFLINE_FOLDER (folder));
- if ((folder->priv->offline_sync ? 1 : 0) == (offline_sync ? 1 : 0))
+ if (folder->priv->offline_sync == offline_sync)
return;
folder->priv->offline_sync = offline_sync;
diff --git a/camel/camel-offline-settings.c b/camel/camel-offline-settings.c
index cf9b222..bfcde7a 100644
--- a/camel/camel-offline-settings.c
+++ b/camel/camel-offline-settings.c
@@ -136,11 +136,11 @@ camel_offline_settings_get_stay_synchronized (CamelOfflineSettings *settings)
**/
void
camel_offline_settings_set_stay_synchronized (CamelOfflineSettings *settings,
- gboolean stay_synchronized)
+ gboolean stay_synchronized)
{
g_return_if_fail (CAMEL_IS_OFFLINE_SETTINGS (settings));
- if ((settings->priv->stay_synchronized ? 1 : 0) == (stay_synchronized ? 1 : 0))
+ if (settings->priv->stay_synchronized == stay_synchronized)
return;
settings->priv->stay_synchronized = stay_synchronized;
diff --git a/camel/camel-partition-table.c b/camel/camel-partition-table.c
index 2d1a611..a3ecd5b 100644
--- a/camel/camel-partition-table.c
+++ b/camel/camel-partition-table.c
@@ -870,7 +870,7 @@ camel_key_table_set_flags (CamelKeyTable *ki,
kb = (CamelKeyBlock *) &bl->data;
if (kb->used >=127 || index >= kb->used) {
- g_warning("Block %x: Invalid index or content: index %d used %d\n", blockid, index, kb->used);
+ g_warning ("Block %x: Invalid index or content: index %d used %d\n", blockid, index, kb->used);
return FALSE;
}
@@ -919,7 +919,7 @@ camel_key_table_lookup (CamelKeyTable *ki,
kb = (CamelKeyBlock *) &bl->data;
if (kb->used >=127 || index >= kb->used) {
- g_warning("Block %x: Invalid index or content: index %d used %d\n", blockid, index, kb->used);
+ g_warning ("Block %x: Invalid index or content: index %d used %d\n", blockid, index, kb->used);
return 0;
}
diff --git a/camel/camel-provider.c b/camel/camel-provider.c
index 8d2808d..78b0e06 100644
--- a/camel/camel-provider.c
+++ b/camel/camel-provider.c
@@ -119,7 +119,7 @@ camel_provider_init (void)
dir = g_dir_open (CAMEL_PROVIDERDIR, 0, NULL);
if (!dir) {
- g_warning("Could not open camel provider directory (%s): %s",
+ g_warning ("Could not open camel provider directory (%s): %s",
CAMEL_PROVIDERDIR, g_strerror (errno));
return;
}
@@ -240,7 +240,7 @@ camel_provider_register (CamelProvider *provider)
LOCK ();
if (g_hash_table_lookup (provider_table, provider->protocol) != NULL) {
- g_warning("Trying to re-register camel provider for protocol '%s'", provider->protocol);
+ g_warning ("Trying to re-register camel provider for protocol '%s'", provider->protocol);
UNLOCK ();
return;
}
diff --git a/camel/camel-sasl-digest-md5.c b/camel/camel-sasl-digest-md5.c
index 4114b9f..773665a 100644
--- a/camel/camel-sasl-digest-md5.c
+++ b/camel/camel-sasl-digest-md5.c
@@ -252,10 +252,10 @@ decode_value (const gchar **in)
decode_lwsp (&inptr);
if (*inptr == '"') {
- d(printf ("decoding quoted string token\n"));
+ d (printf ("decoding quoted string token\n"));
return decode_quoted_string (in);
} else {
- d(printf ("decoding string token\n"));
+ d (printf ("decoding string token\n"));
return decode_token (in);
}
}
diff --git a/camel/camel-sasl-gssapi.c b/camel/camel-sasl-gssapi.c
index 75745e2..642086e 100644
--- a/camel/camel-sasl-gssapi.c
+++ b/camel/camel-sasl-gssapi.c
@@ -315,7 +315,7 @@ sasl_gssapi_challenge_sync (CamelSasl *sasl,
if (ai == NULL)
goto exit;
- str = g_strdup_printf("%s %s", service_name, ai->ai_canonname);
+ str = g_strdup_printf ("%s %s", service_name, ai->ai_canonname);
camel_freeaddrinfo (ai);
inbuf.value = str;
diff --git a/camel/camel-sasl.c b/camel/camel-sasl.c
index f57f013..faa49b4 100644
--- a/camel/camel-sasl.c
+++ b/camel/camel-sasl.c
@@ -645,7 +645,7 @@ camel_sasl_set_authenticated (CamelSasl *sasl,
{
g_return_if_fail (CAMEL_IS_SASL (sasl));
- if ((sasl->priv->authenticated ? 1 : 0) == (authenticated ? 1 : 0))
+ if (sasl->priv->authenticated == authenticated)
return;
sasl->priv->authenticated = authenticated;
diff --git a/camel/camel-search-private.c b/camel/camel-search-private.c
index 585e7e2..9be6236 100644
--- a/camel/camel-search-private.c
+++ b/camel/camel-search-private.c
@@ -57,7 +57,7 @@ camel_search_build_match_regex (regex_t *pattern,
struct _CamelSExpResult **argv,
GError **error)
{
- GString *match = g_string_new("");
+ GString *match = g_string_new ("");
gint c, i, count = 0, err;
gchar *word;
gint flags;
@@ -89,7 +89,7 @@ camel_search_build_match_regex (regex_t *pattern,
}
count++;
} else {
- g_warning("Invalid type passed to body-contains match function");
+ g_warning ("Invalid type passed to body-contains match function");
}
}
if (argc > 1)
@@ -114,7 +114,7 @@ camel_search_build_match_regex (regex_t *pattern,
regfree (pattern);
}
- d(printf("Built regex: '%s'\n", match->str));
+ d (printf ("Built regex: '%s'\n", match->str));
g_string_free (match, TRUE);
return err;
@@ -176,7 +176,7 @@ header_soundex (const gchar *header,
/* FIXME: Should this convert to utf8, and split based on that, and what not?
* soundex only makes sense for us-ascii though ... */
- word = g_string_new("");
+ word = g_string_new ("");
p = header;
do {
c = *p++;
@@ -523,8 +523,8 @@ camel_search_message_body_contains (CamelDataWrapper *object,
} else if (CAMEL_IS_MIME_MESSAGE (containee)) {
/* for messages we only look at its contents */
truth = camel_search_message_body_contains ((CamelDataWrapper *) containee, pattern);
- } else if (camel_content_type_is(CAMEL_DATA_WRAPPER (containee)->mime_type, "text", "*")
- || camel_content_type_is(CAMEL_DATA_WRAPPER (containee)->mime_type, "x-evolution", "evolution-rss-feed")) {
+ } else if (camel_content_type_is (CAMEL_DATA_WRAPPER (containee)->mime_type, "text", "*")
+ || camel_content_type_is (CAMEL_DATA_WRAPPER (containee)->mime_type, "x-evolution", "evolution-rss-feed")) {
/* for all other text parts, we look inside, otherwise we dont care */
CamelStream *stream;
GByteArray *byte_array;
@@ -590,7 +590,7 @@ camel_search_words_split (const guchar *in)
gint inquote = 0;
words = g_malloc0 (sizeof (*words));
- w = g_string_new("");
+ w = g_string_new ("");
do {
c = camel_utf8_getc (&in);
diff --git a/camel/camel-search-sql-sexp.c b/camel/camel-search-sql-sexp.c
index 92d05da..48e15a5 100644
--- a/camel/camel-search-sql-sexp.c
+++ b/camel/camel-search-sql-sexp.c
@@ -87,9 +87,9 @@ func_and (CamelSExp *f,
GString *string;
gint i;
- d(printf("executing and: %d", argc));
+ d (printf ("executing and: %d", argc));
- string = g_string_new("( ");
+ string = g_string_new ("( ");
for (i = 0; i < argc; i++) {
r1 = camel_sexp_term_eval (f, argv[i]);
@@ -98,14 +98,14 @@ func_and (CamelSExp *f,
continue;
}
if (r1->value.string && *r1->value.string)
- g_string_append_printf(string, "%s%s", r1->value.string, ((argc>1) && (i != argc-1)) ? " AND ":"");
+ g_string_append_printf (string, "%s%s", r1->value.string, ((argc > 1) && (i != argc - 1)) ? " AND ":"");
camel_sexp_result_free (f, r1);
}
- g_string_append(string, " )");
+ g_string_append (string, " )");
r = camel_sexp_result_new (f, CAMEL_SEXP_RES_STRING);
if (strlen (string->str) == 4)
- r->value.string = g_strdup("");
+ r->value.string = g_strdup ("");
else
r->value.string = string->str;
g_string_free (string, FALSE);
@@ -123,9 +123,9 @@ func_or (CamelSExp *f,
GString *string;
gint i;
- d(printf("executing or: %d", argc));
+ d (printf ("executing or: %d", argc));
- string = g_string_new("( ");
+ string = g_string_new ("( ");
for (i = 0; i < argc; i++) {
r1 = camel_sexp_term_eval (f, argv[i]);
@@ -133,10 +133,10 @@ func_or (CamelSExp *f,
camel_sexp_result_free (f, r1);
continue;
}
- g_string_append_printf(string, "%s%s", r1->value.string, ((argc>1) && (i != argc-1)) ? " OR ":"");
+ g_string_append_printf (string, "%s%s", r1->value.string, ((argc > 1) && (i != argc - 1)) ? " OR ":"");
camel_sexp_result_free (f, r1);
}
- g_string_append(string, " )");
+ g_string_append (string, " )");
r = camel_sexp_result_new (f, CAMEL_SEXP_RES_STRING);
r->value.string = string->str;
@@ -152,7 +152,7 @@ func_not (CamelSExp *f,
{
CamelSExpResult *r = NULL, *r1;
- d(printf("executing not: %d", argc));
+ d (printf ("executing not: %d", argc));
r1 = camel_sexp_term_eval (f, argv[0]);
if (r1->type == CAMEL_SEXP_RES_STRING) {
@@ -181,36 +181,36 @@ eval_eq (struct _CamelSExp *f,
r = camel_sexp_result_new (f, CAMEL_SEXP_RES_STRING);
if (argc == 2) {
- GString *str = g_string_new("( ");
+ GString *str = g_string_new ("( ");
r1 = camel_sexp_term_eval (f, argv[0]);
r2 = camel_sexp_term_eval (f, argv[1]);
if (r1->type == CAMEL_SEXP_RES_INT)
- g_string_append_printf(str, "%d", r1->value.number);
+ g_string_append_printf (str, "%d", r1->value.number);
else if (r1->type == CAMEL_SEXP_RES_TIME)
- g_string_append_printf(str, "%ld", r1->value.time);
+ g_string_append_printf (str, "%ld", r1->value.time);
else if (r1->type == CAMEL_SEXP_RES_STRING)
- g_string_append_printf(str, "%s", r1->value.string);
+ g_string_append_printf (str, "%s", r1->value.string);
- if (!strstr(str->str, "completed-on") && !strstr(str->str, "follow-up")) {
+ if (!strstr (str->str, "completed-on") && !strstr (str->str, "follow-up")) {
gboolean ut = FALSE;
- if (strstr(str->str, "usertags"))
+ if (strstr (str->str, "usertags"))
ut = TRUE;
if (ut)
- g_string_append_printf(str, " LIKE ");
+ g_string_append_printf (str, " LIKE ");
else
- g_string_append_printf(str, " = ");
+ g_string_append_printf (str, " = ");
if (r2->type == CAMEL_SEXP_RES_INT)
- g_string_append_printf(str, "%d", r2->value.number);
+ g_string_append_printf (str, "%d", r2->value.number);
if (r2->type == CAMEL_SEXP_RES_BOOL)
- g_string_append_printf(str, "%d", r2->value.boolean);
+ g_string_append_printf (str, "%d", r2->value.boolean);
else if (r2->type == CAMEL_SEXP_RES_TIME)
- g_string_append_printf(str, "%ld", r2->value.time);
+ g_string_append_printf (str, "%ld", r2->value.time);
else if (r2->type == CAMEL_SEXP_RES_STRING) {
- gchar *tmp = g_strdup_printf("%c%s%c", ut ? '%':' ', r2->value.string, ut?'%':' ');
+ gchar *tmp = g_strdup_printf ("%c%s%c", ut ? '%':' ', r2->value.string, ut ? '%':' ');
gchar *safe = get_db_safe_string (tmp);
- g_string_append_printf(str, "%s", safe);
+ g_string_append_printf (str, "%s", safe);
g_free (safe);
g_free (tmp);
}
@@ -237,26 +237,26 @@ eval_lt (struct _CamelSExp *f,
r = camel_sexp_result_new (f, CAMEL_SEXP_RES_STRING);
if (argc == 2) {
- GString *str = g_string_new("( ");
+ GString *str = g_string_new ("( ");
r1 = camel_sexp_term_eval (f, argv[0]);
r2 = camel_sexp_term_eval (f, argv[1]);
if (r1->type == CAMEL_SEXP_RES_INT)
- g_string_append_printf(str, "%d", r1->value.number);
+ g_string_append_printf (str, "%d", r1->value.number);
else if (r1->type == CAMEL_SEXP_RES_TIME)
- g_string_append_printf(str, "%ld", r1->value.time);
+ g_string_append_printf (str, "%ld", r1->value.time);
else if (r1->type == CAMEL_SEXP_RES_STRING)
- g_string_append_printf(str, "%s", r1->value.string);
+ g_string_append_printf (str, "%s", r1->value.string);
- g_string_append_printf(str, " < ");
+ g_string_append_printf (str, " < ");
if (r2->type == CAMEL_SEXP_RES_INT)
- g_string_append_printf(str, "%d", r2->value.number);
+ g_string_append_printf (str, "%d", r2->value.number);
if (r2->type == CAMEL_SEXP_RES_BOOL)
- g_string_append_printf(str, "%d", r2->value.boolean);
+ g_string_append_printf (str, "%d", r2->value.boolean);
else if (r2->type == CAMEL_SEXP_RES_TIME)
- g_string_append_printf(str, "%ld", r2->value.time);
+ g_string_append_printf (str, "%ld", r2->value.time);
else if (r2->type == CAMEL_SEXP_RES_STRING)
- g_string_append_printf(str, "%s", r2->value.string);
+ g_string_append_printf (str, "%s", r2->value.string);
camel_sexp_result_free (f, r1);
camel_sexp_result_free (f, r2);
g_string_append (str, " )");
@@ -279,26 +279,26 @@ eval_gt (struct _CamelSExp *f,
r = camel_sexp_result_new (f, CAMEL_SEXP_RES_STRING);
if (argc == 2) {
- GString *str = g_string_new("( ");
+ GString *str = g_string_new ("( ");
r1 = camel_sexp_term_eval (f, argv[0]);
r2 = camel_sexp_term_eval (f, argv[1]);
if (r1->type == CAMEL_SEXP_RES_INT)
- g_string_append_printf(str, "%d", r1->value.number);
+ g_string_append_printf (str, "%d", r1->value.number);
else if (r1->type == CAMEL_SEXP_RES_TIME)
- g_string_append_printf(str, "%ld", r1->value.time);
+ g_string_append_printf (str, "%ld", r1->value.time);
else if (r1->type == CAMEL_SEXP_RES_STRING)
- g_string_append_printf(str, "%s", r1->value.string);
+ g_string_append_printf (str, "%s", r1->value.string);
- g_string_append_printf(str, " > ");
+ g_string_append_printf (str, " > ");
if (r2->type == CAMEL_SEXP_RES_INT)
- g_string_append_printf(str, "%d", r2->value.number);
+ g_string_append_printf (str, "%d", r2->value.number);
if (r2->type == CAMEL_SEXP_RES_BOOL)
- g_string_append_printf(str, "%d", r2->value.boolean);
+ g_string_append_printf (str, "%d", r2->value.boolean);
else if (r2->type == CAMEL_SEXP_RES_TIME)
- g_string_append_printf(str, "%ld", r2->value.time);
+ g_string_append_printf (str, "%ld", r2->value.time);
else if (r2->type == CAMEL_SEXP_RES_STRING)
- g_string_append_printf(str, "%s", r2->value.string);
+ g_string_append_printf (str, "%s", r2->value.string);
camel_sexp_result_free (f, r1);
camel_sexp_result_free (f, r2);
g_string_append (str, " )");
@@ -317,7 +317,7 @@ match_all (struct _CamelSExp *f,
{
CamelSExpResult *r;
- d(printf("executing match-all: %d", argc));
+ d (printf ("executing match-all: %d", argc));
if (argc == 0) {
r = camel_sexp_result_new (f, CAMEL_SEXP_RES_STRING);
r->value.string = g_strdup ("1");
@@ -325,7 +325,7 @@ match_all (struct _CamelSExp *f,
r = camel_sexp_term_eval (f, argv[0]);
else {
r = camel_sexp_result_new (f, CAMEL_SEXP_RES_STRING);
- r->value.string = g_strdup(argv[0]->value.boolean ? "1" : "0");
+ r->value.string = g_strdup (argv[0]->value.boolean ? "1" : "0");
}
return r;
@@ -342,11 +342,11 @@ match_threads (struct _CamelSExp *f,
gint i;
GString *str = g_string_new ("( ");
- d(printf("executing match-threads: %d", argc));
+ d (printf ("executing match-threads: %d", argc));
for (i = 1; i < argc; i++) {
r = camel_sexp_term_eval (f, argv[i]);
- g_string_append_printf(str, "%s%s", r->value.string, ((argc>1) && (i != argc-1)) ? " AND ":"");
+ g_string_append_printf (str, "%s%s", r->value.string, ((argc > 1) && (i != argc - 1)) ? " AND ":"");
camel_sexp_result_free (f, r);
}
@@ -368,7 +368,7 @@ check_header (struct _CamelSExp *f,
CamelSExpResult *r;
gchar *str = NULL;
- d(printf("executing check-header %d\n", how));
+ d (printf ("executing check-header %d\n", how));
/* are we inside a match-all? */
if (argc > 1 && argv[0]->type == CAMEL_SEXP_RES_STRING) {
@@ -401,7 +401,7 @@ check_header (struct _CamelSExp *f,
value = get_db_safe_string (tstr);
g_free (tstr);
}
- str = g_strdup_printf("(%s IS NOT NULL AND %s LIKE %s)", headername, headername, value);
+ str = g_strdup_printf ("(%s IS NOT NULL AND %s LIKE %s)", headername, headername, value);
g_free (value);
}
}
@@ -421,7 +421,7 @@ header_contains (struct _CamelSExp *f,
struct _CamelSExpResult **argv,
gpointer data)
{
- d(printf("executing header-contains: %d", argc));
+ d (printf ("executing header-contains: %d", argc));
return check_header (f, argc, argv, data, CAMEL_SEARCH_MATCH_CONTAINS);
}
@@ -432,7 +432,7 @@ header_has_words (struct _CamelSExp *f,
struct _CamelSExpResult **argv,
gpointer data)
{
- d(printf("executing header-has-word: %d", argc));
+ d (printf ("executing header-has-word: %d", argc));
return check_header (f, argc, argv, data, CAMEL_SEARCH_MATCH_WORD);
}
@@ -443,7 +443,7 @@ header_matches (struct _CamelSExp *f,
struct _CamelSExpResult **argv,
gpointer data)
{
- d(printf("executing header-matches: %d", argc));
+ d (printf ("executing header-matches: %d", argc));
return check_header (f, argc, argv, data, CAMEL_SEARCH_MATCH_EXACT);
}
@@ -454,7 +454,7 @@ header_starts_with (struct _CamelSExp *f,
struct _CamelSExpResult **argv,
gpointer data)
{
- d(printf("executing header-starts-with: %d", argc));
+ d (printf ("executing header-starts-with: %d", argc));
return check_header (f, argc, argv, data, CAMEL_SEARCH_MATCH_STARTS);
}
@@ -465,7 +465,7 @@ header_ends_with (struct _CamelSExp *f,
struct _CamelSExpResult **argv,
gpointer data)
{
- d(printf("executing header-ends-with: %d", argc));
+ d (printf ("executing header-ends-with: %d", argc));
return check_header (f, argc, argv, data, CAMEL_SEARCH_MATCH_ENDS);
}
@@ -479,7 +479,7 @@ header_exists (struct _CamelSExp *f,
CamelSExpResult *r;
gchar *headername;
- d(printf("executing header-exists: %d", argc));
+ d (printf ("executing header-exists: %d", argc));
headername = camel_db_get_column_name (argv[0]->value.string);
r = camel_sexp_result_new (f, CAMEL_SEXP_RES_STRING);
@@ -496,16 +496,16 @@ user_tag (struct _CamelSExp *f,
{
CamelSExpResult *r;
- d(printf("executing user-tag: %d", argc));
+ d (printf ("executing user-tag: %d", argc));
r = camel_sexp_result_new (f, CAMEL_SEXP_RES_STRING);
/* Hacks no otherway to fix these really :( */
if (g_strcmp0 (argv[0]->value.string, "completed-on") == 0)
- r->value.string = g_strdup_printf("(usertags LIKE '%ccompleted-on 0%c' AND usertags LIKE '%ccompleted-on%c')", '%', '%', '%', '%');
+ r->value.string = g_strdup_printf ("(usertags LIKE '%ccompleted-on 0%c' AND usertags LIKE '%ccompleted-on%c')", '%', '%', '%', '%');
else if (g_strcmp0 (argv[0]->value.string, "follow-up") == 0)
- r->value.string = g_strdup_printf("usertags NOT LIKE '%cfollow-up%c'", '%', '%');
+ r->value.string = g_strdup_printf ("usertags NOT LIKE '%cfollow-up%c'", '%', '%');
else
- r->value.string = g_strdup("usertags");
+ r->value.string = g_strdup ("usertags");
return r;
}
@@ -519,17 +519,17 @@ user_flag (struct _CamelSExp *f,
CamelSExpResult *r;
gchar *tstr, *qstr;
- d(printf("executing user-flag: %d", argc));
+ d (printf ("executing user-flag: %d", argc));
r = camel_sexp_result_new (f, CAMEL_SEXP_RES_STRING);
if (argc != 1) {
r->value.string = g_strdup ("(0)");
} else {
- tstr = g_strdup_printf("%s", argv[0]->value.string);
+ tstr = g_strdup_printf ("%s", argv[0]->value.string);
qstr = get_db_safe_string (tstr);
g_free (tstr);
- r->value.string = g_strdup_printf("(labels MATCH %s)", qstr);
+ r->value.string = g_strdup_printf ("(labels MATCH %s)", qstr);
g_free (qstr);
}
@@ -545,7 +545,7 @@ system_flag (struct _CamelSExp *f,
CamelSExpResult *r;
gchar *tstr;
- d(printf("executing system-flag: %d", argc));
+ d (printf ("executing system-flag: %d", argc));
r = camel_sexp_result_new (f, CAMEL_SEXP_RES_STRING);
@@ -553,7 +553,7 @@ system_flag (struct _CamelSExp *f,
r->value.string = g_strdup ("(0)");
} else {
tstr = camel_db_get_column_name (argv[0]->value.string);
- r->value.string = g_strdup_printf("(%s = 1)", tstr);
+ r->value.string = g_strdup_printf ("(%s = 1)", tstr);
g_free (tstr);
}
@@ -568,10 +568,10 @@ get_sent_date (struct _CamelSExp *f,
{
CamelSExpResult *r;
- d(printf("executing get-sent-date\n"));
+ d (printf ("executing get-sent-date\n"));
r = camel_sexp_result_new (f, CAMEL_SEXP_RES_STRING);
- r->value.string = g_strdup("dsent");
+ r->value.string = g_strdup ("dsent");
return r;
}
@@ -584,10 +584,10 @@ get_received_date (struct _CamelSExp *f,
{
CamelSExpResult *r;
- d(printf("executing get-received-date\n"));
+ d (printf ("executing get-received-date\n"));
r = camel_sexp_result_new (f, CAMEL_SEXP_RES_STRING);
- r->value.string = g_strdup("dreceived");
+ r->value.string = g_strdup ("dreceived");
return r;
}
@@ -600,7 +600,7 @@ get_current_date (struct _CamelSExp *f,
{
CamelSExpResult *r;
- d(printf("executing get-current-date\n"));
+ d (printf ("executing get-current-date\n"));
r = camel_sexp_result_new (f, CAMEL_SEXP_RES_INT);
r->value.number = time (NULL);
@@ -615,7 +615,7 @@ get_relative_months (struct _CamelSExp *f,
{
CamelSExpResult *r;
- d(printf("executing get-relative-months\n"));
+ d (printf ("executing get-relative-months\n"));
if (argc != 1 || argv[0]->type != CAMEL_SEXP_RES_INT) {
r = camel_sexp_result_new (f, CAMEL_SEXP_RES_BOOL);
@@ -638,10 +638,10 @@ get_size (struct _CamelSExp *f,
{
CamelSExpResult *r;
- d(printf("executing get-size\n"));
+ d (printf ("executing get-size\n"));
r = camel_sexp_result_new (f, CAMEL_SEXP_RES_STRING);
- r->value.string = g_strdup("size/1024");
+ r->value.string = g_strdup ("size/1024");
return r;
}
@@ -656,7 +656,7 @@ sql_exp (struct _CamelSExp *f,
gint i;
GString *str = g_string_new (NULL);
- d(printf("executing sql-exp\n"));
+ d (printf ("executing sql-exp\n"));
r = camel_sexp_result_new (f, CAMEL_SEXP_RES_STRING);
for (i = 0; i < argc; i++) {
@@ -678,12 +678,12 @@ static struct {
{ "and", (CamelSExpFunc) func_and, 1 },
{ "or", (CamelSExpFunc) func_or, 1},
{ "not", (CamelSExpFunc) func_not, 1},
- { "=", (CamelSExpFunc)eval_eq, 1},
- { ">", (CamelSExpFunc)eval_gt, 1},
- { "<", (CamelSExpFunc)eval_lt, 1},
+ { "=", (CamelSExpFunc) eval_eq, 1},
+ { ">", (CamelSExpFunc) eval_gt, 1},
+ { "<", (CamelSExpFunc) eval_lt, 1},
- { "match-all", (CamelSExpFunc)match_all, 1 },
- { "match-threads", (CamelSExpFunc)match_threads, 1 },
+ { "match-all", (CamelSExpFunc) match_all, 1 },
+ { "match-threads", (CamelSExpFunc) match_threads, 1 },
/* { "body-contains", body_contains}, */ /* We don't store body on the db. */
{ "header-contains", header_contains, 0},
{ "header-has-words", header_has_words, 0},
@@ -868,9 +868,9 @@ gint main ()
for (i = 0; i < G_N_ELEMENTS (txt); i++) {
gchar *sql = NULL;
- printf("Q: %s\n\"%c\"\n", txt[i], 40);
+ printf ("Q: %s\n\"%c\"\n", txt[i], 40);
sql = camel_sexp_to_sql_sexp (txt[i]);
- printf("A: %s\n\n\n", sql);
+ printf ("A: %s\n\n\n", sql);
g_free (sql);
}
diff --git a/camel/camel-sexp.c b/camel/camel-sexp.c
index 728de7b..ced24ea 100644
--- a/camel/camel-sexp.c
+++ b/camel/camel-sexp.c
@@ -299,7 +299,7 @@ term_eval_and (CamelSExp *sexp,
gint i;
const gchar *oper;
- r(printf("( and\n"));
+ r (printf ("( and\n"));
result = camel_sexp_result_new (sexp, CAMEL_SEXP_RES_UNDEFINED);
@@ -314,7 +314,7 @@ term_eval_and (CamelSExp *sexp,
camel_sexp_result_free (sexp, result);
camel_sexp_result_free (sexp, r1);
g_hash_table_destroy (ht);
- camel_sexp_fatal_error(sexp, "Invalid types in AND");
+ camel_sexp_fatal_error (sexp, "Invalid types in AND");
} else if (r1->type == CAMEL_SEXP_RES_ARRAY_PTR) {
gchar **a1;
gint l1, j;
@@ -365,7 +365,7 @@ term_eval_or (CamelSExp *sexp,
gint i;
const gchar *oper;
- r(printf("(or \n"));
+ r (printf ("(or \n"));
oper = "OR";
sexp->operators = g_slist_prepend (sexp->operators, (gpointer) oper);
@@ -380,7 +380,7 @@ term_eval_or (CamelSExp *sexp,
camel_sexp_result_free (sexp, result);
camel_sexp_result_free (sexp, r1);
g_hash_table_destroy (ht);
- camel_sexp_fatal_error(sexp, "Invalid types in OR");
+ camel_sexp_fatal_error (sexp, "Invalid types in OR");
} else if (r1->type == CAMEL_SEXP_RES_ARRAY_PTR) {
gchar **a1;
gint l1, j;
@@ -450,7 +450,7 @@ term_eval_lt (CamelSExp *sexp,
camel_sexp_result_free (sexp, r1);
camel_sexp_result_free (sexp, r2);
camel_sexp_result_free (sexp, result);
- camel_sexp_fatal_error(sexp, "Incompatible types in compare <");
+ camel_sexp_fatal_error (sexp, "Incompatible types in compare <");
} else if (r1->type == CAMEL_SEXP_RES_INT) {
result->type = CAMEL_SEXP_RES_BOOL;
result->value.boolean = r1->value.number < r2->value.number;
@@ -485,7 +485,7 @@ term_eval_gt (CamelSExp *sexp,
camel_sexp_result_free (sexp, r1);
camel_sexp_result_free (sexp, r2);
camel_sexp_result_free (sexp, result);
- camel_sexp_fatal_error(sexp, "Incompatible types in compare >");
+ camel_sexp_fatal_error (sexp, "Incompatible types in compare >");
} else if (r1->type == CAMEL_SEXP_RES_INT) {
result->type = CAMEL_SEXP_RES_BOOL;
result->value.boolean = r1->value.number > r2->value.number;
@@ -553,7 +553,7 @@ term_eval_plus (CamelSExp *sexp,
}
if (i < argc) {
camel_sexp_resultv_free (sexp, argc, argv);
- camel_sexp_fatal_error(sexp, "Invalid types in (+ ints)");
+ camel_sexp_fatal_error (sexp, "Invalid types in (+ ints)");
}
result = camel_sexp_result_new (sexp, CAMEL_SEXP_RES_INT);
result->value.number = total;
@@ -565,7 +565,7 @@ term_eval_plus (CamelSExp *sexp,
}
if (i < argc) {
camel_sexp_resultv_free (sexp, argc, argv);
- camel_sexp_fatal_error(sexp, "Invalid types in (+ strings)");
+ camel_sexp_fatal_error (sexp, "Invalid types in (+ strings)");
}
result = camel_sexp_result_new (sexp, CAMEL_SEXP_RES_STRING);
result->value.string = string->str;
@@ -618,7 +618,7 @@ term_eval_sub (CamelSExp *sexp,
}
if (i < argc) {
camel_sexp_resultv_free (sexp, argc, argv);
- camel_sexp_fatal_error(sexp, "Invalid types in -");
+ camel_sexp_fatal_error (sexp, "Invalid types in -");
}
result = camel_sexp_result_new (sexp, CAMEL_SEXP_RES_INT);
result->value.number = total;
@@ -659,7 +659,7 @@ term_eval_castint (CamelSExp *sexp,
CamelSExpResult *result;
if (argc != 1)
- camel_sexp_fatal_error(sexp, "Incorrect argument count to (gint )");
+ camel_sexp_fatal_error (sexp, "Incorrect argument count to (gint )");
result = camel_sexp_result_new (sexp, CAMEL_SEXP_RES_INT);
switch (argv[0]->type) {
@@ -674,7 +674,7 @@ term_eval_castint (CamelSExp *sexp,
break;
default:
camel_sexp_result_free (sexp, result);
- camel_sexp_fatal_error(sexp, "Invalid type in (cast-int )");
+ camel_sexp_fatal_error (sexp, "Invalid type in (cast-int )");
}
return result;
@@ -690,22 +690,22 @@ term_eval_caststring (CamelSExp *sexp,
CamelSExpResult *result;
if (argc != 1)
- camel_sexp_fatal_error(sexp, "Incorrect argument count to (cast-string )");
+ camel_sexp_fatal_error (sexp, "Incorrect argument count to (cast-string )");
result = camel_sexp_result_new (sexp, CAMEL_SEXP_RES_STRING);
switch (argv[0]->type) {
case CAMEL_SEXP_RES_INT:
- result->value.string = g_strdup_printf("%d", argv[0]->value.number);
+ result->value.string = g_strdup_printf ("%d", argv[0]->value.number);
break;
case CAMEL_SEXP_RES_BOOL:
- result->value.string = g_strdup_printf("%d", argv[0]->value.boolean != 0);
+ result->value.string = g_strdup_printf ("%d", argv[0]->value.boolean != 0);
break;
case CAMEL_SEXP_RES_STRING:
result->value.string = g_strdup (argv[0]->value.string);
break;
default:
camel_sexp_result_free (sexp, result);
- camel_sexp_fatal_error(sexp, "Invalid type in (gint )");
+ camel_sexp_fatal_error (sexp, "Invalid type in (gint )");
}
return result;
@@ -772,28 +772,28 @@ camel_sexp_term_eval (CamelSExp *sexp,
g_return_val_if_fail (term != NULL, NULL);
- r(printf("eval term :\n"));
+ r (printf ("eval term :\n"));
r (parse_dump_term (term, 0));
switch (term->type) {
case CAMEL_SEXP_TERM_STRING:
- r(printf(" (string \"%s\")\n", term->value.string));
+ r (printf (" (string \"%s\")\n", term->value.string));
result = camel_sexp_result_new (sexp, CAMEL_SEXP_RES_STRING);
/* erk, this shoul;dn't need to strdup this ... */
result->value.string = g_strdup (term->value.string);
break;
case CAMEL_SEXP_TERM_INT:
- r(printf(" (gint %d)\n", term->value.number));
+ r (printf (" (gint %d)\n", term->value.number));
result = camel_sexp_result_new (sexp, CAMEL_SEXP_RES_INT);
result->value.number = term->value.number;
break;
case CAMEL_SEXP_TERM_BOOL:
- r(printf(" (gint %d)\n", term->value.number));
+ r (printf (" (gint %d)\n", term->value.number));
result = camel_sexp_result_new (sexp, CAMEL_SEXP_RES_BOOL);
result->value.boolean = term->value.boolean;
break;
case CAMEL_SEXP_TERM_TIME:
- r(printf(" (time_t %ld)\n", term->value.time));
+ r (printf (" (time_t %ld)\n", term->value.time));
result = camel_sexp_result_new (sexp, CAMEL_SEXP_RES_TIME);
result->value.time = term->value.time;
break;
@@ -814,7 +814,7 @@ camel_sexp_term_eval (CamelSExp *sexp,
camel_sexp_resultv_free (sexp, term->value.func.termcount, argv);
break;
default:
- camel_sexp_fatal_error(sexp, "Unknown type in parse tree: %d", term->type);
+ camel_sexp_fatal_error (sexp, "Unknown type in parse tree: %d", term->type);
}
if (result == NULL)
@@ -831,34 +831,34 @@ eval_dump_result (CamelSExpResult *result,
gint i;
if (result == NULL) {
- printf("null result???\n");
+ printf ("null result???\n");
return;
}
for (i = 0; i < depth; i++)
- printf(" ");
+ printf (" ");
switch (result->type) {
case CAMEL_SEXP_RES_ARRAY_PTR:
- printf("array pointers\n");
+ printf ("array pointers\n");
break;
case CAMEL_SEXP_RES_INT:
- printf("int: %d\n", result->value.number);
+ printf ("int: %d\n", result->value.number);
break;
case CAMEL_SEXP_RES_STRING:
- printf("string: '%s'\n", result->value.string);
+ printf ("string: '%s'\n", result->value.string);
break;
case CAMEL_SEXP_RES_BOOL:
- printf("bool: %c\n", result->value.boolean?'t':'f');
+ printf ("bool: %c\n", result->value.boolean ? 't':'f');
break;
case CAMEL_SEXP_RES_TIME:
- printf("time_t: %ld\n", (glong) result->value.time);
+ printf ("time_t: %ld\n", (glong) result->value.time);
break;
case CAMEL_SEXP_RES_UNDEFINED:
- printf(" <undefined>\n");
+ printf (" <undefined>\n");
break;
}
- printf("\n");
+ printf ("\n");
}
#endif
@@ -870,45 +870,45 @@ parse_dump_term (CamelSExpTerm *term,
gint i;
if (t == NULL) {
- printf("null term??\n");
+ printf ("null term??\n");
return;
}
for (i = 0; i < depth; i++)
- printf(" ");
+ printf (" ");
switch (term->type) {
case CAMEL_SEXP_TERM_STRING:
- printf(" \"%s\"", term->value.string);
+ printf (" \"%s\"", term->value.string);
break;
case CAMEL_SEXP_TERM_INT:
- printf(" %d", term->value.number);
+ printf (" %d", term->value.number);
break;
case CAMEL_SEXP_TERM_BOOL:
- printf(" #%c", term->value.boolean?'t':'f');
+ printf (" #%c", term->value.boolean ? 't':'f');
break;
case CAMEL_SEXP_TERM_TIME:
- printf(" %ld", (glong) term->value.time);
+ printf (" %ld", (glong) term->value.time);
break;
case CAMEL_SEXP_TERM_IFUNC:
case CAMEL_SEXP_TERM_FUNC:
- printf(" (function %s\n", term->value.func.sym->name);
+ printf (" (function %s\n", term->value.func.sym->name);
/*printf(" [%d] ", term->value.func.termcount);*/
for (i = 0; i < term->value.func.termcount; i++) {
parse_dump_term (term->value.func.terms[i], depth + 1);
}
for (i = 0; i < depth; i++)
- printf(" ");
- printf(" )");
+ printf (" ");
+ printf (" )");
break;
case CAMEL_SEXP_TERM_VAR:
- printf(" (variable %s )\n", term->value.var->name);
+ printf (" (variable %s )\n", term->value.var->name);
break;
default:
- printf("unknown type: %d\n", term->type);
+ printf ("unknown type: %d\n", term->type);
}
- printf("\n");
+ printf ("\n");
}
#endif
@@ -1127,13 +1127,13 @@ camel_sexp_term_evaluate_occur_times (CamelSExp *sexp,
g_return_val_if_fail (end != NULL, NULL);
/*
- printf("eval term :\n");
+ printf ("eval term :\n");
parse_dump_term (t, 0);
*/
switch (term->type) {
case CAMEL_SEXP_TERM_STRING:
- r(printf(" (string \"%s\")\n", term->value.string));
+ r (printf (" (string \"%s\")\n", term->value.string));
result = camel_sexp_result_new (sexp, CAMEL_SEXP_RES_STRING);
result->value.string = g_strdup (term->value.string);
break;
@@ -1143,7 +1143,7 @@ camel_sexp_term_evaluate_occur_times (CamelSExp *sexp,
CamelSGeneratorFunc *generator = NULL;
CamelSOperatorFunc *operator = NULL;
- r(printf(" (function \"%s\"\n", term->value.func.sym->name));
+ r (printf (" (function \"%s\"\n", term->value.func.sym->name));
result = camel_sexp_result_new (sexp, CAMEL_SEXP_RES_UNDEFINED);
argc = term->value.func.termcount;
@@ -1184,7 +1184,7 @@ camel_sexp_term_evaluate_occur_times (CamelSExp *sexp,
}
if (!ok)
- camel_sexp_fatal_error(sexp, "Error in parse tree");
+ camel_sexp_fatal_error (sexp, "Error in parse tree");
if (result == NULL)
result = camel_sexp_result_new (sexp, CAMEL_SEXP_RES_UNDEFINED);
@@ -1238,7 +1238,7 @@ parse_term_free (CamelSExp *sexp,
break;
default:
- printf("parse_term_free: unknown type: %d\n", term->type);
+ printf ("parse_term_free: unknown type: %d\n", term->type);
}
camel_memchunk_free (sexp->term_chunks, term);
}
@@ -1253,7 +1253,7 @@ parse_values (CamelSExp *sexp,
GScanner *gs = sexp->scanner;
GSList *list = NULL, *l;
- p(printf("parsing values\n"));
+ p (printf ("parsing values\n"));
while ( (token = g_scanner_peek_next_token (gs)) != G_TOKEN_EOF
&& token != ')') {
@@ -1272,10 +1272,10 @@ parse_values (CamelSExp *sexp,
}
g_slist_free (list);
- p(printf("found %d subterms\n", size));
+ p (printf ("found %d subterms\n", size));
*len = size;
- p(printf("done parsing values\n"));
+ p (printf ("done parsing values\n"));
return terms;
}
@@ -1298,22 +1298,22 @@ parse_value (CamelSExp *sexp)
GScanner *gs = sexp->scanner;
CamelSExpSymbol *sym;
- p(printf("parsing value\n"));
+ p (printf ("parsing value\n"));
token = g_scanner_get_next_token (gs);
switch (token) {
case G_TOKEN_EOF:
break;
case G_TOKEN_LEFT_PAREN:
- p(printf("got brace, its a list!\n"));
+ p (printf ("got brace, its a list!\n"));
return parse_list (sexp, TRUE);
case G_TOKEN_STRING:
- p(printf("got string '%s'\n", g_scanner_cur_value(gs).v_string));
+ p (printf ("got string '%s'\n", g_scanner_cur_value (gs).v_string));
term = parse_term_new (sexp, CAMEL_SEXP_TERM_STRING);
term->value.string = g_strdup (g_scanner_cur_value (gs).v_string);
break;
case '-':
- p(printf ("got negative int?\n"));
+ p (printf ("got negative int?\n"));
token = g_scanner_get_next_token (gs);
if (token != G_TOKEN_INT) {
camel_sexp_fatal_error (sexp, "Invalid format for a integer value");
@@ -1327,12 +1327,12 @@ parse_value (CamelSExp *sexp)
term->value.number = g_scanner_cur_value (gs).v_int;
if (negative)
term->value.number = -term->value.number;
- p(printf("got gint %d\n", term->value.number));
+ p (printf ("got gint %d\n", term->value.number));
break;
case '#': {
gchar *str;
- p(printf("got bool?\n"));
+ p (printf ("got bool?\n"));
token = g_scanner_get_next_token (gs);
if (token != G_TOKEN_IDENTIFIER) {
camel_sexp_fatal_error (sexp, "Invalid format for a boolean value");
@@ -1352,7 +1352,7 @@ parse_value (CamelSExp *sexp)
break; }
case G_TOKEN_SYMBOL:
sym = g_scanner_cur_value (gs).v_symbol;
- p(printf("got symbol '%s'\n", sym->name));
+ p (printf ("got symbol '%s'\n", sym->name));
switch (sym->type) {
case CAMEL_SEXP_TERM_FUNC:
case CAMEL_SEXP_TERM_IFUNC:
@@ -1367,17 +1367,17 @@ parse_value (CamelSExp *sexp)
term->value.var = sym;
break;
default:
- camel_sexp_fatal_error(sexp, "Invalid symbol type: %s: %d", sym->name, sym->type);
+ camel_sexp_fatal_error (sexp, "Invalid symbol type: %s: %d", sym->name, sym->type);
}
break;
case G_TOKEN_IDENTIFIER:
- p(printf("got unknown identifider '%s'\n", g_scanner_cur_value(gs).v_identifier));
- camel_sexp_fatal_error(sexp, "Unknown identifier: %s", g_scanner_cur_value(gs).v_identifier);
+ p (printf ("got unknown identifider '%s'\n", g_scanner_cur_value (gs).v_identifier));
+ camel_sexp_fatal_error (sexp, "Unknown identifier: %s", g_scanner_cur_value (gs).v_identifier);
break;
default:
- camel_sexp_fatal_error(sexp, "Unexpected token encountered: %d", token);
+ camel_sexp_fatal_error (sexp, "Unexpected token encountered: %d", token);
}
- p(printf("done parsing value\n"));
+ p (printf ("done parsing value\n"));
return term;
}
@@ -1391,7 +1391,7 @@ parse_list (CamelSExp *sexp,
CamelSExpTerm *term = NULL;
GScanner *gs = sexp->scanner;
- p(printf("parsing list\n"));
+ p (printf ("parsing list\n"));
if (gotbrace)
token = '(';
else
@@ -1403,9 +1403,9 @@ parse_list (CamelSExp *sexp,
CamelSExpSymbol *sym;
sym = g_scanner_cur_value (gs).v_symbol;
- p(printf("got funciton: %s\n", sym->name));
+ p (printf ("got funciton: %s\n", sym->name));
term = parse_term_new (sexp, sym->type);
- p(printf("created new list %p\n", t));
+ p (printf ("created new list %p\n", t));
/* if we have a variable, find out its base type */
while (sym->type == CAMEL_SEXP_TERM_VAR) {
sym = ((CamelSExpTerm *)(sym->data))->value.var;
@@ -1416,26 +1416,26 @@ parse_list (CamelSExp *sexp,
term->value.func.terms = parse_values (sexp, &term->value.func.termcount);
} else {
parse_term_free (sexp, term);
- camel_sexp_fatal_error(sexp, "Trying to call variable as function: %s", sym->name);
+ camel_sexp_fatal_error (sexp, "Trying to call variable as function: %s", sym->name);
}
break; }
case G_TOKEN_IDENTIFIER:
- camel_sexp_fatal_error(sexp, "Unknown identifier: %s", g_scanner_cur_value(gs).v_identifier);
+ camel_sexp_fatal_error (sexp, "Unknown identifier: %s", g_scanner_cur_value (gs).v_identifier);
break;
case G_TOKEN_LEFT_PAREN:
return parse_list (sexp, TRUE);
default:
- camel_sexp_fatal_error(sexp, "Unexpected token encountered: %d", token);
+ camel_sexp_fatal_error (sexp, "Unexpected token encountered: %d", token);
}
token = g_scanner_get_next_token (gs);
if (token != ')') {
- camel_sexp_fatal_error(sexp, "Missing ')'");
+ camel_sexp_fatal_error (sexp, "Missing ')'");
}
} else {
- camel_sexp_fatal_error(sexp, "Missing '('");
+ camel_sexp_fatal_error (sexp, "Missing '('");
}
- p(printf("returning list %p\n", term));
+ p (printf ("returning list %p\n", term));
return term;
}
@@ -1699,7 +1699,7 @@ camel_sexp_parse (CamelSExp *sexp)
g_return_val_if_fail (CAMEL_IS_SEXP (sexp), -1);
if (setjmp (sexp->failenv)) {
- g_warning("Error in parsing: %s", sexp->error);
+ g_warning ("Error in parsing: %s", sexp->error);
return -1;
}
@@ -1723,7 +1723,7 @@ camel_sexp_eval (CamelSExp *sexp)
g_return_val_if_fail (sexp->tree != NULL, NULL);
if (setjmp (sexp->failenv)) {
- g_warning("Error in execution: %s", sexp->error);
+ g_warning ("Error in execution: %s", sexp->error);
return NULL;
}
@@ -1755,7 +1755,7 @@ camel_sexp_evaluate_occur_times (CamelSExp *sexp,
*start = *end = -1;
if (setjmp (sexp->failenv)) {
- g_warning("Error in execution: %s", sexp->error);
+ g_warning ("Error in execution: %s", sexp->error);
return FALSE;
}
@@ -1852,7 +1852,7 @@ main (gint argc,
if (result) {
eval_dump_result (result, 0);
} else {
- printf("no result?|\n");
+ printf ("no result?|\n");
}
return 0;
diff --git a/camel/camel-smime-context.c b/camel/camel-smime-context.c
index f16d2d1..f529121 100644
--- a/camel/camel-smime-context.c
+++ b/camel/camel-smime-context.c
@@ -659,7 +659,7 @@ sm_verify_cmsg (CamelCipherContext *context,
em = NSS_CMSSignerInfo_GetSignerEmailAddress (si);
g_string_append_printf (description, _("Signer: %s <%s>: %s\n"),
- cn?cn:"<unknown>", em?em:"<unknown>",
+ cn ? cn:"<unknown>", em ? em:"<unknown>",
sm_status_description (status));
camel_cipher_validity_add_certinfo_ex (
diff --git a/camel/camel-store-settings.c b/camel/camel-store-settings.c
index 36783a0..15414eb 100644
--- a/camel/camel-store-settings.c
+++ b/camel/camel-store-settings.c
@@ -136,7 +136,7 @@ camel_store_settings_set_filter_inbox (CamelStoreSettings *settings,
{
g_return_if_fail (CAMEL_IS_STORE_SETTINGS (settings));
- if ((settings->priv->filter_inbox ? 1 : 0) == (filter_inbox ? 1 : 0))
+ if (settings->priv->filter_inbox == filter_inbox)
return;
settings->priv->filter_inbox = filter_inbox;
diff --git a/camel/camel-store.c b/camel/camel-store.c
index 4d4dde0..593b426 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -1459,8 +1459,8 @@ dump_fi (CamelFolderInfo *fi,
s[depth] = 0;
while (fi) {
- printf("%sfull_name: %s\n", s, fi->full_name);
- printf("%sflags: %08x\n", s, fi->flags);
+ printf ("%sfull_name: %s\n", s, fi->full_name);
+ printf ("%sflags: %08x\n", s, fi->flags);
dump_fi (fi->child, depth + 2);
fi = fi->next;
}
@@ -2075,21 +2075,21 @@ camel_store_get_folder_info_sync (CamelStore *store,
if (info && (top == NULL || *top == '\0') && (flags & CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL) == 0) {
if (store->flags & CAMEL_STORE_VTRASH)
/* the name of the Trash folder, used for deleted messages */
- add_special_info (store, info, CAMEL_VTRASH_NAME, _("Trash"), FALSE, CAMEL_FOLDER_VIRTUAL|CAMEL_FOLDER_SYSTEM|CAMEL_FOLDER_VTRASH|CAMEL_FOLDER_TYPE_TRASH);
+ add_special_info (store, info, CAMEL_VTRASH_NAME, _("Trash"), FALSE, CAMEL_FOLDER_VIRTUAL | CAMEL_FOLDER_SYSTEM | CAMEL_FOLDER_VTRASH | CAMEL_FOLDER_TYPE_TRASH);
if (store->flags & CAMEL_STORE_VJUNK)
/* the name of the Junk folder, used for spam messages */
- add_special_info (store, info, CAMEL_VJUNK_NAME, _("Junk"), TRUE, CAMEL_FOLDER_VIRTUAL|CAMEL_FOLDER_SYSTEM|CAMEL_FOLDER_VTRASH|CAMEL_FOLDER_TYPE_JUNK);
+ add_special_info (store, info, CAMEL_VJUNK_NAME, _("Junk"), TRUE, CAMEL_FOLDER_VIRTUAL | CAMEL_FOLDER_SYSTEM | CAMEL_FOLDER_VTRASH | CAMEL_FOLDER_TYPE_JUNK);
} else if (!info && top && (flags & CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL) == 0) {
CamelFolderInfo *root_info = NULL;
if ((store->flags & CAMEL_STORE_VTRASH) != 0 && g_str_equal (top, CAMEL_VTRASH_NAME)) {
root_info = class->get_folder_info_sync (store, NULL, flags & (~CAMEL_STORE_FOLDER_INFO_RECURSIVE), cancellable, error);
if (root_info)
- add_special_info (store, root_info, CAMEL_VTRASH_NAME, _("Trash"), FALSE, CAMEL_FOLDER_VIRTUAL|CAMEL_FOLDER_SYSTEM|CAMEL_FOLDER_VTRASH|CAMEL_FOLDER_TYPE_TRASH);
+ add_special_info (store, root_info, CAMEL_VTRASH_NAME, _("Trash"), FALSE, CAMEL_FOLDER_VIRTUAL | CAMEL_FOLDER_SYSTEM | CAMEL_FOLDER_VTRASH | CAMEL_FOLDER_TYPE_TRASH);
} else if ((store->flags & CAMEL_STORE_VJUNK) != 0 && g_str_equal (top, CAMEL_VJUNK_NAME)) {
root_info = class->get_folder_info_sync (store, NULL, flags & (~CAMEL_STORE_FOLDER_INFO_RECURSIVE), cancellable, error);
if (root_info)
- add_special_info (store, root_info, CAMEL_VJUNK_NAME, _("Junk"), TRUE, CAMEL_FOLDER_VIRTUAL|CAMEL_FOLDER_SYSTEM|CAMEL_FOLDER_VTRASH|CAMEL_FOLDER_TYPE_JUNK);
+ add_special_info (store, root_info, CAMEL_VJUNK_NAME, _("Junk"), TRUE, CAMEL_FOLDER_VIRTUAL | CAMEL_FOLDER_SYSTEM | CAMEL_FOLDER_VTRASH | CAMEL_FOLDER_TYPE_JUNK);
}
if (root_info) {
@@ -2104,7 +2104,7 @@ camel_store_get_folder_info_sync (CamelStore *store,
camel_operation_pop_message (cancellable);
- if (camel_debug_start("store:folder_info")) {
+ if (camel_debug_start ("store:folder_info")) {
const gchar *uid;
uid = camel_service_get_uid (CAMEL_SERVICE (store));
@@ -2873,7 +2873,7 @@ camel_store_rename_folder_sync (CamelStore *store,
folder = folders->pdata[i];
full_name = camel_folder_get_full_name (folder);
- new = g_strdup_printf("%s%s", new_name, full_name + strlen(old_name));
+ new = g_strdup_printf ("%s%s", new_name, full_name + strlen (old_name));
camel_object_bag_rekey (store->folders, folder, new);
camel_folder_rename (folder, new);
g_free (new);
diff --git a/camel/camel-stream-filter.c b/camel/camel-stream-filter.c
index f3d2775..cdd5f53 100644
--- a/camel/camel-stream-filter.c
+++ b/camel/camel-stream-filter.c
@@ -139,9 +139,9 @@ stream_filter_read (CamelStream *stream,
priv->filtered = priv->buffer;
priv->filteredlen = size;
- d(printf ("\n\nOriginal content (%s): '", ((CamelObject *)priv->source)->class->name));
+ d (printf ("\n\nOriginal content (%s): '", ((CamelObject *) priv->source)->class->name));
d (fwrite (priv->filtered, sizeof (gchar), priv->filteredlen, stdout));
- d(printf("'\n"));
+ d (printf ("'\n"));
while (f) {
camel_mime_filter_filter (
@@ -149,9 +149,9 @@ stream_filter_read (CamelStream *stream,
&priv->filtered, &priv->filteredlen, &presize);
g_check (priv->realbuffer);
- d(printf ("Filtered content (%s): '", ((CamelObject *)f->filter)->class->name));
+ d (printf ("Filtered content (%s): '", ((CamelObject *) f->filter)->class->name));
d (fwrite (priv->filtered, sizeof (gchar), priv->filteredlen, stdout));
- d(printf("'\n"));
+ d (printf ("'\n"));
f = f->next;
}
@@ -187,9 +187,9 @@ stream_filter_write (CamelStream *stream,
priv->last_was_read = FALSE;
- d(printf ("\n\nWriting: Original content (%s): '", ((CamelObject *)priv->source)->class->name));
+ d (printf ("\n\nWriting: Original content (%s): '", ((CamelObject *) priv->source)->class->name));
d (fwrite (buf, sizeof (gchar), n, stdout));
- d(printf("'\n"));
+ d (printf ("'\n"));
g_check (priv->realbuffer);
@@ -208,9 +208,9 @@ stream_filter_write (CamelStream *stream,
g_check (priv->realbuffer);
- d(printf ("Filtered content (%s): '", ((CamelObject *)f->filter)->class->name));
+ d (printf ("Filtered content (%s): '", ((CamelObject *) f->filter)->class->name));
d (fwrite (buffer, sizeof (gchar), len, stdout));
- d(printf("'\n"));
+ d (printf ("'\n"));
f = f->next;
}
@@ -245,16 +245,16 @@ stream_filter_flush (CamelStream *stream,
presize = 0;
f = priv->filters;
- d(printf ("\n\nFlushing: Original content (%s): '", ((CamelObject *)priv->source)->class->name));
+ d (printf ("\n\nFlushing: Original content (%s): '", ((CamelObject *) priv->source)->class->name));
d (fwrite (buffer, sizeof (gchar), len, stdout));
- d(printf("'\n"));
+ d (printf ("'\n"));
while (f) {
camel_mime_filter_complete (f->filter, buffer, len, presize, &buffer, &len, &presize);
- d(printf ("Filtered content (%s): '", ((CamelObject *)f->filter)->class->name));
+ d (printf ("Filtered content (%s): '", ((CamelObject *) f->filter)->class->name));
d (fwrite (buffer, sizeof (gchar), len, stdout));
- d(printf("'\n"));
+ d (printf ("'\n"));
f = f->next;
}
diff --git a/camel/camel-tcp-stream-ssl.c b/camel/camel-tcp-stream-ssl.c
index 4347fbe..09e0f1d 100644
--- a/camel/camel-tcp-stream-ssl.c
+++ b/camel/camel-tcp-stream-ssl.c
@@ -353,7 +353,7 @@ camel_certdb_nss_cert_get (CamelCertDB *certdb,
g_free (fingerprint);
if (ccert->rawcert->len != cert->derCert.len
|| memcmp (ccert->rawcert->data, cert->derCert.data, cert->derCert.len) != 0) {
- g_warning("rawcert != derCer");
+ g_warning ("rawcert != derCer");
camel_cert_set_trust (certdb, ccert, CAMEL_CERT_TRUST_UNKNOWN);
camel_certdb_touch (certdb);
}
@@ -442,7 +442,7 @@ get_nickname (CERTCertificate *cert)
for (i = 1; status == PR_TRUE; i++) {
if (nick) {
g_free (nick);
- nick = g_strdup_printf("%s #%d", server, i);
+ nick = g_strdup_printf ("%s #%d", server, i);
} else {
nick = g_strdup (server);
}
@@ -567,7 +567,7 @@ ssl_bad_cert (gpointer data,
while (go && status != SECSuccess) {
gchar *prompt = NULL;
- printf("looping, error '%d'\n", error);
+ printf ("looping, error '%d'\n", error);
switch (error) {
case SEC_ERROR_UNKNOWN_ISSUER:
@@ -575,8 +575,8 @@ ssl_bad_cert (gpointer data,
case SEC_ERROR_UNTRUSTED_ISSUER:
case SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE:
/* add certificate */
- printf("unknown issuer, adding ... \n");
- prompt = g_strdup_printf(_("Certificate problem: %s\nIssuer: %s"), cert->subjectName, cert->issuerName);
+ printf ("unknown issuer, adding ... \n");
+ prompt = g_strdup_printf (_("Certificate problem: %s\nIssuer: %s"), cert->subjectName, cert->issuerName);
if (camel_session_alert_user (ssl->priv->session, CAMEL_SESSION_ALERT_WARNING, prompt, TRUE)) {
@@ -587,11 +587,11 @@ ssl_bad_cert (gpointer data,
break;
}
- printf("adding cert '%s'\n", nick);
+ printf ("adding cert '%s'\n", nick);
if (!cert->trust) {
cert->trust = (CERTCertTrust *) PORT_ArenaZAlloc (cert->arena, sizeof (CERTCertTrust));
- CERT_DecodeTrustString(cert->trust, "P");
+ CERT_DecodeTrustString (cert->trust, "P");
}
certs[0] = &cert->derCert;
@@ -599,15 +599,15 @@ ssl_bad_cert (gpointer data,
CERT_ImportCerts (cert->dbhandle, certUsageUserCertImport, 1, certs, NULL, TRUE, FALSE, nick);
g_free (nick);
- printf(" cert type %08x\n", cert->nsCertType);
+ printf (" cert type %08x\n", cert->nsCertType);
memset ((gpointer) &trust, 0, sizeof (trust));
if (CERT_GetCertTrust (cert, &trust) != SECSuccess) {
- CERT_DecodeTrustString(&trust, "P");
+ CERT_DecodeTrustString (&trust, "P");
}
trust.sslFlags |= CERTDB_VALID_PEER | CERTDB_TRUSTED;
if (CERT_ChangeCertTrust (cert->dbhandle, cert, &trust) != SECSuccess) {
- printf("couldn't change cert trust?\n");
+ printf ("couldn't change cert trust?\n");
}
/*status = SECSuccess;*/
@@ -615,25 +615,25 @@ ssl_bad_cert (gpointer data,
/* re-verify? */
status = CERT_VerifyCertNow (cert->dbhandle, cert, TRUE, certUsageSSLServer, NULL);
error = PR_GetError ();
- printf("re-verify status %d, error %d\n", status, error);
+ printf ("re-verify status %d, error %d\n", status, error);
#endif
- printf(" cert type %08x\n", cert->nsCertType);
+ printf (" cert type %08x\n", cert->nsCertType);
} else {
- printf("failed/cancelled\n");
+ printf ("failed/cancelled\n");
go = 0;
}
break;
case SSL_ERROR_BAD_CERT_DOMAIN:
- printf("bad domain\n");
+ printf ("bad domain\n");
- prompt = g_strdup_printf(_("Bad certificate domain: %s\nIssuer: %s"), cert->subjectName, cert->issuerName);
+ prompt = g_strdup_printf (_("Bad certificate domain: %s\nIssuer: %s"), cert->subjectName, cert->issuerName);
if (camel_session_alert_user (ssl->priv->session, CAMEL_SESSION_ALERT_WARNING, prompt, TRUE)) {
host = SSL_RevealURL (sockfd);
status = CERT_AddOKDomainName (cert, host);
- printf("add ok domain name : %s\n", status == SECFailure?"fail":"ok");
+ printf ("add ok domain name : %s\n", status == SECFailure?"fail":"ok");
error = PR_GetError ();
if (status == SECFailure)
go = 0;
@@ -644,9 +644,9 @@ ssl_bad_cert (gpointer data,
break;
case SEC_ERROR_EXPIRED_CERTIFICATE:
- printf("expired\n");
+ printf ("expired\n");
- prompt = g_strdup_printf(_("Certificate expired: %s\nIssuer: %s"), cert->subjectName, cert->issuerName);
+ prompt = g_strdup_printf (_("Certificate expired: %s\nIssuer: %s"), cert->subjectName, cert->issuerName);
if (camel_session_alert_user (ssl->priv->session, CAMEL_SESSION_ALERT_WARNING, prompt, TRUE)) {
cert->timeOK = PR_TRUE;
@@ -661,9 +661,9 @@ ssl_bad_cert (gpointer data,
break;
case SEC_ERROR_CRL_EXPIRED:
- printf("crl expired\n");
+ printf ("crl expired\n");
- prompt = g_strdup_printf(_("Certificate revocation list expired: %s\nIssuer: %s"), cert->subjectName, cert->issuerName);
+ prompt = g_strdup_printf (_("Certificate revocation list expired: %s\nIssuer: %s"), cert->subjectName, cert->issuerName);
if (camel_session_alert_user (ssl->priv->session, CAMEL_SESSION_ALERT_WARNING, prompt, TRUE)) {
host = SSL_RevealURL (sockfd);
@@ -674,7 +674,7 @@ ssl_bad_cert (gpointer data,
break;
default:
- printf("generic error\n");
+ printf ("generic error\n");
go = 0;
break;
}
diff --git a/camel/camel-text-index.c b/camel/camel-text-index.c
index a4719dc..df1acb6 100644
--- a/camel/camel-text-index.c
+++ b/camel/camel-text-index.c
@@ -405,7 +405,7 @@ static void tmp_name (const gchar *in, gchar *o)
s = strrchr (in, '/');
if (s) {
memcpy (o, in, s - in + 1);
- memcpy (o+(s-in+1), ".#", 2);
+ memcpy (o + (s - in + 1), ".#", 2);
strcpy (o + (s - in + 3), s + 1);
} else {
sprintf (o, ".#%s", in);
@@ -452,7 +452,7 @@ text_index_compress_nosync (CamelIndex *idx)
savepath = alloca (i);
strcpy (oldpath, idx->path);
- oldpath[strlen (oldpath)-strlen (".index")] = 0;
+ oldpath[strlen (oldpath) - strlen (".index")] = 0;
tmp_name (oldpath, newpath);
sprintf (savepath, "%s~", oldpath);
@@ -515,7 +515,7 @@ text_index_compress_nosync (CamelIndex *idx)
* have to do 1 at a time and its cheap */
oldkeyid = 0;
while ((oldkeyid = camel_key_table_next (oldp->word_index, oldkeyid, &name, &flags, &data))) {
- io(printf ("copying word '%s'\n", name));
+ io (printf ("copying word '%s'\n", name));
newdata = 0;
newcount = 0;
if (data) {
@@ -524,7 +524,7 @@ text_index_compress_nosync (CamelIndex *idx)
}
while (data) {
if (camel_key_file_read (oldp->links, &data, &count, &records) == -1) {
- io (printf ("could not read from old keys at %d for word '%s'\n", (gint)data, name));
+ io (printf ("could not read from old keys at %d for word '%s'\n", (gint) data, name));
goto fail;
}
for (i = 0; i < count; i++) {
@@ -1419,7 +1419,7 @@ camel_text_index_validate (CamelTextIndex *idx)
printf ("Warning, read failed for word '%s', at data '%u'\n", word, data);
data = 0;
} else {
- printf ("(%d)\n", (gint)count);
+ printf ("(%d)\n", (gint) count);
g_free (records);
}
}
@@ -1890,7 +1890,7 @@ main (gint argc,
camel_init (NULL, 0);
- idx = (CamelIndex *)camel_text_index_new ("textindex", O_CREAT|O_RDWR|O_TRUNC);
+ idx = (CamelIndex *) camel_text_index_new ("textindex", O_CREAT | O_RDWR | O_TRUNC);
#if 1
camel_index_compress (idx);
diff --git a/camel/camel-trie.c b/camel/camel-trie.c
index 8bc60c3..8170840 100644
--- a/camel/camel-trie.c
+++ b/camel/camel-trie.c
@@ -307,7 +307,7 @@ camel_trie_add (CamelTrie *trie,
}
}
- d(fprintf (stderr, "\nafter adding pattern '%s' to trie %p:\n", pattern, trie));
+ d (fprintf (stderr, "\nafter adding pattern '%s' to trie %p:\n", pattern, trie));
d (dump_trie (&trie->root, 0));
}
diff --git a/camel/camel-url.c b/camel/camel-url.c
index 2e6c98c..5b3d081 100644
--- a/camel/camel-url.c
+++ b/camel/camel-url.c
@@ -114,7 +114,7 @@ camel_url_new_with_base (CamelURL *base,
return url;
#ifdef G_OS_WIN32
- if (url->protocol && !strcmp(url->protocol, "file")) {
+ if (url->protocol && !strcmp (url->protocol, "file")) {
url->path = g_filename_from_uri (start, &url->host, NULL);
return url;
}
@@ -356,7 +356,7 @@ camel_url_to_string (CamelURL *url,
*/
#ifdef G_OS_WIN32
- if (url->protocol && !strcmp(url->protocol, "file"))
+ if (url->protocol && !strcmp (url->protocol, "file"))
return g_filename_to_uri (url->path, url->host, NULL);
#endif /* G_OS_WIN32 */
@@ -647,7 +647,7 @@ append_url_encoded (GString *str,
while (*s) {
if (url_encoded_char[*s] ||
(extra_enc_chars && strchr (extra_enc_chars, *s)))
- g_string_append_printf (str, "%%%02x", (gint)*s++);
+ g_string_append_printf (str, "%%%02x", (gint) * s++);
else
g_string_append_c (str, *s++);
}
diff --git a/camel/camel-utf8.c b/camel/camel-utf8.c
index b83ed2b..fde2c9e 100644
--- a/camel/camel-utf8.c
+++ b/camel/camel-utf8.c
@@ -224,7 +224,7 @@ camel_utf7_utf8 (const gchar *ptr)
gint state = 0;
gchar *ret;
- out = g_string_new("");
+ out = g_string_new ("");
do {
c = *p++;
switch (state) {
@@ -244,7 +244,7 @@ camel_utf7_utf8 (const gchar *ptr)
state = 2;
} else {
/* invalid */
- g_string_append(out, "&-");
+ g_string_append (out, "&-");
state = 0;
}
break;
@@ -305,7 +305,7 @@ camel_utf8_utf7 (const gchar *ptr)
gint i = 0;
gchar *ret;
- out = g_string_new("");
+ out = g_string_new ("");
while ((c = camel_utf8_getc (&p))) {
if (c >= 0x20 && c <= 0x7e) {
@@ -315,7 +315,7 @@ camel_utf8_utf7 (const gchar *ptr)
i = 0;
}
if (c == '&')
- g_string_append(out, "&-");
+ g_string_append (out, "&-");
else
g_string_append_c (out, c);
} else {
@@ -367,7 +367,7 @@ camel_utf8_ucs2 (const gchar *pptr)
g_byte_array_append (work, (guchar *) &s, 2);
}
- g_byte_array_append(work, (guchar *) "\000\000", 2);
+ g_byte_array_append (work, (guchar *) "\000\000", 2);
out = g_malloc (work->len);
memcpy (out, work->data, work->len);
g_byte_array_free (work, TRUE);
@@ -388,7 +388,7 @@ gchar *camel_ucs2_utf8 (const gchar *ptr)
{
guint16 *ucs = (guint16 *) ptr;
guint32 c;
- GString *work = g_string_new("");
+ GString *work = g_string_new ("");
gchar *out;
while ((c = *ucs++))
diff --git a/camel/camel-vee-data-cache.c b/camel/camel-vee-data-cache.c
index f441073..6355e56 100644
--- a/camel/camel-vee-data-cache.c
+++ b/camel/camel-vee-data-cache.c
@@ -483,14 +483,14 @@ camel_vee_data_cache_get_subfolder_data (CamelVeeDataCache *data_cache,
}
/* Returns whether data_cache contains certain UID for certain folder;
- instead of camel_vee_data_cache_get_message_info_data() only
- returns FALSE if not, while camel_vee_data_cache_get_message_info_data()
- auto-adds it to data_cache.
+ * instead of camel_vee_data_cache_get_message_info_data() only
+ * returns FALSE if not, while camel_vee_data_cache_get_message_info_data()
+ * auto-adds it to data_cache.
*/
gboolean
camel_vee_data_cache_contains_message_info_data (CamelVeeDataCache *data_cache,
- CamelFolder *folder,
- const gchar *orig_message_uid)
+ CamelFolder *folder,
+ const gchar *orig_message_uid)
{
gboolean res;
VeeData vdata;
diff --git a/camel/camel-vee-data-cache.h b/camel/camel-vee-data-cache.h
index 1416ab9..ce03304 100644
--- a/camel/camel-vee-data-cache.h
+++ b/camel/camel-vee-data-cache.h
@@ -129,7 +129,7 @@ struct _CamelVeeMessageInfoDataClass {
GType camel_vee_message_info_data_get_type
(void) G_GNUC_CONST;
CamelVeeMessageInfoData *
- camel_vee_message_info_data_new
+ camel_vee_message_info_data_new
(CamelVeeSubfolderData *subfolder_data,
const gchar *orig_message_uid);
CamelVeeSubfolderData *
diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c
index 901b137..ad1b766 100644
--- a/camel/camel-vee-folder.c
+++ b/camel/camel-vee-folder.c
@@ -166,7 +166,7 @@ static void
vee_folder_note_unmatch_uid (CamelVeeFolder *vfolder,
CamelVeeSummary *vsummary,
CamelFolder *subfolder,
- CamelVeeDataCache *data_cache,
+ CamelVeeDataCache *data_cache,
CamelVeeMessageInfoData *unmatched_mi_data,
CamelFolderChangeInfo *changes)
{
@@ -204,8 +204,8 @@ vee_folder_remove_unmatched (CamelVeeFolder *vfolder,
if (is_orig_message_uid) {
/* camel_vee_data_cache_get_message_info_data() auto-adds items if not there,
- thus check whether the cache has it already, and if not, then skip the action.
- This can happen for virtual Junk/Trash folders.
+ * thus check whether the cache has it already, and if not, then skip the action.
+ * This can happen for virtual Junk/Trash folders.
*/
if (!camel_vee_data_cache_contains_message_info_data (data_cache, subfolder, orig_message_uid))
return;
@@ -1281,7 +1281,7 @@ camel_vee_folder_new (CamelStore *parent_store,
camel_vee_folder_construct (vf, flags);
}
- d (printf ("returning folder %s %p, count = %d\n", full, vf, camel_folder_get_message_count ((CamelFolder *)vf)));
+ d (printf ("returning folder %s %p, count = %d\n", full, vf, camel_folder_get_message_count ((CamelFolder *) vf)));
return (CamelFolder *) vf;
}
@@ -1619,7 +1619,7 @@ camel_vee_folder_set_auto_update (CamelVeeFolder *vfolder,
{
g_return_if_fail (CAMEL_IS_VEE_FOLDER (vfolder));
- if ((vfolder->priv->auto_update ? 1 : 0) == (auto_update ? 1 : 0))
+ if (vfolder->priv->auto_update == auto_update)
return;
vfolder->priv->auto_update = auto_update;
diff --git a/camel/camel-vee-store.c b/camel/camel-vee-store.c
index 9b674cb..87228ff 100644
--- a/camel/camel-vee-store.c
+++ b/camel/camel-vee-store.c
@@ -266,7 +266,7 @@ vee_store_get_folder_info_sync (CamelStore *store,
GHashTable *infos_hash;
gint i;
- d (printf ("Get folder info '%s'\n", top?top:"<null>"));
+ d (printf ("Get folder info '%s'\n", top ? top:"<null>"));
infos_hash = g_hash_table_new (g_str_hash, g_str_equal);
folders = camel_object_bag_list (store->folders);
@@ -595,7 +595,7 @@ camel_vee_store_set_unmatched_enabled (CamelVeeStore *vstore,
g_return_if_fail (CAMEL_IS_VEE_STORE (vstore));
- if ((vstore->priv->unmatched_enabled ? 1 : 0) == (is_enabled ? 1 : 0))
+ if (vstore->priv->unmatched_enabled == is_enabled)
return;
vstore->priv->unmatched_enabled = is_enabled;
diff --git a/camel/camel-vee-summary.c b/camel/camel-vee-summary.c
index 4ffbc41..ea00a6d 100644
--- a/camel/camel-vee-summary.c
+++ b/camel/camel-vee-summary.c
@@ -143,7 +143,7 @@ vee_info_user_tag (const CamelMessageInfo *mi,
CamelMessageInfo *rmi = camel_folder_summary_get (((CamelVeeMessageInfo *) mi)->orig_summary, mi->uid + 8);
const gchar *ret;
- HANDLE_NULL_INFO("");
+ HANDLE_NULL_INFO ("");
ret = camel_message_info_user_tag (rmi, id);
camel_message_info_free (rmi);
@@ -289,7 +289,7 @@ message_info_from_uid (CamelFolderSummary *s,
* Otherwise, the first byte itself would return in strcmp, saving the CPU.
*/
if (!camel_folder_summary_check_uid (s, uid)) {
- d(g_message ("Unable to find %s in the summary of %s", uid,
+ d (g_message ("Unable to find %s in the summary of %s", uid,
camel_folder_get_full_name (camel_folder_summary_get_folder (s->folder))));
return NULL;
}
@@ -447,7 +447,7 @@ camel_vee_summary_add (CamelVeeSummary *s,
vmi = (CamelVeeMessageInfo *) camel_folder_summary_peek_loaded (&s->summary, vuid);
if (vmi) {
/* Possible that the entry is loaded, see if it has the summary */
- d(g_message ("%s - already there\n", vuid));
+ d (g_message ("%s - already there\n", vuid));
if (!vmi->orig_summary)
vmi->orig_summary = g_object_ref (orig_folder->summary);
@@ -511,7 +511,7 @@ camel_vee_summary_remove (CamelVeeSummary *summary,
if (mi) {
/* under twice, the first for camel_folder_summary_peek_loaded(),
- the second to actually free the mi */
+ * the second to actually free the mi */
camel_message_info_free (mi);
camel_message_info_free (mi);
}
diff --git a/camel/camel.c b/camel/camel.c
index acf2ac8..d5d59ad 100644
--- a/camel/camel.c
+++ b/camel/camel.c
@@ -65,13 +65,13 @@ nss_has_system_db (void)
FILE *f;
gchar buf[80];
- f = fopen(NSS_SYSTEM_DB "/pkcs11.txt", "r");
+ f = fopen (NSS_SYSTEM_DB "/pkcs11.txt", "r");
if (!f)
return FALSE;
/* Check whether the system NSS db is actually enabled */
while (fgets (buf, 80, f) && !found) {
- if (!strcmp(buf, "library=libnsssysinit.so\n"))
+ if (!strcmp (buf, "library=libnsssysinit.so\n"))
found = TRUE;
}
fclose (f);
@@ -132,7 +132,7 @@ camel_init (const gchar *configdir,
gchar *user_nss_dir = g_build_filename ( g_get_home_dir (),
".pki/nssdb", NULL );
if (g_mkdir_with_parents (user_nss_dir, 0700))
- g_warning("Failed to create SQL database directory %s: %s\n",
+ g_warning ("Failed to create SQL database directory %s: %s\n",
user_nss_dir, strerror (errno));
nss_sql_configdir = g_strconcat ("sql:", user_nss_dir, NULL);
diff --git a/camel/db-scrap-tools/db.c b/camel/db-scrap-tools/db.c
index 06bc208..8d9d377 100644
--- a/camel/db-scrap-tools/db.c
+++ b/camel/db-scrap-tools/db.c
@@ -13,9 +13,9 @@ callback (gpointer data,
{
gint i;
for (i = 0; i < argc; i++) {
- printf("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL");
+ printf ("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL");
}
- printf("--DONE \n");
+ printf ("--DONE \n");
return 0;
}
@@ -30,9 +30,9 @@ select_stmt (const gchar *stmt)
ret = sqlite3_exec (db, stmt, callback, &nrecs, &errmsg);
if (ret != SQLITE_OK) {
- printf("Error in select statement %s [%s].\n", stmt, errmsg);
+ printf ("Error in select statement %s [%s].\n", stmt, errmsg);
} else {
- printf("\n %d records returned.\n", nrecs);
+ printf ("\n %d records returned.\n", nrecs);
}
return ret;
@@ -47,7 +47,7 @@ sql_stmt (const gchar *stmt)
ret = sqlite3_exec (db, stmt, 0, 0, &errmsg);
if (ret != SQLITE_OK) {
- printf("Error in statement: %s [%s].\n", stmt, errmsg);
+ printf ("Error in statement: %s [%s].\n", stmt, errmsg);
exit (1);
}
@@ -66,7 +66,7 @@ create_table (const gchar *tablename)
gint sort_uid (gpointer foo, gint len, gpointer data1, gint len2, gpointer data2)
{
- printf("%s \n%s\n\n", data1, data2);
+ printf ("%s \n%s\n\n", data1, data2);
gint a1 = atoi (data1);
gint a2 = atoi (data2);
return a1 < a2;
@@ -74,7 +74,7 @@ gint sort_uid (gpointer foo, gint len, gpointer data1, gint len2, gpointer data
gint sort_cmp (gpointer foo, gint len, gpointer data1, gint len2, gpointer data2)
{
- printf("%s \n%s\n\n", data1, data2);
+ printf ("%s \n%s\n\n", data1, data2);
gint a1 = atoi (data1);
gint a2 = atoi (data2);
return a1 == a2 ? 0 : a1 < a2 ? -1 : 1;
@@ -84,21 +84,21 @@ gint main (gint argc, gchar **argv) {
gchar *zErrMsg = 0;
gint rc;
-// rc = sqlite3_open_v2("test.db", &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE , NULL);
- rc = sqlite3_open("test.db", &db);
+// rc = sqlite3_open_v2 ("test.db", &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE , NULL);
+ rc = sqlite3_open ("test.db", &db);
if (rc) {
- fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db));
+ fprintf (stderr, "Can't open database: %s\n", sqlite3_errmsg (db));
sqlite3_close (db);
exit (1);
}
- sqlite3_create_collation(db, "uidcmp", SQLITE_UTF8, NULL, sort_cmp);
- sqlite3_create_collation(db, "uidsort", SQLITE_UTF8, NULL, sort_uid);
+ sqlite3_create_collation (db, "uidcmp", SQLITE_UTF8, NULL, sort_cmp);
+ sqlite3_create_collation (db, "uidsort", SQLITE_UTF8, NULL, sort_uid);
gchar *subject_san = "San?%*()-234 #$!@#$ #$%32424kar's Subject";
create_table ("table1");
- sql_stmt (sqlite3_mprintf("INSERT INTO table1 (uid, gflags, isize, jsubject, mlist) VALUES ('5120', 100, 123, '%q', 'mlistbinary')", subject_san));
+ sql_stmt (sqlite3_mprintf ("INSERT INTO table1 (uid, gflags, isize, jsubject, mlist) VALUES ('5120', 100, 123, '%q', 'mlistbinary')", subject_san));
sql_stmt ("INSERT INTO table1 (uid, gflags, isize, jsubject, mlist) VALUES ('6103', 100, 123, 'nice subject', 'mlistbinary')");
sql_stmt ("INSERT INTO table1 (uid, gflags, isize, jsubject, mlist) VALUES ('3194', 100, 123, 'nice subject', 'mlistbinary')");
sql_stmt ("INSERT INTO table1 (uid, gflags, isize, jsubject, mlist) VALUES ('8130', 100, 123, 'nice subject', 'mlistbinary')");
@@ -112,7 +112,7 @@ gint main (gint argc, gchar **argv) {
select_stmt ("select * from table1 where uid == 5120 collate uidcmp");
printf ("\n\aFrom teh C File: [%s] \n\a", subject_san);
- printf("------\n");
+ printf ("------\n");
select_stmt ("select count(isize) from table1");
sqlite3_close (db);
diff --git a/camel/providers/imap/camel-imap-command.c b/camel/providers/imap/camel-imap-command.c
index 9815f85..a92ef68 100644
--- a/camel/providers/imap/camel-imap-command.c
+++ b/camel/providers/imap/camel-imap-command.c
@@ -376,7 +376,7 @@ camel_imap_command_response (CamelImapStore *store,
if (!g_ascii_strncasecmp (respbuf, "* BYE", 5)) {
const gchar *err = NULL;
- if (respbuf [5] && g_ascii_strncasecmp (respbuf + 6, "[ALERT] ", 8) == 0)
+ if (respbuf[5] && g_ascii_strncasecmp (respbuf + 6, "[ALERT] ", 8) == 0)
err = respbuf + 14;
if (!err || !*err)
@@ -502,7 +502,7 @@ imap_read_response (CamelImapStore *store,
/* We should never get BAD, or anything else but +, OK, or NO
* for that matter. Well, we could get BAD, treat as NO.
*/
- if (!p || (g_ascii_strncasecmp(p, " NO", 3) != 0 && g_ascii_strncasecmp(p, " BAD", 4)) ) {
+ if (!p || (g_ascii_strncasecmp (p, " NO", 3) != 0 && g_ascii_strncasecmp (p, " BAD", 4)) ) {
g_warning ("Unexpected response from IMAP server: %s",
respbuf);
g_set_error (
@@ -614,10 +614,10 @@ imap_read_untagged (CamelImapStore *store,
}
str->str[length + 1] = '\0';
- if (camel_debug("imap")) {
- printf("Literal: -->");
+ if (camel_debug ("imap")) {
+ printf ("Literal: -->");
fwrite (str->str + 1, 1, length, stdout);
- printf("<--\n");
+ printf ("<--\n");
}
/* Fix up the literal, turning CRLFs into LF. Also, if
@@ -667,7 +667,7 @@ imap_read_untagged (CamelImapStore *store,
/* MAJOR HACK ALERT, gropuwise sometimes sends an extra blank line after literals, check that here
* But only do it if we're inside an sexpression */
if (line[0] == 0 && sexp > 0)
- g_warning("Server sent empty line after a literal, assuming in error");
+ g_warning ("Server sent empty line after a literal, assuming in error");
} while (line[0] == 0 && sexp > 0);
}
@@ -718,7 +718,7 @@ camel_imap_response_free (CamelImapStore *store,
if (!g_ascii_strcasecmp (p, " EXISTS")) {
exists = number;
} else if (!g_ascii_strcasecmp (p, " EXPUNGE")
- || !g_ascii_strcasecmp(p, " XGWMOVE")) {
+ || !g_ascii_strcasecmp (p, " XGWMOVE")) {
/* XGWMOVE response is the same as an EXPUNGE response */
if (!expunged) {
expunged = g_array_new (FALSE, FALSE,
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 427a6db..d23ea2e 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -158,7 +158,7 @@ imap_folder_set_apply_filters (CamelImapFolder *folder,
g_return_if_fail (folder != NULL);
g_return_if_fail (CAMEL_IS_IMAP_FOLDER (folder));
- if ((folder->priv->apply_filters ? 1 : 0) == (apply_filters ? 1 : 0))
+ if (folder->priv->apply_filters == apply_filters)
return;
folder->priv->apply_filters = apply_filters;
@@ -574,7 +574,7 @@ camel_imap_folder_set_check_folder (CamelImapFolder *imap_folder,
g_return_if_fail (CAMEL_IS_IMAP_FOLDER (imap_folder));
- if ((imap_folder->priv->check_folder ? 1 : 0) == (check_folder ? 1 : 0))
+ if (imap_folder->priv->check_folder == check_folder)
return;
imap_folder->priv->check_folder = check_folder;
@@ -1237,7 +1237,7 @@ imap_rescan (CamelFolder *folder,
info = camel_folder_summary_get (folder->summary, uid);
if (!info) {
- if (g_getenv("CRASH_IMAP")) { /* Debug logs to tackle on hard to get imap crasher */
+ if (g_getenv ("CRASH_IMAP")) { /* Debug logs to tackle on hard to get imap crasher */
printf ("CRASH: %s: %s",
camel_folder_get_full_name (folder), uid);
g_assert (0);
@@ -3252,7 +3252,7 @@ get_content (CamelImapFolder *imap_folder,
part_spec = content_info_get_part_spec (ci);
- d(printf("get content '%s' '%s' (frommsg = %d)\n", part_spec, camel_content_type_format(ci->type), frommsg));
+ d (printf ("get content '%s' '%s' (frommsg = %d)\n", part_spec, camel_content_type_format (ci->type), frommsg));
/* There are three cases: multipart/signed, multipart, message/rfc822, and "other" */
if (camel_content_type_is (ci->type, "multipart", "signed")) {
@@ -3270,7 +3270,7 @@ get_content (CamelImapFolder *imap_folder,
spec = g_alloca (strlen (part_spec) + 6);
if (frommsg)
- sprintf(spec, part_spec[0] ? "%s.TEXT" : "TEXT", part_spec);
+ sprintf (spec, part_spec[0] ? "%s.TEXT" : "TEXT", part_spec);
else
strcpy (spec, part_spec);
g_free (part_spec);
@@ -3300,7 +3300,7 @@ get_content (CamelImapFolder *imap_folder,
/* need to set this so it grabs the boundary and other info about the multipart */
/* we assume that part->content_type is more accurate/full than ci->type */
camel_data_wrapper_set_mime_type_field (CAMEL_DATA_WRAPPER (body_mp), CAMEL_DATA_WRAPPER (part)->mime_type);
- isdigest = camel_content_type_is(((CamelDataWrapper *)part)->mime_type, "multipart", "digest");
+ isdigest = camel_content_type_is (((CamelDataWrapper *) part)->mime_type, "multipart", "digest");
speclen = strlen (part_spec);
child_spec = g_malloc (speclen + 17); /* dot + 10 + dot + MIME + nul */
@@ -3337,19 +3337,19 @@ get_content (CamelImapFolder *imap_folder,
return NULL;
}
- if (camel_debug("imap:folder")) {
+ if (camel_debug ("imap:folder")) {
gchar *ct = camel_content_type_format (camel_mime_part_get_content_type ((CamelMimePart *) part));
gchar *ct2 = camel_content_type_format (ci->type);
- printf("Setting part content type to '%s' contentinfo type is '%s'\n", ct, ct2);
+ printf ("Setting part content type to '%s' contentinfo type is '%s'\n", ct, ct2);
g_free (ct);
g_free (ct2);
}
/* if we had no content-type header on a multipart/digest sub-part, then we need to
* treat it as message/rfc822 instead */
- if (isdigest && camel_medium_get_header((CamelMedium *)part, "content-type") == NULL) {
- CamelContentType *ct = camel_content_type_new("message", "rfc822");
+ if (isdigest && camel_medium_get_header ((CamelMedium *) part, "content-type") == NULL) {
+ CamelContentType *ct = camel_content_type_new ("message", "rfc822");
camel_data_wrapper_set_mime_type_field (content, ct);
camel_content_type_unref (ct);
@@ -3380,9 +3380,9 @@ get_content (CamelImapFolder *imap_folder,
/* NB: we need this differently to multipart/signed case above on purpose */
spec = g_alloca (strlen (part_spec) + 6);
if (frommsg)
- sprintf(spec, part_spec[0] ? "%s.1" : "1", part_spec);
+ sprintf (spec, part_spec[0] ? "%s.1" : "1", part_spec);
else
- strcpy(spec, part_spec[0]?part_spec:"1");
+ strcpy (spec, part_spec[0]?part_spec:"1");
enc = ci->encoding ? camel_transfer_encoding_from_string (ci->encoding) : CAMEL_TRANSFER_ENCODING_DEFAULT;
content = camel_imap_wrapper_new (imap_folder, ci->type, enc, uid, spec, part);
@@ -3412,7 +3412,7 @@ get_message (CamelImapFolder *imap_folder,
store = CAMEL_IMAP_STORE (parent_store);
part_spec = content_info_get_part_spec (ci);
- d(printf("get message '%s'\n", part_spec));
+ d (printf ("get message '%s'\n", part_spec));
section_text = g_strdup_printf ("%s%s%s", part_spec, *part_spec ? "." : "",
store->server_level >= IMAP_LEVEL_IMAP4REV1 ? "HEADER" : "0");
@@ -3437,11 +3437,11 @@ get_message (CamelImapFolder *imap_folder,
return NULL;
}
- if (camel_debug("imap:folder")) {
+ if (camel_debug ("imap:folder")) {
gchar *ct = camel_content_type_format (camel_mime_part_get_content_type ((CamelMimePart *) msg));
gchar *ct2 = camel_content_type_format (ci->type);
- printf("Setting message content type to '%s' contentinfo type is '%s'\n", ct, ct2);
+ printf ("Setting message content type to '%s' contentinfo type is '%s'\n", ct, ct2);
g_free (ct);
g_free (ct2);
}
@@ -3627,8 +3627,8 @@ imap_get_message_sync (CamelFolder *folder,
}
}
- if (camel_debug_start("imap:folder")) {
- printf("Folder get message '%s' folder info ->\n", uid);
+ if (camel_debug_start ("imap:folder")) {
+ printf ("Folder get message '%s' folder info ->\n", uid);
camel_message_info_dump ((CamelMessageInfo *) mi);
camel_debug_end ();
}
@@ -3725,7 +3725,7 @@ imap_synchronize_message_sync (CamelFolder *folder,
*/
/* If its cached in full, just get it as is, this is only a shortcut,
* since we get stuff from the cache anyway. It affects a busted connection though. */
- if ((stream = camel_imap_folder_fetch_data(imap_folder, uid, "", TRUE, cancellable, NULL))) {
+ if ((stream = camel_imap_folder_fetch_data (imap_folder, uid, "", TRUE, cancellable, NULL))) {
g_object_unref (stream);
return TRUE;
}
@@ -4017,7 +4017,7 @@ imap_update_summary (CamelFolder *folder,
g_strfreev (extra_headers);
- d(printf("Header is : %s", header_spec->str));
+ d (printf ("Header is : %s", header_spec->str));
/* Figure out if any of the new messages are already cached (which
* may be the case if we're re-syncing after disconnected operation).
@@ -4273,7 +4273,7 @@ imap_update_summary (CamelFolder *folder,
}
uid = (gchar *) camel_message_info_uid (mi);
if (uid[0] == 0) {
- g_warning("Server provided no uid: message %d", i + first);
+ g_warning ("Server provided no uid: message %d", i + first);
g_set_error (
error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
_("Incomplete server response: "
@@ -4759,7 +4759,7 @@ imap_get_quota_info_sync (CamelFolder *folder,
}
if (skipped)
- g_debug ("Unexpected quota response '%s'; skipping it...", (const gchar *)response->untagged->pdata[i]);
+ g_debug ("Unexpected quota response '%s'; skipping it...", (const gchar *) response->untagged->pdata[i]);
}
}
camel_imap_response_free (imap_store, response);
diff --git a/camel/providers/imap/camel-imap-journal.c b/camel/providers/imap/camel-imap-journal.c
index 3a34608..a481c9e 100644
--- a/camel/providers/imap/camel-imap-journal.c
+++ b/camel/providers/imap/camel-imap-journal.c
@@ -185,7 +185,7 @@ imap_entry_load (CamelOfflineJournal *journal,
{
CamelIMAPJournalEntry *entry;
- d(g_print ("DEBUG: Loading to the journal \n"));
+ d (g_print ("DEBUG: Loading to the journal \n"));
entry = g_malloc0 (sizeof (CamelIMAPJournalEntry));
@@ -254,7 +254,7 @@ imap_entry_write (CamelOfflineJournal *journal,
if (camel_file_util_encode_uint32 (out, imap_entry->type) == -1)
return -1;
- d(g_print ("DEBUG: Writing to the journal \n"));
+ d (g_print ("DEBUG: Writing to the journal \n"));
switch (imap_entry->type) {
case CAMEL_IMAP_JOURNAL_ENTRY_EXPUNGE:
uids = imap_entry->uids;
@@ -328,7 +328,7 @@ imap_entry_play (CamelOfflineJournal *journal,
{
CamelIMAPJournalEntry *imap_entry = entry;
- d(g_print ("DEBUG: PLaying the journal \n"));
+ d (g_print ("DEBUG: PLaying the journal \n"));
switch (imap_entry->type) {
case CAMEL_IMAP_JOURNAL_ENTRY_EXPUNGE:
@@ -373,7 +373,7 @@ imap_entry_play (CamelOfflineJournal *journal,
(CamelIMAPJournal *) journal,
imap_entry->dest_folder_name, cancellable);
if (!destination) {
- d(g_print ("Destination folder not found \n"));
+ d (g_print ("Destination folder not found \n"));
return -1;
}
@@ -391,7 +391,7 @@ imap_entry_play (CamelOfflineJournal *journal,
}
g_ptr_array_free (ret_uids, TRUE);
}
- d(g_print ("Replay success \n"));
+ d (g_print ("Replay success \n"));
return 0;
}
default:
@@ -408,7 +408,7 @@ camel_imap_journal_new (CamelImapFolder *folder,
g_return_val_if_fail (CAMEL_IS_IMAP_FOLDER (folder), NULL);
- d(g_print ("Creating the journal \n"));
+ d (g_print ("Creating the journal \n"));
journal = g_object_new (CAMEL_TYPE_IMAP_JOURNAL, NULL);
camel_offline_journal_construct (journal, (CamelFolder *) folder, filename);
@@ -429,7 +429,7 @@ camel_imap_journal_log (CamelOfflineJournal *journal,
entry = g_new0 (CamelIMAPJournalEntry, 1);
entry->type = action;
- d(g_print ("logging the journal \n"));
+ d (g_print ("logging the journal \n"));
va_start (ap, action);
switch (entry->type) {
diff --git a/camel/providers/imap/camel-imap-message-cache.c b/camel/providers/imap/camel-imap-message-cache.c
index be9ec8f..888279c 100644
--- a/camel/providers/imap/camel-imap-message-cache.c
+++ b/camel/providers/imap/camel-imap-message-cache.c
@@ -696,7 +696,7 @@ camel_imap_message_cache_filter_cached (CamelImapMessageCache *cache,
* read the message).
*/
part_find.found = 0;
- part_find.disk_part_name = g_strdup_printf("%s" BASE_PART_SUFFIX,
+ part_find.disk_part_name = g_strdup_printf ("%s" BASE_PART_SUFFIX,
(gchar *) uids->pdata[i]);
g_ptr_array_foreach (parts_list, _match_part, &part_find);
g_free (part_find.disk_part_name);
diff --git a/camel/providers/imap/camel-imap-search.c b/camel/providers/imap/camel-imap-search.c
index b504352..cc142f4 100644
--- a/camel/providers/imap/camel-imap-search.c
+++ b/camel/providers/imap/camel-imap-search.c
@@ -231,14 +231,14 @@ save_match (CamelImapSearch *is,
if (is->cache == NULL)
return -1;
- stream = camel_data_cache_add(is->cache, "search/body-contains", mr->hash, NULL);
+ stream = camel_data_cache_add (is->cache, "search/body-contains", mr->hash, NULL);
if (stream == NULL)
return -1;
- d(printf("Saving search cache entry to '%s': %s\n", mr->hash, mr->terms[0]));
+ d (printf ("Saving search cache entry to '%s': %s\n", mr->hash, mr->terms[0]));
/* we write the whole thing, then re-write the header magic, saves fancy sync code */
- memcpy(&header.mark, " ", 4);
+ memcpy (&header.mark, " ", 4);
header.termcount = 0;
header.matchcount = mr->matches->len;
header.lastuid = mr->lastuid;
@@ -248,8 +248,8 @@ save_match (CamelImapSearch *is,
|| camel_stream_write (stream, mr->matches->data, mr->matches->len * sizeof (guint32), NULL, NULL) != mr->matches->len * sizeof (guint32)
|| !g_seekable_seek (G_SEEKABLE (stream), 0, G_SEEK_SET, NULL, NULL)
|| camel_stream_write (stream, (gchar *) &mark, sizeof (mark), NULL, NULL) != sizeof (mark)) {
- d(printf(" saving failed, removing cache entry\n"));
- camel_data_cache_remove(is->cache, "search/body-contains", mr->hash, NULL);
+ d (printf (" saving failed, removing cache entry\n"));
+ camel_data_cache_remove (is->cache, "search/body-contains", mr->hash, NULL);
ret = -1;
}
@@ -280,11 +280,11 @@ load_match (CamelImapSearch *is,
}
}
- d(printf("Loading search cache entry to '%s': %s\n", mr->hash, mr->terms[0]));
+ d (printf ("Loading search cache entry to '%s': %s\n", mr->hash, mr->terms[0]));
memset (&header, 0, sizeof (header));
if (is->cache)
- stream = camel_data_cache_get(is->cache, "search/body-contains", mr->hash, NULL);
+ stream = camel_data_cache_get (is->cache, "search/body-contains", mr->hash, NULL);
if (stream != NULL) {
/* 'cause i'm gonna be lazy, i'm going to have the termcount == 0 for now,
* and not load or save them since i can't think of a nice way to do it, the hash
@@ -295,18 +295,18 @@ load_match (CamelImapSearch *is,
&& header.validity == is->validity
&& header.mark == MATCH_MARK
&& header.termcount == 0) {
- d(printf(" found %d matches\n", header.matchcount));
+ d (printf (" found %d matches\n", header.matchcount));
g_array_set_size (mr->matches, header.matchcount);
if (camel_stream_read (stream, mr->matches->data, sizeof (guint32) * header.matchcount, NULL, NULL) == -1) {
memset (&header, 0, sizeof (header));
}
} else {
- d(printf(" file format invalid/validity changed\n"));
+ d (printf (" file format invalid/validity changed\n"));
memset (&header, 0, sizeof (header));
}
g_object_unref (stream);
} else {
- d(printf(" no cache entry found\n"));
+ d (printf (" no cache entry found\n"));
}
mr->validity = header.validity;
@@ -338,7 +338,7 @@ sync_match (CamelImapSearch *is,
if (mr->lastuid >= is->lastuid && mr->validity == is->validity)
return 0;
- d(printf ("updating match record for uid's %d:%d\n", mr->lastuid+1, is->lastuid));
+ d (printf ("updating match record for uid's %d:%d\n", mr->lastuid + 1, is->lastuid));
/* TODO: Handle multiple search terms */
@@ -407,7 +407,7 @@ get_match (CamelImapSearch *is,
while (is->matches_count >= MATCH_CACHE_SIZE) {
mr = g_queue_pop_tail (&is->matches);
if (mr) {
- printf("expiring match '%s' (%s)\n", mr->hash, mr->terms[0]);
+ printf ("expiring match '%s' (%s)\n", mr->hash, mr->terms[0]);
g_hash_table_remove (is->matches_hash, mr->hash);
free_match (is, mr);
is->matches_count--;
@@ -451,7 +451,7 @@ imap_body_contains (struct _CamelSExp *f,
parent_store = camel_folder_get_parent_store (s->folder);
store = CAMEL_IMAP_STORE (parent_store);
- d(printf("Performing body search '%s'\n", argv[0]->value.string));
+ d (printf ("Performing body search '%s'\n", argv[0]->value.string));
/* TODO: Cache offline searches too? */
diff --git a/camel/providers/imap/camel-imap-settings.c b/camel/providers/imap/camel-imap-settings.c
index def0479..c26ff16 100644
--- a/camel/providers/imap/camel-imap-settings.c
+++ b/camel/providers/imap/camel-imap-settings.c
@@ -670,7 +670,7 @@ camel_imap_settings_set_check_all (CamelImapSettings *settings,
{
g_return_if_fail (CAMEL_IS_IMAP_SETTINGS (settings));
- if ((settings->priv->check_all ? 1 : 0) == (check_all ? 1 : 0))
+ if (settings->priv->check_all == check_all)
return;
settings->priv->check_all = check_all;
@@ -713,7 +713,7 @@ camel_imap_settings_set_check_subscribed (CamelImapSettings *settings,
{
g_return_if_fail (CAMEL_IS_IMAP_SETTINGS (settings));
- if ((settings->priv->check_subscribed ? 1 : 0) == (check_subscribed ? 1 : 0))
+ if (settings->priv->check_subscribed == check_subscribed)
return;
settings->priv->check_subscribed = check_subscribed;
@@ -910,7 +910,7 @@ camel_imap_settings_set_filter_junk (CamelImapSettings *settings,
{
g_return_if_fail (CAMEL_IS_IMAP_SETTINGS (settings));
- if ((settings->priv->filter_junk ? 1 : 0) == (filter_junk ? 1 : 0))
+ if (settings->priv->filter_junk == filter_junk)
return;
settings->priv->filter_junk = filter_junk;
@@ -951,7 +951,7 @@ camel_imap_settings_set_filter_all (CamelImapSettings *settings,
{
g_return_if_fail (CAMEL_IS_IMAP_SETTINGS (settings));
- if ((settings->priv->filter_all ? 1 : 0) == (filter_all ? 1 : 0))
+ if (settings->priv->filter_all == filter_all)
return;
settings->priv->filter_all = filter_all;
@@ -994,7 +994,7 @@ camel_imap_settings_set_filter_junk_inbox (CamelImapSettings *settings,
{
g_return_if_fail (CAMEL_IS_IMAP_SETTINGS (settings));
- if ((settings->priv->filter_junk_inbox ? 1 : 0) == (filter_junk_inbox ? 1 : 0))
+ if (settings->priv->filter_junk_inbox == filter_junk_inbox)
return;
settings->priv->filter_junk_inbox = filter_junk_inbox;
@@ -1388,7 +1388,7 @@ camel_imap_settings_set_use_namespace (CamelImapSettings *settings,
{
g_return_if_fail (CAMEL_IS_IMAP_SETTINGS (settings));
- if ((settings->priv->use_namespace ? 1 : 0) == (use_namespace ? 1 : 0))
+ if (settings->priv->use_namespace == use_namespace)
return;
settings->priv->use_namespace = use_namespace;
@@ -1431,7 +1431,7 @@ camel_imap_settings_set_use_real_junk_path (CamelImapSettings *settings,
{
g_return_if_fail (CAMEL_IS_IMAP_SETTINGS (settings));
- if ((settings->priv->use_real_junk_path ? 1 : 0) == (use_real_junk_path ? 1 : 0))
+ if (settings->priv->use_real_junk_path == use_real_junk_path)
return;
settings->priv->use_real_junk_path = use_real_junk_path;
@@ -1474,7 +1474,7 @@ camel_imap_settings_set_use_real_trash_path (CamelImapSettings *settings,
{
g_return_if_fail (CAMEL_IS_IMAP_SETTINGS (settings));
- if ((settings->priv->use_real_trash_path ? 1 : 0) == (use_real_trash_path ? 1 : 0))
+ if (settings->priv->use_real_trash_path == use_real_trash_path)
return;
settings->priv->use_real_trash_path = use_real_trash_path;
@@ -1532,7 +1532,7 @@ camel_imap_settings_set_use_shell_command (CamelImapSettings *settings,
{
g_return_if_fail (CAMEL_IS_IMAP_SETTINGS (settings));
- if ((settings->priv->use_shell_command ? 1 : 0) == (use_shell_command ? 1 : 0))
+ if (settings->priv->use_shell_command == use_shell_command)
return;
settings->priv->use_shell_command = use_shell_command;
@@ -1575,7 +1575,7 @@ camel_imap_settings_set_use_subscriptions (CamelImapSettings *settings,
{
g_return_if_fail (CAMEL_IS_IMAP_SETTINGS (settings));
- if ((settings->priv->use_subscriptions ? 1 : 0) == (use_subscriptions ? 1 : 0))
+ if (settings->priv->use_subscriptions == use_subscriptions)
return;
settings->priv->use_subscriptions = use_subscriptions;
diff --git a/camel/providers/imap/camel-imap-store-summary.c b/camel/providers/imap/camel-imap-store-summary.c
index 9a8064d..7babd6b 100644
--- a/camel/providers/imap/camel-imap-store-summary.c
+++ b/camel/providers/imap/camel-imap-store-summary.c
@@ -140,7 +140,7 @@ camel_imap_store_summary_full_to_path (CamelImapStoreSummary *s,
if (c == dir_sep)
*p++ = '/';
else if (c == '/' || c == '%')
- p += sprintf(p, "%%%02X", c);
+ p += sprintf (p, "%%%02X", c);
else
*p++ = c;
}
@@ -230,12 +230,12 @@ camel_imap_store_summary_path_to_full (CamelImapStoreSummary *s,
/* merge old path part if required */
f = g_strdup (full);
if (si) {
- full = g_strdup_printf("%s%s", camel_imap_store_info_full_name(s, si), f);
+ full = g_strdup_printf ("%s%s", camel_imap_store_info_full_name (s, si), f);
g_free (f);
camel_store_summary_info_free ((CamelStoreSummary *) s, si);
f = full;
} else if (ns) {
- full = g_strdup_printf("%s%s", ns->full_name, f);
+ full = g_strdup_printf ("%s%s", ns->full_name, f);
g_free (f);
f = full;
}
@@ -254,7 +254,7 @@ camel_imap_store_summary_add_from_full (CamelImapStoreSummary *s,
gchar *full_name;
CamelImapStoreNamespace *ns;
- d(printf("adding full name '%s' '%c'\n", full, dir_sep));
+ d (printf ("adding full name '%s' '%c'\n", full, dir_sep));
len = strlen (full);
full_name = alloca (len + 1);
@@ -265,13 +265,13 @@ camel_imap_store_summary_add_from_full (CamelImapStoreSummary *s,
info = camel_imap_store_summary_full_name (s, full_name);
if (info) {
camel_store_summary_info_free ((CamelStoreSummary *) s, (CamelStoreInfo *) info);
- d(printf(" already there\n"));
+ d (printf (" already there\n"));
return info;
}
ns = camel_imap_store_summary_namespace_find_full (s, full_name);
if (ns) {
- d(printf("(found namespace for '%s' ns '%s') ", full_name, ns->path));
+ d (printf ("(found namespace for '%s' ns '%s') ", full_name, ns->path));
len = strlen (ns->full_name);
if (len >= strlen (full_name)) {
pathu8 = g_strdup (ns->path);
@@ -287,21 +287,21 @@ camel_imap_store_summary_add_from_full (CamelImapStoreSummary *s,
pathu8 = prefix;
}
}
- d(printf(" (pathu8 = '%s')", pathu8));
+ d (printf (" (pathu8 = '%s')", pathu8));
} else {
- d(printf("(Cannot find namespace for '%s')\n", full_name));
+ d (printf ("(Cannot find namespace for '%s')\n", full_name));
pathu8 = camel_imap_store_summary_full_to_path (s, full_name, dir_sep);
}
info = (CamelImapStoreInfo *) camel_store_summary_add_from_path ((CamelStoreSummary *) s, pathu8);
if (info) {
- d(printf(" '%s' -> '%s'\n", pathu8, full_name));
+ d (printf (" '%s' -> '%s'\n", pathu8, full_name));
camel_store_info_set_string ((CamelStoreSummary *) s, (CamelStoreInfo *) info, CAMEL_IMAP_STORE_INFO_FULL_NAME, full_name);
- if (!g_ascii_strcasecmp(full_name, "inbox"))
+ if (!g_ascii_strcasecmp (full_name, "inbox"))
info->info.flags |= CAMEL_FOLDER_SYSTEM | CAMEL_FOLDER_TYPE_INBOX;
} else {
- d(printf(" failed\n"));
+ d (printf (" failed\n"));
}
return info;
@@ -320,7 +320,7 @@ camel_imap_store_summary_full_from_path (CamelImapStoreSummary *s,
if (ns)
name = camel_imap_store_summary_path_to_full (s, path, ns->sep);
- d(printf("looking up path %s -> %s\n", path, name?name:"not found"));
+ d (printf ("looking up path %s -> %s\n", path, name ? name:"not found"));
return name;
}
@@ -485,7 +485,7 @@ camel_imap_store_summary_namespace_find_full (CamelImapStoreSummary *s,
ns = s->namespace;
while (ns) {
len = strlen (ns->full_name);
- d(printf("find_full: comparing namespace '%s' to name '%s'\n", ns->full_name, full));
+ d (printf ("find_full: comparing namespace '%s' to name '%s'\n", ns->full_name, full));
if (len == 0
|| (strncmp (ns->full_name, full, len) == 0
&& (full[len] == ns->sep || full[len] == 0)))
@@ -582,7 +582,7 @@ summary_header_load (CamelStoreSummary *s,
is->version = version;
if (version < CAMEL_IMAP_STORE_SUMMARY_VERSION_0) {
- g_warning("Store summary header version too low");
+ g_warning ("Store summary header version too low");
return -1;
}
@@ -637,7 +637,7 @@ store_info_load (CamelStoreSummary *s,
mi = NULL;
} else {
/* NB: this is done again for compatability */
- if (g_ascii_strcasecmp(mi->full_name, "inbox") == 0)
+ if (g_ascii_strcasecmp (mi->full_name, "inbox") == 0)
mi->info.flags |= CAMEL_FOLDER_SYSTEM | CAMEL_FOLDER_TYPE_INBOX;
}
}
@@ -700,7 +700,7 @@ store_info_set_string (CamelStoreSummary *s,
switch (type) {
case CAMEL_IMAP_STORE_INFO_FULL_NAME:
- d(printf("Set full name %s -> %s\n", isi->full_name, str));
+ d (printf ("Set full name %s -> %s\n", isi->full_name, str));
camel_store_summary_lock (s, CAMEL_STORE_SUMMARY_SUMMARY_LOCK);
g_free (isi->full_name);
isi->full_name = g_strdup (str);
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index 51e12ca..3a63fba 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -345,10 +345,10 @@ connect_to_server (CamelService *service,
goto exit;
}
- if (!strncmp(buf, "* PREAUTH", 9))
+ if (!strncmp (buf, "* PREAUTH", 9))
store->preauthed = TRUE;
- if (strstr (buf, "Courier-IMAP") || getenv("CAMEL_IMAP_BRAINDAMAGED")) {
+ if (strstr (buf, "Courier-IMAP") || getenv ("CAMEL_IMAP_BRAINDAMAGED")) {
/* Courier-IMAP is braindamaged. So far this flag only
* works around the fact that Courier-IMAP is known to
* give invalid BODY responses seemingly because its
@@ -548,22 +548,22 @@ connect_to_server_process (CamelService *service,
/* Put full details in the environment, in case the connection
* program needs them */
buf = camel_url_to_string (&url, 0);
- child_env[i++] = g_strdup_printf("URL=%s", buf);
+ child_env[i++] = g_strdup_printf ("URL=%s", buf);
g_free (buf);
- child_env[i++] = g_strdup_printf("URLHOST=%s", host);
+ child_env[i++] = g_strdup_printf ("URLHOST=%s", host);
if (port)
- child_env[i++] = g_strdup_printf("URLPORT=%d", port);
+ child_env[i++] = g_strdup_printf ("URLPORT=%d", port);
if (user)
- child_env[i++] = g_strdup_printf("URLUSER=%s", user);
+ child_env[i++] = g_strdup_printf ("URLUSER=%s", user);
if (password)
- child_env[i++] = g_strdup_printf("URLPASSWD=%s", password);
+ child_env[i++] = g_strdup_printf ("URLPASSWD=%s", password);
child_env[i] = NULL;
/* Now do %h, %u, etc. substitution in cmd */
buf = cmd_copy = g_strdup (cmd);
- full_cmd = g_strdup("");
+ full_cmd = g_strdup ("");
for (;;) {
gchar *pc;
@@ -574,7 +574,7 @@ connect_to_server_process (CamelService *service,
pc = strchr (buf, '%');
ignore:
if (!pc) {
- tmp = g_strdup_printf("%s%s", full_cmd, buf);
+ tmp = g_strdup_printf ("%s%s", full_cmd, buf);
g_free (full_cmd);
full_cmd = tmp;
break;
@@ -598,7 +598,7 @@ connect_to_server_process (CamelService *service,
pc = strchr (pc + 1, '%');
goto ignore;
}
- tmp = g_strdup_printf("%s%.*s%s", full_cmd, len, buf, var);
+ tmp = g_strdup_printf ("%s%.*s%s", full_cmd, len, buf, var);
g_free (full_cmd);
full_cmd = tmp;
buf = pc + 2;
@@ -649,7 +649,7 @@ connect_to_server_process (CamelService *service,
return FALSE;
}
- if (!strncmp(buf, "* PREAUTH", 9))
+ if (!strncmp (buf, "* PREAUTH", 9))
store->preauthed = TRUE;
g_free (buf);
@@ -734,7 +734,7 @@ imap_auth_loop (CamelService *service,
if (store->preauthed) {
if (camel_verbose_debug)
- fprintf(stderr, "Server %s has preauthenticated us.\n",
+ fprintf (stderr, "Server %s has preauthenticated us.\n",
host);
goto exit;
}
@@ -1012,7 +1012,7 @@ imap_store_connect_sync (CamelService *service,
goto done;
/* Make sure INBOX is present/subscribed */
- si = camel_store_summary_path((CamelStoreSummary *)store->summary, "INBOX");
+ si = camel_store_summary_path ((CamelStoreSummary *) store->summary, "INBOX");
if (si == NULL || (si->flags & CAMEL_FOLDER_SUBSCRIBED) == 0) {
response = camel_imap_command (store, NULL, cancellable, &local_error, "SUBSCRIBE INBOX");
if (response != NULL) {
@@ -1022,7 +1022,7 @@ imap_store_connect_sync (CamelService *service,
camel_store_summary_info_free ((CamelStoreSummary *) store->summary, si);
if (local_error != NULL)
goto done;
- get_folders_sync(store, "INBOX", cancellable, &local_error);
+ get_folders_sync (store, "INBOX", cancellable, &local_error);
}
store->refresh_stamp = time (NULL);
@@ -1673,7 +1673,7 @@ imap_forget_folder (CamelImapStore *imap_store,
camel_db_delete_folder (((CamelStore *) imap_store)->cdb_w, folder_name, NULL);
camel_imap_message_cache_delete (folder_dir, NULL);
- state_file = g_strdup_printf("%s/subfolders", folder_dir);
+ state_file = g_strdup_printf ("%s/subfolders", folder_dir);
g_rmdir (state_file);
g_free (state_file);
@@ -2284,7 +2284,7 @@ imap_store_delete_folder_sync (CamelStore *store,
/* no need to actually create a CamelFolder for INBOX */
imap_store->current_folder = NULL;
- response = camel_imap_command(imap_store, NULL, cancellable, error, "DELETE %F", folder_name);
+ response = camel_imap_command (imap_store, NULL, cancellable, error, "DELETE %F", folder_name);
if (response) {
camel_imap_response_free (imap_store, response);
imap_forget_folder (imap_store, folder_name, NULL);
@@ -2345,7 +2345,7 @@ rename_folder_info (CamelImapStore *imap_store,
path = camel_store_info_path (imap_store->summary, si);
if (strncmp (path, old_name, olen) == 0) {
if (strlen (path) > olen)
- npath = g_strdup_printf("%s/%s", new_name, path+olen+1);
+ npath = g_strdup_printf ("%s/%s", new_name, path + olen + 1);
else
npath = g_strdup (new_name);
nfull = camel_imap_store_summary_path_to_full (imap_store->summary, npath, imap_store->dir_sep);
@@ -2668,7 +2668,7 @@ parse_list_response_as_folder_info (CamelImapStore *imap_store,
fi = camel_folder_info_new ();
fi->full_name = g_strdup (camel_store_info_path (imap_store->summary, si));
- if (!g_ascii_strcasecmp(fi->full_name, "inbox")) {
+ if (!g_ascii_strcasecmp (fi->full_name, "inbox")) {
flags |= CAMEL_FOLDER_SYSTEM | CAMEL_FOLDER_TYPE_INBOX;
fi->display_name = g_strdup (_("Inbox"));
} else
@@ -2723,7 +2723,7 @@ static guint folder_hash (gconstpointer ap)
{
const gchar *a = ap;
- if (g_ascii_strcasecmp(a, "INBOX") == 0)
+ if (g_ascii_strcasecmp (a, "INBOX") == 0)
a = "INBOX";
return g_str_hash (a);
@@ -2734,9 +2734,9 @@ static gint folder_eq (gconstpointer ap, gconstpointer bp)
const gchar *a = ap;
const gchar *b = bp;
- if (g_ascii_strcasecmp(a, "INBOX") == 0)
+ if (g_ascii_strcasecmp (a, "INBOX") == 0)
a = "INBOX";
- if (g_ascii_strcasecmp(b, "INBOX") == 0)
+ if (g_ascii_strcasecmp (b, "INBOX") == 0)
b = "INBOX";
return g_str_equal (a, b);
@@ -2791,7 +2791,7 @@ get_folders_sync (CamelImapStore *imap_store,
for (j = 0; j < 2; j++) {
response = camel_imap_command (imap_store, NULL, cancellable, first_namespace ? error : NULL,
- "%s \"\" %G", j==1 ? "LSUB" : "LIST",
+ "%s \"\" %G", j == 1 ? "LSUB" : "LIST",
pattern);
if (!response) {
/* do not worry if checking in some namespace fails */
@@ -2905,7 +2905,7 @@ dumpfi (CamelFolderInfo *fi)
}
while (fi) {
- printf("%-25s %-25s %*s\n", fi->name, fi->full_name, (gint)(depth*2+strlen(fi->uri)), fi->uri);
+ printf ("%-25s %-25s %*s\n", fi->name, fi->full_name, (gint)(depth * 2 + strlen (fi->uri)), fi->uri);
if (fi->child)
dumpfi (fi->child);
fi = fi->next;
@@ -2969,7 +2969,7 @@ refresh_refresh (CamelSession *session,
goto done;
} else {
/* this can fail on some servers, thus just try it, but do not skip
- look in all namespaces, unless the operation was cancelled */
+ * look in all namespaces, unless the operation was cancelled */
if (!get_folders_sync (store, "*", cancellable, NULL) &&
g_cancellable_is_cancelled (cancellable))
goto done;
@@ -3008,8 +3008,8 @@ imap_store_get_folder_info_sync (CamelStore *store,
if (top == NULL)
top = "";
- if (camel_debug("imap:folder_info"))
- printf("get folder info online\n");
+ if (camel_debug ("imap:folder_info"))
+ printf ("get folder info online\n");
if (!camel_offline_store_get_online (CAMEL_OFFLINE_STORE (store))) {
tree = get_folder_info_offline (store, top, flags, error);
@@ -3096,8 +3096,8 @@ get_folder_info_offline (CamelStore *store,
gchar *junk_path;
gchar *trash_path;
- if (camel_debug("imap:folder_info"))
- printf("get folder info offline\n");
+ if (camel_debug ("imap:folder_info"))
+ printf ("get folder info offline\n");
service = CAMEL_SERVICE (store);
@@ -3133,7 +3133,7 @@ get_folder_info_offline (CamelStore *store,
/* get starting point */
if (top[0] == 0) {
- name = g_strdup("");
+ name = g_strdup ("");
} else {
name = camel_imap_store_summary_full_from_path (imap_store->summary, top);
if (name == NULL)
@@ -3141,7 +3141,7 @@ get_folder_info_offline (CamelStore *store,
}
main_ns = camel_imap_store_summary_get_main_namespace (imap_store->summary);
- pattern = imap_concat(imap_store, name, "*");
+ pattern = imap_concat (imap_store, name, "*");
/* folder_info_build will insert parent nodes as necessary and mark
* them as noselect, which is information we actually don't have at
@@ -3185,7 +3185,7 @@ get_folder_info_offline (CamelStore *store,
fi->flags = (fi->flags & ~CAMEL_FOLDER_NOINFERIORS) | CAMEL_FOLDER_NOCHILDREN;
/* blah, this gets lost somewhere, i can't be bothered finding out why */
- if (!g_ascii_strcasecmp(fi->full_name, "inbox"))
+ if (!g_ascii_strcasecmp (fi->full_name, "inbox"))
fi->flags = (fi->flags & ~CAMEL_FOLDER_TYPE_MASK) | CAMEL_FOLDER_TYPE_INBOX;
folder_is_trash =
diff --git a/camel/providers/imap/camel-imap-summary.c b/camel/providers/imap/camel-imap-summary.c
index 937c9bc..2fe5a96 100644
--- a/camel/providers/imap/camel-imap-summary.c
+++ b/camel/providers/imap/camel-imap-summary.c
@@ -170,7 +170,7 @@ summary_header_from_db (CamelFolderSummary *s,
ims->validity = bdata_extract_digit (&part);
if (ims->version > CAMEL_IMAP_SUMMARY_VERSION) {
- g_warning("Unkown summary version\n");
+ g_warning ("Unkown summary version\n");
errno = EINVAL;
return FALSE;
}
@@ -270,12 +270,12 @@ content_info_to_db (CamelFolderSummary *s,
gchar *oldr;
if (info->type) {
oldr = mir->cinfo;
- mir->cinfo = oldr ? g_strdup_printf("%s 1", oldr) : g_strdup ("1");
+ mir->cinfo = oldr ? g_strdup_printf ("%s 1", oldr) : g_strdup ("1");
g_free (oldr);
return CAMEL_FOLDER_SUMMARY_CLASS (camel_imap_summary_parent_class)->content_info_to_db (s, info, mir);
} else {
oldr = mir->cinfo;
- mir->cinfo = oldr ? g_strdup_printf("%s 0", oldr) : g_strdup ("0");
+ mir->cinfo = oldr ? g_strdup_printf ("%s 0", oldr) : g_strdup ("0");
g_free (oldr);
return TRUE;
}
diff --git a/camel/providers/imap/camel-imap-utils.c b/camel/providers/imap/camel-imap-utils.c
index 7eed911..1718a14 100644
--- a/camel/providers/imap/camel-imap-utils.c
+++ b/camel/providers/imap/camel-imap-utils.c
@@ -242,7 +242,7 @@ imap_parse_namespace_response (const gchar *response)
struct _namespaces *namespaces;
const gchar *inptr;
- d(printf ("parsing: %s\n", response));
+ d (printf ("parsing: %s\n", response));
if (*response != '*')
return NULL;
@@ -585,17 +585,17 @@ imap_parse_flag_list (gchar **flag_list_p,
flags |= CAMEL_MESSAGE_SEEN;
else if (!g_ascii_strncasecmp (flag_list, "\\Recent", len))
flags |= CAMEL_IMAP_MESSAGE_RECENT;
- else if (!g_ascii_strncasecmp(flag_list, "\\*", len))
+ else if (!g_ascii_strncasecmp (flag_list, "\\*", len))
flags |= CAMEL_MESSAGE_USER | CAMEL_MESSAGE_JUNK | CAMEL_MESSAGE_NOTJUNK;
- else if (!g_ascii_strncasecmp(flag_list, "Junk", len))
+ else if (!g_ascii_strncasecmp (flag_list, "Junk", len))
flags |= CAMEL_MESSAGE_JUNK;
- else if (!g_ascii_strncasecmp(flag_list, "NotJunk", len))
+ else if (!g_ascii_strncasecmp (flag_list, "NotJunk", len))
flags |= CAMEL_MESSAGE_NOTJUNK;
- else if (!g_ascii_strncasecmp(flag_list, "$Label1", len) ||
- !g_ascii_strncasecmp(flag_list, "$Label2", len) ||
- !g_ascii_strncasecmp(flag_list, "$Label3", len) ||
- !g_ascii_strncasecmp(flag_list, "$Label4", len) ||
- !g_ascii_strncasecmp(flag_list, "$Label5", len)) {
+ else if (!g_ascii_strncasecmp (flag_list, "$Label1", len) ||
+ !g_ascii_strncasecmp (flag_list, "$Label2", len) ||
+ !g_ascii_strncasecmp (flag_list, "$Label3", len) ||
+ !g_ascii_strncasecmp (flag_list, "$Label4", len) ||
+ !g_ascii_strncasecmp (flag_list, "$Label5", len)) {
if (custom_flags) {
g_string_append (custom_flags, rename_label_flag (flag_list, len, TRUE));
g_string_append_c (custom_flags, ' ');
@@ -1439,7 +1439,7 @@ imap_path_to_physical (const gchar *prefix,
p = vpath;
while ((c = *p++)) {
if (c == '/') {
- g_string_append(out, "/" SUBFOLDER_DIR_NAME "/");
+ g_string_append (out, "/" SUBFOLDER_DIR_NAME "/");
while (*p == '/')
p++;
} else
diff --git a/camel/providers/imapx/camel-imapx-provider.c b/camel/providers/imapx/camel-imapx-provider.c
index 427197b..f5299b4 100644
--- a/camel/providers/imapx/camel-imapx-provider.c
+++ b/camel/providers/imapx/camel-imapx-provider.c
@@ -108,11 +108,13 @@ void camel_imapx_module_init (void);
void
camel_imapx_module_init (void)
{
- imapx_provider.object_types[CAMEL_PROVIDER_STORE] = camel_imapx_store_get_type ();
+ imapx_provider.object_types[CAMEL_PROVIDER_STORE] =
+ CAMEL_TYPE_IMAPX_STORE;
imapx_provider.url_hash = imapx_url_hash;
imapx_provider.url_equal = imapx_url_equal;
imapx_provider.authtypes = camel_sasl_authtype_list (FALSE);
- imapx_provider.authtypes = g_list_prepend (imapx_provider.authtypes, &camel_imapx_password_authtype);
+ imapx_provider.authtypes = g_list_prepend (
+ imapx_provider.authtypes, &camel_imapx_password_authtype);
imapx_provider.translation_domain = GETTEXT_PACKAGE;
camel_provider_register (&imapx_provider);
diff --git a/camel/providers/local/camel-local-folder.c b/camel/providers/local/camel-local-folder.c
index 037c0d1..1547b43 100644
--- a/camel/providers/local/camel-local-folder.c
+++ b/camel/providers/local/camel-local-folder.c
@@ -323,7 +323,7 @@ local_folder_rename (CamelFolder *folder,
parent_store = camel_folder_get_parent_store (folder);
ls = CAMEL_LOCAL_STORE (parent_store);
- d(printf("renaming local folder paths to '%s'\n", newname));
+ d (printf ("renaming local folder paths to '%s'\n", newname));
/* Sync? */
@@ -331,8 +331,8 @@ local_folder_rename (CamelFolder *folder,
g_free (lf->index_path);
lf->folder_path = camel_local_store_get_full_path (ls, newname);
- lf->index_path = camel_local_store_get_meta_path(ls, newname, ".ibex");
- statepath = camel_local_store_get_meta_path(ls, newname, ".cmeta");
+ lf->index_path = camel_local_store_get_meta_path (ls, newname, ".ibex");
+ statepath = camel_local_store_get_meta_path (ls, newname, ".cmeta");
camel_object_set_state_filename (CAMEL_OBJECT (lf), statepath);
g_free (statepath);
@@ -425,7 +425,7 @@ local_folder_synchronize_sync (CamelFolder *folder,
CamelLocalFolder *lf = CAMEL_LOCAL_FOLDER (folder);
gboolean success;
- d(printf("local sync '%s' , expunge=%s\n", folder->full_name, expunge?"true":"false"));
+ d (printf ("local sync '%s' , expunge=%s\n", folder->full_name, expunge?"true":"false"));
if (camel_local_folder_lock (lf, CAMEL_LOCK_WRITE, error) == -1)
return FALSE;
@@ -563,8 +563,8 @@ camel_local_folder_construct (CamelLocalFolder *lf,
need_summary_check = camel_local_store_get_need_summary_check (ls);
lf->folder_path = camel_local_store_get_full_path (ls, full_name);
- lf->index_path = camel_local_store_get_meta_path(ls, full_name, ".ibex");
- statepath = camel_local_store_get_meta_path(ls, full_name, ".cmeta");
+ lf->index_path = camel_local_store_get_meta_path (ls, full_name, ".ibex");
+ statepath = camel_local_store_get_meta_path (ls, full_name, ".cmeta");
camel_object_set_state_filename (CAMEL_OBJECT (lf), statepath);
g_free (statepath);
@@ -618,7 +618,7 @@ camel_local_folder_construct (CamelLocalFolder *lf,
lf->index = (CamelIndex *) camel_text_index_new (lf->index_path, flag);
if (lf->index == NULL) {
/* yes, this isn't fatal at all */
- g_warning("Could not open/create index file: %s: indexing not performed", g_strerror (errno));
+ g_warning ("Could not open/create index file: %s: indexing not performed", g_strerror (errno));
forceindex = FALSE;
/* record that we dont have an index afterall */
lf->flags &= ~CAMEL_STORE_FOLDER_BODY_INDEX;
@@ -671,9 +671,6 @@ camel_local_folder_set_index_body (CamelLocalFolder *local_folder,
{
g_return_if_fail (CAMEL_IS_LOCAL_FOLDER (local_folder));
- if (((local_folder->flags & CAMEL_STORE_FOLDER_BODY_INDEX) ? 1 : 0) == (index_body ? 1 : 0))
- return;
-
if (index_body)
local_folder->flags |= CAMEL_STORE_FOLDER_BODY_INDEX;
else
diff --git a/camel/providers/local/camel-local-folder.h b/camel/providers/local/camel-local-folder.h
index af08004..7287559 100644
--- a/camel/providers/local/camel-local-folder.h
+++ b/camel/providers/local/camel-local-folder.h
@@ -64,9 +64,13 @@ struct _CamelLocalFolder {
gchar *folder_path; /* the path to the folder itself */
gchar *index_path; /* where the index file lives */
- CamelIndex *index; /* index for this folder */
- CamelFolderSearch *search; /* used to run searches, we just use the real thing (tm) */
- CamelFolderChangeInfo *changes; /* used to store changes to the folder during processing */
+ CamelIndex *index; /* index for this folder */
+
+ /* Used to run searches, we just use the real thing (tm). */
+ CamelFolderSearch *search;
+
+ /* Used to store changes to the folder during processing. */
+ CamelFolderChangeInfo *changes;
};
struct _CamelLocalFolderClass {
diff --git a/camel/providers/local/camel-local-private.c b/camel/providers/local/camel-local-private.c
index 2569e0a..c7a3c20 100644
--- a/camel/providers/local/camel-local-private.c
+++ b/camel/providers/local/camel-local-private.c
@@ -1,5 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*-
- *
+/*
* Copyright (C) 2008 Novell, Inc. (www.novell.com)
*
* Authors: Srinivsa Ragavan <sragavan novell com>
diff --git a/camel/providers/local/camel-local-private.h b/camel/providers/local/camel-local-private.h
index 2d3d3f2..9121b28 100644
--- a/camel/providers/local/camel-local-private.h
+++ b/camel/providers/local/camel-local-private.h
@@ -43,7 +43,11 @@ struct _CamelLocalFolderPrivate {
#define CAMEL_LOCAL_FOLDER_UNLOCK(f, l) \
(g_mutex_unlock (((CamelLocalFolder *) f)->priv->l))
-gint camel_local_frompos_sort (gpointer enc, gint len1, gpointer data1, gint len2, gpointer data2);
+gint camel_local_frompos_sort (gpointer enc,
+ gint len1,
+ gpointer data1,
+ gint len2,
+ gpointer data2);
G_END_DECLS
diff --git a/camel/providers/local/camel-local-provider.c b/camel/providers/local/camel-local-provider.c
index bb76489..efbc757 100644
--- a/camel/providers/local/camel-local-provider.c
+++ b/camel/providers/local/camel-local-provider.c
@@ -135,7 +135,7 @@ make_can_path (gchar *p,
{
gchar c, last, *start = o;
- d(printf("canonical '%s' = ", p));
+ d (printf ("canonical '%s' = ", p));
last = 0;
while ((c = *p++)) {
@@ -149,7 +149,7 @@ make_can_path (gchar *p,
else
*o = 0;
- d(printf("'%s'\n", start));
+ d (printf ("'%s'\n", start));
return start;
}
diff --git a/camel/providers/local/camel-local-store.c b/camel/providers/local/camel-local-store.c
index 033d8e5..62f3621 100644
--- a/camel/providers/local/camel-local-store.c
+++ b/camel/providers/local/camel-local-store.c
@@ -74,7 +74,7 @@ xrename (const gchar *oldp,
new = g_build_filename (prefix, basename, NULL);
g_free (basename);
- d(printf("renaming %s%s to %s%s\n", oldp, suffix, newp, suffix));
+ d (printf ("renaming %s%s to %s%s\n", oldp, suffix, newp, suffix));
if (g_stat (old, &st) == -1) {
if (missingok && errno == ENOENT) {
@@ -275,7 +275,7 @@ local_store_get_folder_info_sync (CamelStore *store,
* there before.
*/
- d(printf("-- LOCAL STORE -- get folder info: %s\n", top));
+ d (printf ("-- LOCAL STORE -- get folder info: %s\n", top));
return NULL;
}
@@ -385,9 +385,9 @@ local_store_create_folder_sync (CamelStore *store,
}
if (parent_name && *parent_name)
- name = g_strdup_printf("%s/%s/%s", path, parent_name, folder_name);
+ name = g_strdup_printf ("%s/%s/%s", path, parent_name, folder_name);
else
- name = g_strdup_printf("%s/%s", path, folder_name);
+ name = g_strdup_printf ("%s/%s", path, folder_name);
if (g_stat (name, &st) == 0 || errno != ENOENT) {
g_set_error (
@@ -401,9 +401,9 @@ local_store_create_folder_sync (CamelStore *store,
g_free (name);
if (parent_name && *parent_name)
- name = g_strdup_printf("%s/%s", parent_name, folder_name);
+ name = g_strdup_printf ("%s/%s", parent_name, folder_name);
else
- name = g_strdup_printf("%s", folder_name);
+ name = g_strdup_printf ("%s", folder_name);
folder = CAMEL_STORE_GET_CLASS (store)->get_folder_sync (
store, name, CAMEL_STORE_FOLDER_CREATE, cancellable, error);
@@ -542,28 +542,29 @@ local_store_rename_folder_sync (CamelStore *store,
/* try to rollback failures, has obvious races */
- d(printf("local rename folder '%s' '%s'\n", old, new));
+ d (printf ("local rename folder '%s' '%s'\n", old, new));
folder = camel_object_bag_get (store->folders, old);
if (folder && folder->index) {
if (camel_index_rename (folder->index, newibex) == -1)
goto ibex_failed;
} else {
- /* TODO: camel_text_index_rename should find out if we have an active index itself? */
+ /* TODO camel_text_index_rename() should find
+ * out if we have an active index itself? */
if (camel_text_index_rename (oldibex, newibex) == -1)
goto ibex_failed;
}
- if (xrename(old, new, path, ".ev-summary", TRUE, error))
+ if (xrename (old, new, path, ".ev-summary", TRUE, error))
goto summary_failed;
- if (xrename(old, new, path, ".ev-summary-meta", TRUE, error))
+ if (xrename (old, new, path, ".ev-summary-meta", TRUE, error))
goto summary_failed;
- if (xrename(old, new, path, ".cmeta", TRUE, error))
+ if (xrename (old, new, path, ".cmeta", TRUE, error))
goto cmeta_failed;
- if (xrename(old, new, path, "", FALSE, error))
+ if (xrename (old, new, path, "", FALSE, error))
goto base_failed;
g_free (newibex);
@@ -577,11 +578,11 @@ local_store_rename_folder_sync (CamelStore *store,
/* The (f)utility of this recovery effort is quesitonable */
base_failed:
- xrename(new, old, path, ".cmeta", TRUE, NULL);
+ xrename (new, old, path, ".cmeta", TRUE, NULL);
cmeta_failed:
- xrename(new, old, path, ".ev-summary", TRUE, NULL);
- xrename(new, old, path, ".ev-summary-meta", TRUE, NULL);
+ xrename (new, old, path, ".ev-summary", TRUE, NULL);
+ xrename (new, old, path, ".ev-summary-meta", TRUE, NULL);
summary_failed:
if (folder) {
if (folder->index)
@@ -817,7 +818,7 @@ camel_local_store_set_need_summary_check (CamelLocalStore *store,
{
g_return_if_fail (CAMEL_IS_LOCAL_STORE (store));
- if ((store->priv->need_summary_check ? 1 : 0) == (need_summary_check ? 1 : 0))
+ if (store->priv->need_summary_check == need_summary_check)
return;
store->priv->need_summary_check = need_summary_check;
diff --git a/camel/providers/local/camel-local-summary.c b/camel/providers/local/camel-local-summary.c
index 1566037..cb1f902 100644
--- a/camel/providers/local/camel-local-summary.c
+++ b/camel/providers/local/camel-local-summary.c
@@ -142,7 +142,7 @@ local_summary_load (CamelLocalSummary *cls,
gint forceindex,
GError **error)
{
- d(g_print ("\nlocal_summary_load called \n"));
+ d (g_print ("\nlocal_summary_load called \n"));
return camel_folder_summary_load_from_db ((CamelFolderSummary *) cls, error);
}
@@ -154,13 +154,13 @@ camel_local_summary_load (CamelLocalSummary *cls,
{
CamelLocalSummaryClass *class;
- d(printf("Loading summary ...\n"));
+ d (printf ("Loading summary ...\n"));
class = CAMEL_LOCAL_SUMMARY_GET_CLASS (cls);
if ((forceindex && class->need_index ())
|| !class->load (cls, forceindex, error)) {
- w(g_warning("Could not load summary: flags may be reset"));
+ w (g_warning ("Could not load summary: flags may be reset"));
camel_folder_summary_clear ((CamelFolderSummary *) cls, NULL);
return FALSE;
}
@@ -299,13 +299,13 @@ camel_local_summary_check (CamelLocalSummary *cls,
}
camel_folder_summary_free_array (known_uids);
- printf("\nMemory used by summary:\n\n");
- printf("Total of %d messages\n", camel_folder_summary_count(s));
- printf("Total: %d bytes (ave %f)\n", stats.citotal + stats.mitotal,
+ printf ("\nMemory used by summary:\n\n");
+ printf ("Total of %d messages\n", camel_folder_summary_count (s));
+ printf ("Total: %d bytes (ave %f)\n", stats.citotal + stats.mitotal,
(double)(stats.citotal + stats.mitotal) / (double) camel_folder_summary_count (s));
- printf("Message Info: %d (ave %f)\n", stats.mitotal, (double)stats.mitotal/(double)stats.micount);
- printf("Content Info; %d (ave %f) count %d\n", stats.citotal, (double)stats.citotal/(double)stats.cicount, stats.cicount);
- printf("message id's: %d (ave %f) count %d\n", stats.msgid, (double)stats.msgid/(double)stats.msgcount, stats.msgcount);
+ printf ("Message Info: %d (ave %f)\n", stats.mitotal, (double) stats.mitotal / (double) stats.micount);
+ printf ("Content Info; %d (ave %f) count %d\n", stats.citotal, (double) stats.citotal / (double) stats.cicount, stats.cicount);
+ printf ("message id's: %d (ave %f) count %d\n", stats.msgid, (double) stats.msgid / (double) stats.msgcount, stats.msgcount);
}
#endif
return ret;
@@ -370,7 +370,7 @@ camel_local_summary_write_headers (gint fd,
if (newfd == -1)
return -1;
- out = fdopen(newfd, "w");
+ out = fdopen (newfd, "w");
if (out == NULL) {
close (newfd);
errno = EINVAL;
@@ -378,10 +378,10 @@ camel_local_summary_write_headers (gint fd,
}
while (header) {
- if (strcmp(header->name, "X-Evolution") != 0
- && (status == NULL || strcmp(header->name, "Status") != 0)
- && (xstatus == NULL || strcmp(header->name, "X-Status") != 0)) {
- len = fprintf(out, "%s:%s\n", header->name, header->value);
+ if (strcmp (header->name, "X-Evolution") != 0
+ && (status == NULL || strcmp (header->name, "Status") != 0)
+ && (xstatus == NULL || strcmp (header->name, "X-Status") != 0)) {
+ len = fprintf (out, "%s:%s\n", header->name, header->value);
if (len == -1) {
fclose (out);
return -1;
@@ -392,7 +392,7 @@ camel_local_summary_write_headers (gint fd,
}
if (status) {
- len = fprintf(out, "Status: %s\n", status);
+ len = fprintf (out, "Status: %s\n", status);
if (len == -1) {
fclose (out);
return -1;
@@ -401,7 +401,7 @@ camel_local_summary_write_headers (gint fd,
}
if (xstatus) {
- len = fprintf(out, "X-Status: %s\n", xstatus);
+ len = fprintf (out, "X-Status: %s\n", xstatus);
if (len == -1) {
fclose (out);
return -1;
@@ -410,7 +410,7 @@ camel_local_summary_write_headers (gint fd,
}
if (xevline) {
- len = fprintf(out, "X-Evolution: %s\n", xevline);
+ len = fprintf (out, "X-Evolution: %s\n", xevline);
if (len == -1) {
fclose (out);
return -1;
@@ -418,7 +418,7 @@ camel_local_summary_write_headers (gint fd,
outlen += len;
}
- len = fprintf(out, "\n");
+ len = fprintf (out, "\n");
if (len == -1) {
fclose (out);
return -1;
@@ -481,7 +481,7 @@ local_summary_add (CamelLocalSummary *cls,
CamelLocalMessageInfo *mi;
gchar *xev;
- d(printf("Adding message to summary\n"));
+ d (printf ("Adding message to summary\n"));
mi = (CamelLocalMessageInfo *) camel_folder_summary_add_from_message ((CamelFolderSummary *) cls, msg);
if (mi) {
@@ -517,11 +517,11 @@ local_summary_add (CamelLocalSummary *cls,
mi->info.flags &= ~(CAMEL_MESSAGE_FOLDER_NOXEV);
xev = camel_local_summary_encode_x_evolution (cls, mi);
- camel_medium_set_header((CamelMedium *)msg, "X-Evolution", xev);
+ camel_medium_set_header ((CamelMedium *) msg, "X-Evolution", xev);
g_free (xev);
camel_folder_change_info_add_uid (ci, camel_message_info_uid (mi));
} else {
- d(printf("Failed!\n"));
+ d (printf ("Failed!\n"));
g_set_error (
error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
_("Unable to add message to summary: unknown reason"));
@@ -533,7 +533,7 @@ static gchar *
local_summary_encode_x_evolution (CamelLocalSummary *cls,
const CamelLocalMessageInfo *mi)
{
- GString *out = g_string_new("");
+ GString *out = g_string_new ("");
struct _camel_header_param *params = NULL;
CamelFlag *flag = mi->info.user_flags;
CamelTag *tag = mi->info.user_tags;
@@ -601,10 +601,10 @@ local_summary_decode_x_evolution (CamelLocalSummary *cls,
/* check for uid/flags */
header = camel_header_token_decode (xev);
- if (header && strlen(header) == strlen("00000000-0000")
- && sscanf(header, "%08x-%04x", &uid, &flags) == 2) {
+ if (header && strlen (header) == strlen ("00000000-0000")
+ && sscanf (header, "%08x-%04x", &uid, &flags) == 2) {
if (mi)
- sprintf(uidstr, "%u", uid);
+ sprintf (uidstr, "%u", uid);
} else {
g_free (header);
return -1;
@@ -620,14 +620,14 @@ local_summary_decode_x_evolution (CamelLocalSummary *cls,
params = camel_header_param_list_decode (header + 1);
scan = params;
while (scan) {
- if (!g_ascii_strcasecmp(scan->name, "flags")) {
- gchar **flagv = g_strsplit(scan->value, ",", 1000);
+ if (!g_ascii_strcasecmp (scan->name, "flags")) {
+ gchar **flagv = g_strsplit (scan->value, ",", 1000);
for (i = 0; flagv[i]; i++)
camel_message_info_set_user_flag ((CamelMessageInfo *) mi, flagv[i], TRUE);
g_strfreev (flagv);
- } else if (!g_ascii_strcasecmp(scan->name, "tags")) {
- gchar **tagv = g_strsplit(scan->value, ",", 10000);
+ } else if (!g_ascii_strcasecmp (scan->name, "tags")) {
+ gchar **tagv = g_strsplit (scan->value, ",", 10000);
gchar *val;
for (i = 0; tagv[i]; i++) {
@@ -704,7 +704,7 @@ message_info_new_from_header (CamelFolderSummary *s,
const gchar *xev;
gint doindex = FALSE;
- xev = camel_header_raw_find(&h, "X-Evolution", NULL);
+ xev = camel_header_raw_find (&h, "X-Evolution", NULL);
if (xev == NULL || camel_local_summary_decode_x_evolution (cls, xev, mi) == -1) {
/* to indicate it has no xev header */
mi->info.flags |= CAMEL_MESSAGE_FOLDER_FLAGGED | CAMEL_MESSAGE_FOLDER_NOXEV;
@@ -720,10 +720,10 @@ message_info_new_from_header (CamelFolderSummary *s,
&& (doindex
|| cls->index_force
|| !camel_index_has_name (cls->index, camel_message_info_uid (mi)))) {
- d(printf("Am indexing message %s\n", camel_message_info_uid(mi)));
+ d (printf ("Am indexing message %s\n", camel_message_info_uid (mi)));
camel_folder_summary_set_index (s, cls->index);
} else {
- d(printf("Not indexing message %s\n", camel_message_info_uid(mi)));
+ d (printf ("Not indexing message %s\n", camel_message_info_uid (mi)));
camel_folder_summary_set_index (s, NULL);
}
}
diff --git a/camel/providers/local/camel-maildir-folder.c b/camel/providers/local/camel-maildir-folder.c
index 1b23fa8..2bd0930 100644
--- a/camel/providers/local/camel-maildir-folder.c
+++ b/camel/providers/local/camel-maildir-folder.c
@@ -160,7 +160,7 @@ maildir_folder_append_message_sync (CamelFolder *folder,
gchar *name, *dest = NULL;
gboolean success = TRUE, has_attachment;
- d(printf("Appending message\n"));
+ d (printf ("Appending message\n"));
/* If we can't lock, don't do anything */
if (!lf || camel_local_folder_lock (lf, CAMEL_LOCK_WRITE, error) == -1)
@@ -181,10 +181,10 @@ maildir_folder_append_message_sync (CamelFolder *folder,
mdi = (CamelMaildirMessageInfo *) mi;
- d(printf("Appending message: uid is %s filename is %s\n", camel_message_info_uid(mi), mdi->filename));
+ d (printf ("Appending message: uid is %s filename is %s\n", camel_message_info_uid (mi), mdi->filename));
/* write it out to tmp, use the uid we got from the summary */
- name = g_strdup_printf ("%s/tmp/%s", lf->folder_path, camel_message_info_uid(mi));
+ name = g_strdup_printf ("%s/tmp/%s", lf->folder_path, camel_message_info_uid (mi));
output_stream = camel_stream_fs_new_with_name (
name, O_WRONLY | O_CREAT, 0600, error);
if (output_stream == NULL)
@@ -196,7 +196,7 @@ maildir_folder_append_message_sync (CamelFolder *folder,
goto fail_write;
/* now move from tmp to cur (bypass new, does it matter?) */
- dest = g_strdup_printf("%s/cur/%s", lf->folder_path, camel_maildir_info_filename (mdi));
+ dest = g_strdup_printf ("%s/cur/%s", lf->folder_path, camel_maildir_info_filename (mdi));
if (g_rename (name, dest) == -1) {
g_set_error (
error, G_IO_ERROR,
@@ -257,7 +257,7 @@ maildir_folder_get_message_sync (CamelFolder *folder,
CamelMimeMessage *message = NULL;
gchar *name = NULL;
- d(printf("getting message: %s\n", uid));
+ d (printf ("getting message: %s\n", uid));
if (!lf || camel_local_folder_lock (lf, CAMEL_LOCK_WRITE, error) == -1)
return NULL;
@@ -340,7 +340,7 @@ maildir_folder_transfer_messages_to_sync (CamelFolder *source,
new_filename = camel_maildir_summary_info_to_name (mdi);
d_filename = g_strdup_printf ("%s/cur/%s", df->folder_path, new_filename);
- s_filename = g_strdup_printf("%s/cur/%s", lf->folder_path, camel_maildir_info_filename (mdi));
+ s_filename = g_strdup_printf ("%s/cur/%s", lf->folder_path, camel_maildir_info_filename (mdi));
if (g_rename (s_filename, d_filename) != 0) {
if (errno == EXDEV) {
@@ -467,7 +467,7 @@ camel_maildir_folder_new (CamelStore *parent_store,
gboolean filter_inbox;
gchar *basename;
- d(printf("Creating maildir folder: %s\n", full_name));
+ d (printf ("Creating maildir folder: %s\n", full_name));
if (g_strcmp0 (full_name, ".") == 0)
basename = g_strdup (_("Inbox"));
diff --git a/camel/providers/local/camel-maildir-store.c b/camel/providers/local/camel-maildir-store.c
index d589941..b89f2a1 100644
--- a/camel/providers/local/camel-maildir-store.c
+++ b/camel/providers/local/camel-maildir-store.c
@@ -125,7 +125,7 @@ maildir_store_create_folder_sync (CamelStore *store,
if (parent_name && *parent_name) {
gchar *dir_name = maildir_full_name_to_dir_name (parent_name);
- name = g_strdup_printf("%s/%s.%s", path, dir_name, folder_name);
+ name = g_strdup_printf ("%s/%s.%s", path, dir_name, folder_name);
g_free (dir_name);
} else
name = maildir_full_name_to_dir_name (folder_name);
@@ -143,9 +143,9 @@ maildir_store_create_folder_sync (CamelStore *store,
name = NULL;
if (parent_name && *parent_name)
- name = g_strdup_printf("%s/%s", parent_name, folder_name);
+ name = g_strdup_printf ("%s/%s", parent_name, folder_name);
else
- name = g_strdup_printf("%s", folder_name);
+ name = g_strdup_printf ("%s", folder_name);
folder = maildir_store_get_folder_sync (
store, name, CAMEL_STORE_FOLDER_CREATE, cancellable, error);
@@ -354,9 +354,9 @@ maildir_store_delete_folder_sync (CamelStore *store,
while ((d = readdir (dir))) {
gchar *name = d->d_name, *file;
- if (!strcmp(name, ".") || !strcmp(name, ".."))
+ if (!strcmp (name, ".") || !strcmp (name, ".."))
continue;
- file = g_strdup_printf("%s/%s", tmp, name);
+ file = g_strdup_printf ("%s/%s", tmp, name);
unlink (file);
g_free (file);
}
@@ -491,7 +491,7 @@ scan_fi (CamelStore *store,
fi->flags = CAMEL_FOLDER_NOCHILDREN;
dir_name = maildir_full_name_to_dir_name (fi->full_name);
- d(printf("Adding maildir info: '%s' '%s' '%s'\n", fi->name, dir_name, fi->uri));
+ d (printf ("Adding maildir info: '%s' '%s' '%s'\n", fi->name, dir_name, fi->uri));
tmp = g_build_filename (path, dir_name, "tmp", NULL);
cur = g_build_filename (path, dir_name, "cur", NULL);
@@ -603,12 +603,12 @@ scan_dirs (CamelStore *store,
CamelFolderInfo *fi;
struct stat st;
- if (strcmp(d->d_name, "tmp") == 0
- || strcmp(d->d_name, "cur") == 0
- || strcmp(d->d_name, "new") == 0
- || strcmp(d->d_name, ".#evolution") == 0
- || strcmp(d->d_name, ".") == 0
- || strcmp(d->d_name, "..") == 0
+ if (strcmp (d->d_name, "tmp") == 0
+ || strcmp (d->d_name, "cur") == 0
+ || strcmp (d->d_name, "new") == 0
+ || strcmp (d->d_name, ".#evolution") == 0
+ || strcmp (d->d_name, ".") == 0
+ || strcmp (d->d_name, "..") == 0
|| !g_str_has_prefix (d->d_name, "."))
continue;
@@ -626,12 +626,12 @@ scan_dirs (CamelStore *store,
else
short_name++;
- if ((g_ascii_strcasecmp ((*topfi)->full_name, "Inbox") != 0
+ if ((g_ascii_strcasecmp ((*topfi)->full_name, "Inbox") != 0
&& (!g_str_has_prefix (full_name, (*topfi)->full_name) ||
(full_name[strlen ((*topfi)->full_name)] != '\0' &&
full_name[strlen ((*topfi)->full_name)] != '/')))
|| (!can_inbox_sibling
- && g_ascii_strcasecmp ((*topfi)->full_name, "Inbox") == 0
+ && g_ascii_strcasecmp ((*topfi)->full_name, "Inbox") == 0
&& (!g_str_has_prefix (full_name, (*topfi)->full_name) ||
(full_name[strlen ((*topfi)->full_name)] != '\0' &&
full_name[strlen ((*topfi)->full_name)] != '/')))) {
@@ -696,13 +696,13 @@ maildir_store_get_folder_info_sync (CamelStore *store,
if (top == NULL || top[0] == 0) {
/* create a dummy "." parent inbox, use to scan, then put back at the top level */
- fi = scan_fi(store, flags, "Inbox", _("Inbox"), cancellable);
+ fi = scan_fi (store, flags, "Inbox", _("Inbox"), cancellable);
if (scan_dirs (store, flags, TRUE, &fi, cancellable, error) == -1)
goto fail;
fi->flags |= CAMEL_FOLDER_SYSTEM | CAMEL_FOLDER_TYPE_INBOX;
- } else if (!strcmp(top, ".")) {
- fi = scan_fi(store, flags, "Inbox", _("Inbox"), cancellable);
+ } else if (!strcmp (top, ".")) {
+ fi = scan_fi (store, flags, "Inbox", _("Inbox"), cancellable);
fi->flags |= CAMEL_FOLDER_SYSTEM | CAMEL_FOLDER_TYPE_INBOX;
} else {
const gchar *name = strrchr (top, '/');
@@ -781,7 +781,7 @@ maildir_store_rename_folder_sync (CamelStore *store,
gchar *old_dir, *new_dir;
CamelFolderInfo *subfolders;
- if (strcmp(old, ".") == 0) {
+ if (strcmp (old, ".") == 0) {
g_set_error (
error, CAMEL_STORE_ERROR,
CAMEL_STORE_ERROR_NO_FOLDER,
@@ -989,7 +989,7 @@ scan_old_dir_info (CamelStore *store,
last = (CamelFolderInfo *) &sn->fi->child;
- if (!strcmp(sn->fi->full_name, "."))
+ if (!strcmp (sn->fi->full_name, "."))
name = g_strdup (path);
else
name = g_build_filename (path, sn->fi->full_name, NULL);
@@ -1006,12 +1006,12 @@ scan_old_dir_info (CamelStore *store,
}
while ((d = readdir (dir))) {
- if (strcmp(d->d_name, "tmp") == 0
- || strcmp(d->d_name, "cur") == 0
- || strcmp(d->d_name, "new") == 0
- || strcmp(d->d_name, ".#evolution") == 0
- || strcmp(d->d_name, ".") == 0
- || strcmp(d->d_name, "..") == 0)
+ if (strcmp (d->d_name, "tmp") == 0
+ || strcmp (d->d_name, "cur") == 0
+ || strcmp (d->d_name, "new") == 0
+ || strcmp (d->d_name, ".#evolution") == 0
+ || strcmp (d->d_name, ".") == 0
+ || strcmp (d->d_name, "..") == 0)
continue;
tmp = g_build_filename (name, d->d_name, NULL);
@@ -1030,10 +1030,10 @@ scan_old_dir_info (CamelStore *store,
snew->dnode = in.dnode;
snew->inode = in.inode;
- if (!strcmp(sn->fi->full_name, "."))
+ if (!strcmp (sn->fi->full_name, "."))
full = g_strdup (d->d_name);
else
- full = g_strdup_printf("%s/%s", sn->fi->full_name, d->d_name);
+ full = g_strdup_printf ("%s/%s", sn->fi->full_name, d->d_name);
fi = camel_folder_info_new ();
fi->full_name = full;
@@ -1096,7 +1096,7 @@ traverse_rename_folder_info (CamelMaildirStore *mstore,
if (fi->child)
traverse_rename_folder_info (mstore, fi->child, cancellable, error);
- if (strcmp (fi->full_name, ".") && ((!g_str_has_prefix (fi->full_name, ".") && (!fi->parent || !strcmp(fi->parent->full_name, "."))) ||
+ if (strcmp (fi->full_name, ".") && ((!g_str_has_prefix (fi->full_name, ".") && (!fi->parent || !strcmp (fi->parent->full_name, "."))) ||
(fi->parent && strcmp (fi->parent->full_name, "."))))
maildir_rename_old_folder (mstore, fi, cancellable, error);
diff --git a/camel/providers/local/camel-maildir-summary.c b/camel/providers/local/camel-maildir-summary.c
index 85d6fbf..9b51054 100644
--- a/camel/providers/local/camel-maildir-summary.c
+++ b/camel/providers/local/camel-maildir-summary.c
@@ -133,7 +133,7 @@ camel_maildir_summary_init (CamelMaildirSummary *maildir_summary)
if (gethostname (hostname, 256) == 0) {
maildir_summary->priv->hostname = g_strdup (hostname);
} else {
- maildir_summary->priv->hostname = g_strdup("localhost");
+ maildir_summary->priv->hostname = g_strdup ("localhost");
}
maildir_summary->priv->summary_lock = g_mutex_new ();
}
@@ -158,7 +158,7 @@ CamelMaildirSummary
parent_store = camel_folder_get_parent_store (folder);
camel_db_set_collate (parent_store->cdb_r, "dreceived", NULL, NULL);
- ((CamelFolderSummary *)o)->sort_by = "dreceived";
+ ((CamelFolderSummary *) o)->sort_by = "dreceived";
((CamelFolderSummary *) o)->collate = NULL;
}
camel_local_summary_construct ((CamelLocalSummary *) o, maildirdir, index);
@@ -264,7 +264,7 @@ maildir_summary_add (CamelLocalSummary *cls,
if (mi) {
if (info) {
camel_maildir_info_set_filename (mi, camel_maildir_summary_info_to_name (mi));
- d(printf("Setting filename to %s\n", camel_maildir_info_filename(mi)));
+ d (printf ("Setting filename to %s\n", camel_maildir_info_filename (mi)));
}
}
@@ -292,7 +292,7 @@ message_info_new_from_header (CamelFolderSummary *s,
/* handle 'duplicates' */
info = camel_folder_summary_peek_loaded (s, uid);
if (info) {
- d(printf("already seen uid '%s', just summarising instead\n", uid));
+ d (printf ("already seen uid '%s', just summarising instead\n", uid));
camel_message_info_free (mi);
mdi = (CamelMaildirMessageInfo *)(mi = info);
}
@@ -328,7 +328,7 @@ message_info_new_from_header (CamelFolderSummary *s,
} else {
/* if creating a file, set its name from the flags we have */
camel_maildir_info_set_filename (mdi, camel_maildir_summary_info_to_name (mdi));
- d(printf("Setting filename to %s\n", camel_maildir_info_filename(mi)));
+ d (printf ("Setting filename to %s\n", camel_maildir_info_filename (mi)));
}
}
@@ -366,7 +366,7 @@ static gchar *maildir_summary_next_uid_string (CamelFolderSummary *s)
{
CamelMaildirSummary *mds = (CamelMaildirSummary *) s;
- d(printf("next uid string called?\n"));
+ d (printf ("next uid string called?\n"));
/* if we have a current file, then use that to get the uid */
if (mds->priv->current_file) {
@@ -380,7 +380,7 @@ static gchar *maildir_summary_next_uid_string (CamelFolderSummary *s)
} else {
/* the first would probably work, but just to be safe, check for collisions */
#if 0
- return g_strdup_printf("%ld.%d_%u.%s", time(0), getpid(), camel_folder_summary_next_uid(s), mds->priv->hostname);
+ return g_strdup_printf ("%ld.%d_%u.%s", time (0), getpid (), camel_folder_summary_next_uid (s), mds->priv->hostname);
#else
CamelLocalSummary *cls = (CamelLocalSummary *) s;
gchar *name = NULL, *uid = NULL;
@@ -395,8 +395,8 @@ static gchar *maildir_summary_next_uid_string (CamelFolderSummary *s)
g_free (uid);
g_usleep (2 * G_USEC_PER_SEC);
}
- uid = g_strdup_printf("%ld.%d_%u.%s", time(NULL), getpid(), nextuid, mds->priv->hostname);
- name = g_strdup_printf("%s/tmp/%s", cls->folder_path, uid);
+ uid = g_strdup_printf ("%ld.%d_%u.%s", time (NULL), getpid (), nextuid, mds->priv->hostname);
+ name = g_strdup_printf ("%s/tmp/%s", cls->folder_path, uid);
retry++;
} while (g_stat (name, &st) == 0 && retry < 3);
@@ -422,9 +422,9 @@ maildir_summary_load (CamelLocalSummary *cls,
CamelMemPool *pool;
gint ret;
- cur = g_strdup_printf("%s/cur", cls->folder_path);
+ cur = g_strdup_printf ("%s/cur", cls->folder_path);
- d(printf("pre-loading uid <> filename map\n"));
+ d (printf ("pre-loading uid <> filename map\n"));
dir = opendir (cur);
if (dir == NULL) {
@@ -478,11 +478,11 @@ camel_maildir_summary_add (CamelLocalSummary *cls,
GCancellable *cancellable)
{
CamelMaildirSummary *maildirs = (CamelMaildirSummary *) cls;
- gchar *filename = g_strdup_printf("%s/cur/%s", cls->folder_path, name);
+ gchar *filename = g_strdup_printf ("%s/cur/%s", cls->folder_path, name);
gint fd;
CamelMimeParser *mp;
- d(printf("summarising: %s\n", name));
+ d (printf ("summarising: %s\n", name));
fd = open (filename, O_RDONLY | O_LARGEFILE);
if (fd == -1) {
@@ -494,7 +494,7 @@ camel_maildir_summary_add (CamelLocalSummary *cls,
camel_mime_parser_scan_from (mp, FALSE);
camel_mime_parser_init_with_fd (mp, fd);
if (cls->index && (forceindex || !camel_index_has_name (cls->index, name))) {
- d(printf("forcing indexing of message content\n"));
+ d (printf ("forcing indexing of message content\n"));
camel_folder_summary_set_index ((CamelFolderSummary *) maildirs, cls->index);
} else {
camel_folder_summary_set_index ((CamelFolderSummary *) maildirs, NULL);
@@ -518,7 +518,7 @@ remove_summary (gchar *key,
CamelMessageInfo *info,
struct _remove_data *rd)
{
- d(printf("removing message %s from summary\n", key));
+ d (printf ("removing message %s from summary\n", key));
if (rd->cls->index)
camel_index_delete_name (rd->cls->index, camel_message_info_uid (info));
if (rd->changes)
@@ -549,10 +549,10 @@ maildir_summary_check (CamelLocalSummary *cls,
g_mutex_lock (((CamelMaildirSummary *) cls)->priv->summary_lock);
- new = g_strdup_printf("%s/new", cls->folder_path);
- cur = g_strdup_printf("%s/cur", cls->folder_path);
+ new = g_strdup_printf ("%s/new", cls->folder_path);
+ cur = g_strdup_printf ("%s/cur", cls->folder_path);
- d(printf("checking summary ...\n"));
+ d (printf ("checking summary ...\n"));
camel_operation_push_message (
cancellable, _("Checking folder consistency"));
@@ -685,9 +685,9 @@ maildir_summary_check (CamelLocalSummary *cls,
}
/* copy this to the destination folder, use 'standard' semantics for maildir info field */
- src = g_strdup_printf("%s/%s", new, name);
- destfilename = g_strdup_printf("%s:2,", destname);
- dest = g_strdup_printf("%s/%s", cur, destfilename);
+ src = g_strdup_printf ("%s/%s", new, name);
+ destfilename = g_strdup_printf ("%s:2,", destname);
+ dest = g_strdup_printf ("%s/%s", cur, destfilename);
/* FIXME: This should probably use link/unlink */
@@ -699,7 +699,7 @@ maildir_summary_check (CamelLocalSummary *cls,
}
} else {
/* else? we should probably care about failures, but wont */
- g_warning("Failed to move new maildir message %s to cur %s", src, dest);
+ g_warning ("Failed to move new maildir message %s to cur %s", src, dest);
}
/* c strings are painful to work with ... */
@@ -738,7 +738,7 @@ maildir_summary_sync (CamelLocalSummary *cls,
struct stat st;
GPtrArray *known_uids;
- d(printf("summary_sync(expunge=%s)\n", expunge?"true":"false"));
+ d (printf ("summary_sync(expunge=%s)\n", expunge?"true":"false"));
if (camel_local_summary_check (cls, changes, cancellable, error) == -1)
return -1;
@@ -753,8 +753,8 @@ maildir_summary_sync (CamelLocalSummary *cls,
info = camel_folder_summary_get ((CamelFolderSummary *) cls, g_ptr_array_index (known_uids, i));
mdi = (CamelMaildirMessageInfo *) info;
if (mdi && (mdi->info.info.flags & CAMEL_MESSAGE_DELETED) && expunge) {
- name = g_strdup_printf("%s/cur/%s", cls->folder_path, camel_maildir_info_filename(mdi));
- d(printf("deleting %s\n", name));
+ name = g_strdup_printf ("%s/cur/%s", cls->folder_path, camel_maildir_info_filename (mdi));
+ d (printf ("deleting %s\n", name));
if (unlink (name) == 0 || errno == ENOENT) {
/* FIXME: put this in folder_summary::remove()? */
@@ -774,8 +774,8 @@ maildir_summary_sync (CamelLocalSummary *cls,
/* have our flags/ i.e. name changed? */
if (strcmp (newname, camel_maildir_info_filename (mdi))) {
- name = g_strdup_printf("%s/cur/%s", cls->folder_path, camel_maildir_info_filename(mdi));
- dest = g_strdup_printf("%s/cur/%s", cls->folder_path, newname);
+ name = g_strdup_printf ("%s/cur/%s", cls->folder_path, camel_maildir_info_filename (mdi));
+ dest = g_strdup_printf ("%s/cur/%s", cls->folder_path, newname);
g_rename (name, dest);
if (g_stat (dest, &st) == -1) {
/* we'll assume it didn't work, but dont change anything else */
diff --git a/camel/providers/local/camel-mbox-folder.c b/camel/providers/local/camel-mbox-folder.c
index 29dcef4..81a75bd 100644
--- a/camel/providers/local/camel-mbox-folder.c
+++ b/camel/providers/local/camel-mbox-folder.c
@@ -96,7 +96,7 @@ mbox_folder_get_filename (CamelFolder *folder,
goffset frompos;
gchar *filename = NULL;
- d(printf("Getting message %s\n", uid));
+ d (printf ("Getting message %s\n", uid));
/* lock the folder first, burn if we can't, need write lock for summary check */
if (camel_local_folder_lock (lf, CAMEL_LOCK_WRITE, error) == -1)
@@ -159,7 +159,7 @@ mbox_folder_append_message_sync (CamelFolder *folder,
if (camel_local_folder_lock (lf, CAMEL_LOCK_WRITE, error) == -1)
return FALSE;
- d(printf("Appending message\n"));
+ d (printf ("Appending message\n"));
/* first, check the summary is correct (updates folder_size too) */
retval = camel_local_summary_check ((CamelLocalSummary *) folder->summary, lf->changes, cancellable, error);
@@ -171,7 +171,7 @@ mbox_folder_append_message_sync (CamelFolder *folder,
if (mi == NULL)
goto fail;
- d(printf("Appending message: uid is %s\n", camel_message_info_uid(mi)));
+ d (printf ("Appending message: uid is %s\n", camel_message_info_uid (mi)));
has_attachment = camel_mime_message_has_attachment (message);
if (((camel_message_info_flags (mi) & CAMEL_MESSAGE_ATTACHMENTS) && !has_attachment) ||
@@ -195,7 +195,7 @@ mbox_folder_append_message_sync (CamelFolder *folder,
xev = camel_local_summary_encode_x_evolution ((CamelLocalSummary *) folder->summary, mi);
if (xev) {
/* the x-ev header should match the 'current' flags, no problem, so store as much */
- camel_medium_set_header((CamelMedium *)message, "X-Evolution", xev);
+ camel_medium_set_header ((CamelMedium *) message, "X-Evolution", xev);
mi->flags &= ~ CAMEL_MESSAGE_FOLDER_NOXEV | CAMEL_MESSAGE_FOLDER_FLAGGED;
g_free (xev);
}
@@ -307,7 +307,7 @@ mbox_folder_get_message_sync (CamelFolder *folder,
gint retried = FALSE;
goffset frompos;
- d(printf("Getting message %s\n", uid));
+ d (printf ("Getting message %s\n", uid));
/* lock the folder first, burn if we can't, need write lock for summary check */
if (camel_local_folder_lock (lf, CAMEL_LOCK_WRITE, error) == -1)
@@ -360,8 +360,8 @@ retry:
if (camel_mime_parser_step (parser, NULL, NULL) != CAMEL_MIME_PARSER_STATE_FROM
|| camel_mime_parser_tell_start_from (parser) != frompos) {
- g_warning("Summary doesn't match the folder contents! eek!\n"
- " expecting offset %ld got %ld, state = %d", (glong)frompos,
+ g_warning ("Summary doesn't match the folder contents! eek!\n"
+ " expecting offset %ld got %ld, state = %d", (glong) frompos,
(glong) camel_mime_parser_tell_start_from (parser),
camel_mime_parser_state (parser));
@@ -394,7 +394,7 @@ retry:
goto fail;
}
- camel_medium_remove_header((CamelMedium *)message, "X-Evolution");
+ camel_medium_remove_header ((CamelMedium *) message, "X-Evolution");
fail:
/* and unlock now we're finished with it */
diff --git a/camel/providers/local/camel-mbox-store.c b/camel/providers/local/camel-mbox-store.c
index 4e400a4..ccf69e8 100644
--- a/camel/providers/local/camel-mbox-store.c
+++ b/camel/providers/local/camel-mbox-store.c
@@ -41,7 +41,15 @@
G_DEFINE_TYPE (CamelMboxStore, camel_mbox_store, CAMEL_TYPE_LOCAL_STORE)
static const gchar *extensions[] = {
- ".msf", ".ev-summary", ".ev-summary-meta", ".ibex.index", ".ibex.index.data", ".cmeta", ".lock", ".db", ".journal"
+ ".msf",
+ ".ev-summary",
+ ".ev-summary-meta",
+ ".ibex.index",
+ ".ibex.index.data",
+ ".cmeta",
+ ".lock",
+ ".db",
+ ".journal"
};
/* used to find out where we've visited already */
@@ -92,7 +100,7 @@ ignore_file (const gchar *filename,
return TRUE;
}
- if (sbd && flen > 4 && !strcmp(filename + flen - 4, ".sbd"))
+ if (sbd && flen > 4 && !strcmp (filename + flen - 4, ".sbd"))
return TRUE;
return FALSE;
@@ -122,15 +130,19 @@ fill_fi (CamelStore *store,
local_store = CAMEL_LOCAL_STORE (store);
- /* This should be fast enough not to have to test for INFO_FAST */
+ /* This should be fast enough not
+ * to have to test for INFO_FAST. */
folderpath = camel_local_store_get_full_path (
local_store, fi->full_name);
- mbs = (CamelMboxSummary *) camel_mbox_summary_new (NULL, folderpath, NULL);
+ mbs = (CamelMboxSummary *) camel_mbox_summary_new (
+ NULL, folderpath, NULL);
/* FIXME[disk-summary] track exception */
if (camel_folder_summary_header_load_from_db ((CamelFolderSummary *) mbs, store, fi->full_name, NULL)) {
- fi->unread = camel_folder_summary_get_unread_count ((CamelFolderSummary *) mbs);
- fi->total = camel_folder_summary_get_saved_count ((CamelFolderSummary *) mbs);
+ fi->unread = camel_folder_summary_get_unread_count (
+ (CamelFolderSummary *) mbs);
+ fi->total = camel_folder_summary_get_saved_count (
+ (CamelFolderSummary *) mbs);
}
g_object_unref (mbs);
@@ -139,8 +151,10 @@ fill_fi (CamelStore *store,
if (camel_local_store_is_main_store (CAMEL_LOCAL_STORE (store)) && fi->full_name
&& (fi->flags & CAMEL_FOLDER_TYPE_MASK) == CAMEL_FOLDER_TYPE_NORMAL)
- fi->flags = (fi->flags & ~CAMEL_FOLDER_TYPE_MASK)
- | camel_local_store_get_folder_type_by_full_name (CAMEL_LOCAL_STORE (store), fi->full_name);
+ fi->flags =
+ (fi->flags & ~CAMEL_FOLDER_TYPE_MASK) |
+ camel_local_store_get_folder_type_by_full_name (
+ CAMEL_LOCAL_STORE (store), fi->full_name);
}
static CamelFolderInfo *
@@ -178,7 +192,7 @@ scan_dir (CamelStore *store,
if (ignore_file (dent, FALSE))
continue;
- path = g_strdup_printf("%s/%s", root, dent);
+ path = g_strdup_printf ("%s/%s", root, dent);
if (g_stat (path, &st) == -1) {
g_free (path);
continue;
@@ -194,11 +208,11 @@ scan_dir (CamelStore *store,
}
#endif
short_name = g_strdup (dent);
- if ((ext = strrchr(short_name, '.')) && !strcmp(ext, ".sbd"))
+ if ((ext = strrchr (short_name, '.')) && !strcmp (ext, ".sbd"))
*ext = '\0';
if (name != NULL)
- full_name = g_strdup_printf("%s/%s", name, short_name);
+ full_name = g_strdup_printf ("%s/%s", name, short_name);
else
full_name = g_strdup (short_name);
@@ -207,7 +221,7 @@ scan_dir (CamelStore *store,
g_free (full_name);
if (S_ISDIR (st.st_mode)) {
- fi->flags =(fi->flags & ~CAMEL_FOLDER_NOCHILDREN) | CAMEL_FOLDER_CHILDREN;
+ fi->flags = (fi->flags & ~CAMEL_FOLDER_NOCHILDREN) | CAMEL_FOLDER_CHILDREN;
} else {
fi->flags &= ~CAMEL_FOLDER_NOSELECT;
}
@@ -250,7 +264,7 @@ scan_dir (CamelStore *store,
if ((fi->child = scan_dir (store, visited, fi, path, fi->full_name, flags, error)))
fi->flags |= CAMEL_FOLDER_CHILDREN;
else
- fi->flags =(fi->flags & ~CAMEL_FOLDER_CHILDREN) | CAMEL_FOLDER_NOCHILDREN;
+ fi->flags = (fi->flags & ~CAMEL_FOLDER_CHILDREN) | CAMEL_FOLDER_NOCHILDREN;
}
}
@@ -395,7 +409,14 @@ mbox_store_get_folder_sync (CamelStore *store,
g_free (dirname);
- fd = g_open (name, O_LARGEFILE | O_WRONLY | O_CREAT | O_APPEND | O_BINARY, 0666);
+ fd = g_open (
+ name,
+ O_LARGEFILE |
+ O_WRONLY |
+ O_CREAT |
+ O_APPEND |
+ O_BINARY, 0666);
+
if (fd == -1) {
g_set_error (
error, G_IO_ERROR,
@@ -476,7 +497,7 @@ mbox_store_get_folder_info_sync (CamelStore *store,
/* requesting scan of specific folder */
if (g_stat (path, &st) == -1 || !S_ISREG (st.st_mode)) {
- char *test_if_subdir = g_strdup_printf("%s.sbd", path);
+ gchar *test_if_subdir = g_strdup_printf ("%s.sbd", path);
if (g_stat (test_if_subdir, &st) == -1) {
g_free (path);
@@ -499,7 +520,7 @@ mbox_store_get_folder_info_sync (CamelStore *store,
fill_fi (store, fi, flags);
- subdir = g_strdup_printf("%s.sbd", path);
+ subdir = g_strdup_printf ("%s.sbd", path);
if (g_stat (subdir, &st) == 0) {
if (S_ISDIR (st.st_mode))
fi->child = scan_dir (store, visited, fi, subdir, top, flags, error);
@@ -526,8 +547,10 @@ mbox_store_create_folder_sync (CamelStore *store,
GCancellable *cancellable,
GError **error)
{
- /* FIXME: this is almost an exact copy of CamelLocalStore::create_folder() except that we use
- * different path schemes... need to find a way to share parent's code? */
+ /* FIXME This is almost an exact copy of
+ * CamelLocalStore::create_folder() except that we use
+ * different path schemes - need to find a way to share
+ * parent's code? */
CamelLocalSettings *local_settings;
CamelLocalStore *local_store;
CamelFolderInfo *info = NULL;
@@ -627,7 +650,7 @@ mbox_store_delete_folder_sync (CamelStore *store,
local_store = CAMEL_LOCAL_STORE (store);
name = camel_local_store_get_full_path (local_store, folder_name);
- path = g_strdup_printf("%s.sbd", name);
+ path = g_strdup_printf ("%s.sbd", name);
if (g_rmdir (path) == -1 && errno != ENOENT) {
g_set_error (
@@ -825,29 +848,30 @@ mbox_store_rename_folder_sync (CamelStore *store,
goto ibex_failed;
}
} else {
- /* TODO: camel_text_index_rename should find out if we have an active index itself? */
+ /* TODO camel_text_index_rename should find out
+ * if we have an active index itself? */
if (camel_text_index_rename (oldibex, newibex) == -1 && errno != ENOENT) {
errnosav = errno;
goto ibex_failed;
}
}
- if (xrename(store, old, new, ".ev-summary", TRUE) == -1) {
+ if (xrename (store, old, new, ".ev-summary", TRUE) == -1) {
errnosav = errno;
goto summary_failed;
}
- if (xrename(store, old, new, ".ev-summary-meta", TRUE) == -1) {
+ if (xrename (store, old, new, ".ev-summary-meta", TRUE) == -1) {
errnosav = errno;
goto summary_failed;
}
- if (xrename(store, old, new, ".cmeta", TRUE) == -1) {
+ if (xrename (store, old, new, ".cmeta", TRUE) == -1) {
errnosav = errno;
goto cmeta_failed;
}
- if (xrename(store, old, new, ".sbd", TRUE) == -1) {
+ if (xrename (store, old, new, ".sbd", TRUE) == -1) {
errnosav = errno;
goto subdir_failed;
}
@@ -866,12 +890,12 @@ mbox_store_rename_folder_sync (CamelStore *store,
return TRUE;
base_failed:
- xrename(store, new, old, ".sbd", TRUE);
+ xrename (store, new, old, ".sbd", TRUE);
subdir_failed:
- xrename(store, new, old, ".cmeta", TRUE);
+ xrename (store, new, old, ".cmeta", TRUE);
cmeta_failed:
- xrename(store, new, old, ".ev-summary", TRUE);
- xrename(store, new, old, ".ev-summary-meta", TRUE);
+ xrename (store, new, old, ".ev-summary", TRUE);
+ xrename (store, new, old, ".ev-summary-meta", TRUE);
summary_failed:
if (folder) {
if (folder->index)
@@ -958,7 +982,10 @@ mbox_store_get_meta_path (CamelLocalStore *ls,
name = g_alloca (strlen (full_name) + strlen (ext) + 2);
if ((slash = strrchr (full_name, '/')))
- sprintf (name, "%.*s.%s%s", slash - full_name + 1, full_name, slash + 1, ext);
+ sprintf (
+ name, "%.*s.%s%s",
+ slash - full_name + 1,
+ full_name, slash + 1, ext);
else
sprintf (name, ".%s%s", full_name, ext);
diff --git a/camel/providers/local/camel-mbox-summary.c b/camel/providers/local/camel-mbox-summary.c
index 6821715..b00e6c3 100644
--- a/camel/providers/local/camel-mbox-summary.c
+++ b/camel/providers/local/camel-mbox-summary.c
@@ -186,7 +186,7 @@ camel_mbox_summary_new (CamelFolder *folder,
parent_store = camel_folder_get_parent_store (folder);
/* Set the functions for db sorting */
- camel_db_set_collate (parent_store->cdb_r, "bdata", "mbox_frompos_sort", (CamelDBCollate)camel_local_frompos_sort);
+ camel_db_set_collate (parent_store->cdb_r, "bdata", "mbox_frompos_sort", (CamelDBCollate) camel_local_frompos_sort);
summary->sort_by = "bdata";
summary->collate = "mbox_frompos_sort";
@@ -212,10 +212,10 @@ mbox_summary_encode_x_evolution (CamelLocalSummary *cls,
while (*p && isdigit (*p))
p++;
- if (*p == 0 && sscanf(uidstr, "%u", &uid) == 1) {
- return g_strdup_printf("%08x-%04x", uid, mi->info.flags & 0xffff);
+ if (*p == 0 && sscanf (uidstr, "%u", &uid) == 1) {
+ return g_strdup_printf ("%08x-%04x", uid, mi->info.flags & 0xffff);
} else {
- return g_strdup_printf("%s-%04x", uidstr, mi->info.flags & 0xffff);
+ return g_strdup_printf ("%s-%04x", uidstr, mi->info.flags & 0xffff);
}
}
@@ -277,20 +277,20 @@ message_info_new_from_header (CamelFolderSummary *s,
if (mbs->xstatus) {
/* check for existance of status & x-status headers */
- status = camel_header_raw_find(&h, "Status", NULL);
+ status = camel_header_raw_find (&h, "Status", NULL);
if (status)
flags = decode_status (status);
- xstatus = camel_header_raw_find(&h, "X-Status", NULL);
+ xstatus = camel_header_raw_find (&h, "X-Status", NULL);
if (xstatus)
flags |= decode_status (xstatus);
}
#endif
/* if we have an xev header, use it, else assign a new one */
- xev = camel_header_raw_find(&h, "X-Evolution", NULL);
+ xev = camel_header_raw_find (&h, "X-Evolution", NULL);
if (xev != NULL
&& camel_local_summary_decode_x_evolution ((CamelLocalSummary *) s, xev, &mi->info) == 0) {
uid = camel_message_info_uid (mi);
- d(printf("found valid x-evolution: %s\n", uid));
+ d (printf ("found valid x-evolution: %s\n", uid));
/* If one is there, it should be there already */
info = (CamelMboxMessageInfo *) camel_folder_summary_peek_loaded (s, uid);
if (info) {
@@ -300,15 +300,15 @@ message_info_new_from_header (CamelFolderSummary *s,
mi = info;
} else {
add = 7;
- d(printf("seen '%s' before, adding anew\n", uid));
+ d (printf ("seen '%s' before, adding anew\n", uid));
camel_message_info_free (info);
}
} else {
add = 2;
- d(printf("but isn't present in summary\n"));
+ d (printf ("but isn't present in summary\n"));
}
} else {
- d(printf("didn't find x-evolution\n"));
+ d (printf ("didn't find x-evolution\n"));
add = 7;
}
@@ -384,7 +384,7 @@ message_info_to_db (CamelFolderSummary *s,
struct _CamelMIRecord *mir;
mir = CAMEL_FOLDER_SUMMARY_CLASS (camel_mbox_summary_parent_class)->message_info_to_db (s, info);
- mir->bdata = g_strdup_printf("%" G_GOFFSET_FORMAT, mbi->frompos);
+ mir->bdata = g_strdup_printf ("%" G_GOFFSET_FORMAT, mbi->frompos);
return mir;
}
@@ -411,7 +411,7 @@ summary_update (CamelLocalSummary *cls,
GList *del = NULL;
GPtrArray *known_uids;
- d(printf("Calling summary update, from pos %d\n", (gint)offset));
+ d (printf ("Calling summary update, from pos %d\n", (gint) offset));
cls->index_force = FALSE;
@@ -420,7 +420,7 @@ summary_update (CamelLocalSummary *cls,
camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
fd = g_open (cls->folder_path, O_LARGEFILE | O_RDONLY | O_BINARY, 0);
if (fd == -1) {
- d(printf("%s failed to open: %s\n", cls->folder_path, g_strerror (errno)));
+ d (printf ("%s failed to open: %s\n", cls->folder_path, g_strerror (errno)));
camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
g_set_error (
error, G_IO_ERROR,
@@ -444,7 +444,7 @@ summary_update (CamelLocalSummary *cls,
&& camel_mime_parser_tell_start_from (mp) == offset) {
camel_mime_parser_unstep (mp);
} else {
- g_warning("The next message didn't start where I expected, building summary from start");
+ g_warning ("The next message didn't start where I expected, building summary from start");
camel_mime_parser_drop_step (mp);
offset = 0;
camel_mime_parser_seek (mp, offset, SEEK_SET);
@@ -510,7 +510,7 @@ summary_update (CamelLocalSummary *cls,
mi = (CamelMboxMessageInfo *) camel_folder_summary_get (s, uid);
/* must've dissapeared from the file? */
if (!mi || mi->info.info.flags & CAMEL_MESSAGE_FOLDER_NOTSEEN) {
- d(printf("uid '%s' vanished, removing", uid));
+ d (printf ("uid '%s' vanished, removing", uid));
if (changeinfo)
camel_folder_change_info_remove_uid (changeinfo, uid);
del = g_list_prepend (del, (gpointer) camel_pstring_strdup (uid));
@@ -561,7 +561,7 @@ mbox_summary_check (CamelLocalSummary *cls,
gint ret = 0;
gint i;
- d(printf("Checking summary\n"));
+ d (printf ("Checking summary\n"));
camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
@@ -585,7 +585,7 @@ mbox_summary_check (CamelLocalSummary *cls,
GPtrArray *known_uids;
/* empty? No need to scan at all */
- d(printf("Empty mbox, clearing summary\n"));
+ d (printf ("Empty mbox, clearing summary\n"));
camel_folder_summary_prepare_fetch_all (s, NULL);
known_uids = camel_folder_summary_get_array (s);
for (i = 0; known_uids && i < known_uids->len; i++) {
@@ -604,14 +604,14 @@ mbox_summary_check (CamelLocalSummary *cls,
if (st.st_size != mbs->folder_size || st.st_mtime != s->time) {
if (mbs->folder_size < st.st_size) {
/* this will automatically rescan from 0 if there is a problem */
- d(printf("folder grew, attempting to rebuild from %d\n", mbs->folder_size));
+ d (printf ("folder grew, attempting to rebuild from %d\n", mbs->folder_size));
ret = summary_update (cls, mbs->folder_size, changes, cancellable, error);
} else {
- d(printf("folder shrank! rebuilding from start\n"));
+ d (printf ("folder shrank! rebuilding from start\n"));
ret = summary_update (cls, 0, changes, cancellable, error);
}
} else {
- d(printf("Folder unchanged, do nothing\n"));
+ d (printf ("Folder unchanged, do nothing\n"));
}
}
@@ -645,7 +645,7 @@ mbox_summary_sync_full (CamelMboxSummary *mbs,
guint32 flags = (expunge ? 1 : 0), filemode = 0600;
struct stat st;
- d(printf("performing full summary/sync\n"));
+ d (printf ("performing full summary/sync\n"));
camel_operation_push_message (cancellable, _("Storing folder"));
camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
@@ -668,7 +668,7 @@ mbox_summary_sync_full (CamelMboxSummary *mbs,
tmpname = g_alloca (strlen (cls->folder_path) + 5);
sprintf (tmpname, "%s.tmp", cls->folder_path);
- d(printf("Writing temporary file to %s\n", tmpname));
+ d (printf ("Writing temporary file to %s\n", tmpname));
fdout = g_open (tmpname, O_LARGEFILE | O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, filemode);
if (fdout == -1) {
g_set_error (
@@ -684,10 +684,10 @@ mbox_summary_sync_full (CamelMboxSummary *mbs,
fd, fdout, cancellable, error) == -1)
goto error;
- d(printf("Closing folders\n"));
+ d (printf ("Closing folders\n"));
if (close (fd) == -1) {
- g_warning("Cannot close source folder: %s", g_strerror (errno));
+ g_warning ("Cannot close source folder: %s", g_strerror (errno));
g_set_error (
error, G_IO_ERROR,
g_io_error_from_errno (errno),
@@ -698,7 +698,7 @@ mbox_summary_sync_full (CamelMboxSummary *mbs,
}
if (close (fdout) == -1) {
- g_warning("Cannot close temporary folder: %s", g_strerror (errno));
+ g_warning ("Cannot close temporary folder: %s", g_strerror (errno));
g_set_error (
error, G_IO_ERROR,
g_io_error_from_errno (errno),
@@ -715,7 +715,7 @@ mbox_summary_sync_full (CamelMboxSummary *mbs,
g_warning ("Cannot remove %s: %s", cls->folder_path, g_strerror (errno));
#endif
if (g_rename (tmpname, cls->folder_path) == -1) {
- g_warning("Cannot rename folder: %s", g_strerror (errno));
+ g_warning ("Cannot rename folder: %s", g_strerror (errno));
g_set_error (
error, G_IO_ERROR,
g_io_error_from_errno (errno),
@@ -789,7 +789,7 @@ mbox_summary_sync_quick (CamelMboxSummary *mbs,
goffset lastpos;
GPtrArray *summary = NULL;
- d(printf("Performing quick summary sync\n"));
+ d (printf ("Performing quick summary sync\n"));
camel_operation_push_message (cancellable, _("Storing folder"));
camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
@@ -838,7 +838,7 @@ mbox_summary_sync_quick (CamelMboxSummary *mbs,
info = (CamelMboxMessageInfo *) camel_folder_summary_get (s, summary->pdata[i]);
- d(printf("Checking message %s %08x\n", camel_message_info_uid(info), ((CamelMessageInfoBase *)info)->flags));
+ d (printf ("Checking message %s %08x\n", camel_message_info_uid (info), ((CamelMessageInfoBase *) info)->flags));
if ((info->info.info.flags & CAMEL_MESSAGE_FOLDER_FLAGGED) == 0) {
camel_message_info_free ((CamelMessageInfo *) info);
@@ -846,7 +846,7 @@ mbox_summary_sync_quick (CamelMboxSummary *mbs,
continue;
}
- d(printf("Updating message %s: %d\n", camel_message_info_uid(info), (gint)info->frompos));
+ d (printf ("Updating message %s: %d\n", camel_message_info_uid (info), (gint) info->frompos));
camel_mime_parser_seek (mp, info->frompos, SEEK_SET);
@@ -858,7 +858,7 @@ mbox_summary_sync_quick (CamelMboxSummary *mbs,
}
if (camel_mime_parser_tell_start_from (mp) != info->frompos) {
- g_warning("Didn't get the next message where I expected (%d) got %d instead",
+ g_warning ("Didn't get the next message where I expected (%d) got %d instead",
(gint) info->frompos, (gint) camel_mime_parser_tell_start_from (mp));
g_set_error (
error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
@@ -867,13 +867,13 @@ mbox_summary_sync_quick (CamelMboxSummary *mbs,
}
if (camel_mime_parser_step (mp, NULL, NULL) == CAMEL_MIME_PARSER_STATE_FROM_END) {
- g_warning("camel_mime_parser_step failed (2)");
+ g_warning ("camel_mime_parser_step failed (2)");
goto error;
}
- xev = camel_mime_parser_header(mp, "X-Evolution", &xevoffset);
+ xev = camel_mime_parser_header (mp, "X-Evolution", &xevoffset);
if (xev == NULL || camel_local_summary_decode_x_evolution (cls, xev, NULL) == -1) {
- g_warning("We're supposed to have a valid x-ev header, but we dont");
+ g_warning ("We're supposed to have a valid x-ev header, but we dont");
goto error;
}
xevnew = camel_local_summary_encode_x_evolution (cls, &info->info);
@@ -885,7 +885,7 @@ mbox_summary_sync_quick (CamelMboxSummary *mbs,
if (strlen (xev) - 1 != strlen (xevtmp)) {
g_free (xevnew);
g_free (xevtmp);
- g_warning("Hmm, the xev headers shouldn't have changed size, but they did");
+ g_warning ("Hmm, the xev headers shouldn't have changed size, but they did");
goto error;
}
g_free (xevtmp);
@@ -893,7 +893,7 @@ mbox_summary_sync_quick (CamelMboxSummary *mbs,
/* we write out the xevnew string, assuming its been folded identically to the original too! */
lastpos = lseek (fd, 0, SEEK_CUR);
- lseek(fd, xevoffset+strlen("X-Evolution: "), SEEK_SET);
+ lseek (fd, xevoffset + strlen ("X-Evolution: "), SEEK_SET);
do {
len = write (fd, xevnew, strlen (xevnew));
} while (len == -1 && errno == EINTR);
@@ -909,7 +909,7 @@ mbox_summary_sync_quick (CamelMboxSummary *mbs,
info = NULL;
}
- d(printf("Closing folders\n"));
+ d (printf ("Closing folders\n"));
if (close (fd) == -1) {
g_warning ("Cannot close source folder: %s", g_strerror (errno));
@@ -1009,7 +1009,7 @@ mbox_summary_sync (CamelLocalSummary *cls,
ret = CAMEL_MBOX_SUMMARY_GET_CLASS (cls)->sync_quick (
mbs, expunge, changeinfo, cancellable, NULL);
if (ret == -1)
- g_warning("failed a quick-sync, trying a full sync");
+ g_warning ("failed a quick-sync, trying a full sync");
} else {
ret = 0;
}
@@ -1071,7 +1071,7 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
gchar statnew[8], xstatnew[8];
#endif
- d(printf("performing full summary/sync\n"));
+ d (printf ("performing full summary/sync\n"));
camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
@@ -1104,9 +1104,9 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
if (!info)
continue;
- d(printf("Looking at message %s\n", camel_message_info_uid(info)));
+ d (printf ("Looking at message %s\n", camel_message_info_uid (info)));
- d(printf("seeking (%s) to %d\n", ((CamelMessageInfo *) info)->uid, (gint)info->frompos));
+ d (printf ("seeking (%s) to %d\n", ((CamelMessageInfo *) info)->uid, (gint) info->frompos));
if (lastdel)
camel_mime_parser_seek (mp, info->frompos, SEEK_SET);
@@ -1118,7 +1118,7 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
}
if (camel_mime_parser_tell_start_from (mp) != info->frompos) {
- g_warning("Didn't get the next message where I expected (%d) got %d instead",
+ g_warning ("Didn't get the next message where I expected (%d) got %d instead",
(gint) info->frompos, (gint) camel_mime_parser_tell_start_from (mp));
g_set_error (
error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
@@ -1129,7 +1129,7 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
lastdel = FALSE;
if ((flags&1) && info->info.info.flags & CAMEL_MESSAGE_DELETED) {
const gchar *uid = camel_message_info_uid (info);
- d(printf("Deleting %s\n", uid));
+ d (printf ("Deleting %s\n", uid));
if (((CamelLocalSummary *) cls)->index)
camel_index_delete_name (((CamelLocalSummary *) cls)->index, uid);
@@ -1146,20 +1146,20 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
/* otherwise, the message is staying, copy its From_ line across */
#if 0
if (i > 0)
- write(fdout, "\n", 1);
+ write (fdout, "\n", 1);
#endif
info->frompos = lseek (fdout, 0, SEEK_CUR);
((CamelMessageInfo *) info)->dirty = TRUE;
fromline = camel_mime_parser_from_line (mp);
- d(printf("Saving %s:%d\n", camel_message_info_uid(info), info->frompos));
+ d (printf ("Saving %s:%d\n", camel_message_info_uid (info), info->frompos));
g_warn_if_fail (write (fdout, fromline, strlen (fromline)) != -1);
}
if (info && info->info.info.flags & (CAMEL_MESSAGE_FOLDER_NOXEV | CAMEL_MESSAGE_FOLDER_FLAGGED)) {
- d(printf("Updating header for %s flags = %08x\n", camel_message_info_uid(info), info->info.flags));
+ d (printf ("Updating header for %s flags = %08x\n", camel_message_info_uid (info), info->info.flags));
if (camel_mime_parser_step (mp, &buffer, &len) == CAMEL_MIME_PARSER_STATE_FROM_END) {
- g_warning("camel_mime_parser_step failed (2)");
+ g_warning ("camel_mime_parser_step failed (2)");
goto error;
}
@@ -1176,7 +1176,7 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
}
#endif
if (len == -1) {
- d(printf("Error writing to temporary mailbox\n"));
+ d (printf ("Error writing to temporary mailbox\n"));
g_set_error (
error, G_IO_ERROR,
g_io_error_from_errno (errno),
@@ -1192,7 +1192,7 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
camel_mime_parser_drop_step (mp);
if (info) {
- d(printf("looking for message content to copy across from %d\n", (gint)camel_mime_parser_tell(mp)));
+ d (printf ("looking for message content to copy across from %d\n", (gint) camel_mime_parser_tell (mp)));
while (camel_mime_parser_step (mp, &buffer, &len) == CAMEL_MIME_PARSER_STATE_PRE_FROM) {
/*d(printf("copying mbox contents to temporary: '%.*s'\n", len, buffer));*/
if (write (fdout, buffer, len) != len) {
@@ -1206,7 +1206,7 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
}
}
- if (write(fdout, "\n", 1) != 1) {
+ if (write (fdout, "\n", 1) != 1) {
g_set_error (
error, G_IO_ERROR,
g_io_error_from_errno (errno),
@@ -1215,7 +1215,7 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
goto error;
}
- d(printf("we are now at %d, from = %d\n", (gint)camel_mime_parser_tell(mp),
+ d (printf ("we are now at %d, from = %d\n", (gint) camel_mime_parser_tell (mp),
(gint) camel_mime_parser_tell_start_from (mp)));
camel_mime_parser_unstep (mp);
camel_message_info_free ((CamelMessageInfo *) info);
@@ -1232,7 +1232,7 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
#if 0
/* if last was deleted, append the \n we removed */
if (lastdel && count > 0)
- write(fdout, "\n", 1);
+ write (fdout, "\n", 1);
#endif
g_object_unref (mp);
@@ -1294,9 +1294,9 @@ mbox_summary_add (CamelLocalSummary *cls,
/* we snoop and add status/x-status headers to suit */
encode_status (mi->info.info.flags & STATUS_STATUS, status);
- camel_medium_set_header((CamelMedium *)msg, "Status", status);
+ camel_medium_set_header ((CamelMedium *) msg, "Status", status);
encode_status (mi->info.info.flags & STATUS_XSTATUS, status);
- camel_medium_set_header((CamelMedium *)msg, "X-Status", status);
+ camel_medium_set_header ((CamelMedium *) msg, "X-Status", status);
}
return (CamelMessageInfo *) mi;
diff --git a/camel/providers/local/camel-mh-folder.c b/camel/providers/local/camel-mh-folder.c
index e2ec447..5424617 100644
--- a/camel/providers/local/camel-mh-folder.c
+++ b/camel/providers/local/camel-mh-folder.c
@@ -49,7 +49,7 @@ mh_folder_get_filename (CamelFolder *folder,
{
CamelLocalFolder *lf = (CamelLocalFolder *) folder;
- return g_strdup_printf("%s/%s", lf->folder_path, uid);
+ return g_strdup_printf ("%s/%s", lf->folder_path, uid);
}
static gboolean
@@ -68,7 +68,7 @@ mh_folder_append_message_sync (CamelFolder *folder,
/* FIXME: probably needs additional locking (although mh doesn't appear do do it) */
- d(printf("Appending message\n"));
+ d (printf ("Appending message\n"));
/* If we can't lock, don't do anything */
if (!lf || camel_local_folder_lock (lf, CAMEL_LOCK_WRITE, error) == -1)
@@ -85,10 +85,10 @@ mh_folder_append_message_sync (CamelFolder *folder,
camel_message_info_set_flags (mi, CAMEL_MESSAGE_ATTACHMENTS, has_attachment ? CAMEL_MESSAGE_ATTACHMENTS : 0);
}
- d(printf("Appending message: uid is %s\n", camel_message_info_uid(mi)));
+ d (printf ("Appending message: uid is %s\n", camel_message_info_uid (mi)));
/* write it out, use the uid we got from the summary */
- name = g_strdup_printf("%s/%s", lf->folder_path, camel_message_info_uid(mi));
+ name = g_strdup_printf ("%s/%s", lf->folder_path, camel_message_info_uid (mi));
output_stream = camel_stream_fs_new_with_name (
name, O_WRONLY | O_CREAT, 0600, error);
if (output_stream == NULL)
@@ -147,7 +147,7 @@ mh_folder_get_message_sync (CamelFolder *folder,
CamelMessageInfo *info;
gchar *name = NULL;
- d(printf("getting message: %s\n", uid));
+ d (printf ("getting message: %s\n", uid));
if (!lf || camel_local_folder_lock (lf, CAMEL_LOCK_WRITE, error) == -1)
return NULL;
@@ -163,7 +163,7 @@ mh_folder_get_message_sync (CamelFolder *folder,
/* we only need it to check the message exists */
camel_message_info_free (info);
- name = g_strdup_printf("%s/%s", lf->folder_path, uid);
+ name = g_strdup_printf ("%s/%s", lf->folder_path, uid);
message_stream = camel_stream_fs_new_with_name (
name, O_RDONLY, 0, error);
if (message_stream == NULL) {
@@ -238,7 +238,7 @@ camel_mh_folder_new (CamelStore *parent_store,
CamelFolder *folder;
gchar *basename;
- d(printf("Creating mh folder: %s\n", full_name));
+ d (printf ("Creating mh folder: %s\n", full_name));
basename = g_path_get_basename (full_name);
diff --git a/camel/providers/local/camel-mh-settings.c b/camel/providers/local/camel-mh-settings.c
index 12a68a0..0f5d43f 100644
--- a/camel/providers/local/camel-mh-settings.c
+++ b/camel/providers/local/camel-mh-settings.c
@@ -138,7 +138,7 @@ camel_mh_settings_set_use_dot_folders (CamelMhSettings *settings,
{
g_return_if_fail (CAMEL_IS_MH_SETTINGS (settings));
- if ((settings->priv->use_dot_folders ? 1 : 0) == (use_dot_folders ? 1 : 0))
+ if (settings->priv->use_dot_folders == use_dot_folders)
return;
settings->priv->use_dot_folders = use_dot_folders;
diff --git a/camel/providers/local/camel-mh-store.c b/camel/providers/local/camel-mh-store.c
index 27f7328..1c40d37 100644
--- a/camel/providers/local/camel-mh-store.c
+++ b/camel/providers/local/camel-mh-store.c
@@ -104,7 +104,7 @@ folders_update (const gchar *root,
&& (line[flen] == 0 || line[flen] == '/')) {
if (camel_stream_write (out, new, strlen (new), cancellable, NULL) == -1
|| camel_stream_write (out, line + flen, strlen (line) - flen, cancellable, NULL) == -1
- || camel_stream_write(out, "\n", 1, cancellable, NULL) == -1)
+ || camel_stream_write (out, "\n", 1, cancellable, NULL) == -1)
goto fail;
copy = FALSE;
}
@@ -330,8 +330,8 @@ recursive_scan (CamelStore *store,
/* Look for subdirectories to add and scan. */
while ((d = readdir (dp)) != NULL) {
/* Skip current and parent directory. */
- if (strcmp(d->d_name, ".") == 0
- || strcmp(d->d_name, "..") == 0)
+ if (strcmp (d->d_name, ".") == 0
+ || strcmp (d->d_name, "..") == 0)
continue;
/* skip fully-numerical entries (i.e. mh messages) */
@@ -342,7 +342,7 @@ recursive_scan (CamelStore *store,
/* Otherwise, treat at potential node, and recurse,
* a bit more expensive than needed, but tough! */
if (path[0]) {
- tmp = g_strdup_printf("%s/%s", path, d->d_name);
+ tmp = g_strdup_printf ("%s/%s", path, d->d_name);
recursive_scan (
store, &fi->child, fi, visited,
root, tmp, flags, cancellable);
@@ -432,7 +432,7 @@ folders_scan (CamelStore *store,
tmp = g_strdup (line);
g_hash_table_insert (visited, tmp, tmp);
- path = g_strdup_printf("%s/%s", root, line);
+ path = g_strdup_printf ("%s/%s", root, line);
if (g_stat (path, &st) == 0 && S_ISDIR (st.st_mode)) {
fi = folder_info_new (
store, root, line, flags, cancellable);
diff --git a/camel/providers/local/camel-mh-summary.c b/camel/providers/local/camel-mh-summary.c
index 8b3ce9f..50e1ace 100644
--- a/camel/providers/local/camel-mh-summary.c
+++ b/camel/providers/local/camel-mh-summary.c
@@ -105,9 +105,9 @@ camel_mh_summary_new (CamelFolder *folder,
CamelStore *parent_store;
parent_store = camel_folder_get_parent_store (folder);
- camel_db_set_collate (parent_store->cdb_r, "uid", "mh_uid_sort", (CamelDBCollate)camel_local_frompos_sort);
- ((CamelFolderSummary *)o)->sort_by = "uid";
- ((CamelFolderSummary *)o)->collate = "mh_uid_sort";
+ camel_db_set_collate (parent_store->cdb_r, "uid", "mh_uid_sort", (CamelDBCollate) camel_local_frompos_sort);
+ ((CamelFolderSummary *) o)->sort_by = "uid";
+ ((CamelFolderSummary *) o)->collate = "mh_uid_sort";
}
camel_local_summary_construct ((CamelLocalSummary *) o, mhdir, index);
@@ -133,7 +133,7 @@ mh_summary_next_uid_string (CamelFolderSummary *s)
/* else scan for one - and create it too, to make sure */
do {
uid = camel_folder_summary_next_uid (s);
- name = g_strdup_printf("%s/%u", cls->folder_path, uid);
+ name = g_strdup_printf ("%s/%u", cls->folder_path, uid);
/* O_EXCL isn't guaranteed, sigh. Oh well, bad luck, mh has problems anyway */
fd = open (name, O_WRONLY | O_CREAT | O_EXCL | O_LARGEFILE, 0600);
g_free (name);
@@ -142,7 +142,7 @@ mh_summary_next_uid_string (CamelFolderSummary *s)
if (fd != -1)
close (fd);
- uidstr = g_strdup_printf("%u", uid);
+ uidstr = g_strdup_printf ("%u", uid);
}
return uidstr;
@@ -155,11 +155,11 @@ camel_mh_summary_add (CamelLocalSummary *cls,
GCancellable *cancellable)
{
CamelMhSummary *mhs = (CamelMhSummary *) cls;
- gchar *filename = g_strdup_printf("%s/%s", cls->folder_path, name);
+ gchar *filename = g_strdup_printf ("%s/%s", cls->folder_path, name);
gint fd;
CamelMimeParser *mp;
- d(printf("summarising: %s\n", name));
+ d (printf ("summarising: %s\n", name));
fd = open (filename, O_RDONLY | O_LARGEFILE);
if (fd == -1) {
@@ -171,7 +171,7 @@ camel_mh_summary_add (CamelLocalSummary *cls,
camel_mime_parser_scan_from (mp, FALSE);
camel_mime_parser_init_with_fd (mp, fd);
if (cls->index && (forceindex || !camel_index_has_name (cls->index, name))) {
- d(printf("forcing indexing of message content\n"));
+ d (printf ("forcing indexing of message content\n"));
camel_folder_summary_set_index ((CamelFolderSummary *) mhs, cls->index);
} else {
camel_folder_summary_set_index ((CamelFolderSummary *) mhs, NULL);
@@ -190,7 +190,7 @@ remove_summary (gchar *key,
CamelMessageInfo *info,
CamelLocalSummary *cls)
{
- d(printf("removing message %s from summary\n", key));
+ d (printf ("removing message %s from summary\n", key));
if (cls->index)
camel_index_delete_name (cls->index, camel_message_info_uid (info));
camel_folder_summary_remove ((CamelFolderSummary *) cls, info);
@@ -215,7 +215,7 @@ mh_summary_check (CamelLocalSummary *cls,
/* FIXME: Handle changeinfo */
- d(printf("checking summary ...\n"));
+ d (printf ("checking summary ...\n"));
/* scan the directory, check for mail files not in the index, or index entries that
* no longer exist */
@@ -297,7 +297,7 @@ mh_summary_sync (CamelLocalSummary *cls,
gchar *name;
const gchar *uid;
- d(printf("summary_sync(expunge=%s)\n", expunge?"true":"false"));
+ d (printf ("summary_sync(expunge=%s)\n", expunge?"true":"false"));
/* we could probably get away without this ... but why not use it, esp if we're going to
* be doing any significant io already */
@@ -313,8 +313,8 @@ mh_summary_sync (CamelLocalSummary *cls,
g_assert (info);
if (expunge && (info->info.flags & CAMEL_MESSAGE_DELETED)) {
uid = camel_message_info_uid (info);
- name = g_strdup_printf("%s/%s", cls->folder_path, uid);
- d(printf("deleting %s\n", name));
+ name = g_strdup_printf ("%s/%s", cls->folder_path, uid);
+ d (printf ("deleting %s\n", name));
if (unlink (name) == 0 || errno == ENOENT) {
/* FIXME: put this in folder_summary::remove()? */
diff --git a/camel/providers/local/camel-mh-summary.h b/camel/providers/local/camel-mh-summary.h
index 392cba2..c5c1a52 100644
--- a/camel/providers/local/camel-mh-summary.h
+++ b/camel/providers/local/camel-mh-summary.h
@@ -57,8 +57,11 @@ struct _CamelMhSummaryClass {
CamelLocalSummaryClass parent_class;
};
-GType camel_mh_summary_get_type (void);
-CamelMhSummary *camel_mh_summary_new (struct _CamelFolder *, const gchar *mhdir, CamelIndex *index);
+GType camel_mh_summary_get_type (void);
+CamelMhSummary *
+ camel_mh_summary_new (CamelFolder *folder,
+ const gchar *mhdir,
+ CamelIndex *index);
G_END_DECLS
diff --git a/camel/providers/local/camel-spool-folder.c b/camel/providers/local/camel-spool-folder.c
index 16089c7..db7ac8e 100644
--- a/camel/providers/local/camel-spool-folder.c
+++ b/camel/providers/local/camel-spool-folder.c
@@ -1,5 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*-
- *
+/*
* Authors: Michael Zucchi <notzed ximian com>
*
* Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
diff --git a/camel/providers/local/camel-spool-settings.c b/camel/providers/local/camel-spool-settings.c
index 117d511..12a1368 100644
--- a/camel/providers/local/camel-spool-settings.c
+++ b/camel/providers/local/camel-spool-settings.c
@@ -136,7 +136,7 @@ camel_spool_settings_set_use_xstatus_headers (CamelSpoolSettings *settings,
{
g_return_if_fail (CAMEL_IS_SPOOL_SETTINGS (settings));
- if ((settings->priv->use_xstatus_headers ? 1 : 0) == (use_xstatus_headers ? 1 : 0))
+ if (settings->priv->use_xstatus_headers == use_xstatus_headers)
return;
settings->priv->use_xstatus_headers = use_xstatus_headers;
diff --git a/camel/providers/local/camel-spool-store.c b/camel/providers/local/camel-spool-store.c
index 7b53997..b047671 100644
--- a/camel/providers/local/camel-spool-store.c
+++ b/camel/providers/local/camel-spool-store.c
@@ -196,12 +196,12 @@ scan_dir (CamelStore *store,
gchar from[80];
FILE *fp;
- d(printf("checking dir '%s' part '%s' for mbox content\n", root, path));
+ d (printf ("checking dir '%s' part '%s' for mbox content\n", root, path));
/* look for folders matching the right structure, recursively */
if (path) {
name = alloca (strlen (root) + strlen (path) + 2);
- sprintf(name, "%s/%s", root, path);
+ sprintf (name, "%s/%s", root, path);
} else
name = (gchar *) root; /* XXX casting away const */
@@ -242,11 +242,11 @@ scan_dir (CamelStore *store,
}
while ((d = readdir (dir))) {
- if (strcmp(d->d_name, ".") == 0
- || strcmp(d->d_name, "..") == 0)
+ if (strcmp (d->d_name, ".") == 0
+ || strcmp (d->d_name, "..") == 0)
continue;
- tmp = g_strdup_printf("%s/%s", name, d->d_name);
+ tmp = g_strdup_printf ("%s/%s", name, d->d_name);
if (g_stat (tmp, &st) == 0) {
if (path)
fname = g_strdup_printf (
@@ -261,11 +261,11 @@ scan_dir (CamelStore *store,
folder = camel_object_bag_peek (
store->folders, fname);
if (folder == NULL) {
- fp = fopen(tmp, "r");
+ fp = fopen (tmp, "r");
if (fp != NULL) {
isfolder = (st.st_size == 0
|| (fgets (from, sizeof (from), fp) != NULL
- && strncmp(from, "From ", 5) == 0));
+ && strncmp (from, "From ", 5) == 0));
fclose (fp);
}
}
@@ -466,7 +466,7 @@ spool_store_get_folder_sync (CamelStore *store,
gchar *name;
gchar *path;
- d(printf("opening folder %s on path %s\n", folder_name, path));
+ d (printf ("opening folder %s on path %s\n", folder_name, path));
spool_store = CAMEL_SPOOL_STORE (store);
type = spool_store_get_type (spool_store, error);
@@ -485,7 +485,7 @@ spool_store_get_folder_sync (CamelStore *store,
/* we only support an 'INBOX' in mbox mode */
if (type == CAMEL_SPOOL_STORE_MBOX) {
- if (strcmp(folder_name, "INBOX") != 0) {
+ if (strcmp (folder_name, "INBOX") != 0) {
g_set_error (
error, CAMEL_STORE_ERROR,
CAMEL_STORE_ERROR_NO_FOLDER,
diff --git a/camel/providers/local/camel-spool-summary.c b/camel/providers/local/camel-spool-summary.c
index 56782e8..5649a44 100644
--- a/camel/providers/local/camel-spool-summary.c
+++ b/camel/providers/local/camel-spool-summary.c
@@ -91,9 +91,9 @@ camel_spool_summary_new (CamelFolder *folder,
CamelStore *parent_store;
parent_store = camel_folder_get_parent_store (folder);
- camel_db_set_collate (parent_store->cdb_r, "bdata", "spool_frompos_sort", (CamelDBCollate)camel_local_frompos_sort);
- ((CamelFolderSummary *)new)->sort_by = "bdata";
- ((CamelFolderSummary *)new)->collate = "spool_frompos_sort";
+ camel_db_set_collate (parent_store->cdb_r, "bdata", "spool_frompos_sort", (CamelDBCollate) camel_local_frompos_sort);
+ ((CamelFolderSummary *) new)->sort_by = "bdata";
+ ((CamelFolderSummary *) new)->collate = "spool_frompos_sort";
}
camel_local_summary_construct ((CamelLocalSummary *) new, mbox_name, NULL);
camel_folder_summary_load_from_db ((CamelFolderSummary *) new, NULL);
@@ -127,7 +127,7 @@ spool_summary_sync_full (CamelMboxSummary *cls,
struct stat st;
guint32 flags = (expunge ? 1 : 0);
- d(printf("performing full summary/sync\n"));
+ d (printf ("performing full summary/sync\n"));
camel_operation_push_message (cancellable, _("Storing folder"));
@@ -146,7 +146,7 @@ spool_summary_sync_full (CamelMboxSummary *cls,
sprintf (tmpname, "/tmp/spool.camel.XXXXXX");
fdout = g_mkstemp (tmpname);
- d(printf("Writing tmp file to %s\n", tmpname));
+ d (printf ("Writing tmp file to %s\n", tmpname));
if (fdout == -1) {
g_set_error (
error, G_IO_ERROR,
@@ -163,7 +163,7 @@ spool_summary_sync_full (CamelMboxSummary *cls,
/* sync out content */
if (fsync (fdout) == -1) {
- g_warning("Cannot synchronize temporary folder: %s", g_strerror (errno));
+ g_warning ("Cannot synchronize temporary folder: %s", g_strerror (errno));
g_set_error (
error, G_IO_ERROR,
g_io_error_from_errno (errno),
@@ -175,7 +175,7 @@ spool_summary_sync_full (CamelMboxSummary *cls,
/* see if we can write this much to the spool file */
if (fstat (fd, &st) == -1) {
- g_warning("Cannot synchronize temporary folder: %s", g_strerror (errno));
+ g_warning ("Cannot synchronize temporary folder: %s", g_strerror (errno));
g_set_error (
error, G_IO_ERROR,
g_io_error_from_errno (errno),
@@ -187,7 +187,7 @@ spool_summary_sync_full (CamelMboxSummary *cls,
spoollen = st.st_size;
if (fstat (fdout, &st) == -1) {
- g_warning("Cannot synchronize temporary folder: %s", g_strerror (errno));
+ g_warning ("Cannot synchronize temporary folder: %s", g_strerror (errno));
g_set_error (
error, G_IO_ERROR,
g_io_error_from_errno (errno),
@@ -201,11 +201,11 @@ spool_summary_sync_full (CamelMboxSummary *cls,
/* I think this is the right way to do this - checking that the file will fit the new data */
if (outlen > 0
&& (lseek (fd, outlen - 1, SEEK_SET) == -1
- || write(fd, "", 1) != 1
+ || write (fd, "", 1) != 1
|| fsync (fd) == -1
|| lseek (fd, 0, SEEK_SET) == -1
|| lseek (fdout, 0, SEEK_SET) == -1)) {
- g_warning("Cannot synchronize spool folder: %s", g_strerror (errno));
+ g_warning ("Cannot synchronize spool folder: %s", g_strerror (errno));
g_set_error (
error, G_IO_ERROR,
g_io_error_from_errno (errno),
@@ -254,7 +254,7 @@ spool_summary_sync_full (CamelMboxSummary *cls,
g_free (buffer);
- d(printf("Closing folders\n"));
+ d (printf ("Closing folders\n"));
if (ftruncate (fd, outlen) == -1) {
g_set_error (
@@ -269,7 +269,7 @@ spool_summary_sync_full (CamelMboxSummary *cls,
}
if (close (fd) == -1) {
- g_warning("Cannot close source folder: %s", g_strerror (errno));
+ g_warning ("Cannot close source folder: %s", g_strerror (errno));
g_set_error (
error, G_IO_ERROR,
g_io_error_from_errno (errno),
@@ -334,7 +334,7 @@ spool_summary_check (CamelLocalSummary *cls,
/* if we do, then write out the headers using sync_full, etc */
if (work) {
- d(printf("Have to add new headers, re-syncing from the start to accomplish this\n"));
+ d (printf ("Have to add new headers, re-syncing from the start to accomplish this\n"));
if (CAMEL_MBOX_SUMMARY_GET_CLASS (cls)->sync_full (
CAMEL_MBOX_SUMMARY (cls), FALSE,
changeinfo, cancellable, error) == -1)
diff --git a/camel/providers/nntp/camel-nntp-folder.c b/camel/providers/nntp/camel-nntp-folder.c
index 3d775f8..5894ade 100644
--- a/camel/providers/nntp/camel-nntp-folder.c
+++ b/camel/providers/nntp/camel-nntp-folder.c
@@ -66,7 +66,7 @@ nntp_folder_set_apply_filters (CamelNNTPFolder *folder,
g_return_if_fail (folder != NULL);
g_return_if_fail (CAMEL_IS_NNTP_FOLDER (folder));
- if ((folder->priv->apply_filters ? 1 : 0) == (apply_filters ? 1 : 0))
+ if (folder->priv->apply_filters == apply_filters)
return;
folder->priv->apply_filters = apply_filters;
diff --git a/camel/providers/nntp/camel-nntp-provider.c b/camel/providers/nntp/camel-nntp-provider.c
index 9b4a724..6b73d54 100644
--- a/camel/providers/nntp/camel-nntp-provider.c
+++ b/camel/providers/nntp/camel-nntp-provider.c
@@ -45,7 +45,8 @@ static CamelProviderConfEntry nntp_conf_entries[] = {
{ CAMEL_PROVIDER_CONF_SECTION_START, "folders", NULL,
N_("Folders") },
{ CAMEL_PROVIDER_CONF_CHECKBOX, "short-folder-names", NULL,
- N_("_Show folders in short notation (e.g. c.o.linux rather than comp.os.linux)"), "1" },
+ N_("_Show folders in short notation (e.g. c.o.linux rather "
+ "than comp.os.linux)"), "1" },
{ CAMEL_PROVIDER_CONF_CHECKBOX, "folder-hierarchy-relative", NULL,
N_("In the subscription _dialog, show relative folder names"), "1" },
{ CAMEL_PROVIDER_CONF_SECTION_END },
diff --git a/camel/providers/nntp/camel-nntp-settings.c b/camel/providers/nntp/camel-nntp-settings.c
index b775d5c..3a0d4ca 100644
--- a/camel/providers/nntp/camel-nntp-settings.c
+++ b/camel/providers/nntp/camel-nntp-settings.c
@@ -290,7 +290,7 @@ camel_nntp_settings_set_filter_all (CamelNNTPSettings *settings,
{
g_return_if_fail (CAMEL_IS_NNTP_SETTINGS (settings));
- if ((settings->priv->filter_all ? 1 : 0) == (filter_all ? 1 : 0))
+ if (settings->priv->filter_all == filter_all)
return;
settings->priv->filter_all = filter_all;
@@ -339,7 +339,7 @@ camel_nntp_settings_set_folder_hierarchy_relative (CamelNNTPSettings *settings,
{
g_return_if_fail (CAMEL_IS_NNTP_SETTINGS (settings));
- if ((settings->priv->folder_hierarchy_relative ? 1 : 0) == (folder_hierarchy_relative ? 1 : 0))
+ if (settings->priv->folder_hierarchy_relative == folder_hierarchy_relative)
return;
settings->priv->folder_hierarchy_relative = folder_hierarchy_relative;
@@ -382,7 +382,7 @@ camel_nntp_settings_set_short_folder_names (CamelNNTPSettings *settings,
{
g_return_if_fail (CAMEL_IS_NNTP_SETTINGS (settings));
- if ((settings->priv->short_folder_names ? 1 : 0) == (short_folder_names ? 1 : 0))
+ if (settings->priv->short_folder_names == short_folder_names)
return;
settings->priv->short_folder_names = short_folder_names;
diff --git a/camel/providers/nntp/camel-nntp-store-summary.c b/camel/providers/nntp/camel-nntp-store-summary.c
index 368b4f5..4b64b01 100644
--- a/camel/providers/nntp/camel-nntp-store-summary.c
+++ b/camel/providers/nntp/camel-nntp-store-summary.c
@@ -248,7 +248,7 @@ camel_nntp_store_summary_add_from_full (CamelNNTPStoreSummary *s,
gint len;
gchar *full_name;
- d(printf("adding full name '%s' '%c'\n", full, dir_sep));
+ d (printf ("adding full name '%s' '%c'\n", full, dir_sep));
len = strlen (full);
full_name = g_alloca (len + 1);
@@ -259,7 +259,7 @@ camel_nntp_store_summary_add_from_full (CamelNNTPStoreSummary *s,
info = camel_nntp_store_summary_full_name (s, full_name);
if (info) {
camel_store_summary_info_free ((CamelStoreSummary *) s, (CamelStoreInfo *) info);
- d(printf(" already there\n"));
+ d (printf (" already there\n"));
return info;
}
@@ -267,10 +267,10 @@ camel_nntp_store_summary_add_from_full (CamelNNTPStoreSummary *s,
info = (CamelNNTPStoreInfo *) camel_store_summary_add_from_path ((CamelStoreSummary *) s, pathu8);
if (info) {
- d(printf(" '%s' -> '%s'\n", pathu8, full_name));
+ d (printf (" '%s' -> '%s'\n", pathu8, full_name));
camel_store_info_set_string ((CamelStoreSummary *) s, (CamelStoreInfo *) info, CAMEL_NNTP_STORE_INFO_FULL_NAME, full_name);
} else {
- d(printf(" failed\n"));
+ d (printf (" failed\n"));
}
return info;
@@ -290,7 +290,7 @@ summary_header_load (CamelStoreSummary *s,
is->version = version;
if (version < CAMEL_NNTP_STORE_SUMMARY_VERSION_0) {
- g_warning("Store summary header version too low");
+ g_warning ("Store summary header version too low");
return -1;
}
@@ -398,7 +398,7 @@ store_info_set_string (CamelStoreSummary *s,
switch (type) {
case CAMEL_NNTP_STORE_INFO_FULL_NAME:
- d(printf("Set full name %s -> %s\n", nsi->full_name, str));
+ d (printf ("Set full name %s -> %s\n", nsi->full_name, str));
camel_store_summary_lock (s, CAMEL_STORE_SUMMARY_SUMMARY_LOCK);
g_free (nsi->full_name);
nsi->full_name = g_strdup (str);
diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c
index 4d2827e..be3e2df 100644
--- a/camel/providers/nntp/camel-nntp-store.c
+++ b/camel/providers/nntp/camel-nntp-store.c
@@ -199,10 +199,10 @@ xover_setup (CamelNNTPStore *store,
struct _xover_header *xover, *last;
/* manual override */
- if (store->xover || getenv("CAMEL_NNTP_DISABLE_XOVER") != NULL)
+ if (store->xover || getenv ("CAMEL_NNTP_DISABLE_XOVER") != NULL)
return 0;
- ret = camel_nntp_raw_command_auth(store, cancellable, error, &line, "list overview.fmt");
+ ret = camel_nntp_raw_command_auth (store, cancellable, error, &line, "list overview.fmt");
if (ret == -1) {
return -1;
} else if (ret != 215)
@@ -223,7 +223,7 @@ xover_setup (CamelNNTPStore *store,
for (i = 0; i < G_N_ELEMENTS (headers); i++) {
if (strcmp (line, headers[i].name) == 0) {
xover->name = headers[i].name;
- if (strncmp((gchar *) p, "full", 4) == 0)
+ if (strncmp ((gchar *) p, "full", 4) == 0)
xover->skip = strlen (xover->name) + 1;
else
xover->skip = 0;
@@ -656,7 +656,7 @@ nntp_store_info_update (CamelNNTPStore *store,
si = (CamelNNTPStoreInfo *) camel_store_summary_info_new (summ);
relpath = g_alloca (strlen (line) + 2);
- sprintf(relpath, "/%s", line);
+ sprintf (relpath, "/%s", line);
si->info.path = g_strdup (line);
si->full_name = g_strdup (line); /* why do we keep this? */
@@ -675,7 +675,7 @@ nntp_store_info_update (CamelNNTPStore *store,
}
}
- dd(printf("store info update '%s' first '%u' last '%u'\n", line, first, last));
+ dd (printf ("store info update '%s' first '%u' last '%u'\n", line, first, last));
if (si->last) {
if (last > si->last)
@@ -869,7 +869,7 @@ nntp_store_get_cached_folder_info (CamelNNTPStore *store,
GHashTable *known; /* folder name to folder info */
gboolean folder_hierarchy_relative;
gchar *tmpname;
- gchar *top = g_strconcat(orig_top?orig_top:"", ".", NULL);
+ gchar *top = g_strconcat (orig_top ? orig_top:"", ".", NULL);
gint toplen = strlen (top);
service = CAMEL_SERVICE (store);
@@ -979,7 +979,7 @@ nntp_get_date (CamelNNTPStore *nntp_store,
GError **error)
{
guchar *line;
- gint ret = camel_nntp_command(nntp_store, cancellable, error, NULL, (gchar **)&line, "date");
+ gint ret = camel_nntp_command (nntp_store, cancellable, error, NULL, (gchar **) &line, "date");
gchar *ptr;
nntp_store->summary->last_newslist[0] = 0;
@@ -1048,7 +1048,7 @@ nntp_store_get_folder_info_all (CamelNNTPStore *nntp_store,
/* at first, we do a DATE to find out the last load occasion */
nntp_get_date (nntp_store, cancellable, NULL);
do_complete_list_nodate:
- ret = camel_nntp_command (nntp_store, cancellable, error, NULL, (gchar **)&line, "list");
+ ret = camel_nntp_command (nntp_store, cancellable, error, NULL, (gchar **) &line, "list");
if (ret == -1)
goto error;
else if (ret != 215) {
@@ -1097,12 +1097,12 @@ nntp_get_folder_info (CamelStore *store,
CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE (store);
CamelFolderInfo *first = NULL;
- dd(printf("g_f_i: fast %d subscr %d recursive %d online %d top \"%s\"\n",
+ dd (printf ("g_f_i: fast %d subscr %d recursive %d online %d top \"%s\"\n",
flags & CAMEL_STORE_FOLDER_INFO_FAST,
flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED,
flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE,
online,
- top?top:""));
+ top ? top:""));
if (flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED)
first = nntp_store_get_subscribed_folder_info (
@@ -1585,7 +1585,7 @@ camel_nntp_raw_commandv (CamelNNTPStore *store,
strval = g_strdup_printf ("%u-%u", u, u2);
break;
default:
- g_warning("Passing unknown format to nntp_command: %c\n", c);
+ g_warning ("Passing unknown format to nntp_command: %c\n", c);
g_assert (0);
}
@@ -1725,7 +1725,7 @@ camel_nntp_command (CamelNNTPStore *store,
/* Check for unprocessed data, !*/
if (store->stream && store->stream->mode == CAMEL_NNTP_STREAM_DATA) {
- g_warning("Unprocessed data left in stream, flushing");
+ g_warning ("Unprocessed data left in stream, flushing");
while (camel_nntp_stream_getd (store->stream, (guchar **) &p, &u, cancellable, error) > 0)
;
}
@@ -1733,7 +1733,7 @@ camel_nntp_command (CamelNNTPStore *store,
if (folder != NULL
&& (store->current_folder == NULL || strcmp (store->current_folder, full_name) != 0)) {
- ret = camel_nntp_raw_command_auth(store, cancellable, &local_error, line, "group %s", full_name);
+ ret = camel_nntp_raw_command_auth (store, cancellable, &local_error, line, "group %s", full_name);
if (ret == 211) {
g_free (store->current_folder);
store->current_folder = g_strdup (full_name);
diff --git a/camel/providers/nntp/camel-nntp-stream.c b/camel/providers/nntp/camel-nntp-stream.c
index bbb4127..7d17d8d 100644
--- a/camel/providers/nntp/camel-nntp-stream.c
+++ b/camel/providers/nntp/camel-nntp-stream.c
@@ -1,5 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*-
- *
+/*
* Author:
* Michael Zucchi <notzed ximian com>
*
@@ -96,7 +95,6 @@ nntp_stream_fill (CamelNNTPStream *is,
g_io_error_from_errno (errno),
"%s", g_strerror (errno));
}
- dd (printf ("NNTP_STREAM_FILL (ERROR): %d - '%s'\n", left, g_strerror (errno)));
return -1;
}
}
@@ -142,7 +140,6 @@ nntp_stream_read (CamelStream *stream,
is->ptr = p + 3;
is->mode = CAMEL_NNTP_STREAM_EOD;
is->state = 0;
- dd (printf ("NNTP_STREAM_READ (%d):\n%.*s\n", (gint)(o-buffer), (gint)(o-buffer), buffer));
return o - buffer;
}
p++;
@@ -175,8 +172,6 @@ nntp_stream_read (CamelStream *stream,
is->ptr = p;
is->state = state;
- dd (printf ("NNTP_STREAM_READ (%d):\n%.*s\n", (gint)(o-buffer), (gint)(o-buffer), buffer));
-
return o - buffer;
}
@@ -297,7 +292,8 @@ camel_nntp_stream_line (CamelNNTPStream *is,
p = is->ptr;
e = is->end;
- /* Data mode, convert leading '..' to '.', and stop when we reach a solitary '.' */
+ /* Data mode, convert leading '..' to '.',
+ * and stop when we reach a solitary '.' */
if (is->mode == CAMEL_NNTP_STREAM_DATA) {
/* need at least 3 chars in buffer */
while (e - p < 3) {
@@ -393,8 +389,6 @@ camel_nntp_stream_gets (CamelNNTPStream *is,
*len = max;
is->ptr += max;
- dd (printf ("NNTP_STREAM_GETS (%s,%d): '%.*s'\n", end==NULL?"more":"last", *len, (gint)*len, *start));
-
return end == NULL ? 1 : 0;
}
@@ -458,12 +452,11 @@ camel_nntp_stream_getd (CamelNNTPStream *is,
is->mode = CAMEL_NNTP_STREAM_EOD;
is->state = 0;
- dd (printf ("NNTP_STREAM_GETD (%s,%d): '%.*s'\n", "last", *len, (gint)*len, *start));
-
return 0;
}
- /* If at start, just skip '.', else return data upto '.' but skip it */
+ /* If at start, just skip '.', else
+ * return data upto '.' but skip it. */
if (p == s) {
s++;
p++;
@@ -473,8 +466,6 @@ camel_nntp_stream_getd (CamelNNTPStream *is,
*start = s;
is->state = 1;
- dd (printf ("NNTP_STREAM_GETD (%s,%d): '%.*s'\n", "more", *len, (gint)*len, *start));
-
return 1;
}
}
@@ -498,7 +489,6 @@ camel_nntp_stream_getd (CamelNNTPStream *is,
*len = p-s;
*start = s;
- dd (printf ("NNTP_STREAM_GETD (%s,%d): '%.*s'\n", "more", *len, (gint)*len, *start));
return 1;
}
diff --git a/camel/providers/pop3/camel-pop3-engine.c b/camel/providers/pop3/camel-pop3-engine.c
index 86c0d41..916fa95 100644
--- a/camel/providers/pop3/camel-pop3-engine.c
+++ b/camel/providers/pop3/camel-pop3-engine.c
@@ -194,26 +194,26 @@ cmd_capa (CamelPOP3Engine *pe,
gint i;
CamelServiceAuthType *auth;
- dd(printf("cmd_capa\n"));
+ dd (printf ("cmd_capa\n"));
g_return_if_fail (pe != NULL);
do {
ret = camel_pop3_stream_line (stream, &line, &len, cancellable, NULL);
if (ret >= 0) {
- if (strncmp((gchar *) line, "SASL ", 5) == 0) {
+ if (strncmp ((gchar *) line, "SASL ", 5) == 0) {
tok = line + 5;
- dd(printf("scanning tokens '%s'\n", tok));
+ dd (printf ("scanning tokens '%s'\n", tok));
while (tok) {
next = (guchar *) strchr ((gchar *) tok, ' ');
if (next)
*next++ = 0;
auth = camel_sasl_authtype ((const gchar *) tok);
if (auth) {
- dd(printf("got auth type '%s'\n", tok));
+ dd (printf ("got auth type '%s'\n", tok));
pe->auth = g_list_prepend (pe->auth, auth);
} else {
- dd(printf("unsupported auth type '%s'\n", tok));
+ dd (printf ("unsupported auth type '%s'\n", tok));
}
tok = next;
}
@@ -236,7 +236,7 @@ get_capabilities (CamelPOP3Engine *pe,
g_return_if_fail (pe != NULL);
if (!(pe->flags & CAMEL_POP3_ENGINE_DISABLE_EXTENSIONS)) {
- pc = camel_pop3_engine_command_new(pe, CAMEL_POP3_COMMAND_MULTI, cmd_capa, NULL, cancellable, NULL, "CAPA\r\n");
+ pc = camel_pop3_engine_command_new (pe, CAMEL_POP3_COMMAND_MULTI, cmd_capa, NULL, cancellable, NULL, "CAPA\r\n");
while (camel_pop3_engine_iterate (pe, pc, cancellable, NULL) > 0)
;
camel_pop3_engine_command_free (pe, pc);
@@ -318,7 +318,7 @@ camel_pop3_engine_iterate (CamelPOP3Engine *pe,
p = pe->line;
switch (p[0]) {
case '+':
- dd(printf("Got + response\n"));
+ dd (printf ("Got + response\n"));
if (pc->flags & CAMEL_POP3_COMMAND_MULTI) {
pc->state = CAMEL_POP3_COMMAND_DATA;
camel_pop3_stream_set_mode (pe->stream, CAMEL_POP3_STREAM_DATA);
@@ -339,7 +339,7 @@ camel_pop3_engine_iterate (CamelPOP3Engine *pe,
break;
default:
/* what do we do now? f'knows! */
- g_warning("Bad server response: %s\n", p);
+ g_warning ("Bad server response: %s\n", p);
pc->state = CAMEL_POP3_COMMAND_ERR;
break;
}
diff --git a/camel/providers/pop3/camel-pop3-engine.h b/camel/providers/pop3/camel-pop3-engine.h
index 91c38cc..35ba1c7 100644
--- a/camel/providers/pop3/camel-pop3-engine.h
+++ b/camel/providers/pop3/camel-pop3-engine.h
@@ -50,7 +50,8 @@ typedef struct _CamelPOP3Engine CamelPOP3Engine;
typedef struct _CamelPOP3EngineClass CamelPOP3EngineClass;
typedef struct _CamelPOP3Command CamelPOP3Command;
-/* pop 3 connection states, actually since we're given a connected socket, we always start in auth state */
+/* POP3 connection states, actually since we're given
+ * a connected socket, we always start in auth state. */
typedef enum {
CAMEL_POP3_ENGINE_DISCONNECT = 0,
CAMEL_POP3_ENGINE_AUTH,
@@ -90,7 +91,10 @@ enum {
CAMEL_POP3_ENGINE_DISABLE_EXTENSIONS = 1 << 0
};
-typedef void (*CamelPOP3CommandFunc)(CamelPOP3Engine *pe, CamelPOP3Stream *stream, GCancellable *cancellable, gpointer data);
+typedef void (*CamelPOP3CommandFunc) (CamelPOP3Engine *pe,
+ CamelPOP3Stream *stream,
+ GCancellable *cancellable,
+ gpointer data);
struct _CamelPOP3Command {
guint32 flags;
diff --git a/camel/providers/pop3/camel-pop3-folder.c b/camel/providers/pop3/camel-pop3-folder.c
index a469746..9101e11 100644
--- a/camel/providers/pop3/camel-pop3-folder.c
+++ b/camel/providers/pop3/camel-pop3-folder.c
@@ -78,14 +78,14 @@ cmd_uidl (CamelPOP3Engine *pe,
if (ret >= 0) {
if (strlen ((gchar *) line) > 1024)
line[1024] = 0;
- if (sscanf((gchar *) line, "%u %s", &id, uid) == 2) {
+ if (sscanf ((gchar *) line, "%u %s", &id, uid) == 2) {
fi = g_hash_table_lookup (folder->uids_id, GINT_TO_POINTER (id));
if (fi) {
camel_operation_progress (NULL, (fi->index + 1) * 100 / folder->uids->len);
fi->uid = g_strdup (uid);
g_hash_table_insert (folder->uids_fi, fi->uid, fi);
} else {
- g_warning("ID %u (uid: %s) not in previous LIST output", id, uid);
+ g_warning ("ID %u (uid: %s) not in previous LIST output", id, uid);
}
}
}
@@ -122,8 +122,8 @@ cmd_builduid (CamelPOP3Engine *pe,
case CAMEL_MIME_PARSER_STATE_MULTIPART:
h = camel_mime_parser_headers_raw (mp);
while (h) {
- if (g_ascii_strcasecmp(h->name, "status") != 0
- && g_ascii_strcasecmp(h->name, "x-status") != 0) {
+ if (g_ascii_strcasecmp (h->name, "status") != 0
+ && g_ascii_strcasecmp (h->name, "x-status") != 0) {
g_checksum_update (checksum, (guchar *) h->name, -1);
g_checksum_update (checksum, (guchar *) h->value, -1);
}
@@ -138,7 +138,7 @@ cmd_builduid (CamelPOP3Engine *pe,
fi->uid = g_base64_encode ((guchar *) digest, length);
- d(printf("building uid for id '%d' = '%s'\n", fi->id, fi->uid));
+ d (printf ("building uid for id '%d' = '%s'\n", fi->id, fi->uid));
}
static void
@@ -175,13 +175,13 @@ cmd_list (CamelPOP3Engine *pe,
do {
ret = camel_pop3_stream_line (stream, &line, &len, cancellable, NULL);
if (ret >= 0) {
- if (sscanf((gchar *) line, "%u %u", &id, &size) == 2) {
+ if (sscanf ((gchar *) line, "%u %u", &id, &size) == 2) {
fi = g_malloc0 (sizeof (*fi));
fi->size = size;
fi->id = id;
fi->index = ((CamelPOP3Folder *) folder)->uids->len;
if ((pop3_store->engine->capa & CAMEL_POP3_CAP_UIDL) == 0)
- fi->cmd = camel_pop3_engine_command_new(pe, CAMEL_POP3_COMMAND_MULTI, cmd_builduid, fi, cancellable, NULL, "TOP %u 0\r\n", id);
+ fi->cmd = camel_pop3_engine_command_new (pe, CAMEL_POP3_COMMAND_MULTI, cmd_builduid, fi, cancellable, NULL, "TOP %u 0\r\n", id);
g_ptr_array_add (pop3_folder->uids, fi);
g_hash_table_insert (pop3_folder->uids_id, GINT_TO_POINTER (id), fi);
}
@@ -204,7 +204,7 @@ cmd_list (CamelPOP3Engine *pe,
/* First time downloading the POP folder, lets just download only a batch. */
last_uid = -1;
}
- d(printf("Last stored' first uid: %d\n", last_uid));
+ d (printf ("Last stored' first uid: %d\n", last_uid));
}
if (last_uid == -1)
@@ -225,9 +225,9 @@ cmd_list (CamelPOP3Engine *pe,
/* Lets pull another window of old messages */
save_uid = TRUE;
/* Decrement 'i' by another batch count or till we reach the first message */
- d(printf("Fetch more (%d): from %d", pop3_folder->fetch_more, i));
+ d (printf ("Fetch more (%d): from %d", pop3_folder->fetch_more, i));
for (k = 0; k< pop3_folder->fetch_more && i>= 0; k++, i--);
- d(printf(" to %d\n", i));
+ d (printf (" to %d\n", i));
/* Don't load messages newer than the latest we already had. We had to just get old messages and not
* new messages. */
@@ -269,7 +269,7 @@ cmd_list (CamelPOP3Engine *pe,
free_fi (pop3_folder, fi);
}
g_ptr_array_remove_range (pop3_folder->uids, 0, i);
- d(printf("Removing %d uids that are old\n", i));
+ d (printf ("Removing %d uids that are old\n", i));
}
@@ -300,7 +300,7 @@ cmd_list (CamelPOP3Engine *pe,
g_key_file_load_from_file (pop3_folder->key_file, path, G_KEY_FILE_NONE, NULL);
g_free (contents);
g_free (path);
- d(printf("Saving last uid %d\n", fi->id));
+ d (printf ("Saving last uid %d\n", fi->id));
}
@@ -552,18 +552,18 @@ pop3_folder_get_message_sync (CamelFolder *folder,
/* check to see if we have safely written flag set */
if (pop3_store->cache == NULL
- || (stream = camel_data_cache_get(pop3_store->cache, "cache", fi->uid, NULL)) == NULL
+ || (stream = camel_data_cache_get (pop3_store->cache, "cache", fi->uid, NULL)) == NULL
|| camel_stream_read (stream, buffer, 1, cancellable, NULL) != 1
|| buffer[0] != '#') {
/* Initiate retrieval, if disk backing fails, use a memory backing */
if (pop3_store->cache == NULL
- || (stream = camel_data_cache_add(pop3_store->cache, "cache", fi->uid, NULL)) == NULL)
+ || (stream = camel_data_cache_add (pop3_store->cache, "cache", fi->uid, NULL)) == NULL)
stream = camel_stream_mem_new ();
/* ref it, the cache storage routine unref's when done */
fi->stream = g_object_ref (stream);
- pcr = camel_pop3_engine_command_new(pop3_store->engine, CAMEL_POP3_COMMAND_MULTI, cmd_tocache, fi, cancellable, NULL, "RETR %u\r\n", fi->id);
+ pcr = camel_pop3_engine_command_new (pop3_store->engine, CAMEL_POP3_COMMAND_MULTI, cmd_tocache, fi, cancellable, NULL, "RETR %u\r\n", fi->id);
/* Also initiate retrieval of some of the following messages, assume we'll be receiving them */
if (auto_fetch && pop3_store->cache != NULL) {
@@ -575,7 +575,7 @@ pop3_folder_get_message_sync (CamelFolder *folder,
CamelPOP3FolderInfo *pfi = pop3_folder->uids->pdata[i];
if (pfi->uid && pfi->cmd == NULL) {
- pfi->stream = camel_data_cache_add(pop3_store->cache, "cache", pfi->uid, NULL);
+ pfi->stream = camel_data_cache_add (pop3_store->cache, "cache", pfi->uid, NULL);
if (pfi->stream) {
pfi->cmd = camel_pop3_engine_command_new (pop3_store->engine, CAMEL_POP3_COMMAND_MULTI,
cmd_tocache, pfi, cancellable, NULL, "RETR %u\r\n", pfi->id);
@@ -697,9 +697,9 @@ pop3_folder_refresh_info_sync (CamelFolder *folder,
/* only used during setup */
pop3_folder->uids_id = g_hash_table_new (NULL, NULL);
- pcl = camel_pop3_engine_command_new(pop3_store->engine, CAMEL_POP3_COMMAND_MULTI, cmd_list, folder, cancellable, &local_error, "LIST\r\n");
+ pcl = camel_pop3_engine_command_new (pop3_store->engine, CAMEL_POP3_COMMAND_MULTI, cmd_list, folder, cancellable, &local_error, "LIST\r\n");
if (!local_error && (pop3_store->engine->capa & CAMEL_POP3_CAP_UIDL) != 0)
- pcu = camel_pop3_engine_command_new(pop3_store->engine, CAMEL_POP3_COMMAND_MULTI, cmd_uidl, folder, cancellable, &local_error, "UIDL\r\n");
+ pcu = camel_pop3_engine_command_new (pop3_store->engine, CAMEL_POP3_COMMAND_MULTI, cmd_uidl, folder, cancellable, &local_error, "UIDL\r\n");
while ((i = camel_pop3_engine_iterate (pop3_store->engine, NULL, cancellable, error)) > 0)
;
@@ -869,7 +869,7 @@ pop3_folder_synchronize_sync (CamelFolder *folder,
/* also remove from cache */
if (pop3_store->cache && fi->uid)
- camel_data_cache_remove(pop3_store->cache, "cache", fi->uid, NULL);
+ camel_data_cache_remove (pop3_store->cache, "cache", fi->uid, NULL);
}
}
@@ -931,7 +931,7 @@ camel_pop3_folder_new (CamelStore *parent,
service = CAMEL_SERVICE (parent);
- d(printf("opening pop3 INBOX folder\n"));
+ d (printf ("opening pop3 INBOX folder\n"));
folder = g_object_new (
CAMEL_TYPE_POP3_FOLDER,
@@ -1051,7 +1051,7 @@ camel_pop3_delete_old (CamelFolder *folder,
pop3_store = CAMEL_POP3_STORE (parent_store);
temp = time (&temp);
- d(printf("%s(%d): pop3_folder->uids->len=[%d]\n", __FILE__, __LINE__, pop3_folder->uids->len));
+ d (printf ("%s(%d): pop3_folder->uids->len=[%d]\n", __FILE__, __LINE__, pop3_folder->uids->len));
for (i = 0; i < pop3_folder->uids->len; i++) {
message_time = 0;
fi = pop3_folder->uids->pdata[i];
@@ -1069,9 +1069,9 @@ camel_pop3_delete_old (CamelFolder *folder,
if (!fi->uid)
continue;
- d(printf("%s(%d): fi->uid=[%s]\n", __FILE__, __LINE__, fi->uid));
+ d (printf ("%s(%d): fi->uid=[%s]\n", __FILE__, __LINE__, fi->uid));
if (!pop3_get_message_time_from_cache (folder, fi->uid, &message_time)) {
- d(printf("could not get message time from cache, trying from pop3\n"));
+ d (printf ("could not get message time from cache, trying from pop3\n"));
message = pop3_folder_get_message_sync (
folder, fi->uid, cancellable, error);
if (message) {
@@ -1084,8 +1084,8 @@ camel_pop3_delete_old (CamelFolder *folder,
gdouble time_diff = difftime (temp,message_time);
gint day_lag = time_diff / (60 * 60 * 24);
- d(printf("%s(%d): message_time= [%ld]\n", __FILE__, __LINE__, message_time));
- d(printf("%s(%d): day_lag=[%d] \t days_to_delete=[%d]\n",
+ d (printf ("%s(%d): message_time= [%ld]\n", __FILE__, __LINE__, message_time));
+ d (printf ("%s(%d): day_lag=[%d] \t days_to_delete=[%d]\n",
__FILE__, __LINE__, day_lag, days_to_delete));
if (day_lag > days_to_delete) {
@@ -1097,7 +1097,7 @@ camel_pop3_delete_old (CamelFolder *folder,
camel_pop3_engine_command_free (pop3_store->engine, fi->cmd);
fi->cmd = NULL;
}
- d(printf("%s(%d): Deleting old messages\n", __FILE__, __LINE__));
+ d (printf ("%s(%d): Deleting old messages\n", __FILE__, __LINE__));
fi->cmd = camel_pop3_engine_command_new (pop3_store->engine,
0,
NULL,
@@ -1107,7 +1107,7 @@ camel_pop3_delete_old (CamelFolder *folder,
fi->id);
/* also remove from cache */
if (pop3_store->cache && fi->uid) {
- camel_data_cache_remove(pop3_store->cache, "cache", fi->uid, NULL);
+ camel_data_cache_remove (pop3_store->cache, "cache", fi->uid, NULL);
}
}
}
diff --git a/camel/providers/pop3/camel-pop3-folder.h b/camel/providers/pop3/camel-pop3-folder.h
index a3f4f5f..125c622 100644
--- a/camel/providers/pop3/camel-pop3-folder.h
+++ b/camel/providers/pop3/camel-pop3-folder.h
@@ -67,8 +67,13 @@ struct _CamelPOP3Folder {
CamelFolder parent;
GPtrArray *uids;
- GHashTable *uids_fi; /* messageinfo uid to CamelPOP3FolderInfo *, which is stored in uids array */
- GHashTable *uids_id; /* messageinfo by id */
+
+ /* messageinfo uid to CamelPOP3FolderInfo *,
+ * which is stored in uids array */
+ GHashTable *uids_fi;
+
+ /* messageinfo by id */
+ GHashTable *uids_id;
GKeyFile *key_file;
gboolean mobile_mode;
diff --git a/camel/providers/pop3/camel-pop3-provider.c b/camel/providers/pop3/camel-pop3-provider.c
index aeeae79..3d046cd 100644
--- a/camel/providers/pop3/camel-pop3-provider.c
+++ b/camel/providers/pop3/camel-pop3-provider.c
@@ -40,7 +40,8 @@ static CamelProviderConfEntry pop3_conf_entries[] = {
{ CAMEL_PROVIDER_CONF_CHECKBOX, "keep-on-server", NULL,
N_("_Leave messages on server"), "0" },
{ CAMEL_PROVIDER_CONF_CHECKSPIN, "delete-after-days", "keep-on-server",
- /* Translators: '%s' is replaced with a widget, where user can select how many days can be message left on the server */
+ /* Translators: '%s' is replaced with a widget, where user can
+ * select how many days can be message left on the server. */
N_("_Delete after %s day(s)"), "0:1:7:365" },
{ CAMEL_PROVIDER_CONF_CHECKBOX, "delete-expunged", "keep-on-server",
N_("Delete _expunged from local Inbox"), "0" },
@@ -104,16 +105,22 @@ camel_provider_module_init (void)
{
CamelServiceAuthType *auth;
- pop3_provider.object_types[CAMEL_PROVIDER_STORE] = camel_pop3_store_get_type ();
+ pop3_provider.object_types[CAMEL_PROVIDER_STORE] =
+ CAMEL_TYPE_POP3_STORE;
pop3_provider.url_hash = pop3_url_hash;
pop3_provider.url_equal = pop3_url_equal;
pop3_provider.authtypes = camel_sasl_authtype_list (FALSE);
- auth = camel_sasl_authtype("LOGIN");
+ auth = camel_sasl_authtype ("LOGIN");
if (auth)
- pop3_provider.authtypes = g_list_prepend (pop3_provider.authtypes, auth);
- pop3_provider.authtypes = g_list_prepend (pop3_provider.authtypes, &camel_pop3_apop_authtype);
- pop3_provider.authtypes = g_list_prepend (pop3_provider.authtypes, &camel_pop3_password_authtype);
+ pop3_provider.authtypes = g_list_prepend (
+ pop3_provider.authtypes, auth);
+ pop3_provider.authtypes = g_list_prepend (
+ pop3_provider.authtypes,
+ &camel_pop3_apop_authtype);
+ pop3_provider.authtypes = g_list_prepend (
+ pop3_provider.authtypes,
+ &camel_pop3_password_authtype);
pop3_provider.translation_domain = GETTEXT_PACKAGE;
camel_provider_register (&pop3_provider);
diff --git a/camel/providers/pop3/camel-pop3-settings.c b/camel/providers/pop3/camel-pop3-settings.c
index f906c01..7f3cf69 100644
--- a/camel/providers/pop3/camel-pop3-settings.c
+++ b/camel/providers/pop3/camel-pop3-settings.c
@@ -456,7 +456,7 @@ camel_pop3_settings_set_delete_expunged (CamelPOP3Settings *settings,
{
g_return_if_fail (CAMEL_IS_POP3_SETTINGS (settings));
- if ((settings->priv->delete_expunged ? 1 : 0) == (delete_expunged ? 1 : 0))
+ if (settings->priv->delete_expunged == delete_expunged)
return;
settings->priv->delete_expunged = delete_expunged;
@@ -501,7 +501,7 @@ camel_pop3_settings_set_disable_extensions (CamelPOP3Settings *settings,
{
g_return_if_fail (CAMEL_IS_POP3_SETTINGS (settings));
- if ((settings->priv->disable_extensions ? 1 : 0) == (disable_extensions ? 1 : 0))
+ if (settings->priv->disable_extensions == disable_extensions)
return;
settings->priv->disable_extensions = disable_extensions;
@@ -544,7 +544,7 @@ camel_pop3_settings_set_keep_on_server (CamelPOP3Settings *settings,
{
g_return_if_fail (CAMEL_IS_POP3_SETTINGS (settings));
- if ((settings->priv->keep_on_server ? 1 : 0) == (keep_on_server ? 1 : 0))
+ if (settings->priv->keep_on_server == keep_on_server)
return;
settings->priv->keep_on_server = keep_on_server;
@@ -585,7 +585,7 @@ camel_pop3_settings_set_auto_fetch (CamelPOP3Settings *settings,
{
g_return_if_fail (CAMEL_IS_POP3_SETTINGS (settings));
- if ((settings->priv->auto_fetch ? 1 : 0) == (auto_fetch ? 1 : 0))
+ if (settings->priv->auto_fetch == auto_fetch)
return;
settings->priv->auto_fetch = auto_fetch;
@@ -626,7 +626,7 @@ camel_pop3_settings_set_mobile_mode (CamelPOP3Settings *settings,
{
g_return_if_fail (CAMEL_IS_POP3_SETTINGS (settings));
- if ((settings->priv->mobile_mode ? 1 : 0) == (mobile_mode ? 1 : 0))
+ if (settings->priv->mobile_mode == mobile_mode)
return;
settings->priv->mobile_mode = mobile_mode;
@@ -667,7 +667,7 @@ camel_pop3_settings_set_batch_fetch_count (CamelPOP3Settings *settings,
{
g_return_if_fail (CAMEL_IS_POP3_SETTINGS (settings));
- if ((settings->priv->batch_fetch_count ? 1 : 0) == (batch_fetch_count ? 1 : 0))
+ if (settings->priv->batch_fetch_count == batch_fetch_count)
return;
settings->priv->batch_fetch_count = batch_fetch_count;
diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c
index 354f174..3475d3b 100644
--- a/camel/providers/pop3/camel-pop3-store.c
+++ b/camel/providers/pop3/camel-pop3-store.c
@@ -156,7 +156,9 @@ connect_to_server (CamelService *service,
goto stls_exception;
}
- pc = camel_pop3_engine_command_new (store->engine, 0, NULL, NULL, cancellable, error, "STLS\r\n");
+ pc = camel_pop3_engine_command_new (
+ store->engine, 0, NULL, NULL,
+ cancellable, error, "STLS\r\n");
while (camel_pop3_engine_iterate (store->engine, NULL, cancellable, NULL) > 0)
;
@@ -169,7 +171,8 @@ connect_to_server (CamelService *service,
tmp = get_valid_utf8_error ((gchar *) store->engine->line);
g_set_error (
error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
- /* Translators: Last %s is an optional explanation beginning with ": " separator */
+ /* Translators: Last %s is an optional
+ * explanation beginning with ": " separator. */
_("Failed to connect to POP server %s in secure mode%s"),
host, (tmp != NULL) ? tmp : "");
g_free (tmp);
@@ -197,10 +200,13 @@ connect_to_server (CamelService *service,
goto exit;
stls_exception:
- /* as soon as we send a STLS command, all hope is lost of a clean QUIT if problems arise */
+ /* As soon as we send a STLS command, all hope
+ * is lost of a clean QUIT if problems arise. */
/* if (clean_quit) {
/ * try to disconnect cleanly * /
- pc = camel_pop3_engine_command_new (store->engine, 0, NULL, NULL, cancellable, NULL, "QUIT\r\n");
+ pc = camel_pop3_engine_command_new (
+ store->engine, 0, NULL, NULL,
+ cancellable, NULL, "QUIT\r\n");
while (camel_pop3_engine_iterate (store->engine, NULL, cancellable, NULL) > 0)
;
camel_pop3_engine_command_free (store->engine, pc);
@@ -280,7 +286,7 @@ try_sasl (CamelPOP3Store *store,
/* If we dont get continuation, or the sasl object's run out
* of work, or we dont get a challenge, its a protocol error,
* so fail, and try reset the server. */
- if (strncmp((gchar *) line, "+ ", 2) != 0
+ if (strncmp ((gchar *) line, "+ ", 2) != 0
|| camel_sasl_get_authenticated (sasl)
|| (resp = (guchar *) camel_sasl_challenge_base64_sync (sasl, (const gchar *) line + 2, cancellable, NULL)) == NULL) {
camel_stream_write_string (
@@ -328,9 +334,8 @@ pop3_store_finalize (GObject *object)
{
CamelPOP3Store *pop3_store = CAMEL_POP3_STORE (object);
- /* force disconnect so we dont have it run later, after we've cleaned up some stuff */
- /* SIGH */
-
+ /* Force disconnect so we dont have it run
+ * later, after we've cleaned up some stuff. */
camel_service_disconnect_sync (
CAMEL_SERVICE (pop3_store), TRUE, NULL, NULL);
@@ -453,7 +458,9 @@ pop3_store_disconnect_sync (CamelService *service,
if (clean) {
CamelPOP3Command *pc;
- pc = camel_pop3_engine_command_new(store->engine, 0, NULL, NULL, cancellable, error, "QUIT\r\n");
+ pc = camel_pop3_engine_command_new (
+ store->engine, 0, NULL, NULL,
+ cancellable, error, "QUIT\r\n");
while (camel_pop3_engine_iterate (store->engine, NULL, cancellable, NULL) > 0)
;
camel_pop3_engine_command_free (store->engine, pc);
@@ -813,8 +820,11 @@ camel_pop3_store_expunge (CamelPOP3Store *store,
GError **error)
{
CamelPOP3Command *pc;
+ CamelServiceConnectionStatus status;
+
+ status = camel_service_get_connection_status (CAMEL_SERVICE (store));
- if (camel_service_get_connection_status (CAMEL_SERVICE (store)) != CAMEL_SERVICE_CONNECTED) {
+ if (status != CAMEL_SERVICE_CONNECTED) {
g_set_error (
error, CAMEL_SERVICE_ERROR,
CAMEL_SERVICE_ERROR_UNAVAILABLE,
diff --git a/camel/providers/pop3/camel-pop3-stream.c b/camel/providers/pop3/camel-pop3-stream.c
index 38dc03c..7a54461 100644
--- a/camel/providers/pop3/camel-pop3-stream.c
+++ b/camel/providers/pop3/camel-pop3-stream.c
@@ -1,5 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*-
- *
+/*
* Author:
* Michael Zucchi <notzed ximian com>
*
@@ -83,7 +82,6 @@ stream_fill (CamelPOP3Stream *is,
CAMEL_POP3_STREAM_SIZE - (is->end - is->buf),
cancellable, &local_error);
if (local_error) {
- dd (printf ("POP3_STREAM_FILL: Failed to read bytes: %s\n", local_error->message));
g_propagate_error (error, local_error);
}
@@ -136,7 +134,6 @@ stream_read (CamelStream *stream,
is->ptr = p + 3;
is->mode = CAMEL_POP3_STREAM_EOD;
is->state = 0;
- dd (printf ("POP3_STREAM_READ (%d):\n%.*s\n", (gint)(o-buffer), (gint)(o-buffer), buffer));
return o - buffer;
}
p++;
@@ -169,8 +166,6 @@ stream_read (CamelStream *stream,
is->ptr = p;
is->state = state;
- dd (printf ("POP3_STREAM_READ (%d):\n%.*s\n", (gint)(o-buffer), (gint)(o-buffer), buffer));
-
return o - buffer;
}
@@ -184,9 +179,9 @@ stream_write (CamelStream *stream,
CamelPOP3Stream *is = (CamelPOP3Stream *) stream;
if (strncmp (buffer, "PASS ", 5) != 0)
- dd (printf ("POP3_STREAM_WRITE (%d):\n%.*s\n", (gint)n, (gint)n, buffer));
+ dd (printf ("POP3_STREAM_WRITE (%d):\n%.*s\n", (gint) n, (gint) n, buffer));
else
- dd (printf ("POP3_STREAM_WRITE (%d):\nPASS xxxxxxxx\n", (gint)n));
+ dd (printf ("POP3_STREAM_WRITE (%d):\nPASS xxxxxxxx\n", (gint) n));
return camel_stream_write (is->source, buffer, n, cancellable, error);
}
@@ -292,7 +287,8 @@ camel_pop3_stream_line (CamelPOP3Stream *is,
p = is->ptr;
e = is->end;
- /* Data mode, convert leading '..' to '.', and stop when we reach a solitary '.' */
+ /* Data mode, convert leading '..' to '.',
+ * and stop when we reach a solitary '.' */
if (is->mode == CAMEL_POP3_STREAM_DATA) {
/* need at least 3 chars in buffer */
while (e - p < 3) {
@@ -412,12 +408,11 @@ camel_pop3_stream_getd (CamelPOP3Stream *is,
is->mode = CAMEL_POP3_STREAM_EOD;
is->state = 0;
- dd (printf ("POP3_STREAM_GETD (%s,%d): '%.*s'\n", "last", *len, (gint)*len, *start));
-
return 0;
}
- /* If at start, just skip '.', else return data upto '.' but skip it */
+ /* If at start, just skip '.', else
+ * return data upto '.' but skip it. */
if (p == s) {
s++;
p++;
@@ -427,8 +422,6 @@ camel_pop3_stream_getd (CamelPOP3Stream *is,
*start = s;
is->state = 1;
- dd (printf ("POP3_STREAM_GETD (%s,%d): '%.*s'\n", "more", *len, (gint)*len, *start));
-
return 1;
}
}
@@ -452,7 +445,5 @@ camel_pop3_stream_getd (CamelPOP3Stream *is,
*len = p-s;
*start = s;
- dd (printf ("POP3_STREAM_GETD (%s,%d): '%.*s'\n", "more", *len, (gint)*len, *start));
-
return 1;
}
diff --git a/camel/providers/sendmail/camel-sendmail-provider.c b/camel/providers/sendmail/camel-sendmail-provider.c
index 4b45fd2..f5a82f3 100644
--- a/camel/providers/sendmail/camel-sendmail-provider.c
+++ b/camel/providers/sendmail/camel-sendmail-provider.c
@@ -52,7 +52,8 @@ static CamelProvider sendmail_provider = {
void
camel_provider_module_init (void)
{
- sendmail_provider.object_types[CAMEL_PROVIDER_TRANSPORT] = camel_sendmail_transport_get_type ();
+ sendmail_provider.object_types[CAMEL_PROVIDER_TRANSPORT] =
+ CAMEL_TYPE_SENDMAIL_TRANSPORT;
sendmail_provider.url_hash = camel_url_hash;
sendmail_provider.url_equal = camel_url_equal;
diff --git a/camel/providers/sendmail/camel-sendmail-transport.c b/camel/providers/sendmail/camel-sendmail-transport.c
index 507cc81..b437dce 100644
--- a/camel/providers/sendmail/camel-sendmail-transport.c
+++ b/camel/providers/sendmail/camel-sendmail-transport.c
@@ -66,9 +66,13 @@ sendmail_send_to_sync (CamelTransport *transport,
CamelMimeFilter *crlf;
sigset_t mask, omask;
CamelStream *out;
+ gboolean success;
pid_t pid;
- if (!camel_internet_address_get (CAMEL_INTERNET_ADDRESS (from), 0, NULL, &from_addr))
+ success = camel_internet_address_get (
+ CAMEL_INTERNET_ADDRESS (from), 0, NULL, &from_addr);
+
+ if (!success)
return FALSE;
len = camel_address_length (recipients);
@@ -80,7 +84,10 @@ sendmail_send_to_sync (CamelTransport *transport,
argv[4] = "--";
for (i = 0; i < len; i++) {
- if (!camel_internet_address_get (CAMEL_INTERNET_ADDRESS (recipients), i, NULL, &addr)) {
+ success = camel_internet_address_get (
+ CAMEL_INTERNET_ADDRESS (recipients), i, NULL, &addr);
+
+ if (!success) {
g_set_error (
error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
_("Could not parse recipient list"));
@@ -169,9 +176,12 @@ sendmail_send_to_sync (CamelTransport *transport,
close (fd[0]);
out = camel_stream_fs_new_with_fd (fd[1]);
- /* workaround for lame sendmail implementations that can't handle CRLF eoln sequences */
+ /* XXX Workaround for lame sendmail implementations
+ * that can't handle CRLF eoln sequences. */
filter = camel_stream_filter_new (out);
- crlf = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_DECODE, CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY);
+ crlf = camel_mime_filter_crlf_new (
+ CAMEL_MIME_FILTER_CRLF_DECODE,
+ CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY);
camel_stream_filter_add (CAMEL_STREAM_FILTER (filter), crlf);
g_object_unref (crlf);
g_object_unref (out);
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index d2e15e8..c30ff83 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -136,10 +136,12 @@ connect_to_server (CamelService *service,
transport->connected = TRUE;
/* get the localaddr - needed later by smtp_helo */
- transport->localaddr = camel_tcp_stream_get_local_address (CAMEL_TCP_STREAM (tcp_stream), &transport->localaddrlen);
+ transport->localaddr = camel_tcp_stream_get_local_address (
+ CAMEL_TCP_STREAM (tcp_stream), &transport->localaddrlen);
transport->ostream = tcp_stream;
- transport->istream = camel_stream_buffer_new (tcp_stream, CAMEL_STREAM_BUFFER_READ);
+ transport->istream = camel_stream_buffer_new (
+ tcp_stream, CAMEL_STREAM_BUFFER_READ);
/* Read the greeting, note whether the server is ESMTP or not. */
do {
@@ -186,7 +188,8 @@ connect_to_server (CamelService *service,
}
}
- /* clear any EHLO/HELO exception and assume that any SMTP errors encountered were non-fatal */
+ /* Clear any EHLO/HELO exception and assume that
+ * any SMTP errors encountered were non-fatal. */
g_clear_error (error);
if (method != CAMEL_NETWORK_SECURITY_METHOD_STARTTLS_ON_STANDARD_PORT)
@@ -201,7 +204,7 @@ connect_to_server (CamelService *service,
goto exception_cleanup;
}
- d(fprintf (stderr, "sending : STARTTLS\r\n"));
+ d (fprintf (stderr, "sending : STARTTLS\r\n"));
if (camel_stream_write (
tcp_stream, "STARTTLS\r\n", 10, cancellable, error) == -1) {
g_prefix_error (error, _("STARTTLS command failed: "));
@@ -477,7 +480,7 @@ smtp_transport_authenticate_sync (CamelService *service,
"AUTH %s\r\n", mechanism);
}
- d(fprintf (stderr, "sending : %s", cmdbuf));
+ d (fprintf (stderr, "sending : %s", cmdbuf));
if (camel_stream_write_string (
transport->ostream, cmdbuf,
cancellable, error) == -1) {
@@ -512,11 +515,14 @@ smtp_transport_authenticate_sync (CamelService *service,
if (FALSE) {
broken_smtp_server:
- d(fprintf (stderr, "Your SMTP server's implementation of the %s SASL\n"
- "authentication mechanism is broken. Please report this to the\n"
- "appropriate vendor and suggest that they re-read rfc2554 again\n"
- "for the first time (specifically Section 4).\n",
- mechanism));
+ d (fprintf (
+ stderr, "Your SMTP server's implementation "
+ "of the %s SASL\nauthentication mechanism is "
+ "broken. Please report this to the\n"
+ "appropriate vendor and suggest that they "
+ "re-read rfc2554 again\nfor the first time "
+ "(specifically Section 4).\n",
+ mechanism));
}
/* eat whtspc */
@@ -532,7 +538,7 @@ smtp_transport_authenticate_sync (CamelService *service,
/* send our challenge */
cmdbuf = g_strdup_printf ("%s\r\n", challenge);
g_free (challenge);
- d(fprintf (stderr, "sending : %s", cmdbuf));
+ d (fprintf (stderr, "sending : %s", cmdbuf));
if (camel_stream_write_string (
transport->ostream, cmdbuf,
cancellable, error) == -1) {
@@ -574,11 +580,11 @@ smtp_transport_authenticate_sync (CamelService *service,
break_and_lose:
/* Get the server out of "waiting for continuation data" mode. */
- d(fprintf (stderr, "sending : *\n"));
+ d (fprintf (stderr, "sending : *\n"));
camel_stream_write (transport->ostream, "*\r\n", 3, cancellable, NULL);
respbuf = camel_stream_buffer_read_line (
CAMEL_STREAM_BUFFER (transport->istream), cancellable, NULL);
- d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
+ d (fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
lose:
result = CAMEL_AUTHENTICATION_ERROR;
@@ -864,7 +870,7 @@ esmtp_get_authtypes (const guchar *buffer)
start = buffer;
/* make sure there is at least one delimiter
- character in the AUTH response */
+ * character in the AUTH response */
if (!isspace ((gint) *start) && *start != '=')
return NULL;
@@ -1121,12 +1127,12 @@ smtp_helo (CamelSmtpTransport *transport,
token = (transport->flags & CAMEL_SMTP_TRANSPORT_IS_ESMTP) ? "EHLO" : "HELO";
if (numeric)
- cmdbuf = g_strdup_printf("%s [%s%s]\r\n", token, numeric, name);
+ cmdbuf = g_strdup_printf ("%s [%s%s]\r\n", token, numeric, name);
else
- cmdbuf = g_strdup_printf("%s %s\r\n", token, name);
+ cmdbuf = g_strdup_printf ("%s %s\r\n", token, name);
g_free (name);
- d(fprintf (stderr, "sending : %s", cmdbuf));
+ d (fprintf (stderr, "sending : %s", cmdbuf));
if (camel_stream_write_string (
transport->ostream, cmdbuf, cancellable, error) == -1) {
g_free (cmdbuf);
@@ -1226,7 +1232,7 @@ smtp_mail (CamelSmtpTransport *transport,
else
cmdbuf = g_strdup_printf ("MAIL FROM:<%s>\r\n", sender);
- d(fprintf (stderr, "sending : %s", cmdbuf));
+ d (fprintf (stderr, "sending : %s", cmdbuf));
if (camel_stream_write_string (
transport->ostream, cmdbuf, cancellable, error) == -1) {
@@ -1278,7 +1284,7 @@ smtp_rcpt (CamelSmtpTransport *transport,
cmdbuf = g_strdup_printf ("RCPT TO:<%s>\r\n", recipient);
- d(fprintf (stderr, "sending : %s", cmdbuf));
+ d (fprintf (stderr, "sending : %s", cmdbuf));
if (camel_stream_write_string (
transport->ostream, cmdbuf, cancellable, error) == -1) {
@@ -1343,11 +1349,12 @@ smtp_data (CamelSmtpTransport *transport,
/* Changes the encoding of all mime parts to fit within our required
* encoding type and also force any text parts with long lines (longer
* than 998 octets) to wrap by QP or base64 encoding them. */
- camel_mime_message_set_best_encoding (message, CAMEL_BESTENC_GET_ENCODING, enctype);
+ camel_mime_message_set_best_encoding (
+ message, CAMEL_BESTENC_GET_ENCODING, enctype);
cmdbuf = g_strdup ("DATA\r\n");
- d(fprintf (stderr, "sending : %s", cmdbuf));
+ d (fprintf (stderr, "sending : %s", cmdbuf));
if (camel_stream_write_string (
transport->ostream, cmdbuf, cancellable, error) == -1) {
@@ -1448,7 +1455,7 @@ smtp_data (CamelSmtpTransport *transport,
/* terminate the message body */
- d(fprintf (stderr, "sending : \\r\\n.\\r\\n\n"));
+ d (fprintf (stderr, "sending : \\r\\n.\\r\\n\n"));
if (camel_stream_write (
transport->ostream, "\r\n.\r\n", 5,
@@ -1496,7 +1503,7 @@ smtp_rset (CamelSmtpTransport *transport,
cmdbuf = g_strdup ("RSET\r\n");
- d(fprintf (stderr, "sending : %s", cmdbuf));
+ d (fprintf (stderr, "sending : %s", cmdbuf));
if (camel_stream_write_string (
transport->ostream, cmdbuf, cancellable, error) == -1) {
@@ -1545,7 +1552,7 @@ smtp_quit (CamelSmtpTransport *transport,
cmdbuf = g_strdup ("QUIT\r\n");
- d(fprintf (stderr, "sending : %s", cmdbuf));
+ d (fprintf (stderr, "sending : %s", cmdbuf));
if (camel_stream_write_string (
transport->ostream, cmdbuf, cancellable, error) == -1) {
@@ -1562,7 +1569,7 @@ smtp_quit (CamelSmtpTransport *transport,
CAMEL_STREAM_BUFFER (transport->istream),
cancellable, error);
- d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
+ d (fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
if (respbuf == NULL) {
g_prefix_error (error, _("QUIT command failed: "));
transport->connected = FALSE;
diff --git a/camel/providers/smtp/camel-smtp-transport.h b/camel/providers/smtp/camel-smtp-transport.h
index 20e0d2d..2bfccc3 100644
--- a/camel/providers/smtp/camel-smtp-transport.h
+++ b/camel/providers/smtp/camel-smtp-transport.h
@@ -51,7 +51,8 @@
#define CAMEL_SMTP_TRANSPORT_ENHANCEDSTATUSCODES (1 << 2)
#define CAMEL_SMTP_TRANSPORT_STARTTLS (1 << 3)
-#define CAMEL_SMTP_TRANSPORT_AUTH_EQUAL (1 << 4) /* set if we are using authtypes from a broken AUTH= */
+/* set if we are using authtypes from a broken AUTH= */
+#define CAMEL_SMTP_TRANSPORT_AUTH_EQUAL (1 << 4)
#ifdef G_OS_WIN32
#define socklen_t int
diff --git a/camel/tests/folder/test1.c b/camel/tests/folder/test1.c
index 1ef2768..302207a 100644
--- a/camel/tests/folder/test1.c
+++ b/camel/tests/folder/test1.c
@@ -25,7 +25,7 @@ gint main (gint argc, gchar **argv)
camel_test_provider_init (1, local_drivers);
/* clear out any camel-test data */
- system("/bin/rm -rf /tmp/camel-test");
+ system ("/bin/rm -rf /tmp/camel-test");
session = camel_test_session_new ("/tmp/camel-test");
@@ -33,7 +33,7 @@ gint main (gint argc, gchar **argv)
/* todo: subscriptions? */
/* todo: work out how to do imap/pop/nntp tests */
for (i = 0; i < G_N_ELEMENTS (local_providers); i++) {
- path = g_strdup_printf("%s:///tmp/camel-test/%s", local_providers[i], local_providers[i]);
+ path = g_strdup_printf ("%s:///tmp/camel-test/%s", local_providers[i], local_providers[i]);
test_folder_basic (session, path, TRUE, FALSE);
diff --git a/camel/tests/folder/test11.c b/camel/tests/folder/test11.c
index d67bdfd..f3c3d78 100644
--- a/camel/tests/folder/test11.c
+++ b/camel/tests/folder/test11.c
@@ -17,18 +17,18 @@ static CamelSession *session;
/* FIXME: flags aren't really right yet */
/* ASCII sorted on full_name */
static CamelFolderInfo fi_list_1[] = {
- { NULL, NULL, NULL, ".", "Inbox", CAMEL_FOLDER_SYSTEM|CAMEL_FOLDER_NOCHILDREN, -1, -1 },
- { NULL, NULL, NULL, ".#evolution/Junk", "Junk", CAMEL_FOLDER_SYSTEM|CAMEL_FOLDER_NOCHILDREN, -1, -1 },
- { NULL, NULL, NULL, ".#evolution/Trash", "Trash", CAMEL_FOLDER_SYSTEM|CAMEL_FOLDER_NOCHILDREN, -1, -1 },
+ { NULL, NULL, NULL, ".", "Inbox", CAMEL_FOLDER_SYSTEM | CAMEL_FOLDER_NOCHILDREN, -1, -1 },
+ { NULL, NULL, NULL, ".#evolution/Junk", "Junk", CAMEL_FOLDER_SYSTEM | CAMEL_FOLDER_NOCHILDREN, -1, -1 },
+ { NULL, NULL, NULL, ".#evolution/Trash", "Trash", CAMEL_FOLDER_SYSTEM | CAMEL_FOLDER_NOCHILDREN, -1, -1 },
{ NULL, NULL, NULL, "testbox", "testbox", CAMEL_FOLDER_CHILDREN, -1, -1 },
{ NULL, NULL, NULL, "testbox/foo", "foo", CAMEL_FOLDER_NOCHILDREN, -1, -1 },
{ NULL, NULL, NULL, "testbox2", "testbox2", CAMEL_FOLDER_NOCHILDREN, -1, -1 },
};
static CamelFolderInfo fi_list_2[] = {
- { NULL, NULL, NULL, ".", "Inbox", CAMEL_FOLDER_SYSTEM|CAMEL_FOLDER_NOCHILDREN, -1, -1 },
- { NULL, NULL, NULL, ".#evolution/Junk", "Junk", CAMEL_FOLDER_SYSTEM|CAMEL_FOLDER_NOCHILDREN, -1, -1 },
- { NULL, NULL, NULL, ".#evolution/Trash", "Trash", CAMEL_FOLDER_SYSTEM|CAMEL_FOLDER_NOCHILDREN, -1, -1 },
+ { NULL, NULL, NULL, ".", "Inbox", CAMEL_FOLDER_SYSTEM | CAMEL_FOLDER_NOCHILDREN, -1, -1 },
+ { NULL, NULL, NULL, ".#evolution/Junk", "Junk", CAMEL_FOLDER_SYSTEM | CAMEL_FOLDER_NOCHILDREN, -1, -1 },
+ { NULL, NULL, NULL, ".#evolution/Trash", "Trash", CAMEL_FOLDER_SYSTEM | CAMEL_FOLDER_NOCHILDREN, -1, -1 },
{ NULL, NULL, NULL, "testbox", "testbox", CAMEL_FOLDER_NOCHILDREN, -1, -1 },
{ NULL, NULL, NULL, "testbox2", "testbox2", CAMEL_FOLDER_NOCHILDREN, -1, -1 },
};
diff --git a/camel/tests/folder/test2.c b/camel/tests/folder/test2.c
index 3f730c6..ef6638a 100644
--- a/camel/tests/folder/test2.c
+++ b/camel/tests/folder/test2.c
@@ -27,7 +27,7 @@ gint main (gint argc, gchar **argv)
camel_test_provider_init (1, local_drivers);
/* clear out any camel-test data */
- system("/bin/rm -rf /tmp/camel-test");
+ system ("/bin/rm -rf /tmp/camel-test");
session = camel_test_session_new ("/tmp/camel-test");
@@ -35,12 +35,12 @@ gint main (gint argc, gchar **argv)
for (i = 0; i < G_N_ELEMENTS (stores); i++) {
gchar *name = stores[i];
- test_folder_message_ops(session, name, TRUE, "testbox");
+ test_folder_message_ops (session, name, TRUE, "testbox");
}
/* create a pseudo-spool file, and check that */
- creat("/tmp/camel-test/testbox", 0600);
- test_folder_message_ops(session, "spool:///tmp/camel-test/testbox", TRUE, "INBOX");
+ creat ("/tmp/camel-test/testbox", 0600);
+ test_folder_message_ops (session, "spool:///tmp/camel-test/testbox", TRUE, "INBOX");
check_unref (session, 1);
diff --git a/camel/tests/folder/test3.c b/camel/tests/folder/test3.c
index d02378a..6e414db 100644
--- a/camel/tests/folder/test3.c
+++ b/camel/tests/folder/test3.c
@@ -71,12 +71,12 @@ static struct {
{ { 100, 50, 0 }, "(body-contains \"Content\")" },
{ { 0, 0, 0 }, "(user-flag \"every7\")" },
- { { 100/13+1, 50/13+1, 0 }, "(user-flag \"every13\")" },
+ { { 100 / 13 + 1, 50 / 13 + 1, 0 }, "(user-flag \"every13\")" },
{ { 1, 1, 0 }, "(= \"7tag1\" (user-tag \"every7\"))" },
- { { 100/11+1, 50/11+1, 0 }, "(= \"11tag\" (user-tag \"every11\"))" },
+ { { 100 / 11 + 1, 50 / 11 + 1, 0 }, "(= \"11tag\" (user-tag \"every11\"))" },
- { { 100/13 + 100/17 + 1, 50/13 + 50/17 + 2, 0 }, "(user-flag \"every13\" \"every17\")" },
- { { 100/13 + 100/17 + 1, 50/13 + 50/17 + 2, 0 }, "(or (user-flag \"every13\") (user-flag \"every17\"))" },
+ { { 100 / 13 + 100 / 17 + 1, 50 / 13 + 50 / 17 + 2, 0 }, "(user-flag \"every13\" \"every17\")" },
+ { { 100 / 13 + 100 / 17 + 1, 50 / 13 + 50 / 17 + 2, 0 }, "(or (user-flag \"every13\") (user-flag \"every17\"))" },
{ { 1, 0, 0 }, "(and (user-flag \"every13\") (user-flag \"every17\"))" },
{ { 0, 0, 0 }, "(and (header-contains \"subject\" \"Test1\") (header-contains \"subject\" \"Test2\"))" },
@@ -93,20 +93,20 @@ static struct {
{ { 11, 6, 0 }, "(or (header-contains \"subject\" \"Test1\") (header-contains \"subject\" \"message99\"))" },
/* 72000 is 24*60*100 == half the 'sent date' of the messages */
- { { 100/2, 50/2, 0 }, "(> 72000 (get-sent-date))" },
- { { 100/2-1, 50/2, 0 }, "(< 72000 (get-sent-date))" },
+ { { 100 / 2, 50 / 2, 0 }, "(> 72000 (get-sent-date))" },
+ { { 100 / 2 - 1, 50 / 2, 0 }, "(< 72000 (get-sent-date))" },
{ { 1, 0, 0 }, "(= 72000 (get-sent-date))" },
{ { 0, 0, 0 }, "(= 72001 (get-sent-date))" },
- { { (100/2-1)/17+1, (50/2-1)/17+1, 0 }, "(and (user-flag \"every17\") (< 72000 (get-sent-date)))" },
- { { (100/2-1)/17+1, (50/2-1)/17, 0 }, "(and (user-flag \"every17\") (> 72000 (get-sent-date)))" },
- { { (100/2-1)/13+1, (50/2-1)/13+1, 0 }, "(and (user-flag \"every13\") (< 72000 (get-sent-date)))" },
- { { (100/2-1)/13+1, (50/2-1)/13+1, 0 }, "(and (user-flag \"every13\") (> 72000 (get-sent-date)))" },
+ { { (100 / 2 - 1) / 17 + 1, (50 / 2 - 1) / 17 + 1, 0 }, "(and (user-flag \"every17\") (< 72000 (get-sent-date)))" },
+ { { (100 / 2 - 1) / 17 + 1, (50 / 2 - 1) / 17, 0 }, "(and (user-flag \"every17\") (> 72000 (get-sent-date)))" },
+ { { (100 / 2 - 1) / 13 + 1, (50 / 2 - 1) / 13 + 1, 0 }, "(and (user-flag \"every13\") (< 72000 (get-sent-date)))" },
+ { { (100 / 2 - 1) / 13 + 1, (50 / 2 - 1) / 13 + 1, 0 }, "(and (user-flag \"every13\") (> 72000 (get-sent-date)))" },
- { { 100/2+100/2/17, 50/2+50/2/17, 0 }, "(or (user-flag \"every17\") (< 72000 (get-sent-date)))" },
- { { 100/2+100/2/17+1, 50/2+50/2/17+1, 0 }, "(or (user-flag \"every17\") (> 72000 (get-sent-date)))" },
- { { 100/2+100/2/13, 50/2+50/2/13+1, 0 }, "(or (user-flag \"every13\") (< 72000 (get-sent-date)))" },
- { { 100/2+100/2/13+1, 50/2+50/2/13+1, 0 }, "(or (user-flag \"every13\") (> 72000 (get-sent-date)))" },
+ { { 100 / 2 + 100 / 2 / 17, 50 / 2 + 50 / 2 / 17, 0 }, "(or (user-flag \"every17\") (< 72000 (get-sent-date)))" },
+ { { 100 / 2 + 100 / 2 / 17 + 1, 50 / 2 + 50 / 2 / 17 + 1, 0 }, "(or (user-flag \"every17\") (> 72000 (get-sent-date)))" },
+ { { 100 / 2 + 100 / 2 / 13, 50 / 2 + 50 / 2 / 13 + 1, 0 }, "(or (user-flag \"every13\") (< 72000 (get-sent-date)))" },
+ { { 100 / 2 + 100 / 2 / 13 + 1, 50 / 2 + 50 / 2 / 13 + 1, 0 }, "(or (user-flag \"every13\") (> 72000 (get-sent-date)))" },
};
static void
@@ -211,10 +211,10 @@ main (gint argc,
push ("creating test message");
msg = test_message_create_simple ();
content = g_strdup_printf ("data%d content\n", j);
- test_message_set_content_simple ((CamelMimePart *)msg, 0, "text/plain",
+ test_message_set_content_simple ((CamelMimePart *) msg, 0, "text/plain",
content, strlen (content));
test_free (content);
- subject = g_strdup_printf ("Test%d message%d subject", j, 100-j);
+ subject = g_strdup_printf ("Test%d message%d subject", j, 100 - j);
camel_mime_message_set_subject (msg, subject);
camel_mime_message_set_date (msg, j * 60 * 24, 0);
@@ -246,7 +246,7 @@ main (gint argc,
camel_folder_set_message_user_flag (folder, uid, "every17", TRUE);
}
if ((j / 7) * 7 == j) {
- gchar *tag = g_strdup_printf ("7tag%d", j/7);
+ gchar *tag = g_strdup_printf ("7tag%d", j / 7);
camel_folder_set_message_user_tag (folder, uid, "every7", tag);
test_free (tag);
}
diff --git a/camel/tests/folder/test4.c b/camel/tests/folder/test4.c
index f32c02f..b8c18b3 100644
--- a/camel/tests/folder/test4.c
+++ b/camel/tests/folder/test4.c
@@ -21,7 +21,7 @@ gint main (gint argc, gchar **argv)
camel_test_provider_init (1, imap_drivers);
/* clear out any camel-test data */
- system("/bin/rm -rf /tmp/camel-test");
+ system ("/bin/rm -rf /tmp/camel-test");
session = camel_test_session_new ("/tmp/camel-test");
@@ -31,8 +31,8 @@ gint main (gint argc, gchar **argv)
path = getenv (remote_providers[i]);
if (path == NULL) {
- printf("Aborted (ignored).\n");
- printf("Set '%s', to re-run test.\n", remote_providers[i]);
+ printf ("Aborted (ignored).\n");
+ printf ("Set '%s', to re-run test.\n", remote_providers[i]);
/* tells make check to ignore us in the total count */
_exit (77);
}
diff --git a/camel/tests/folder/test5.c b/camel/tests/folder/test5.c
index 15dc843..c58c8f5 100644
--- a/camel/tests/folder/test5.c
+++ b/camel/tests/folder/test5.c
@@ -21,7 +21,7 @@ gint main (gint argc, gchar **argv)
camel_test_provider_init (1, nntp_drivers);
/* clear out any camel-test data */
- system("/bin/rm -rf /tmp/camel-test");
+ system ("/bin/rm -rf /tmp/camel-test");
session = camel_test_session_new ("/tmp/camel-test");
@@ -31,12 +31,12 @@ gint main (gint argc, gchar **argv)
path = getenv (remote_providers[i]);
if (path == NULL) {
- printf("Aborted (ignored).\n");
- printf("Set '%s', to re-run test.\n", remote_providers[i]);
+ printf ("Aborted (ignored).\n");
+ printf ("Set '%s', to re-run test.\n", remote_providers[i]);
/* tells make check to ignore us in the total count */
_exit (77);
}
- camel_test_nonfatal("Not sure how many tests apply to NNTP");
+ camel_test_nonfatal ("Not sure how many tests apply to NNTP");
test_folder_basic (session, path, FALSE, FALSE);
camel_test_fatal ();
}
diff --git a/camel/tests/folder/test6.c b/camel/tests/folder/test6.c
index 6f87ab7..1f8bd0f 100644
--- a/camel/tests/folder/test6.c
+++ b/camel/tests/folder/test6.c
@@ -20,7 +20,7 @@ gint main (gint argc, gchar **argv)
camel_test_provider_init (1, imap_drivers);
/* clear out any camel-test data */
- system("/bin/rm -rf /tmp/camel-test");
+ system ("/bin/rm -rf /tmp/camel-test");
session = camel_test_session_new ("/tmp/camel-test");
@@ -28,14 +28,14 @@ gint main (gint argc, gchar **argv)
path = getenv (remote_providers[i]);
if (path == NULL) {
- printf("Aborted (ignored).\n");
- printf("Set '%s', to re-run test.\n", remote_providers[i]);
+ printf ("Aborted (ignored).\n");
+ printf ("Set '%s', to re-run test.\n", remote_providers[i]);
/* tells make check to ignore us in the total count */
_exit (77);
}
/*camel_test_nonfatal("The IMAP code is just rooted");*/
- test_folder_message_ops(session, path, FALSE, "testbox");
- test_folder_message_ops(session, path, FALSE, "INBOX");
+ test_folder_message_ops (session, path, FALSE, "testbox");
+ test_folder_message_ops (session, path, FALSE, "INBOX");
/*camel_test_fatal();*/
}
diff --git a/camel/tests/folder/test7.c b/camel/tests/folder/test7.c
index 0087ab6..0edda95 100644
--- a/camel/tests/folder/test7.c
+++ b/camel/tests/folder/test7.c
@@ -21,7 +21,7 @@ gint main (gint argc, gchar **argv)
camel_test_provider_init (1, nntp_drivers);
/* clear out any camel-test data */
- system("/bin/rm -rf /tmp/camel-test");
+ system ("/bin/rm -rf /tmp/camel-test");
session = camel_test_session_new ("/tmp/camel-test");
@@ -29,13 +29,13 @@ gint main (gint argc, gchar **argv)
path = getenv (remote_providers[i]);
if (path == NULL) {
- printf("Aborted (ignored).\n");
- printf("Set '%s', to re-run test.\n", remote_providers[i]);
+ printf ("Aborted (ignored).\n");
+ printf ("Set '%s', to re-run test.\n", remote_providers[i]);
/* tells make check to ignore us in the total count */
_exit (77);
}
- camel_test_nonfatal("Dont know how many tests apply to NNTP");
- test_folder_message_ops(session, path, FALSE, "testbox");
+ camel_test_nonfatal ("Dont know how many tests apply to NNTP");
+ test_folder_message_ops (session, path, FALSE, "testbox");
camel_test_fatal ();
}
diff --git a/camel/tests/folder/test8.c b/camel/tests/folder/test8.c
index 2eef068..2483a3b 100644
--- a/camel/tests/folder/test8.c
+++ b/camel/tests/folder/test8.c
@@ -31,7 +31,7 @@ test_add_message (CamelFolder *folder,
push ("creating message %d\n", j);
msg = test_message_create_simple ();
content = g_strdup_printf ("Test message %08x contents\n\n", j);
- test_message_set_content_simple ((CamelMimePart *)msg, 0, "text/plain",
+ test_message_set_content_simple ((CamelMimePart *) msg, 0, "text/plain",
content, strlen (content));
test_free (content);
subject = g_strdup_printf ("Test message %08x subject", j);
@@ -68,9 +68,9 @@ worker (gpointer d)
for (i = 0; i < MAX_MESSAGES; i++) {
test_add_message (info->folder, id + i);
- sub = g_strdup_printf ("(match-all (header-contains \"subject\" \"message %08x subject\"))", id+i);
+ sub = g_strdup_printf ("(match-all (header-contains \"subject\" \"message %08x subject\"))", id + i);
- push ("searching for message %d\n\tusing: %s", id+i, sub);
+ push ("searching for message %d\n\tusing: %s", id + i, sub);
res = camel_folder_search_by_expression (info->folder, sub, NULL, &error);
check_msg (error == NULL, "%s", error->message);
check_msg (res->len == 1, "res->len = %d", res->len);
@@ -84,7 +84,7 @@ worker (gpointer d)
g_clear_error (&error);
pull ();
- content = g_strdup_printf ("Test message %08x contents\n\n", id+i);
+ content = g_strdup_printf ("Test message %08x contents\n\n", id + i);
push ("comparing content '%s': '%s'", res->pdata[0], content);
test_message_compare_content (camel_medium_get_content ((CamelMedium *) msg), content, strlen (content));
test_free (content);
diff --git a/camel/tests/folder/test9.c b/camel/tests/folder/test9.c
index c8157c8..3be2c11 100644
--- a/camel/tests/folder/test9.c
+++ b/camel/tests/folder/test9.c
@@ -133,17 +133,17 @@ gint main (gint argc, gchar **argv)
/* append a bunch of messages with specific content */
push ("creating 100 test message mbox");
- mbox = camel_stream_fs_new_with_name ("/tmp/camel-test/inbox", O_WRONLY|O_CREAT|O_EXCL, 0600, NULL);
+ mbox = camel_stream_fs_new_with_name ("/tmp/camel-test/inbox", O_WRONLY | O_CREAT | O_EXCL, 0600, NULL);
for (j = 0; j < 100; j++) {
gchar *content, *subject;
push ("creating test message");
msg = test_message_create_simple ();
content = g_strdup_printf ("data%d content\n", j);
- test_message_set_content_simple ((CamelMimePart *)msg, 0, "text/plain",
+ test_message_set_content_simple ((CamelMimePart *) msg, 0, "text/plain",
content, strlen (content));
test_free (content);
- subject = g_strdup_printf ("Test%d message%d subject", j, 100-j);
+ subject = g_strdup_printf ("Test%d message%d subject", j, 100 - j);
camel_mime_message_set_subject (msg, subject);
camel_mime_message_set_date (msg, j * 60 * 24, 0);
diff --git a/camel/tests/lib/addresses.c b/camel/tests/lib/addresses.c
index 467d73e..bb6a465 100644
--- a/camel/tests/lib/addresses.c
+++ b/camel/tests/lib/addresses.c
@@ -34,7 +34,7 @@ test_address_compare (CamelInternetAddress *addr,
check (e1 != NULL && e2 != NULL);
if (e1 != NULL) {
- check_msg(string_equal(e1, e2), "e1 = '%s' e2 = '%s'", e1, e2);
+ check_msg (string_equal (e1, e2), "e1 = '%s' e2 = '%s'", e1, e2);
test_free (e1);
test_free (e2);
}
@@ -48,7 +48,7 @@ test_address_compare (CamelInternetAddress *addr,
check (f1 != NULL && f2 != NULL);
if (f1 != NULL) {
- check_msg(string_equal(f1, f2), "f1 = '%s' f2 = '%s'", f1, f2);
+ check_msg (string_equal (f1, f2), "f1 = '%s' f2 = '%s'", f1, f2);
test_free (f1);
test_free (f2);
}
diff --git a/camel/tests/lib/camel-test-provider.c b/camel/tests/lib/camel-test-provider.c
index 06834e8..1535c9a 100644
--- a/camel/tests/lib/camel-test-provider.c
+++ b/camel/tests/lib/camel-test-provider.c
@@ -10,11 +10,11 @@ camel_test_provider_init (gint argc,
GError *error = NULL;
for (i = 0; i < argc; i++) {
- name = g_strdup_printf("libcamel%s."G_MODULE_SUFFIX, argv[i]);
- path = g_build_filename(CAMEL_BUILD_DIR, "providers", argv[i], ".libs", name, NULL);
+ name = g_strdup_printf ("libcamel%s."G_MODULE_SUFFIX, argv[i]);
+ path = g_build_filename (CAMEL_BUILD_DIR, "providers", argv[i], ".libs", name, NULL);
g_free (name);
camel_provider_load (path, &error);
- check_msg(error == NULL, "Cannot load provider for '%s', test aborted", argv[i]);
+ check_msg (error == NULL, "Cannot load provider for '%s', test aborted", argv[i]);
g_free (path);
}
}
diff --git a/camel/tests/lib/camel-test.c b/camel/tests/lib/camel-test.c
index 050ef31..27837ce 100644
--- a/camel/tests/lib/camel-test.c
+++ b/camel/tests/lib/camel-test.c
@@ -44,17 +44,17 @@ dump_action (GThread *thread,
{
struct _stack *node;
- printf("\nThread %p:\n", thread);
+ printf ("\nThread %p:\n", thread);
node = s->state;
if (node) {
- printf("Current action:\n");
+ printf ("Current action:\n");
while (node) {
- printf("\t%s%s\n", node->fatal?"":"[nonfatal]", node->what);
+ printf ("\t%s%s\n", node->fatal?"":"[nonfatal]", node->what);
node = node->next;
}
}
- printf("\tTest: %s\n", s->test);
+ printf ("\tTest: %s\n", s->test);
}
static void G_GNUC_NORETURN
@@ -64,11 +64,11 @@ die (gint sig)
if (!indie) {
indie = 1;
- printf("\n\nReceived fatal signal %d\n", sig);
+ printf ("\n\nReceived fatal signal %d\n", sig);
g_hash_table_foreach (info_table, (GHFunc) dump_action, 0);
if (camel_test_verbose > 2) {
- printf("Attach debugger to pid %d to debug\n", getpid());
+ printf ("Attach debugger to pid %d to debug\n", getpid ());
sleep (1000);
}
}
@@ -155,7 +155,7 @@ void camel_test_start (const gchar *what)
s->test = g_strdup (what);
if (camel_test_verbose > 0) {
- printf("Test: %s ... ", what);
+ printf ("Test: %s ... ", what);
fflush (stdout);
}
@@ -178,7 +178,7 @@ void camel_test_push (const gchar *what, ...)
va_end (ap);
if (camel_test_verbose > 3)
- printf("Start step: %s\n", text);
+ printf ("Start step: %s\n", text);
node = g_malloc (sizeof (*node));
node->what = text;
@@ -201,7 +201,7 @@ void camel_test_pull (void)
g_assert (s->state);
if (camel_test_verbose > 3)
- printf("Finish step: %s\n", s->state->what);
+ printf ("Finish step: %s\n", s->state->what);
node = s->state;
s->state = node->next;
@@ -242,7 +242,7 @@ void camel_test_failv (const gchar *why, va_list ap)
if ((s->nonfatal == 0 && camel_test_verbose > 0)
|| (s->nonfatal && camel_test_verbose > 1)) {
- printf("Failed.\n%s\n", text);
+ printf ("Failed.\n%s\n", text);
camel_test_break ();
}
@@ -258,7 +258,7 @@ void camel_test_failv (const gchar *why, va_list ap)
} else {
ok = 0;
if (camel_test_verbose > 1) {
- printf("Known problem (ignored):\n");
+ printf ("Known problem (ignored):\n");
dump_action (CAMEL_TEST_ID, s, 0);
}
}
@@ -282,7 +282,7 @@ void camel_test_nonfatal (const gchar *what, ...)
va_end (ap);
if (camel_test_verbose > 3)
- printf("Start nonfatal: %s\n", text);
+ printf ("Start nonfatal: %s\n", text);
node = g_malloc (sizeof (*node));
node->what = text;
@@ -303,9 +303,9 @@ void camel_test_end (void)
{
if (camel_test_verbose > 0) {
if (ok)
- printf("Ok\n");
+ printf ("Ok\n");
else
- printf("Partial success\n");
+ printf ("Partial success\n");
}
fflush (stdout);
diff --git a/camel/tests/lib/folders.c b/camel/tests/lib/folders.c
index 33506e5..8d439e0 100644
--- a/camel/tests/lib/folders.c
+++ b/camel/tests/lib/folders.c
@@ -355,7 +355,7 @@ test_folder_message_ops (CamelSession *session,
max = local ? 2 : 1;
for (indexed = 0; indexed < max; indexed++) {
- gchar *what = g_strdup_printf ("folder ops: %s %s", name, local?(indexed?"indexed":"non-indexed"):"");
+ gchar *what = g_strdup_printf ("folder ops: %s %s", name, local ? (indexed?"indexed":"non-indexed"):"");
gint flags;
camel_test_start (what);
@@ -402,7 +402,7 @@ test_folder_message_ops (CamelSession *session,
push ("creating test message");
msg = test_message_create_simple ();
content = g_strdup_printf ("Test message %d contents\n\n", j);
- test_message_set_content_simple ((CamelMimePart *)msg, 0, "text/plain",
+ test_message_set_content_simple ((CamelMimePart *) msg, 0, "text/plain",
content, strlen (content));
test_free (content);
subject = g_strdup_printf ("Test message %d", j);
@@ -516,7 +516,7 @@ test_folder_message_ops (CamelSession *session,
check (uids != NULL);
check (uids->len == 9);
for (j = 0; j < 9; j++) {
- gchar *subject = g_strdup_printf ("Test message %d", j+1);
+ gchar *subject = g_strdup_printf ("Test message %d", j + 1);
push ("verify after expunge of %s", subject);
test_folder_message (folder, uids->pdata[j]);
@@ -546,7 +546,7 @@ test_folder_message_ops (CamelSession *session,
check (uids != NULL);
check (uids->len == 8);
for (j = 0; j < 8; j++) {
- gchar *subject = g_strdup_printf ("Test message %d", j+1);
+ gchar *subject = g_strdup_printf ("Test message %d", j + 1);
push ("verify after expunge of %s", subject);
test_folder_message (folder, uids->pdata[j]);
diff --git a/camel/tests/lib/messages.c b/camel/tests/lib/messages.c
index d39329e..f53e4ab 100644
--- a/camel/tests/lib/messages.c
+++ b/camel/tests/lib/messages.c
@@ -283,7 +283,7 @@ message_dump_rec (CamelMimeMessage *msg,
printf ("%sPart <%s>\n", s, G_OBJECT_TYPE_NAME (part));
printf ("%sContent-Type: %s\n", s, mime_type);
g_free (mime_type);
- printf ("%s encoding: %s\n", s, camel_transfer_encoding_to_string (((CamelDataWrapper *)part)->encoding));
+ printf ("%s encoding: %s\n", s, camel_transfer_encoding_to_string (((CamelDataWrapper *) part)->encoding));
printf ("%s part encoding: %s\n", s, camel_transfer_encoding_to_string (camel_mime_part_get_encoding (part)));
containee = camel_medium_get_content (CAMEL_MEDIUM (part));
@@ -295,7 +295,7 @@ message_dump_rec (CamelMimeMessage *msg,
printf ("%sContent <%s>\n", s, G_OBJECT_TYPE_NAME (containee));
printf ("%sContent-Type: %s\n", s, mime_type);
g_free (mime_type);
- printf ("%s encoding: %s\n", s, camel_transfer_encoding_to_string (((CamelDataWrapper *)containee)->encoding));
+ printf ("%s encoding: %s\n", s, camel_transfer_encoding_to_string (((CamelDataWrapper *) containee)->encoding));
/* using the object types is more accurate than using the mime/types */
if (CAMEL_IS_MULTIPART (containee)) {
diff --git a/camel/tests/message/test1.c b/camel/tests/message/test1.c
index 8841fdb..083213b 100644
--- a/camel/tests/message/test1.c
+++ b/camel/tests/message/test1.c
@@ -112,41 +112,41 @@ main (gint argc,
setup ();
- camel_test_start("Simple memory-based content creation");
+ camel_test_start ("Simple memory-based content creation");
/* test all ways of setting simple content for a message (i.e. memory based) */
for (j = 0; j < MAX_TEXTS; j++) {
- push("testing text number %d", j);
+ push ("testing text number %d", j);
text = texts[j].text;
len = texts[j].len;
for (i = 0; i < SET_CONTENT_WAYS; i++) {
- push("create simple message %d", i);
+ push ("create simple message %d", i);
msg = test_message_create_simple ();
- push("set simple content");
- test_message_set_content_simple((CamelMimePart *)msg, i, "text/plain", text, len);
+ push ("set simple content");
+ test_message_set_content_simple ((CamelMimePart *) msg, i, "text/plain", text, len);
pull ();
- push("compare original content");
+ push ("compare original content");
test_message_compare_content (camel_medium_get_content ((CamelMedium *) msg), text, len);
pull ();
- push("save message to test1.msg");
- unlink("test1.msg");
- test_message_write_file(msg, "test1.msg");
+ push ("save message to test1.msg");
+ unlink ("test1.msg");
+ test_message_write_file (msg, "test1.msg");
check_unref (msg, 1);
pull ();
- push("read from test1.msg");
- msg2 = test_message_read_file("test1.msg");
+ push ("read from test1.msg");
+ msg2 = test_message_read_file ("test1.msg");
pull ();
- push("compare read with original content");
+ push ("compare read with original content");
test_message_compare_content (camel_medium_get_content ((CamelMedium *) msg2), text, len);
check_unref (msg2, 1);
pull ();
- unlink("test1.msg");
+ unlink ("test1.msg");
pull ();
}
pull ();
@@ -154,38 +154,38 @@ main (gint argc,
camel_test_end ();
- camel_test_start("Different encodings");
+ camel_test_start ("Different encodings");
for (j = 0; j < MAX_TEXTS; j++) {
- push("testing text number %d", j);
+ push ("testing text number %d", j);
text = texts[j].text;
len = texts[j].len;
for (i = 0; i < CAMEL_TRANSFER_NUM_ENCODINGS; i++) {
- push("test simple message, encoding %s", camel_transfer_encoding_to_string(i));
+ push ("test simple message, encoding %s", camel_transfer_encoding_to_string (i));
msg = test_message_create_simple ();
- push("set simple content");
- test_message_set_content_simple((CamelMimePart *)msg, 0, "text/plain", text, len);
+ push ("set simple content");
+ test_message_set_content_simple ((CamelMimePart *) msg, 0, "text/plain", text, len);
pull ();
camel_mime_part_set_encoding ((CamelMimePart *) msg, i);
- push("save message to test1.msg");
- unlink("test1.msg");
- test_message_write_file(msg, "test1.msg");
+ push ("save message to test1.msg");
+ unlink ("test1.msg");
+ test_message_write_file (msg, "test1.msg");
check_unref (msg, 1);
pull ();
- push("read from test1.msg");
- msg2 = test_message_read_file("test1.msg");
+ push ("read from test1.msg");
+ msg2 = test_message_read_file ("test1.msg");
pull ();
- push("compare read with original content");
+ push ("compare read with original content");
test_message_compare_content (camel_medium_get_content ((CamelMedium *) msg2), text, len);
check_unref (msg2, 1);
pull ();
- unlink("test1.msg");
+ unlink ("test1.msg");
pull ();
}
pull ();
diff --git a/camel/tests/message/test2.c b/camel/tests/message/test2.c
index 8ac4af3..2d296e3 100644
--- a/camel/tests/message/test2.c
+++ b/camel/tests/message/test2.c
@@ -58,14 +58,14 @@ static gchar *convert (const gchar *in, const gchar *from, const gchar *to)
noutp = nout = g_malloc (outlen);
if (iconv (ic, &inp, &inlen, &noutp, &outlen) == -1
|| iconv (ic, NULL, 0, &noutp, &outlen) == -1) {
- g_warning("Cannot convert '%s' \n from %s to %s: %s\n", in, to, from, g_strerror(errno));
+ g_warning ("Cannot convert '%s' \n from %s to %s: %s\n", in, to, from, g_strerror (errno));
}
iconv_close (ic);
}
/* and lets see what camel thinks out optimal charset is */
{
- printf("Camel thinks the best encoding of '%s' is %s, although we converted from %s\n",
+ printf ("Camel thinks the best encoding of '%s' is %s, although we converted from %s\n",
in, camel_charset_best (out, strlen (out)), from);
}
fail:
@@ -109,84 +109,84 @@ gint main (gint argc, gchar **argv)
camel_test_init (argc, argv);
- camel_test_start("CamelInternetAddress, basics");
+ camel_test_start ("CamelInternetAddress, basics");
addr = camel_internet_address_new ();
- push("Test blank address");
+ push ("Test blank address");
check (camel_address_length (CAMEL_ADDRESS (addr)) == 0);
check (camel_internet_address_get (addr, 0, &real, &where) == FALSE);
pull ();
- push("Test blank clone");
+ push ("Test blank clone");
addr2 = CAMEL_INTERNET_ADDRESS (camel_address_new_clone (CAMEL_ADDRESS (addr)));
test_address_compare (addr, addr2);
check_unref (addr2, 1);
pull ();
- push("Test add 1");
- camel_internet_address_add(addr, "Zed", "nowhere here com au");
+ push ("Test add 1");
+ camel_internet_address_add (addr, "Zed", "nowhere here com au");
check (camel_address_length (CAMEL_ADDRESS (addr)) == 1);
check (camel_internet_address_get (addr, 0, &real, &where) == TRUE);
- check_msg(string_equal("Zed", real), "real = '%s'", real);
- check(strcmp(where, "nowhere here com au") == 0);
+ check_msg (string_equal ("Zed", real), "real = '%s'", real);
+ check (strcmp (where, "nowhere here com au") == 0);
pull ();
- push("Test clone 1");
+ push ("Test clone 1");
addr2 = CAMEL_INTERNET_ADDRESS (camel_address_new_clone (CAMEL_ADDRESS (addr)));
test_address_compare (addr, addr2);
check_unref (addr2, 1);
pull ();
- push("Test add many");
+ push ("Test add many");
for (i = 1; i < 10; i++) {
gchar name[16], a[32];
- sprintf(name, "Zed %d", i);
- sprintf(a, "nowhere here-%d com au", i);
+ sprintf (name, "Zed %d", i);
+ sprintf (a, "nowhere here-%d com au", i);
camel_internet_address_add (addr, name, a);
check (camel_address_length (CAMEL_ADDRESS (addr)) == i + 1);
check (camel_internet_address_get (addr, i, &real, &where) == TRUE);
- check_msg(string_equal(name, real), "name = '%s' real = '%s'", name, real);
+ check_msg (string_equal (name, real), "name = '%s' real = '%s'", name, real);
check (strcmp (where, a) == 0);
}
pull ();
/* put a few of these in to make it look like its doing something impressive ... :) */
camel_test_end ();
- camel_test_start("CamelInternetAddress, search");
-
- push("Test search");
- camel_test_nonfatal("Address comparisons should ignore whitespace??");
- check(camel_internet_address_find_name(addr, "Zed 1", &where) == 1);
- check(camel_internet_address_find_name(addr, "Zed 9", &where) == 9);
- check(camel_internet_address_find_name(addr, "Zed", &where) == 0);
- check(camel_internet_address_find_name(addr, " Zed", &where) == 0);
- check(camel_internet_address_find_name(addr, "Zed ", &where) == 0);
- check(camel_internet_address_find_name(addr, " Zed ", &where) == 0);
- check(camel_internet_address_find_name(addr, "Zed 20", &where) == -1);
- check(camel_internet_address_find_name(addr, "", &where) == -1);
+ camel_test_start ("CamelInternetAddress, search");
+
+ push ("Test search");
+ camel_test_nonfatal ("Address comparisons should ignore whitespace??");
+ check (camel_internet_address_find_name (addr, "Zed 1", &where) == 1);
+ check (camel_internet_address_find_name (addr, "Zed 9", &where) == 9);
+ check (camel_internet_address_find_name (addr, "Zed", &where) == 0);
+ check (camel_internet_address_find_name (addr, " Zed", &where) == 0);
+ check (camel_internet_address_find_name (addr, "Zed ", &where) == 0);
+ check (camel_internet_address_find_name (addr, " Zed ", &where) == 0);
+ check (camel_internet_address_find_name (addr, "Zed 20", &where) == -1);
+ check (camel_internet_address_find_name (addr, "", &where) == -1);
/* interface dont handle nulls :) */
/*check(camel_internet_address_find_name(addr, NULL, &where) == -1);*/
- check(camel_internet_address_find_address(addr, "nowhere here-1 com au", &where) == 1);
- check(camel_internet_address_find_address(addr, "nowhere here-1 . com.au", &where) == 1);
- check(camel_internet_address_find_address(addr, "nowhere here-2 .com.au ", &where) == 2);
- check(camel_internet_address_find_address(addr, " nowhere @here-3.com.au", &where) == 3);
- check(camel_internet_address_find_address(addr, "nowhere here-20 com au ", &where) == -1);
- check(camel_internet_address_find_address(addr, "", &where) == -1);
+ check (camel_internet_address_find_address (addr, "nowhere here-1 com au", &where) == 1);
+ check (camel_internet_address_find_address (addr, "nowhere here-1 . com.au", &where) == 1);
+ check (camel_internet_address_find_address (addr, "nowhere here-2 .com.au ", &where) == 2);
+ check (camel_internet_address_find_address (addr, " nowhere @here-3.com.au", &where) == 3);
+ check (camel_internet_address_find_address (addr, "nowhere here-20 com au ", &where) == -1);
+ check (camel_internet_address_find_address (addr, "", &where) == -1);
/*check(camel_internet_address_find_address(addr, NULL, &where) == -1);*/
camel_test_fatal ();
pull ();
camel_test_end ();
- camel_test_start("CamelInternetAddress, copy/cat/clone");
+ camel_test_start ("CamelInternetAddress, copy/cat/clone");
- push("Test clone many");
+ push ("Test clone many");
addr2 = CAMEL_INTERNET_ADDRESS (camel_address_new_clone (CAMEL_ADDRESS (addr)));
test_address_compare (addr, addr2);
pull ();
- push("Test remove items");
+ push ("Test remove items");
camel_address_remove (CAMEL_ADDRESS (addr2), 0);
check (camel_address_length (CAMEL_ADDRESS (addr2)) == 9);
camel_address_remove (CAMEL_ADDRESS (addr2), 0);
@@ -200,8 +200,8 @@ gint main (gint argc, gchar **argv)
check_unref (addr2, 1);
pull ();
- push("Testing copy/cat");
- push("clone + cat");
+ push ("Testing copy/cat");
+ push ("clone + cat");
addr2 = CAMEL_INTERNET_ADDRESS (camel_address_new_clone (CAMEL_ADDRESS (addr)));
camel_address_cat (CAMEL_ADDRESS (addr2), CAMEL_ADDRESS (addr));
check (camel_address_length (CAMEL_ADDRESS (addr)) == 10);
@@ -209,7 +209,7 @@ gint main (gint argc, gchar **argv)
check_unref (addr2, 1);
pull ();
- push("cat + cat + copy");
+ push ("cat + cat + copy");
addr2 = camel_internet_address_new ();
camel_address_cat (CAMEL_ADDRESS (addr2), CAMEL_ADDRESS (addr));
test_address_compare (addr, addr2);
@@ -221,7 +221,7 @@ gint main (gint argc, gchar **argv)
check_unref (addr2, 1);
pull ();
- push("copy");
+ push ("copy");
addr2 = camel_internet_address_new ();
camel_address_copy (CAMEL_ADDRESS (addr2), CAMEL_ADDRESS (addr));
test_address_compare (addr, addr2);
@@ -234,10 +234,10 @@ gint main (gint argc, gchar **argv)
camel_test_end ();
- camel_test_start("CamelInternetAddress, I18N");
+ camel_test_start ("CamelInternetAddress, I18N");
for (i = 0; i < G_N_ELEMENTS (test_lines); i++) {
- push("Testing text line %d (%s) '%s'", i, test_lines[i].type, test_lines[i].line);
+ push ("Testing text line %d (%s) '%s'", i, test_lines[i].type, test_lines[i].line);
addr = camel_internet_address_new ();
@@ -245,18 +245,18 @@ gint main (gint argc, gchar **argv)
charset = test_lines[i].type;
name = to_utf8 (test_lines[i].line, charset);
- push("Address setup");
- camel_internet_address_add(addr, name, "nobody nowhere com");
+ push ("Address setup");
+ camel_internet_address_add (addr, name, "nobody nowhere com");
check (camel_internet_address_get (addr, 0, &real, &where) == TRUE);
- check_msg(string_equal(name, real), "name = '%s' real = '%s'", name, real);
- check(strcmp(where, "nobody nowhere com") == 0);
+ check_msg (string_equal (name, real), "name = '%s' real = '%s'", name, real);
+ check (strcmp (where, "nobody nowhere com") == 0);
test_free (name);
check (camel_internet_address_get (addr, 1, &real, &where) == FALSE);
check (camel_address_length (CAMEL_ADDRESS (addr)) == 1);
pull ();
- push("Address encode/decode");
+ push ("Address encode/decode");
enc = camel_address_encode (CAMEL_ADDRESS (addr));
addr2 = camel_internet_address_new ();
@@ -264,10 +264,10 @@ gint main (gint argc, gchar **argv)
check (camel_address_length (CAMEL_ADDRESS (addr2)) == 1);
enc2 = camel_address_encode (CAMEL_ADDRESS (addr2));
- check_msg(string_equal(enc, enc2), "enc = '%s' enc2 = '%s'", enc, enc2);
+ check_msg (string_equal (enc, enc2), "enc = '%s' enc2 = '%s'", enc, enc2);
test_free (enc2);
- push("Compare addresses");
+ push ("Compare addresses");
test_address_compare (addr, addr2);
pull ();
check_unref (addr2, 1);
@@ -275,9 +275,9 @@ gint main (gint argc, gchar **argv)
pull ();
/* FIXME: format/unformat arne't guaranteed to be reversible, at least at the moment */
- camel_test_nonfatal("format/unformat not (yet) reversible for all cases");
+ camel_test_nonfatal ("format/unformat not (yet) reversible for all cases");
- push("Address format/unformat");
+ push ("Address format/unformat");
format = camel_address_format (CAMEL_ADDRESS (addr));
addr2 = camel_internet_address_new ();
@@ -285,12 +285,12 @@ gint main (gint argc, gchar **argv)
check (camel_address_length (CAMEL_ADDRESS (addr2)) == 1);
format2 = camel_address_format (CAMEL_ADDRESS (addr2));
- check_msg(string_equal(format, format2), "format = '%s\n\tformat2 = '%s'", format, format2);
+ check_msg (string_equal (format, format2), "format = '%s\n\tformat2 = '%s'", format, format2);
test_free (format2);
/* currently format/unformat doesn't handle ,'s and other special chars at all */
if (camel_address_length (CAMEL_ADDRESS (addr2)) == 1) {
- push("Compare addresses");
+ push ("Compare addresses");
test_address_compare (addr, addr2);
pull ();
}
@@ -309,23 +309,23 @@ gint main (gint argc, gchar **argv)
camel_test_end ();
- camel_test_start("CamelInternetAddress, I18N decode");
+ camel_test_start ("CamelInternetAddress, I18N decode");
for (i = 0; i < G_N_ELEMENTS (test_address); i++) {
- push("Testing address line %d '%s'", i, test_address[i].addr);
+ push ("Testing address line %d '%s'", i, test_address[i].addr);
addr = camel_internet_address_new ();
- push("checking decoded");
+ push ("checking decoded");
check (camel_address_decode (CAMEL_ADDRESS (addr), test_address[i].addr) == test_address[i].count);
format = camel_address_format (CAMEL_ADDRESS (addr));
check (strcmp (format, test_address[i].utf8) == 0);
test_free (format);
pull ();
- push("Comparing re-encoded output");
+ push ("Comparing re-encoded output");
addr2 = CAMEL_INTERNET_ADDRESS (camel_internet_address_new ());
enc = camel_address_encode (CAMEL_ADDRESS (addr));
- check_msg(camel_address_decode(CAMEL_ADDRESS(addr2), enc) == test_address[i].count, "enc = '%s'", enc);
+ check_msg (camel_address_decode (CAMEL_ADDRESS (addr2), enc) == test_address[i].count, "enc = '%s'", enc);
test_free (enc);
test_address_compare (addr, addr2);
check_unref (addr2, 1);
diff --git a/camel/tests/message/test3.c b/camel/tests/message/test3.c
index 751a016..1728570 100644
--- a/camel/tests/message/test3.c
+++ b/camel/tests/message/test3.c
@@ -18,24 +18,24 @@ gint main (gint argc, gchar **argv)
camel_test_init (argc, argv);
- camel_test_start("multipart message");
+ camel_test_start ("multipart message");
- push("building message");
+ push ("building message");
msg = test_message_create_simple ();
mp = camel_multipart_new ();
/* Hrm, this should be able to set its own boundary, no? */
- camel_multipart_set_boundary(mp, "_=,.XYZ_Kangaroo_Meat_is_!_ABADF00D");
- check(strcmp(camel_multipart_get_boundary(mp), "_=,.XYZ_Kangaroo_Meat_is_!_ABADF00D") == 0);
+ camel_multipart_set_boundary (mp, "_=,.XYZ_Kangaroo_Meat_is_!_ABADF00D");
+ check (strcmp (camel_multipart_get_boundary (mp), "_=,.XYZ_Kangaroo_Meat_is_!_ABADF00D") == 0);
camel_medium_set_content ((CamelMedium *) msg, (CamelDataWrapper *) mp);
check (camel_multipart_get_number (mp) == 0);
check (camel_multipart_get_part (mp, 0) == NULL);
check (camel_multipart_get_part (mp, 1) == NULL);
- push("adding/removing parts");
+ push ("adding/removing parts");
part = camel_mime_part_new ();
- test_message_set_content_simple(part, 0, "text/plain", "content part 1", strlen("content part 1"));
+ test_message_set_content_simple (part, 0, "text/plain", "content part 1", strlen ("content part 1"));
camel_multipart_add_part (mp, part);
check (G_OBJECT (part)->ref_count == 2);
check (camel_multipart_get_number (mp) == 1);
@@ -73,7 +73,7 @@ gint main (gint argc, gchar **argv)
check (camel_multipart_get_part (mp, 1) == NULL);
part2 = camel_mime_part_new ();
- test_message_set_content_simple(part2, 0, "text/plain", "content part 2", strlen("content part 2"));
+ test_message_set_content_simple (part2, 0, "text/plain", "content part 2", strlen ("content part 2"));
camel_multipart_add_part (mp, part2);
check (G_OBJECT (part2)->ref_count == 2);
check (camel_multipart_get_number (mp) == 2);
@@ -81,7 +81,7 @@ gint main (gint argc, gchar **argv)
check (camel_multipart_get_part (mp, 1) == part2);
part3 = camel_mime_part_new ();
- test_message_set_content_simple(part3, 0, "text/plain", "content part 3", strlen("content part 3"));
+ test_message_set_content_simple (part3, 0, "text/plain", "content part 3", strlen ("content part 3"));
camel_multipart_add_part_at (mp, part3, 1);
check (G_OBJECT (part3)->ref_count == 2);
check (camel_multipart_get_number (mp) == 3);
@@ -90,91 +90,91 @@ gint main (gint argc, gchar **argv)
check (camel_multipart_get_part (mp, 2) == part2);
pull ();
- push("save message to test3.msg");
- unlink("test3.msg");
- test_message_write_file(msg, "test3.msg");
+ push ("save message to test3.msg");
+ unlink ("test3.msg");
+ test_message_write_file (msg, "test3.msg");
pull ();
- push("read from test3.msg");
- msg2 = test_message_read_file("test3.msg");
+ push ("read from test3.msg");
+ msg2 = test_message_read_file ("test3.msg");
pull ();
- push("compre content of multipart");
+ push ("compre content of multipart");
mp2 = (CamelMultipart *) camel_medium_get_content ((CamelMedium *) msg2);
check (mp2 != NULL);
check (CAMEL_IS_MULTIPART (mp2));
check (camel_multipart_get_number (mp2) == 3);
- check(strcmp(camel_multipart_get_boundary(mp2), "_=,.XYZ_Kangaroo_Meat_is_!_ABADF00D") == 0);
+ check (strcmp (camel_multipart_get_boundary (mp2), "_=,.XYZ_Kangaroo_Meat_is_!_ABADF00D") == 0);
check (mp2->preface == NULL || strlen (mp2->preface) == 0);
/* FIXME */
- camel_test_nonfatal("postface may gain a single \\n?");
- check_msg(mp2->postface == NULL || strlen(mp2->postface) == 0, "postface: '%s'", mp2->postface);
+ camel_test_nonfatal ("postface may gain a single \\n?");
+ check_msg (mp2->postface == NULL || strlen (mp2->postface) == 0, "postface: '%s'", mp2->postface);
camel_test_fatal ();
test_message_compare_content (camel_medium_get_content (CAMEL_MEDIUM (camel_multipart_get_part (mp2, 0))),
- "content part 1", strlen("content part 1"));
+ "content part 1", strlen ("content part 1"));
test_message_compare_content (camel_medium_get_content (CAMEL_MEDIUM (camel_multipart_get_part (mp2, 1))),
- "content part 3", strlen("content part 3"));
+ "content part 3", strlen ("content part 3"));
test_message_compare_content (camel_medium_get_content (CAMEL_MEDIUM (camel_multipart_get_part (mp2, 2))),
- "content part 2", strlen("content part 2"));
+ "content part 2", strlen ("content part 2"));
pull ();
- push("writing again, & re-reading");
- unlink("test3-2.msg");
- test_message_write_file(msg2, "test3-2.msg");
- msg3 = test_message_read_file("test3-2.msg");
+ push ("writing again, & re-reading");
+ unlink ("test3-2.msg");
+ test_message_write_file (msg2, "test3-2.msg");
+ msg3 = test_message_read_file ("test3-2.msg");
- push("comparing again");
+ push ("comparing again");
mp2 = (CamelMultipart *) camel_medium_get_content ((CamelMedium *) msg3);
check (mp2 != NULL);
check (CAMEL_IS_MULTIPART (mp2));
check (camel_multipart_get_number (mp2) == 3);
- check(strcmp(camel_multipart_get_boundary(mp2), "_=,.XYZ_Kangaroo_Meat_is_!_ABADF00D") == 0);
+ check (strcmp (camel_multipart_get_boundary (mp2), "_=,.XYZ_Kangaroo_Meat_is_!_ABADF00D") == 0);
check (mp2->preface == NULL || strlen (mp2->preface) == 0);
- check_msg(mp2->postface == NULL || strlen(mp2->postface) == 0, "postface: '%s'", mp2->postface);
+ check_msg (mp2->postface == NULL || strlen (mp2->postface) == 0, "postface: '%s'", mp2->postface);
test_message_compare_content (camel_medium_get_content (CAMEL_MEDIUM (camel_multipart_get_part (mp2, 0))),
- "content part 1", strlen("content part 1"));
+ "content part 1", strlen ("content part 1"));
test_message_compare_content (camel_medium_get_content (CAMEL_MEDIUM (camel_multipart_get_part (mp2, 1))),
- "content part 3", strlen("content part 3"));
+ "content part 3", strlen ("content part 3"));
test_message_compare_content (camel_medium_get_content (CAMEL_MEDIUM (camel_multipart_get_part (mp2, 2))),
- "content part 2", strlen("content part 2"));
+ "content part 2", strlen ("content part 2"));
pull ();
pull ();
check_unref (msg2, 1);
check_unref (msg3, 1);
- push("testing pre/post text");
- camel_multipart_set_preface(mp, "pre-text\nLines.");
- camel_multipart_set_postface(mp, "post-text, no lines.\nOne line.\n");
+ push ("testing pre/post text");
+ camel_multipart_set_preface (mp, "pre-text\nLines.");
+ camel_multipart_set_postface (mp, "post-text, no lines.\nOne line.\n");
- check(strcmp(mp->preface, "pre-text\nLines.") == 0);
- check(strcmp(mp->postface, "post-text, no lines.\nOne line.\n") == 0);
+ check (strcmp (mp->preface, "pre-text\nLines.") == 0);
+ check (strcmp (mp->postface, "post-text, no lines.\nOne line.\n") == 0);
- push("writing /re-reading");
- unlink("test3-3.msg");
- test_message_write_file(msg, "test3-3.msg");
- msg2 = test_message_read_file("test3-3.msg");
+ push ("writing /re-reading");
+ unlink ("test3-3.msg");
+ test_message_write_file (msg, "test3-3.msg");
+ msg2 = test_message_read_file ("test3-3.msg");
mp2 = (CamelMultipart *) camel_medium_get_content ((CamelMedium *) msg2);
check (mp2 != NULL);
check (CAMEL_IS_MULTIPART (mp2));
check (camel_multipart_get_number (mp2) == 3);
- check(strcmp(camel_multipart_get_boundary(mp2), "_=,.XYZ_Kangaroo_Meat_is_!_ABADF00D") == 0);
- check(mp2->preface && strcmp(mp2->preface, "pre-text\nLines.") == 0);
- check(mp2->postface && strcmp(mp2->postface, "post-text, no lines.\nOne line.\n") == 0);
+ check (strcmp (camel_multipart_get_boundary (mp2), "_=,.XYZ_Kangaroo_Meat_is_!_ABADF00D") == 0);
+ check (mp2->preface && strcmp (mp2->preface, "pre-text\nLines.") == 0);
+ check (mp2->postface && strcmp (mp2->postface, "post-text, no lines.\nOne line.\n") == 0);
test_message_compare_content (camel_medium_get_content (CAMEL_MEDIUM (camel_multipart_get_part (mp2, 0))),
- "content part 1", strlen("content part 1"));
+ "content part 1", strlen ("content part 1"));
test_message_compare_content (camel_medium_get_content (CAMEL_MEDIUM (camel_multipart_get_part (mp2, 1))),
- "content part 3", strlen("content part 3"));
+ "content part 3", strlen ("content part 3"));
test_message_compare_content (camel_medium_get_content (CAMEL_MEDIUM (camel_multipart_get_part (mp2, 2))),
- "content part 2", strlen("content part 2"));
+ "content part 2", strlen ("content part 2"));
pull ();
check_unref (msg2, 1);
pull ();
diff --git a/camel/tests/mime-filter/test-tohtml.c b/camel/tests/mime-filter/test-tohtml.c
index ba4f7a8..0c5ac58 100644
--- a/camel/tests/mime-filter/test-tohtml.c
+++ b/camel/tests/mime-filter/test-tohtml.c
@@ -29,9 +29,9 @@ test_filter (CamelMimeFilter *f,
GByteArray *byte_array_out;
gint id;
- camel_test_push("Data file '%s'", inname);
+ camel_test_push ("Data file '%s'", inname);
- camel_test_push("setup");
+ camel_test_push ("setup");
indisk = camel_stream_fs_new_with_name (inname, O_RDONLY, 0, NULL);
check (indisk);
@@ -44,7 +44,7 @@ test_filter (CamelMimeFilter *f,
camel_test_pull ();
- camel_test_push("reading through filter stream");
+ camel_test_push ("reading through filter stream");
byte_array_in = g_byte_array_new ();
in = camel_stream_mem_new_with_byte_array (byte_array_in);
@@ -74,7 +74,7 @@ test_filter (CamelMimeFilter *f,
check (g_seekable_seek (
G_SEEKABLE (indisk), 0, G_SEEK_SET, NULL, NULL));
- camel_test_push("writing through filter stream");
+ camel_test_push ("writing through filter stream");
byte_array_in = g_byte_array_new ();
in = camel_stream_mem_new_with_byte_array (byte_array_in);
@@ -110,15 +110,15 @@ main (gint argc,
camel_test_init (argc, argv);
- camel_test_start("HTML Stream filtering");
+ camel_test_start ("HTML Stream filtering");
for (i = 0; i < 100; i++) {
gchar inname[32], outname[32];
CamelMimeFilter *f;
struct stat st;
- sprintf(inname, "data/html.%d.in", i);
- sprintf(outname, "data/html.%d.out", i);
+ sprintf (inname, "data/html.%d.in", i);
+ sprintf (outname, "data/html.%d.out", i);
if (g_stat (inname, &st) == -1)
break;
diff --git a/camel/tests/misc/split.c b/camel/tests/misc/split.c
index f88f629..f37f3f8 100644
--- a/camel/tests/misc/split.c
+++ b/camel/tests/misc/split.c
@@ -58,14 +58,14 @@ main (gint argc,
camel_test_init (argc, argv);
- camel_test_start("Search splitting");
+ camel_test_start ("Search splitting");
for (i = 0; i < G_N_ELEMENTS (split_tests); i++) {
- camel_test_push("split %d '%s'", i, split_tests[i].word);
+ camel_test_push ("split %d '%s'", i, split_tests[i].word);
words = camel_search_words_split (split_tests[i].word);
check (words != NULL);
- check_msg(words->len == split_tests[i].count, "words->len = %d, count = %d", words->len, split_tests[i].count);
+ check_msg (words->len == split_tests[i].count, "words->len = %d, count = %d", words->len, split_tests[i].count);
for (j = 0; j < words->len; j++) {
check_msg (strcmp (split_tests[i].splits[j].word, words->words[j]->word) == 0,
@@ -79,17 +79,17 @@ main (gint argc,
camel_test_end ();
- camel_test_start("Search splitting - simple");
+ camel_test_start ("Search splitting - simple");
for (i = 0; i < G_N_ELEMENTS (simple_tests); i++) {
- camel_test_push("simple split %d '%s'", i, simple_tests[i].word);
+ camel_test_push ("simple split %d '%s'", i, simple_tests[i].word);
tmp = camel_search_words_split (simple_tests[i].word);
check (tmp != NULL);
words = camel_search_words_simple (tmp);
check (words != NULL);
- check_msg(words->len == simple_tests[i].count, "words->len = %d, count = %d", words->len, simple_tests[i].count);
+ check_msg (words->len == simple_tests[i].count, "words->len = %d, count = %d", words->len, simple_tests[i].count);
for (j = 0; j < words->len; j++) {
check_msg (strcmp (simple_tests[i].splits[j].word, words->words[j]->word) == 0,
diff --git a/camel/tests/misc/test1.c b/camel/tests/misc/test1.c
index 2812a54..1ba8eba 100644
--- a/camel/tests/misc/test1.c
+++ b/camel/tests/misc/test1.c
@@ -32,20 +32,20 @@ main (gint argc,
camel_test_init (argc, argv);
- camel_test_start("references decoding");
+ camel_test_start ("references decoding");
for (i = 0; i < G_N_ELEMENTS (test1); i++) {
struct _camel_header_references *head, *node;
- camel_test_push("references decoding[%d] '%s'", i, test1[i].header);
+ camel_test_push ("references decoding[%d] '%s'", i, test1[i].header);
head = camel_header_references_decode (test1[i].header);
node = head;
for (j = 0; test1[i].values[j]; j++) {
- check_msg(node != NULL, "didn't find all references");
+ check_msg (node != NULL, "didn't find all references");
check (strcmp (test1[i].values[j], node->id) == 0);
node = node->next;
}
- check_msg(node == NULL, "found more references than should have");
+ check_msg (node == NULL, "found more references than should have");
camel_header_references_list_clear (&head);
camel_test_pull ();
}
diff --git a/camel/tests/misc/test2.c b/camel/tests/misc/test2.c
index 8c274be..4ae4797 100644
--- a/camel/tests/misc/test2.c
+++ b/camel/tests/misc/test2.c
@@ -69,35 +69,35 @@ main (gint argc,
camel_test_init (argc, argv);
- camel_test_start("Param list decoding");
+ camel_test_start ("Param list decoding");
for (i = 0; i < G_N_ELEMENTS (test1); i++) {
struct _camel_header_param *head, *node;
- camel_test_push("param decoding[%d] '%s'", i, test1[i].list);
+ camel_test_push ("param decoding[%d] '%s'", i, test1[i].list);
head = camel_header_param_list_decode (test1[i].list);
check (head != NULL);
node = head;
for (j = 0; j < test1[i].count; j++) {
- check_msg(node != NULL, "didn't find all params");
+ check_msg (node != NULL, "didn't find all params");
check (strcmp (node->name, test1[i].params[j * 2]) == 0);
check (strcmp (node->value, test1[i].params[j * 2 + 1]) == 0);
node = node->next;
}
- check_msg(node == NULL, "found more params than should have");
+ check_msg (node == NULL, "found more params than should have");
camel_header_param_list_free (head);
camel_test_pull ();
}
camel_test_end ();
- camel_test_start("Param list encoding");
+ camel_test_start ("Param list encoding");
for (i = 0; i < G_N_ELEMENTS (test2); i++) {
struct _camel_header_param *head = NULL, *scan;
gchar *text;
- camel_test_push("param encoding[%d]", i);
+ camel_test_push ("param encoding[%d]", i);
for (j = 0; j < test2[i].count; j++)
camel_header_set_param (&head, test2[i].params[j * 2], test2[i].params[j * 2 + 1]);
diff --git a/libebackend/e-authentication-session.c b/libebackend/e-authentication-session.c
index 75b3f77..1336ad8 100644
--- a/libebackend/e-authentication-session.c
+++ b/libebackend/e-authentication-session.c
@@ -616,8 +616,13 @@ exit:
switch (session_result) {
case E_AUTHENTICATION_SESSION_ERROR:
- authentication_session_msg (
- session, "Complete (ERROR - %s)", error && *error ? (*error)->message : "Uknown/Unset error");
+ if (error != NULL && *error != NULL)
+ authentication_session_msg (
+ session, "Complete (ERROR - %s)",
+ (*error)->message);
+ else
+ authentication_session_msg (
+ session, "Complete (ERROR)");
break;
case E_AUTHENTICATION_SESSION_SUCCESS:
authentication_session_msg (
diff --git a/libebackend/e-collection-backend.c b/libebackend/e-collection-backend.c
index 433ccf5..e6a280c 100644
--- a/libebackend/e-collection-backend.c
+++ b/libebackend/e-collection-backend.c
@@ -967,7 +967,8 @@ e_collection_backend_new_child (ECollectionBackend *backend,
collection_source = e_backend_get_source (E_BACKEND (backend));
- g_print ("%s: Pairing %s with resource %s\n",
+ g_print (
+ "%s: Pairing %s with resource %s\n",
e_source_get_display_name (collection_source),
e_source_get_uid (child_source), resource_id);
diff --git a/libebackend/e-extension.c b/libebackend/e-extension.c
index 18dddf2..559c18f 100644
--- a/libebackend/e-extension.c
+++ b/libebackend/e-extension.c
@@ -76,7 +76,8 @@ extension_set_extensible (EExtension *extension,
/* Verify the EExtensible object is the type we want. */
if (!g_type_is_a (extensible_type, class->extensible_type)) {
- g_warning ("%s is meant to extend %s but was given an %s",
+ g_warning (
+ "%s is meant to extend %s but was given an %s",
G_OBJECT_TYPE_NAME (extension),
g_type_name (class->extensible_type),
g_type_name (extensible_type));
diff --git a/libebackend/e-server-side-source.c b/libebackend/e-server-side-source.c
index 553c9d6..893d925 100644
--- a/libebackend/e-server-side-source.c
+++ b/libebackend/e-server-side-source.c
@@ -943,7 +943,7 @@ server_side_source_remote_create_sync (ESource *source,
error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Data source '%s' does not "
- "support creating remote resources"),
+ "support creating remote resources"),
e_source_get_display_name (source));
return FALSE;
}
@@ -957,7 +957,7 @@ server_side_source_remote_create_sync (ESource *source,
error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Data source '%s' has no collection "
- "backend to create the remote resource"),
+ "backend to create the remote resource"),
e_source_get_display_name (source));
return FALSE;
}
@@ -985,7 +985,7 @@ server_side_source_remote_delete_sync (ESource *source,
error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Data source '%s' does not "
- "support deleting remote resources"),
+ "support deleting remote resources"),
e_source_get_display_name (source));
return FALSE;
}
@@ -999,7 +999,7 @@ server_side_source_remote_delete_sync (ESource *source,
error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Data source '%s' has no collection "
- "backend to delete the remote resource"),
+ "backend to delete the remote resource"),
e_source_get_display_name (source));
return FALSE;
}
diff --git a/libedataserver/e-categories.c b/libedataserver/e-categories.c
index 07e1c6c..d944d02 100644
--- a/libedataserver/e-categories.c
+++ b/libedataserver/e-categories.c
@@ -96,14 +96,14 @@ static guint changed_listener_signals[LAST_SIGNAL];
static void
e_changed_listener_class_init (EChangedListenerClass *class)
{
- changed_listener_signals[CHANGED] =
- g_signal_new ("changed",
- G_TYPE_FROM_CLASS (class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EChangedListenerClass, changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
+ changed_listener_signals[CHANGED] = g_signal_new (
+ "changed",
+ G_TYPE_FROM_CLASS (class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (EChangedListenerClass, changed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
}
static void
@@ -230,7 +230,7 @@ idle_saver_cb (gpointer user_data)
filename = build_categories_filename ();
- d(g_debug ("Saving categories to \"%s\"", filename));
+ d (g_debug ("Saving categories to \"%s\"", filename));
/* Build the file contents. */
buffer = g_string_new ("<categories>\n");
@@ -391,7 +391,7 @@ load_categories (void)
if (!g_file_test (filename, G_FILE_TEST_EXISTS))
goto exit;
- d(g_debug ("Loading categories from \"%s\"", filename));
+ d (g_debug ("Loading categories from \"%s\"", filename));
if (!g_file_get_contents (filename, &contents, &length, &error)) {
g_warning ("Unable to load categories: %s", error->message);
@@ -475,13 +475,13 @@ initialize_categories (void)
n_added = load_categories ();
if (n_added > 0) {
- d(g_debug ("Loaded %d categories", n_added));
+ d (g_debug ("Loaded %d categories", n_added));
save_is_pending = FALSE;
return;
}
load_default_categories ();
- d(g_debug ("Loaded default categories"));
+ d (g_debug ("Loaded default categories"));
save_categories ();
}
diff --git a/libedataserver/e-data-server-util.c b/libedataserver/e-data-server-util.c
index 3aca9e8..ff3c261 100644
--- a/libedataserver/e-data-server-util.c
+++ b/libedataserver/e-data-server-util.c
@@ -755,7 +755,8 @@ e_filename_make_safe (gchar *string)
* achieve, and whether it does that as currently
* written?
*/
- if (!g_unichar_isprint (c) || ( c < 0xff && strchr (unsafe_chars, c&0xff ))) {
+ if (!g_unichar_isprint (c) ||
+ (c < 0xff && strchr (unsafe_chars, c & 0xff))) {
while (ts < p)
*ts++ = '_';
}
@@ -932,10 +933,12 @@ e_util_copy_object_slist (GSList *copy_to,
GSList *objects_copy = NULL;
/* Make deep copy of objects */
for (iter = objects; iter; iter = iter->next)
- objects_copy = g_slist_prepend (objects_copy, g_object_ref (iter->data));
+ objects_copy = g_slist_prepend (
+ objects_copy, g_object_ref (iter->data));
/* Concatenate the two lists */
- return g_slist_concat (copy_to, g_slist_reverse (objects_copy));
+ return g_slist_concat (
+ copy_to, g_slist_reverse (objects_copy));
}
return copy_to;
@@ -1420,15 +1423,17 @@ e_util_replace_prefix (const gchar *configure_time_prefix,
const gchar *runtime_prefix,
const gchar *configure_time_path)
{
- gchar *c_t_prefix_slash = g_strconcat (configure_time_prefix, "/",
- NULL);
+ gchar *c_t_prefix_slash;
gchar *retval;
+ c_t_prefix_slash = g_strconcat (configure_time_prefix, "/", NULL);
+
if (runtime_prefix &&
g_str_has_prefix (configure_time_path, c_t_prefix_slash)) {
- retval = g_strconcat (runtime_prefix,
- configure_time_path + strlen (configure_time_prefix),
- NULL);
+ retval = g_strconcat (
+ runtime_prefix,
+ configure_time_path + strlen (configure_time_prefix),
+ NULL);
} else
retval = g_strdup (configure_time_path);
diff --git a/libedataserver/e-debug-log.c b/libedataserver/e-debug-log.c
index a719c78..f4cc9f4 100644
--- a/libedataserver/e-debug-log.c
+++ b/libedataserver/e-debug-log.c
@@ -171,17 +171,17 @@ e_debug_logv (gboolean is_milestone,
tm = *localtime (&tv.tv_sec);
- debug_str = g_strdup_printf ("%p;%04d/%02d/%02d;%02d:%02d:%02d.%04d;(%s);%s",
- g_thread_self (),
- tm.tm_year + 1900,
- tm.tm_mon + 1,
- tm.tm_mday,
- tm.tm_hour,
- tm.tm_min,
- tm.tm_sec,
- (gint) (tv.tv_usec / 100),
- domain,
- str);
+ debug_str = g_strdup_printf (
+ "%p;%04d/%02d/%02d;%02d:%02d:%02d.%04d;(%s);%s",
+ g_thread_self (),
+ tm.tm_year + 1900,
+ tm.tm_mon + 1,
+ tm.tm_mday,
+ tm.tm_hour,
+ tm.tm_min,
+ tm.tm_sec,
+ (gint) (tv.tv_usec / 100),
+ domain, str);
g_free (str);
add_to_ring (debug_str);
@@ -212,7 +212,8 @@ e_debug_log_load_configuration (const gchar *filename,
key_file = g_key_file_new ();
- if (!g_key_file_load_from_file (key_file, filename, G_KEY_FILE_NONE, error)) {
+ if (!g_key_file_load_from_file (
+ key_file, filename, G_KEY_FILE_NONE, error)) {
g_key_file_free (key_file);
return FALSE;
}
@@ -220,7 +221,9 @@ e_debug_log_load_configuration (const gchar *filename,
/* Domains */
my_error = NULL;
- strings = g_key_file_get_string_list (key_file, KEY_FILE_GROUP, KEY_FILE_DOMAINS_KEY, &num_strings, &my_error);
+ strings = g_key_file_get_string_list (
+ key_file, KEY_FILE_GROUP,
+ KEY_FILE_DOMAINS_KEY, &num_strings, &my_error);
if (my_error)
g_error_free (my_error);
else {
@@ -229,14 +232,17 @@ e_debug_log_load_configuration (const gchar *filename,
for (i = 0; i < num_strings; i++)
strings[i] = g_strstrip (strings[i]);
- e_debug_log_enable_domains ((const gchar **) strings, num_strings);
+ e_debug_log_enable_domains (
+ (const gchar **) strings, num_strings);
g_strfreev (strings);
}
/* Number of lines */
my_error = NULL;
- num = g_key_file_get_integer (key_file, KEY_FILE_GROUP, KEY_FILE_MAX_LINES_KEY, &my_error);
+ num = g_key_file_get_integer (
+ key_file, KEY_FILE_GROUP,
+ KEY_FILE_MAX_LINES_KEY, &my_error);
if (my_error)
g_error_free (my_error);
else
@@ -374,18 +380,27 @@ make_key_file_from_configuration (void)
closure.domains = g_new (gchar *, num_domains);
closure.num_domains = 0;
- g_hash_table_foreach (domains_hash, domains_foreach_dump_cb, &closure);
+ g_hash_table_foreach (
+ domains_hash,
+ domains_foreach_dump_cb,
+ &closure);
g_assert (num_domains == closure.num_domains);
- g_key_file_set_string_list (key_file, KEY_FILE_GROUP, KEY_FILE_DOMAINS_KEY,
- (const gchar * const *) closure.domains, closure.num_domains);
+ g_key_file_set_string_list (
+ key_file,
+ KEY_FILE_GROUP,
+ KEY_FILE_DOMAINS_KEY,
+ (const gchar * const *) closure.domains,
+ closure.num_domains);
g_free (closure.domains);
}
}
/* max lines */
- g_key_file_set_integer (key_file, KEY_FILE_GROUP, KEY_FILE_MAX_LINES_KEY, ring_buffer_max_lines);
+ g_key_file_set_integer (
+ key_file, KEY_FILE_GROUP,
+ KEY_FILE_MAX_LINES_KEY, ring_buffer_max_lines);
return key_file;
}
@@ -400,10 +415,11 @@ write_string (const gchar *filename,
gint saved_errno;
saved_errno = errno;
- g_set_error (error,
- G_FILE_ERROR,
- g_file_error_from_errno (saved_errno),
- "error when writing to log file %s", filename);
+ g_set_error (
+ error,
+ G_FILE_ERROR,
+ g_file_error_from_errno (saved_errno),
+ "error when writing to log file %s", filename);
return FALSE;
}
@@ -421,12 +437,12 @@ dump_configuration (const gchar *filename,
gsize length;
gboolean success;
- if (!write_string (filename, file,
- "\n\n"
- "This configuration for the debug log can be re-created\n"
- "by putting the following in ~/evolution-data-server-debug-log.conf\n"
- "(use ';' to separate domain names):\n\n",
- error)) {
+ if (!write_string (
+ filename, file,
+ "\n\n"
+ "This configuration for the debug log can be re-created\n"
+ "by putting the following in ~/evolution-data-server-debug-log.conf\n"
+ "(use ';' to separate domain names):\n\n", error)) {
return FALSE;
}
@@ -529,10 +545,11 @@ e_debug_log_dump (const gchar *filename,
gint saved_errno;
saved_errno = errno;
- g_set_error (error,
- G_FILE_ERROR,
- g_file_error_from_errno (saved_errno),
- "could not open log file %s", filename);
+ g_set_error (
+ error,
+ G_FILE_ERROR,
+ g_file_error_from_errno (saved_errno),
+ "could not open log file %s", filename);
goto out;
}
@@ -556,10 +573,11 @@ e_debug_log_dump (const gchar *filename,
*error = NULL;
}
- g_set_error (error,
- G_FILE_ERROR,
- g_file_error_from_errno (saved_errno),
- "error when closing log file %s", filename);
+ g_set_error (
+ error,
+ G_FILE_ERROR,
+ g_file_error_from_errno (saved_errno),
+ "error when closing log file %s", filename);
success = FALSE;
}
@@ -588,13 +606,14 @@ e_debug_log_dump_to_dated_file (GError **error)
t = time (NULL);
tm = *localtime (&t);
- basename = g_strdup_printf ("e-debug-log-%04d-%02d-%02d-%02d-%02d-%02d.txt",
- tm.tm_year + 1900,
- tm.tm_mon + 1,
- tm.tm_mday,
- tm.tm_hour,
- tm.tm_min,
- tm.tm_sec);
+ basename = g_strdup_printf (
+ "e-debug-log-%04d-%02d-%02d-%02d-%02d-%02d.txt",
+ tm.tm_year + 1900,
+ tm.tm_mon + 1,
+ tm.tm_mday,
+ tm.tm_hour,
+ tm.tm_min,
+ tm.tm_sec);
filename = g_build_filename (g_get_home_dir (), basename, NULL);
retval = e_debug_log_dump (filename, error);
@@ -632,7 +651,10 @@ e_debug_log_set_max_lines (gint num_lines)
gint i;
if (ring_buffer_num_lines == ring_buffer_max_lines)
- start_index = (ring_buffer_next_index + ring_buffer_max_lines - lines_to_copy) % ring_buffer_max_lines;
+ start_index =
+ (ring_buffer_next_index +
+ ring_buffer_max_lines - lines_to_copy) %
+ ring_buffer_max_lines;
else
start_index = ring_buffer_num_lines - lines_to_copy;
diff --git a/libedataserver/e-iterator.c b/libedataserver/e-iterator.c
index ffec27e..f2f04d7 100644
--- a/libedataserver/e-iterator.c
+++ b/libedataserver/e-iterator.c
@@ -26,14 +26,14 @@ e_iterator_class_init (EIteratorClass *class)
object_class = G_OBJECT_CLASS (class);
- e_iterator_signals[INVALIDATE] =
- g_signal_new ("invalidate",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EIteratorClass, invalidate),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
+ e_iterator_signals[INVALIDATE] = g_signal_new (
+ "invalidate",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EIteratorClass, invalidate),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
}
/**
diff --git a/libedataserver/e-memory.c b/libedataserver/e-memory.c
index c956539..05d8fd8 100644
--- a/libedataserver/e-memory.c
+++ b/libedataserver/e-memory.c
@@ -35,7 +35,7 @@ struct timeval timeit_start;
static time_start (const gchar *desc)
{
gettimeofday (&timeit_start, NULL);
- printf("starting: %s\n", desc);
+ printf ("starting: %s\n", desc);
}
static time_end (const gchar *desc)
@@ -46,8 +46,9 @@ static time_end (const gchar *desc)
gettimeofday (&end, NULL);
diff = end.tv_sec * 1000 + end.tv_usec / 1000;
diff -= timeit_start.tv_sec * 1000 + timeit_start.tv_usec / 1000;
- printf("%s took %ld.%03ld seconds\n",
- desc, diff / 1000, diff % 1000);
+ printf (
+ "%s took %ld.%03ld seconds\n",
+ desc, diff / 1000, diff % 1000);
}
#else
#define time_start(x)
@@ -257,7 +258,8 @@ e_memchunk_clean (EMemChunk *memchunk)
if (memchunk->blocks->len == 0 || f == NULL)
return;
- /* first, setup the tree/list so we can map free block addresses to block addresses */
+ /* first, setup the tree/list so we can map
+ * free block addresses to block addresses */
tree = g_tree_new ((GCompareFunc) tree_compare);
for (i = 0; i < memchunk->blocks->len; i++) {
ci = alloca (sizeof (*ci));
@@ -275,7 +277,7 @@ e_memchunk_clean (EMemChunk *memchunk)
if (ci) {
ci->count += f->atoms;
} else {
- g_warning("error, can't find free node in memory block\n");
+ g_warning ("error, can't find free node in memory block\n");
}
f = f->next;
}
@@ -348,45 +350,45 @@ main ()
struct _EStrv *s;
s = strv_new (8);
- s = strv_set(s, 1, "Testing 1");
- s = strv_set(s, 2, "Testing 2");
- s = strv_set(s, 3, "Testing 3");
- s = strv_set(s, 4, "Testing 4");
- s = strv_set(s, 5, "Testing 5");
- s = strv_set(s, 6, "Testing 7");
+ s = strv_set (s, 1, "Testing 1");
+ s = strv_set (s, 2, "Testing 2");
+ s = strv_set (s, 3, "Testing 3");
+ s = strv_set (s, 4, "Testing 4");
+ s = strv_set (s, 5, "Testing 5");
+ s = strv_set (s, 6, "Testing 7");
for (i = 0; i < 8; i++) {
- printf("s[%d] = %s\n", i, strv_get(s, i));
+ printf ("s[%d] = %s\n", i, strv_get (s, i));
}
s (sleep (5));
- printf("packing ...\n");
+ printf ("packing ...\n");
s = strv_pack (s);
for (i = 0; i < 8; i++) {
- printf("s[%d] = %s\n", i, strv_get(s, i));
+ printf ("s[%d] = %s\n", i, strv_get (s, i));
}
- printf("setting ...\n");
+ printf ("setting ...\n");
- s = strv_set_ref(s, 1, "Testing 1 x");
+ s = strv_set_ref (s, 1, "Testing 1 x");
for (i = 0; i < 8; i++) {
- printf("s[%d] = %s\n", i, strv_get(s, i));
+ printf ("s[%d] = %s\n", i, strv_get (s, i));
}
- printf("packing ...\n");
+ printf ("packing ...\n");
s = strv_pack (s);
for (i = 0; i < 8; i++) {
- printf("s[%d] = %s\n", i, strv_get(s, i));
+ printf ("s[%d] = %s\n", i, strv_get (s, i));
}
strv_free (s);
#if 0
- time_start("Using memchunks");
+ time_start ("Using memchunks");
mc = memchunk_new (CHUNK_COUNT, CHUNK_SIZE);
for (i = 0; i < 1000000; i++) {
mem = memchunk_alloc (mc);
@@ -395,10 +397,13 @@ main ()
}
s (sleep (10));
memchunk_destroy (mc);
- time_end("allocating 1000000 memchunks, freeing 500k");
+ time_end ("allocating 1000000 memchunks, freeing 500k");
- time_start("Using gmemchunks");
- gmc = g_mem_chunk_new("memchunk", CHUNK_SIZE, CHUNK_SIZE*CHUNK_COUNT, G_ALLOC_AND_FREE);
+ time_start ("Using gmemchunks");
+ gmc = g_mem_chunk_new (
+ "memchunk", CHUNK_SIZE,
+ CHUNK_SIZE * CHUNK_COUNT,
+ G_ALLOC_AND_FREE);
for (i = 0; i < 1000000; i++) {
mem = g_mem_chunk_alloc (gmc);
if ((i & 1) == 0)
@@ -406,31 +411,34 @@ main ()
}
s (sleep (10));
g_mem_chunk_destroy (gmc);
- time_end("allocating 1000000 gmemchunks, freeing 500k");
+ time_end ("allocating 1000000 gmemchunks, freeing 500k");
- time_start("Using memchunks");
+ time_start ("Using memchunks");
mc = memchunk_new (CHUNK_COUNT, CHUNK_SIZE);
for (i = 0; i < 1000000; i++) {
mem = memchunk_alloc (mc);
}
s (sleep (10));
memchunk_destroy (mc);
- time_end("allocating 1000000 memchunks");
+ time_end ("allocating 1000000 memchunks");
- time_start("Using gmemchunks");
- gmc = g_mem_chunk_new("memchunk", CHUNK_SIZE, CHUNK_COUNT*CHUNK_SIZE, G_ALLOC_ONLY);
+ time_start ("Using gmemchunks");
+ gmc = g_mem_chunk_new (
+ "memchunk", CHUNK_SIZE,
+ CHUNK_COUNT * CHUNK_SIZE,
+ G_ALLOC_ONLY);
for (i = 0; i < 1000000; i++) {
mem = g_mem_chunk_alloc (gmc);
}
s (sleep (10));
g_mem_chunk_destroy (gmc);
- time_end("allocating 1000000 gmemchunks");
+ time_end ("allocating 1000000 gmemchunks");
- time_start("Using malloc");
+ time_start ("Using malloc");
for (i = 0; i < 1000000; i++) {
malloc (CHUNK_SIZE);
}
- time_end("allocating 1000000 malloc");
+ time_end ("allocating 1000000 malloc");
#endif
}
diff --git a/libedataserver/e-proxy.c b/libedataserver/e-proxy.c
index b949790..39d6b77 100644
--- a/libedataserver/e-proxy.c
+++ b/libedataserver/e-proxy.c
@@ -364,10 +364,8 @@ ep_need_proxy_http (EProxy *proxy,
if (p_addr->type == PROXY_IPV4) {
addr_in = ((struct in_addr *) p_addr->addr);
mask = ((struct in_addr *) p_addr->mask);
- d(g_print ("ep_need_proxy:ipv4: in: %ul\t mask: %ul\t addr: %ul\n",
- in.s_addr, mask->s_addr, addr_in->s_addr));
if ((in.s_addr & mask->s_addr) == addr_in->s_addr) {
- d(g_print ("Host [%s] doesn't require proxy\n", host));
+ d (g_print ("Host [%s] doesn't require proxy\n", host));
g_object_unref (addr);
return FALSE;
}
@@ -383,7 +381,7 @@ ep_need_proxy_http (EProxy *proxy,
ipv6_network_addr (&in6, (struct in6_addr *) p_addr->mask, &net6);
if (p_addr->type == PROXY_IPV6) {
if (IN6_ARE_ADDR_EQUAL (&net6, (struct in6_addr *) p_addr->addr)) {
- d(g_print ("Host [%s] doesn't require proxy\n", host));
+ d (g_print ("Host [%s] doesn't require proxy\n", host));
g_object_unref (addr);
return FALSE;
}
@@ -399,7 +397,7 @@ ep_need_proxy_http (EProxy *proxy,
| net6.s6_addr[14] << 8
| net6.s6_addr[15];
if ((v4addr & mask->s_addr) != addr_in->s_addr) {
- d(g_print ("Host [%s] doesn't require proxy\n", host));
+ d (g_print ("Host [%s] doesn't require proxy\n", host));
g_object_unref (addr);
return FALSE;
}
@@ -408,7 +406,7 @@ ep_need_proxy_http (EProxy *proxy,
}
}
- d(g_print ("%s needs a proxy to connect to internet\n", host));
+ d (g_print ("%s needs a proxy to connect to internet\n", host));
g_object_unref (addr);
return TRUE;
@@ -459,9 +457,6 @@ ep_manipulate_ipv4 (ProxyHostAddr *host_addr,
mask->s_addr = 0xFFFFFFFF;
}
- d(g_print ("ep_manipulate_ipv4: addr_in: %ul, addr: %ul, mask: %ul\n",
- addr_in->s_addr, addr->s_addr, mask->s_addr));
-
host_addr->addr = addr;
host_addr->mask = mask;
@@ -569,22 +564,26 @@ ep_parse_ignore_host (gpointer data,
goto error;
if (so_addr->sa_family == AF_INET)
- has_error = ep_manipulate_ipv4 (host_addr,
- &((struct sockaddr_in *) so_addr)->sin_addr,
- netmask);
+ has_error = ep_manipulate_ipv4 (
+ host_addr,
+ &((struct sockaddr_in *) so_addr)->sin_addr,
+ netmask);
else
- has_error = ep_manipulate_ipv6 (host_addr,
- &((struct sockaddr_in6 *) so_addr)->sin6_addr,
- netmask);
+ has_error = ep_manipulate_ipv6 (
+ host_addr,
+ &((struct sockaddr_in6 *) so_addr)->sin6_addr,
+ netmask);
if (!has_error) {
- priv->ign_addrs = g_slist_append (priv->ign_addrs, host_addr);
- priv->ign_hosts = g_slist_append (priv->ign_hosts, hostname);
+ priv->ign_addrs = g_slist_append (
+ priv->ign_addrs, host_addr);
+ priv->ign_hosts = g_slist_append (
+ priv->ign_hosts, hostname);
} else {
g_free (hostname);
}
} else {
- d(g_print ("Unable to resolve %s\n", hostname));
+ d (g_print ("Unable to resolve %s\n", hostname));
priv->ign_hosts = g_slist_append (priv->ign_hosts, hostname);
}
error:
@@ -653,7 +652,8 @@ update_proxy_uri (const gchar *uri,
/* here can be only http or https and nothing else */
is_https = g_str_has_prefix (uri, "https://");
- res = g_strdup_printf ("%s://%s%s%s %s",
+ res = g_strdup_printf (
+ "%s://%s%s%s %s",
is_https ? "https" : "http",
user,
pw ? ":" : "",
@@ -709,7 +709,7 @@ ep_set_proxy (EProxy *proxy,
} else
uri_http = NULL;
g_free (proxy_server);
- d(g_print ("ep_set_proxy: uri_http: %s\n", uri_http));
+ d (g_print ("ep_set_proxy: uri_http: %s\n", uri_http));
proxy_server = ep_read_key_string (proxy, E_PROXY_KEY_HTTPS_HOST);
proxy_port = ep_read_key_int (proxy, E_PROXY_KEY_HTTPS_PORT);
@@ -721,7 +721,7 @@ ep_set_proxy (EProxy *proxy,
} else
uri_https = NULL;
g_free (proxy_server);
- d(g_print ("ep_set_proxy: uri_https: %s\n", uri_https));
+ d (g_print ("ep_set_proxy: uri_https: %s\n", uri_https));
proxy_server = ep_read_key_string (proxy, E_PROXY_KEY_SOCKS_HOST);
proxy_port = ep_read_key_int (proxy, E_PROXY_KEY_SOCKS_PORT);
@@ -733,7 +733,7 @@ ep_set_proxy (EProxy *proxy,
} else
uri_socks = NULL;
g_free (proxy_server);
- d(g_print ("ep_set_proxy: uri_socks: %s\n", uri_socks));
+ d (g_print ("ep_set_proxy: uri_socks: %s\n", uri_socks));
if (regen_ign_host_list) {
if (priv->ign_hosts) {
@@ -783,7 +783,7 @@ ep_set_proxy (EProxy *proxy,
changed = ep_change_uri (&priv->uri_socks, uri_socks) || changed;
emit_signal:
- d(g_print ("%s: changed:%d uri_http: %s; uri_https: %s; uri_socks: %s\n", G_STRFUNC, changed ? 1 : 0, uri_http ? uri_http : "[null]", uri_https ? uri_https : "[null]", uri_socks ? uri_socks : "[null]"));
+ d (g_print ("%s: changed:%d uri_http: %s; uri_https: %s; uri_socks: %s\n", G_STRFUNC, changed ? 1 : 0, uri_http ? uri_http : "[null]", uri_https ? uri_https : "[null]", uri_socks ? uri_socks : "[null]"));
if (changed)
g_signal_emit (proxy, signals[CHANGED], 0);
@@ -803,7 +803,7 @@ ep_evo_proxy_changed_cb (GSettings *settings,
priv = proxy->priv;
- d(g_print ("%s: proxy settings changed, key '%s'\n", G_STRFUNC, key ? key : "NULL"));
+ d (g_print ("%s: proxy settings changed, key '%s'\n", G_STRFUNC, key ? key : "NULL"));
if (g_strcmp0 (key, "proxy-type") == 0) {
ep_set_proxy (proxy, TRUE);
} else if (priv->type == PROXY_TYPE_SYSTEM) {
@@ -1047,7 +1047,7 @@ e_proxy_require_proxy_for_uri (EProxy *proxy,
g_return_val_if_fail (uri != NULL, FALSE);
if (!proxy->priv->use_proxy || proxy->priv->type == PROXY_TYPE_NO_PROXY) {
- d(g_print ("[%s] don't need a proxy to connect to internet\n", uri));
+ d (g_print ("[%s] don't need a proxy to connect to internet\n", uri));
return FALSE;
}
diff --git a/libedataserver/e-sexp.c b/libedataserver/e-sexp.c
index ae807fc..0e057a9 100644
--- a/libedataserver/e-sexp.c
+++ b/libedataserver/e-sexp.c
@@ -102,15 +102,23 @@
G_DEFINE_TYPE (ESExp, e_sexp, G_TYPE_OBJECT)
#endif
-static struct _ESExpTerm * parse_list (ESExp *f, gint gotbrace);
-static struct _ESExpTerm * parse_value (ESExp *f);
+static struct _ESExpTerm *
+ parse_list (ESExp *f,
+ gint gotbrace);
+static struct _ESExpTerm *
+ parse_value (ESExp *f);
#ifdef TESTER
-static void parse_dump_term (struct _ESExpTerm *t, gint depth);
+static void parse_dump_term (struct _ESExpTerm *t,
+ gint depth);
#endif
-typedef gboolean (ESGeneratorFunc) (gint argc, struct _ESExpResult **argv, struct _ESExpResult *r);
-typedef gboolean (ESOperatorFunc) (gint argc, struct _ESExpResult **argv, struct _ESExpResult *r);
+typedef gboolean (ESGeneratorFunc) (gint argc,
+ struct _ESExpResult **argv,
+ struct _ESExpResult *r);
+typedef gboolean (ESOperatorFunc) (gint argc,
+ struct _ESExpResult **argv,
+ struct _ESExpResult *r);
/* FIXME: constant _TIME_MAX used in different files, move it somewhere */
#define _TIME_MAX ((time_t) INT_MAX) /* Max valid time_t */
@@ -269,7 +277,7 @@ term_eval_and (struct _ESExp *f,
gint i;
const gchar *oper;
- r(printf("( and\n"));
+ r (printf ("( and\n"));
r = e_sexp_result_new (f, ESEXP_RES_UNDEFINED);
@@ -284,7 +292,7 @@ term_eval_and (struct _ESExp *f,
e_sexp_result_free (f, r);
e_sexp_result_free (f, r1);
g_hash_table_destroy (ht);
- e_sexp_fatal_error(f, "Invalid types in AND");
+ e_sexp_fatal_error (f, "Invalid types in AND");
} else if (r1->type == ESEXP_RES_ARRAY_PTR) {
gchar **a1;
gint l1, j;
@@ -335,7 +343,7 @@ term_eval_or (struct _ESExp *f,
gint i;
const gchar *oper;
- r(printf("(or \n"));
+ r (printf ("(or \n"));
oper = "OR";
f->operators = g_slist_prepend (f->operators, (gpointer) oper);
@@ -350,7 +358,7 @@ term_eval_or (struct _ESExp *f,
e_sexp_result_free (f, r);
e_sexp_result_free (f, r1);
g_hash_table_destroy (ht);
- e_sexp_fatal_error(f, "Invalid types in OR");
+ e_sexp_fatal_error (f, "Invalid types in OR");
} else if (r1->type == ESEXP_RES_ARRAY_PTR) {
gchar **a1;
gint l1, j;
@@ -419,7 +427,7 @@ term_eval_lt (struct _ESExp *f,
e_sexp_result_free (f, r1);
e_sexp_result_free (f, r2);
e_sexp_result_free (f, r);
- e_sexp_fatal_error(f, "Incompatible types in compare <");
+ e_sexp_fatal_error (f, "Incompatible types in compare <");
} else if (r1->type == ESEXP_RES_INT) {
r->type = ESEXP_RES_BOOL;
r->value.boolean = r1->value.number < r2->value.number;
@@ -454,7 +462,7 @@ term_eval_gt (struct _ESExp *f,
e_sexp_result_free (f, r1);
e_sexp_result_free (f, r2);
e_sexp_result_free (f, r);
- e_sexp_fatal_error(f, "Incompatible types in compare >");
+ e_sexp_fatal_error (f, "Incompatible types in compare >");
} else if (r1->type == ESEXP_RES_INT) {
r->type = ESEXP_RES_BOOL;
r->value.boolean = r1->value.number > r2->value.number;
@@ -522,7 +530,7 @@ term_eval_plus (struct _ESExp *f,
}
if (i < argc) {
e_sexp_resultv_free (f, argc, argv);
- e_sexp_fatal_error(f, "Invalid types in (+ ints)");
+ e_sexp_fatal_error (f, "Invalid types in (+ ints)");
}
r = e_sexp_result_new (f, ESEXP_RES_INT);
r->value.number = total;
@@ -534,7 +542,7 @@ term_eval_plus (struct _ESExp *f,
}
if (i < argc) {
e_sexp_resultv_free (f, argc, argv);
- e_sexp_fatal_error(f, "Invalid types in (+ strings)");
+ e_sexp_fatal_error (f, "Invalid types in (+ strings)");
}
r = e_sexp_result_new (f, ESEXP_RES_STRING);
r->value.string = s->str;
@@ -586,7 +594,7 @@ term_eval_sub (struct _ESExp *f,
}
if (i < argc) {
e_sexp_resultv_free (f, argc, argv);
- e_sexp_fatal_error(f, "Invalid types in -");
+ e_sexp_fatal_error (f, "Invalid types in -");
}
r = e_sexp_result_new (f, ESEXP_RES_INT);
r->value.number = total;
@@ -627,7 +635,7 @@ term_eval_castint (struct _ESExp *f,
struct _ESExpResult *r;
if (argc != 1)
- e_sexp_fatal_error(f, "Incorrect argument count to (gint )");
+ e_sexp_fatal_error (f, "Incorrect argument count to (gint )");
r = e_sexp_result_new (f, ESEXP_RES_INT);
switch (argv[0]->type) {
@@ -642,7 +650,7 @@ term_eval_castint (struct _ESExp *f,
break;
default:
e_sexp_result_free (f, r);
- e_sexp_fatal_error(f, "Invalid type in (cast-int )");
+ e_sexp_fatal_error (f, "Invalid type in (cast-int )");
}
return r;
@@ -658,22 +666,22 @@ term_eval_caststring (struct _ESExp *f,
struct _ESExpResult *r;
if (argc != 1)
- e_sexp_fatal_error(f, "Incorrect argument count to (cast-string )");
+ e_sexp_fatal_error (f, "Incorrect argument count to (cast-string )");
r = e_sexp_result_new (f, ESEXP_RES_STRING);
switch (argv[0]->type) {
case ESEXP_RES_INT:
- r->value.string = g_strdup_printf("%d", argv[0]->value.number);
+ r->value.string = g_strdup_printf ("%d", argv[0]->value.number);
break;
case ESEXP_RES_BOOL:
- r->value.string = g_strdup_printf("%d", argv[0]->value.boolean != 0);
+ r->value.string = g_strdup_printf ("%d", argv[0]->value.boolean != 0);
break;
case ESEXP_RES_STRING:
r->value.string = g_strdup (argv[0]->value.string);
break;
default:
e_sexp_result_free (f, r);
- e_sexp_fatal_error(f, "Invalid type in (gint )");
+ e_sexp_fatal_error (f, "Invalid type in (gint )");
}
return r;
@@ -734,34 +742,36 @@ e_sexp_term_eval (struct _ESExp *f,
g_return_val_if_fail (t != NULL, NULL);
- r(printf("eval term :\n"));
+ r (printf ("eval term :\n"));
r (parse_dump_term (t, 0));
switch (t->type) {
case ESEXP_TERM_STRING:
- r(printf(" (string \"%s\")\n", t->value.string));
+ r (printf (" (string \"%s\")\n", t->value.string));
r = e_sexp_result_new (f, ESEXP_RES_STRING);
/* erk, this shoul;dn't need to strdup this ... */
r->value.string = g_strdup (t->value.string);
break;
case ESEXP_TERM_INT:
- r(printf(" (gint %d)\n", t->value.number));
+ r (printf (" (gint %d)\n", t->value.number));
r = e_sexp_result_new (f, ESEXP_RES_INT);
r->value.number = t->value.number;
break;
case ESEXP_TERM_BOOL:
- r(printf(" (gint %d)\n", t->value.number));
+ r (printf (" (gint %d)\n", t->value.number));
r = e_sexp_result_new (f, ESEXP_RES_BOOL);
r->value.boolean = t->value.boolean;
break;
case ESEXP_TERM_TIME:
- r(printf(" (time_t %ld)\n", t->value.time));
+ r (printf (" (time_t %ld)\n", t->value.time));
r = e_sexp_result_new (f, ESEXP_RES_TIME);
r->value.time = t->value.time;
break;
case ESEXP_TERM_IFUNC:
if (t->value.func.sym && t->value.func.sym->f.ifunc)
- r = t->value.func.sym->f.ifunc (f, t->value.func.termcount, t->value.func.terms, t->value.func.sym->data);
+ r = t->value.func.sym->f.ifunc (
+ f, t->value.func.termcount,
+ t->value.func.terms, t->value.func.sym->data);
break;
case ESEXP_TERM_FUNC:
/* first evaluate all arguments to result types */
@@ -771,12 +781,14 @@ e_sexp_term_eval (struct _ESExp *f,
}
/* call the function */
if (t->value.func.sym->f.func)
- r = t->value.func.sym->f.func (f, t->value.func.termcount, argv, t->value.func.sym->data);
+ r = t->value.func.sym->f.func (
+ f, t->value.func.termcount,
+ argv, t->value.func.sym->data);
e_sexp_resultv_free (f, t->value.func.termcount, argv);
break;
default:
- e_sexp_fatal_error(f, "Unknown type in parse tree: %d", t->type);
+ e_sexp_fatal_error (f, "Unknown type in parse tree: %d", t->type);
}
if (r == NULL)
@@ -793,34 +805,34 @@ eval_dump_result (ESExpResult *r,
gint i;
if (r == NULL) {
- printf("null result???\n");
+ printf ("null result???\n");
return;
}
for (i = 0; i < depth; i++)
- printf(" ");
+ printf (" ");
switch (r->type) {
case ESEXP_RES_ARRAY_PTR:
- printf("array pointers\n");
+ printf ("array pointers\n");
break;
case ESEXP_RES_INT:
- printf("int: %d\n", r->value.number);
+ printf ("int: %d\n", r->value.number);
break;
case ESEXP_RES_STRING:
- printf("string: '%s'\n", r->value.string);
+ printf ("string: '%s'\n", r->value.string);
break;
case ESEXP_RES_BOOL:
- printf("bool: %c\n", r->value.boolean?'t':'f');
+ printf ("bool: %c\n", r->value.boolean ? 't':'f');
break;
case ESEXP_RES_TIME:
- printf("time_t: %ld\n", (glong) r->value.time);
+ printf ("time_t: %ld\n", (glong) r->value.time);
break;
case ESEXP_RES_UNDEFINED:
- printf(" <undefined>\n");
+ printf (" <undefined>\n");
break;
}
- printf("\n");
+ printf ("\n");
}
#endif
@@ -832,45 +844,45 @@ parse_dump_term (struct _ESExpTerm *t,
gint i;
if (t == NULL) {
- printf("null term??\n");
+ printf ("null term??\n");
return;
}
for (i = 0; i < depth; i++)
- printf(" ");
+ printf (" ");
switch (t->type) {
case ESEXP_TERM_STRING:
- printf(" \"%s\"", t->value.string);
+ printf (" \"%s\"", t->value.string);
break;
case ESEXP_TERM_INT:
- printf(" %d", t->value.number);
+ printf (" %d", t->value.number);
break;
case ESEXP_TERM_BOOL:
- printf(" #%c", t->value.boolean?'t':'f');
+ printf (" #%c", t->value.boolean ? 't':'f');
break;
case ESEXP_TERM_TIME:
- printf(" %ld", (glong) t->value.time);
+ printf (" %ld", (glong) t->value.time);
break;
case ESEXP_TERM_IFUNC:
case ESEXP_TERM_FUNC:
- printf(" (function %s\n", t->value.func.sym->name);
+ printf (" (function %s\n", t->value.func.sym->name);
/*printf(" [%d] ", t->value.func.termcount);*/
for (i = 0; i < t->value.func.termcount; i++) {
parse_dump_term (t->value.func.terms[i], depth + 1);
}
for (i = 0; i < depth; i++)
- printf(" ");
- printf(" )");
+ printf (" ");
+ printf (" )");
break;
case ESEXP_TERM_VAR:
- printf(" (variable %s )\n", t->value.var->name);
+ printf (" (variable %s )\n", t->value.var->name);
break;
default:
- printf("unknown type: %d\n", t->type);
+ printf ("unknown type: %d\n", t->type);
}
- printf("\n");
+ printf ("\n");
}
#endif
@@ -1089,13 +1101,13 @@ e_sexp_term_evaluate_occur_times (struct _ESExp *f,
g_return_val_if_fail (end != NULL, NULL);
/*
- printf("eval term :\n");
+ printf ("eval term :\n");
parse_dump_term (t, 0);
*/
switch (t->type) {
case ESEXP_TERM_STRING:
- r(printf(" (string \"%s\")\n", t->value.string));
+ r (printf (" (string \"%s\")\n", t->value.string));
r = e_sexp_result_new (f, ESEXP_RES_STRING);
r->value.string = g_strdup (t->value.string);
break;
@@ -1105,15 +1117,15 @@ e_sexp_term_evaluate_occur_times (struct _ESExp *f,
ESGeneratorFunc *generator = NULL;
ESOperatorFunc *operator = NULL;
- r(printf(" (function \"%s\"\n", t->value.func.sym->name));
+ r (printf (" (function \"%s\"\n", t->value.func.sym->name));
r = e_sexp_result_new (f, ESEXP_RES_UNDEFINED);
argc = t->value.func.termcount;
argv = alloca (sizeof (argv[0]) * argc);
for (i = 0; i < t->value.func.termcount; i++) {
- argv[i] = e_sexp_term_evaluate_occur_times (f, t->value.func.terms[i],
- start, end);
+ argv[i] = e_sexp_term_evaluate_occur_times (
+ f, t->value.func.terms[i], start, end);
}
if (is_time_function (t->value.func.sym->name)) {
@@ -1146,7 +1158,7 @@ e_sexp_term_evaluate_occur_times (struct _ESExp *f,
}
if (!ok)
- e_sexp_fatal_error(f, "Error in parse tree");
+ e_sexp_fatal_error (f, "Error in parse tree");
if (r == NULL)
r = e_sexp_result_new (f, ESEXP_RES_UNDEFINED);
@@ -1197,7 +1209,7 @@ parse_term_free (struct _ESExp *f,
break;
default:
- printf("parse_term_free: unknown type: %d\n", t->type);
+ printf ("parse_term_free: unknown type: %d\n", t->type);
}
e_memchunk_free (f->term_chunks, t);
}
@@ -1212,7 +1224,7 @@ parse_values (ESExp *f,
GScanner *gs = f->scanner;
GSList *list = NULL, *l;
- p(printf("parsing values\n"));
+ p (printf ("parsing values\n"));
while ( (token = g_scanner_peek_next_token (gs)) != G_TOKEN_EOF
&& token != ')') {
@@ -1231,10 +1243,10 @@ parse_values (ESExp *f,
}
g_slist_free (list);
- p(printf("found %d subterms\n", size));
+ p (printf ("found %d subterms\n", size));
*len = size;
- p(printf("done parsing values\n"));
+ p (printf ("done parsing values\n"));
return terms;
}
@@ -1257,25 +1269,28 @@ parse_value (ESExp *f)
GScanner *gs = f->scanner;
struct _ESExpSymbol *s;
- p(printf("parsing value\n"));
+ p (printf ("parsing value\n"));
token = g_scanner_get_next_token (gs);
switch (token) {
case G_TOKEN_EOF:
break;
case G_TOKEN_LEFT_PAREN:
- p(printf("got brace, its a list!\n"));
+ p (printf ("got brace, its a list!\n"));
return parse_list (f, TRUE);
case G_TOKEN_STRING:
- p(printf("got string '%s'\n", g_scanner_cur_value(gs).v_string));
+ p (printf (
+ "got string '%s'\n",
+ g_scanner_cur_value (gs).v_string));
t = parse_term_new (f, ESEXP_TERM_STRING);
t->value.string = g_strdup (g_scanner_cur_value (gs).v_string);
break;
case '-':
- p(printf ("got negative int?\n"));
+ p (printf ("got negative int?\n"));
token = g_scanner_get_next_token (gs);
if (token != G_TOKEN_INT) {
- e_sexp_fatal_error (f, "Invalid format for a integer value");
+ e_sexp_fatal_error (
+ f, "Invalid format for a integer value");
return NULL;
}
@@ -1286,15 +1301,16 @@ parse_value (ESExp *f)
t->value.number = g_scanner_cur_value (gs).v_int;
if (negative)
t->value.number = -t->value.number;
- p(printf("got gint %d\n", t->value.number));
+ p (printf ("got gint %d\n", t->value.number));
break;
case '#': {
gchar *str;
- p(printf("got bool?\n"));
+ p (printf ("got bool?\n"));
token = g_scanner_get_next_token (gs);
if (token != G_TOKEN_IDENTIFIER) {
- e_sexp_fatal_error (f, "Invalid format for a boolean value");
+ e_sexp_fatal_error (
+ f, "Invalid format for a boolean value");
return NULL;
}
@@ -1302,7 +1318,8 @@ parse_value (ESExp *f)
g_assert (str != NULL);
if (!(strlen (str) == 1 && (str[0] == 't' || str[0] == 'f'))) {
- e_sexp_fatal_error (f, "Invalid format for a boolean value");
+ e_sexp_fatal_error (
+ f, "Invalid format for a boolean value");
return NULL;
}
@@ -1311,32 +1328,40 @@ parse_value (ESExp *f)
break; }
case G_TOKEN_SYMBOL:
s = g_scanner_cur_value (gs).v_symbol;
- p(printf("got symbol '%s'\n", s->name));
+ p (printf ("got symbol '%s'\n", s->name));
switch (s->type) {
case ESEXP_TERM_FUNC:
case ESEXP_TERM_IFUNC:
- /* this is basically invalid, since we can't use function
- * pointers, but let the runtime catch it ... */
+ /* this is basically invalid, since we can't use
+ * function pointers, but let the runtime catch it */
t = parse_term_new (f, s->type);
t->value.func.sym = s;
- t->value.func.terms = parse_values (f, &t->value.func.termcount);
+ t->value.func.terms = parse_values (
+ f, &t->value.func.termcount);
break;
case ESEXP_TERM_VAR:
t = parse_term_new (f, s->type);
t->value.var = s;
break;
default:
- e_sexp_fatal_error(f, "Invalid symbol type: %s: %d", s->name, s->type);
+ e_sexp_fatal_error (
+ f, "Invalid symbol type: %s: %d",
+ s->name, s->type);
}
break;
case G_TOKEN_IDENTIFIER:
- p(printf("got unknown identifider '%s'\n", g_scanner_cur_value(gs).v_identifier));
- e_sexp_fatal_error(f, "Unknown identifier: %s", g_scanner_cur_value(gs).v_identifier);
+ p (printf (
+ "got unknown identifider '%s'\n",
+ g_scanner_cur_value (gs).v_identifier));
+ e_sexp_fatal_error (
+ f, "Unknown identifier: %s",
+ g_scanner_cur_value (gs).v_identifier);
break;
default:
- e_sexp_fatal_error(f, "Unexpected token encountered: %d", token);
+ e_sexp_fatal_error (
+ f, "Unexpected token encountered: %d", token);
}
- p(printf("done parsing value\n"));
+ p (printf ("done parsing value\n"));
return t;
}
@@ -1349,7 +1374,7 @@ parse_list (ESExp *f,
struct _ESExpTerm *t = NULL;
GScanner *gs = f->scanner;
- p(printf("parsing list\n"));
+ p (printf ("parsing list\n"));
if (gotbrace)
token = '(';
else
@@ -1361,9 +1386,9 @@ parse_list (ESExp *f,
struct _ESExpSymbol *s;
s = g_scanner_cur_value (gs).v_symbol;
- p(printf("got funciton: %s\n", s->name));
+ p (printf ("got funciton: %s\n", s->name));
t = parse_term_new (f, s->type);
- p(printf("created new list %p\n", t));
+ p (printf ("created new list %p\n", t));
/* if we have a variable, find out its base type */
while (s->type == ESEXP_TERM_VAR) {
s = ((ESExpTerm *)(s->data))->value.var;
@@ -1371,29 +1396,34 @@ parse_list (ESExp *f,
if (s->type == ESEXP_TERM_FUNC
|| s->type == ESEXP_TERM_IFUNC) {
t->value.func.sym = s;
- t->value.func.terms = parse_values (f, &t->value.func.termcount);
+ t->value.func.terms = parse_values (
+ f, &t->value.func.termcount);
} else {
parse_term_free (f, t);
- e_sexp_fatal_error(f, "Trying to call variable as function: %s", s->name);
+ e_sexp_fatal_error (
+ f, "Trying to call variable "
+ "as function: %s", s->name);
}
break; }
case G_TOKEN_IDENTIFIER:
- e_sexp_fatal_error(f, "Unknown identifier: %s", g_scanner_cur_value(gs).v_identifier);
+ e_sexp_fatal_error (
+ f, "Unknown identifier: %s",
+ g_scanner_cur_value (gs).v_identifier);
break;
case G_TOKEN_LEFT_PAREN:
return parse_list (f, TRUE);
default:
- e_sexp_fatal_error(f, "Unexpected token encountered: %d", token);
+ e_sexp_fatal_error (f, "Unexpected token encountered: %d", token);
}
token = g_scanner_get_next_token (gs);
if (token != ')') {
- e_sexp_fatal_error(f, "Missing ')'");
+ e_sexp_fatal_error (f, "Missing ')'");
}
} else {
- e_sexp_fatal_error(f, "Missing '('");
+ e_sexp_fatal_error (f, "Missing '('");
}
- p(printf("returning list %p\n", t));
+ p (printf ("returning list %p\n", t));
return t;
}
@@ -1416,18 +1446,18 @@ static const struct {
gint type; /* set to 1 if a function can perform shortcut evaluation, or
doesn't execute everything, 0 otherwise */
} symbols[] = {
- { "and", (ESExpFunc *)term_eval_and, 1 },
- { "or", (ESExpFunc *)term_eval_or, 1 },
- { "not", (ESExpFunc *)term_eval_not, 0 },
- { "<", (ESExpFunc *)term_eval_lt, 1 },
- { ">", (ESExpFunc *)term_eval_gt, 1 },
- { "=", (ESExpFunc *)term_eval_eq, 1 },
- { "+", (ESExpFunc *)term_eval_plus, 0 },
- { "-", (ESExpFunc *)term_eval_sub, 0 },
- { "cast-int", (ESExpFunc *)term_eval_castint, 0 },
- { "cast-string", (ESExpFunc *)term_eval_caststring, 0 },
- { "if", (ESExpFunc *)term_eval_if, 1 },
- { "begin", (ESExpFunc *)term_eval_begin, 1 },
+ { "and", (ESExpFunc *) term_eval_and, 1 },
+ { "or", (ESExpFunc *) term_eval_or, 1 },
+ { "not", (ESExpFunc *) term_eval_not, 0 },
+ { "<", (ESExpFunc *) term_eval_lt, 1 },
+ { ">", (ESExpFunc *) term_eval_gt, 1 },
+ { "=", (ESExpFunc *) term_eval_eq, 1 },
+ { "+", (ESExpFunc *) term_eval_plus, 0 },
+ { "-", (ESExpFunc *) term_eval_sub, 0 },
+ { "cast-int", (ESExpFunc *) term_eval_castint, 0 },
+ { "cast-string", (ESExpFunc *) term_eval_caststring, 0 },
+ { "if", (ESExpFunc *) term_eval_if, 1 },
+ { "begin", (ESExpFunc *) term_eval_begin, 1 },
};
static void
@@ -1474,9 +1504,17 @@ e_sexp_init (ESExp *s)
/* load in builtin symbols? */
for (i = 0; i < G_N_ELEMENTS (symbols); i++) {
if (symbols[i].type == 1) {
- e_sexp_add_ifunction (s, 0, symbols[i].name, (ESExpIFunc *) symbols[i].func, (gpointer) &symbols[i]);
+ e_sexp_add_ifunction (
+ s, 0,
+ symbols[i].name,
+ (ESExpIFunc *) symbols[i].func,
+ (gpointer) &symbols[i]);
} else {
- e_sexp_add_function (s, 0, symbols[i].name, symbols[i].func, (gpointer) &symbols[i]);
+ e_sexp_add_function (
+ s, 0,
+ symbols[i].name,
+ symbols[i].func,
+ (gpointer) &symbols[i]);
}
}
@@ -1635,7 +1673,7 @@ e_sexp_parse (ESExp *f)
g_return_val_if_fail (IS_E_SEXP (f), -1);
if (setjmp (f->failenv)) {
- g_warning("Error in parsing: %s", f->error);
+ g_warning ("Error in parsing: %s", f->error);
return -1;
}
@@ -1655,7 +1693,7 @@ e_sexp_eval (ESExp *f)
g_return_val_if_fail (f->tree != NULL, NULL);
if (setjmp (f->failenv)) {
- g_warning("Error in execution: %s", f->error);
+ g_warning ("Error in execution: %s", f->error);
return NULL;
}
@@ -1687,7 +1725,7 @@ e_sexp_evaluate_occur_times (ESExp *f,
*start = *end = -1;
if (setjmp (f->failenv)) {
- g_warning("Error in execution: %s", f->error);
+ g_warning ("Error in execution: %s", f->error);
return FALSE;
}
@@ -1717,9 +1755,9 @@ e_sexp_encode_bool (GString *s,
gboolean state)
{
if (state)
- g_string_append(s, " #t");
+ g_string_append (s, " #t");
else
- g_string_append(s, " #f");
+ g_string_append (s, " #f");
}
/**
@@ -1742,13 +1780,13 @@ e_sexp_encode_string (GString *s,
p = "";
else
p = string;
- g_string_append(s, " \"");
+ g_string_append (s, " \"");
while ((c = *p++)) {
if (c == '\\' || c == '\"' || c == '\'')
g_string_append_c (s, '\\');
g_string_append_c (s, c);
}
- g_string_append(s, "\"");
+ g_string_append (s, "\"");
}
#ifdef TESTER
@@ -1762,7 +1800,7 @@ gint main (gint argc, gchar **argv)
f = e_sexp_new ();
- e_sexp_add_variable(f, 0, "test", NULL);
+ e_sexp_add_variable (f, 0, "test", NULL);
if (argc < 2 || !argv[1])
return;
@@ -1778,7 +1816,7 @@ gint main (gint argc, gchar **argv)
if (r) {
eval_dump_result (r, 0);
} else {
- printf("no result?|\n");
+ printf ("no result?|\n");
}
return 0;
diff --git a/libedataserver/e-source-alarms.c b/libedataserver/e-source-alarms.c
index 9de9900..f713bb4 100644
--- a/libedataserver/e-source-alarms.c
+++ b/libedataserver/e-source-alarms.c
@@ -211,7 +211,7 @@ e_source_alarms_set_include_me (ESourceAlarms *extension,
{
g_return_if_fail (E_IS_SOURCE_ALARMS (extension));
- if ((extension->priv->include_me ? 1 : 0) == (include_me ? 1 : 0))
+ if (extension->priv->include_me == include_me)
return;
extension->priv->include_me = include_me;
diff --git a/libedataserver/e-source-authenticator.c b/libedataserver/e-source-authenticator.c
index 3e9936b..4985724 100644
--- a/libedataserver/e-source-authenticator.c
+++ b/libedataserver/e-source-authenticator.c
@@ -186,43 +186,43 @@ source_authenticator_get_prompt_strings (ESourceAuthenticator *auth,
g_string_append_printf (
description,
_("Please enter the password for "
- "address book \"%s\"."), display_name);
+ "address book \"%s\"."), display_name);
break;
case TYPE_CALENDAR:
g_string_append_printf (
description,
_("Please enter the password for "
- "calendar \"%s\"."), display_name);
+ "calendar \"%s\"."), display_name);
break;
case TYPE_MAIL_ACCOUNT:
g_string_append_printf (
description,
_("Please enter the password for "
- "mail account \"%s\"."), display_name);
+ "mail account \"%s\"."), display_name);
break;
case TYPE_MAIL_TRANSPORT:
g_string_append_printf (
description,
_("Please enter the password for "
- "mail transport \"%s\"."), display_name);
+ "mail transport \"%s\"."), display_name);
break;
case TYPE_MEMO_LIST:
g_string_append_printf (
description,
_("Please enter the password for "
- "memo list \"%s\"."), display_name);
+ "memo list \"%s\"."), display_name);
break;
case TYPE_TASK_LIST:
g_string_append_printf (
description,
_("Please enter the password for "
- "task list \"%s\"."), display_name);
+ "task list \"%s\"."), display_name);
break;
default: /* generic account prompt */
g_string_append_printf (
description,
_("Please enter the password for "
- "account \"%s\"."), display_name);
+ "account \"%s\"."), display_name);
break;
}
diff --git a/libedataserver/e-source-autocomplete.c b/libedataserver/e-source-autocomplete.c
index 22d7a0f..5a6ebfb 100644
--- a/libedataserver/e-source-autocomplete.c
+++ b/libedataserver/e-source-autocomplete.c
@@ -162,7 +162,7 @@ e_source_autocomplete_set_include_me (ESourceAutocomplete *extension,
{
g_return_if_fail (E_IS_SOURCE_AUTOCOMPLETE (extension));
- if ((extension->priv->include_me ? 1 : 0) == (include_me ? 1 : 0))
+ if (extension->priv->include_me == include_me)
return;
extension->priv->include_me = include_me;
diff --git a/libedataserver/e-source-collection.c b/libedataserver/e-source-collection.c
index 67ba0c1..86d5975 100644
--- a/libedataserver/e-source-collection.c
+++ b/libedataserver/e-source-collection.c
@@ -367,7 +367,7 @@ e_source_collection_set_calendar_enabled (ESourceCollection *extension,
{
g_return_if_fail (E_IS_SOURCE_COLLECTION (extension));
- if ((extension->priv->calendar_enabled ? 1 : 0) == (calendar_enabled ? 1 : 0))
+ if (extension->priv->calendar_enabled == calendar_enabled)
return;
extension->priv->calendar_enabled = calendar_enabled;
@@ -421,7 +421,7 @@ e_source_collection_set_contacts_enabled (ESourceCollection *extension,
{
g_return_if_fail (E_IS_SOURCE_COLLECTION (extension));
- if ((extension->priv->contacts_enabled ? 1 : 0) == (contacts_enabled ? 1 : 0))
+ if (extension->priv->contacts_enabled == contacts_enabled)
return;
extension->priv->contacts_enabled = contacts_enabled;
@@ -474,7 +474,7 @@ e_source_collection_set_mail_enabled (ESourceCollection *extension,
{
g_return_if_fail (E_IS_SOURCE_COLLECTION (extension));
- if ((extension->priv->mail_enabled ? 1 : 0) == (mail_enabled ? 1 : 0))
+ if (extension->priv->mail_enabled == mail_enabled)
return;
extension->priv->mail_enabled = mail_enabled;
diff --git a/libedataserver/e-source-mail-composition.c b/libedataserver/e-source-mail-composition.c
index ec37741..de1795d 100644
--- a/libedataserver/e-source-mail-composition.c
+++ b/libedataserver/e-source-mail-composition.c
@@ -576,7 +576,7 @@ e_source_mail_composition_set_sign_imip (ESourceMailComposition *extension,
{
g_return_if_fail (E_IS_SOURCE_MAIL_COMPOSITION (extension));
- if ((extension->priv->sign_imip ? 1 : 0) == (sign_imip ? 1 : 0))
+ if (extension->priv->sign_imip == sign_imip)
return;
extension->priv->sign_imip = sign_imip;
diff --git a/libedataserver/e-source-offline.c b/libedataserver/e-source-offline.c
index 94d61b1..30e6047 100644
--- a/libedataserver/e-source-offline.c
+++ b/libedataserver/e-source-offline.c
@@ -162,7 +162,7 @@ e_source_offline_set_stay_synchronized (ESourceOffline *extension,
{
g_return_if_fail (E_IS_SOURCE_OFFLINE (extension));
- if ((extension->priv->stay_synchronized ? 1 : 0) == (stay_synchronized ? 1 : 0))
+ if (extension->priv->stay_synchronized == stay_synchronized)
return;
extension->priv->stay_synchronized = stay_synchronized;
diff --git a/libedataserver/e-source-openpgp.c b/libedataserver/e-source-openpgp.c
index 8178667..3d3328e 100644
--- a/libedataserver/e-source-openpgp.c
+++ b/libedataserver/e-source-openpgp.c
@@ -294,7 +294,7 @@ e_source_openpgp_set_always_trust (ESourceOpenPGP *extension,
{
g_return_if_fail (E_IS_SOURCE_OPENPGP (extension));
- if ((extension->priv->always_trust ? 1 : 0) == (always_trust ? 1 : 0))
+ if (extension->priv->always_trust == always_trust)
return;
extension->priv->always_trust = always_trust;
@@ -335,7 +335,7 @@ e_source_openpgp_set_encrypt_to_self (ESourceOpenPGP *extension,
{
g_return_if_fail (E_IS_SOURCE_OPENPGP (extension));
- if ((extension->priv->encrypt_to_self ? 1 : 0) == (encrypt_to_self ? 1 : 0))
+ if (extension->priv->encrypt_to_self == encrypt_to_self)
return;
extension->priv->encrypt_to_self = encrypt_to_self;
@@ -547,7 +547,7 @@ e_source_openpgp_set_sign_by_default (ESourceOpenPGP *extension,
{
g_return_if_fail (E_IS_SOURCE_OPENPGP (extension));
- if ((extension->priv->sign_by_default ? 1 : 0) == (sign_by_default ? 1 : 0))
+ if (extension->priv->sign_by_default == sign_by_default)
return;
extension->priv->sign_by_default = sign_by_default;
diff --git a/libedataserver/e-source-refresh.c b/libedataserver/e-source-refresh.c
index 8200ba6..d210ae4 100644
--- a/libedataserver/e-source-refresh.c
+++ b/libedataserver/e-source-refresh.c
@@ -420,9 +420,6 @@ e_source_refresh_set_enabled (ESourceRefresh *extension,
{
g_return_if_fail (E_IS_SOURCE_REFRESH (extension));
- if ((enabled ? 1 : 0) == (extension->priv->enabled ? 1 : 0))
- return;
-
extension->priv->enabled = enabled;
g_object_notify (G_OBJECT (extension), "enabled");
diff --git a/libedataserver/e-source-selectable.c b/libedataserver/e-source-selectable.c
index 80969f7..0d0f383 100644
--- a/libedataserver/e-source-selectable.c
+++ b/libedataserver/e-source-selectable.c
@@ -287,7 +287,7 @@ e_source_selectable_set_selected (ESourceSelectable *extension,
{
g_return_if_fail (E_IS_SOURCE_SELECTABLE (extension));
- if ((extension->priv->selected ? 1 : 0) == (selected ? 1 : 0))
+ if (extension->priv->selected == selected)
return;
extension->priv->selected = selected;
diff --git a/libedataserver/e-source-smime.c b/libedataserver/e-source-smime.c
index 3189f80..3c55902 100644
--- a/libedataserver/e-source-smime.c
+++ b/libedataserver/e-source-smime.c
@@ -359,7 +359,9 @@ e_source_smime_set_encryption_certificate (ESourceSMIME *extension,
g_mutex_lock (extension->priv->property_lock);
- if (g_strcmp0 (extension->priv->encryption_certificate, encryption_certificate) == 0) {
+ if (g_strcmp0 (
+ extension->priv->encryption_certificate,
+ encryption_certificate) == 0) {
g_mutex_unlock (extension->priv->property_lock);
return;
}
@@ -408,7 +410,7 @@ e_source_smime_set_encrypt_by_default (ESourceSMIME *extension,
{
g_return_if_fail (E_IS_SOURCE_SMIME (extension));
- if ((extension->priv->encrypt_by_default ? 1 : 0) == (encrypt_by_default ? 1 : 0))
+ if (extension->priv->encrypt_by_default == encrypt_by_default)
return;
extension->priv->encrypt_by_default = encrypt_by_default;
@@ -449,7 +451,7 @@ e_source_smime_set_encrypt_to_self (ESourceSMIME *extension,
{
g_return_if_fail (E_IS_SOURCE_SMIME (extension));
- if ((extension->priv->encrypt_to_self ? 1 : 0) == (encrypt_to_self ? 1 : 0))
+ if (extension->priv->encrypt_to_self == encrypt_to_self)
return;
extension->priv->encrypt_to_self = encrypt_to_self;
@@ -664,7 +666,7 @@ e_source_smime_set_sign_by_default (ESourceSMIME *extension,
{
g_return_if_fail (E_IS_SOURCE_SMIME (extension));
- if ((extension->priv->sign_by_default ? 1 : 0) == (sign_by_default ? 1 : 0))
+ if (extension->priv->sign_by_default == sign_by_default)
return;
extension->priv->sign_by_default = sign_by_default;
diff --git a/libedataserver/e-source-webdav.c b/libedataserver/e-source-webdav.c
index 5cf9cee..2a2a017 100644
--- a/libedataserver/e-source-webdav.c
+++ b/libedataserver/e-source-webdav.c
@@ -661,7 +661,7 @@ e_source_webdav_set_avoid_ifmatch (ESourceWebdav *extension,
{
g_return_if_fail (E_IS_SOURCE_WEBDAV (extension));
- if ((extension->priv->avoid_ifmatch ? 1 : 0) == (avoid_ifmatch ? 1 : 0))
+ if (extension->priv->avoid_ifmatch == avoid_ifmatch)
return;
extension->priv->avoid_ifmatch = avoid_ifmatch;
@@ -701,7 +701,7 @@ e_source_webdav_set_calendar_auto_schedule (ESourceWebdav *extension,
{
g_return_if_fail (E_IS_SOURCE_WEBDAV (extension));
- if ((extension->priv->calendar_auto_schedule ? 1 : 0) == (calendar_auto_schedule ? 1 : 0))
+ if (extension->priv->calendar_auto_schedule == calendar_auto_schedule)
return;
extension->priv->calendar_auto_schedule = calendar_auto_schedule;
@@ -921,7 +921,7 @@ e_source_webdav_set_ignore_invalid_cert (ESourceWebdav *extension,
{
g_return_if_fail (E_IS_SOURCE_WEBDAV (extension));
- if ((extension->priv->ignore_invalid_cert ? 1 : 0) == (ignore_invalid_cert ? 1 : 0))
+ if (extension->priv->ignore_invalid_cert == ignore_invalid_cert)
return;
extension->priv->ignore_invalid_cert = ignore_invalid_cert;
diff --git a/libedataserver/e-source.c b/libedataserver/e-source.c
index c86ac3c..219b4cf 100644
--- a/libedataserver/e-source.c
+++ b/libedataserver/e-source.c
@@ -1082,7 +1082,7 @@ source_remote_create_sync (ESource *source,
error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Data source '%s' does not "
- "support creating remote resources"),
+ "support creating remote resources"),
e_source_get_display_name (source));
return FALSE;
}
@@ -1191,7 +1191,7 @@ source_remote_delete_sync (ESource *source,
error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
_("Data source '%s' does not "
- "support deleting remote resources"),
+ "support deleting remote resources"),
e_source_get_display_name (source));
return FALSE;
}
@@ -1844,7 +1844,7 @@ e_source_set_enabled (ESource *source,
{
g_return_if_fail (E_IS_SOURCE (source));
- if ((enabled ? 1 : 0) == (source->priv->enabled ? 1 : 0))
+ if (source->priv->enabled == enabled)
return;
source->priv->enabled = enabled;
diff --git a/libedataserver/e-time-utils.c b/libedataserver/e-time-utils.c
index 65b8519..699710c 100644
--- a/libedataserver/e-time-utils.c
+++ b/libedataserver/e-time-utils.c
@@ -1573,7 +1573,8 @@ locale_supports_12_hour_format (void)
static gboolean
has_correct_date (const struct tm *value)
{
- const gint days_in_month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+ const gint days_in_month[12] = {
+ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
gint days, year;
g_return_val_if_fail (value != NULL, FALSE);
@@ -1581,7 +1582,9 @@ has_correct_date (const struct tm *value)
year = value->tm_year + 1900;
days = days_in_month[value->tm_mon];
- if (value->tm_mon == 1 && ((year <= 1752) ? (!(year % 4)) : ((!(year % 4) && (year % 100)) || !(year % 400))))
+ if (value->tm_mon == 1 &&
+ ((year <= 1752) ? (!(year % 4)) :
+ ((!(year % 4) && (year % 100)) || !(year % 400))))
days++;
return value->tm_mday >= 1 && value->tm_mday <= days;
@@ -1786,16 +1789,16 @@ e_time_parse_date_ex (const gchar *value,
g_return_val_if_fail (result != NULL, E_TIME_PARSE_INVALID);
/* according to the current locale */
- format [0] = ("%x");
+ format[0] = ("%x");
/* according to the current locale with forced 4-digit year*/
format[1] = e_time_get_d_fmt_with_4digit_year ();
/* strptime format of a weekday and a date. */
- format [2] = _("%a %m/%d/%Y");
+ format[2] = _("%a %m/%d/%Y");
/* This is the preferred date format for the locale. */
- format [3] = _("%m/%d/%Y");
+ format[3] = _("%m/%d/%Y");
if (two_digit_year) {
/* when we need to know about two digit year, then always first try
@@ -1881,7 +1884,8 @@ e_time_parse_time (const gchar *value,
/* strptime format for time of day, without seconds 24-hour format. */
format[num_formats++] = _("%H:%M");
- /* strptime format for time of day, without seconds 24-hour format, and no colon. */
+ /* strptime format for time of day, without seconds 24-hour format,
+ * and no colon. */
format[num_formats++] = _("%H%M");
if (use_12_hour_formats) {
@@ -2088,34 +2092,42 @@ e_time_get_d_fmt_with_4digit_year (void)
#if defined(HAVE_NL_LANGINFO)
res = g_strdup (nl_langinfo (D_FMT) );
#elif defined(G_OS_WIN32)
- #define GET_LOCALE_INFO(str, len) GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SLONGDATE, str, len)
+#define GET_LOCALE_INFO(str, len) \
+ GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SLONGDATE, str, len)
gint format_string_length = GET_LOCALE_INFO (NULL, 0);
- if (format_string_length > 0)
- {
- gsize format_bytes_read, format_bytes_written;
- gchar *format_string = g_strnfill (format_string_length + 1, '\0');
+ if (format_string_length > 0) {
+ gsize format_bytes_read;
+ gsize format_bytes_written;
+ gchar *format_string;
+
+ format_string = g_strnfill (format_string_length + 1, '\0');
GET_LOCALE_INFO (format_string, format_string_length);
- res = g_locale_to_utf8 (format_string, format_string_length, &format_bytes_read, &format_bytes_written, NULL);
+ res = g_locale_to_utf8 (
+ format_string,
+ format_string_length,
+ &format_bytes_read,
+ &format_bytes_written,
+ NULL);
g_free (format_string);
+
/* now, convert the res to format of nl_langinfo */
- _e_string_replace(&res, "\\bd\\b", "%#d"); /* d -> %#d */
- _e_string_replace(&res, "\\bdd\\b", "%d"); /* dd -> %d */
- _e_string_replace(&res, "\\bddd\\b", "%a"); /* ddd -> %a */
- _e_string_replace(&res, "\\bdddd\\b", "%A"); /* dddd -> %A */
- _e_string_replace(&res, "\\bM\\b", "%#m"); /* M -> %#m */
- _e_string_replace(&res, "\\bMM\\b", "%m"); /* MM -> %m */
- _e_string_replace(&res, "\\bMMM\\b", "%b"); /* MMM -> %b */
- _e_string_replace(&res, "\\bMMMM\\b", "%B"); /* MMMM -> %B */
- _e_string_replace(&res, "\\by\\b", "%#y"); /* y -> %y */
- _e_string_replace(&res, "\\byy\\b", "%y"); /* yy -> %y*/
- _e_string_replace(&res, "\\byyyy\\b", "%Y"); /* yyyy -> %Y */
- _e_string_replace(&res, "\\byyyyy\\b", "%Y"); /* yyyyy -> %Y */
+ _e_string_replace (&res, "\\bd\\b", "%#d"); /* d -> %#d */
+ _e_string_replace (&res, "\\bdd\\b", "%d"); /* dd -> %d */
+ _e_string_replace (&res, "\\bddd\\b", "%a"); /* ddd -> %a */
+ _e_string_replace (&res, "\\bdddd\\b", "%A"); /* dddd -> %A */
+ _e_string_replace (&res, "\\bM\\b", "%#m"); /* M -> %#m */
+ _e_string_replace (&res, "\\bMM\\b", "%m"); /* MM -> %m */
+ _e_string_replace (&res, "\\bMMM\\b", "%b"); /* MMM -> %b */
+ _e_string_replace (&res, "\\bMMMM\\b", "%B"); /* MMMM -> %B */
+ _e_string_replace (&res, "\\by\\b", "%#y"); /* y -> %y */
+ _e_string_replace (&res, "\\byy\\b", "%y"); /* yy -> %y */
+ _e_string_replace (&res, "\\byyyy\\b", "%Y"); /* yyyy -> %Y */
+ _e_string_replace (&res, "\\byyyyy\\b", "%Y"); /* yyyyy -> %Y */
}
- #undef GET_LOCALE_INFO
- /**TODO** implement this for other systems
- */
+#undef GET_LOCALE_INFO
+ /* TODO Implement this for other systems. */
#else
- /* this will not work for other systems */
+ /* This will not work for other systems. */
res = g_strdup ("%x");
#endif
diff --git a/libedataserver/e-uid.c b/libedataserver/e-uid.c
index 1a37e41..19e860c 100644
--- a/libedataserver/e-uid.c
+++ b/libedataserver/e-uid.c
@@ -37,16 +37,15 @@
gchar *
e_uid_new (void)
{
- static gint serial;
- static gchar *hostname;
+ static gint serial = 0;
+ static gchar *hostname = NULL;
- if (!hostname) {
+ if (hostname == NULL)
hostname = (gchar *) g_get_host_name ();
- }
- return g_strdup_printf ("%lu %lu %d %s",
- (gulong) time (NULL),
- (gulong) getpid (),
- serial++,
- hostname);
+ return g_strdup_printf (
+ "%lu %lu %d %s",
+ (gulong) time (NULL),
+ (gulong) getpid (),
+ serial++, hostname);
}
diff --git a/libedataserver/e-url.c b/libedataserver/e-url.c
index 6783863..68adc2a 100644
--- a/libedataserver/e-url.c
+++ b/libedataserver/e-url.c
@@ -265,8 +265,9 @@ e_uri_new (const gchar *uri_string)
value = g_strdup ("");
}
uri_decode (name);
- g_datalist_set_data_full (&uri->params, name,
- value, g_free);
+ g_datalist_set_data_full (
+ &uri->params, name,
+ value, g_free);
g_free (name);
}
}
@@ -400,18 +401,18 @@ e_uri_to_string (EUri *uri,
uri->query ? uri->query : "");
else
str_uri = g_strdup_printf (
- "%s://%s%s%s%s%s%s%s%s%s%s",
+ "%s://%s%s%s%s%s%s%s%s%s%s",
uri->protocol,
- uri->user ? uri->user : "",
- uri->authmech ? ";auth=" : "",
- uri->authmech ? uri->authmech : "",
- uri->passwd && show_password ? ":" : "",
- uri->passwd && show_password ? uri->passwd : "",
- uri->user ? "@" : "",
- uri->host ? uri->host : "",
- uri->path ? uri->path : "",
- uri->query ? "?" : "",
- uri->query ? uri->query : "");
+ uri->user ? uri->user : "",
+ uri->authmech ? ";auth=" : "",
+ uri->authmech ? uri->authmech : "",
+ uri->passwd && show_password ? ":" : "",
+ uri->passwd && show_password ? uri->passwd : "",
+ uri->user ? "@" : "",
+ uri->host ? uri->host : "",
+ uri->path ? uri->path : "",
+ uri->query ? "?" : "",
+ uri->query ? uri->query : "");
return str_uri;
}
diff --git a/libedataserver/e-xml-hash-utils.c b/libedataserver/e-xml-hash-utils.c
index 0f246b5..ab0b1b8 100644
--- a/libedataserver/e-xml-hash-utils.c
+++ b/libedataserver/e-xml-hash-utils.c
@@ -62,8 +62,8 @@ e_xml_to_hash (xmlDoc *doc,
continue;
if (type == E_XML_HASH_TYPE_OBJECT_UID &&
- !strcmp ((gchar *)node->name, "object"))
- key = xmlGetProp (node, (xmlChar*)"uid");
+ !strcmp ((gchar *) node->name, "object"))
+ key = xmlGetProp (node, (xmlChar *)"uid");
else
key = xmlStrdup (node->name);
@@ -79,7 +79,10 @@ e_xml_to_hash (xmlDoc *doc,
continue;
}
- g_hash_table_insert (hash, g_strdup ((gchar *) key), g_strdup ((gchar *) value));
+ g_hash_table_insert (
+ hash, g_strdup ((gchar *) key),
+ g_strdup ((gchar *) value));
+
xmlFree (key);
xmlFree (value);
}
@@ -103,8 +106,8 @@ foreach_save_func (gpointer key,
xmlChar *enc;
if (sd->type == E_XML_HASH_TYPE_OBJECT_UID) {
- new_node = xmlNewNode (NULL, (xmlChar*)"object");
- xmlNewProp (new_node, (xmlChar*)"uid", (const xmlChar *) key);
+ new_node = xmlNewNode (NULL, (xmlChar *)"object");
+ xmlNewProp (new_node, (xmlChar *)"uid", (const xmlChar *) key);
} else
new_node = xmlNewNode (NULL, (const xmlChar *) key);
@@ -134,8 +137,8 @@ e_xml_from_hash (GHashTable *hash,
xmlDoc *doc;
struct save_data sd;
- doc = xmlNewDoc ((xmlChar*)"1.0");
- doc->encoding = xmlStrdup ((xmlChar*)"UTF-8");
+ doc = xmlNewDoc ((xmlChar *)"1.0");
+ doc->encoding = xmlStrdup ((xmlChar *)"UTF-8");
sd.type = type;
sd.doc = doc;
sd.root = xmlNewDocNode (doc, NULL, (xmlChar *) root_name, NULL);
diff --git a/libedataserverui/e-categories-editor.c b/libedataserverui/e-categories-editor.c
index a2fc427..49e2b1a 100644
--- a/libedataserverui/e-categories-editor.c
+++ b/libedataserverui/e-categories-editor.c
@@ -263,7 +263,8 @@ e_categories_editor_init (ECategoriesEditor *editor)
gtk_tree_view_set_headers_visible (
GTK_TREE_VIEW (categories_list), FALSE);
gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (categories_list), TRUE);
- g_signal_connect (G_OBJECT (categories_list), "category-checked",
+ g_signal_connect (
+ G_OBJECT (categories_list), "category-checked",
G_CALLBACK (category_checked_cb), editor);
hbuttonbox1 = gtk_hbutton_box_new ();
diff --git a/libedataserverui/e-categories-selector.c b/libedataserverui/e-categories-selector.c
index 7cbcce8..e2eedfa 100644
--- a/libedataserverui/e-categories-selector.c
+++ b/libedataserverui/e-categories-selector.c
@@ -137,7 +137,8 @@ category_toggled_cb (GtkCellRenderer *renderer,
gchar *category;
gboolean active;
- gtk_tree_model_get (model, &iter,
+ gtk_tree_model_get (
+ model, &iter,
COLUMN_ACTIVE, &active,
COLUMN_CATEGORY, &category, -1);
@@ -465,7 +466,8 @@ e_categories_selector_set_checked (ECategoriesSelector *selector,
gchar *category_name;
gboolean found;
- gtk_tree_model_get (model, &iter,
+ gtk_tree_model_get (
+ model, &iter,
COLUMN_CATEGORY, &category_name,
-1);
found = (g_hash_table_lookup (
@@ -516,7 +518,8 @@ e_categories_selector_delete_selection (ECategoriesSelector *selector)
gchar *category;
gtk_tree_model_get_iter (model, &iter, path);
- gtk_tree_model_get (model, &iter,
+ gtk_tree_model_get (
+ model, &iter,
COLUMN_CATEGORY, &category, -1);
gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
e_categories_remove (category);
@@ -568,7 +571,8 @@ e_categories_selector_get_selected (ECategoriesSelector *selector)
gchar *category;
gtk_tree_model_get_iter (model, &iter, path);
- gtk_tree_model_get (model, &iter,
+ gtk_tree_model_get (
+ model, &iter,
COLUMN_CATEGORY, &category, -1);
if (str->len == 0)
g_string_assign (str, category);
diff --git a/libedataserverui/e-category-editor.c b/libedataserverui/e-category-editor.c
index 3f83f0b..6579a6c 100644
--- a/libedataserverui/e-category-editor.c
+++ b/libedataserverui/e-category-editor.c
@@ -285,7 +285,7 @@ e_category_editor_create_category (ECategoryEditor *editor)
GTK_WINDOW (editor),
0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
_("There is already a category '%s' in the "
- "configuration. Please use another name"),
+ "configuration. Please use another name"),
category_name);
gtk_dialog_run (GTK_DIALOG (error_dialog));
diff --git a/libedataserverui/e-contact-store.c b/libedataserverui/e-contact-store.c
index 5aa4ce9..4e49399 100644
--- a/libedataserverui/e-contact-store.c
+++ b/libedataserverui/e-contact-store.c
@@ -166,23 +166,25 @@ e_contact_store_class_init (EContactStoreClass *class)
object_class->dispose = contact_store_dispose;
object_class->finalize = contact_store_finalize;
- signals[START_CLIENT_VIEW] =
- g_signal_new ("start-client-view",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EContactStoreClass, start_client_view),
- NULL, NULL,
- g_cclosure_marshal_VOID__OBJECT,
- G_TYPE_NONE, 1, E_TYPE_BOOK_CLIENT_VIEW);
-
- signals[STOP_CLIENT_VIEW] =
- g_signal_new ("stop-client-view",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EContactStoreClass, stop_client_view),
- NULL, NULL,
- g_cclosure_marshal_VOID__OBJECT,
- G_TYPE_NONE, 1, E_TYPE_BOOK_CLIENT_VIEW);
+ signals[START_CLIENT_VIEW] = g_signal_new (
+ "start-client-view",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EContactStoreClass, start_client_view),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ E_TYPE_BOOK_CLIENT_VIEW);
+
+ signals[STOP_CLIENT_VIEW] = g_signal_new (
+ "stop-client-view",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EContactStoreClass, stop_client_view),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ E_TYPE_BOOK_CLIENT_VIEW);
}
static void
@@ -721,14 +723,18 @@ start_view (EContactStore *contact_store,
{
g_signal_emit (contact_store, signals[START_CLIENT_VIEW], 0, view);
- g_signal_connect_swapped (view, "objects-added",
- G_CALLBACK (view_contacts_added), contact_store);
- g_signal_connect_swapped (view, "objects-removed",
- G_CALLBACK (view_contacts_removed), contact_store);
- g_signal_connect_swapped (view, "objects-modified",
- G_CALLBACK (view_contacts_modified), contact_store);
- g_signal_connect_swapped (view, "complete",
- G_CALLBACK (view_complete), contact_store);
+ g_signal_connect_swapped (
+ view, "objects-added",
+ G_CALLBACK (view_contacts_added), contact_store);
+ g_signal_connect_swapped (
+ view, "objects-removed",
+ G_CALLBACK (view_contacts_removed), contact_store);
+ g_signal_connect_swapped (
+ view, "objects-modified",
+ G_CALLBACK (view_contacts_modified), contact_store);
+ g_signal_connect_swapped (
+ view, "complete",
+ G_CALLBACK (view_complete), contact_store);
e_book_client_view_start (view, NULL);
}
@@ -739,8 +745,9 @@ stop_view (EContactStore *contact_store,
{
e_book_client_view_stop (view, NULL);
- g_signal_handlers_disconnect_matched (view, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, contact_store);
+ g_signal_handlers_disconnect_matched (
+ view, G_SIGNAL_MATCH_DATA,
+ 0, 0, NULL, NULL, contact_store);
g_signal_emit (contact_store, signals[STOP_CLIENT_VIEW], 0, view);
}
diff --git a/libedataserverui/e-destination-store.c b/libedataserverui/e-destination-store.c
index 1f9309e..82801f2 100644
--- a/libedataserverui/e-destination-store.c
+++ b/libedataserverui/e-destination-store.c
@@ -278,16 +278,18 @@ static void
start_destination (EDestinationStore *destination_store,
EDestination *destination)
{
- g_signal_connect_swapped (destination, "changed",
- G_CALLBACK (destination_changed), destination_store);
+ g_signal_connect_swapped (
+ destination, "changed",
+ G_CALLBACK (destination_changed), destination_store);
}
static void
stop_destination (EDestinationStore *destination_store,
EDestination *destination)
{
- g_signal_handlers_disconnect_matched (destination, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, destination_store);
+ g_signal_handlers_disconnect_matched (
+ destination, G_SIGNAL_MATCH_DATA,
+ 0, 0, NULL, NULL, destination_store);
}
/* --------------- *
@@ -402,9 +404,10 @@ e_destination_store_insert_destination (EDestinationStore *destination_store,
g_ptr_array_set_size (array, array->len + 1);
if (array->len - 1 - index > 0) {
- memmove (array->pdata + index + 1,
- array->pdata + index,
- (array->len - 1 - index) * sizeof (gpointer));
+ memmove (
+ array->pdata + index + 1,
+ array->pdata + index,
+ (array->len - 1 - index) * sizeof (gpointer));
}
array->pdata[index] = destination;
@@ -711,7 +714,7 @@ e_destination_store_get_value (GtkTreeModel *tree_model,
if (e_contact_get (contact, E_CONTACT_IS_LIST)) {
string = e_destination_get_name (destination);
string_new = g_string_new (string);
- string_new = g_string_append(string_new, " mailing list");
+ string_new = g_string_append (string_new, " mailing list");
g_value_set_string (value, string_new->str);
g_string_free (string_new, TRUE);
}
diff --git a/libedataserverui/e-name-selector-dialog.c b/libedataserverui/e-name-selector-dialog.c
index 5fd7f0b..308ce20 100644
--- a/libedataserverui/e-name-selector-dialog.c
+++ b/libedataserverui/e-name-selector-dialog.c
@@ -299,25 +299,31 @@ name_selector_dialog_constructed (GObject *object)
AddressBookLabel = gtk_label_new_with_mnemonic (_("Address B_ook:"));
gtk_widget_show (AddressBookLabel);
- gtk_table_attach (GTK_TABLE (show_contacts_table), AddressBookLabel, 0, 1, 0, 1,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
+ gtk_table_attach (
+ GTK_TABLE (show_contacts_table),
+ AddressBookLabel, 0, 1, 0, 1,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
gtk_label_set_justify (GTK_LABEL (AddressBookLabel), GTK_JUSTIFY_CENTER);
gtk_misc_set_alignment (GTK_MISC (AddressBookLabel), 0, 0.5);
label31 = gtk_label_new_with_mnemonic (_("Cat_egory:"));
gtk_widget_show (label31);
- gtk_table_attach (GTK_TABLE (show_contacts_table), label31, 0, 1, 1, 2,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
+ gtk_table_attach (
+ GTK_TABLE (show_contacts_table),
+ label31, 0, 1, 1, 2,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
gtk_label_set_justify (GTK_LABEL (label31), GTK_JUSTIFY_CENTER);
gtk_misc_set_alignment (GTK_MISC (label31), 0, 0.5);
hbox1 = gtk_hbox_new (FALSE, 12);
gtk_widget_show (hbox1);
- gtk_table_attach (GTK_TABLE (show_contacts_table), hbox1, 1, 2, 2, 3,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
+ gtk_table_attach (
+ GTK_TABLE (show_contacts_table),
+ hbox1, 1, 2, 2, 3,
+ (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+ (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
search = gtk_entry_new ();
gtk_widget_show (search);
@@ -325,28 +331,36 @@ name_selector_dialog_constructed (GObject *object)
label39 = gtk_label_new_with_mnemonic (_("_Search:"));
gtk_widget_show (label39);
- gtk_table_attach (GTK_TABLE (show_contacts_table), label39, 0, 1, 2, 3,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
+ gtk_table_attach (
+ GTK_TABLE (show_contacts_table),
+ label39, 0, 1, 2, 3,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label39), 0, 0.5);
source_menu_box = gtk_hbox_new (FALSE, 0);
gtk_widget_show (source_menu_box);
- gtk_table_attach (GTK_TABLE (show_contacts_table), source_menu_box, 1, 2, 0, 1,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (GTK_FILL), 0, 0);
+ gtk_table_attach (
+ GTK_TABLE (show_contacts_table),
+ source_menu_box, 1, 2, 0, 1,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (GTK_FILL), 0, 0);
combobox_category = gtk_combo_box_text_new ();
gtk_widget_show (combobox_category);
- gtk_table_attach (GTK_TABLE (show_contacts_table), combobox_category, 1, 2, 1, 2,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (GTK_FILL), 0, 0);
- gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox_category), _("Any Category"));
+ gtk_table_attach (
+ GTK_TABLE (show_contacts_table),
+ combobox_category, 1, 2, 1, 2,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (GTK_FILL), 0, 0);
+ gtk_combo_box_text_append_text (
+ GTK_COMBO_BOX_TEXT (combobox_category), _("Any Category"));
tmp_str = g_strconcat ("<b>", _("Co_ntacts"), "</b>", NULL);
label36 = gtk_label_new_with_mnemonic (tmp_str);
gtk_widget_show (label36);
- gtk_box_pack_start (GTK_BOX (name_selector_box), label36, FALSE, FALSE, 0);
+ gtk_box_pack_start (
+ GTK_BOX (name_selector_box), label36, FALSE, FALSE, 0);
gtk_label_set_use_markup (GTK_LABEL (label36), TRUE);
gtk_misc_set_alignment (GTK_MISC (label36), 0, 0.5);
g_free (tmp_str);
@@ -354,16 +368,17 @@ name_selector_dialog_constructed (GObject *object)
scrolledwindow0 = gtk_scrolled_window_new (NULL, NULL);
priv->contact_window = scrolledwindow0;
gtk_widget_show (scrolledwindow0);
- gtk_box_pack_start (GTK_BOX (name_selector_box), scrolledwindow0,
- TRUE, TRUE, 0);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow0),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
+ gtk_box_pack_start (
+ GTK_BOX (name_selector_box), scrolledwindow0,
+ TRUE, TRUE, 0);
+ gtk_scrolled_window_set_policy (
+ GTK_SCROLLED_WINDOW (scrolledwindow0),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
hbox3 = gtk_hbox_new (FALSE, 12);
gtk_widget_show (hbox3);
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW
- (scrolledwindow0), hbox3);
+ gtk_scrolled_window_add_with_viewport (
+ GTK_SCROLLED_WINDOW (scrolledwindow0), hbox3);
label38 = gtk_label_new ("");
gtk_widget_show (label38);
@@ -372,14 +387,19 @@ name_selector_dialog_constructed (GObject *object)
scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_show (scrolledwindow1);
gtk_box_pack_start (GTK_BOX (hbox3), scrolledwindow1, TRUE, TRUE, 0);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_SHADOW_IN);
+ gtk_scrolled_window_set_policy (
+ GTK_SCROLLED_WINDOW (scrolledwindow1),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_scrolled_window_set_shadow_type (
+ GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_SHADOW_IN);
source_tree_view = gtk_tree_view_new ();
gtk_widget_show (source_tree_view);
gtk_container_add (GTK_CONTAINER (scrolledwindow1), source_tree_view);
- gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (source_tree_view), FALSE);
- gtk_tree_view_set_enable_search (GTK_TREE_VIEW (source_tree_view), FALSE);
+ gtk_tree_view_set_headers_visible (
+ GTK_TREE_VIEW (source_tree_view), FALSE);
+ gtk_tree_view_set_enable_search (
+ GTK_TREE_VIEW (source_tree_view), FALSE);
destination_box = gtk_vbox_new (TRUE, 6);
gtk_widget_show (destination_box);
@@ -413,7 +433,9 @@ name_selector_dialog_constructed (GObject *object)
g_object_unref (G_OBJECT (tmp_relation));
g_object_unref (G_OBJECT (tmp_relation_set));
- gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (object))), name_selector_box, TRUE, TRUE, 0);
+ gtk_box_pack_start (
+ GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (object))),
+ name_selector_box, TRUE, TRUE, 0);
/* Store pointers to relevant widgets */
@@ -509,7 +531,8 @@ name_selector_dialog_constructed (GObject *object)
* 600 pixels seems to be a good lower bound resolution to allow room
* above or below for other UI (window manager's?)
*/
- gtk_window_set_default_size (GTK_WINDOW (object), 700,
+ gtk_window_set_default_size (
+ GTK_WINDOW (object), 700,
gdk_screen_height () >= 600 ? 512 : -1);
gtk_dialog_set_default_response (
@@ -763,9 +786,10 @@ make_tree_view_for_section (ENameSelectorDialog *name_selector_dialog,
column = gtk_tree_view_column_new ();
cell_renderer = GTK_CELL_RENDERER (gtk_cell_renderer_text_new ());
gtk_tree_view_column_pack_start (column, cell_renderer, TRUE);
- gtk_tree_view_column_set_cell_data_func (column, cell_renderer,
- (GtkTreeCellDataFunc) destination_column_formatter,
- name_selector_dialog, NULL);
+ gtk_tree_view_column_set_cell_data_func (
+ column, cell_renderer,
+ (GtkTreeCellDataFunc) destination_column_formatter,
+ name_selector_dialog, NULL);
gtk_tree_view_append_column (tree_view, column);
gtk_tree_view_set_headers_visible (tree_view, FALSE);
gtk_tree_view_set_model (tree_view, GTK_TREE_MODEL (destination_store));
@@ -853,8 +877,9 @@ add_section (ENameSelectorDialog *name_selector_dialog,
}
/* Set up transfer button */
- g_signal_connect_swapped (section.transfer_button, "clicked",
- G_CALLBACK (transfer_button_clicked), name_selector_dialog);
+ g_signal_connect_swapped (
+ section.transfer_button, "clicked",
+ G_CALLBACK (transfer_button_clicked), name_selector_dialog);
/*data for the remove callback*/
data = g_malloc0 (sizeof (SelData));
@@ -862,10 +887,11 @@ add_section (ENameSelectorDialog *name_selector_dialog,
data->dlg_ptr = name_selector_dialog;
/*Associate to an object destroy so that it gets freed*/
- g_object_set_data_full ((GObject *)section.destination_view, "sel-remove-data", data, g_free);
+ g_object_set_data_full ((GObject *) section.destination_view, "sel-remove-data", data, g_free);
- g_signal_connect(section.remove_button, "clicked",
- G_CALLBACK (remove_button_clicked), data);
+ g_signal_connect (
+ section.remove_button, "clicked",
+ G_CALLBACK (remove_button_clicked), data);
/* Alignment and vbox for the add/remove buttons */
@@ -910,25 +936,29 @@ add_section (ENameSelectorDialog *name_selector_dialog,
data = g_malloc0 (sizeof (SelData));
data->view = section.destination_view;
data->button = section.remove_button;
- g_object_set_data_full ((GObject *)section.destination_view, "sel-change-data", data, g_free);
+ g_object_set_data_full ((GObject *) section.destination_view, "sel-change-data", data, g_free);
selection = gtk_tree_view_get_selection (section.destination_view);
gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
- g_signal_connect(selection, "changed",
- G_CALLBACK (selection_changed), data);
+ g_signal_connect (
+ selection, "changed",
+ G_CALLBACK (selection_changed), data);
- g_signal_connect_swapped (section.destination_view, "row-activated",
- G_CALLBACK (destination_activated), name_selector_dialog);
- g_signal_connect_swapped (section.destination_view, "key-press-event",
- G_CALLBACK (destination_key_press), name_selector_dialog);
+ g_signal_connect_swapped (
+ section.destination_view, "row-activated",
+ G_CALLBACK (destination_activated), name_selector_dialog);
+ g_signal_connect_swapped (
+ section.destination_view, "key-press-event",
+ G_CALLBACK (destination_key_press), name_selector_dialog);
/* Done! */
gtk_widget_show_all (GTK_WIDGET (section.section_box));
/* Pack this section's box into the dialog */
- gtk_box_pack_start (name_selector_dialog->priv->destination_box,
- GTK_WIDGET (section.section_box), TRUE, TRUE, 0);
+ gtk_box_pack_start (
+ name_selector_dialog->priv->destination_box,
+ GTK_WIDGET (section.section_box), TRUE, TRUE, 0);
g_array_append_val (name_selector_dialog->priv->sections, section);
@@ -1588,9 +1618,10 @@ contact_column_formatter (GtkTreeViewColumn *column,
full_name_str = e_contact_get (contact, E_CONTACT_FILE_AS);
string = g_strdup_printf ("%s", full_name_str ? full_name_str : "?");
} else {
- string = g_strdup_printf ("%s%s<%s>", full_name_str ? full_name_str : "",
- full_name_str ? " " : "",
- email_str ? email_str : "");
+ string = g_strdup_printf (
+ "%s%s<%s>", full_name_str ? full_name_str : "",
+ full_name_str ? " " : "",
+ email_str ? email_str : "");
}
g_free (full_name_str);
diff --git a/libedataserverui/e-name-selector-entry.c b/libedataserverui/e-name-selector-entry.c
index c69556c..6c1cd87 100644
--- a/libedataserverui/e-name-selector-entry.c
+++ b/libedataserverui/e-name-selector-entry.c
@@ -303,8 +303,9 @@ name_selector_entry_drag_data_received (GtkWidget *widget,
if (n_addresses <= 0)
/* Chain up to parent's drag_data_received() method. */
GTK_WIDGET_CLASS (e_name_selector_entry_parent_class)->
- drag_data_received (widget, context, x, y,
- selection_data, info, time);
+ drag_data_received (
+ widget, context, x, y,
+ selection_data, info, time);
}
static void
@@ -767,16 +768,17 @@ set_completion_query (ENameSelectorEntry *name_selector_entry,
file_as_query_str = name_style_query ("file_as", cue_str);
user_fields_str = ens_util_populate_user_query_fields (priv->user_query_fields, cue_str, encoded_cue_str);
- query_str = g_strdup_printf ("(or "
- " (beginswith \"nickname\" %s) "
- " (beginswith \"email\" %s) "
- " %s "
- " %s "
- " %s "
- ")",
- encoded_cue_str, encoded_cue_str,
- full_name_query_str, file_as_query_str,
- user_fields_str ? user_fields_str : "");
+ query_str = g_strdup_printf (
+ "(or "
+ " (beginswith \"nickname\" %s) "
+ " (beginswith \"email\" %s) "
+ " %s "
+ " %s "
+ " %s "
+ ")",
+ encoded_cue_str, encoded_cue_str,
+ full_name_query_str, file_as_query_str,
+ user_fields_str ? user_fields_str : "");
g_free (user_fields_str);
g_free (file_as_query_str);
@@ -1095,10 +1097,15 @@ type_ahead_complete (ENameSelectorEntry *name_selector_entry)
textrep_len = g_utf8_strlen (textrep, -1);
pos = range_start;
- g_signal_handlers_block_by_func (name_selector_entry, user_insert_text, name_selector_entry);
- g_signal_handlers_block_by_func (name_selector_entry, user_delete_text, name_selector_entry);
- g_signal_handlers_block_by_func (name_selector_entry->priv->destination_store,
- destination_row_changed, name_selector_entry);
+ g_signal_handlers_block_by_func (
+ name_selector_entry,
+ user_insert_text, name_selector_entry);
+ g_signal_handlers_block_by_func (
+ name_selector_entry,
+ user_delete_text, name_selector_entry);
+ g_signal_handlers_block_by_func (
+ name_selector_entry->priv->destination_store,
+ destination_row_changed, name_selector_entry);
if (textrep_len > range_len) {
gint i;
@@ -1107,10 +1114,15 @@ type_ahead_complete (ENameSelectorEntry *name_selector_entry)
for (i = 0; textrep[i] && cue_str[i]; i++)
textrep[i] = cue_str[i];
- gtk_editable_delete_text (GTK_EDITABLE (name_selector_entry), range_start, range_end);
- gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), textrep, -1, &pos);
- gtk_editable_select_region (GTK_EDITABLE (name_selector_entry), range_end,
- range_start + textrep_len);
+ gtk_editable_delete_text (
+ GTK_EDITABLE (name_selector_entry),
+ range_start, range_end);
+ gtk_editable_insert_text (
+ GTK_EDITABLE (name_selector_entry),
+ textrep, -1, &pos);
+ gtk_editable_select_region (
+ GTK_EDITABLE (name_selector_entry),
+ range_end, range_start + textrep_len);
priv->is_completing = TRUE;
}
g_free (cue_str);
@@ -1127,8 +1139,9 @@ type_ahead_complete (ENameSelectorEntry *name_selector_entry)
generate_attribute_list (name_selector_entry);
}
- g_signal_handlers_unblock_by_func (name_selector_entry->priv->destination_store,
- destination_row_changed, name_selector_entry);
+ g_signal_handlers_unblock_by_func (
+ name_selector_entry->priv->destination_store,
+ destination_row_changed, name_selector_entry);
g_signal_handlers_unblock_by_func (name_selector_entry, user_delete_text, name_selector_entry);
g_signal_handlers_unblock_by_func (name_selector_entry, user_insert_text, name_selector_entry);
@@ -1205,12 +1218,15 @@ insert_destination_at_position (ENameSelectorEntry *name_selector_entry,
destination = build_destination_at_position (text, pos);
g_assert (destination);
- g_signal_handlers_block_by_func (name_selector_entry->priv->destination_store,
- destination_row_inserted, name_selector_entry);
- e_destination_store_insert_destination (name_selector_entry->priv->destination_store,
+ g_signal_handlers_block_by_func (
+ name_selector_entry->priv->destination_store,
+ destination_row_inserted, name_selector_entry);
+ e_destination_store_insert_destination (
+ name_selector_entry->priv->destination_store,
index, destination);
- g_signal_handlers_unblock_by_func (name_selector_entry->priv->destination_store,
- destination_row_inserted, name_selector_entry);
+ g_signal_handlers_unblock_by_func (
+ name_selector_entry->priv->destination_store,
+ destination_row_inserted, name_selector_entry);
g_object_unref (destination);
}
@@ -1234,11 +1250,13 @@ modify_destination_at_position (ENameSelectorEntry *name_selector_entry,
if (e_destination_get_contact (destination))
rebuild_attributes = TRUE;
- g_signal_handlers_block_by_func (name_selector_entry->priv->destination_store,
- destination_row_changed, name_selector_entry);
+ g_signal_handlers_block_by_func (
+ name_selector_entry->priv->destination_store,
+ destination_row_changed, name_selector_entry);
e_destination_set_raw (destination, raw_address);
- g_signal_handlers_unblock_by_func (name_selector_entry->priv->destination_store,
- destination_row_changed, name_selector_entry);
+ g_signal_handlers_unblock_by_func (
+ name_selector_entry->priv->destination_store,
+ destination_row_changed, name_selector_entry);
g_free (raw_address);
@@ -1329,12 +1347,15 @@ remove_destination_by_index (ENameSelectorEntry *name_selector_entry,
destination = find_destination_by_index (name_selector_entry, index);
if (destination) {
- g_signal_handlers_block_by_func (name_selector_entry->priv->destination_store,
- destination_row_deleted, name_selector_entry);
- e_destination_store_remove_destination (name_selector_entry->priv->destination_store,
+ g_signal_handlers_block_by_func (
+ name_selector_entry->priv->destination_store,
+ destination_row_deleted, name_selector_entry);
+ e_destination_store_remove_destination (
+ name_selector_entry->priv->destination_store,
destination);
- g_signal_handlers_unblock_by_func (name_selector_entry->priv->destination_store,
- destination_row_deleted, name_selector_entry);
+ g_signal_handlers_unblock_by_func (
+ name_selector_entry->priv->destination_store,
+ destination_row_deleted, name_selector_entry);
}
}
@@ -1658,8 +1679,9 @@ user_delete_text (ENameSelectorEntry *name_selector_entry,
}
}
}
- gtk_editable_delete_text (GTK_EDITABLE (name_selector_entry),
- start_pos, end_pos);
+ gtk_editable_delete_text (
+ GTK_EDITABLE (name_selector_entry),
+ start_pos, end_pos);
/*If the user is deleting a '"' new destinations have to be created for ',' between the quoted text
Like "fd,ty,uy" is a one entity, but if you remove the quotes it has to be broken doan into 3 seperate
@@ -1719,9 +1741,10 @@ completion_match_selected (ENameSelectorEntry *name_selector_entry,
g_return_val_if_fail (name_selector_entry->priv->email_generator == email_generator_model, FALSE);
- e_tree_model_generator_convert_iter_to_child_iter (email_generator_model,
- &contact_iter, &email_n,
- generator_iter);
+ e_tree_model_generator_convert_iter_to_child_iter (
+ email_generator_model,
+ &contact_iter, &email_n,
+ generator_iter);
contact = e_contact_store_get_contact (name_selector_entry->priv->contact_store, &contact_iter);
book_client = e_contact_store_get_client (name_selector_entry->priv->contact_store, &contact_iter);
@@ -2004,11 +2027,13 @@ contact_layout_pixbuffer (GtkCellLayout *cell_layout,
if (!name_selector_entry->priv->contact_store)
return;
- gtk_tree_model_filter_convert_iter_to_child_iter (GTK_TREE_MODEL_FILTER (model),
- &generator_iter, iter);
- e_tree_model_generator_convert_iter_to_child_iter (name_selector_entry->priv->email_generator,
- &contact_store_iter, &email_n,
- &generator_iter);
+ gtk_tree_model_filter_convert_iter_to_child_iter (
+ GTK_TREE_MODEL_FILTER (model),
+ &generator_iter, iter);
+ e_tree_model_generator_convert_iter_to_child_iter (
+ name_selector_entry->priv->email_generator,
+ &contact_store_iter, &email_n,
+ &generator_iter);
contact = e_contact_store_get_contact (name_selector_entry->priv->contact_store, &contact_store_iter);
if (!contact) {
@@ -2080,11 +2105,13 @@ contact_layout_formatter (GtkCellLayout *cell_layout,
if (!name_selector_entry->priv->contact_store)
return;
- gtk_tree_model_filter_convert_iter_to_child_iter (GTK_TREE_MODEL_FILTER (model),
- &generator_iter, iter);
- e_tree_model_generator_convert_iter_to_child_iter (name_selector_entry->priv->email_generator,
- &contact_store_iter, &email_n,
- &generator_iter);
+ gtk_tree_model_filter_convert_iter_to_child_iter (
+ GTK_TREE_MODEL_FILTER (model),
+ &generator_iter, iter);
+ e_tree_model_generator_convert_iter_to_child_iter (
+ name_selector_entry->priv->email_generator,
+ &contact_store_iter, &email_n,
+ &generator_iter);
contact = e_contact_store_get_contact (name_selector_entry->priv->contact_store, &contact_store_iter);
email_list = e_contact_get (contact, E_CONTACT_EMAIL);
@@ -2094,9 +2121,10 @@ contact_layout_formatter (GtkCellLayout *cell_layout,
if (e_contact_get (contact, E_CONTACT_IS_LIST)) {
string = g_strdup_printf ("%s", file_as_str ? file_as_str : "?");
} else {
- string = g_strdup_printf ("%s%s<%s>", file_as_str ? file_as_str : "",
- file_as_str ? " " : "",
- email_str ? email_str : "");
+ string = g_strdup_printf (
+ "%s%s<%s>", file_as_str ? file_as_str : "",
+ file_as_str ? " " : "",
+ email_str ? email_str : "");
}
g_free (file_as_str);
@@ -2136,7 +2164,9 @@ generate_contact_rows (EContactStore *contact_store,
static void
ensure_type_ahead_complete_on_timeout (ENameSelectorEntry *name_selector_entry)
{
- re_set_timeout (name_selector_entry->priv->type_ahead_complete_cb_id, type_ahead_complete_on_timeout_cb, name_selector_entry);
+ re_set_timeout (
+ name_selector_entry->priv->type_ahead_complete_cb_id,
+ type_ahead_complete_on_timeout_cb, name_selector_entry);
}
static void
@@ -2149,20 +2179,26 @@ setup_contact_store (ENameSelectorEntry *name_selector_entry)
if (name_selector_entry->priv->contact_store) {
name_selector_entry->priv->email_generator =
- e_tree_model_generator_new (GTK_TREE_MODEL (name_selector_entry->priv->contact_store));
+ e_tree_model_generator_new (
+ GTK_TREE_MODEL (
+ name_selector_entry->priv->contact_store));
- e_tree_model_generator_set_generate_func (name_selector_entry->priv->email_generator,
- (ETreeModelGeneratorGenerateFunc) generate_contact_rows,
- name_selector_entry, NULL);
+ e_tree_model_generator_set_generate_func (
+ name_selector_entry->priv->email_generator,
+ (ETreeModelGeneratorGenerateFunc) generate_contact_rows,
+ name_selector_entry, NULL);
/* Assign the store to the entry completion */
- gtk_entry_completion_set_model (name_selector_entry->priv->entry_completion,
- GTK_TREE_MODEL (name_selector_entry->priv->email_generator));
+ gtk_entry_completion_set_model (
+ name_selector_entry->priv->entry_completion,
+ GTK_TREE_MODEL (
+ name_selector_entry->priv->email_generator));
/* Set up callback for incoming matches */
- g_signal_connect_swapped (name_selector_entry->priv->contact_store, "row-inserted",
- G_CALLBACK (ensure_type_ahead_complete_on_timeout), name_selector_entry);
+ g_signal_connect_swapped (
+ name_selector_entry->priv->contact_store, "row-inserted",
+ G_CALLBACK (ensure_type_ahead_complete_on_timeout), name_selector_entry);
} else {
/* Remove the store from the entry completion */
@@ -2433,12 +2469,15 @@ setup_destination_store (ENameSelectorEntry *name_selector_entry)
{
GtkTreeIter iter;
- g_signal_connect_swapped (name_selector_entry->priv->destination_store, "row-changed",
- G_CALLBACK (destination_row_changed), name_selector_entry);
- g_signal_connect_swapped (name_selector_entry->priv->destination_store, "row-deleted",
- G_CALLBACK (destination_row_deleted), name_selector_entry);
- g_signal_connect_swapped (name_selector_entry->priv->destination_store, "row-inserted",
- G_CALLBACK (destination_row_inserted), name_selector_entry);
+ g_signal_connect_swapped (
+ name_selector_entry->priv->destination_store, "row-changed",
+ G_CALLBACK (destination_row_changed), name_selector_entry);
+ g_signal_connect_swapped (
+ name_selector_entry->priv->destination_store, "row-deleted",
+ G_CALLBACK (destination_row_deleted), name_selector_entry);
+ g_signal_connect_swapped (
+ name_selector_entry->priv->destination_store, "row-inserted",
+ G_CALLBACK (destination_row_inserted), name_selector_entry);
if (!gtk_tree_model_get_iter_first (GTK_TREE_MODEL (name_selector_entry->priv->destination_store), &iter))
return;
@@ -2475,8 +2514,9 @@ prepare_popup_destination (ENameSelectorEntry *name_selector_entry,
name_selector_entry->priv->popup_destination = NULL;
}
- gtk_entry_get_layout_offsets (GTK_ENTRY (name_selector_entry),
- &layout_offset_x, &layout_offset_y);
+ gtk_entry_get_layout_offsets (
+ GTK_ENTRY (name_selector_entry),
+ &layout_offset_x, &layout_offset_y);
x = (event_button->x + 0.5) - layout_offset_x;
y = (event_button->y + 0.5) - layout_offset_y;
@@ -2490,7 +2530,7 @@ prepare_popup_destination (ENameSelectorEntry *name_selector_entry,
index = gtk_entry_layout_index_to_text_index (GTK_ENTRY (name_selector_entry), index);
destination = find_destination_at_position (name_selector_entry, index);
/* FIXME: Add this to a private variable, in ENameSelectorEntry Class*/
- g_object_set_data ((GObject *)name_selector_entry, "index", GINT_TO_POINTER(index));
+ g_object_set_data ((GObject *) name_selector_entry, "index", GINT_TO_POINTER (index));
if (!destination || !e_destination_get_contact (destination))
return FALSE;
@@ -2600,7 +2640,7 @@ eab_parse_qp_email (const gchar *string,
struct _camel_header_address *address;
gboolean res = FALSE;
- address = camel_header_address_decode (string, "UTF-8");
+ address = camel_header_address_decode (string, "UTF-8");
if (!address)
return FALSE;
@@ -2627,7 +2667,7 @@ popup_activate_inline_expand (ENameSelectorEntry *name_selector_entry,
gint position, start, end;
const GList *dests;
- position = GPOINTER_TO_INT(g_object_get_data ((GObject *)name_selector_entry, "index"));
+ position = GPOINTER_TO_INT (g_object_get_data ((GObject *) name_selector_entry, "index"));
for (dests = e_destination_list_get_dests (destination); dests; dests = dests->next) {
const EDestination *dest = dests->data;
@@ -2716,8 +2756,9 @@ popup_activate_contact (ENameSelectorEntry *name_selector_entry,
contact_list_editor = (*name_selector_entry->priv->contact_list_editor_func) (book_client, contact, FALSE, TRUE);
g_object_ref (name_selector_entry);
- g_signal_connect (contact_list_editor, "editor_closed",
- G_CALLBACK (editor_closed_cb), name_selector_entry);
+ g_signal_connect (
+ contact_list_editor, "editor_closed",
+ G_CALLBACK (editor_closed_cb), name_selector_entry);
} else {
GtkWidget *contact_editor;
@@ -2726,8 +2767,9 @@ popup_activate_contact (ENameSelectorEntry *name_selector_entry,
contact_editor = (*name_selector_entry->priv->contact_editor_func) (book_client, contact, FALSE, TRUE);
g_object_ref (name_selector_entry);
- g_signal_connect (contact_editor, "editor_closed",
- G_CALLBACK (editor_closed_cb), name_selector_entry);
+ g_signal_connect (
+ contact_editor, "editor_closed",
+ G_CALLBACK (editor_closed_cb), name_selector_entry);
}
}
@@ -2898,7 +2940,9 @@ populate_popup (ENameSelectorEntry *name_selector_entry,
if (length > 1) {
menu_item = gtk_check_menu_item_new_with_label (email);
- g_signal_connect (menu_item, "toggled", G_CALLBACK (destination_set_list), dest);
+ g_signal_connect (
+ menu_item, "toggled",
+ G_CALLBACK (destination_set_list), dest);
} else {
menu_item = gtk_menu_item_new_with_label (email);
}
@@ -2908,9 +2952,12 @@ populate_popup (ENameSelectorEntry *name_selector_entry,
show_menu = TRUE;
if (length > 1) {
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), !e_destination_is_ignored (dest));
- g_signal_connect_swapped (menu_item, "activate", G_CALLBACK (popup_activate_list),
- dest);
+ gtk_check_menu_item_set_active (
+ GTK_CHECK_MENU_ITEM (menu_item),
+ !e_destination_is_ignored (dest));
+ g_signal_connect_swapped (
+ menu_item, "activate",
+ G_CALLBACK (popup_activate_list), dest);
}
}
@@ -2939,8 +2986,10 @@ populate_popup (ENameSelectorEntry *name_selector_entry,
if (i == email_num && len > 1) {
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), TRUE);
- g_signal_connect_swapped (menu_item, "activate", G_CALLBACK (popup_activate_email),
- name_selector_entry);
+ g_signal_connect_swapped (
+ menu_item, "activate",
+ G_CALLBACK (popup_activate_email),
+ name_selector_entry);
}
}
}
@@ -2956,13 +3005,14 @@ populate_popup (ENameSelectorEntry *name_selector_entry,
/* Expand a list inline */
if (is_list) {
/* To Translators: This would be similiar to "Expand MyList Inline" where MyList is a Contact List*/
- edit_label = g_strdup_printf (_("E_xpand %s Inline"), (gchar *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
+ edit_label = g_strdup_printf (_("E_xpand %s Inline"), (gchar *) e_contact_get_const (contact, E_CONTACT_FILE_AS));
menu_item = gtk_menu_item_new_with_mnemonic (edit_label);
g_free (edit_label);
gtk_widget_show (menu_item);
gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item);
- g_signal_connect_swapped (menu_item, "activate", G_CALLBACK (popup_activate_inline_expand),
- name_selector_entry);
+ g_signal_connect_swapped (
+ menu_item, "activate", G_CALLBACK (popup_activate_inline_expand),
+ name_selector_entry);
/* Separator */
menu_item = gtk_separator_menu_item_new ();
@@ -2971,24 +3021,26 @@ populate_popup (ENameSelectorEntry *name_selector_entry,
}
/* Copy Contact Item */
- copy_label = g_strdup_printf (_("Cop_y %s"), (gchar *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
+ copy_label = g_strdup_printf (_("Cop_y %s"), (gchar *) e_contact_get_const (contact, E_CONTACT_FILE_AS));
menu_item = gtk_menu_item_new_with_mnemonic (copy_label);
g_free (copy_label);
gtk_widget_show (menu_item);
gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item);
- g_signal_connect_swapped (menu_item, "activate", G_CALLBACK (popup_activate_copy),
- name_selector_entry);
+ g_signal_connect_swapped (
+ menu_item, "activate", G_CALLBACK (popup_activate_copy),
+ name_selector_entry);
/* Cut Contact Item */
- cut_label = g_strdup_printf (_("C_ut %s"), (gchar *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
+ cut_label = g_strdup_printf (_("C_ut %s"), (gchar *) e_contact_get_const (contact, E_CONTACT_FILE_AS));
menu_item = gtk_menu_item_new_with_mnemonic (cut_label);
g_free (cut_label);
gtk_widget_show (menu_item);
gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item);
- g_signal_connect_swapped (menu_item, "activate", G_CALLBACK (popup_activate_cut),
- name_selector_entry);
+ g_signal_connect_swapped (
+ menu_item, "activate", G_CALLBACK (popup_activate_cut),
+ name_selector_entry);
if (show_menu) {
menu_item = gtk_separator_menu_item_new ();
@@ -2998,14 +3050,15 @@ populate_popup (ENameSelectorEntry *name_selector_entry,
/* Edit Contact item */
- edit_label = g_strdup_printf (_("_Edit %s"), (gchar *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
+ edit_label = g_strdup_printf (_("_Edit %s"), (gchar *) e_contact_get_const (contact, E_CONTACT_FILE_AS));
menu_item = gtk_menu_item_new_with_mnemonic (edit_label);
g_free (edit_label);
gtk_widget_show (menu_item);
gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item);
- g_signal_connect_swapped (menu_item, "activate", G_CALLBACK (popup_activate_contact),
- name_selector_entry);
+ g_signal_connect_swapped (
+ menu_item, "activate", G_CALLBACK (popup_activate_contact),
+ name_selector_entry);
deep_free_list (email_list);
}
diff --git a/libedataserverui/e-name-selector-list.c b/libedataserverui/e-name-selector-list.c
index 13a7d04..f22c894 100644
--- a/libedataserverui/e-name-selector-list.c
+++ b/libedataserverui/e-name-selector-list.c
@@ -102,11 +102,12 @@ enl_popup_grab (ENameSelectorList *list)
gtk_grab_add (GTK_WIDGET (list->priv->popup));
- gdk_pointer_grab (window, TRUE,
- GDK_BUTTON_PRESS_MASK |
- GDK_BUTTON_RELEASE_MASK |
- GDK_POINTER_MOTION_MASK,
- NULL, NULL, GDK_CURRENT_TIME);
+ gdk_pointer_grab (
+ window, TRUE,
+ GDK_BUTTON_PRESS_MASK |
+ GDK_BUTTON_RELEASE_MASK |
+ GDK_POINTER_MOTION_MASK,
+ NULL, NULL, GDK_CURRENT_TIME);
gdk_keyboard_grab (window, TRUE, GDK_CURRENT_TIME);
gtk_widget_grab_focus ((GtkWidget *) list);
@@ -439,7 +440,7 @@ enl_tree_button_press_event (GtkWidget *widget,
gtk_menu_popdown (GTK_MENU (list->priv->menu));
}
menu = gtk_menu_new ();
- g_signal_connect (menu, "deactivate", G_CALLBACK(menu_deactivate), list);
+ g_signal_connect (menu, "deactivate", G_CALLBACK (menu_deactivate), list);
list->priv->menu = menu;
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, event->button, gtk_get_current_event_time ());
@@ -461,7 +462,9 @@ enl_tree_button_press_event (GtkWidget *widget,
if (length > 1) {
menu_item = gtk_check_menu_item_new_with_label (email);
- g_signal_connect (menu_item, "toggled", G_CALLBACK (destination_set_list), dest);
+ g_signal_connect (
+ menu_item, "toggled",
+ G_CALLBACK (destination_set_list), dest);
} else {
menu_item = gtk_menu_item_new_with_label (email);
}
@@ -471,9 +474,12 @@ enl_tree_button_press_event (GtkWidget *widget,
show_menu = TRUE;
if (length > 1) {
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), !e_destination_is_ignored (dest));
- g_signal_connect_swapped (menu_item, "activate", G_CALLBACK (popup_activate_list),
- dest);
+ gtk_check_menu_item_set_active (
+ GTK_CHECK_MENU_ITEM (menu_item),
+ !e_destination_is_ignored (dest));
+ g_signal_connect_swapped (
+ menu_item, "activate",
+ G_CALLBACK (popup_activate_list), dest);
}
}
@@ -490,7 +496,10 @@ enl_tree_button_press_event (GtkWidget *widget,
if (len > 1) {
menu_item = gtk_radio_menu_item_new_with_label (group, email);
group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_item));
- g_signal_connect (menu_item, "toggled", G_CALLBACK (destination_set_email), destination);
+ g_signal_connect (
+ menu_item, "toggled",
+ G_CALLBACK (destination_set_email),
+ destination);
} else {
menu_item = gtk_menu_item_new_with_label (email);
}
@@ -502,8 +511,10 @@ enl_tree_button_press_event (GtkWidget *widget,
if (i == email_num && len > 1) {
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), TRUE);
- g_signal_connect_swapped (menu_item, "activate", G_CALLBACK (popup_activate_email),
- entry);
+ g_signal_connect_swapped (
+ menu_item, "activate",
+ G_CALLBACK (popup_activate_email),
+ entry);
}
}
g_list_foreach (email_list, (GFunc) g_free, NULL);
@@ -518,7 +529,7 @@ enl_tree_button_press_event (GtkWidget *widget,
gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item);
}
- delete_label = g_strdup_printf(_("_Delete %s"), (gchar *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
+ delete_label = g_strdup_printf (_("_Delete %s"), (gchar *) e_contact_get_const (contact, E_CONTACT_FILE_AS));
menu_item = gtk_menu_item_new_with_mnemonic (delete_label);
g_free (delete_label);
gtk_widget_show (menu_item);
@@ -528,8 +539,9 @@ enl_tree_button_press_event (GtkWidget *widget,
row_info->list = list;
row_info->path = path;
- g_signal_connect (menu_item, "activate", G_CALLBACK (popup_delete_row),
- row_info);
+ g_signal_connect (
+ menu_item, "activate",
+ G_CALLBACK (popup_delete_row), row_info);
return TRUE;
@@ -657,11 +669,11 @@ e_name_selector_list_init (ENameSelectorList *list)
gtk_tree_view_column_set_clickable (column, TRUE);
scroll = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll),
- GTK_POLICY_NEVER,
- GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroll),
- GTK_SHADOW_NONE);
+ gtk_scrolled_window_set_policy (
+ GTK_SCROLLED_WINDOW (scroll),
+ GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+ gtk_scrolled_window_set_shadow_type (
+ GTK_SCROLLED_WINDOW (scroll), GTK_SHADOW_NONE);
gtk_widget_set_size_request (
gtk_scrolled_window_get_vscrollbar (
GTK_SCROLLED_WINDOW (scroll)), -1, 0);
@@ -670,8 +682,8 @@ e_name_selector_list_init (ENameSelectorList *list)
gtk_window_set_resizable (GTK_WINDOW (list->priv->popup), FALSE);
popup_frame = gtk_frame_new (NULL);
- gtk_frame_set_shadow_type (GTK_FRAME (popup_frame),
- GTK_SHADOW_ETCHED_IN);
+ gtk_frame_set_shadow_type (
+ GTK_FRAME (popup_frame), GTK_SHADOW_ETCHED_IN);
gtk_container_add (GTK_CONTAINER (list->priv->popup), popup_frame);
@@ -679,19 +691,34 @@ e_name_selector_list_init (ENameSelectorList *list)
gtk_container_add (GTK_CONTAINER (popup_frame), vbox);
gtk_container_add (GTK_CONTAINER (scroll), list->priv->tree_view);
- gtk_box_pack_start (GTK_BOX (vbox), scroll,
- TRUE, TRUE, 0);
-
- g_signal_connect_after (GTK_WIDGET (list), "focus-in-event", G_CALLBACK(enl_entry_focus_in), NULL);
- g_signal_connect (GTK_WIDGET (list), "focus-out-event", G_CALLBACK(enl_entry_focus_out), NULL);
- g_signal_connect (GTK_WIDGET (list), "key-press-event", G_CALLBACK(enl_entry_key_press_event), NULL);
-
- g_signal_connect_after (list->priv->tree_view, "key-press-event", G_CALLBACK(enl_tree_key_press_event), list);
- g_signal_connect (list->priv->tree_view, "button-press-event", G_CALLBACK (enl_tree_button_press_event), list);
-
- g_signal_connect (GTK_WIDGET (list->priv->popup), "button-press-event", G_CALLBACK(enl_popup_button_press), list);
- g_signal_connect (GTK_WIDGET (list->priv->popup), "focus-out-event", G_CALLBACK(enl_popup_focus_out), list);
- g_signal_connect (GTK_WIDGET (list->priv->popup), "enter-notify-event", G_CALLBACK (enl_popup_enter_notify), list);
+ gtk_box_pack_start (GTK_BOX (vbox), scroll, TRUE, TRUE, 0);
+
+ g_signal_connect_after (
+ GTK_WIDGET (list), "focus-in-event",
+ G_CALLBACK (enl_entry_focus_in), NULL);
+ g_signal_connect (
+ GTK_WIDGET (list), "focus-out-event",
+ G_CALLBACK (enl_entry_focus_out), NULL);
+ g_signal_connect (
+ GTK_WIDGET (list), "key-press-event",
+ G_CALLBACK (enl_entry_key_press_event), NULL);
+
+ g_signal_connect_after (
+ list->priv->tree_view, "key-press-event",
+ G_CALLBACK (enl_tree_key_press_event), list);
+ g_signal_connect (
+ list->priv->tree_view, "button-press-event",
+ G_CALLBACK (enl_tree_button_press_event), list);
+
+ g_signal_connect (
+ list->priv->popup, "button-press-event",
+ G_CALLBACK (enl_popup_button_press), list);
+ g_signal_connect (
+ list->priv->popup, "focus-out-event",
+ G_CALLBACK (enl_popup_focus_out), list);
+ g_signal_connect (
+ list->priv->popup, "enter-notify-event",
+ G_CALLBACK (enl_popup_enter_notify), list);
}
diff --git a/libedataserverui/e-name-selector-model.c b/libedataserverui/e-name-selector-model.c
index 98e66b1..770f514 100644
--- a/libedataserverui/e-name-selector-model.c
+++ b/libedataserverui/e-name-selector-model.c
@@ -81,9 +81,10 @@ e_name_selector_model_init (ENameSelectorModel *name_selector_model)
name_selector_model->priv->contact_filter =
e_tree_model_generator_new (GTK_TREE_MODEL (name_selector_model->priv->contact_store));
- e_tree_model_generator_set_generate_func (name_selector_model->priv->contact_filter,
- (ETreeModelGeneratorGenerateFunc) generate_contact_rows,
- name_selector_model, NULL);
+ e_tree_model_generator_set_generate_func (
+ name_selector_model->priv->contact_filter,
+ (ETreeModelGeneratorGenerateFunc) generate_contact_rows,
+ name_selector_model, NULL);
e_tree_model_generator_set_modify_func (name_selector_model->priv->contact_filter,
(ETreeModelGeneratorModifyFunc) override_email_address,
name_selector_model, NULL);
@@ -312,9 +313,12 @@ destinations_changed (ENameSelectorModel *name_selector_model)
destination_uid = e_destination_get_contact_uid (destination);
if (destination_uid)
- g_hash_table_insert (destination_uid_hash_new,
- g_strdup_printf ("%s:%d", destination_uid, e_destination_get_email_num (destination)),
- GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (
+ destination_uid_hash_new,
+ g_strdup_printf (
+ "%s:%d", destination_uid,
+ e_destination_get_email_num (destination)),
+ GINT_TO_POINTER (TRUE));
}
g_list_free (destinations);
@@ -326,13 +330,17 @@ destinations_changed (ENameSelectorModel *name_selector_model)
hash_compare.name_selector_model = name_selector_model;
hash_compare.other_hash = destination_uid_hash_old;
- g_hash_table_foreach (destination_uid_hash_new, (GHFunc) emit_destination_uid_changes_cb,
- &hash_compare);
+ g_hash_table_foreach (
+ destination_uid_hash_new,
+ (GHFunc) emit_destination_uid_changes_cb,
+ &hash_compare);
if (destination_uid_hash_old) {
hash_compare.other_hash = destination_uid_hash_new;
- g_hash_table_foreach (destination_uid_hash_old, (GHFunc) emit_destination_uid_changes_cb,
- &hash_compare);
+ g_hash_table_foreach (
+ destination_uid_hash_old,
+ (GHFunc) emit_destination_uid_changes_cb,
+ &hash_compare);
g_hash_table_destroy (destination_uid_hash_old);
}
@@ -349,8 +357,9 @@ free_section (ENameSelectorModel *name_selector_model,
section = &g_array_index (name_selector_model->priv->sections, Section, n);
- g_signal_handlers_disconnect_matched (section->destination_store, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, name_selector_model);
+ g_signal_handlers_disconnect_matched (
+ section->destination_store, G_SIGNAL_MATCH_DATA,
+ 0, 0, NULL, NULL, name_selector_model);
g_free (section->name);
g_free (section->pretty_name);
@@ -478,12 +487,15 @@ e_name_selector_model_add_section (ENameSelectorModel *name_selector_model,
else
section.destination_store = e_destination_store_new ();
- g_signal_connect_swapped (section.destination_store, "row-changed",
- G_CALLBACK (destinations_changed), name_selector_model);
- g_signal_connect_swapped (section.destination_store, "row-deleted",
- G_CALLBACK (destinations_changed), name_selector_model);
- g_signal_connect_swapped (section.destination_store, "row-inserted",
- G_CALLBACK (destinations_changed), name_selector_model);
+ g_signal_connect_swapped (
+ section.destination_store, "row-changed",
+ G_CALLBACK (destinations_changed), name_selector_model);
+ g_signal_connect_swapped (
+ section.destination_store, "row-deleted",
+ G_CALLBACK (destinations_changed), name_selector_model);
+ g_signal_connect_swapped (
+ section.destination_store, "row-inserted",
+ G_CALLBACK (destinations_changed), name_selector_model);
g_array_append_val (name_selector_model->priv->sections, section);
diff --git a/libedataserverui/e-passwords.c b/libedataserverui/e-passwords.c
index 96ce70e..5d6c3dd 100644
--- a/libedataserverui/e-passwords.c
+++ b/libedataserverui/e-passwords.c
@@ -698,7 +698,7 @@ update_capslock_state (GtkDialog *dialog,
/* The space acts as a vertical placeholder. */
markup = g_markup_printf_escaped (
"<small>%s</small>", (mask & GDK_LOCK_MASK) ?
- _("You have the Caps Lock key on.") : " ");
+ _("You have the Caps Lock key on.") : " ");
gtk_label_set_markup (GTK_LABEL (label), markup);
g_free (markup);
@@ -820,13 +820,13 @@ ep_ask_password (EPassMsg *msg)
(type == E_PASSWORDS_REMEMBER_FOREVER)
? _("_Remember this passphrase")
: _("_Remember this passphrase for"
- " the remainder of this session"));
+ " the remainder of this session"));
} else {
widget = gtk_check_button_new_with_mnemonic (
(type == E_PASSWORDS_REMEMBER_FOREVER)
? _("_Remember this password")
: _("_Remember this password for"
- " the remainder of this session"));
+ " the remainder of this session"));
}
gtk_toggle_button_set_active (
diff --git a/libedataserverui/e-tree-model-generator.c b/libedataserverui/e-tree-model-generator.c
index 122ed2d..aff9129 100644
--- a/libedataserverui/e-tree-model-generator.c
+++ b/libedataserverui/e-tree-model-generator.c
@@ -142,12 +142,15 @@ tree_model_generator_set_property (GObject *object,
tree_model_generator->priv->root_nodes =
build_node_map (tree_model_generator, NULL, NULL, -1);
- g_signal_connect_swapped (tree_model_generator->priv->child_model, "row-changed",
- G_CALLBACK (child_row_changed), tree_model_generator);
- g_signal_connect_swapped (tree_model_generator->priv->child_model, "row-deleted",
- G_CALLBACK (child_row_deleted), tree_model_generator);
- g_signal_connect_swapped (tree_model_generator->priv->child_model, "row-inserted",
- G_CALLBACK (child_row_inserted), tree_model_generator);
+ g_signal_connect_swapped (
+ tree_model_generator->priv->child_model, "row-changed",
+ G_CALLBACK (child_row_changed), tree_model_generator);
+ g_signal_connect_swapped (
+ tree_model_generator->priv->child_model, "row-deleted",
+ G_CALLBACK (child_row_deleted), tree_model_generator);
+ g_signal_connect_swapped (
+ tree_model_generator->priv->child_model, "row-inserted",
+ G_CALLBACK (child_row_inserted), tree_model_generator);
break;
default:
@@ -182,9 +185,10 @@ tree_model_generator_finalize (GObject *object)
ETreeModelGenerator *tree_model_generator = E_TREE_MODEL_GENERATOR (object);
if (tree_model_generator->priv->child_model) {
- g_signal_handlers_disconnect_matched (tree_model_generator->priv->child_model,
- G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL,
- tree_model_generator);
+ g_signal_handlers_disconnect_matched (
+ tree_model_generator->priv->child_model,
+ G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL,
+ tree_model_generator);
g_object_unref (tree_model_generator->priv->child_model);
}
@@ -521,9 +525,10 @@ create_node_at_child_path (ETreeModelGenerator *tree_model_generator,
if (group->len - 1 - index > 0) {
gint i;
- memmove ((Node *) group->data + index + 1,
- (Node *) group->data + index,
- (group->len - 1 - index) * sizeof (Node));
+ memmove (
+ (Node *) group->data + index + 1,
+ (Node *) group->data + index,
+ (group->len - 1 - index) * sizeof (Node));
/* Update parent pointers */
for (i = index + 1; i < group->len; i++) {
@@ -548,8 +553,9 @@ create_node_at_child_path (ETreeModelGenerator *tree_model_generator,
node->n_generated = 0;
node->child_nodes = NULL;
- ETMG_DEBUG (g_print ("Created node at offset %d, parent_group = %p, parent_index = %d\n",
- index, node->parent_group, node->parent_index));
+ ETMG_DEBUG (
+ g_print ("Created node at offset %d, parent_group = %p, parent_index = %d\n",
+ index, node->parent_group, node->parent_index));
return node;
}
@@ -565,8 +571,9 @@ dump_group (GArray *group)
for (i = 0; i < group->len; i++) {
Node *node = &g_array_index (group, Node, i);
- g_print (" %04d: pgroup=%p, pindex=%d, n_generated=%d, child_nodes=%p\n",
- i, node->parent_group, node->parent_index, node->n_generated, node->child_nodes);
+ g_print (
+ " %04d: pgroup=%p, pindex=%d, n_generated=%d, child_nodes=%p\n",
+ i, node->parent_group, node->parent_index, node->n_generated, node->child_nodes);
}
}
@@ -742,8 +749,9 @@ e_tree_model_generator_new (GtkTreeModel *child_model)
{
g_return_val_if_fail (GTK_IS_TREE_MODEL (child_model), NULL);
- return E_TREE_MODEL_GENERATOR (g_object_new (E_TYPE_TREE_MODEL_GENERATOR,
- "child-model", child_model, NULL));
+ return E_TREE_MODEL_GENERATOR (
+ g_object_new (E_TYPE_TREE_MODEL_GENERATOR,
+ "child-model", child_model, NULL));
}
/**
@@ -1321,8 +1329,9 @@ e_tree_model_generator_get_value (GtkTreeModel *tree_model,
g_return_if_fail (E_IS_TREE_MODEL_GENERATOR (tree_model));
g_return_if_fail (ITER_IS_VALID (tree_model_generator, iter));
- e_tree_model_generator_convert_iter_to_child_iter (tree_model_generator, &child_iter,
- &permutation_n, iter);
+ e_tree_model_generator_convert_iter_to_child_iter (
+ tree_model_generator, &child_iter,
+ &permutation_n, iter);
if (tree_model_generator->priv->modify_func) {
tree_model_generator->priv->modify_func (tree_model_generator->priv->child_model,
diff --git a/tests/libebook/client/client-test-utils.c b/tests/libebook/client/client-test-utils.c
index e84a473..ee6cafe 100644
--- a/tests/libebook/client/client-test-utils.c
+++ b/tests/libebook/client/client-test-utils.c
@@ -30,7 +30,7 @@ print_email (EContact *contact)
g_print (" Email addresses:\n");
emails = e_contact_get (contact, E_CONTACT_EMAIL);
for (e = emails; e; e = e->next) {
- g_print ("\t%s\n", (gchar *)e->data);
+ g_print ("\t%s\n", (gchar *) e->data);
}
g_list_foreach (emails, (GFunc) g_free, NULL);
g_list_free (emails);
@@ -338,11 +338,11 @@ new_vcard_from_test_case (const gchar *case_name)
GError *error = NULL;
gchar *vcard;
- case_filename = g_strdup_printf ("%s.vcf", case_name);
+ case_filename = g_strdup_printf ("%s.vcf", case_name);
filename = g_build_filename (SRCDIR, "..", "data", "vcards", case_filename, NULL);
file = g_file_new_for_path (filename);
if (!g_file_load_contents (file, NULL, &vcard, NULL, NULL, &error)) {
- g_warning ("failed to read test contact file '%s': %s",
+ g_warning ("failed to read test contact file '%s': %s",
filename, error->message);
exit (1);
}
diff --git a/tests/libebook/client/test-client-get-revision.c b/tests/libebook/client/test-client-get-revision.c
index d13e863..adac4ed 100644
--- a/tests/libebook/client/test-client-get-revision.c
+++ b/tests/libebook/client/test-client-get-revision.c
@@ -16,7 +16,7 @@ get_revision_compare_cycle (EBookClient *client)
GError *error = NULL;
if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION, &revision_before, NULL, &error))
- g_error ("Error getting book revision: %s", error->message);
+ g_error ("Error getting book revision: %s", error->message);
if (!add_contact_from_test_case_verify (client, "simple-1", &contact)) {
g_object_unref (client);
@@ -29,7 +29,7 @@ get_revision_compare_cycle (EBookClient *client)
g_object_unref (contact);
if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION, &revision_after, NULL, &error))
- g_error ("Error getting book revision: %s", error->message);
+ g_error ("Error getting book revision: %s", error->message);
g_assert (revision_before);
g_assert (revision_after);
diff --git a/tests/libebook/client/test-client-photo-is-uri.c b/tests/libebook/client/test-client-photo-is-uri.c
index 19f9029..ea4ba20 100644
--- a/tests/libebook/client/test-client-photo-is-uri.c
+++ b/tests/libebook/client/test-client-photo-is-uri.c
@@ -78,7 +78,7 @@ objects_removed (EBookClientView *book_view,
GSList *l;
for (l = (GSList *) ids; l; l = l->next) {
- g_print ("Removed contact: %s\n", (gchar *)l->data);
+ g_print ("Removed contact: %s\n", (gchar *) l->data);
}
}
diff --git a/tests/libebook/client/test-client-revision-view.c b/tests/libebook/client/test-client-revision-view.c
index 02214ce..88d8b01 100644
--- a/tests/libebook/client/test-client-revision-view.c
+++ b/tests/libebook/client/test-client-revision-view.c
@@ -67,9 +67,9 @@ setup_book (EBookClient **book_out)
static void
print_contact (EContact *contact)
{
- g_print ("Contact: %s\n", (gchar *)e_contact_get_const (contact, E_CONTACT_FULL_NAME));
- g_print ("UID: %s\n", (gchar *)e_contact_get_const (contact, E_CONTACT_UID));
- g_print ("REV: %s\n", (gchar *)e_contact_get_const (contact, E_CONTACT_REV));
+ g_print ("Contact: %s\n", (gchar *) e_contact_get_const (contact, E_CONTACT_FULL_NAME));
+ g_print ("UID: %s\n", (gchar *) e_contact_get_const (contact, E_CONTACT_UID));
+ g_print ("REV: %s\n", (gchar *) e_contact_get_const (contact, E_CONTACT_REV));
g_print ("\n");
}
diff --git a/tests/libebook/client/test-client-uid-only-view.c b/tests/libebook/client/test-client-uid-only-view.c
index 21d78f5..8fb6851 100644
--- a/tests/libebook/client/test-client-uid-only-view.c
+++ b/tests/libebook/client/test-client-uid-only-view.c
@@ -122,13 +122,13 @@ print_contact (EContact *contact)
{
GList *emails, *e;
- g_print ("Contact: %s\n", (gchar *)e_contact_get_const (contact, E_CONTACT_FULL_NAME));
- g_print ("UID: %s\n", (gchar *)e_contact_get_const (contact, E_CONTACT_UID));
+ g_print ("Contact: %s\n", (gchar *) e_contact_get_const (contact, E_CONTACT_FULL_NAME));
+ g_print ("UID: %s\n", (gchar *) e_contact_get_const (contact, E_CONTACT_UID));
g_print ("Email addresses:\n");
emails = e_contact_get (contact, E_CONTACT_EMAIL);
for (e = emails; e; e = e->next) {
- g_print ("\t%s\n", (gchar *)e->data);
+ g_print ("\t%s\n", (gchar *) e->data);
}
g_list_foreach (emails, (GFunc) g_free, NULL);
g_list_free (emails);
diff --git a/tests/libebook/ebook-test-utils.c b/tests/libebook/ebook-test-utils.c
index 82750be..c96692a 100644
--- a/tests/libebook/ebook-test-utils.c
+++ b/tests/libebook/ebook-test-utils.c
@@ -47,11 +47,11 @@ ebook_test_utils_new_vcard_from_test_case (const gchar *case_name)
GError *error = NULL;
gchar *vcard;
- case_filename = g_strdup_printf ("%s.vcf", case_name);
+ case_filename = g_strdup_printf ("%s.vcf", case_name);
filename = g_build_filename (SRCDIR, EBOOK_TEST_UTILS_DATA_DIR, EBOOK_TEST_UTILS_VCARDS_DIR, case_filename, NULL);
file = g_file_new_for_path (filename);
if (!g_file_load_contents (file, NULL, &vcard, NULL, NULL, &error)) {
- g_warning ("failed to read test contact file '%s': %s",
+ g_warning ("failed to read test contact file '%s': %s",
filename, error->message);
exit (1);
}
@@ -121,7 +121,7 @@ ebook_test_utils_book_add_contact (EBook *book,
source = e_book_get_source (book);
name = e_source_get_display_name (source);
- g_warning ("failed to add contact to addressbook: `%s': %s",
+ g_warning ("failed to add contact to addressbook: `%s': %s",
name, error->message);
exit (1);
}
@@ -136,13 +136,13 @@ add_contact_cb (EBook *book,
EBookTestClosure *closure)
{
if (error) {
- g_warning ("failed to asynchronously add the contact '%s': "
- "status %d (%s)", uid, error->code, error->message);
+ g_warning ("failed to asynchronously add the contact '%s': "
+ "status %d (%s)", uid, error->code, error->message);
exit (1);
}
- test_print ("successfully asynchronously added the contact "
- "addressbook\n");
+ test_print ("successfully asynchronously added the contact "
+ "addressbook\n");
if (closure->cb)
(*closure->cb) (closure);
@@ -162,7 +162,7 @@ ebook_test_utils_book_async_add_contact (EBook *book,
closure->user_data = user_data;
if (!e_book_add_contact_async (book, contact,
(EBookIdAsyncCallback) add_contact_cb, closure)) {
- g_warning ("failed to set up contact add");
+ g_warning ("failed to set up contact add");
exit (1);
}
}
@@ -182,7 +182,7 @@ ebook_test_utils_book_commit_contact (EBook *book,
source = e_book_get_source (book);
name = e_source_get_display_name (source);
- g_warning ("failed to commit changes to contact '%s' to addressbook: `%s': %s",
+ g_warning ("failed to commit changes to contact '%s' to addressbook: `%s': %s",
uid, name, error->message);
exit (1);
}
@@ -194,13 +194,13 @@ commit_contact_cb (EBook *book,
EBookTestClosure *closure)
{
if (error) {
- g_warning ("failed to asynchronously commit the contact: "
- "status %d (%s)", error->code, error->message);
+ g_warning ("failed to asynchronously commit the contact: "
+ "status %d (%s)", error->code, error->message);
exit (1);
}
- test_print ("successfully asynchronously committed the contact to the "
- "addressbook\n");
+ test_print ("successfully asynchronously committed the contact to the "
+ "addressbook\n");
if (closure->cb)
(*closure->cb) (closure);
@@ -220,7 +220,7 @@ ebook_test_utils_book_async_commit_contact (EBook *book,
closure->user_data = user_data;
if (!e_book_commit_contact_async (book, contact,
(EBookAsyncCallback) commit_contact_cb, closure)) {
- g_warning ("failed to set up contact commit");
+ g_warning ("failed to set up contact commit");
exit (1);
}
}
@@ -238,8 +238,8 @@ ebook_test_utils_book_get_contact (EBook *book,
source = e_book_get_source (book);
name = e_source_get_display_name (source);
- g_warning ("failed to get contact '%s' in addressbook: `%s': "
- "%s", uid, name, error->message);
+ g_warning ("failed to get contact '%s' in addressbook: `%s': "
+ "%s", uid, name, error->message);
exit (1);
}
@@ -255,13 +255,13 @@ get_contact_cb (EBook *book,
const gchar *uid;
if (error) {
- g_warning ("failed to asynchronously get the contact: "
- "status %d (%s)", error->code, error->message);
+ g_warning ("failed to asynchronously get the contact: "
+ "status %d (%s)", error->code, error->message);
exit (1);
}
uid = e_contact_get_const (contact, E_CONTACT_UID);
- test_print ("successfully asynchronously retrieved the contact '%s'\n",
+ test_print ("successfully asynchronously retrieved the contact '%s'\n",
uid);
if (closure->cb)
@@ -284,7 +284,7 @@ ebook_test_utils_book_async_get_contact (EBook *book,
if (!e_book_get_contact_async (book, uid,
(EBookContactAsyncCallback) get_contact_cb,
closure)) {
- g_warning ("failed to set up async getContact");
+ g_warning ("failed to set up async getContact");
exit (1);
}
}
@@ -301,8 +301,8 @@ ebook_test_utils_book_get_required_fields (EBook *book)
source = e_book_get_source (book);
name = e_source_get_display_name (source);
- g_warning ("failed to get required fields for addressbook "
- "`%s': %s", name, error->message);
+ g_warning ("failed to get required fields for addressbook "
+ "`%s': %s", name, error->message);
exit (1);
}
@@ -316,14 +316,14 @@ get_required_fields_cb (EBook *book,
EBookTestClosure *closure)
{
if (error) {
- g_warning ("failed to asynchronously get the required fields: "
- "status %d (%s)", error->code, error->message);
+ g_warning ("failed to asynchronously get the required fields: "
+ "status %d (%s)", error->code, error->message);
exit (1);
}
closure->list = fields;
- test_print ("successfully asynchronously retrieved the required fields\n");
+ test_print ("successfully asynchronously retrieved the required fields\n");
if (closure->cb)
(*closure->cb) (closure);
@@ -344,7 +344,7 @@ ebook_test_utils_book_async_get_required_fields (EBook *book,
if (!e_book_get_required_fields_async (book,
(EBookEListAsyncCallback) get_required_fields_cb,
closure)) {
- g_warning ("failed to set up async getRequiredFields");
+ g_warning ("failed to set up async getRequiredFields");
exit (1);
}
}
@@ -361,8 +361,8 @@ ebook_test_utils_book_get_static_capabilities (EBook *book)
source = e_book_get_source (book);
name = e_source_get_display_name (source);
- g_warning ("failed to get capabilities for addressbook: `%s': "
- "%s", name, error->message);
+ g_warning ("failed to get capabilities for addressbook: `%s': "
+ "%s", name, error->message);
exit (1);
}
@@ -381,8 +381,8 @@ ebook_test_utils_book_get_supported_auth_methods (EBook *book)
source = e_book_get_source (book);
name = e_source_get_display_name (source);
- g_warning ("failed to get supported auth methods for "
- "addressbook `%s': %s", name, error->message);
+ g_warning ("failed to get supported auth methods for "
+ "addressbook `%s': %s", name, error->message);
exit (1);
}
@@ -396,15 +396,15 @@ get_supported_auth_methods_cb (EBook *book,
EBookTestClosure *closure)
{
if (error) {
- g_warning ("failed to asynchronously get the supported auth "
- "methods: status %d (%s)", error->code, error->message);
+ g_warning ("failed to asynchronously get the supported auth "
+ "methods: status %d (%s)", error->code, error->message);
exit (1);
}
closure->list = methods;
- test_print ("successfully asynchronously retrieved the supported auth "
- "methods\n");
+ test_print ("successfully asynchronously retrieved the supported auth "
+ "methods\n");
if (closure->cb)
(*closure->cb) (closure);
@@ -424,7 +424,7 @@ ebook_test_utils_book_async_get_supported_auth_methods (EBook *book,
if (!e_book_get_supported_auth_methods_async (book,
(EBookEListAsyncCallback) get_supported_auth_methods_cb,
closure)) {
- g_warning ("failed to set up async getSupportedAuthMethods");
+ g_warning ("failed to set up async getSupportedAuthMethods");
exit (1);
}
}
@@ -441,8 +441,8 @@ ebook_test_utils_book_get_supported_fields (EBook *book)
source = e_book_get_source (book);
name = e_source_get_display_name (source);
- g_warning ("failed to get supported fields for addressbook "
- "`%s': %s", name, error->message);
+ g_warning ("failed to get supported fields for addressbook "
+ "`%s': %s", name, error->message);
exit (1);
}
@@ -456,14 +456,14 @@ get_supported_fields_cb (EBook *book,
EBookTestClosure *closure)
{
if (error) {
- g_warning ("failed to asynchronously get the supported fields: "
- "status %d (%s)", error->code, error->message);
+ g_warning ("failed to asynchronously get the supported fields: "
+ "status %d (%s)", error->code, error->message);
exit (1);
}
closure->list = fields;
- test_print ("successfully asynchronously retrieved the supported fields\n");
+ test_print ("successfully asynchronously retrieved the supported fields\n");
if (closure->cb)
(*closure->cb) (closure);
@@ -483,7 +483,7 @@ ebook_test_utils_book_async_get_supported_fields (EBook *book,
if (!e_book_get_supported_fields_async (book,
(EBookEListAsyncCallback) get_supported_fields_cb,
closure)) {
- g_warning ("failed to set up async getSupportedFields");
+ g_warning ("failed to set up async getSupportedFields");
exit (1);
}
}
@@ -500,7 +500,7 @@ ebook_test_utils_book_remove_contact (EBook *book,
source = e_book_get_source (book);
name = e_source_get_display_name (source);
- g_warning ("failed to remove contact '%s' from addressbook: `%s': %s",
+ g_warning ("failed to remove contact '%s' from addressbook: `%s': %s",
uid, name, error->message);
exit (1);
}
@@ -512,12 +512,12 @@ remove_contact_cb (EBook *book,
EBookTestClosure *closure)
{
if (error) {
- g_warning ("failed to asynchronously remove the contact: "
- "status %d (%s)", error->code, error->message);
+ g_warning ("failed to asynchronously remove the contact: "
+ "status %d (%s)", error->code, error->message);
exit (1);
}
- test_print ("successfully asynchronously removed the contact\n");
+ test_print ("successfully asynchronously removed the contact\n");
if (closure->cb)
(*closure->cb) (closure);
@@ -539,7 +539,7 @@ ebook_test_utils_book_async_remove_contact (EBook *book,
if (!e_book_remove_contact_async (book, contact,
(EBookAsyncCallback) remove_contact_cb,
closure)) {
- g_warning ("failed to set up async removeContacts (for a single contact)");
+ g_warning ("failed to set up async removeContacts (for a single contact)");
exit (1);
}
}
@@ -550,12 +550,12 @@ remove_contact_by_id_cb (EBook *book,
EBookTestClosure *closure)
{
if (error) {
- g_warning ("failed to asynchronously remove the contact by id: "
- "status %d (%s)", error->code, error->message);
+ g_warning ("failed to asynchronously remove the contact by id: "
+ "status %d (%s)", error->code, error->message);
exit (1);
}
- test_print ("successfully asynchronously removed the contact by id\n");
+ test_print ("successfully asynchronously removed the contact by id\n");
if (closure->cb)
(*closure->cb) (closure);
@@ -577,7 +577,7 @@ ebook_test_utils_book_async_remove_contact_by_id (EBook *book,
if (!e_book_remove_contact_by_id_async (book, uid,
(EBookAsyncCallback) remove_contact_by_id_cb,
closure)) {
- g_warning ("failed to set up async removeContacts (by id)");
+ g_warning ("failed to set up async removeContacts (by id)");
exit (1);
}
}
@@ -594,7 +594,7 @@ ebook_test_utils_book_remove_contacts (EBook *book,
source = e_book_get_source (book);
name = e_source_get_display_name (source);
- g_warning ("failed to remove contacts from addressbook: `%s': %s",
+ g_warning ("failed to remove contacts from addressbook: `%s': %s",
name, error->message);
exit (1);
}
@@ -606,12 +606,12 @@ remove_contacts_cb (EBook *book,
EBookTestClosure *closure)
{
if (error) {
- g_warning ("failed to asynchronously remove the contacts: "
- "status %d (%s)", error->code, error->message);
+ g_warning ("failed to asynchronously remove the contacts: "
+ "status %d (%s)", error->code, error->message);
exit (1);
}
- test_print ("successfully asynchronously removed the contacts\n");
+ test_print ("successfully asynchronously removed the contacts\n");
if (closure->cb)
(*closure->cb) (closure);
@@ -633,7 +633,7 @@ ebook_test_utils_book_async_remove_contacts (EBook *book,
if (!e_book_remove_contacts_async (book, uids,
(EBookAsyncCallback) remove_contacts_cb,
closure)) {
- g_warning ("failed to set up async removeContacts");
+ g_warning ("failed to set up async removeContacts");
exit (1);
}
}
@@ -646,12 +646,12 @@ ebook_test_utils_book_new_temp (gchar **uri)
gchar *uri_result;
file_template = g_build_filename (g_get_tmp_dir (),
- "ebook-test-XXXXXX/", NULL);
+ "ebook-test-XXXXXX/", NULL);
g_mkstemp (file_template);
uri_result = g_strconcat ("local:", file_template, NULL);
if (!uri_result) {
- g_warning ("failed to convert %s to a 'local:' URI", file_template);
+ g_warning ("failed to convert %s to a 'local:' URI", file_template);
exit (1);
}
g_free (file_template);
@@ -681,7 +681,7 @@ ebook_test_utils_book_open (EBook *book,
source = e_book_get_source (book);
name = e_source_get_display_name (source);
- g_warning ("failed to open addressbook: `%s': %s", name,
+ g_warning ("failed to open addressbook: `%s': %s", name,
error->message);
exit (1);
}
@@ -701,7 +701,7 @@ ebook_test_utils_book_get_book_view (EBook *book,
source = e_book_get_source (book);
name = e_source_get_display_name (source);
- g_warning ("failed to get view for addressbook: `%s': %s",
+ g_warning ("failed to get view for addressbook: `%s': %s",
name, error->message);
exit (1);
}
@@ -714,14 +714,14 @@ get_book_view_cb (EBook *book,
EBookTestClosure *closure)
{
if (error) {
- g_warning ("failed to asynchronously get book view for the "
- "book: status %d (%s)", error->code, error->message);
+ g_warning ("failed to asynchronously get book view for the "
+ "book: status %d (%s)", error->code, error->message);
exit (1);
}
closure->view = view;
- test_print ("successfully asynchronously retrieved the book view\n");
+ test_print ("successfully asynchronously retrieved the book view\n");
if (closure->cb)
(*closure->cb) (closure);
}
@@ -738,7 +738,7 @@ ebook_test_utils_book_async_get_book_view (EBook *book,
closure->cb = callback;
closure->user_data = user_data;
if (!e_book_get_book_view_async (book, query, NULL, -1, (EBookBookViewAsyncCallback) get_book_view_cb, closure)) {
- g_warning ("failed to set up book view retrieval");
+ g_warning ("failed to set up book view retrieval");
exit (1);
}
}
diff --git a/tests/libebook/test-categories.c b/tests/libebook/test-categories.c
index 4c5b2ea..1b3d357 100644
--- a/tests/libebook/test-categories.c
+++ b/tests/libebook/test-categories.c
@@ -44,9 +44,9 @@ main (gint argc,
if (g_list_length (category_list) != 3)
printf ("failed conversion from string to list\n");
else {
- if (!strcmp ("Birthday", (gchar *)g_list_nth_data (category_list, 0)) &&
- !strcmp ("Business", (gchar *)g_list_nth_data (category_list, 1)) &&
- !strcmp ("Competition", (gchar *)g_list_nth_data (category_list, 2)))
+ if (!strcmp ("Birthday", (gchar *) g_list_nth_data (category_list, 0)) &&
+ !strcmp ("Business", (gchar *) g_list_nth_data (category_list, 1)) &&
+ !strcmp ("Competition", (gchar *) g_list_nth_data (category_list, 2)))
printf ("passed conversion from string to list\n");
else
printf ("failed conversion from string to list\n");
diff --git a/tests/libebook/test-changes.c b/tests/libebook/test-changes.c
index a7cfad2..9c1d62d 100644
--- a/tests/libebook/test-changes.c
+++ b/tests/libebook/test-changes.c
@@ -56,7 +56,7 @@ main (gint argc,
exit (0);
}
- printf ("got changed vcard back: %s\n", (gchar *)e_contact_get_const (change->contact, E_CONTACT_UID));
+ printf ("got changed vcard back: %s\n", (gchar *) e_contact_get_const (change->contact, E_CONTACT_UID));
e_book_free_change_list (changes);
diff --git a/tests/libebook/test-ebook-async.c b/tests/libebook/test-ebook-async.c
index b78dda6..4cd5334 100644
--- a/tests/libebook/test-ebook-async.c
+++ b/tests/libebook/test-ebook-async.c
@@ -17,7 +17,7 @@ print_email (EContact *contact)
printf ("Email addresses:\n");
emails = e_contact_get (contact, E_CONTACT_EMAIL);
for (e = emails; e; e = e->next) {
- printf ("\t%s\n", (gchar *)e->data);
+ printf ("\t%s\n", (gchar *) e->data);
}
g_list_foreach (emails, (GFunc) g_free, NULL);
g_list_free (emails);
diff --git a/tests/libebook/test-ebook-get-book-view.c b/tests/libebook/test-ebook-get-book-view.c
index 97923f3..e5ea416 100644
--- a/tests/libebook/test-ebook-get-book-view.c
+++ b/tests/libebook/test-ebook-get-book-view.c
@@ -12,13 +12,13 @@ print_contact (EContact *contact)
{
GList *emails, *e;
- test_print ("Contact: %s\n", (gchar *)e_contact_get_const (contact, E_CONTACT_FULL_NAME));
- test_print ("UID: %s\n", (gchar *)e_contact_get_const (contact, E_CONTACT_UID));
+ test_print ("Contact: %s\n", (gchar *) e_contact_get_const (contact, E_CONTACT_FULL_NAME));
+ test_print ("UID: %s\n", (gchar *) e_contact_get_const (contact, E_CONTACT_UID));
test_print ("Email addresses:\n");
emails = e_contact_get (contact, E_CONTACT_EMAIL);
for (e = emails; e; e = e->next) {
- test_print ("\t%s\n", (gchar *)e->data);
+ test_print ("\t%s\n", (gchar *) e->data);
}
g_list_foreach (emails, (GFunc) g_free, NULL);
g_list_free (emails);
@@ -44,7 +44,7 @@ contacts_removed (EBookView *book_view,
GList *l;
for (l = (GList *) ids; l; l = l->next) {
- test_print ("Removed contact: %s\n", (gchar *)l->data);
+ test_print ("Removed contact: %s\n", (gchar *) l->data);
}
}
diff --git a/tests/libebook/test-ebook-remove-contact.c b/tests/libebook/test-ebook-remove-contact.c
index 5b5728f..3f0f37c 100644
--- a/tests/libebook/test-ebook-remove-contact.c
+++ b/tests/libebook/test-ebook-remove-contact.c
@@ -30,7 +30,7 @@ main (gint argc,
e_book_get_contact (book, uid, &contact_final, NULL);
g_assert (contact_final == NULL);
- test_print ("successfully added and removed contact '%s'\n", uid);
+ test_print ("successfully added and removed contact '%s'\n", uid);
g_free (uid);
diff --git a/tests/libebook/test-ebook-remove-contacts.c b/tests/libebook/test-ebook-remove-contacts.c
index dff2e31..c36df40 100644
--- a/tests/libebook/test-ebook-remove-contacts.c
+++ b/tests/libebook/test-ebook-remove-contacts.c
@@ -38,7 +38,7 @@ main (gint argc,
e_book_get_contact (book, uid_2, &contact_final, NULL);
g_assert (contact_final == NULL);
- test_print ("successfully added and removed contacts\n");
+ test_print ("successfully added and removed contacts\n");
g_free (uid_1);
g_free (uid_2);
diff --git a/tests/libebook/test-ebook.c b/tests/libebook/test-ebook.c
index 91c5375..708719a 100644
--- a/tests/libebook/test-ebook.c
+++ b/tests/libebook/test-ebook.c
@@ -17,7 +17,7 @@ print_email (EContact *contact)
printf ("Email addresses:\n");
emails = e_contact_get (contact, E_CONTACT_EMAIL);
for (e = emails; e; e = e->next) {
- printf ("\t%s\n", (gchar *)e->data);
+ printf ("\t%s\n", (gchar *) e->data);
}
g_list_foreach (emails, (GFunc) g_free, NULL);
g_list_free (emails);
diff --git a/tests/libebook/test-stress-bookviews.c b/tests/libebook/test-stress-bookviews.c
index 1c2c296..ed7b8c0 100644
--- a/tests/libebook/test-stress-bookviews.c
+++ b/tests/libebook/test-stress-bookviews.c
@@ -8,13 +8,13 @@ print_contact (EContact *contact)
{
GList *emails, *e;
- printf ("Contact: %s\n", (gchar *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
- printf ("UID: %s\n", (gchar *)e_contact_get_const (contact, E_CONTACT_UID));
+ printf ("Contact: %s\n", (gchar *) e_contact_get_const (contact, E_CONTACT_FILE_AS));
+ printf ("UID: %s\n", (gchar *) e_contact_get_const (contact, E_CONTACT_UID));
printf ("Email addresses:\n");
emails = e_contact_get (contact, E_CONTACT_EMAIL);
for (e = emails; e; e = e->next) {
- printf ("\t%s\n", (gchar *)e->data);
+ printf ("\t%s\n", (gchar *) e->data);
}
g_list_foreach (emails, (GFunc) g_free, NULL);
g_list_free (emails);
@@ -40,7 +40,7 @@ contacts_removed (EBookView *book_view,
GList *l;
for (l = (GList *) ids; l; l = l->next) {
- printf ("Removed contact: %s\n", (gchar *)l->data);
+ printf ("Removed contact: %s\n", (gchar *) l->data);
}
}
diff --git a/tests/libecal/client/test-client-get-revision.c b/tests/libecal/client/test-client-get-revision.c
index 65b2f5b..4dab582 100644
--- a/tests/libecal/client/test-client-get-revision.c
+++ b/tests/libecal/client/test-client-get-revision.c
@@ -25,14 +25,14 @@ get_revision_compare_cycle (ECalClient *client)
if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION,
&revision_before, NULL, &error))
- g_error ("Error getting book revision: %s", error->message);
+ g_error ("Error getting book revision: %s", error->message);
if (!e_cal_client_create_object_sync (client, icalcomp, &uid, NULL, &error))
g_error ("Error creating object: %s", error->message);
if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION,
&revision_after, NULL, &error))
- g_error ("Error getting book revision: %s", error->message);
+ g_error ("Error getting book revision: %s", error->message);
g_assert (revision_before);
g_assert (revision_after);
diff --git a/tests/libecal/client/test-client-get-view.c b/tests/libecal/client/test-client-get-view.c
index 32c8a3c..6d870e5 100644
--- a/tests/libecal/client/test-client-get-view.c
+++ b/tests/libecal/client/test-client-get-view.c
@@ -39,7 +39,7 @@ objects_added_cb (GObject *object,
const GSList *l;
for (l = objects; l; l = l->next)
- g_print ("Object added %s (%s)\n", icalcomponent_get_uid (l->data), icalcomponent_get_summary (l->data));
+ g_print ("Object added %s (%s)\n", icalcomponent_get_uid (l->data), icalcomponent_get_summary (l->data));
subtest_passed (SUBTEST_OBJECTS_ADDED);
}
@@ -52,7 +52,7 @@ objects_modified_cb (GObject *object,
const GSList *l;
for (l = objects; l; l = l->next)
- g_print ("Object modified %s (%s)\n", icalcomponent_get_uid (l->data), icalcomponent_get_summary (l->data));
+ g_print ("Object modified %s (%s)\n", icalcomponent_get_uid (l->data), icalcomponent_get_summary (l->data));
subtest_passed (SUBTEST_OBJECTS_MODIFIED);
}
@@ -67,7 +67,7 @@ objects_removed_cb (GObject *object,
for (l = objects; l; l = l->next) {
ECalComponentId *id = l->data;
- g_print ("Object removed: uid: %s, rid: %s\n", id->uid, id->rid);
+ g_print ("Object removed: uid: %s, rid: %s\n", id->uid, id->rid);
}
subtest_passed (SUBTEST_OBJECTS_REMOVED);
@@ -78,7 +78,7 @@ complete_cb (GObject *object,
const GError *error,
gpointer data)
{
- g_print ("View complete (status: %d, error_msg:%s)\n", error ? error->code : 0, error ? error->message : "NULL");
+ g_print ("View complete (status: %d, error_msg:%s)\n", error ? error->code : 0, error ? error->message : "NULL");
subtest_passed (SUBTEST_VIEW_DONE);
}
diff --git a/tests/libecal/client/test-client-revision-view.c b/tests/libecal/client/test-client-revision-view.c
index 3099d15..bf60e78 100644
--- a/tests/libecal/client/test-client-revision-view.c
+++ b/tests/libecal/client/test-client-revision-view.c
@@ -58,7 +58,7 @@ objects_added_cb (GObject *object,
struct icaltimetype recurrence = icalcomponent_get_recurrenceid (component);
struct icaltimetype last_modified = get_last_modified (component);
- g_print ("Object added %s (recurrence id:%s, last-modified:%s)\n",
+ g_print ("Object added %s (recurrence id:%s, last-modified:%s)\n",
icalcomponent_get_uid (component),
icaltime_as_ical_string (recurrence),
icaltime_as_ical_string (last_modified));
@@ -81,7 +81,7 @@ objects_modified_cb (GObject *object,
struct icaltimetype recurrence = icalcomponent_get_recurrenceid (component);
struct icaltimetype last_modified = get_last_modified (component);
- g_print ("Object modified %s (recurrence id:%s, last-modified:%s)\n",
+ g_print ("Object modified %s (recurrence id:%s, last-modified:%s)\n",
icalcomponent_get_uid (component),
icaltime_as_ical_string (recurrence),
icaltime_as_ical_string (last_modified));
@@ -102,7 +102,7 @@ objects_removed_cb (GObject *object,
for (l = objects; l; l = l->next) {
ECalComponentId *id = l->data;
- g_print ("Object removed: uid: %s, rid: %s\n", id->uid, id->rid);
+ g_print ("Object removed: uid: %s, rid: %s\n", id->uid, id->rid);
}
subtest_passed (SUBTEST_OBJECTS_REMOVED);
@@ -113,7 +113,7 @@ complete_cb (GObject *object,
const GError *error,
gpointer data)
{
- g_print ("View complete (status: %d, error_msg:%s)\n", error ? error->code : 0, error ? error->message : "NULL");
+ g_print ("View complete (status: %d, error_msg:%s)\n", error ? error->code : 0, error ? error->message : "NULL");
subtest_passed (SUBTEST_VIEW_DONE);
}
@@ -195,7 +195,7 @@ async_get_view_ready (GObject *source_object,
g_object_set_data_full (G_OBJECT (cal_client), "cal-view", view, g_object_unref);
- field_list = g_slist_prepend (NULL, (gpointer) "UID");
+ field_list = g_slist_prepend (NULL, (gpointer) "UID");
field_list = g_slist_prepend (field_list, (gpointer) "RECURRENCE-ID");
field_list = g_slist_prepend (field_list, (gpointer) "LAST-MODIFIED");
@@ -253,7 +253,7 @@ main (gint argc,
g_signal_connect (view, "objects_removed", G_CALLBACK (objects_removed_cb), cal_client);
g_signal_connect (view, "complete", G_CALLBACK (complete_cb), cal_client);
- field_list = g_slist_prepend (NULL, (gpointer) "UID");
+ field_list = g_slist_prepend (NULL, (gpointer) "UID");
field_list = g_slist_prepend (field_list, (gpointer) "RECURRENCE-ID");
field_list = g_slist_prepend (field_list, (gpointer) "LAST-MODIFIED");
diff --git a/tests/libecal/ecal-test-utils.c b/tests/libecal/ecal-test-utils.c
index 4d62d64..8cb2a5f 100644
--- a/tests/libecal/ecal-test-utils.c
+++ b/tests/libecal/ecal-test-utils.c
@@ -108,15 +108,15 @@ open_ex_cb (ECal *cal,
test_print ("calendar server is busy; waiting...");
return;
} else if (error) {
- g_warning ("failed to asynchronously remove the calendar: "
- "status %d (%s)", error->code, error->message);
+ g_warning ("failed to asynchronously remove the calendar: "
+ "status %d (%s)", error->code, error->message);
exit (1);
}
closure->cal = cal;
- test_print ("successfully asynchronously removed the temporary "
- "calendar\n");
+ test_print ("successfully asynchronously removed the temporary "
+ "calendar\n");
if (closure->cb)
(*closure->cb) (closure);
@@ -147,10 +147,10 @@ ecal_test_utils_cal_get_alarm_email_address (ECal *cal)
gchar *address = NULL;
if (!e_cal_get_alarm_email_address (cal, &address, &error)) {
- g_warning ("failed to get alarm email address; %s\n", error->message);
+ g_warning ("failed to get alarm email address; %s\n", error->message);
exit (1);
}
- test_print ("successfully got the alarm email address\n");
+ test_print ("successfully got the alarm email address\n");
return address;
}
@@ -162,10 +162,10 @@ ecal_test_utils_cal_get_cal_address (ECal *cal)
gchar *address = NULL;
if (!e_cal_get_cal_address (cal, &address, &error)) {
- g_warning ("failed to get calendar address; %s\n", error->message);
+ g_warning ("failed to get calendar address; %s\n", error->message);
exit (1);
}
- test_print ("successfully got the calendar address\n");
+ test_print ("successfully got the calendar address\n");
return address;
}
@@ -177,10 +177,10 @@ ecal_test_utils_cal_get_ldap_attribute (ECal *cal)
gchar *attr = NULL;
if (!e_cal_get_ldap_attribute (cal, &attr, &error)) {
- g_warning ("failed to get ldap attribute; %s\n", error->message);
+ g_warning ("failed to get ldap attribute; %s\n", error->message);
exit (1);
}
- test_print ("successfully got the ldap attribute\n");
+ test_print ("successfully got the ldap attribute\n");
return attr;
}
@@ -188,38 +188,38 @@ ecal_test_utils_cal_get_ldap_attribute (ECal *cal)
static const gchar *
b2s (gboolean value)
{
- return value ? "true" : "false";
+ return value ? "true" : "false";
}
void
ecal_test_utils_cal_get_capabilities (ECal *cal)
{
- test_print ("calendar capabilities:\n");
- test_print (" One alarm only: %s\n"
- " Organizers must attend meetings: %s\n"
- " Organizers must accept meetings: %s\n"
- " Master object for recurrences: %s\n"
- " Can save schedules: %s\n"
- " No alarm repeat: %s\n"
- " No audio alarms: %s\n"
- " No display alarms: %s\n"
- " No email alarms: %s\n"
- " No procedure alarms: %s\n"
- " No task assignment: %s\n"
- " No 'this and future': %s\n"
- " No 'this and prior': %s\n"
- " No transparency: %s\n"
- " Organizer not email address: %s\n"
- " Remove alarms: %s\n"
- " Create messages: %s\n"
- " No conv. to assigned task: %s\n"
- " No conv. to recurring: %s\n"
- " No general options: %s\n"
- " Requires send options: %s\n"
- " Delegate supported: %s\n"
- " No organizer required: %s\n"
- " Delegate to many: %s\n"
- " Has unaccepted meeting: %s\n"
+ test_print ("calendar capabilities:\n");
+ test_print (" One alarm only: %s\n"
+ " Organizers must attend meetings: %s\n"
+ " Organizers must accept meetings: %s\n"
+ " Master object for recurrences: %s\n"
+ " Can save schedules: %s\n"
+ " No alarm repeat: %s\n"
+ " No audio alarms: %s\n"
+ " No display alarms: %s\n"
+ " No email alarms: %s\n"
+ " No procedure alarms: %s\n"
+ " No task assignment: %s\n"
+ " No 'this and future': %s\n"
+ " No 'this and prior': %s\n"
+ " No transparency: %s\n"
+ " Organizer not email address: %s\n"
+ " Remove alarms: %s\n"
+ " Create messages: %s\n"
+ " No conv. to assigned task: %s\n"
+ " No conv. to recurring: %s\n"
+ " No general options: %s\n"
+ " Requires send options: %s\n"
+ " Delegate supported: %s\n"
+ " No organizer required: %s\n"
+ " Delegate to many: %s\n"
+ " Has unaccepted meeting: %s\n"
,
b2s (e_cal_get_one_alarm_only (cal)),
b2s (e_cal_get_organizer_must_attend (cal)),
@@ -287,7 +287,7 @@ ecal_test_utils_cal_assert_objects_equal_shallow (icalcomponent *a,
uid_a = icalcomponent_get_uid (a);
uid_b = icalcomponent_get_uid (b);
if (g_strcmp0 (uid_a, uid_b)) {
- g_error ("icomponents not equal:\n"
+ g_error ("icomponents not equal:\n"
" uid A: '%s'\n"
" uid b: '%s'\n",
uid_a, uid_b);
@@ -323,14 +323,14 @@ ecal_test_utils_cal_get_object (ECal *cal,
icalcomponent *component = NULL;
if (!e_cal_get_object (cal, uid, NULL, &component, &error)) {
- g_warning ("failed to get icalcomponent object '%s'; %s\n", uid, error->message);
+ g_warning ("failed to get icalcomponent object '%s'; %s\n", uid, error->message);
exit (1);
}
if (!icalcomponent_is_valid (component)) {
- g_warning ("retrieved icalcomponent is invalid\n");
+ g_warning ("retrieved icalcomponent is invalid\n");
exit (1);
}
- test_print ("successfully got the icalcomponent object '%s'\n", uid);
+ test_print ("successfully got the icalcomponent object '%s'\n", uid);
return component;
}
@@ -343,14 +343,14 @@ ecal_test_utils_cal_modify_object (ECal *cal,
GError *error = NULL;
if (!icalcomponent_is_valid (component)) {
- g_warning (G_STRLOC ": icalcomponent argument is invalid\n");
+ g_warning (G_STRLOC ": icalcomponent argument is invalid\n");
exit (1);
}
if (!e_cal_modify_object (cal, component, mod_type, &error)) {
- g_warning ("failed to modify icalcomponent object; %s\n", error->message);
+ g_warning ("failed to modify icalcomponent object; %s\n", error->message);
exit (1);
}
- test_print ("successfully modified the icalcomponent object\n");
+ test_print ("successfully modified the icalcomponent object\n");
}
void
@@ -360,10 +360,10 @@ ecal_test_utils_cal_remove_object (ECal *cal,
GError *error = NULL;
if (!e_cal_remove_object (cal, uid, &error)) {
- g_warning ("failed to remove icalcomponent object '%s'; %s\n", uid, error->message);
+ g_warning ("failed to remove icalcomponent object '%s'; %s\n", uid, error->message);
exit (1);
}
- test_print ("successfully remoed the icalcomponent object '%s'\n", uid);
+ test_print ("successfully remoed the icalcomponent object '%s'\n", uid);
}
icalcomponent *
@@ -373,14 +373,14 @@ ecal_test_utils_cal_get_default_object (ECal *cal)
icalcomponent *component = NULL;
if (!e_cal_get_default_object (cal, &component, &error)) {
- g_warning ("failed to get default icalcomponent object; %s\n", error->message);
+ g_warning ("failed to get default icalcomponent object; %s\n", error->message);
exit (1);
}
if (!icalcomponent_is_valid (component)) {
- g_warning ("default icalcomponent is invalid\n");
+ g_warning ("default icalcomponent is invalid\n");
exit (1);
}
- test_print ("successfully got the default icalcomponent object\n");
+ test_print ("successfully got the default icalcomponent object\n");
return component;
}
@@ -393,10 +393,10 @@ ecal_test_utils_cal_get_object_list (ECal *cal,
GList *objects = NULL;
if (!e_cal_get_object_list (cal, query, &objects, &error)) {
- g_warning ("failed to get list of icalcomponent objects for query '%s'; %s\n", query, error->message);
+ g_warning ("failed to get list of icalcomponent objects for query '%s'; %s\n", query, error->message);
exit (1);
}
- test_print ("successfully got list of icalcomponent objects for the query '%s'\n", query);
+ test_print ("successfully got list of icalcomponent objects for the query '%s'\n", query);
return objects;
}
@@ -409,10 +409,10 @@ ecal_test_utils_cal_get_objects_for_uid (ECal *cal,
GList *objects = NULL;
if (!e_cal_get_objects_for_uid (cal, uid, &objects, &error)) {
- g_warning ("failed to get icalcomponent objects for UID '%s'; %s\n", uid, error->message);
+ g_warning ("failed to get icalcomponent objects for UID '%s'; %s\n", uid, error->message);
exit (1);
}
- test_print ("successfully got objects for the icalcomponent with UID '%s'\n", uid);
+ test_print ("successfully got objects for the icalcomponent with UID '%s'\n", uid);
return objects;
}
@@ -426,17 +426,17 @@ ecal_test_utils_cal_create_object (ECal *cal,
gchar *ical_string = NULL;
if (!icalcomponent_is_valid (component)) {
- g_warning ("supplied icalcomponent is invalid\n");
+ g_warning ("supplied icalcomponent is invalid\n");
exit (1);
}
if (!e_cal_create_object (cal, component, &uid, &error)) {
- g_warning ("failed to get create an icalcomponent object; %s\n", error->message);
+ g_warning ("failed to get create an icalcomponent object; %s\n", error->message);
exit (1);
}
ical_string = icalcomponent_as_ical_string (component);
- test_print ("successfully created icalcomponent object '%s'\n%s\n", uid,
+ test_print ("successfully created icalcomponent object '%s'\n%s\n", uid,
ical_string);
g_free (ical_string);
@@ -454,14 +454,14 @@ cal_set_mode_cb (ECal *cal,
test_print ("calendar server is busy; waiting...");
return;
} else if (status != E_CALENDAR_STATUS_OK) {
- g_warning ("failed to asynchronously remove the calendar: "
- "status %d", status);
+ g_warning ("failed to asynchronously remove the calendar: "
+ "status %d", status);
exit (1);
}
closure->mode = mode;
- test_print ("successfully set the calendar mode to %d\n", mode);
+ test_print ("successfully set the calendar mode to %d\n", mode);
if (closure->cb)
(*closure->cb) (closure);
@@ -533,7 +533,7 @@ ecal_test_utils_cal_component_set_icalcomponent (ECalComponent *e_component,
icalcomponent *component)
{
if (!e_cal_component_set_icalcomponent (e_component, component)) {
- g_error ("Could not set icalcomponent\n");
+ g_error ("Could not set icalcomponent\n");
}
}
@@ -545,10 +545,10 @@ ecal_test_utils_cal_get_timezone (ECal *cal,
icaltimezone *zone = NULL;
if (!e_cal_get_timezone (cal, tzid, &zone, &error)) {
- g_warning ("failed to get icaltimezone* for ID '%s'; %s\n", tzid, error->message);
+ g_warning ("failed to get icaltimezone* for ID '%s'; %s\n", tzid, error->message);
exit (1);
}
- test_print ("successfully got icaltimezone* for ID '%s'\n", tzid);
+ test_print ("successfully got icaltimezone* for ID '%s'\n", tzid);
return zone;
}
@@ -563,10 +563,10 @@ ecal_test_utils_cal_add_timezone (ECal *cal,
name = icaltimezone_get_display_name (zone);
if (!e_cal_add_timezone (cal, zone, &error)) {
- g_warning ("failed to add icaltimezone '%s'; %s\n", name, error->message);
+ g_warning ("failed to add icaltimezone '%s'; %s\n", name, error->message);
exit (1);
}
- test_print ("successfully added icaltimezone '%s'\n", name);
+ test_print ("successfully added icaltimezone '%s'\n", name);
}
void
@@ -579,10 +579,10 @@ ecal_test_utils_cal_set_default_timezone (ECal *cal,
name = icaltimezone_get_display_name (zone);
if (!e_cal_set_default_timezone (cal, zone, &error)) {
- g_warning ("failed to set default icaltimezone '%s'; %s\n", name, error->message);
+ g_warning ("failed to set default icaltimezone '%s'; %s\n", name, error->message);
exit (1);
}
- test_print ("successfully set default icaltimezone '%s'\n", name);
+ test_print ("successfully set default icaltimezone '%s'\n", name);
}
GList *
diff --git a/tests/libecal/test-ecal-create-object--2.c b/tests/libecal/test-ecal-create-object--2.c
index a174a14..7ee7fb2 100644
--- a/tests/libecal/test-ecal-create-object--2.c
+++ b/tests/libecal/test-ecal-create-object--2.c
@@ -23,7 +23,7 @@ main (gint argc,
cal = ecal_test_utils_cal_new_temp (&uri, E_CAL_SOURCE_TYPE_EVENT);
ecal_test_utils_cal_open (cal, FALSE);
ecal_test_utils_create_component (cal, "20040109T090000Z", "UTC",
- "20040109T103000", "UTC", EVENT_SUMMARY, &e_component,
+ "20040109T103000", "UTC", EVENT_SUMMARY, &e_component,
&uid);
icalcomponent_final = ecal_test_utils_cal_get_object (cal, uid);
diff --git a/tests/libecal/test-ecal-get-query.c b/tests/libecal/test-ecal-get-query.c
index 2e9fe8b..a056855 100644
--- a/tests/libecal/test-ecal-get-query.c
+++ b/tests/libecal/test-ecal-get-query.c
@@ -49,7 +49,7 @@ objects_added_cb (GObject *object,
GList *l;
for (l = objects; l; l = l->next)
- test_print ("Object added %s\n", icalcomponent_get_uid (l->data));
+ test_print ("Object added %s\n", icalcomponent_get_uid (l->data));
subtest_passed (SUBTEST_OBJECTS_ADDED);
}
@@ -62,7 +62,7 @@ objects_modified_cb (GObject *object,
GList *l;
for (l = objects; l; l = l->next)
- test_print ("Object modified %s\n", icalcomponent_get_uid (l->data));
+ test_print ("Object modified %s\n", icalcomponent_get_uid (l->data));
subtest_passed (SUBTEST_OBJECTS_MODIFIED);
}
@@ -77,7 +77,7 @@ objects_removed_cb (GObject *object,
for (l = objects; l; l = l->next) {
ECalComponentId *id = l->data;
- test_print ("Object removed: uid: %s, rid: %s\n", id->uid,
+ test_print ("Object removed: uid: %s, rid: %s\n", id->uid,
id->rid);
}
@@ -90,7 +90,7 @@ view_complete_cb (GObject *object,
const gchar *error_msg,
gpointer data)
{
- test_print ("View complete (status: %d, error_msg:%s\n", status, error_msg ? error_msg : "NULL");
+ test_print ("View complete (status: %d, error_msg:%s\n", status, error_msg ? error_msg : "NULL");
g_source_remove (complete_timeout_id);
@@ -100,7 +100,7 @@ view_complete_cb (GObject *object,
static void
complete_timeout_cb (gpointer user_data)
{
- g_error ("failed to complete all the pieces of the test in time");
+ g_error ("failed to complete all the pieces of the test in time");
}
static gboolean
diff --git a/tests/libecal/test-ecal-receive-objects.c b/tests/libecal/test-ecal-receive-objects.c
index 618ce13..18cc2dd 100644
--- a/tests/libecal/test-ecal-receive-objects.c
+++ b/tests/libecal/test-ecal-receive-objects.c
@@ -21,7 +21,7 @@ main (gint argc,
cal = ecal_test_utils_cal_new_temp (&uri, E_CAL_SOURCE_TYPE_EVENT);
ecal_test_utils_cal_open (cal, FALSE);
- ecal_test_utils_create_component (cal, "20040109T090000Z", "UTC",
+ ecal_test_utils_create_component (cal, "20040109T090000Z", "UTC",
"20040109T103000", "UTC", "meeting request",
&e_component, &uid);
diff --git a/tests/libecal/test-ecal-send-objects.c b/tests/libecal/test-ecal-send-objects.c
index a21f3ef..9ed6a9e 100644
--- a/tests/libecal/test-ecal-send-objects.c
+++ b/tests/libecal/test-ecal-send-objects.c
@@ -23,8 +23,8 @@ main (gint argc,
cal = ecal_test_utils_cal_new_temp (&uri, E_CAL_SOURCE_TYPE_EVENT);
ecal_test_utils_cal_open (cal, FALSE);
- ecal_test_utils_create_component (cal, "20040109T090000Z", "UTC",
- "20040109T103000", "UTC", "new event", &e_component,
+ ecal_test_utils_create_component (cal, "20040109T090000Z", "UTC",
+ "20040109T103000", "UTC", "new event", &e_component,
&uid);
component = e_cal_component_get_icalcomponent (e_component);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]