[evolution-data-server] Coding style and whitespace cleanup.
- From: Matthew Barnes <mbarnes src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Coding style and whitespace cleanup.
- Date: Sat, 24 Oct 2009 04:23:10 +0000 (UTC)
commit 31168fc230fd9f08462e3241622e0f596d41c4aa
Author: Matthew Barnes <mbarnes redhat com>
Date: Sat Oct 24 00:22:53 2009 -0400
Coding style and whitespace cleanup.
addressbook/libebook/e-book-view.c | 2 +-
addressbook/libebook/e-book.c | 74 ++---
addressbook/libebook/e-error.h | 1 -
addressbook/libedata-book/e-book-backend.c | 6 +-
addressbook/libedata-book/e-data-book-factory.c | 30 +-
addressbook/libedata-book/e-data-book-types.h | 2 +-
addressbook/libedata-book/e-data-book-view.c | 20 +-
addressbook/libedata-book/e-data-book.c | 77 +++---
addressbook/libedata-book/opid.c | 4 +-
calendar/libecal/e-cal-system-timezone.c | 2 +-
calendar/libecal/e-cal-view.c | 9 +-
calendar/libecal/e-cal.c | 6 +-
calendar/libedata-cal/e-data-cal-factory.c | 18 +-
calendar/libedata-cal/e-data-cal-types.h | 4 +-
calendar/libedata-cal/e-data-cal-view.c | 19 +-
calendar/libedata-cal/e-data-cal.c | 52 ++--
camel/camel-cipher-context.c | 2 +-
camel/camel-cipher-context.h | 12 +-
camel/camel-db.c | 1 -
camel/camel-file-utils.c | 12 +-
camel/camel-file-utils.h | 2 +-
camel/camel-folder-summary.c | 3 +-
camel/camel-smime-context.c | 10 +-
camel/camel-tcp-stream-ssl.c | 14 +-
camel/providers/imap/camel-imap-store-summary.c | 2 +-
camel/providers/imap/camel-imap-store.c | 4 +-
camel/providers/imapx/camel-imapx-exception.c | 2 +-
camel/providers/imapx/camel-imapx-exception.h | 2 +-
camel/providers/imapx/camel-imapx-folder.c | 26 +-
camel/providers/imapx/camel-imapx-folder.h | 10 +-
camel/providers/imapx/camel-imapx-provider.c | 22 +-
camel/providers/imapx/camel-imapx-server.c | 374 ++++++++++------------
camel/providers/imapx/camel-imapx-server.h | 16 +-
camel/providers/imapx/camel-imapx-store.c | 65 ++--
camel/providers/imapx/camel-imapx-store.h | 10 +-
camel/providers/imapx/camel-imapx-stream.c | 126 ++++----
camel/providers/imapx/camel-imapx-stream.h | 36 +-
camel/providers/imapx/camel-imapx-tokenise.h | 16 +-
camel/providers/imapx/camel-imapx-utils.c | 147 ++++-----
camel/providers/imapx/camel-imapx-utils.h | 28 +-
camel/providers/imapx/camel-imapx-view-summary.c | 12 +-
camel/providers/imapx/camel-imapx-view-summary.h | 8 +-
camel/providers/imapx/test-imapx.c | 7 +-
camel/providers/local/camel-maildir-folder.c | 6 +-
libebackend/e-offline-listener.c | 7 +-
libebackend/e-offline-listener.h | 1 -
libedataserverui/e-categories-dialog.c | 2 +-
libedataserverui/e-name-selector-entry.c | 8 +-
48 files changed, 633 insertions(+), 686 deletions(-)
---
diff --git a/addressbook/libebook/e-book-view.c b/addressbook/libebook/e-book-view.c
index 56e23f0..f5c1460 100644
--- a/addressbook/libebook/e-book-view.c
+++ b/addressbook/libebook/e-book-view.c
@@ -109,7 +109,7 @@ contacts_removed_cb (DBusGProxy *proxy, const gchar **ids, EBookView *book_view)
return;
for (p = ids; *p; p++) {
- list = g_list_prepend (list, (char*)*p);
+ list = g_list_prepend (list, (gchar *)*p);
}
list = g_list_reverse (list);
diff --git a/addressbook/libebook/e-book.c b/addressbook/libebook/e-book.c
index 25f239e..b05bf37 100644
--- a/addressbook/libebook/e-book.c
+++ b/addressbook/libebook/e-book.c
@@ -38,15 +38,14 @@
#define E_DATA_BOOK_FACTORY_SERVICE_NAME "org.gnome.evolution.dataserver.AddressBook"
-static char** flatten_stringlist(GList *list);
-static GList *array_to_stringlist (char **list);
+static gchar ** flatten_stringlist(GList *list);
+static GList *array_to_stringlist (gchar **list);
static gboolean unwrap_gerror(GError *error, GError **client_error);
static EBookStatus get_status_from_error (GError *error);
G_DEFINE_TYPE(EBook, e_book, G_TYPE_OBJECT)
#define E_BOOK_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), E_TYPE_BOOK, EBookPrivate))
-
enum {
WRITABLE_STATUS,
CONNECTION_STATUS,
@@ -59,12 +58,12 @@ static guint e_book_signals [LAST_SIGNAL];
struct _EBookPrivate {
ESource *source;
- char *uri;
+ gchar *uri;
DBusGProxy *proxy;
gboolean loaded;
gboolean writable;
gboolean connected;
- char *cap;
+ gchar *cap;
gboolean cap_queried;
};
@@ -73,7 +72,7 @@ static DBusGProxy *factory_proxy = NULL;
typedef struct {
EBook *book;
- void *callback; /* TODO union */
+ gpointer callback; /* TODO union */
gpointer closure;
gpointer data;
} AsyncData;
@@ -293,7 +292,7 @@ e_book_add_contact (EBook *book,
GError **error)
{
GError *err = NULL;
- char *vcard, *uid = NULL;
+ gchar *vcard, *uid = NULL;
e_return_error_if_fail (E_IS_BOOK (book), E_BOOK_ERROR_INVALID_ARG);
e_return_error_if_fail (book->priv->proxy, E_BOOK_ERROR_REPOSITORY_OFFLINE);
@@ -310,7 +309,7 @@ e_book_add_contact (EBook *book,
}
static void
-add_contact_reply (DBusGProxy *proxy, char *uid, GError *error, gpointer user_data)
+add_contact_reply (DBusGProxy *proxy, gchar *uid, GError *error, gpointer user_data)
{
AsyncData *data = user_data;
EBookIdCallback cb = data->callback;
@@ -426,7 +425,7 @@ e_book_async_commit_contact (EBook *book,
EBookCallback cb,
gpointer closure)
{
- char *vcard;
+ gchar *vcard;
AsyncData *data;
e_return_async_error_if_fail (E_IS_BOOK (book), E_BOOK_ERROR_INVALID_ARG);
@@ -445,7 +444,6 @@ e_book_async_commit_contact (EBook *book,
return 0;
}
-
/**
* e_book_get_required_fields:
* @book: an #EBook
@@ -465,7 +463,7 @@ e_book_get_required_fields (EBook *book,
GError **error)
{
GError *err = NULL;
- char **list = NULL;
+ gchar **list = NULL;
e_return_error_if_fail (E_IS_BOOK (book), E_BOOK_ERROR_INVALID_ARG);
e_return_error_if_fail (book->priv->proxy, E_BOOK_ERROR_REPOSITORY_OFFLINE);
@@ -480,11 +478,11 @@ e_book_get_required_fields (EBook *book,
}
static void
-get_required_fields_reply(DBusGProxy *proxy, char **fields, GError *error, gpointer user_data)
+get_required_fields_reply(DBusGProxy *proxy, gchar **fields, GError *error, gpointer user_data)
{
AsyncData *data = user_data;
EBookEListCallback cb = data->callback;
- char **i = fields;
+ gchar **i = fields;
EList *efields = e_list_new (NULL,
(EListFreeFunc) g_free,
NULL);
@@ -551,7 +549,7 @@ e_book_get_supported_fields (EBook *book,
GError **error)
{
GError *err = NULL;
- char **list = NULL;
+ gchar **list = NULL;
e_return_error_if_fail (E_IS_BOOK (book), E_BOOK_ERROR_INVALID_ARG);
e_return_error_if_fail (book->priv->proxy, E_BOOK_ERROR_REPOSITORY_OFFLINE);
@@ -566,11 +564,11 @@ e_book_get_supported_fields (EBook *book,
}
static void
-get_supported_fields_reply(DBusGProxy *proxy, char **fields, GError *error, gpointer user_data)
+get_supported_fields_reply(DBusGProxy *proxy, gchar **fields, GError *error, gpointer user_data)
{
AsyncData *data = user_data;
EBookEListCallback cb = data->callback;
- char **i = fields;
+ gchar **i = fields;
EList *efields = e_list_new (NULL, (EListFreeFunc) g_free, NULL);
while (*i != NULL) {
@@ -636,7 +634,7 @@ e_book_get_supported_auth_methods (EBook *book,
GError **error)
{
GError *err = NULL;
- char **list = NULL;
+ gchar **list = NULL;
e_return_error_if_fail (E_IS_BOOK (book), E_BOOK_ERROR_INVALID_ARG);
e_return_error_if_fail (book->priv->proxy, E_BOOK_ERROR_REPOSITORY_OFFLINE);
@@ -651,11 +649,11 @@ e_book_get_supported_auth_methods (EBook *book,
}
static void
-get_supported_auth_methods_reply(DBusGProxy *proxy, char **methods, GError *error, gpointer user_data)
+get_supported_auth_methods_reply(DBusGProxy *proxy, gchar **methods, GError *error, gpointer user_data)
{
AsyncData *data = user_data;
EBookEListCallback cb = data->callback;
- char **i = methods;
+ gchar **i = methods;
EList *emethods = e_list_new (NULL,
(EListFreeFunc) g_free,
NULL);
@@ -821,7 +819,7 @@ e_book_get_contact (EBook *book,
}
static void
-get_contact_reply(DBusGProxy *proxy, char *vcard, GError *error, gpointer user_data)
+get_contact_reply(DBusGProxy *proxy, gchar *vcard, GError *error, gpointer user_data)
{
AsyncData *data = user_data;
EBookContactCallback cb = data->callback;
@@ -941,7 +939,7 @@ e_book_remove_contacts (EBook *book,
GError **error)
{
GError *err = NULL;
- char **l;
+ gchar **l;
e_return_error_if_fail (E_IS_BOOK (book), E_BOOK_ERROR_INVALID_ARG);
e_return_error_if_fail (book->priv->proxy, E_BOOK_ERROR_REPOSITORY_OFFLINE);
@@ -949,7 +947,7 @@ e_book_remove_contacts (EBook *book,
l = flatten_stringlist (ids);
- org_gnome_evolution_dataserver_addressbook_Book_remove_contacts (book->priv->proxy, (const char **) l, &err);
+ org_gnome_evolution_dataserver_addressbook_Book_remove_contacts (book->priv->proxy, (const gchar **) l, &err);
g_free (l);
return unwrap_gerror (err, error);
}
@@ -1091,7 +1089,7 @@ e_book_async_remove_contacts (EBook *book,
data->callback = cb;
data->closure = closure;
- org_gnome_evolution_dataserver_addressbook_Book_remove_contacts_async (book->priv->proxy, (const char **) l, remove_contacts_reply, data);
+ org_gnome_evolution_dataserver_addressbook_Book_remove_contacts_async (book->priv->proxy, (const gchar **) l, remove_contacts_reply, data);
g_free (l);
return 0;
}
@@ -1121,7 +1119,7 @@ e_book_get_book_view (EBook *book,
{
GError *err = NULL;
DBusGProxy *view_proxy;
- char *sexp, *view_path;
+ gchar *sexp, *view_path;
gboolean ret = TRUE;
e_return_error_if_fail (E_IS_BOOK (book), E_BOOK_ERROR_INVALID_ARG);
@@ -1245,8 +1243,8 @@ e_book_get_contacts (EBook *book,
GError **error)
{
GError *err = NULL;
- char **list = NULL;
- char *sexp;
+ gchar **list = NULL;
+ gchar *sexp;
e_return_error_if_fail (E_IS_BOOK (book), E_BOOK_ERROR_INVALID_ARG);
e_return_error_if_fail (book->priv->proxy, E_BOOK_ERROR_REPOSITORY_OFFLINE);
@@ -1256,7 +1254,7 @@ e_book_get_contacts (EBook *book,
g_free (sexp);
if (!err) {
GList *l = NULL;
- char **i = list;
+ gchar **i = list;
while (*i != NULL) {
l = g_list_prepend (l, e_contact_new_from_vcard (*i++));
}
@@ -1269,13 +1267,13 @@ e_book_get_contacts (EBook *book,
}
static void
-get_contacts_reply(DBusGProxy *proxy, char **vcards, GError *error, gpointer user_data)
+get_contacts_reply(DBusGProxy *proxy, gchar **vcards, GError *error, gpointer user_data)
{
AsyncData *data = user_data;
GList *list = NULL;
EBookListCallback cb = data->callback;
if (vcards) {
- char **i = vcards;
+ gchar **i = vcards;
while (*i != NULL) {
list = g_list_prepend (list, e_contact_new_from_vcard (*i++));
}
@@ -1330,7 +1328,7 @@ static GList *
parse_changes_array (GPtrArray *array)
{
GList *l = NULL;
- int i;
+ gint i;
if (array == NULL)
return NULL;
@@ -1700,7 +1698,7 @@ e_book_get_static_capabilities (EBook *book,
e_return_error_if_fail (book->priv->proxy, E_BOOK_ERROR_REPOSITORY_OFFLINE);
if (!book->priv->cap_queried) {
- char *cap = NULL;
+ gchar *cap = NULL;
if (!org_gnome_evolution_dataserver_addressbook_Book_get_static_capabilities (book->priv->proxy, &cap, error)) {
return NULL;
@@ -2036,7 +2034,7 @@ e_book_new (ESource *source, GError **error)
{
GError *err = NULL;
EBook *book;
- char *path, *xml;
+ gchar *path, *xml;
e_return_error_if_fail (E_IS_SOURCE (source), E_BOOK_ERROR_INVALID_ARG);
@@ -2374,7 +2372,7 @@ get_status_from_error (GError *error)
return E_BOOK_ERROR_OK;
if (error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) {
- const char *name;
+ const gchar *name;
gint i;
name = dbus_g_error_get_name (error);
@@ -2397,12 +2395,12 @@ get_status_from_error (GError *error)
/**
* Turn a GList of strings into an array of strings.
*/
-static char **
+static gchar **
flatten_stringlist (GList *list)
{
- char **array = g_new0 (char *, g_list_length (list) + 1);
+ gchar **array = g_new0 (gchar *, g_list_length (list) + 1);
GList *l = list;
- int i = 0;
+ gint i = 0;
while (l != NULL) {
array[i++] = l->data;
l = l->next;
@@ -2414,10 +2412,10 @@ flatten_stringlist (GList *list)
* Turn an array of strings into a GList.
*/
static GList *
-array_to_stringlist (char **list)
+array_to_stringlist (gchar **list)
{
GList *l = NULL;
- char **i = list;
+ gchar **i = list;
while (*i != NULL) {
l = g_list_prepend (l, (*i++));
}
diff --git a/addressbook/libebook/e-error.h b/addressbook/libebook/e-error.h
index 5d137f0..39e8852 100644
--- a/addressbook/libebook/e-error.h
+++ b/addressbook/libebook/e-error.h
@@ -17,7 +17,6 @@
return FALSE; \
}; }G_STMT_END
-
#define e_return_async_error_if_fail(expr, error) G_STMT_START { \
if G_LIKELY (expr) {} else { \
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, \
diff --git a/addressbook/libedata-book/e-book-backend.c b/addressbook/libedata-book/e-book-backend.c
index 80f2740..e0e2332 100644
--- a/addressbook/libedata-book/e-book-backend.c
+++ b/addressbook/libedata-book/e-book-backend.c
@@ -764,7 +764,7 @@ e_book_backend_sync (EBookBackend *backend)
* Return value: A new #GNOME_Evolution_Addressbook_BookChangeItem.
**/
EDataBookChange *
-e_book_backend_change_add_new (const char *vcard)
+e_book_backend_change_add_new (const gchar *vcard)
{
EDataBookChange *new_change = g_new (EDataBookChange, 1);
@@ -784,7 +784,7 @@ e_book_backend_change_add_new (const char *vcard)
* Return value: A new #GNOME_Evolution_Addressbook_BookChangeItem.
**/
EDataBookChange *
-e_book_backend_change_modify_new (const char *vcard)
+e_book_backend_change_modify_new (const gchar *vcard)
{
EDataBookChange *new_change = g_new (EDataBookChange, 1);
@@ -804,7 +804,7 @@ e_book_backend_change_modify_new (const char *vcard)
* Return value: A new #GNOME_Evolution_Addressbook_BookChangeItem.
**/
EDataBookChange *
-e_book_backend_change_delete_new (const char *vcard)
+e_book_backend_change_delete_new (const gchar *vcard)
{
EDataBookChange *new_change = g_new (EDataBookChange, 1);
diff --git a/addressbook/libedata-book/e-data-book-factory.c b/addressbook/libedata-book/e-data-book-factory.c
index cac1b68..0673c9c 100644
--- a/addressbook/libedata-book/e-data-book-factory.c
+++ b/addressbook/libedata-book/e-data-book-factory.c
@@ -40,7 +40,7 @@
#define d(x)
-static void impl_BookFactory_getBook(EDataBookFactory *factory, const char *IN_uri, DBusGMethodInvocation *context);
+static void impl_BookFactory_getBook(EDataBookFactory *factory, const gchar *IN_uri, DBusGMethodInvocation *context);
#include "e-data-book-factory-glue.h"
static GMainLoop *loop;
@@ -170,8 +170,6 @@ e_data_book_factory_set_backend_mode (EDataBookFactory *factory, gint mode)
g_mutex_unlock (priv->connections_lock);
}
-
-
static void
e_data_book_factory_class_init (EDataBookFactoryClass *e_data_book_factory_class)
{
@@ -199,10 +197,10 @@ e_data_book_factory_init (EDataBookFactory *factory)
}
/* TODO: write dispose to kill hash */
-static char *
-e_data_book_factory_extract_proto_from_uri (const char *uri)
+static gchar *
+e_data_book_factory_extract_proto_from_uri (const gchar *uri)
{
- char *proto, *p;
+ gchar *proto, *p;
p = strchr (uri, ':');
if (p == NULL)
return NULL;
@@ -246,7 +244,7 @@ construct_book_factory_path (void)
}
static void
-my_remove (char *key, GObject *dead)
+my_remove (gchar *key, GObject *dead)
{
EDataBookFactoryPrivate *priv = factory->priv;
GHashTableIter iter;
@@ -281,13 +279,13 @@ my_remove (char *key, GObject *dead)
}
static void
-impl_BookFactory_getBook(EDataBookFactory *factory, const char *IN_source, DBusGMethodInvocation *context)
+impl_BookFactory_getBook(EDataBookFactory *factory, const gchar *IN_source, DBusGMethodInvocation *context)
{
EDataBook *book;
EBookBackend *backend;
EDataBookFactoryPrivate *priv = factory->priv;
ESource *source;
- char *uri, *path, *sender;
+ gchar *uri, *path, *sender;
GList *list;
if (IN_source == NULL || IN_source[0] == '\0') {
@@ -362,13 +360,13 @@ impl_BookFactory_getBook(EDataBookFactory *factory, const char *IN_source, DBusG
static void
name_owner_changed (DBusGProxy *proxy,
- const char *name,
- const char *prev_owner,
- const char *new_owner,
+ const gchar *name,
+ const gchar *prev_owner,
+ const gchar *new_owner,
EDataBookFactory *factory)
{
if (strcmp (new_owner, "") == 0 && strcmp (name, prev_owner) == 0) {
- char *key;
+ gchar *key;
GList *list = NULL;
g_mutex_lock (factory->priv->connections_lock);
if (g_hash_table_lookup_extended (factory->priv->connections, prev_owner, (gpointer)&key, (gpointer)&list)) {
@@ -382,7 +380,7 @@ name_owner_changed (DBusGProxy *proxy,
/* Convenience function to print an error and exit */
G_GNUC_NORETURN static void
-die (const char *prefix, GError *error)
+die (const gchar *prefix, GError *error)
{
g_error("%s: %s", prefix, error->message);
g_error_free (error);
@@ -401,8 +399,8 @@ offline_state_changed_cb (EOfflineListener *eol, EDataBookFactory *factory)
#define E_DATA_BOOK_FACTORY_SERVICE_NAME "org.gnome.evolution.dataserver.AddressBook"
-int
-main (int argc, char **argv)
+gint
+main (gint argc, gchar **argv)
{
GError *error = NULL;
DBusGProxy *bus_proxy;
diff --git a/addressbook/libedata-book/e-data-book-types.h b/addressbook/libedata-book/e-data-book-types.h
index 618fb7b..7ac83e4 100644
--- a/addressbook/libedata-book/e-data-book-types.h
+++ b/addressbook/libedata-book/e-data-book-types.h
@@ -112,7 +112,7 @@ typedef enum {
typedef struct {
EDataBookChangeType change_type;
- char *vcard;
+ gchar *vcard;
} EDataBookChange;
/* Transition typedef */
diff --git a/addressbook/libedata-book/e-data-book-view.c b/addressbook/libedata-book/e-data-book-view.c
index c3861dd..0594f06 100644
--- a/addressbook/libedata-book/e-data-book-view.c
+++ b/addressbook/libedata-book/e-data-book-view.c
@@ -48,9 +48,9 @@ struct _EDataBookViewPrivate {
EDataBook *book;
EBookBackend *backend;
- char* card_query;
+ gchar * card_query;
EBookBackendSExp *card_sexp;
- int max_results;
+ gint max_results;
gboolean running;
GMutex *pending_mutex;
@@ -139,9 +139,9 @@ e_data_book_view_init (EDataBookView *book_view)
priv->running = FALSE;
priv->pending_mutex = g_mutex_new ();
- priv->adds = g_array_sized_new (TRUE, TRUE, sizeof (char*), THRESHOLD);
- priv->changes = g_array_sized_new (TRUE, TRUE, sizeof (char*), THRESHOLD);
- priv->removes = g_array_sized_new (TRUE, TRUE, sizeof (char*), THRESHOLD);
+ priv->adds = g_array_sized_new (TRUE, TRUE, sizeof (gchar *), THRESHOLD);
+ priv->changes = g_array_sized_new (TRUE, TRUE, sizeof (gchar *), THRESHOLD);
+ priv->removes = g_array_sized_new (TRUE, TRUE, sizeof (gchar *), THRESHOLD);
priv->ids = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, NULL);
@@ -205,7 +205,7 @@ send_pending_removes (EDataBookView *view)
* @vcard.
*/
static void
-notify_change (EDataBookView *view, char *vcard)
+notify_change (EDataBookView *view, gchar *vcard)
{
EDataBookViewPrivate *priv = view->priv;
send_pending_adds (view);
@@ -218,7 +218,7 @@ notify_change (EDataBookView *view, char *vcard)
* Queue @id to be sent as a change notification. This takes ownership of @id.
*/
static void
-notify_remove (EDataBookView *view, char *id)
+notify_remove (EDataBookView *view, gchar *id)
{
EDataBookViewPrivate *priv = view->priv;
@@ -234,7 +234,7 @@ notify_remove (EDataBookView *view, char *id)
* @vcard but not @id.
*/
static void
-notify_add (EDataBookView *view, const char *id, char *vcard)
+notify_add (EDataBookView *view, const gchar *id, gchar *vcard)
{
EDataBookViewPrivate *priv = view->priv;
send_pending_changes (view);
@@ -620,8 +620,8 @@ impl_BookView_dispose (EDataBookView *book_view, GError **eror)
void
e_data_book_view_set_thresholds (EDataBookView *book_view,
- int minimum_grouping_threshold,
- int maximum_grouping_threshold)
+ gint minimum_grouping_threshold,
+ gint maximum_grouping_threshold)
{
g_return_if_fail (E_IS_DATA_BOOK_VIEW (book_view));
diff --git a/addressbook/libedata-book/e-data-book.c b/addressbook/libedata-book/e-data-book.c
index d21fcd6..0698ff3 100644
--- a/addressbook/libedata-book/e-data-book.c
+++ b/addressbook/libedata-book/e-data-book.c
@@ -39,24 +39,24 @@ DBusGConnection *connection;
/* DBus glue */
static void impl_AddressBook_Book_open(EDataBook *book, gboolean only_if_exists, DBusGMethodInvocation *context);
static void impl_AddressBook_Book_remove(EDataBook *book, DBusGMethodInvocation *context);
-static void impl_AddressBook_Book_getContact(EDataBook *book, const char *IN_uid, DBusGMethodInvocation *context);
-static void impl_AddressBook_Book_getContactList(EDataBook *book, const char *query, DBusGMethodInvocation *context);
-static void impl_AddressBook_Book_authenticateUser(EDataBook *book, const char *IN_user, const char *IN_passwd, const char *IN_auth_method, DBusGMethodInvocation *context);
-static void impl_AddressBook_Book_addContact(EDataBook *book, const char *IN_vcard, DBusGMethodInvocation *context);
-static void impl_AddressBook_Book_modifyContact(EDataBook *book, const char *IN_vcard, DBusGMethodInvocation *context);
-static void impl_AddressBook_Book_removeContacts(EDataBook *book, const char **IN_uids, DBusGMethodInvocation *context);
-static gboolean impl_AddressBook_Book_getStaticCapabilities(EDataBook *book, char **OUT_capabilities, GError **error);
+static void impl_AddressBook_Book_getContact(EDataBook *book, const gchar *IN_uid, DBusGMethodInvocation *context);
+static void impl_AddressBook_Book_getContactList(EDataBook *book, const gchar *query, DBusGMethodInvocation *context);
+static void impl_AddressBook_Book_authenticateUser(EDataBook *book, const gchar *IN_user, const gchar *IN_passwd, const gchar *IN_auth_method, DBusGMethodInvocation *context);
+static void impl_AddressBook_Book_addContact(EDataBook *book, const gchar *IN_vcard, DBusGMethodInvocation *context);
+static void impl_AddressBook_Book_modifyContact(EDataBook *book, const gchar *IN_vcard, DBusGMethodInvocation *context);
+static void impl_AddressBook_Book_removeContacts(EDataBook *book, const gchar **IN_uids, DBusGMethodInvocation *context);
+static gboolean impl_AddressBook_Book_getStaticCapabilities(EDataBook *book, gchar **OUT_capabilities, GError **error);
static void impl_AddressBook_Book_getSupportedFields(EDataBook *book, DBusGMethodInvocation *context);
static void impl_AddressBook_Book_getRequiredFields(EDataBook *book, DBusGMethodInvocation *context);
static void impl_AddressBook_Book_getSupportedAuthMethods(EDataBook *book, DBusGMethodInvocation *context);
-static void impl_AddressBook_Book_getBookView (EDataBook *book, const char *search, const guint max_results, DBusGMethodInvocation *context);
-static void impl_AddressBook_Book_getChanges(EDataBook *book, const char *IN_change_id, DBusGMethodInvocation *context);
+static void impl_AddressBook_Book_getBookView (EDataBook *book, const gchar *search, const guint max_results, DBusGMethodInvocation *context);
+static void impl_AddressBook_Book_getChanges(EDataBook *book, const gchar *IN_change_id, DBusGMethodInvocation *context);
static gboolean impl_AddressBook_Book_cancelOperation(EDataBook *book, GError **error);
static void impl_AddressBook_Book_close(EDataBook *book, DBusGMethodInvocation *context);
#include "e-data-book-glue.h"
static void return_status_and_list (guint32 opid, EDataBookStatus status, GList *list, gboolean free_data);
-static void data_book_return_error (DBusGMethodInvocation *context, gint code, const char *error_str);
+static void data_book_return_error (DBusGMethodInvocation *context, gint code, const gchar *error_str);
enum {
WRITABLE,
@@ -89,23 +89,23 @@ typedef struct {
gboolean only_if_exists;
/* OP_AUTHENTICATE */
struct {
- char *username;
- char *password;
- char *method;
+ gchar *username;
+ gchar *password;
+ gchar *method;
} auth;
/* OP_ADD_CONTACT */
/* OP_MODIFY_CONTACT */
- char *vcard;
+ gchar *vcard;
/* OP_GET_CONTACT */
- char *uid;
+ gchar *uid;
/* OP_GET_CONTACTS */
- char *query;
+ gchar *query;
/* OP_MODIFY_CONTACT */
- char **vcards;
+ gchar **vcards;
/* OP_REMOVE_CONTACTS */
GList *ids;
/* OP_GET_CHANGES */
- char *change_id;
+ gchar *change_id;
};
} OperationData;
@@ -174,7 +174,6 @@ op_new (OperationID op, EDataBook *book, DBusGMethodInvocation *context)
return data;
}
-
/* Create the EDataBook error quark */
GQuark
e_data_book_error_quark (void)
@@ -185,7 +184,6 @@ e_data_book_error_quark (void)
return quark;
}
-
/* Generate the GObject boilerplate */
G_DEFINE_TYPE(EDataBook, e_data_book, G_TYPE_OBJECT)
@@ -325,7 +323,7 @@ e_data_book_respond_remove (EDataBook *book, guint opid, EDataBookStatus status)
}
static void
-impl_AddressBook_Book_getContact (EDataBook *book, const char *IN_uid, DBusGMethodInvocation *context)
+impl_AddressBook_Book_getContact (EDataBook *book, const gchar *IN_uid, DBusGMethodInvocation *context)
{
OperationData *op;
@@ -352,7 +350,7 @@ e_data_book_respond_get_contact (EDataBook *book, guint32 opid, EDataBookStatus
}
static void
-impl_AddressBook_Book_getContactList (EDataBook *book, const char *query, DBusGMethodInvocation *context)
+impl_AddressBook_Book_getContactList (EDataBook *book, const gchar *query, DBusGMethodInvocation *context)
{
OperationData *op;
@@ -373,7 +371,7 @@ e_data_book_respond_get_contact_list (EDataBook *book, guint32 opid, EDataBookSt
}
static void
-impl_AddressBook_Book_authenticateUser(EDataBook *book, const char *IN_user, const char *IN_passwd, const char *IN_auth_method, DBusGMethodInvocation *context)
+impl_AddressBook_Book_authenticateUser(EDataBook *book, const gchar *IN_user, const gchar *IN_passwd, const gchar *IN_auth_method, DBusGMethodInvocation *context)
{
OperationData *op;
@@ -384,15 +382,14 @@ impl_AddressBook_Book_authenticateUser(EDataBook *book, const char *IN_user, con
g_thread_pool_push (op_pool, op, NULL);
}
-
static void
-data_book_return_error (DBusGMethodInvocation *context, gint code, const char *error_str)
+data_book_return_error (DBusGMethodInvocation *context, gint code, const gchar *error_str)
{
GError *error;
-
- error = g_error_new (E_DATA_BOOK_ERROR, code, "%s", error_str) ;
+
+ error = g_error_new (E_DATA_BOOK_ERROR, code, "%s", error_str);
dbus_g_method_return_error (context, error);
-
+
g_error_free (error);
}
@@ -409,7 +406,7 @@ e_data_book_respond_authenticate_user (EDataBook *book, guint32 opid, EDataBookS
}
static void
-impl_AddressBook_Book_addContact (EDataBook *book, const char *IN_vcard, DBusGMethodInvocation *context)
+impl_AddressBook_Book_addContact (EDataBook *book, const gchar *IN_vcard, DBusGMethodInvocation *context)
{
OperationData *op;
@@ -439,7 +436,7 @@ e_data_book_respond_create (EDataBook *book, guint32 opid, EDataBookStatus statu
}
static void
-impl_AddressBook_Book_modifyContact (EDataBook *book, const char *IN_vcard, DBusGMethodInvocation *context)
+impl_AddressBook_Book_modifyContact (EDataBook *book, const gchar *IN_vcard, DBusGMethodInvocation *context)
{
OperationData *op;
@@ -469,7 +466,7 @@ e_data_book_respond_modify (EDataBook *book, guint32 opid, EDataBookStatus statu
}
static void
-impl_AddressBook_Book_removeContacts(EDataBook *book, const char **IN_uids, DBusGMethodInvocation *context)
+impl_AddressBook_Book_removeContacts(EDataBook *book, const gchar **IN_uids, DBusGMethodInvocation *context)
{
OperationData *op;
@@ -507,7 +504,7 @@ e_data_book_respond_remove_contacts (EDataBook *book, guint32 opid, EDataBookSta
}
static gboolean
-impl_AddressBook_Book_getStaticCapabilities(EDataBook *book, char **OUT_capabilities, GError **error)
+impl_AddressBook_Book_getStaticCapabilities(EDataBook *book, gchar **OUT_capabilities, GError **error)
{
*OUT_capabilities = e_book_backend_get_static_capabilities (e_data_book_get_backend (book));
return TRUE;
@@ -549,7 +546,7 @@ e_data_book_respond_get_supported_auth_methods (EDataBook *book, guint32 opid, E
return_status_and_list (opid, status, auth_methods, FALSE);
}
-static char*
+static gchar *
construct_bookview_path (void)
{
static volatile guint counter = 1;
@@ -560,12 +557,12 @@ construct_bookview_path (void)
}
static void
-impl_AddressBook_Book_getBookView (EDataBook *book, const char *search, const guint max_results, DBusGMethodInvocation *context)
+impl_AddressBook_Book_getBookView (EDataBook *book, const gchar *search, const guint max_results, DBusGMethodInvocation *context)
{
EBookBackend *backend = e_data_book_get_backend (book);
EBookBackendSExp *card_sexp;
EDataBookView *book_view;
- char *path;
+ gchar *path;
card_sexp = e_book_backend_sexp_new (search);
if (!card_sexp) {
@@ -583,7 +580,7 @@ impl_AddressBook_Book_getBookView (EDataBook *book, const char *search, const gu
}
static void
-impl_AddressBook_Book_getChanges(EDataBook *book, const char *IN_change_id, DBusGMethodInvocation *context)
+impl_AddressBook_Book_getChanges(EDataBook *book, const gchar *IN_change_id, DBusGMethodInvocation *context)
{
OperationData *op;
@@ -602,7 +599,7 @@ e_data_book_respond_get_changes (EDataBook *book, guint32 opid, EDataBookStatus
} else {
/* The DBus interface to this is a(us), an array of structs of unsigned ints
and strings. In dbus-glib this is a GPtrArray of GValueArray of unsigned
- int and strings. */
+ gint and strings. */
GPtrArray *array;
array = g_ptr_array_new ();
@@ -682,11 +679,11 @@ return_status_and_list (guint32 opid, EDataBookStatus status, GList *list, gbool
DBusGMethodInvocation *context = opid_fetch (opid);
if (status == E_DATA_BOOK_STATUS_SUCCESS) {
- char **array;
+ gchar **array;
GList *l;
- int i = 0;
+ gint i = 0;
- array = g_new0 (char*, g_list_length (list) + 1);
+ array = g_new0 (gchar *, g_list_length (list) + 1);
for (l = list; l != NULL; l = l->next) {
array[i++] = l->data;
}
diff --git a/addressbook/libedata-book/opid.c b/addressbook/libedata-book/opid.c
index 127e0c1..e5fe841 100644
--- a/addressbook/libedata-book/opid.c
+++ b/addressbook/libedata-book/opid.c
@@ -22,7 +22,7 @@
#include "opid.h"
G_LOCK_DEFINE_STATIC (lock);
-static int counter = 0;
+static gint counter = 0;
static GHashTable *hash = NULL;
static void
@@ -35,7 +35,7 @@ opid_init (void)
guint32
opid_store (gpointer p)
{
- int id;
+ gint id;
g_return_val_if_fail (p, 0);
diff --git a/calendar/libecal/e-cal-system-timezone.c b/calendar/libecal/e-cal-system-timezone.c
index 2c9abfd..b6b81ef 100644
--- a/calendar/libecal/e-cal-system-timezone.c
+++ b/calendar/libecal/e-cal-system-timezone.c
@@ -276,7 +276,7 @@ files_are_identical_inode (struct stat *a_stat,
gboolean res = a_stat->st_ino == b_stat->st_ino;
if (res) {
- const char *filename;
+ const gchar *filename;
filename = strrchr (b_filename, '/');
if (filename)
diff --git a/calendar/libecal/e-cal-view.c b/calendar/libecal/e-cal-view.c
index 87edac3..54baf23 100644
--- a/calendar/libecal/e-cal-view.c
+++ b/calendar/libecal/e-cal-view.c
@@ -62,18 +62,17 @@ static guint signals[LAST_SIGNAL];
static GObjectClass *parent_class;
-
static GList *
build_object_list (const gchar **seq)
{
GList *list;
- int i;
+ gint i;
list = NULL;
for (i = 0; seq[i]; i++) {
icalcomponent *comp;
- comp = icalcomponent_new_from_string ((char*)seq[i]);
+ comp = icalcomponent_new_from_string ((gchar *)seq[i]);
if (!comp)
continue;
@@ -87,7 +86,7 @@ static GList *
build_id_list (const gchar **seq)
{
GList *list;
- int i;
+ gint i;
list = NULL;
for (i = 0; seq[i]; i++) {
@@ -164,7 +163,7 @@ objects_removed_cb (DBusGProxy *proxy, const gchar **uids, gpointer data)
}
static void
-progress_cb (DBusGProxy *proxy, const gchar *message, int percent, gpointer data)
+progress_cb (DBusGProxy *proxy, const gchar *message, gint percent, gpointer data)
{
ECalView *view;
diff --git a/calendar/libecal/e-cal.c b/calendar/libecal/e-cal.c
index b5df1af..ecf0e68 100644
--- a/calendar/libecal/e-cal.c
+++ b/calendar/libecal/e-cal.c
@@ -340,12 +340,10 @@ cal_mode_enum_get_type (void)
return cal_mode_enum_type;
}
-
-
static EDataCalObjType
convert_type (ECalSourceType type)
{
- switch (type){
+ switch (type) {
case E_CAL_SOURCE_TYPE_EVENT:
return Event;
case E_CAL_SOURCE_TYPE_TODO:
@@ -552,7 +550,6 @@ e_cal_activate(GError **error)
return TRUE;
}
-
static gboolean
reopen_with_auth (gpointer data)
{
@@ -1709,7 +1706,6 @@ e_cal_set_mode (ECal *ecal, CalMode mode)
return TRUE;
}
-
/* This is used in the callback which fetches all the timezones needed for an
object. */
typedef struct _ECalGetTimezonesData ECalGetTimezonesData;
diff --git a/calendar/libedata-cal/e-data-cal-factory.c b/calendar/libedata-cal/e-data-cal-factory.c
index ce79269..0f078cc 100644
--- a/calendar/libedata-cal/e-data-cal-factory.c
+++ b/calendar/libedata-cal/e-data-cal-factory.c
@@ -47,7 +47,7 @@
#define d(x)
-static void impl_CalFactory_getCal (EDataCalFactory *factory, const char *IN_uri, EDataCalObjType type, DBusGMethodInvocation *context);
+static void impl_CalFactory_getCal (EDataCalFactory *factory, const gchar *IN_uri, EDataCalObjType type, DBusGMethodInvocation *context);
#include "e-data-cal-factory-glue.h"
static GMainLoop *loop;
@@ -103,7 +103,7 @@ e_data_cal_factory_error_quark (void)
static icalcomponent_kind
calobjtype_to_icalkind (const EDataCalObjType type)
{
- switch (type){
+ switch (type) {
case Event:
return ICAL_VEVENT_COMPONENT;
case Todo:
@@ -120,7 +120,7 @@ calobjtype_to_icalkind (const EDataCalObjType type)
static const gchar *
calobjtype_to_string (const EDataCalObjType type)
{
- switch (type){
+ switch (type) {
case Event:
return "VEVENT";
case Todo:
@@ -443,13 +443,13 @@ impl_CalFactory_getCal (EDataCalFactory *factory,
static void
name_owner_changed (DBusGProxy *proxy,
- const char *name,
- const char *prev_owner,
- const char *new_owner,
+ const gchar *name,
+ const gchar *prev_owner,
+ const gchar *new_owner,
EDataCalFactory *factory)
{
if (strcmp (new_owner, "") == 0 && strcmp (name, prev_owner) == 0) {
- char *key;
+ gchar *key;
GList *list = NULL;
if (g_hash_table_lookup_extended (factory->priv->connections, prev_owner, (gpointer)&key, (gpointer)&list)) {
g_list_foreach (list, (GFunc)g_object_unref, NULL);
@@ -660,7 +660,7 @@ e_data_cal_factory_dump_active_backends (EDataCalFactory *factory)
/* Convenience function to print an error and exit */
G_GNUC_NORETURN static void
-die (const char *prefix, GError *error)
+die (const gchar *prefix, GError *error)
{
g_error("%s: %s", prefix, error->message);
g_error_free (error);
@@ -679,7 +679,7 @@ offline_state_changed_cb (EOfflineListener *eol, EDataCalFactory *factory)
#define E_DATA_CAL_FACTORY_SERVICE_NAME "org.gnome.evolution.dataserver.Calendar"
-int
+gint
main (gint argc, gchar **argv)
{
GError *error = NULL;
diff --git a/calendar/libedata-cal/e-data-cal-types.h b/calendar/libedata-cal/e-data-cal-types.h
index c36251f..83be605 100644
--- a/calendar/libedata-cal/e-data-cal-types.h
+++ b/calendar/libedata-cal/e-data-cal-types.h
@@ -31,10 +31,10 @@ typedef enum {
QueryRefused,
CouldNotCancel,
-
+
OtherError,
InvalidServerVersion
-
+
} EDataCalCallStatus;
/* Some hacks so the backends compile without change */
diff --git a/calendar/libedata-cal/e-data-cal-view.c b/calendar/libedata-cal/e-data-cal-view.c
index cb8c9c2..14174f5 100644
--- a/calendar/libedata-cal/e-data-cal-view.c
+++ b/calendar/libedata-cal/e-data-cal-view.c
@@ -60,7 +60,7 @@ struct _EDataCalViewPrivate {
GHashTable *ids;
- char *path;
+ gchar *path;
};
G_DEFINE_TYPE (EDataCalView, e_data_cal_view, G_TYPE_OBJECT);
@@ -183,16 +183,16 @@ e_data_cal_view_init (EDataCalView *view)
priv->started = FALSE;
priv->sexp = NULL;
- priv->adds = g_array_sized_new (TRUE, TRUE, sizeof (char*), THRESHOLD);
- priv->changes = g_array_sized_new (TRUE, TRUE, sizeof (char*), THRESHOLD);
- priv->removes = g_array_sized_new (TRUE, TRUE, sizeof (char*), THRESHOLD);
+ priv->adds = g_array_sized_new (TRUE, TRUE, sizeof (gchar *), THRESHOLD);
+ priv->changes = g_array_sized_new (TRUE, TRUE, sizeof (gchar *), THRESHOLD);
+ priv->removes = g_array_sized_new (TRUE, TRUE, sizeof (gchar *), THRESHOLD);
priv->ids = g_hash_table_new_full (id_hash, id_equal, (GDestroyNotify)e_cal_component_free_id, NULL);
}
EDataCalView *
e_data_cal_view_new (ECalBackend *backend,
- const char *path, ECalBackendSExp *sexp)
+ const gchar *path, ECalBackendSExp *sexp)
{
EDataCalView *query;
@@ -204,7 +204,7 @@ e_data_cal_view_new (ECalBackend *backend,
return query;
}
-const char *
+const gchar *
e_data_cal_view_get_dbus_path (EDataCalView *view)
{
g_return_val_if_fail (E_IS_DATA_CAL_VIEW (view), NULL);
@@ -266,7 +266,7 @@ send_pending_removes (EDataCalView *view)
}
static void
-notify_add (EDataCalView *view, char *obj)
+notify_add (EDataCalView *view, gchar *obj)
{
EDataCalViewPrivate *priv = view->priv;
ECalComponent *comp;
@@ -287,7 +287,7 @@ notify_add (EDataCalView *view, char *obj)
}
static void
-notify_change (EDataCalView *view, char *obj)
+notify_change (EDataCalView *view, gchar *obj)
{
EDataCalViewPrivate *priv = view->priv;
@@ -301,7 +301,7 @@ static void
notify_remove (EDataCalView *view, ECalComponentId *id)
{
EDataCalViewPrivate *priv = view->priv;
- char *uid;
+ gchar *uid;
send_pending_adds (view);
send_pending_changes (view);
@@ -325,7 +325,6 @@ notify_done (EDataCalView *view)
g_signal_emit (view, signals[DONE], 0, priv->done_status);
}
-
static gboolean
impl_EDataCalView_start (EDataCalView *query, GError **error)
{
diff --git a/calendar/libedata-cal/e-data-cal.c b/calendar/libedata-cal/e-data-cal.c
index 132fc34..5797da0 100644
--- a/calendar/libedata-cal/e-data-cal.c
+++ b/calendar/libedata-cal/e-data-cal.c
@@ -54,7 +54,7 @@ static void impl_Cal_getDefaultObject (EDataCal *cal, DBusGMethodInvocation *con
static void impl_Cal_getObject (EDataCal *cal, const gchar *uid, const gchar *rid, DBusGMethodInvocation *context);
static void impl_Cal_getObjectList (EDataCal *cal, const gchar *sexp, DBusGMethodInvocation *context);
static void impl_Cal_getChanges (EDataCal *cal, const gchar *change_id, DBusGMethodInvocation *context);
-static void impl_Cal_getFreeBusy (EDataCal *cal, const char **user_list, const gulong start, const gulong end, DBusGMethodInvocation *context);
+static void impl_Cal_getFreeBusy (EDataCal *cal, const gchar **user_list, const gulong start, const gulong end, DBusGMethodInvocation *context);
static void impl_Cal_discardAlarm (EDataCal *cal, const gchar *uid, const gchar *auid, DBusGMethodInvocation *context);
static void impl_Cal_createObject (EDataCal *cal, const gchar *calobj, DBusGMethodInvocation *context);
static void impl_Cal_modifyObject (EDataCal *cal, const gchar *calobj, const EDataCalObjModType mod, DBusGMethodInvocation *context);
@@ -257,7 +257,7 @@ impl_Cal_setMode (EDataCal *cal,
static void
impl_Cal_getDefaultObject (EDataCal *cal, DBusGMethodInvocation *context)
{
- e_cal_backend_get_default_object (cal->priv->backend, cal, context);
+ e_cal_backend_get_default_object (cal->priv->backend, cal, context);
}
/* EDataCal::getObject method */
@@ -291,7 +291,7 @@ impl_Cal_getChanges (EDataCal *cal,
/* EDataCal::getFreeBusy method */
static void
impl_Cal_getFreeBusy (EDataCal *cal,
- const char **user_list,
+ const gchar **user_list,
const gulong start,
const gulong end,
DBusGMethodInvocation *context)
@@ -299,7 +299,7 @@ impl_Cal_getFreeBusy (EDataCal *cal,
GList *users = NULL;
if (user_list) {
- int i;
+ gint i;
for (i = 0; user_list[i]; i++)
users = g_list_append (users, (gpointer)user_list[i]);
@@ -381,7 +381,7 @@ impl_Cal_getAttachmentList (EDataCal *cal,
}
/* Function to get a new EDataCalView path, used by getQuery below */
-static gchar*
+static gchar *
construct_calview_path (void)
{
static guint counter = 1;
@@ -396,7 +396,7 @@ impl_Cal_getQuery (EDataCal *cal,
{
EDataCalView *query;
ECalBackendSExp *obj_sexp;
- char *path;
+ gchar *path;
/* we handle this entirely here, since it doesn't require any
backend involvement now that we have e_cal_view_start to
@@ -432,8 +432,6 @@ impl_Cal_getTimezone (EDataCal *cal,
e_cal_backend_get_timezone (cal->priv->backend, cal, context, tzid);
}
-
-
/* EDataCal::addTimezone method */
static void
impl_Cal_addTimezone (EDataCal *cal,
@@ -514,7 +512,7 @@ e_data_cal_notify_alarm_email_address (EDataCal *cal, EServerMethodContext conte
* Notifies listeners of the completion of the get_ldap_attribute method call.
*/
void
-e_data_cal_notify_ldap_attribute (EDataCal *cal, EServerMethodContext context, EDataCalCallStatus status, const char *attribute)
+e_data_cal_notify_ldap_attribute (EDataCal *cal, EServerMethodContext context, EDataCalCallStatus status, const gchar *attribute)
{
DBusGMethodInvocation *method = context;
if (status != Success)
@@ -692,19 +690,19 @@ e_data_cal_notify_objects_sent (EDataCal *cal, EServerMethodContext context, EDa
if (status != Success) {
dbus_g_method_return_error (method, g_error_new (E_DATA_CAL_ERROR, status, _("Cannot send calendar objects")));
} else {
- char **users_array = NULL;
+ gchar **users_array = NULL;
if (users) {
GList *l;
- char **user;
+ gchar **user;
- users_array = g_new0 (char *, g_list_length (users)+1);
+ users_array = g_new0 (gchar *, g_list_length (users)+1);
if (users_array)
for (l = users, user = users_array; l != NULL; l = l->next, user++)
*user = g_strdup (l->data);
}
else
- users_array = g_new0 (char *, 1);
+ users_array = g_new0 (gchar *, 1);
dbus_g_method_return (method, users_array, calobj ? calobj : "");
if (users_array)
@@ -763,11 +761,11 @@ e_data_cal_notify_object_list (EDataCal *cal, EServerMethodContext context, EDat
if (status != Success) {
dbus_g_method_return_error (method, g_error_new (E_DATA_CAL_ERROR, status, _("Cannot retrieve calendar object list")));
} else {
- char **seq = NULL;
+ gchar **seq = NULL;
GList *l;
- int i;
+ gint i;
- seq = g_new0 (char *, g_list_length (objects)+1);
+ seq = g_new0 (gchar *, g_list_length (objects)+1);
for (l = objects, i = 0; l; l = l->next, i++) {
seq[i] = l->data;
}
@@ -789,11 +787,11 @@ void
e_data_cal_notify_attachment_list (EDataCal *cal, EServerMethodContext context, EDataCalCallStatus status, GSList *attachments)
{
DBusGMethodInvocation *method = context;
- char **seq;
+ gchar **seq;
GSList *l;
- int i;
+ gint i;
- seq = g_new0 (char *, g_slist_length (attachments));
+ seq = g_new0 (gchar *, g_slist_length (attachments));
for (l = attachments, i = 0; l; l = l->next, i++) {
seq[i] = g_strdup (l->data);
}
@@ -897,13 +895,13 @@ e_data_cal_notify_changes (EDataCal *cal, EServerMethodContext context, EDataCal
if (status != Success) {
dbus_g_method_return_error (method, g_error_new (E_DATA_CAL_ERROR, status, _("Cannot retrieve calendar changes")));
} else {
- char **additions, **modifications, **removals;
+ gchar **additions, **modifications, **removals;
GList *l;
- int i;
+ gint i;
additions = NULL;
if (adds) {
- additions = g_new0 (char *, g_list_length (adds) + 1);
+ additions = g_new0 (gchar *, g_list_length (adds) + 1);
if (additions)
for (i = 0, l = adds; l; i++, l = l->next)
additions[i] = g_strdup (l->data);
@@ -911,7 +909,7 @@ e_data_cal_notify_changes (EDataCal *cal, EServerMethodContext context, EDataCal
modifications = NULL;
if (modifies) {
- modifications = g_new0 (char *, g_list_length (modifies) + 1);
+ modifications = g_new0 (gchar *, g_list_length (modifies) + 1);
if (modifications)
for (i = 0, l = modifies; l; i++, l = l->next)
modifications[i] = g_strdup (l->data);
@@ -919,7 +917,7 @@ e_data_cal_notify_changes (EDataCal *cal, EServerMethodContext context, EDataCal
removals = NULL;
if (deletes) {
- removals = g_new0 (char *, g_list_length (deletes) + 1);
+ removals = g_new0 (gchar *, g_list_length (deletes) + 1);
if (removals)
for (i = 0, l = deletes; l; i++, l = l->next)
removals[i] = g_strdup (l->data);
@@ -947,11 +945,11 @@ e_data_cal_notify_free_busy (EDataCal *cal, EServerMethodContext context, EDataC
if (status != Success) {
dbus_g_method_return_error (method, g_error_new (E_DATA_CAL_ERROR, status, _("Cannot retrieve calendar free/busy list")));
} else {
- char **seq;
+ gchar **seq;
GList *l;
- int i;
+ gint i;
- seq = g_new0 (char *, g_list_length (freebusy));
+ seq = g_new0 (gchar *, g_list_length (freebusy));
for (i = 0, l = freebusy; l; i++, l = l->next) {
seq[i] = g_strdup (l->data);
}
diff --git a/camel/camel-cipher-context.c b/camel/camel-cipher-context.c
index fb7e330..9d5731c 100644
--- a/camel/camel-cipher-context.c
+++ b/camel/camel-cipher-context.c
@@ -488,7 +488,7 @@ camel_cipher_validity_add_certinfo(CamelCipherValidity *vin, enum _camel_cipher_
* Add a cert info to the signer or encrypter info, with extended data set.
**/
void
-camel_cipher_validity_add_certinfo_ex (CamelCipherValidity *vin, camel_cipher_validity_mode_t mode, const gchar *name, const gchar *email, void *cert_data, void (*cert_data_free)(void *cert_data), void *(*cert_data_clone)(void *cert_data))
+camel_cipher_validity_add_certinfo_ex (CamelCipherValidity *vin, camel_cipher_validity_mode_t mode, const gchar *name, const gchar *email, gpointer cert_data, void (*cert_data_free)(gpointer cert_data), gpointer (*cert_data_clone)(gpointer cert_data))
{
CamelCipherCertInfo *info;
CamelDList *list;
diff --git a/camel/camel-cipher-context.h b/camel/camel-cipher-context.h
index 0a82abf..7364416 100644
--- a/camel/camel-cipher-context.h
+++ b/camel/camel-cipher-context.h
@@ -77,9 +77,9 @@ struct _CamelCipherCertInfo {
gchar *name; /* common name */
gchar *email;
- void *cert_data; /* custom certificate data; can be NULL */
- void (*cert_data_free) (void *cert_data); /* called to free cert_data; can be NULL only if cert_data is NULL */
- void *(*cert_data_clone) (void *cert_data); /* called to clone cert_data; can be NULL only if cert_data is NULL */
+ gpointer cert_data; /* custom certificate data; can be NULL */
+ void (*cert_data_free) (gpointer cert_data); /* called to free cert_data; can be NULL only if cert_data is NULL */
+ gpointer (*cert_data_clone) (gpointer cert_data); /* called to clone cert_data; can be NULL only if cert_data is NULL */
};
struct _CamelCipherValidity {
@@ -183,9 +183,9 @@ void camel_cipher_validity_add_certinfo_ex (
camel_cipher_validity_mode_t mode,
const gchar *name,
const gchar *email,
- void *cert_data,
- void (*cert_data_free) (void *cert_data),
- void *(*cert_data_clone) (void *cert_data));
+ gpointer cert_data,
+ void (*cert_data_free) (gpointer cert_data),
+ gpointer (*cert_data_clone) (gpointer cert_data));
void camel_cipher_validity_envelope(CamelCipherValidity *parent, CamelCipherValidity *valid);
void camel_cipher_validity_free (CamelCipherValidity *validity);
diff --git a/camel/camel-db.c b/camel/camel-db.c
index 5e7ce51..1729f3b 100644
--- a/camel/camel-db.c
+++ b/camel/camel-db.c
@@ -1263,7 +1263,6 @@ camel_db_reset_folder_version (CamelDB *cdb, const gchar *folder_name, gint rese
gchar *version_insert_query;
gchar *drop_folder_query;
-
drop_folder_query = sqlite3_mprintf ("DROP TABLE IF EXISTS '%q_version'", folder_name);
version_creation_query = sqlite3_mprintf ("CREATE TABLE IF NOT EXISTS '%q_version' ( version TEXT )", folder_name);
diff --git a/camel/camel-file-utils.c b/camel/camel-file-utils.c
index 4af03c6..2fb6986 100644
--- a/camel/camel-file-utils.c
+++ b/camel/camel-file-utils.c
@@ -764,13 +764,13 @@ camel_file_util_savename(const gchar *filename)
* Returns 0 on success or -1 on fail. In the case of failure, errno
* will be set appropriately.
**/
-int
-camel_mkdir (const char *path, mode_t mode)
+gint
+camel_mkdir (const gchar *path, mode_t mode)
{
- char *copy, *p;
-
+ gchar *copy, *p;
+
g_assert(path && path[0] == '/');
-
+
p = copy = g_alloca (strlen (path) + 1);
strcpy(copy, path);
do {
@@ -784,6 +784,6 @@ camel_mkdir (const char *path, mode_t mode)
if (p)
*p = '/';
} while (p);
-
+
return 0;
}
diff --git a/camel/camel-file-utils.h b/camel/camel-file-utils.h
index 3db63e6..8a8ab54 100644
--- a/camel/camel-file-utils.h
+++ b/camel/camel-file-utils.h
@@ -69,7 +69,7 @@ gssize camel_read_socket (gint fd, gchar *buf, gsize n);
gssize camel_write_socket (gint fd, const gchar *buf, gsize n);
gchar *camel_file_util_savename(const gchar *filename);
-int camel_mkdir (const char *path, mode_t mode);
+gint camel_mkdir (const gchar *path, mode_t mode);
G_END_DECLS
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index 0bd1276..cdd3d04 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -1581,7 +1581,7 @@ camel_folder_summary_save_to_db (CamelFolderSummary *s, CamelException *ex)
s->flags |= CAMEL_SUMMARY_DIRTY;
return -1;
}
-
+
if (ex && camel_exception_is_set (ex) && strstr (camel_exception_get_description (ex), "26 columns but 28 values") != NULL) {
/* This is an error is previous migration. Let remigrate this folder alone. */
camel_db_abort_transaction (cdb, ex);
@@ -1599,7 +1599,6 @@ camel_folder_summary_save_to_db (CamelFolderSummary *s, CamelException *ex)
}
}
-
camel_db_end_transaction (cdb, ex);
record = (((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_to_db (s, ex));
diff --git a/camel/camel-smime-context.c b/camel/camel-smime-context.c
index 70f4b4e..99ad6d8 100644
--- a/camel/camel-smime-context.c
+++ b/camel/camel-smime-context.c
@@ -62,8 +62,8 @@
#define d(x)
-void smime_cert_data_free (void *cert_data);
-void *smime_cert_data_clone (void *cert_data);
+void smime_cert_data_free (gpointer cert_data);
+gpointer smime_cert_data_clone (gpointer cert_data);
struct _CamelSMIMEContextPrivate {
CERTCertDBHandle *certdb;
@@ -720,15 +720,15 @@ sm_status_description(NSSCMSVerificationStatus status)
}
void
-smime_cert_data_free (void *cert_data)
+smime_cert_data_free (gpointer cert_data)
{
g_return_if_fail (cert_data != NULL);
CERT_DestroyCertificate (cert_data);
}
-void *
-smime_cert_data_clone (void *cert_data)
+gpointer
+smime_cert_data_clone (gpointer cert_data)
{
g_return_val_if_fail (cert_data != NULL, NULL);
diff --git a/camel/camel-tcp-stream-ssl.c b/camel/camel-tcp-stream-ssl.c
index 482e1d0..e2af703 100644
--- a/camel/camel-tcp-stream-ssl.c
+++ b/camel/camel-tcp-stream-ssl.c
@@ -1064,13 +1064,13 @@ enable_ssl (CamelTcpStreamSSL *ssl, PRFileDesc *fd)
SSL_SetURL (ssl_fd, ssl->priv->expected_host);
- /* NSS provides a default implementation for the SSL_GetClientAuthDataHook callback
- * but does not enable it by default. It must be explicltly requested by the application.
- * See: http://www.mozilla.org/projects/security/pki/nss/ref/ssl/sslfnc.html#1126622 */
- SSL_GetClientAuthDataHook (ssl_fd, (SSLGetClientAuthData)&NSS_GetClientAuthData, NULL );
-
- /* NSS provides _and_ installs a default implementation for the
- * SSL_AuthCertificateHook callback so we _don't_ need to install one. */
+ /* NSS provides a default implementation for the SSL_GetClientAuthDataHook callback
+ * but does not enable it by default. It must be explicltly requested by the application.
+ * See: http://www.mozilla.org/projects/security/pki/nss/ref/ssl/sslfnc.html#1126622 */
+ SSL_GetClientAuthDataHook (ssl_fd, (SSLGetClientAuthData)&NSS_GetClientAuthData, NULL );
+
+ /* NSS provides _and_ installs a default implementation for the
+ * SSL_AuthCertificateHook callback so we _don't_ need to install one. */
SSL_BadCertHook (ssl_fd, ssl_bad_cert, ssl);
ssl->priv->ssl_mode = TRUE;
diff --git a/camel/providers/imap/camel-imap-store-summary.c b/camel/providers/imap/camel-imap-store-summary.c
index 7737200..ac0c223 100644
--- a/camel/providers/imap/camel-imap-store-summary.c
+++ b/camel/providers/imap/camel-imap-store-summary.c
@@ -575,7 +575,7 @@ namespaces_save (CamelImapStoreSummary *s, FILE *in, CamelImapStoreNamespace *ns
{
while (ns) {
if (camel_file_util_encode_string(in, ns->path) == -1
- || camel_file_util_encode_string(in, ns->full_name) == -1
+ || camel_file_util_encode_string(in, ns->full_name) == -1
|| camel_file_util_encode_uint32(in, (guint32)ns->sep) == -1)
return FALSE;
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index 5523a78..cba10a6 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -1447,7 +1447,7 @@ imap_connect (CamelService *service, CamelException *ex)
}
if (namespaces) {
- #define add_all(_ns) \
+ #define add_all(_ns) \
if (_ns) { \
struct _namespace *ns; \
\
@@ -2877,7 +2877,7 @@ get_folder_info_offline (CamelStore *store, const gchar *top,
if ((g_str_equal (name, full_name)
|| imap_match_pattern (ns, pattern, full_name)
|| (include_inbox && !g_ascii_strcasecmp (full_name, "INBOX")))
- && ((ns == main_ns &&
+ && ((ns == main_ns &&
((imap_store->parameters & IMAP_PARAM_SUBSCRIPTIONS) == 0
|| (flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED) == 0))
|| (si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED)
diff --git a/camel/providers/imapx/camel-imapx-exception.c b/camel/providers/imapx/camel-imapx-exception.c
index 95add85..e031baf 100644
--- a/camel/providers/imapx/camel-imapx-exception.c
+++ b/camel/providers/imapx/camel-imapx-exception.c
@@ -50,7 +50,7 @@ camel_exception_throw_ex(CamelException *ex)
}
void
-camel_exception_throw(int id, char *fmt, ...)
+camel_exception_throw(gint id, gchar *fmt, ...)
{
CamelException *ex;
va_list ap;
diff --git a/camel/providers/imapx/camel-imapx-exception.h b/camel/providers/imapx/camel-imapx-exception.h
index 4132044..a27183f 100644
--- a/camel/providers/imapx/camel-imapx-exception.h
+++ b/camel/providers/imapx/camel-imapx-exception.h
@@ -30,6 +30,6 @@ void camel_exception_drop(struct _CamelExceptionEnv *env);
/* user functions */
void camel_exception_throw_ex(CamelException *ex) __attribute__ ((noreturn));
-void camel_exception_throw(int id, char *fmt, ...) __attribute__ ((noreturn));
+void camel_exception_throw(gint id, gchar *fmt, ...) __attribute__ ((noreturn));
#endif
diff --git a/camel/providers/imapx/camel-imapx-folder.c b/camel/providers/imapx/camel-imapx-folder.c
index dbd7cb3..4549414 100644
--- a/camel/providers/imapx/camel-imapx-folder.c
+++ b/camel/providers/imapx/camel-imapx-folder.c
@@ -1,13 +1,13 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* camel-imap-folder.c : class for a imap folder */
-/*
+/*
* Authors: Michael Zucchi <notzed ximian com>
*
* Copyright (C) 2002 Ximian, Inc. (www.ximian.com)
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
@@ -53,12 +53,12 @@
static CamelFolderClass *parent_class;
CamelFolder *
-camel_imapx_folder_new(CamelStore *store, const char *path, const char *raw)
+camel_imapx_folder_new(CamelStore *store, const gchar *path, const gchar *raw)
{
CamelFolder *folder;
d(printf("opening imap folder '%s'\n", path));
-
+
folder = CAMEL_FOLDER (camel_object_new (CAMEL_IMAPX_FOLDER_TYPE));
camel_folder_construct(folder, store, path, path);
@@ -83,7 +83,7 @@ camel_imapx_folder_delete(CamelIMAPXFolder *folder, CamelException *ex)
}
void
-camel_imapx_folder_rename(CamelIMAPXFolder *folder, const char *new, CamelException *ex)
+camel_imapx_folder_rename(CamelIMAPXFolder *folder, const gchar *new, CamelException *ex)
{
}
@@ -93,7 +93,7 @@ camel_imapx_folder_close(CamelIMAPXFolder *folder, CamelException *ex)
}
#endif
-static void
+static void
imapx_refresh_info (CamelFolder *folder, CamelException *ex)
{
CamelIMAPXStore *is = (CamelIMAPXStore *)folder->parent_store;
@@ -120,7 +120,7 @@ imapx_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
}
static CamelMimeMessage *
-imapx_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
+imapx_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
CamelMimeMessage *msg = NULL;
CamelStream *stream;
@@ -145,7 +145,7 @@ imapx_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
}
static void
-imapx_append_message(CamelFolder *folder, CamelMimeMessage *message, const CamelMessageInfo *info, char **appended_uid, CamelException *ex)
+imapx_append_message(CamelFolder *folder, CamelMimeMessage *message, const CamelMessageInfo *info, gchar **appended_uid, CamelException *ex)
{
CamelIMAPXStore *is = (CamelIMAPXStore *)folder->parent_store;
@@ -216,7 +216,7 @@ imap_folder_class_init (CamelIMAPXFolderClass *klass)
{
((CamelFolderClass *)klass)->refresh_info = imapx_refresh_info;
((CamelFolderClass *)klass)->sync = imapx_sync;
-
+
((CamelFolderClass *)klass)->get_message = imapx_get_message;
((CamelFolderClass *)klass)->append_message = imapx_append_message;
}
@@ -229,7 +229,7 @@ imap_folder_init(CamelObject *o, CamelObjectClass *klass)
folder->folder_flags |= (CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY |
CAMEL_FOLDER_HAS_SEARCH_CAPABILITY);
-
+
folder->permanent_flags = CAMEL_MESSAGE_ANSWERED |
CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_DRAFT |
CAMEL_MESSAGE_FLAGGED | CAMEL_MESSAGE_SEEN | CAMEL_MESSAGE_USER;
@@ -247,7 +247,7 @@ CamelType
camel_imapx_folder_get_type (void)
{
static CamelType camel_imapx_folder_type = CAMEL_INVALID_TYPE;
-
+
if (!camel_imapx_folder_type) {
camel_imapx_folder_type = camel_type_register (CAMEL_FOLDER_TYPE, "CamelIMAPXFolder",
sizeof (CamelIMAPXFolder),
@@ -258,6 +258,6 @@ camel_imapx_folder_get_type (void)
(CamelObjectFinalizeFunc)imap_finalise);
parent_class = (CamelFolderClass *)camel_folder_get_type();
}
-
+
return camel_imapx_folder_type;
}
diff --git a/camel/providers/imapx/camel-imapx-folder.h b/camel/providers/imapx/camel-imapx-folder.h
index 1ed3a89..95a8156 100644
--- a/camel/providers/imapx/camel-imapx-folder.h
+++ b/camel/providers/imapx/camel-imapx-folder.h
@@ -1,13 +1,13 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* camel-imap-folder.h : Class for a IMAP folder */
-/*
+/*
* Authors: Michael Zucchi <notzed ximian com>
*
* Copyright (C) 2002 Ximian, Inc. (www.ximian.com)
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
@@ -39,7 +39,7 @@ extern "C" {
typedef struct _CamelIMAPXFolder {
CamelFolder parent_object;
- char *raw_name;
+ gchar *raw_name;
// CamelChangeInfo *changes;
} CamelIMAPXFolder;
@@ -51,7 +51,7 @@ typedef struct _CamelIMAPXFolderClass {
CamelType camel_imapx_folder_get_type (void);
/* public methods */
-CamelFolder *camel_imapx_folder_new(CamelStore *parent, const char *path, const char *raw);
+CamelFolder *camel_imapx_folder_new(CamelStore *parent, const gchar *path, const gchar *raw);
#ifdef __cplusplus
}
diff --git a/camel/providers/imapx/camel-imapx-provider.c b/camel/providers/imapx/camel-imapx-provider.c
index 47aa041..b9e3e72 100644
--- a/camel/providers/imapx/camel-imapx-provider.c
+++ b/camel/providers/imapx/camel-imapx-provider.c
@@ -1,15 +1,15 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* camel-pop3-provider.c: pop3 provider registration code */
-/*
+/*
* Authors :
* Dan Winship <danw ximian com>
* Michael Zucchi <notzed ximian com>
*
* Copyright (C) 2002 Ximian, Inc. (www.ximian.com)
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
@@ -44,30 +44,30 @@ CamelProviderConfEntry imapx_conf_entries[] = {
static CamelProvider imapx_provider = {
"imapx",
-
+
N_("IMAP+"),
-
+
N_("Experimental IMAP 4(.1) client\n"
"This is untested and unsupported code, you want to use plain imap instead.\n\n"
" !!! DO NOT USE THIS FOR PRODUCTION EMAIL !!!\n"),
"mail",
-
+
CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_IS_SOURCE |
CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_SUPPORTS_SSL,
-
+
CAMEL_URL_NEED_USER | CAMEL_URL_NEED_HOST | CAMEL_URL_ALLOW_AUTH,
-
+
imapx_conf_entries,
-
+
/* ... */
};
CamelServiceAuthType camel_imapx_password_authtype = {
N_("Password"),
-
+
N_("This option will connect to the IMAP server using a "
"plaintext password."),
-
+
"",
TRUE
};
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index b02d0b4..da6b5ee 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -55,7 +55,6 @@
/* All comms with server go here */
-
/* Try pipelining fetch requests, 'in bits' */
#define MULTI_FETCH
#define MULTI_SIZE (8196)
@@ -65,17 +64,16 @@
struct _uidset_state {
struct _CamelIMAPXEngine *ie;
- int entries, uids;
- int total, limit;
+ gint entries, uids;
+ gint total, limit;
guint32 start;
guint32 last;
};
struct _CamelIMAPXCommand;
-void imapx_uidset_init(struct _uidset_state *ss, int total, int limit);
-int imapx_uidset_done(struct _uidset_state *ss, struct _CamelIMAPXCommand *ic);
-int imapx_uidset_add(struct _uidset_state *ss, struct _CamelIMAPXCommand *ic, const char *uid);
-
+void imapx_uidset_init(struct _uidset_state *ss, gint total, gint limit);
+gint imapx_uidset_done(struct _uidset_state *ss, struct _CamelIMAPXCommand *ic);
+gint imapx_uidset_add(struct _uidset_state *ss, struct _CamelIMAPXCommand *ic, const gchar *uid);
typedef struct _CamelIMAPXCommandPart CamelIMAPXCommandPart;
typedef struct _CamelIMAPXCommand CamelIMAPXCommand;
@@ -97,26 +95,26 @@ struct _CamelIMAPXCommandPart {
struct _CamelIMAPXCommand *parent;
- int data_size;
- char *data;
+ gint data_size;
+ gchar *data;
camel_imapx_command_part_t type;
- int ob_size;
- void *ob;
+ gint ob_size;
+ gpointer ob;
};
-typedef int (*CamelIMAPXEngineFunc)(struct _CamelIMAPXServer *engine, guint32 id, void *data);
+typedef gint (*CamelIMAPXEngineFunc)(struct _CamelIMAPXServer *engine, guint32 id, gpointer data);
typedef void (*CamelIMAPXCommandFunc)(struct _CamelIMAPXServer *engine, struct _CamelIMAPXCommand *);
struct _CamelIMAPXCommand {
struct _CamelIMAPXCommand *next, *prev;
- char pri;
+ gchar pri;
- const char *name; /* command name/type (e.g. FETCH) */
+ const gchar *name; /* command name/type (e.g. FETCH) */
- char *select; /* folder to select */
+ gchar *select; /* folder to select */
struct _status_info *status; /* status for command, indicates it is complete if != NULL */
@@ -130,8 +128,8 @@ struct _CamelIMAPXCommand {
struct _CamelIMAPXJob *job;
};
-CamelIMAPXCommand *camel_imapx_command_new(const char *name, const char *select, const char *fmt, ...);
-void camel_imapx_command_add(CamelIMAPXCommand *ic, const char *fmt, ...);
+CamelIMAPXCommand *camel_imapx_command_new(const gchar *name, const gchar *select, const gchar *fmt, ...);
+void camel_imapx_command_add(CamelIMAPXCommand *ic, const gchar *fmt, ...);
void camel_imapx_command_free(CamelIMAPXCommand *ic);
void camel_imapx_command_close(CamelIMAPXCommand *ic);
@@ -144,7 +142,7 @@ enum {
};
struct _refresh_info {
- char *uid;
+ gchar *uid;
guint32 server_flags;
CamelFlag *server_user_flags;
};
@@ -160,7 +158,7 @@ enum {
struct _imapx_flag_change {
GPtrArray *infos;
- char *name;
+ gchar *name;
};
typedef struct _CamelIMAPXJob CamelIMAPXJob;
@@ -174,9 +172,9 @@ struct _CamelIMAPXJob {
// ??
//CamelOperation *op;
- int noreply:1; /* dont wait for reply */
- char type; /* operation type */
- char pri; /* the command priority */
+ gint noreply:1; /* dont wait for reply */
+ gchar type; /* operation type */
+ gchar pri; /* the command priority */
short commands; /* counts how many commands are outstanding */
CamelFolder *folder;
@@ -184,20 +182,20 @@ struct _CamelIMAPXJob {
union {
struct {
/* in: uid requested */
- char *uid;
+ gchar *uid;
/* in/out: message content stream output */
CamelStream *stream;
/* working variables */
- size_t body_offset;
- ssize_t body_len;
- size_t fetch_offset;
+ gsize body_offset;
+ gssize body_len;
+ gsize fetch_offset;
} get_message;
struct {
/* array of refresh info's */
GArray *infos;
/* used for biulding uidset stuff */
- int index;
- int last_index;
+ gint index;
+ gint last_index;
struct _uidset_state uidset;
/* changes during refresh */
// CamelChangeInfo *changes;
@@ -210,11 +208,11 @@ struct _CamelIMAPXJob {
GArray *off_user;
} sync_changes;
struct {
- char *path;
+ gchar *path;
CamelMessageInfo *info;
} append_message;
struct {
- char *pattern;
+ gchar *pattern;
guint32 flags;
GHashTable *folders;
} list;
@@ -230,19 +228,15 @@ enum {
#define SSL_PORT_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_SSL2 | CAMEL_TCP_STREAM_SSL_ENABLE_SSL3)
#define STARTTLS_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_TLS)
-
-
static void imapx_select(CamelIMAPXServer *is, CamelFolder *folder, CamelException *ex);
-
-
/*
this creates a uid (or sequence number) set directly into a command,
if total is set, then we break it up into total uids. (i.e. command time)
if limit is set, then we break it up into limit entries (i.e. command length)
*/
void
-imapx_uidset_init(struct _uidset_state *ss, int total, int limit)
+imapx_uidset_init(struct _uidset_state *ss, gint total, gint limit)
{
ss->uids = 0;
ss->entries = 0;
@@ -252,10 +246,10 @@ imapx_uidset_init(struct _uidset_state *ss, int total, int limit)
ss->limit = limit;
}
-int
+gint
imapx_uidset_done(struct _uidset_state *ss, CamelIMAPXCommand *ic)
{
- int ret = 0;
+ gint ret = 0;
if (ss->last != 0 && ss->last != ss->start) {
camel_imapx_command_add(ic, ":%d", ss->last);
@@ -271,8 +265,8 @@ imapx_uidset_done(struct _uidset_state *ss, CamelIMAPXCommand *ic)
return ret;
}
-int
-imapx_uidset_add(struct _uidset_state *ss, CamelIMAPXCommand *ic, const char *uid)
+gint
+imapx_uidset_add(struct _uidset_state *ss, CamelIMAPXCommand *ic, const gchar *uid)
{
guint32 uidn;
@@ -316,21 +310,16 @@ imapx_uidset_add(struct _uidset_state *ss, CamelIMAPXCommand *ic, const char *ui
return 0;
}
-
-
-
-
-
static void
-imapx_command_add_part(CamelIMAPXCommand *ic, camel_imapx_command_part_t type, void *o)
+imapx_command_add_part(CamelIMAPXCommand *ic, camel_imapx_command_part_t type, gpointer o)
{
CamelIMAPXCommandPart *cp;
CamelStreamNull *null;
- unsigned int ob_size = 0;
+ guint ob_size = 0;
/* TODO: literal+? */
-
- switch(type & CAMEL_IMAPX_COMMAND_MASK) {
+
+ switch (type & CAMEL_IMAPX_COMMAND_MASK) {
case CAMEL_IMAPX_COMMAND_DATAWRAPPER:
case CAMEL_IMAPX_COMMAND_STREAM: {
CamelObject *ob = o;
@@ -362,7 +351,7 @@ imapx_command_add_part(CamelIMAPXCommand *ic, camel_imapx_command_part_t type, v
break;
}
case CAMEL_IMAPX_COMMAND_FILE: {
- char *path = o;
+ gchar *path = o;
struct stat st;
if (stat(path, &st) == 0) {
@@ -402,33 +391,33 @@ imapx_command_add_part(CamelIMAPXCommand *ic, camel_imapx_command_part_t type, v
}
static void
-imapx_command_addv(CamelIMAPXCommand *ic, const char *fmt, va_list ap)
+imapx_command_addv(CamelIMAPXCommand *ic, const gchar *fmt, va_list ap)
{
- const unsigned char *p, *ps, *start;
- unsigned char c;
- unsigned int width;
- char ch;
- int llong;
- int left;
- int fill;
- int zero;
- char *s;
- char *P;
- int d;
- long int l;
+ const guchar *p, *ps, *start;
+ guchar c;
+ guint width;
+ gchar ch;
+ gint llong;
+ gint left;
+ gint fill;
+ gint zero;
+ gchar *s;
+ gchar *P;
+ gint d;
+ glong l;
guint32 f;
CamelFlag *F;
CamelStream *S;
CamelDataWrapper *D;
CamelSasl *A;
- char buffer[16];
+ gchar buffer[16];
c(printf("adding command, fmt = '%s'\n", fmt));
p = fmt;
ps = fmt;
while ( ( c = *p++ ) ) {
- switch(c) {
+ switch (c) {
case '%':
if (*p == '%') {
camel_stream_write((CamelStream *)ic->mem, ps, p-ps);
@@ -466,7 +455,7 @@ imapx_command_addv(CamelIMAPXCommand *ic, const char *fmt, va_list ap)
c = *p++;
}
- switch(c) {
+ switch (c) {
case 'A': /* auth object - sasl auth, treat as special kind of continuation */
A = va_arg(ap, CamelSasl *);
imapx_command_add_part(ic, CAMEL_IMAPX_COMMAND_AUTH, A);
@@ -482,26 +471,26 @@ imapx_command_addv(CamelIMAPXCommand *ic, const char *fmt, va_list ap)
imapx_command_add_part(ic, CAMEL_IMAPX_COMMAND_DATAWRAPPER, D);
break;
case 'P': /* filename path */
- P = va_arg(ap, char *);
+ P = va_arg(ap, gchar *);
c(printf("got file path '%s'\n", P));
imapx_command_add_part(ic, CAMEL_IMAPX_COMMAND_FILE, P);
break;
case 't': /* token */
- s = va_arg(ap, char *);
+ s = va_arg(ap, gchar *);
camel_stream_write((CamelStream *)ic->mem, s, strlen(s));
break;
case 's': /* simple string */
- s = va_arg(ap, char *);
+ s = va_arg(ap, gchar *);
c(printf("got string '%s'\n", s));
if (*s) {
- unsigned char mask = imapx_is_mask(s);
+ guchar mask = imapx_is_mask(s);
if (mask & IMAPX_TYPE_ATOM_CHAR)
camel_stream_write((CamelStream *)ic->mem, s, strlen(s));
else if (mask & IMAPX_TYPE_TEXT_CHAR) {
camel_stream_write((CamelStream *)ic->mem, "\"", 1);
while (*s) {
- char *start = s;
+ gchar *start = s;
while (*s && imapx_is_quoted_char(*s))
s++;
@@ -521,7 +510,7 @@ imapx_command_addv(CamelIMAPXCommand *ic, const char *fmt, va_list ap)
}
break;
case 'f': /* imap folder name */
- s = va_arg(ap, char *);
+ s = va_arg(ap, gchar *);
c(printf("got folder '%s'\n", s));
/* FIXME: encode folder name */
/* FIXME: namespace? */
@@ -533,21 +522,21 @@ imapx_command_addv(CamelIMAPXCommand *ic, const char *fmt, va_list ap)
imap_write_flags((CamelStream *)ic->mem, f, F);
break;
case 'c':
- d = va_arg(ap, int);
+ d = va_arg(ap, gint);
ch = d;
camel_stream_write((CamelStream *)ic->mem, &ch, 1);
break;
case 'd': /* int/unsigned */
case 'u':
if (llong) {
- l = va_arg(ap, long int);
- c(printf("got long int '%d'\n", (int)l));
+ l = va_arg(ap, glong);
+ c(printf("got glong '%d'\n", (gint)l));
memcpy(buffer, start, p-start);
buffer[p-start] = 0;
camel_stream_printf((CamelStream *)ic->mem, buffer, l);
} else {
- d = va_arg(ap, int);
- c(printf("got int '%d'\n", d));
+ d = va_arg(ap, gint);
+ c(printf("got gint '%d'\n", d));
memcpy(buffer, start, p-start);
buffer[p-start] = 0;
camel_stream_printf((CamelStream *)ic->mem, buffer, d);
@@ -572,22 +561,11 @@ imapx_command_addv(CamelIMAPXCommand *ic, const char *fmt, va_list ap)
camel_stream_write((CamelStream *)ic->mem, ps, p-ps-1);
}
-
-
-
-
-
-
-
-
-
-
-
CamelIMAPXCommand *
-camel_imapx_command_new(const char *name, const char *select, const char *fmt, ...)
+camel_imapx_command_new(const gchar *name, const gchar *select, const gchar *fmt, ...)
{
CamelIMAPXCommand *ic;
- static int tag = 0;
+ static gint tag = 0;
va_list ap;
ic = g_malloc0(sizeof(*ic));
@@ -607,7 +585,7 @@ camel_imapx_command_new(const char *name, const char *select, const char *fmt, .
}
void
-camel_imapx_command_add(CamelIMAPXCommand *ic, const char *fmt, ...)
+camel_imapx_command_add(CamelIMAPXCommand *ic, const gchar *fmt, ...)
{
va_list ap;
@@ -655,10 +633,10 @@ void
camel_imapx_command_close(CamelIMAPXCommand *ic)
{
if (ic->mem) {
- c(printf("completing command buffer is [%d] '%.*s'\n", ic->mem->buffer->len, (int)ic->mem->buffer->len, ic->mem->buffer->data));
+ c(printf("completing command buffer is [%d] '%.*s'\n", ic->mem->buffer->len, (gint)ic->mem->buffer->len, ic->mem->buffer->data));
if (ic->mem->buffer->len > 0)
imapx_command_add_part(ic, CAMEL_IMAPX_COMMAND_SIMPLE, NULL);
-
+
camel_object_unref((CamelObject *)ic->mem);
ic->mem = NULL;
}
@@ -672,10 +650,10 @@ camel_imapx_engine_command_queue(CamelIMAPXEngine *imap, CamelIMAPXCommand *ic)
CamelIMAPXCommandPart *cp;
if (ic->mem) {
- c(printf("completing command buffer is [%d] '%.*s'\n", ic->mem->buffer->len, (int)ic->mem->buffer->len, ic->mem->buffer->data));
+ c(printf("completing command buffer is [%d] '%.*s'\n", ic->mem->buffer->len, (gint)ic->mem->buffer->len, ic->mem->buffer->data));
if (ic->mem->buffer->len > 0)
imapx_command_add_part(imap, ic, CAMEL_IMAPX_COMMAND_SIMPLE, NULL);
-
+
camel_object_unref((CamelObject *)ic->mem);
ic->mem = NULL;
}
@@ -685,10 +663,10 @@ camel_imapx_engine_command_queue(CamelIMAPXEngine *imap, CamelIMAPXCommand *ic)
#endif
/* Get a path into the cache, works like maildir, but isn't */
-static char *
-imapx_get_path_uid(CamelIMAPXServer *is, CamelFolder *folder, const char *bit, const char *uid)
+static gchar *
+imapx_get_path_uid(CamelIMAPXServer *is, CamelFolder *folder, const gchar *bit, const gchar *uid)
{
- char *dir, *path;
+ gchar *dir, *path;
// big fixme of course, we need to create the path if it doesn't exist,
// base it on the server, blah blah
@@ -735,8 +713,8 @@ static void
imapx_command_start_next(CamelIMAPXServer *imap, CamelException *ex)
{
CamelIMAPXCommand *ic, *nc;
- int count = 0;
- int pri = -128;
+ gint count = 0;
+ gint pri = -128;
/* See if we can start another task yet.
@@ -775,7 +753,7 @@ imapx_command_start_next(CamelIMAPXServer *imap, CamelException *ex)
if (imap->select) {
printf("- we're selected on '%s', current jobs?\n", imap->select);
for (ic = (CamelIMAPXCommand *)imap->active.head;ic->next;ic=ic->next) {
- printf("- %3d '%s'\n", (int)ic->pri, ic->name);
+ printf("- %3d '%s'\n", (gint)ic->pri, ic->name);
if (ic->pri > pri)
pri = ic->pri;
count++;
@@ -790,7 +768,7 @@ imapx_command_start_next(CamelIMAPXServer *imap, CamelException *ex)
ic = (CamelIMAPXCommand *)imap->queue.head;
nc = ic->next;
while (nc && imap->literal == NULL && count < MAX_COMMANDS && ic->pri >= pri) {
- printf("-- %3d '%s'?\n", (int)ic->pri, ic->name);
+ printf("-- %3d '%s'?\n", (gint)ic->pri, ic->name);
if (ic->select == NULL || strcmp(ic->select, imap->select) == 0) {
printf("--> starting '%s'\n", ic->name);
pri = ic->pri;
@@ -818,7 +796,7 @@ imapx_command_start_next(CamelIMAPXServer *imap, CamelException *ex)
count = 0;
while (nc && imap->literal == NULL && count < MAX_COMMANDS && ic->pri >= pri) {
if (ic->select == NULL || (imap->select && strcmp(ic->select, imap->select))) {
- printf("* queueing job %3d '%s'\n", (int)ic->pri, ic->name);
+ printf("* queueing job %3d '%s'\n", (gint)ic->pri, ic->name);
pri = ic->pri;
e_dlist_remove((EDListNode *)ic);
imapx_command_start(imap, ic);
@@ -867,7 +845,7 @@ imapx_command_queue(CamelIMAPXServer *imap, CamelIMAPXCommand *ic)
/* Must have QUEUE lock */
static CamelIMAPXCommand *
-imapx_find_command_tag(CamelIMAPXServer *imap, unsigned int tag)
+imapx_find_command_tag(CamelIMAPXServer *imap, guint tag)
{
CamelIMAPXCommand *ic;
@@ -884,7 +862,7 @@ imapx_find_command_tag(CamelIMAPXServer *imap, unsigned int tag)
/* Must not have QUEUE lock */
static CamelIMAPXJob *
-imapx_find_job(CamelIMAPXServer *imap, int type, const char *uid)
+imapx_find_job(CamelIMAPXServer *imap, gint type, const gchar *uid)
{
CamelIMAPXJob *job;
@@ -924,7 +902,7 @@ found:
static void
imapx_expunged(CamelIMAPXServer *imap)
{
- int count = 1, index=0, expunge;
+ gint count = 1, index=0, expunge;
const CamelMessageInfo *iterinfo;
CamelIterator *iter;
@@ -935,8 +913,8 @@ imapx_expunged(CamelIMAPXServer *imap)
printf("Processing '%d' expunges\n", imap->expunged->len);
-/* Change implementation
-
+/* Change implementation
+
expunge = g_array_index(imap->expunged, guint32, index++);
iter = camel_folder_summary_search(imap->select_folder->summary, NULL, NULL, NULL, NULL);
while ((iterinfo = camel_iterator_next(iter, NULL))) {
@@ -955,14 +933,14 @@ imapx_expunged(CamelIMAPXServer *imap)
}
/* handle any untagged responses */
-static int
+static gint
imapx_untagged(CamelIMAPXServer *imap, CamelException *ex)
{
- unsigned int id, len;
- unsigned char *token, *p, c;
- int tok;
+ guint id, len;
+ guchar *token, *p, c;
+ gint tok;
struct _status_info *sinfo;
-
+
e(printf("got untagged response\n"));
id = 0;
tok = camel_imapx_stream_token(imap->stream, &token, &len, ex);
@@ -1073,7 +1051,7 @@ imapx_untagged(CamelIMAPXServer *imap, CamelException *ex)
if (mi) {
GArray *infos = job->u.refresh_info.infos;
- int i = job->u.refresh_info.last_index;
+ gint i = job->u.refresh_info.last_index;
/* This is rather inefficent, but should be ok if we're expecting it
since we break each fetch into lots of 100 */
@@ -1122,7 +1100,7 @@ imapx_untagged(CamelIMAPXServer *imap, CamelException *ex)
camel_imapx_stream_ungettoken(imap->stream, tok, token, len);
sinfo = imap_parse_status(imap->stream, ex);
camel_object_trigger_event(imap, "status", sinfo);
- switch(sinfo->condition) {
+ switch (sinfo->condition) {
case IMAP_READ_WRITE:
imap->mode = IMAPX_MODE_READ|IMAPX_MODE_WRITE;
printf("folder is read-write\n");
@@ -1161,12 +1139,12 @@ imapx_untagged(CamelIMAPXServer *imap, CamelException *ex)
/* handle any continuation requests
either data continuations, or auth continuation */
-static int
+static gint
imapx_continuation(CamelIMAPXServer *imap, CamelException *ex)
{
CamelIMAPXCommand *ic, *newliteral = NULL;
CamelIMAPXCommandPart *cp;
-
+
printf("got continuation response\n");
/* The 'literal' pointer is like a write-lock, nothing else
@@ -1183,7 +1161,7 @@ imapx_continuation(CamelIMAPXServer *imap, CamelException *ex)
printf("got continuation response for data\n");
cp = ic->current;
- switch(cp->type & CAMEL_IMAPX_COMMAND_MASK) {
+ switch (cp->type & CAMEL_IMAPX_COMMAND_MASK) {
case CAMEL_IMAPX_COMMAND_DATAWRAPPER:
printf("writing data wrapper to literal\n");
camel_data_wrapper_write_to_stream((CamelDataWrapper *)cp->ob, (CamelStream *)imap->stream);
@@ -1193,28 +1171,28 @@ imapx_continuation(CamelIMAPXServer *imap, CamelException *ex)
camel_stream_write_to_stream((CamelStream *)cp->ob, (CamelStream *)imap->stream);
break;
case CAMEL_IMAPX_COMMAND_AUTH: {
- char *resp;
- unsigned char *token;
- int tok, len;
-
+ gchar *resp;
+ guchar *token;
+ gint tok, len;
+
tok = camel_imapx_stream_token(imap->stream, &token, &len, ex);
resp = camel_sasl_challenge_base64((CamelSasl *)cp->ob, token, ex);
if (camel_exception_is_set(ex))
return -1;
-
+
printf("got auth continuation, feeding token '%s' back to auth mech\n", resp);
-
+
camel_stream_write((CamelStream *)imap->stream, resp, strlen(resp));
-
+
/* we want to keep getting called until we get a status reponse from the server
ignore what sasl tells us */
newliteral = ic;
-
+
break; }
case CAMEL_IMAPX_COMMAND_FILE: {
CamelStream *file;
- printf("writing file '%s' to literal\n", (char *)cp->ob);
+ printf("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))) {
@@ -1233,9 +1211,9 @@ imapx_continuation(CamelIMAPXServer *imap, CamelException *ex)
camel_exception_set (ex, 1, "continuation response for non-continuation request");
return -1;
}
-
+
camel_imapx_stream_skip(imap->stream, ex);
-
+
cp = cp->next;
if (cp->next) {
ic->current = cp;
@@ -1261,11 +1239,11 @@ imapx_continuation(CamelIMAPXServer *imap, CamelException *ex)
}
/* handle a completion line */
-static int
-imapx_completion(CamelIMAPXServer *imap, unsigned char *token, int len, CamelException *ex)
+static gint
+imapx_completion(CamelIMAPXServer *imap, guchar *token, gint len, CamelException *ex)
{
CamelIMAPXCommand * volatile ic;
- unsigned int tag;
+ guint tag;
if (token[0] != imap->tagprefix)
camel_exception_throw(1, "Server sent unexpected response: %s", token);
@@ -1320,9 +1298,9 @@ static void
imapx_step(CamelIMAPXServer *is, CamelException *ex)
/* throws IO,PARSE exception */
{
- unsigned int len;
- unsigned char *token;
- int tok;
+ guint len;
+ guchar *token;
+ gint tok;
// poll ? wait for other stuff? loop?
tok = camel_imapx_stream_token(is->stream, &token, &len, ex);
@@ -1464,19 +1442,19 @@ imapx_select(CamelIMAPXServer *is, CamelFolder *folder, CamelException *ex)
}
static void
-imapx_connect(CamelIMAPXServer *is, int ssl_mode, int try_starttls, CamelException *ex)
+imapx_connect(CamelIMAPXServer *is, gint ssl_mode, gint try_starttls, CamelException *ex)
/* throws IO exception */
{
CamelStream * tcp_stream = NULL;
- int ret;
+ gint ret;
#ifdef HAVE_SSL
- const char *mode;
+ const gchar *mode;
#endif
guchar *buffer = NULL;
- int len;
- char *serv;
- const char *port = NULL;
+ gint len;
+ gchar *serv;
+ const gchar *port = NULL;
struct addrinfo *ai, hints = { 0 };
CamelIMAPXCommand *ic;
@@ -1502,7 +1480,7 @@ imapx_connect(CamelIMAPXServer *is, int ssl_mode, int try_starttls, CamelExcepti
} else {
tcp_stream = camel_tcp_stream_raw_new ();
}
-#else
+#else
tcp_stream = camel_tcp_stream_raw_new ();
#endif /* HAVE_SSL */
@@ -1516,13 +1494,13 @@ imapx_connect(CamelIMAPXServer *is, int ssl_mode, int try_starttls, CamelExcepti
if (ex->id) {
g_message ("Unable to connect %d %s \n", ex->id, ex->desc);
camel_object_unref(tcp_stream);
- return;
+ return;
}
ret = camel_tcp_stream_connect(CAMEL_TCP_STREAM(tcp_stream), ai);
camel_freeaddrinfo(ai);
if (ret == -1) {
- if (errno == EINTR)
+ if (errno == EINTR)
camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("Connection cancelled"));
else
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
@@ -1553,10 +1531,10 @@ retry:
g_message ("Connecting \n");
imapx_connect(is, 0, 0, ex);
g_message ("Connected \n");
-
+
if (is->url->passwd == NULL) {
CamelException ex = { 0, NULL };
- char *prompt = g_strdup_printf(_("%sPlease enter the IMAP password for %s %s"), "", is->url->user, is->url->host);
+ gchar *prompt = g_strdup_printf(_("%sPlease enter the IMAP password for %s %s"), "", is->url->user, is->url->host);
const gchar *auth_domain;
auth_domain = camel_url_get_param (is->url, "auth-domain");
@@ -1671,7 +1649,7 @@ imapx_job_get_message_start(CamelIMAPXServer *is, CamelIMAPXJob *job)
{
CamelIMAPXCommand *ic;
#ifdef MULTI_FETCH
- int i;
+ gint i;
#endif
// FIXME: MUST ensure we never try to get the same message
// twice at the same time.
@@ -1713,7 +1691,7 @@ imapx_job_append_message_done(CamelIMAPXServer *is, CamelIMAPXCommand *ic)
{
CamelIMAPXJob *job = ic->job;
CamelMessageInfo *mi;
- char *cur;
+ gchar *cur;
/* Append done. If we the server supports UIDPLUS we will get an APPENDUID response
with the new uid. This lets us move the message we have directly to the cache
@@ -1722,10 +1700,10 @@ imapx_job_append_message_done(CamelIMAPXServer *is, CamelIMAPXCommand *ic)
if (ic->status->result == IMAP_OK) {
if (ic->status->condition == IMAP_APPENDUID) {
- printf("Got appenduid %d %d\n", (int)ic->status->u.appenduid.uidvalidity, (int)ic->status->u.appenduid.uid);
+ printf("Got appenduid %d %d\n", (gint)ic->status->u.appenduid.uidvalidity, (gint)ic->status->u.appenduid.uid);
if (ic->status->u.appenduid.uidvalidity == is->uidvalidity) {
mi = camel_message_info_clone(job->u.append_message.info);
- mi->uid = g_strdup_printf("%u", (unsigned int)ic->status->u.appenduid.uid);
+ mi->uid = g_strdup_printf("%u", (guint)ic->status->u.appenduid.uid);
cur = imapx_get_path_uid(is, job->folder, NULL, mi->uid);
printf("Moving cache item %s to %s\n", job->u.append_message.path, cur);
link(job->u.append_message.path, cur);
@@ -1755,7 +1733,7 @@ imapx_job_append_message_start(CamelIMAPXServer *is, CamelIMAPXJob *job)
{
CamelIMAPXCommand *ic;
- // FIXME: We dont need anything selected for this command to run ...
+ // FIXME: We dont need anything selected for this command to run ...
//imapx_select(is, job->folder);
/* TODO: we could supply the original append date from the file timestamp */
ic = camel_imapx_command_new("APPEND", NULL,
@@ -1773,13 +1751,13 @@ imapx_job_append_message_start(CamelIMAPXServer *is, CamelIMAPXJob *job)
/* ********************************************************************** */
-static int
-imapx_refresh_info_uid_cmp(const void *ap, const void *bp)
+static gint
+imapx_refresh_info_uid_cmp(gconstpointer ap, gconstpointer bp)
{
- unsigned int av, bv;
+ guint av, bv;
- av = strtoul((const char *)ap, NULL, 10);
- bv = strtoul((const char *)bp, NULL, 10);
+ av = strtoul((const gchar *)ap, NULL, 10);
+ bv = strtoul((const gchar *)bp, NULL, 10);
if (av<bv)
return -1;
@@ -1789,8 +1767,8 @@ imapx_refresh_info_uid_cmp(const void *ap, const void *bp)
return 0;
}
-static int
-imapx_refresh_info_cmp(const void *ap, const void *bp)
+static gint
+imapx_refresh_info_cmp(gconstpointer ap, gconstpointer bp)
{
const struct _refresh_info *a = ap;
const struct _refresh_info *b = bp;
@@ -1815,7 +1793,7 @@ static void
imapx_job_refresh_info_step_done(CamelIMAPXServer *is, CamelIMAPXCommand *ic)
{
CamelIMAPXJob *job = ic->job;
- int i = job->u.refresh_info.index;
+ gint i = job->u.refresh_info.index;
GArray *infos = job->u.refresh_info.infos;
/* if (camel_change_info_changed(job->u.refresh_info.changes))
@@ -1829,7 +1807,7 @@ imapx_job_refresh_info_step_done(CamelIMAPXServer *is, CamelIMAPXCommand *ic)
job->u.refresh_info.last_index = i;
for (;i<infos->len;i++) {
- int res;
+ gint res;
struct _refresh_info *r = &g_array_index(infos, struct _refresh_info, i);
if (r->uid) {
@@ -1861,11 +1839,11 @@ imapx_job_refresh_info_step_done(CamelIMAPXServer *is, CamelIMAPXCommand *ic)
e_msgport_reply((EMsg *)job);
}
-static int
-imapx_uid_cmp(const void *ap, const void *bp, void *data)
+static gint
+imapx_uid_cmp(gconstpointer ap, gconstpointer bp, gpointer data)
{
- const char *a = ap, *b = bp;
- char *ae, *be;
+ const gchar *a = ap, *b = bp;
+ gchar *ae, *be;
unsigned long av, bv;
av = strtoul(a, &ae, 10);
@@ -1888,7 +1866,7 @@ static void
imapx_job_refresh_info_done(CamelIMAPXServer *is, CamelIMAPXCommand *ic)
{
CamelIMAPXJob *job = ic->job;
- int i;
+ gint i;
GArray *infos = job->u.refresh_info.infos;
if (ic->status->result == IMAP_OK) {
@@ -1897,7 +1875,7 @@ imapx_job_refresh_info_done(CamelIMAPXServer *is, CamelIMAPXCommand *ic)
const CamelMessageInfo *iterinfo;
CamelIMAPXMessageInfo *info;
CamelFolderSummary *s = job->folder->summary;
- int i, count=0;
+ gint i, count=0;
/* Here we do the typical sort/iterate/merge loop.
If the server flags dont match what we had, we modify our
@@ -2019,7 +1997,7 @@ imapx_job_list_start(CamelIMAPXServer *is, CamelIMAPXJob *job)
/* FIXME: this is basically a copy of the same in camel-imapx-utils.c */
static struct {
- char *name;
+ gchar *name;
guint32 flag;
} flags_table[] = {
{ "\\ANSWERED", CAMEL_MESSAGE_ANSWERED },
@@ -2055,21 +2033,21 @@ imapx_job_sync_changes_done(CamelIMAPXServer *is, CamelIMAPXCommand *ic)
Not that ... given all the asynchronicity going on, we're guaranteed
that what we just set is actually what is on the server now .. but
if it isn't, i guess we'll fix up next refresh */
-
+
if (ic->status->result != IMAP_OK && !camel_exception_is_set(job->ex))
camel_exception_setv(job->ex, 1, "Error syncing changes: %s", ic->status->text);
if (job->commands == 0) {
if (!camel_exception_is_set(job->ex)) {
- int i;
+ gint i;
/*
for (i=0;i<job->u.sync_changes.infos->len;i++) {
CamelIMAPXMessageInfo *info = job->u.sync_changes.infos->pdata[i];
info->server_flags = ((CamelMessageInfoBase *)info)->flags & CAMEL_IMAPX_SERVER_FLAGS;
- /* FIXME: move over user flags too
- }*/
+ /* FIXME: move over user flags too
+ }*/
}
e_dlist_remove((EDListNode *)job);
e_msgport_reply((EMsg *)job);
@@ -2082,7 +2060,7 @@ imapx_job_sync_changes_start(CamelIMAPXServer *is, CamelIMAPXJob *job)
guint32 i, j;
struct _uidset_state ss;
GPtrArray *infos = job->u.sync_changes.infos;
- int on;
+ gint on;
for (on=0;on<2;on++) {
guint32 orset = on?job->u.sync_changes.on_set:job->u.sync_changes.off_set;
@@ -2101,7 +2079,7 @@ imapx_job_sync_changes_start(CamelIMAPXServer *is, CamelIMAPXJob *job)
CamelIMAPXMessageInfo *info = infos->pdata[i];
guint32 flags = ((CamelMessageInfoBase *)info)->flags & CAMEL_IMAPX_SERVER_FLAGS;
guint32 sflags = info->server_flags & CAMEL_IMAPX_SERVER_FLAGS;
- int send = 0;
+ gint send = 0;
if ( (on && (((flags ^ sflags) & flags) & flag))
|| (!on && (((flags ^ sflags) & ~flags) & flag))) {
@@ -2162,8 +2140,8 @@ imapx_job_sync_changes_start(CamelIMAPXServer *is, CamelIMAPXJob *job)
/* ********************************************************************** */
-static void *
-imapx_server_loop(void *d)
+static gpointer
+imapx_server_loop(gpointer d)
{
CamelIMAPXServer *is = d;
CamelIMAPXJob *job;
@@ -2222,7 +2200,7 @@ imapx_server_loop(void *d)
#ifdef HAVE_SSL
{
PRPollDesc pollfds[2] = { };
- int res;
+ gint res;
printf("\nGoing to sleep waiting for work to do\n\n");
@@ -2250,7 +2228,7 @@ imapx_server_loop(void *d)
#else
{
struct pollfd[2] = { 0 };
- int res;
+ gint res;
pollfd[0].fd = ((CamelTcpStreamRaw *)is->stream->source)->sockfd;
pollfd[0].events = POLLIN;
@@ -2334,7 +2312,7 @@ camel_imapx_server_get_type (void)
(CamelObjectInitFunc) imapx_server_init,
(CamelObjectFinalizeFunc) imapx_server_finalise);
}
-
+
return type;
}
@@ -2357,7 +2335,7 @@ camel_imapx_server_new(CamelStore *store, CamelURL *url)
/* Client commands */
void
-camel_imapx_server_connect(CamelIMAPXServer *is, int state)
+camel_imapx_server_connect(CamelIMAPXServer *is, gint state)
{
if (state) {
pthread_t id;
@@ -2398,11 +2376,11 @@ imapx_run_job(CamelIMAPXServer *is, CamelIMAPXJob *job)
}
static CamelStream *
-imapx_server_get_message(CamelIMAPXServer *is, CamelFolder *folder, const char *uid, int pri, CamelException *ex)
+imapx_server_get_message(CamelIMAPXServer *is, CamelFolder *folder, const gchar *uid, gint pri, CamelException *ex)
{
CamelStream *stream;
CamelIMAPXJob *job;
- char *tmp, *name;
+ gchar *tmp, *name;
/* Get a message, we either get it from the local cache,
Or we ask for it, which will put it in the local cache,
@@ -2431,7 +2409,7 @@ imapx_server_get_message(CamelIMAPXServer *is, CamelFolder *folder, const char *
job->type = IMAPX_JOB_GET_MESSAGE;
job->start = imapx_job_get_message_start;
job->folder = folder;
- job->u.get_message.uid = (char *)uid;
+ job->u.get_message.uid = (gchar *)uid;
job->u.get_message.stream = camel_stream_fs_new_with_name(tmp, O_WRONLY|O_CREAT|O_TRUNC, 0666);
if (job->u.get_message.stream == NULL) {
g_free(tmp);
@@ -2470,7 +2448,7 @@ imapx_server_get_message(CamelIMAPXServer *is, CamelFolder *folder, const char *
}
CamelStream *
-camel_imapx_server_get_message(CamelIMAPXServer *is, CamelFolder *folder, const char *uid, CamelException *ex)
+camel_imapx_server_get_message(CamelIMAPXServer *is, CamelFolder *folder, const gchar *uid, CamelException *ex)
{
return imapx_server_get_message(is, folder, uid, 100, ex);
}
@@ -2478,12 +2456,12 @@ camel_imapx_server_get_message(CamelIMAPXServer *is, CamelFolder *folder, const
void
camel_imapx_server_append_message(CamelIMAPXServer *is, CamelFolder *folder, CamelMimeMessage *message, const CamelMessageInfo *mi, CamelException *ex)
{
- char *uid = NULL, *tmp = NULL, *new = NULL;
+ gchar *uid = NULL, *tmp = NULL, *new = NULL;
CamelStream *stream, *filter;
CamelMimeFilter *canon;
CamelIMAPXJob *job;
CamelMessageInfo *info;
- int res;
+ gint res;
/* Append just assumes we have no/a dodgy connection. We dump stuff into the 'new'
directory, and let the summary know it's there. Then we fire off a no-reply
@@ -2492,7 +2470,7 @@ camel_imapx_server_append_message(CamelIMAPXServer *is, CamelFolder *folder, Cam
// FIXME: assign a real uid! start with last known uid, add some maildir-like stuff?
do {
- static int nextappend;
+ static gint nextappend;
g_free(uid);
g_free(tmp);
@@ -2513,7 +2491,7 @@ camel_imapx_server_append_message(CamelIMAPXServer *is, CamelFolder *folder, Cam
res = camel_data_wrapper_write_to_stream((CamelDataWrapper *)message, filter);
camel_object_unref(canon);
camel_object_unref(filter);
-
+
if (res == -1) {
camel_exception_setv(ex, 2, "Cannot create spool file: %s", g_strerror(errno));
goto fail;
@@ -2563,8 +2541,8 @@ static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
static CamelIterator *threaditer;
static CamelFolder *threadfolder;
-static void *
-getmsgs(void *d)
+static gpointer
+getmsgs(gpointer d)
{
CamelIMAPXServer *is = ((CamelIMAPXStore *)threadfolder->parent_store)->server;
const CamelMessageInfo *info;
@@ -2576,8 +2554,8 @@ getmsgs(void *d)
pthread_mutex_lock(&lock);
while ((info = imapx_iterator_next(threaditer, NULL))) {
- char *cur = imapx_get_path_uid(is, threadfolder, NULL, camel_message_info_uid(info));
- char *uid = g_strdup(camel_message_info_uid(info));
+ gchar *cur = imapx_get_path_uid(is, threadfolder, NULL, camel_message_info_uid(info));
+ gchar *uid = g_strdup(camel_message_info_uid(info));
struct stat st;
pthread_mutex_unlock(&lock);
@@ -2623,8 +2601,8 @@ camel_imapx_server_refresh_info(CamelIMAPXServer *is, CamelFolder *folder, Camel
g_free(job);
/* {
- int i;
- int c = 3;
+ gint i;
+ gint c = 3;
pthread_t ids[10];
threadfolder = folder;
@@ -2641,7 +2619,7 @@ camel_imapx_server_refresh_info(CamelIMAPXServer *is, CamelFolder *folder, Camel
static void
imapx_sync_free_user(GArray *user_set)
{
- int i;
+ gint i;
if (user_set == NULL)
return;
@@ -2686,7 +2664,7 @@ camel_imapx_server_sync_changes(CamelIMAPXServer *is, CamelFolder *folder, GPtrA
uflags = ((CamelMessageInfoBase *)info)->user_flags;
suflags = info->server_user_flags;
while (uflags || suflags) {
- int res;
+ gint res;
if (uflags) {
if (suflags)
@@ -2800,15 +2778,15 @@ imapx_name_equal(gconstpointer a, gconstpointer b)
}
static void
-imapx_list_flatten(void *k, void *v, void *d)
+imapx_list_flatten(gpointer k, gpointer v, gpointer d)
{
GPtrArray *folders = d;
g_ptr_array_add(folders, v);
}
-static int
-imapx_list_cmp(const void *ap, const void *bp)
+static gint
+imapx_list_cmp(gconstpointer ap, gconstpointer bp)
{
struct _list_info *a = ((struct _list_info **)ap)[0];
struct _list_info *b = ((struct _list_info **)bp)[0];
@@ -2817,7 +2795,7 @@ imapx_list_cmp(const void *ap, const void *bp)
}
GPtrArray *
-camel_imapx_server_list(CamelIMAPXServer *is, const char *top, guint32 flags, CamelException *ex)
+camel_imapx_server_list(CamelIMAPXServer *is, const gchar *top, guint32 flags, CamelException *ex)
{
CamelIMAPXJob *job;
GPtrArray *folders;
diff --git a/camel/providers/imapx/camel-imapx-server.h b/camel/providers/imapx/camel-imapx-server.h
index 633606c..8bf9f54 100644
--- a/camel/providers/imapx/camel-imapx-server.h
+++ b/camel/providers/imapx/camel-imapx-server.h
@@ -54,12 +54,12 @@ struct _CamelIMAPXServer {
EMsgPort *port;
EDList jobs;
- char tagprefix;
- int state:4;
+ gchar tagprefix;
+ gint state:4;
/* Current command/work queue. All commands are stored in one list,
all the time, so they can be cleaned up in exception cases */
- void *queue_lock;
+ gpointer queue_lock;
struct _CamelIMAPXCommand *literal;
EDList queue;
EDList active;
@@ -67,7 +67,7 @@ struct _CamelIMAPXServer {
/* info on currently selected folder */
struct _CamelFolder *select_folder;
- char *select;
+ gchar *select;
struct _CamelFolderChangeInfo *changes;
struct _CamelFolder *select_pending;
guint32 permanentflags;
@@ -85,21 +85,21 @@ struct _CamelIMAPXServer {
struct _CamelIMAPXServerClass {
CamelObjectClass cclass;
- char tagprefix;
+ gchar tagprefix;
};
CamelType camel_imapx_server_get_type (void);
CamelIMAPXServer *camel_imapx_server_new(struct _CamelStore *store, struct _CamelURL *url);
-void camel_imapx_server_connect(CamelIMAPXServer *is, int state);
+void camel_imapx_server_connect(CamelIMAPXServer *is, gint state);
-GPtrArray *camel_imapx_server_list(CamelIMAPXServer *is, const char *top, guint32 flags, CamelException *ex);
+GPtrArray *camel_imapx_server_list(CamelIMAPXServer *is, const gchar *top, guint32 flags, CamelException *ex);
void camel_imapx_server_refresh_info(CamelIMAPXServer *is, CamelFolder *folder, struct _CamelException *ex);
void camel_imapx_server_sync_changes(CamelIMAPXServer *is, CamelFolder *folder, GPtrArray *infos, CamelException *ex);
void camel_imapx_server_expunge(CamelIMAPXServer *is, CamelFolder *folder, CamelException *ex);
-CamelStream *camel_imapx_server_get_message(CamelIMAPXServer *is, CamelFolder *folder, const char *uid, struct _CamelException *ex);
+CamelStream *camel_imapx_server_get_message(CamelIMAPXServer *is, CamelFolder *folder, const gchar *uid, struct _CamelException *ex);
void camel_imapx_server_append_message(CamelIMAPXServer *is, CamelFolder *folder, struct _CamelMimeMessage *message, const struct _CamelMessageInfo *mi, CamelException *ex);
#endif /* ! _CAMEL_IMAPX_SERVER_H */
diff --git a/camel/providers/imapx/camel-imapx-store.c b/camel/providers/imapx/camel-imapx-store.c
index 5e64757..77759af 100644
--- a/camel/providers/imapx/camel-imapx-store.c
+++ b/camel/providers/imapx/camel-imapx-store.c
@@ -1,13 +1,13 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* camel-imap-store.c : class for a imap store */
-/*
+/*
* Authors: Michael Zucchi <notzed ximian com>
*
* Copyright (C) 2000-2002 Ximian, Inc. (www.ximian.com)
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
@@ -86,7 +86,7 @@ imapx_name_equal(gconstpointer a, gconstpointer b)
static void imap_construct(CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex)
{
- char *base, *summary;
+ gchar *base, *summary;
CamelIMAPXStore *store = (CamelIMAPXStore *)service;
CAMEL_SERVICE_CLASS (parent_class)->construct (service, session, provider, url, ex);
@@ -104,7 +104,6 @@ static void imap_construct(CamelService *service, CamelSession *session, CamelPr
}
}
-
extern CamelServiceAuthType camel_imapx_password_authtype;
extern CamelServiceAuthType camel_imapx_apop_authtype;
@@ -136,11 +135,11 @@ static void
store_get_pass(CamelIMAPXStore *store)
{
if (((CamelService *)store)->url->passwd == NULL) {
- char *prompt;
+ gchar *prompt;
CamelException ex;
camel_exception_init(&ex);
-
+
prompt = g_strdup_printf (_("%sPlease enter the IMAP password for %s %s"),
store->login_error?store->login_error:"",
((CamelService *)store)->url->user,
@@ -166,10 +165,10 @@ store_get_sasl(struct _CamelIMAPXDriver *driver, CamelIMAPXStore *store)
}
static void
-store_get_login(struct _CamelIMAPXDriver *driver, char **login, char **pass, CamelIMAPXStore *store)
+store_get_login(struct _CamelIMAPXDriver *driver, gchar **login, gchar **pass, CamelIMAPXStore *store)
{
store_get_pass(store);
-
+
*login = g_strdup(((CamelService *)store)->url->user);
*pass = g_strdup(((CamelService *)store)->url->passwd);
}
@@ -198,7 +197,7 @@ imap_disconnect (CamelService *service, gboolean clean, CamelException *ex)
if (store->server)
camel_imapx_server_connect(store->server, 0);
-
+
return TRUE;
}
@@ -248,7 +247,7 @@ get_folder_offline (CamelStore *store, const gchar *folder_name,
}
static CamelFolder *
-imap_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
+imap_get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, CamelException *ex)
{
CamelIMAPXStore *istore = (CamelIMAPXStore *)store;
CamelFolder *folder;
@@ -273,7 +272,7 @@ imap_get_inbox(CamelStore *store, CamelException *ex)
static CamelFolderInfo *
folders_build_info(CamelURL *base, struct _list_info *li)
{
- char *path, *full_name, *name;
+ gchar *path, *full_name, *name;
CamelFolderInfo *fi;
full_name = imapx_list_get_path(li);
@@ -318,15 +317,15 @@ folders_build_info(CamelURL *base, struct _list_info *li)
/* note, pname is the raw name, not the folderinfo name */
/* note also this free's as we go, since we never go 'backwards' */
static CamelFolderInfo *
-folders_build_rec(CamelURL *base, GPtrArray *folders, int *ip, CamelFolderInfo *pfi, char *pname)
+folders_build_rec(CamelURL *base, GPtrArray *folders, gint *ip, CamelFolderInfo *pfi, gchar *pname)
{
- int plen = 0;
+ gint plen = 0;
CamelFolderInfo *last = NULL, *first = NULL;
if (pfi)
plen = strlen(pname);
- for(;(*ip)<(int)folders->len;) {
+ for (;(*ip)<(gint)folders->len;) {
CamelFolderInfo *fi;
struct _list_info *li;
@@ -344,7 +343,7 @@ folders_build_rec(CamelURL *base, GPtrArray *folders, int *ip, CamelFolderInfo *
/* is this not an immediate child of the parent? */
#if 0
- char *p;
+ gchar *p;
if (pfi != NULL
&& li->separator != 0
&& (p = strchr(li->name + plen + 1, li->separator)) != NULL) {
@@ -381,9 +380,9 @@ folders_build_rec(CamelURL *base, GPtrArray *folders, int *ip, CamelFolderInfo *
}
static void
-folder_info_dump(CamelFolderInfo *fi, int depth)
+folder_info_dump(CamelFolderInfo *fi, gint depth)
{
- char *s;
+ gchar *s;
s = alloca(depth+1);
memset(s, ' ', depth);
@@ -394,7 +393,7 @@ folder_info_dump(CamelFolderInfo *fi, int depth)
folder_info_dump(fi->child, depth+2);
fi = fi->next;
}
-
+
}
// THIS IS VERY CRAP AND VERY TEMPORARY
@@ -418,7 +417,6 @@ folder_info_fill(CamelStore *store, CamelFolderInfo *fi)
}
}
-
/* folder_name is path name */
static CamelFolderInfo *
imapx_build_folder_info (CamelIMAPXStore *imap_store, const gchar *folder_name)
@@ -482,7 +480,7 @@ fill_fi(CamelStore *store, CamelFolderInfo *fi, guint32 flags)
}
}
-static gint
+static gint
imap_match_pattern(gchar dir_sep, const gchar *pattern, const gchar *name)
{
gchar p, n;
@@ -508,7 +506,6 @@ imap_match_pattern(gchar dir_sep, const gchar *pattern, const gchar *name)
return n == 0 && (p == '%' || p == 0);
}
-
static CamelFolderInfo *
get_folder_info_offline (CamelStore *store, const gchar *top,
guint32 flags, CamelException *ex)
@@ -612,14 +609,14 @@ get_folder_info_offline (CamelStore *store, const gchar *top,
}
static CamelFolderInfo *
-imap_get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelException *ex)
+imap_get_folder_info(CamelStore *store, const gchar *top, guint32 flags, CamelException *ex)
{
CamelIMAPXStore *istore = (CamelIMAPXStore *)store;
CamelFolderInfo * fi= NULL;
GPtrArray *folders = NULL;
CamelURL *base;
CamelIterator *iter;
- int i;
+ gint i;
if (istore->server == NULL) {
camel_service_connect((CamelService *)store, ex);
@@ -634,7 +631,7 @@ imap_get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelExc
folders = camel_imapx_server_list(istore->server, "", flags, ex);
for (i=0;!camel_exception_is_set(ex) && i<folders->len;i++) {
struct _list_info *li = folders->pdata[i];
- char *name;
+ gchar *name;
name = imapx_list_get_path(li);
g_free(name);
@@ -655,19 +652,19 @@ imap_get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelExc
}
static void
-imap_delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
+imap_delete_folder(CamelStore *store, const gchar *folder_name, CamelException *ex)
{
camel_exception_setv(ex, 1, "delete_folder::unimplemented");
}
static void
-imap_rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex)
+imap_rename_folder(CamelStore *store, const gchar *old, const gchar *new, CamelException *ex)
{
camel_exception_setv(ex, 1, "rename_folder::unimplemented");
}
static CamelFolderInfo *
-imap_create_folder(CamelStore *store, const char *parent_name, const char *folder_name, CamelException *ex)
+imap_create_folder(CamelStore *store, const gchar *parent_name, const gchar *folder_name, CamelException *ex)
{
camel_exception_setv(ex, 1, "create_folder::unimplemented");
return NULL;
@@ -675,7 +672,7 @@ imap_create_folder(CamelStore *store, const char *parent_name, const char *folde
/* ********************************************************************** */
#if 0
-static int store_resp_fetch(CamelIMAPXEngine *ie, guint32 id, void *data)
+static gint store_resp_fetch(CamelIMAPXEngine *ie, guint32 id, gpointer data)
{
struct _fetch_info *finfo;
CamelIMAPXStore *istore = data;
@@ -762,7 +759,7 @@ static int store_resp_fetch(CamelIMAPXEngine *ie, guint32 id, void *data)
if (pending == NULL) {
pending = e_memchunk_alloc(istore->pending_fetch_chunks);
pending->info = info;
- g_hash_table_insert(istore->pending_fetch_table, (char *)camel_message_info_uid(info), pending);
+ g_hash_table_insert(istore->pending_fetch_table, (gchar *)camel_message_info_uid(info), pending);
e_dlist_addtail(&istore->pending_fetch_list, (EDListNode *)pending);
}
} else {
@@ -796,7 +793,7 @@ camel_imapx_store_folder_selected(CamelIMAPXStore *store, CamelIMAPXFolder *fold
{
CamelIMAPXCommand * volatile ic = NULL;
CamelIMAPXStore *istore = (CamelIMAPXStore *)store;
- int i;
+ gint i;
struct _uidset_state ss;
GPtrArray *fetch;
CamelMessageInfo *info;
@@ -876,14 +873,14 @@ camel_imapx_store_folder_selected(CamelIMAPXStore *store, CamelIMAPXFolder *fold
#if 0
/*char *uids[] = {"1", "2", "4", "5", "6", "7", "9", "11", "12", 0};*/
/*char *uids[] = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", 0};*/
-char *uids[] = {"1", "3", "5", "7", "9", "11", "12", "13", "14", "15", "20", "21", "24", "25", "26", 0};
+gchar *uids[] = {"1", "3", "5", "7", "9", "11", "12", "13", "14", "15", "20", "21", "24", "25", "26", 0};
void
uidset_test(CamelIMAPXEngine *ie)
{
struct _uidset_state ss;
CamelIMAPXCommand *ic;
- int i;
+ gint i;
/*ic = camel_imapx_engine_command_new(ie, 0, "FETCH", NULL, "FETCH ");*/
uidset_init(&ss, 0, 0);
@@ -906,7 +903,7 @@ camel_imapx_store_class_init(CamelIMAPXStoreClass *klass)
CamelStoreClass *camel_store_class = CAMEL_STORE_CLASS(klass);
parent_class = CAMEL_STORE_CLASS(camel_type_get_global_classfuncs(camel_store_get_type()));
-
+
camel_service_class->construct = imap_construct;
camel_service_class->query_auth_types = imap_query_auth_types;
camel_service_class->connect = imap_connect;
diff --git a/camel/providers/imapx/camel-imapx-store.h b/camel/providers/imapx/camel-imapx-store.h
index 13cfdbc..03d117f 100644
--- a/camel/providers/imapx/camel-imapx-store.h
+++ b/camel/providers/imapx/camel-imapx-store.h
@@ -1,13 +1,13 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* camel-imap-store.h : class for an imap store */
-/*
+/*
* Authors: Michael Zucchi <notzed ximian com>
*
* Copyright (C) 2002 Ximian, Inc. (www.ximian.com)
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
@@ -21,7 +21,6 @@
* USA
*/
-
#ifndef CAMEL_IMAPX_STORE_H
#define CAMEL_IMAPX_STORE_H 1
@@ -55,7 +54,7 @@ typedef struct {
gchar *namespace, dir_sep, *base_url, *storage_path;
/* if we had a login error, what to show to user */
- char *login_error;
+ gchar *login_error;
GPtrArray *pending_list;
} CamelIMAPXStore;
@@ -74,4 +73,3 @@ CamelType camel_imapx_store_get_type (void);
#endif /* CAMEL_IMAPX_STORE_H */
-
diff --git a/camel/providers/imapx/camel-imapx-stream.c b/camel/providers/imapx/camel-imapx-stream.c
index fa84879..223e9b1 100644
--- a/camel/providers/imapx/camel-imapx-stream.c
+++ b/camel/providers/imapx/camel-imapx-stream.c
@@ -48,10 +48,10 @@ static CamelObjectClass *parent_class = NULL;
#define CAMEL_IMAPX_STREAM_SIZE (4096)
#define CAMEL_IMAPX_STREAM_TOKEN (4096) /* maximum token size */
-static int
+static gint
stream_fill(CamelIMAPXStream *is)
{
- int left = 0;
+ gint left = 0;
if (is->source) {
left = is->end - is->ptr;
@@ -61,7 +61,7 @@ stream_fill(CamelIMAPXStream *is)
left = camel_stream_read(is->source, is->end, CAMEL_IMAPX_STREAM_SIZE - (is->end - is->buf));
if (left > 0) {
is->end += left;
- io(printf("camel_imapx_read: buffer is '%.*s'\n", (int)(is->end - is->ptr), is->ptr));
+ io(printf("camel_imapx_read: buffer is '%.*s'\n", (gint)(is->end - is->ptr), is->ptr));
return is->end - is->ptr;
} else {
io(printf("camel_imapx_read: -1\n"));
@@ -74,11 +74,11 @@ stream_fill(CamelIMAPXStream *is)
return -1;
}
-static ssize_t
-stream_read(CamelStream *stream, char *buffer, size_t n)
+static gssize
+stream_read(CamelStream *stream, gchar *buffer, gsize n)
{
CamelIMAPXStream *is = (CamelIMAPXStream *)stream;
- ssize_t max;
+ gssize max;
if (is->literal == 0 || n == 0)
return 0;
@@ -96,31 +96,31 @@ stream_read(CamelStream *stream, char *buffer, size_t n)
return max;
}
- io(printf("camel_imapx_read(literal): '%.*s'\n", (int)max, buffer));
+ io(printf("camel_imapx_read(literal): '%.*s'\n", (gint)max, buffer));
is->literal -= max;
-
+
return max;
}
-static ssize_t
-stream_write(CamelStream *stream, const char *buffer, size_t n)
+static gssize
+stream_write(CamelStream *stream, const gchar *buffer, gsize n)
{
CamelIMAPXStream *is = (CamelIMAPXStream *)stream;
- io(printf("camel_imapx_write: '%.*s'\n", (int)n, buffer));
+ io(printf("camel_imapx_write: '%.*s'\n", (gint)n, buffer));
return camel_stream_write(is->source, buffer, n);
}
-static int
+static gint
stream_close(CamelStream *stream)
{
/* nop? */
return 0;
}
-static int
+static gint
stream_flush(CamelStream *stream)
{
/* nop? */
@@ -135,7 +135,7 @@ stream_eos(CamelStream *stream)
return is->literal == 0;
}
-static int
+static gint
stream_reset(CamelStream *stream)
{
/* nop? reset literal mode? */
@@ -215,7 +215,7 @@ camel_imapx_stream_new(CamelStream *source)
}
/* Returns if there is any data buffered that is ready for processing */
-int
+gint
camel_imapx_stream_buffered(CamelIMAPXStream *is)
{
return is->end - is->ptr;
@@ -223,11 +223,11 @@ camel_imapx_stream_buffered(CamelIMAPXStream *is)
#if 0
-static int
-skip_ws(CamelIMAPXStream *is, unsigned char *pp, unsigned char *pe)
+static gint
+skip_ws(CamelIMAPXStream *is, guchar *pp, guchar *pe)
{
- register unsigned char c, *p;
- unsigned char *e;
+ register guchar c, *p;
+ guchar *e;
p = is->ptr;
e = is->end;
@@ -252,13 +252,13 @@ skip_ws(CamelIMAPXStream *is, unsigned char *pp, unsigned char *pe)
/* FIXME: these should probably handle it themselves,
and get rid of the token interface? */
-int
-camel_imapx_stream_atom(CamelIMAPXStream *is, unsigned char **data, unsigned int *lenp, CamelException *ex)
+gint
+camel_imapx_stream_atom(CamelIMAPXStream *is, guchar **data, guint *lenp, CamelException *ex)
{
- unsigned char *p, c;
+ guchar *p, c;
/* this is only 'approximate' atom */
- switch(camel_imapx_stream_token(is, data, lenp, ex)) {
+ switch (camel_imapx_stream_token(is, data, lenp, ex)) {
case IMAP_TOK_TOKEN:
p = *data;
while ((c = *p))
@@ -275,13 +275,13 @@ camel_imapx_stream_atom(CamelIMAPXStream *is, unsigned char **data, unsigned int
}
/* gets an atom, a quoted_string, or a literal */
-int
-camel_imapx_stream_astring(CamelIMAPXStream *is, unsigned char **data, CamelException *ex)
+gint
+camel_imapx_stream_astring(CamelIMAPXStream *is, guchar **data, CamelException *ex)
{
- unsigned char *p, *start;
- unsigned int len, inlen;
+ guchar *p, *start;
+ guint len, inlen;
- switch(camel_imapx_stream_token(is, data, &len, ex)) {
+ switch (camel_imapx_stream_token(is, data, &len, ex)) {
case IMAP_TOK_TOKEN:
case IMAP_TOK_INT:
case IMAP_TOK_STRING:
@@ -315,13 +315,13 @@ camel_imapx_stream_astring(CamelIMAPXStream *is, unsigned char **data, CamelExce
}
/* check for NIL or (small) quoted_string or literal */
-int
-camel_imapx_stream_nstring(CamelIMAPXStream *is, unsigned char **data, CamelException *ex)
+gint
+camel_imapx_stream_nstring(CamelIMAPXStream *is, guchar **data, CamelException *ex)
{
- unsigned char *p, *start;
- unsigned int len, inlen;
+ guchar *p, *start;
+ guint len, inlen;
- switch(camel_imapx_stream_token(is, data, &len, ex)) {
+ switch (camel_imapx_stream_token(is, data, &len, ex)) {
case IMAP_TOK_STRING:
return 0;
case IMAP_TOK_LITERAL:
@@ -358,18 +358,18 @@ camel_imapx_stream_nstring(CamelIMAPXStream *is, unsigned char **data, CamelExce
}
/* parse an nstring as a stream */
-int
+gint
camel_imapx_stream_nstring_stream(CamelIMAPXStream *is, CamelStream **stream, CamelException *ex)
/* throws IO,PARSE exception */
{
- unsigned char *token;
- unsigned int len;
- int ret = 0;
+ guchar *token;
+ guint len;
+ gint ret = 0;
CamelStream * volatile mem = NULL;
*stream = NULL;
- switch(camel_imapx_stream_token(is, &token, &len, ex)) {
+ switch (camel_imapx_stream_token(is, &token, &len, ex)) {
case IMAP_TOK_STRING:
mem = camel_stream_mem_new_with_buffer(token, len);
*stream = mem;
@@ -403,8 +403,8 @@ camel_imapx_stream_nstring_stream(CamelIMAPXStream *is, CamelStream **stream, Ca
guint32
camel_imapx_stream_number(CamelIMAPXStream *is, CamelException *ex)
{
- unsigned char *token;
- unsigned int len;
+ guchar *token;
+ guint len;
if (camel_imapx_stream_token(is, &token, &len, ex) != IMAP_TOK_INT) {
camel_exception_set (ex, 1, "expecting number");
@@ -414,13 +414,13 @@ camel_imapx_stream_number(CamelIMAPXStream *is, CamelException *ex)
return strtoul(token, 0, 10);
}
-int
-camel_imapx_stream_text(CamelIMAPXStream *is, unsigned char **text, CamelException *ex)
+gint
+camel_imapx_stream_text(CamelIMAPXStream *is, guchar **text, CamelException *ex)
{
GByteArray *build = g_byte_array_new();
- unsigned char *token;
- unsigned int len;
- int tok;
+ guchar *token;
+ guint len;
+ gint tok;
while (is->unget > 0) {
switch (is->unget_tok) {
@@ -457,12 +457,12 @@ camel_imapx_stream_text(CamelIMAPXStream *is, unsigned char **text, CamelExcepti
/* Get one token from the imap stream */
camel_imapx_token_t
/* throws IO,PARSE exception */
-camel_imapx_stream_token(CamelIMAPXStream *is, unsigned char **data, unsigned int *len, CamelException *ex)
+camel_imapx_stream_token(CamelIMAPXStream *is, guchar **data, guint *len, CamelException *ex)
{
- register unsigned char c, *p, *o, *oe;
- unsigned char *e;
- unsigned int literal;
- int digits;
+ register guchar c, *p, *o, *oe;
+ guchar *e;
+ guint literal;
+ gint digits;
if (is->unget > 0) {
is->unget--;
@@ -525,7 +525,7 @@ camel_imapx_stream_token(CamelIMAPXStream *is, unsigned char **data, unsigned in
if (isdigit(c))
printf("Protocol error: literal too big\n");
else
- printf("Protocol error: literal contains invalid char %02x '%c'\n", c, isprint(c)?c:c);
+ printf("Protocol error: literal contains invalid gchar %02x '%c'\n", c, isprint(c)?c:c);
goto protocol_error;
}
}
@@ -630,7 +630,7 @@ protocol_error:
}
void
-camel_imapx_stream_ungettoken(CamelIMAPXStream *is, camel_imapx_token_t tok, unsigned char *token, unsigned int len)
+camel_imapx_stream_ungettoken(CamelIMAPXStream *is, camel_imapx_token_t tok, guchar *token, guint len)
{
/*printf("ungettoken: '%c' '%s'\n", tok, token);*/
is->unget_tok = tok;
@@ -640,10 +640,10 @@ camel_imapx_stream_ungettoken(CamelIMAPXStream *is, camel_imapx_token_t tok, uns
}
/* returns -1 on error, 0 if last lot of data, >0 if more remaining */
-int camel_imapx_stream_gets(CamelIMAPXStream *is, unsigned char **start, unsigned int *len)
+gint camel_imapx_stream_gets(CamelIMAPXStream *is, guchar **start, guint *len)
{
- int max;
- unsigned char *end;
+ gint max;
+ guchar *end;
*len = 0;
@@ -665,15 +665,15 @@ int camel_imapx_stream_gets(CamelIMAPXStream *is, unsigned char **start, unsigne
return end == NULL?1:0;
}
-void camel_imapx_stream_set_literal(CamelIMAPXStream *is, unsigned int literal)
+void camel_imapx_stream_set_literal(CamelIMAPXStream *is, guint literal)
{
is->literal = literal;
}
/* returns -1 on erorr, 0 if last data, >0 if more data left */
-int camel_imapx_stream_getl(CamelIMAPXStream *is, unsigned char **start, unsigned int *len)
+gint camel_imapx_stream_getl(CamelIMAPXStream *is, guchar **start, guint *len)
{
- int max;
+ gint max;
*len = 0;
@@ -699,19 +699,19 @@ int camel_imapx_stream_getl(CamelIMAPXStream *is, unsigned char **start, unsigne
}
/* skip the rest of the line of tokens */
-int
+gint
camel_imapx_stream_skip(CamelIMAPXStream *is, CamelException *ex)
{
- int tok;
- unsigned char *token;
- unsigned int len;
+ gint tok;
+ guchar *token;
+ guint len;
do {
tok = camel_imapx_stream_token(is, &token, &len, ex);
if (tok == IMAP_TOK_LITERAL) {
camel_imapx_stream_set_literal(is, len);
while ((tok = camel_imapx_stream_getl(is, &token, &len)) > 0) {
- printf("Skip literal data '%.*s'\n", (int)len, token);
+ printf("Skip literal data '%.*s'\n", (gint)len, token);
}
}
} while (tok != '\n' && tok >= 0);
diff --git a/camel/providers/imapx/camel-imapx-stream.h b/camel/providers/imapx/camel-imapx-stream.h
index b2c6d2b..a98ff6d 100644
--- a/camel/providers/imapx/camel-imapx-stream.h
+++ b/camel/providers/imapx/camel-imapx-stream.h
@@ -45,15 +45,15 @@ struct _CamelIMAPXStream {
CamelStream *source;
/*int state;*/
- unsigned char *buf, *ptr, *end;
- unsigned int literal;
+ guchar *buf, *ptr, *end;
+ guint literal;
- unsigned int unget;
+ guint unget;
camel_imapx_token_t unget_tok;
- unsigned char *unget_token;
- unsigned int unget_len;
+ guchar *unget_token;
+ guint unget_len;
- unsigned char *tokenbuf, *tokenptr, *tokenend;
+ guchar *tokenbuf, *tokenptr, *tokenend;
};
struct _CamelIMAPXStreamClass {
@@ -64,32 +64,32 @@ CamelType camel_imapx_stream_get_type (void);
CamelStream *camel_imapx_stream_new (CamelStream *source);
-int camel_imapx_stream_buffered (CamelIMAPXStream *is);
+gint camel_imapx_stream_buffered (CamelIMAPXStream *is);
-camel_imapx_token_t camel_imapx_stream_token (CamelIMAPXStream *is, unsigned char **start, unsigned int *len, CamelException *ex); /* throws IO,PARSE exception */
-void camel_imapx_stream_ungettoken (CamelIMAPXStream *is, camel_imapx_token_t tok, unsigned char *token, unsigned int len);
+camel_imapx_token_t camel_imapx_stream_token (CamelIMAPXStream *is, guchar **start, guint *len, CamelException *ex); /* throws IO,PARSE exception */
+void camel_imapx_stream_ungettoken (CamelIMAPXStream *is, camel_imapx_token_t tok, guchar *token, guint len);
-void camel_imapx_stream_set_literal (CamelIMAPXStream *is, unsigned int literal);
-int camel_imapx_stream_gets (CamelIMAPXStream *is, unsigned char **start, unsigned int *len);
-int camel_imapx_stream_getl (CamelIMAPXStream *is, unsigned char **start, unsigned int *len);
+void camel_imapx_stream_set_literal (CamelIMAPXStream *is, guint literal);
+gint camel_imapx_stream_gets (CamelIMAPXStream *is, guchar **start, guint *len);
+gint camel_imapx_stream_getl (CamelIMAPXStream *is, guchar **start, guint *len);
/* all throw IO,PARSE exceptions */
/* gets an atom, upper-cases */
-int camel_imapx_stream_atom (CamelIMAPXStream *is, unsigned char **start, unsigned int *len, CamelException *ex);
+gint camel_imapx_stream_atom (CamelIMAPXStream *is, guchar **start, guint *len, CamelException *ex);
/* gets an atom or string */
-int camel_imapx_stream_astring (CamelIMAPXStream *is, unsigned char **start, CamelException *ex);
+gint camel_imapx_stream_astring (CamelIMAPXStream *is, guchar **start, CamelException *ex);
/* gets a NIL or a string, start==NULL if NIL */
-int camel_imapx_stream_nstring (CamelIMAPXStream *is, unsigned char **start, CamelException *ex);
+gint camel_imapx_stream_nstring (CamelIMAPXStream *is, guchar **start, CamelException *ex);
/* gets a NIL or string into a stream, stream==NULL if NIL */
-int camel_imapx_stream_nstring_stream(CamelIMAPXStream *is, CamelStream **stream, CamelException *ex);
+gint camel_imapx_stream_nstring_stream(CamelIMAPXStream *is, CamelStream **stream, CamelException *ex);
/* gets 'text' */
-int camel_imapx_stream_text (CamelIMAPXStream *is, unsigned char **text, CamelException *ex);
+gint camel_imapx_stream_text (CamelIMAPXStream *is, guchar **text, CamelException *ex);
/* gets a 'number' */
guint32 camel_imapx_stream_number(CamelIMAPXStream *is, CamelException *ex);
/* skips the rest of a line, including literals, etc */
-int camel_imapx_stream_skip(CamelIMAPXStream *is, CamelException *ex);
+gint camel_imapx_stream_skip(CamelIMAPXStream *is, CamelException *ex);
#endif /* ! _CAMEL_IMAPX_STREAM_H */
diff --git a/camel/providers/imapx/camel-imapx-tokenise.h b/camel/providers/imapx/camel-imapx-tokenise.h
index 0309d39..e174f54 100644
--- a/camel/providers/imapx/camel-imapx-tokenise.h
+++ b/camel/providers/imapx/camel-imapx-tokenise.h
@@ -29,7 +29,7 @@
#endif
#line 3 "camel-imapx-tokens.txt"
-struct _imap_keyword { char *name; camel_imapx_id_t id; };
+struct _imap_keyword { gchar *name; camel_imapx_id_t id; };
#define TOTAL_KEYWORDS 31
#define MIN_WORD_LENGTH 2
@@ -45,10 +45,10 @@ __inline
inline
#endif
#endif
-static unsigned int
-imap_hash (register const char *str, register unsigned int len)
+static guint
+imap_hash (register const gchar *str, register guint len)
{
- static unsigned char asso_values[] =
+ static guchar asso_values[] =
{
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
@@ -77,14 +77,14 @@ imap_hash (register const char *str, register unsigned int len)
50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
50, 50, 50, 50, 50, 50
};
- return len + asso_values[(unsigned char)str[len - 1]] + asso_values[(unsigned char)str[0]];
+ return len + asso_values[(guchar)str[len - 1]] + asso_values[(guchar)str[0]];
}
#ifdef __GNUC__
__inline
#endif
struct _imap_keyword *
-imap_tokenise_struct (register const char *str, register unsigned int len)
+imap_tokenise_struct (register const gchar *str, register guint len)
{
static struct _imap_keyword wordlist[] =
{
@@ -161,11 +161,11 @@ imap_tokenise_struct (register const char *str, register unsigned int len)
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
- register int key = imap_hash (str, len);
+ register gint key = imap_hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
{
- register const char *s = wordlist[key].name;
+ register const gchar *s = wordlist[key].name;
if (*str == *s && !strcmp (str + 1, s + 1))
return &wordlist[key];
diff --git a/camel/providers/imapx/camel-imapx-utils.c b/camel/providers/imapx/camel-imapx-utils.c
index f963d55..f1223f7 100644
--- a/camel/providers/imapx/camel-imapx-utils.c
+++ b/camel/providers/imapx/camel-imapx-utils.c
@@ -26,7 +26,7 @@
__inline
#endif
camel_imapx_id_t
-imap_tokenise (register const char *str, register unsigned int len)
+imap_tokenise (register const gchar *str, register guint len)
{
struct _imap_keyword *k = imap_tokenise_struct(str, len);
@@ -37,7 +37,7 @@ imap_tokenise (register const char *str, register unsigned int len)
/* flag table */
static struct {
- char *name;
+ gchar *name;
guint32 flag;
} flag_table[] = {
{ "\\ANSWERED", CAMEL_MESSAGE_ANSWERED },
@@ -56,8 +56,8 @@ void
imap_parse_flags(CamelIMAPXStream *stream, guint32 *flagsp, CamelFlag **user_flagsp, CamelException *ex)
/* throws IO,PARSE exception */
{
- int tok, len, i;
- unsigned char *token, *p, c;
+ gint tok, len, i;
+ guchar *token, *p, c;
guint32 flags = 0;
*flagsp = flags;
@@ -71,7 +71,7 @@ imap_parse_flags(CamelIMAPXStream *stream, guint32 *flagsp, CamelFlag **user_fla
// FIXME: ascii_toupper
while ((c=*p))
*p++ = toupper(c);
- for (i=0;i<(int)(sizeof(flag_table)/sizeof(flag_table[0]));i++)
+ for (i=0;i<(gint)(sizeof(flag_table)/sizeof(flag_table[0]));i++)
if (!strcmp(token, flag_table[i].name)) {
flags |= flag_table[i].flag;
goto found;
@@ -97,13 +97,13 @@ void
imap_write_flags(CamelStream *stream, guint32 flags, CamelFlag *user_flags)
/* throws IO exception */
{
- int i;
+ gint i;
/* all this ugly exception throwing goes away once camel streams throw their own? */
if (camel_stream_write(stream, "(", 1) == -1)
camel_exception_throw(1, "io error: %s", strerror(errno));
- for (i=0;flags!=0 && i<(int)(sizeof(flag_table)/sizeof(flag_table[0]));i++) {
+ for (i=0;flags!=0 && i<(gint)(sizeof(flag_table)/sizeof(flag_table[0]));i++) {
if (flag_table[i].flag & flags) {
if (camel_stream_write(stream, flag_table[i].name, strlen(flag_table[i].name)) == -1)
camel_exception_throw(1, "io error: %s", strerror(errno));
@@ -135,7 +135,7 @@ capability_data ::= "CAPABILITY" SPACE [1#capability SPACE] "IMAP4rev1"
*/
struct {
- char *name;
+ gchar *name;
guint32 flag;
} capa_table[] = {
{ "IMAP4", IMAP_CAPABILITY_IMAP4 },
@@ -150,15 +150,15 @@ struct {
struct _capability_info *
imap_parse_capability(CamelIMAPXStream *stream, CamelException *ex)
{
- int tok, len, i;
- unsigned char *token, *p, c;
+ gint tok, len, i;
+ guchar *token, *p, c;
struct _capability_info * volatile cinfo;
cinfo = g_malloc0(sizeof(*cinfo));
/* FIXME: handle auth types */
while (!camel_exception_is_set (ex) && (tok = camel_imapx_stream_token(stream, &token, &len, ex)) != '\n') {
- switch(tok) {
+ switch (tok) {
case IMAP_TOK_TOKEN:
case IMAP_TOK_STRING:
p = token;
@@ -166,7 +166,7 @@ imap_parse_capability(CamelIMAPXStream *stream, CamelException *ex)
*p++ = toupper(c);
case IMAP_TOK_INT:
printf(" cap: '%s'\n", token);
- for (i=0;i<(int)(sizeof(capa_table)/sizeof(capa_table[0]));i++)
+ for (i=0;i<(gint)(sizeof(capa_table)/sizeof(capa_table[0]));i++)
if (strcmp(token, capa_table[i].name))
cinfo->capa |= capa_table[i].flag;
break;
@@ -178,7 +178,7 @@ imap_parse_capability(CamelIMAPXStream *stream, CamelException *ex)
if (camel_exception_is_set (ex)) {
imap_free_capability(cinfo);
- cinfo = NULL;
+ cinfo = NULL;
}
return cinfo;
@@ -288,13 +288,9 @@ media_subtype ::= string
media_text ::= <"> "TEXT" <"> SPACE media_subtype
;; Defined in [MIME-IMT]
-
-
( "type" "subtype" body_fields [envelope body body_fld_lines]
[body_fld_lines]
-
-
(("TEXT" "PLAIN" ("CHARSET"
"US-ASCII") NIL NIL "7BIT" 1152 23)("TEXT" "PLAIN"
("CHARSET" "US-ASCII" "NAME" "cc.diff")
@@ -306,7 +302,7 @@ media_text ::= <"> "TEXT" <"> SPACE media_subtype
/*
struct _body_fields {
CamelContentType *ct;
- char *msgid, *desc;
+ gchar *msgid, *desc;
CamelTransferEncoding encoding;
guint32 size;
};*/
@@ -322,7 +318,7 @@ imap_free_body(struct _CamelMessageContentInfo *cinfo)
imap_free_body(list);
list = next;
}
-
+
if (cinfo->type)
camel_content_type_unref(cinfo->type);
g_free(cinfo->id);
@@ -334,8 +330,8 @@ imap_free_body(struct _CamelMessageContentInfo *cinfo)
void
imap_parse_param_list(CamelIMAPXStream *is, struct _camel_header_param **plist, CamelException *ex)
{
- int tok, len;
- unsigned char *token, *param;
+ gint tok, len;
+ guchar *token, *param;
p(printf("body_fld_param\n"));
@@ -347,7 +343,7 @@ imap_parse_param_list(CamelIMAPXStream *is, struct _camel_header_param **plist,
if (tok == ')')
break;
camel_imapx_stream_ungettoken(is, tok, token, len);
-
+
camel_imapx_stream_astring(is, &token, ex);
param = alloca(strlen(token)+1);
strcpy(param, token);
@@ -360,8 +356,8 @@ imap_parse_param_list(CamelIMAPXStream *is, struct _camel_header_param **plist,
struct _CamelContentDisposition *
imap_parse_ext_optional(CamelIMAPXStream *is, CamelException *ex)
{
- int tok, len;
- unsigned char *token;
+ gint tok, len;
+ guchar *token;
struct _CamelContentDisposition *dinfo = NULL;
/* this parses both extension types, from the body_fld_dsp onwards */
@@ -429,7 +425,7 @@ imap_parse_ext_optional(CamelIMAPXStream *is, CamelException *ex)
/* we have a literal string */
camel_imapx_stream_set_literal(is, len);
while ((tok = camel_imapx_stream_getl(is, &token, &len)) > 0) {
- d(printf("Skip literal data '%.*s'\n", (int)len, token));
+ d(printf("Skip literal data '%.*s'\n", (gint)len, token));
}
break;
@@ -446,9 +442,9 @@ imap_parse_ext_optional(CamelIMAPXStream *is, CamelException *ex)
struct _CamelMessageContentInfo *
imap_parse_body_fields(CamelIMAPXStream *is, CamelException *ex)
{
- unsigned char *token, *type;
+ guchar *token, *type;
struct _CamelMessageContentInfo *cinfo;
-
+
/* body_fields ::= body_fld_param SPACE body_fld_id SPACE
body_fld_desc SPACE body_fld_enc SPACE
body_fld_octets */
@@ -489,7 +485,7 @@ imap_parse_body_fields(CamelIMAPXStream *is, CamelException *ex)
if (camel_exception_is_set (ex))
goto error;
cinfo->encoding = g_strdup(token);
-
+
/* body_fld_octets ::= number */
cinfo->size = camel_imapx_stream_number(is, ex);
if (camel_exception_is_set (ex))
@@ -505,8 +501,8 @@ struct _camel_header_address *
imap_parse_address_list(CamelIMAPXStream *is, CamelException *ex)
/* throws PARSE,IO exception */
{
- int tok, len;
- unsigned char *token, *host, *mbox;
+ gint tok, len;
+ guchar *token, *host, *mbox;
struct _camel_header_address *list = NULL;
/* "(" 1*address ")" / nil */
@@ -524,7 +520,7 @@ imap_parse_address_list(CamelIMAPXStream *is, CamelException *ex)
if (tok != '(') {
camel_header_address_list_clear(&list);
camel_exception_set (ex, 1, "missing '(' for address");
- return NULL;
+ return NULL;
}
addr = camel_header_address_new();
@@ -557,7 +553,7 @@ imap_parse_address_list(CamelIMAPXStream *is, CamelException *ex)
group = addr;
}
} else {
- addr->v.addr = g_strdup_printf("%s%s%s", mbox?(char *)mbox:"", host?"@":"", host?(char *)host:"");
+ addr->v.addr = g_strdup_printf("%s%s%s", mbox?(gchar *)mbox:"", host?"@":"", host?(gchar *)host:"");
g_free(mbox);
d(printf("adding address '%s'\n", addr->v.addr));
if (group != NULL)
@@ -581,10 +577,10 @@ imap_parse_address_list(CamelIMAPXStream *is, CamelException *ex)
struct _CamelMessageInfo *
imap_parse_envelope(CamelIMAPXStream *is, CamelException *ex)
{
- int tok, len;
- unsigned char *token;
+ gint tok, len;
+ guchar *token;
struct _camel_header_address *addr, *addr_from;
- char *addrstr;
+ gchar *addrstr;
struct _CamelMessageInfoBase *minfo;
/* envelope ::= "(" env_date SPACE env_subject SPACE env_from
@@ -680,19 +676,19 @@ imap_parse_envelope(CamelIMAPXStream *is, CamelException *ex)
if (tok != ')') {
camel_message_info_free(minfo);
camel_exception_throw(1, "expecting ')'");
- return NULL;
+ return NULL;
}
/* CHEN TODO handle exceptions better */
return (CamelMessageInfo *)minfo;
}
-
+
struct _CamelMessageContentInfo *
imap_parse_body(CamelIMAPXStream *is, CamelException *ex)
{
- int tok, len;
- unsigned char *token;
+ gint tok, len;
+ guchar *token;
struct _CamelMessageContentInfo * volatile cinfo = NULL;
struct _CamelMessageContentInfo *subinfo, *last;
struct _CamelContentDisposition * volatile dinfo = NULL;
@@ -804,7 +800,7 @@ imap_parse_body(CamelIMAPXStream *is, CamelException *ex)
if (tok != ')') {
camel_imapx_stream_nstring(is, &token, ex);
- d(printf("md5: %s\n", token?(char *)token:"NIL"));
+ d(printf("md5: %s\n", token?(gchar *)token:"NIL"));
/* body_fld_dsp ::= "(" string SPACE body_fld_param ")" / nil */
@@ -825,7 +821,6 @@ imap_parse_body(CamelIMAPXStream *is, CamelException *ex)
d(printf("Dropping extension data '%s'\n", token));
} while (tok != ')');
-
/* CHEN TODO handle exceptions better */
if (camel_exception_is_set (ex)) {
if (cinfo)
@@ -865,7 +860,7 @@ imap_parse_section(CamelIMAPXStream *is, CamelException *ex)
tok = camel_imapx_stream_token(is, &token, &len, ex);
if (tok != '[') {
camel_exception_set (ex, 1, "section: expecting '['");
- return NULL;
+ return NULL;
}
tok = camel_imapx_stream_token(is, &token, &len, ex);
@@ -889,7 +884,7 @@ imap_parse_section(CamelIMAPXStream *is, CamelException *ex)
tok = camel_imapx_stream_token(is, &token, &len, ex);
if (tok == IMAP_TOK_STRING || tok == IMAP_TOK_TOKEN || tok == IMAP_TOK_INT) {
/* ?do something? */
- } else if (tok != ')'){
+ } else if (tok != ')') {
camel_exception_set (ex, 1, "section: header fields: expecting string");
g_free (section);
return NULL;
@@ -939,7 +934,7 @@ void
imap_dump_fetch(struct _fetch_info *finfo)
{
CamelStream *sout;
- int fd;
+ gint fd;
printf("Fetch info:\n");
if (finfo == NULL) {
@@ -973,11 +968,11 @@ imap_dump_fetch(struct _fetch_info *finfo)
//camel_content_info_dump(finfo->cinfo, 0);
}
if (finfo->got & FETCH_SIZE)
- camel_stream_printf(sout, "Size: %d\n", (int)finfo->size);
+ camel_stream_printf(sout, "Size: %d\n", (gint)finfo->size);
if (finfo->got & FETCH_BODY)
- camel_stream_printf(sout, "Offset: %d\n", (int)finfo->offset);
+ camel_stream_printf(sout, "Offset: %d\n", (gint)finfo->offset);
if (finfo->got & FETCH_FLAGS)
- camel_stream_printf(sout, "Flags: %08x\n", (int)finfo->flags);
+ camel_stream_printf(sout, "Flags: %08x\n", (gint)finfo->flags);
if (finfo->date)
camel_stream_printf(sout, "Date: '%s'\n", finfo->date);
if (finfo->section)
@@ -990,8 +985,8 @@ imap_dump_fetch(struct _fetch_info *finfo)
struct _fetch_info *
imap_parse_fetch(CamelIMAPXStream *is, CamelException *ex)
{
- int tok, len;
- unsigned char *token, *p, c;
+ gint tok, len;
+ guchar *token, *p, c;
struct _fetch_info *finfo;
finfo = g_malloc0(sizeof(*finfo));
@@ -1009,7 +1004,7 @@ imap_parse_fetch(CamelIMAPXStream *is, CamelException *ex)
while ((c=*p))
*p++ = toupper(c);
- switch(imap_tokenise(token, len)) {
+ switch (imap_tokenise(token, len)) {
case IMAP_ENVELOPE:
finfo->minfo = imap_parse_envelope(is, ex);
finfo->got |= FETCH_MINFO;
@@ -1056,7 +1051,7 @@ imap_parse_fetch(CamelIMAPXStream *is, CamelException *ex)
camel_imapx_stream_ungettoken(is, tok, token, len);
}
camel_imapx_stream_nstring_stream(is, &finfo->body, ex);
- finfo->got |= FETCH_BODY;
+ finfo->got |= FETCH_BODY;
} else {
camel_exception_set (ex, 1, "unknown body response");
imap_free_fetch(finfo);
@@ -1093,8 +1088,8 @@ imap_parse_fetch(CamelIMAPXStream *is, CamelException *ex)
struct _status_info *
imap_parse_status(CamelIMAPXStream *is, CamelException *ex)
{
- int tok, len;
- unsigned char *token;
+ gint tok, len;
+ guchar *token;
struct _status_info *sinfo;
sinfo = g_malloc0(sizeof(*sinfo));
@@ -1178,7 +1173,7 @@ imap_parse_status(CamelIMAPXStream *is, CamelException *ex)
}
/* and take the human readable response */
- camel_imapx_stream_text(is, (unsigned char **)&sinfo->text, ex);
+ camel_imapx_stream_text(is, (guchar **)&sinfo->text, ex);
return sinfo;
}
@@ -1220,7 +1215,7 @@ imap_free_status(struct _status_info *sinfo)
/* FIXME: use tokeniser? */
/* FIXME: real flags */
static struct {
- char *name;
+ gchar *name;
guint32 flag;
} list_flag_table[] = {
{ "\\NOINFERIORS", CAMEL_FOLDER_NOINFERIORS },
@@ -1238,7 +1233,7 @@ imap_parse_list(CamelIMAPXStream *is, CamelException *ex)
struct _list_info * volatile linfo;
linfo = g_malloc0(sizeof(*linfo));
-
+
/* mailbox_list ::= "(" #("\Marked" / "\Noinferiors" /
"\Noselect" / "\Unmarked" / flag_extension) ")"
SPACE (<"> QUOTED_CHAR <"> / nil) SPACE mailbox */
@@ -1255,7 +1250,7 @@ imap_parse_list(CamelIMAPXStream *is, CamelException *ex)
p = token;
while ((c=*p))
*p++ = toupper(c);
- for (i=0;i<(int)(sizeof(list_flag_table)/sizeof(list_flag_table[0]));i++)
+ for (i=0;i<(gint)(sizeof(list_flag_table)/sizeof(list_flag_table[0]));i++)
if (!strcmp(token, list_flag_table[i].name))
linfo->flags |= list_flag_table[i].flag;
} else {
@@ -1273,12 +1268,12 @@ imap_parse_list(CamelIMAPXStream *is, CamelException *ex)
return linfo;
}
-char *
+gchar *
imapx_list_get_path(struct _list_info *li)
{
- char *path, *p;
- int c;
- const char *f;
+ gchar *path, *p;
+ gint c;
+ const gchar *f;
if (li->separator != 0 && li->separator != '/') {
p = path = alloca(strlen(li->name)*3+1);
@@ -1352,7 +1347,7 @@ QSPECIAL = 8
*/
-unsigned char imapx_specials[256] = {
+guchar imapx_specials[256] = {
/* 00 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 4, 0, 0,
/* 10 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* 20 */4, 1, 0, 1, 1, 0, 1, 1, 0, 0, 2, 7, 1, 1, 1, 1,
@@ -1361,14 +1356,14 @@ unsigned char imapx_specials[256] = {
/* 50 */1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 0, 7, 1, 1,
/* 60 */1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* 70 */1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
#define list_wildcards "*%"
@@ -1381,8 +1376,8 @@ unsigned char imapx_specials[256] = {
void imapx_utils_init(void)
{
- int i;
- unsigned char v;
+ gint i;
+ guchar v;
for (i=0;i<128;i++) {
v = 0;
@@ -1400,17 +1395,17 @@ void imapx_utils_init(void)
if (strchr(notid_specials, i) != NULL)
v |= IMAPX_TYPE_NOTID_CHAR;
}
-
+
imapx_specials[i] = v;
}
}
-unsigned char imapx_is_mask(const char *p)
+guchar imapx_is_mask(const gchar *p)
{
- unsigned char v = 0xff;
+ guchar v = 0xff;
while (*p) {
- v &= imapx_specials[((unsigned char)*p) & 0xff];
+ v &= imapx_specials[((guchar)*p) & 0xff];
p++;
}
diff --git a/camel/providers/imapx/camel-imapx-utils.h b/camel/providers/imapx/camel-imapx-utils.h
index ad4e9f3..a9c2eed 100644
--- a/camel/providers/imapx/camel-imapx-utils.h
+++ b/camel/providers/imapx/camel-imapx-utils.h
@@ -46,7 +46,7 @@ typedef enum _camel_imapx_id_t {
} camel_imapx_id_t;
/* str MUST be in upper case, tokenised using gperf function */
-camel_imapx_id_t imap_tokenise(register const char *str, register unsigned int len);
+camel_imapx_id_t imap_tokenise(register const gchar *str, register guint len);
/* this flag should be part of imapfoldersummary */
enum {
@@ -83,7 +83,7 @@ struct _CamelMessageContentInfo *imap_parse_body_fields(struct _CamelIMAPXStream
struct _camel_header_address *imap_parse_address_list(struct _CamelIMAPXStream *is, CamelException *ex) /* IO,PARSE */;
struct _CamelMessageInfo *imap_parse_envelope(struct _CamelIMAPXStream *is, CamelException *ex) /* IO, PARSE */;
struct _CamelMessageContentInfo *imap_parse_body(struct _CamelIMAPXStream *is, CamelException *ex) /* IO,PARSE */;
-char *imap_parse_section(struct _CamelIMAPXStream *is, CamelException *ex) /* IO,PARSE */;
+gchar *imap_parse_section(struct _CamelIMAPXStream *is, CamelException *ex) /* IO,PARSE */;
void imap_free_body(struct _CamelMessageContentInfo *cinfo);
/* ********************************************************************** */
@@ -100,9 +100,9 @@ struct _fetch_info {
guint32 offset; /* start offset of a BODY[]<offset.length> request */
guint32 flags; /* FLAGS */
struct _CamelFlag *user_flags;
- char *date; /* INTERNALDATE */
- char *section; /* section for a BODY[section] request */
- char *uid; /* UID */
+ gchar *date; /* INTERNALDATE */
+ gchar *section; /* section for a BODY[section] request */
+ gchar *uid; /* UID */
};
#define FETCH_BODY (1<<0)
@@ -129,8 +129,8 @@ struct _status_info {
union {
struct {
- char *oldname;
- char *newname;
+ gchar *oldname;
+ gchar *newname;
} newname;
guint32 permanentflags;
guint32 uidvalidity;
@@ -141,7 +141,7 @@ struct _status_info {
} appenduid;
} u;
- char *text;
+ gchar *text;
};
struct _status_info *imap_parse_status(struct _CamelIMAPXStream *is, CamelException *ex);
@@ -150,21 +150,21 @@ void imap_free_status(struct _status_info *sinfo);
/* ********************************************************************** */
-/* should this just return a FolderInfo?
+/* should this just return a FolderInfo?
should this just return the name & flags & separator by reference? */
struct _list_info {
guint32 flags:24;
- char separator;
- char *name;
+ gchar separator;
+ gchar *name;
};
struct _list_info *imap_parse_list(struct _CamelIMAPXStream *is, CamelException *ex);
-char *imapx_list_get_path(struct _list_info *li);
+gchar *imapx_list_get_path(struct _list_info *li);
void imap_free_list(struct _list_info *linfo);
/* ********************************************************************** */
-extern unsigned char imapx_specials[256];
+extern guchar imapx_specials[256];
#define IMAPX_TYPE_CHAR (1<<0)
#define IMAPX_TYPE_TEXT_CHAR (1<<1)
@@ -173,7 +173,7 @@ extern unsigned char imapx_specials[256];
#define IMAPX_TYPE_TOKEN_CHAR (1<<4)
#define IMAPX_TYPE_NOTID_CHAR (1<<5)
-unsigned char imapx_is_mask(const char *p);
+guchar imapx_is_mask(const gchar *p);
#define imapx_is_text_char(c) ((imapx_specials[((unsigned char)(c))&0xff] & IMAPX_TYPE_TEXT_CHAR) != 0)
#define imapx_is_quoted_char(c) ((imapx_specials[((unsigned char)(c))&0xff] & IMAPX_TYPE_QUOTED_CHAR) != 0)
diff --git a/camel/providers/imapx/camel-imapx-view-summary.c b/camel/providers/imapx/camel-imapx-view-summary.c
index a5f967f..109700c 100644
--- a/camel/providers/imapx/camel-imapx-view-summary.c
+++ b/camel/providers/imapx/camel-imapx-view-summary.c
@@ -43,11 +43,11 @@ static CamelViewSummaryDiskClass *cmvs_parent;
* camel_imapx_view_summary_new:
*
* Create a new CamelIMAPXViewSummary object.
- *
+ *
* Return value: A new CamelIMAPXViewSummary widget.
**/
CamelIMAPXViewSummary *
-camel_imapx_view_summary_new(const char *base, CamelException *ex)
+camel_imapx_view_summary_new(const gchar *base, CamelException *ex)
{
return (CamelIMAPXViewSummary *)camel_view_summary_disk_construct(camel_object_new(camel_imapx_view_summary_get_type()), base, ex);
}
@@ -77,10 +77,10 @@ void camel_imapx_view_last_uid(CamelIMAPXView *view, guint32 uid)
#endif
}
-static int
+static gint
imapx_view_decode(CamelViewSummaryDisk *s, CamelView *view, CamelRecordDecoder *crd)
{
- int tag, ver;
+ gint tag, ver;
((CamelViewSummaryDiskClass *)cmvs_parent)->decode(s, view, crd);
@@ -147,7 +147,7 @@ CamelType
camel_imapx_view_summary_get_type(void)
{
static CamelType type = CAMEL_INVALID_TYPE;
-
+
if (type == CAMEL_INVALID_TYPE) {
cmvs_parent = (CamelViewSummaryDiskClass *)camel_view_summary_disk_get_type();
type = camel_type_register((CamelType)cmvs_parent, "CamelIMAPXViewSummary",
@@ -158,6 +158,6 @@ camel_imapx_view_summary_get_type(void)
(CamelObjectInitFunc) camel_imapx_view_summary_init,
(CamelObjectFinalizeFunc) camel_imapx_view_summary_finalise);
}
-
+
return type;
}
diff --git a/camel/providers/imapx/camel-imapx-view-summary.h b/camel/providers/imapx/camel-imapx-view-summary.h
index e7b244b..5c30bbd 100644
--- a/camel/providers/imapx/camel-imapx-view-summary.h
+++ b/camel/providers/imapx/camel-imapx-view-summary.h
@@ -35,13 +35,13 @@ typedef struct _CamelIMAPXView CamelIMAPXView;
struct _CamelIMAPXView {
CamelViewDisk view;
- char separator;
+ gchar separator;
/* This data is only set on the root views */
- char *raw_name;
+ gchar *raw_name;
guint32 exists;
guint32 uidvalidity;
- guint32 permanentflags;
+ guint32 permanentflags;
};
struct _CamelIMAPXViewSummary {
@@ -53,7 +53,7 @@ struct _CamelIMAPXViewSummaryClass {
};
CamelType camel_imapx_view_summary_get_type (void);
-CamelIMAPXViewSummary *camel_imapx_view_summary_new (const char *base, CamelException *ex);
+CamelIMAPXViewSummary *camel_imapx_view_summary_new (const gchar *base, CamelException *ex);
/* called on root view */
guint32 camel_imapx_view_next_uid(CamelIMAPXView *view);
diff --git a/camel/providers/imapx/test-imapx.c b/camel/providers/imapx/test-imapx.c
index fa39d85..5c810c4 100644
--- a/camel/providers/imapx/test-imapx.c
+++ b/camel/providers/imapx/test-imapx.c
@@ -3,15 +3,14 @@
#include "camel-imapx-folder.h"
#include <camel/camel-session.h>
-int
-main (int argc, char *argv [])
+gint
+main (gint argc, gchar *argv [])
{
CamelSession *session;
CamelException *ex;
gchar *uri = NULL;
CamelService *service;
-
if (argc != 2) {
printf ("Pass the account url argument \n");
return -1;
@@ -23,7 +22,7 @@ main (int argc, char *argv [])
camel_init ("/tmp/test-camel-imapx");
camel_provider_init ();
ex = camel_exception_new ();
-
+
session = CAMEL_SESSION (camel_object_new (CAMEL_SESSION_TYPE));
camel_session_construct (session, "/tmp/test-camel-imapx");
diff --git a/camel/providers/local/camel-maildir-folder.c b/camel/providers/local/camel-maildir-folder.c
index f8de62e..81d5553 100644
--- a/camel/providers/local/camel-maildir-folder.c
+++ b/camel/providers/local/camel-maildir-folder.c
@@ -374,7 +374,7 @@ maildir_sort_uids (CamelFolder *folder, GPtrArray *uids)
CAMEL_FOLDER_CLASS (parent_class)->sort_uids (folder, uids);
}
-static void
+static void
maildir_transfer_messages_to (CamelFolder *source, GPtrArray *uids, CamelFolder *dest, GPtrArray **transferred_uids, gboolean delete_originals, CamelException *ex)
{
gboolean fallback = FALSE;
@@ -390,8 +390,8 @@ maildir_transfer_messages_to (CamelFolder *source, GPtrArray *uids, CamelFolder
camel_folder_freeze (source);
for (i = 0; i < uids->len; i++) {
- char *uid = (char *) uids->pdata[i];
- char *s_filename, *d_filename, *tmp;
+ gchar *uid = (gchar *) uids->pdata[i];
+ gchar *s_filename, *d_filename, *tmp;
CamelMaildirMessageInfo *mdi;
CamelMessageInfo *info;
diff --git a/libebackend/e-offline-listener.c b/libebackend/e-offline-listener.c
index 136a71f..d7bbc36 100644
--- a/libebackend/e-offline-listener.c
+++ b/libebackend/e-offline-listener.c
@@ -79,7 +79,6 @@ online_status_changed (GConfClient *client, gint cnxn_id, GConfEntry *entry, gpo
}
}
-
static void
setup_offline_listener (EOfflineListener *eol)
{
@@ -87,8 +86,8 @@ setup_offline_listener (EOfflineListener *eol)
priv->default_client = gconf_client_get_default ();
gconf_client_add_dir (priv->default_client, "/apps/evolution/shell", GCONF_CLIENT_PRELOAD_RECURSIVE,NULL);
- gconf_client_notify_add (priv->default_client, "/apps/evolution/shell/start_offline",
- (GConfClientNotifyFunc)online_status_changed,
+ gconf_client_notify_add (priv->default_client, "/apps/evolution/shell/start_offline",
+ (GConfClientNotifyFunc)online_status_changed,
eol, NULL, NULL);
priv->is_offline_now = gconf_client_get_bool (priv->default_client, "/apps/evolution/shell/start_offline", NULL);
@@ -151,7 +150,7 @@ eol_class_init (EOfflineListenerClass *klass)
object_class = G_OBJECT_CLASS (klass);
object_class->dispose = eol_dispose;
object_class->finalize = eol_finalize;
-
+
signals[CHANGED] =
g_signal_new ("changed",
G_OBJECT_CLASS_TYPE (object_class),
diff --git a/libebackend/e-offline-listener.h b/libebackend/e-offline-listener.h
index 007d57b..68e4e27 100644
--- a/libebackend/e-offline-listener.h
+++ b/libebackend/e-offline-listener.h
@@ -45,7 +45,6 @@ typedef enum {
EOL_STATE_OFFLINE = 0,
EOL_STATE_ONLINE = 1
} EOfflineListenerState;
-
struct _EOfflineListener {
GObject parent;
diff --git a/libedataserverui/e-categories-dialog.c b/libedataserverui/e-categories-dialog.c
index 63f9a07..1f1866e 100644
--- a/libedataserverui/e-categories-dialog.c
+++ b/libedataserverui/e-categories-dialog.c
@@ -100,7 +100,7 @@ load_properties_dialog (ECategoriesDialog *parent)
NULL);
prop_dialog->gui = gtk_builder_new ();
gtk_builder_set_translation_domain (prop_dialog->gui, GETTEXT_PACKAGE);
-
+
if (!gtk_builder_add_objects_from_file (prop_dialog->gui, uifile, (gchar **) ui_to_load, &error)) {
g_object_unref (prop_dialog->gui);
g_free (prop_dialog);
diff --git a/libedataserverui/e-name-selector-entry.c b/libedataserverui/e-name-selector-entry.c
index 1bcdfa2..2709739 100644
--- a/libedataserverui/e-name-selector-entry.c
+++ b/libedataserverui/e-name-selector-entry.c
@@ -1592,7 +1592,7 @@ sanitize_entry (ENameSelectorEntry *name_selector_entry)
static gboolean
user_focus_in (ENameSelectorEntry *name_selector_entry, GdkEventFocus *event_focus)
{
- int n;
+ gint n;
GList *l, *known;
GString *str = g_string_new ("");
EDestination *dest_dummy = e_destination_new ();
@@ -1605,7 +1605,7 @@ user_focus_in (ENameSelectorEntry *name_selector_entry, GdkEventFocus *event_foc
EDestination *dest = l->data;
if (dest) {
- char *text;
+ gchar *text;
text = get_destination_textrep (dest);
if (text) {
@@ -1618,14 +1618,14 @@ user_focus_in (ENameSelectorEntry *name_selector_entry, GdkEventFocus *event_foc
}
}
g_list_free (known);
-
+
/* Add a blank destination */
e_destination_store_append_destination (name_selector_entry->destination_store, dest_dummy);
if (str->str && str->str[0])
g_string_append (str, ", ");
gtk_entry_set_text (GTK_ENTRY (name_selector_entry), str->str);
-
+
g_string_free (str, TRUE);
g_signal_handlers_unblock_matched (name_selector_entry->destination_store, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, name_selector_entry);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]