[evolution-mapi] Whitespace and coding style cleanup.



commit 6961caa17de3a9f4a8708e74e8845e99284497f6
Author: Matthew Barnes <mbarnes redhat com>
Date:   Tue Apr 6 11:08:49 2010 -0400

    Whitespace and coding style cleanup.

 .../exchange-mapi-account-listener.c               |  172 ++--
 .../exchange-mapi-account-listener.h               |   26 +-
 .../exchange-mapi-account-settings.c               |   26 +-
 .../exchange-mapi-account-setup.c                  |  125 ++--
 .../exchange-mapi-account-setup.h                  |    5 +-
 src/addressbook/e-book-backend-mapi-factory.c      |    5 +-
 src/addressbook/e-book-backend-mapi-gal-factory.c  |    4 +-
 src/addressbook/e-book-backend-mapi-gal.c          |  273 +++---
 src/addressbook/e-book-backend-mapi-gal.h          |    4 +-
 src/addressbook/e-book-backend-mapi.c              |  612 ++++++------
 src/addressbook/e-book-backend-mapi.h              |    5 +-
 src/calendar/e-cal-backend-mapi-factory.c          |    6 +-
 src/calendar/e-cal-backend-mapi-factory.h          |    4 +-
 src/calendar/e-cal-backend-mapi.c                  |  535 +++++-----
 src/calendar/e-cal-backend-mapi.h                  |   12 +-
 src/camel/camel-mapi-folder.c                      |  581 ++++++------
 src/camel/camel-mapi-folder.h                      |   19 +-
 src/camel/camel-mapi-notifications.c               |   17 +-
 src/camel/camel-mapi-notifications.h               |    4 +-
 src/camel/camel-mapi-private.h                     |    2 +-
 src/camel/camel-mapi-provider.c                    |   25 +-
 src/camel/camel-mapi-store-summary.c               |  102 +-
 src/camel/camel-mapi-store-summary.h               |   22 +-
 src/camel/camel-mapi-store.c                       |  297 +++---
 src/camel/camel-mapi-store.h                       |   30 +-
 src/camel/camel-mapi-summary.c                     |   63 +-
 src/camel/camel-mapi-summary.h                     |   30 +-
 src/camel/camel-mapi-transport.c                   |   19 +-
 src/camel/camel-mapi-transport.h                   |    6 +-
 src/camel/camel-mapi-utils.c                       |  110 +--
 src/camel/camel-mapi-utils.h                       |    4 +-
 src/camel/camel-private.h                          |   27 +-
 .../exchange-mapi-cal-recur-utils.c                |  428 ++++----
 .../exchange-mapi-cal-recur-utils.h                |    2 +-
 src/libexchangemapi/exchange-mapi-cal-tz-utils.c   |   64 +-
 src/libexchangemapi/exchange-mapi-cal-tz-utils.h   |   12 +-
 src/libexchangemapi/exchange-mapi-cal-utils.c      | 1029 ++++++++++----------
 src/libexchangemapi/exchange-mapi-cal-utils.h      |  140 ++--
 src/libexchangemapi/exchange-mapi-connection.c     |  506 +++++-----
 src/libexchangemapi/exchange-mapi-connection.h     |  112 +--
 src/libexchangemapi/exchange-mapi-defs.h           |   53 +-
 src/libexchangemapi/exchange-mapi-folder.c         |   20 +-
 src/libexchangemapi/exchange-mapi-folder.h         |   12 +-
 src/libexchangemapi/exchange-mapi-utils.c          |  136 ++--
 src/libexchangemapi/exchange-mapi-utils.h          |   36 +-
 45 files changed, 2802 insertions(+), 2920 deletions(-)
---
diff --git a/src/account-setup-eplugin/exchange-mapi-account-listener.c b/src/account-setup-eplugin/exchange-mapi-account-listener.c
index 5a6fe57..7d05206 100644
--- a/src/account-setup-eplugin/exchange-mapi-account-listener.c
+++ b/src/account-setup-eplugin/exchange-mapi-account-listener.c
@@ -10,7 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/> 
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -39,7 +39,6 @@
 
 #include <libmapi/libmapi.h>
 
-
 /* FIXME: The mapi should not be needed in the include statement.
 LIMBAPI_CFLAGS or something is going wrong */
 
@@ -61,29 +60,29 @@ typedef struct _ExchangeMAPIAccountInfo ExchangeMAPIAccountInfo;
 
 /* stores some info about all currently existing mapi accounts */
 struct _ExchangeMAPIAccountInfo {
-	char *uid;
-	char *name;
-	char *source_url;
-	gboolean enabled; 
+	gchar *uid;
+	gchar *name;
+	gchar *source_url;
+	gboolean enabled;
 };
 
 /* list of ExchangeMAPIAccountInfo structures */
-static 	GList *mapi_accounts = NULL;
+static	GList *mapi_accounts = NULL;
 
 static GObjectClass *parent_class = NULL;
 
-static void 
+static void
 dispose (GObject *object)
 {
 	ExchangeMAPIAccountListener *config_listener = EXCHANGE_MAPI_ACCOUNT_LISTENER (object);
-	
+
 	g_object_unref (config_listener->priv->gconf_client);
 	g_object_unref (config_listener->priv->account_list);
 
 	G_OBJECT_CLASS (parent_class)->dispose (object);
 }
 
-static void 
+static void
 finalize (GObject *object)
 {
 	ExchangeMAPIAccountListener *config_listener = EXCHANGE_MAPI_ACCOUNT_LISTENER (object);
@@ -93,7 +92,7 @@ finalize (GObject *object)
 		g_free (config_listener->priv);
 	}
 
-	for (list = g_list_first (mapi_accounts); list ; list = g_list_next (list)) {
+	for (list = g_list_first (mapi_accounts); list; list = g_list_next (list)) {
 		ExchangeMAPIAccountInfo *info = (ExchangeMAPIAccountInfo *)(list->data);
 		if (info) {
 			g_free (info->uid);
@@ -102,32 +101,31 @@ finalize (GObject *object)
 			g_free (info);
 		}
 	}
-	
+
 	g_list_free (mapi_accounts);
 
 	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
-static void 
+static void
 exchange_mapi_account_listener_class_init (ExchangeMAPIAccountListenerClass *class)
 {
 	GObjectClass *object_class;
-	
+
 	parent_class = g_type_class_ref (G_TYPE_OBJECT);
 	object_class = G_OBJECT_CLASS (class);
-	
+
 	/* virtual method override */
 	object_class->dispose = dispose;
 	object_class->finalize = finalize;
 }
 
-static void 
+static void
 exchange_mapi_account_listener_init (ExchangeMAPIAccountListener *config_listener)
 {
 	config_listener->priv = g_new0 (ExchangeMAPIAccountListenerPrivate, 1);
 }
 
-
 /* This is a list of folders returned by e-d-s. */
 static	GSList *folders_list = NULL;
 
@@ -166,30 +164,30 @@ is_mapi_account (EAccount *account)
 
 /* looks up for an existing exchange account info in the mapi_accounts list based on uid */
 
-static ExchangeMAPIAccountInfo* 
-lookup_account_info (const char *key)
+static ExchangeMAPIAccountInfo*
+lookup_account_info (const gchar *key)
 {
 	GList *list;
 
-	g_return_val_if_fail (key != NULL, NULL); 
+	g_return_val_if_fail (key != NULL, NULL);
 
 	for (list = g_list_first (mapi_accounts); list; list = g_list_next (list)) {
 		ExchangeMAPIAccountInfo *info = (ExchangeMAPIAccountInfo *)(list->data);
 		if (g_ascii_strcasecmp (info->uid, key) == 0)
-			return info; 
+			return info;
 	}
 
 	return NULL;
 }
 
-#define CALENDAR_SOURCES 	"/apps/evolution/calendar/sources"
-#define TASK_SOURCES 		"/apps/evolution/tasks/sources"
-#define JOURNAL_SOURCES 	"/apps/evolution/memos/sources"
-#define SELECTED_CALENDARS 	"/apps/evolution/calendar/display/selected_calendars"
-#define SELECTED_TASKS 		"/apps/evolution/calendar/tasks/selected_tasks"
-#define SELECTED_JOURNALS 	"/apps/evolution/calendar/memos/selected_memos"
+#define CALENDAR_SOURCES	"/apps/evolution/calendar/sources"
+#define TASK_SOURCES		"/apps/evolution/tasks/sources"
+#define JOURNAL_SOURCES		"/apps/evolution/memos/sources"
+#define SELECTED_CALENDARS	"/apps/evolution/calendar/display/selected_calendars"
+#define SELECTED_TASKS		"/apps/evolution/calendar/tasks/selected_tasks"
+#define SELECTED_JOURNALS	"/apps/evolution/calendar/memos/selected_memos"
 
-#define ITIP_MESSAGE_HANDLING 	"/apps/evolution/itip/delete_processed"
+#define ITIP_MESSAGE_HANDLING	"/apps/evolution/itip/delete_processed"
 
 static void
 add_cal_esource (EAccount *account, GSList *folders, ExchangeMAPIFolderType folder_type, CamelURL *url)
@@ -197,15 +195,15 @@ add_cal_esource (EAccount *account, GSList *folders, ExchangeMAPIFolderType fold
 	ESourceList *source_list = NULL;
 	ESourceGroup *group = NULL;
 	const gchar *conf_key = NULL, *source_selection_key = NULL;
- 	GSList *temp_list = NULL;
+	GSList *temp_list = NULL;
 	GConfClient* client;
-	GSList *ids, *temp ;
+	GSList *ids, *temp;
 	gchar *base_uri = NULL;
 
-	if (folder_type == MAPI_FOLDER_TYPE_APPOINTMENT) { 
+	if (folder_type == MAPI_FOLDER_TYPE_APPOINTMENT) {
 		conf_key = CALENDAR_SOURCES;
 		source_selection_key = SELECTED_CALENDARS;
-	} else if (folder_type == MAPI_FOLDER_TYPE_TASK) { 
+	} else if (folder_type == MAPI_FOLDER_TYPE_TASK) {
 		conf_key = TASK_SOURCES;
 		source_selection_key = SELECTED_TASKS;
 	} else if (folder_type == MAPI_FOLDER_TYPE_MEMO) {
@@ -214,7 +212,7 @@ add_cal_esource (EAccount *account, GSList *folders, ExchangeMAPIFolderType fold
 	} else {
 		g_warning ("%s: %s: Unknown ExchangeMAPIFolderType\n", G_STRLOC, G_STRFUNC);
 		return;
-	} 
+	}
 
 	client = gconf_client_get_default ();
 	gconf_client_set_bool (client, ITIP_MESSAGE_HANDLING, TRUE, NULL);
@@ -235,7 +233,7 @@ add_cal_esource (EAccount *account, GSList *folders, ExchangeMAPIFolderType fold
 	e_source_group_set_property (group, "acl-owner-email", account->id->address);
 
 	for (temp_list = folders; temp_list != NULL; temp_list = g_slist_next (temp_list)) {
- 		ExchangeMAPIFolder *folder = temp_list->data;
+		ExchangeMAPIFolder *folder = temp_list->data;
 		ESource *source = NULL;
 		gchar *relative_uri = NULL, *fid = NULL;
 
@@ -253,10 +251,10 @@ add_cal_esource (EAccount *account, GSList *folders, ExchangeMAPIFolderType fold
 		e_source_set_property (source, "profile", camel_url_get_param (url, "profile"));
 		e_source_set_property (source, "domain", camel_url_get_param (url, "domain"));
 		e_source_set_property (source, "folder-id", fid);
-		e_source_set_property (source, "offline_sync", 
+		e_source_set_property (source, "offline_sync",
 					camel_url_get_param (url, "offline_sync") ? "1" : "0");
 
-		if (folder->is_default) 
+		if (folder->is_default)
 			e_source_set_property (source, "delete", "no");
 
 		if (folder->parent_folder_id) {
@@ -300,7 +298,7 @@ add_cal_esource (EAccount *account, GSList *folders, ExchangeMAPIFolderType fold
 	g_object_unref (client);
 }
 
-static void 
+static void
 remove_cal_esource (EAccount *existing_account_info, ExchangeMAPIFolderType folder_type, CamelURL *url)
 {
 	ESourceList *list;
@@ -312,10 +310,10 @@ remove_cal_esource (EAccount *existing_account_info, ExchangeMAPIFolderType fold
 	GSList *node_tobe_deleted;
 	gchar *base_uri;
 
-	if (folder_type == MAPI_FOLDER_TYPE_APPOINTMENT) { 
+	if (folder_type == MAPI_FOLDER_TYPE_APPOINTMENT) {
 		conf_key = CALENDAR_SOURCES;
 		source_selection_key = SELECTED_CALENDARS;
-	} else if (folder_type == MAPI_FOLDER_TYPE_TASK) { 
+	} else if (folder_type == MAPI_FOLDER_TYPE_TASK) {
 		conf_key = TASK_SOURCES;
 		source_selection_key = SELECTED_TASKS;
 	} else if (folder_type == MAPI_FOLDER_TYPE_MEMO) {
@@ -324,41 +322,41 @@ remove_cal_esource (EAccount *existing_account_info, ExchangeMAPIFolderType fold
 	} else {
 		g_warning ("%s: %s: Unknown ExchangeMAPIFolderType\n", G_STRLOC, G_STRFUNC);
 		return;
-	} 
+	}
 
 	client = gconf_client_get_default();
 	gconf_client_set_bool (client, ITIP_MESSAGE_HANDLING, FALSE, NULL);
 	list = e_source_list_new_for_gconf (client, conf_key);
-	groups = e_source_list_peek_groups (list); 
+	groups = e_source_list_peek_groups (list);
 
 	base_uri = g_strdup_printf ("mapi://%s %s/", url->user, url->host);
 
 	found_group = FALSE;
 
-	for ( ; groups != NULL && !found_group; groups = g_slist_next (groups)) {
+	for (; groups != NULL && !found_group; groups = g_slist_next (groups)) {
 		ESourceGroup *group = E_SOURCE_GROUP (groups->data);
 
-		if (strcmp (e_source_group_peek_name (group), existing_account_info->name) == 0 && 
+		if (strcmp (e_source_group_peek_name (group), existing_account_info->name) == 0 &&
 		    strcmp (e_source_group_peek_base_uri (group), base_uri) == 0) {
 			GSList *sources = e_source_group_peek_sources (group);
-			
-			for( ; sources != NULL; sources = g_slist_next (sources)) {
+
+			for (; sources != NULL; sources = g_slist_next (sources)) {
 				ESource *source = E_SOURCE (sources->data);
 
 				if (source_selection_key) {
-					ids = gconf_client_get_list (client, source_selection_key , 
+					ids = gconf_client_get_list (client, source_selection_key ,
 								     GCONF_VALUE_STRING, NULL);
 					node_tobe_deleted = g_slist_find_custom (ids, e_source_peek_uid (source), (GCompareFunc) strcmp);
 					if (node_tobe_deleted) {
 						g_free (node_tobe_deleted->data);
 						ids = g_slist_delete_link (ids, node_tobe_deleted);
 					}
-					gconf_client_set_list (client, source_selection_key, 
+					gconf_client_set_list (client, source_selection_key,
 							       GCONF_VALUE_STRING, ids, NULL);
 				}
 			}
 			e_source_list_remove_group (list, group);
-			e_source_list_sync (list, NULL);	
+			e_source_list_sync (list, NULL);
 			found_group = TRUE;
 			break;
 		}
@@ -366,13 +364,13 @@ remove_cal_esource (EAccount *existing_account_info, ExchangeMAPIFolderType fold
 
 	g_free (base_uri);
 	g_object_unref (list);
-	g_object_unref (client);		
+	g_object_unref (client);
 }
 
 /* add sources for calendar and tasks if the account added is exchange account
    adds the new account info to mapi_accounts list */
 
-static void 
+static void
 add_calendar_sources (EAccount *account, GSList *folders)
 {
 	CamelURL *url;
@@ -388,10 +386,10 @@ add_calendar_sources (EAccount *account, GSList *folders)
 	camel_url_free (url);
 }
 
-/* removes calendar and tasks sources if the account removed is exchange account 
+/* removes calendar and tasks sources if the account removed is exchange account
    removes the the account info from mapi_account list */
 
-static void 
+static void
 remove_calendar_sources (EAccount *account)
 {
 	CamelURL *url;
@@ -414,7 +412,7 @@ add_addressbook_sources (EAccount *account, GSList *folders)
 	ESourceList *list;
 	ESourceGroup *group;
 	ESource *source;
-	char *base_uri;
+	gchar *base_uri;
 	GSList *temp_list;
 	GConfClient* client;
 
@@ -433,8 +431,8 @@ add_addressbook_sources (EAccount *account, GSList *folders)
 	e_source_group_set_property (group, "domain", camel_url_get_param (url, "domain"));
 
 	for (temp_list = folders; temp_list != NULL; temp_list = g_slist_next (temp_list)) {
- 		ExchangeMAPIFolder *folder = temp_list->data;
-		char *tmp = NULL;
+		ExchangeMAPIFolder *folder = temp_list->data;
+		gchar *tmp = NULL;
 		if (folder->container_class != MAPI_FOLDER_TYPE_CONTACT)
 			continue;
 
@@ -448,10 +446,10 @@ add_addressbook_sources (EAccount *account, GSList *folders)
 		tmp = exchange_mapi_util_mapi_id_to_string (folder->folder_id);
 		e_source_set_property(source, "folder-id", tmp);
 		g_free (tmp);
-		e_source_set_property (source, "offline_sync", 
+		e_source_set_property (source, "offline_sync",
 					       camel_url_get_param (url, "offline_sync") ? "1" : "0");
 		e_source_set_property (source, "completion", "true");
-		if (folder->is_default) 
+		if (folder->is_default)
 			e_source_set_property (source, "delete", "no");
 		if (folder->parent_folder_id) {
 			gchar *tmp = exchange_mapi_util_mapi_id_to_string (folder->parent_folder_id);
@@ -464,7 +462,7 @@ add_addressbook_sources (EAccount *account, GSList *folders)
 
 	//Add GAL
 	{
-		char *uri;
+		gchar *uri;
 
 		uri = g_strdup_printf("mapigal://%s %s/;Global Address List", url->user, url->host);
 		source = e_source_new_with_absolute_uri ("Global Address List", uri);
@@ -498,7 +496,7 @@ add_addressbook_sources (EAccount *account, GSList *folders)
 	return TRUE;
 }
 
-static void 
+static void
 remove_addressbook_sources (ExchangeMAPIAccountInfo *existing_account_info)
 {
 	ESourceList *list;
@@ -506,7 +504,7 @@ remove_addressbook_sources (ExchangeMAPIAccountInfo *existing_account_info)
 	GSList *groups;
 	gboolean found_group;
 	CamelURL *url;
-	char *base_uri;
+	gchar *base_uri;
 	GConfClient *client;
 
 	url = camel_url_new (existing_account_info->source_url, NULL);
@@ -517,11 +515,11 @@ remove_addressbook_sources (ExchangeMAPIAccountInfo *existing_account_info)
 	base_uri = g_strdup_printf ("mapi://%s %s/", url->user, url->host);
 	client = gconf_client_get_default ();
 	list = e_source_list_new_for_gconf (client, "/apps/evolution/addressbook/sources" );
-	groups = e_source_list_peek_groups (list); 
+	groups = e_source_list_peek_groups (list);
 
 	found_group = FALSE;
 
-	for ( ; groups != NULL && !found_group; groups = g_slist_next (groups)) {
+	for (; groups != NULL && !found_group; groups = g_slist_next (groups)) {
 
 		group = E_SOURCE_GROUP (groups->data);
 		if ( strcmp ( e_source_group_peek_base_uri (group), base_uri) == 0 && strcmp (e_source_group_peek_name (group), existing_account_info->name) == 0) {
@@ -550,7 +548,7 @@ mapi_account_added (EAccountList *account_listener, EAccount *account)
 	info->uid = g_strdup (account->uid);
 	info->name = g_strdup (account->name);
 	info->source_url = g_strdup (account->source->url);
-	info->enabled = account->enabled; 
+	info->enabled = account->enabled;
 
 	mapi_accounts = g_list_append (mapi_accounts, info);
 
@@ -564,7 +562,7 @@ mapi_account_added (EAccountList *account_listener, EAccount *account)
 	}
 }
 
-static void 
+static void
 mapi_account_removed (EAccountList *account_listener, EAccount *account)
 {
 	ExchangeMAPIAccountInfo *info = NULL;
@@ -575,13 +573,13 @@ mapi_account_removed (EAccountList *account_listener, EAccount *account)
 
 	/* We store a complete list of MAPI accounts - both enabled and disabled */
 	info = lookup_account_info (account->uid);
-	g_return_if_fail (info != NULL);  
+	g_return_if_fail (info != NULL);
 
 	/* Remove from the local MAPI accounts list */
 	mapi_accounts = g_list_remove (mapi_accounts, info);
 
 	/* If the account was disabled, then the corresponding ESource should have been removed
-	 * when the account was disabled. We should only clean up the MAPI profile database etc. 
+	 * when the account was disabled. We should only clean up the MAPI profile database etc.
 	 */
 	if (info->enabled) {
 		remove_addressbook_sources (info);
@@ -591,11 +589,11 @@ mapi_account_removed (EAccountList *account_listener, EAccount *account)
 	/* Now, clean up the profile database etc */
 	url = camel_url_new (info->source_url, NULL);
 	if (url != NULL) {
-		const char *profile = camel_url_get_param (url, "profile");
+		const gchar *profile = camel_url_get_param (url, "profile");
 		gchar *key = camel_url_to_string (url, CAMEL_URL_HIDE_PASSWORD | CAMEL_URL_HIDE_PARAMS);
 		exchange_mapi_delete_profile (profile);
-		e_passwords_forget_password (EXCHANGE_MAPI_PASSWORD_COMPONENT, key); 
-		g_free (key); 
+		e_passwords_forget_password (EXCHANGE_MAPI_PASSWORD_COMPONENT, key);
+		g_free (key);
 		camel_url_free (url);
 	}
 
@@ -610,7 +608,7 @@ static gboolean
 create_profile_entry (CamelURL *url, EAccount *account)
 {
 	gboolean status = FALSE;
-	guint8 attempts = 0; 
+	guint8 attempts = 0;
 
 	while (!status && attempts <= 3) {
 		gchar *password = NULL, *key = NULL;
@@ -626,20 +624,20 @@ create_profile_entry (CamelURL *url, EAccount *account)
 					E_PASSWORDS_REMEMBER_FOREVER|E_PASSWORDS_SECRET,
 					&remember, NULL);
 			g_free (title);
-		} 
+		}
 		g_free (key);
 
 		if (password)
 		  status = exchange_mapi_create_profile (url->user, password, camel_url_get_param (url, "domain"), url->host, NULL, NULL, NULL);
 
-		++attempts; 
+		++attempts;
 	}
 
-	return status; 
+	return status;
 }
 
 static gboolean
-check_equal (const char *a, const char *b)
+check_equal (const gchar *a, const gchar *b)
 {
 	if (!a && a == b)
 		return TRUE;
@@ -650,7 +648,7 @@ check_equal (const char *a, const char *b)
 static gboolean
 mapi_camel_url_equal (CamelURL *a, CamelURL *b)
 {
-	const char *params[] = { "profile", "domain", "ad_limit", "ad_server" };
+	const gchar *params[] = { "profile", "domain", "ad_limit", "ad_server" };
 	guint n_params = G_N_ELEMENTS (params), i;
 	gboolean retval = TRUE;
 
@@ -675,15 +673,15 @@ mapi_account_changed (EAccountList *account_listener, EAccount *account)
 		existing_account_info = lookup_account_info (account->uid);
 
 	if (existing_account_info)
-		old_url = camel_url_new (existing_account_info->source_url, NULL); 
+		old_url = camel_url_new (existing_account_info->source_url, NULL);
 
-	new_url = camel_url_new (account->source->url, NULL); 
+	new_url = camel_url_new (account->source->url, NULL);
 
 	if (existing_account_info == NULL && isa_mapi_account) {
 		/* some account of other type is changed to MAPI */
 		if (create_profile_entry (new_url, account)) {
 			/* Things are successful */
-			gchar *profname = NULL, *uri = NULL; 
+			gchar *profname = NULL, *uri = NULL;
 			ExchangeMAPIAccountListener *config_listener = exchange_mapi_accounts_peek_config_listener();
 
 			profname = exchange_mapi_util_profile_name (new_url->user, camel_url_get_param (new_url, "domain"));
@@ -694,10 +692,10 @@ mapi_account_changed (EAccountList *account_listener, EAccount *account)
 			/* FIXME: Find a better way to append to the Account source URL. The current
 			 * method uses e_account_set_string() which initiates another signal emmission
 			 * which we have to block for now. */
-			g_signal_handlers_block_by_func (config_listener->priv->account_list, G_CALLBACK (mapi_account_changed), NULL); 
+			g_signal_handlers_block_by_func (config_listener->priv->account_list, G_CALLBACK (mapi_account_changed), NULL);
 			e_account_set_string (account, E_ACCOUNT_SOURCE_URL, uri);
 			e_account_set_string (account, E_ACCOUNT_TRANSPORT_URL, uri);
-			g_signal_handlers_unblock_by_func (config_listener->priv->account_list, G_CALLBACK (mapi_account_changed), NULL); 
+			g_signal_handlers_unblock_by_func (config_listener->priv->account_list, G_CALLBACK (mapi_account_changed), NULL);
 			g_free (uri);
 
 			mapi_account_added (account_listener, account);
@@ -716,7 +714,7 @@ mapi_account_changed (EAccountList *account_listener, EAccount *account)
 			mapi_account_removed (account_listener, account);
 			if (create_profile_entry (new_url, account)) {
 				/* Things are successful */
-				gchar *profname = NULL, *uri = NULL; 
+				gchar *profname = NULL, *uri = NULL;
 				ExchangeMAPIAccountListener *config_listener = exchange_mapi_accounts_peek_config_listener();
 
 				profname = exchange_mapi_util_profile_name (new_url->user, camel_url_get_param (new_url, "domain"));
@@ -727,10 +725,10 @@ mapi_account_changed (EAccountList *account_listener, EAccount *account)
 				/* FIXME: Find a better way to append to the Account source URL. The current
 				 * method uses e_account_set_string() which initiates another signal emmission
 				 * which we have to block for now. */
-				g_signal_handlers_block_by_func (config_listener->priv->account_list, G_CALLBACK (mapi_account_changed), NULL); 
+				g_signal_handlers_block_by_func (config_listener->priv->account_list, G_CALLBACK (mapi_account_changed), NULL);
 				e_account_set_string (account, E_ACCOUNT_SOURCE_URL, uri);
 				e_account_set_string (account, E_ACCOUNT_TRANSPORT_URL, uri);
-				g_signal_handlers_unblock_by_func (config_listener->priv->account_list, G_CALLBACK (mapi_account_changed), NULL); 
+				g_signal_handlers_unblock_by_func (config_listener->priv->account_list, G_CALLBACK (mapi_account_changed), NULL);
 				g_free (uri);
 
 				mapi_account_added (account_listener, account);
@@ -739,10 +737,10 @@ mapi_account_changed (EAccountList *account_listener, EAccount *account)
 	}
 
 	if (old_url)
-		camel_url_free (old_url); 
+		camel_url_free (old_url);
 
-	camel_url_free (new_url); 
-} 
+	camel_url_free (new_url);
+}
 
 static void
 exchange_mapi_account_listener_construct (ExchangeMAPIAccountListener *config_listener)
@@ -758,7 +756,7 @@ exchange_mapi_account_listener_construct (ExchangeMAPIAccountListener *config_li
 			info->uid = g_strdup (account->uid);
 			info->name = g_strdup (account->name);
 			info->source_url = g_strdup (account->source->url);
-			info->enabled = account->enabled; 
+			info->enabled = account->enabled;
 			mapi_accounts = g_list_append (mapi_accounts, info);
 		}
 	}
diff --git a/src/account-setup-eplugin/exchange-mapi-account-listener.h b/src/account-setup-eplugin/exchange-mapi-account-listener.h
index 709e170..cace30a 100644
--- a/src/account-setup-eplugin/exchange-mapi-account-listener.h
+++ b/src/account-setup-eplugin/exchange-mapi-account-listener.h
@@ -10,7 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -28,15 +28,15 @@
 
 G_BEGIN_DECLS
 
-#define EXCHANGE_MAPI_ACCOUNT_LISTENER_TYPE 		(exchange_mapi_account_listener_get_type ())
-#define EXCHANGE_MAPI_ACCOUNT_LISTENER(obj) 		(G_TYPE_CHECK_INSTANCE_CAST ((obj), EXCHANGE_MAPI_ACCOUNT_LISTENER_TYPE, ExchangeMAPIAccountListener))
-#define EXCHANGE_MAPI_ACCOUNT_LISTENER_CLASS(klass) 	(G_TYPE_CHECK_CLASS_CAST ((klass), EXCHANGE_MAPI_ACCOUNT_LISTENER_TYPE,  ExchangeMAPIAccountListenerClass))
-#define EXCHANGE_MAPI_IS_ACCOUNT_LISTENER(obj) 		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXCHANGE_MAPI_ACCOUNT_LISTENER_TYPE))
-#define EXCHANGE_MAPI_IS_ACCOUNT_LISTENER_CLASS(klass) 	(G_TYPE_CHECK_CLASS_TYPE ((obj), EXCHANGE_MAPI_ACCOUNT_LISTENER_TYPE))
+#define EXCHANGE_MAPI_ACCOUNT_LISTENER_TYPE		(exchange_mapi_account_listener_get_type ())
+#define EXCHANGE_MAPI_ACCOUNT_LISTENER(obj)		(G_TYPE_CHECK_INSTANCE_CAST ((obj), EXCHANGE_MAPI_ACCOUNT_LISTENER_TYPE, ExchangeMAPIAccountListener))
+#define EXCHANGE_MAPI_ACCOUNT_LISTENER_CLASS(klass)	(G_TYPE_CHECK_CLASS_CAST ((klass), EXCHANGE_MAPI_ACCOUNT_LISTENER_TYPE,  ExchangeMAPIAccountListenerClass))
+#define EXCHANGE_MAPI_IS_ACCOUNT_LISTENER(obj)		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXCHANGE_MAPI_ACCOUNT_LISTENER_TYPE))
+#define EXCHANGE_MAPI_IS_ACCOUNT_LISTENER_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE ((obj), EXCHANGE_MAPI_ACCOUNT_LISTENER_TYPE))
 
-typedef struct _ExchangeMAPIAccountListener 		ExchangeMAPIAccountListener;
-typedef struct _ExchangeMAPIAccountListenerClass 	ExchangeMAPIAccountListenerClass;
-typedef struct _ExchangeMAPIAccountListenerPrivate 	ExchangeMAPIAccountListenerPrivate;
+typedef struct _ExchangeMAPIAccountListener		ExchangeMAPIAccountListener;
+typedef struct _ExchangeMAPIAccountListenerClass	ExchangeMAPIAccountListenerClass;
+typedef struct _ExchangeMAPIAccountListenerPrivate	ExchangeMAPIAccountListenerPrivate;
 
 struct _ExchangeMAPIAccountListener {
 	GObject parent;
@@ -47,11 +47,11 @@ struct _ExchangeMAPIAccountListenerClass {
 	GObjectClass parent_class;
 };
 
-GType 				exchange_mapi_account_listener_get_type (void);
+GType				exchange_mapi_account_listener_get_type (void);
 ExchangeMAPIAccountListener *	exchange_mapi_account_listener_new (void);
-GSList *			exchange_mapi_account_listener_peek_folder_list (void); 
-void 				exchange_mapi_account_listener_get_folder_list (void);
-void 				exchange_mapi_account_listener_free_folder_list (void);
+GSList *			exchange_mapi_account_listener_peek_folder_list (void);
+void				exchange_mapi_account_listener_get_folder_list (void);
+void				exchange_mapi_account_listener_free_folder_list (void);
 
 G_END_DECLS
 
diff --git a/src/account-setup-eplugin/exchange-mapi-account-settings.c b/src/account-setup-eplugin/exchange-mapi-account-settings.c
index 7d7bb09..3d31be6 100644
--- a/src/account-setup-eplugin/exchange-mapi-account-settings.c
+++ b/src/account-setup-eplugin/exchange-mapi-account-settings.c
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -93,25 +93,25 @@ mapi_settings_get_folder_size (gpointer data)
 		/*Tree View */
 		view =  gtk_tree_view_new ();
 		renderer = gtk_cell_renderer_text_new ();
-		gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view),-1, 
+		gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view),-1,
 							     _("Folder"), renderer, "text", COL_FOLDERSIZE_NAME,
 							     NULL);
-		
+
 		renderer = gtk_cell_renderer_text_new ();
-		gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view),-1, 
+		gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view),-1,
 							     _("Size"), renderer, "text", COL_FOLDERSIZE_SIZE,
 							     NULL);
 		/* Model for TreeView */
 		store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
 		gtk_tree_view_set_model (GTK_TREE_VIEW (view), GTK_TREE_MODEL (store));
-		
+
 		/* Populate model with data */
 		while (folder_list) {
 			ExchangeMAPIFolder *folder = (ExchangeMAPIFolder *) folder_list->data;
 			gchar *folder_size = g_format_size_for_display (folder->size);
-			
+
 			gtk_list_store_append (store, &iter);
-			gtk_list_store_set (store, &iter, 
+			gtk_list_store_set (store, &iter,
 					    COL_FOLDERSIZE_NAME, folder->folder_name,
 					    COL_FOLDERSIZE_SIZE, folder_size,
 					    -1);
@@ -126,7 +126,7 @@ mapi_settings_get_folder_size (gpointer data)
 
 	/* Pack into content_area */
 	content_area = (GtkBox*) gtk_dialog_get_content_area (dialog_data->dialog);
-	gtk_box_pack_start (content_area, view, TRUE, TRUE, 6);	
+	gtk_box_pack_start (content_area, view, TRUE, TRUE, 6);
 
 	return FALSE;
 }
@@ -140,7 +140,7 @@ mapi_settings_run_folder_size_dialog (gpointer data)
 
 	dialog_data = g_new0 (FolderSizeDialogData, 1);
 
-	dialog_data->dialog = (GtkDialog *)gtk_dialog_new_with_buttons (_("Folder Size"), NULL, 
+	dialog_data->dialog = (GtkDialog *)gtk_dialog_new_with_buttons (_("Folder Size"), NULL,
 							   GTK_DIALOG_DESTROY_WITH_PARENT,
 							   GTK_STOCK_CLOSE, GTK_RESPONSE_ACCEPT,
 							   NULL);
@@ -220,14 +220,14 @@ folder_size_actions_update_cb (EShellView *shell_view, GtkActionEntry *entries)
 
 	ui_manager = e_shell_window_get_ui_manager (shell_window);
 	action_group = e_lookup_action_group (ui_manager, "mail");
-		
-	folder_size_action = gtk_action_group_get_action (action_group, 
+
+	folder_size_action = gtk_action_group_get_action (action_group,
 							  "mail-mapi-folder-size");
 
 	/* Show / Hide action entry */
 	if (g_str_has_prefix (folder_uri, "mapi://"))
 		gtk_action_set_visible (folder_size_action , TRUE);
-	else 
+	else
 		gtk_action_set_visible (folder_size_action , FALSE);
 
 }
@@ -270,7 +270,7 @@ org_gnome_exchange_mapi_settings (EPlugin *epl, EConfigHookItemFactoryData *data
 	gtk_container_set_border_width (GTK_CONTAINER (vbox_misc), 6);
 	gtk_container_add (GTK_CONTAINER (frm_misc), GTK_WIDGET (vbox_misc));
 
-	tbl_misc = (GtkTable*) g_object_new (GTK_TYPE_TABLE, "n-rows", 1, "n-columns", 1, 
+	tbl_misc = (GtkTable*) g_object_new (GTK_TYPE_TABLE, "n-rows", 1, "n-columns", 1,
 					     "homogeneous", FALSE, "row-spacing", 6,
 					     "column-spacing", 6, NULL);
 
diff --git a/src/account-setup-eplugin/exchange-mapi-account-setup.c b/src/account-setup-eplugin/exchange-mapi-account-setup.c
index bec47d8..3e6a4b5 100644
--- a/src/account-setup-eplugin/exchange-mapi-account-setup.c
+++ b/src/account-setup-eplugin/exchange-mapi-account-setup.c
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -46,7 +46,7 @@
 
 #define d(x) x
 
-int e_plugin_lib_enable (EPlugin *ep, int enable);
+gint e_plugin_lib_enable (EPlugin *ep, gint enable);
 
 /* Account Setup */
 GtkWidget *org_gnome_exchange_mapi_account_setup (EPlugin *epl, EConfigHookItemFactoryData *data);
@@ -63,23 +63,22 @@ void exchange_mapi_book_commit (EPlugin *epl, EConfigTarget *target);
 gboolean exchange_mapi_cal_check (EPlugin *epl, EConfigHookPageCheckData *data);
 void exchange_mapi_cal_commit (EPlugin *epl, EConfigTarget *target);
 
-
 static ExchangeMAPIAccountListener *config_listener = NULL;
 
-static void 
+static void
 free_mapi_listener ( void )
 {
 	g_object_unref (config_listener);
 }
 
-int
-e_plugin_lib_enable (EPlugin *ep, int enable)
+gint
+e_plugin_lib_enable (EPlugin *ep, gint enable)
 {
 	g_debug ("Loading Exchange MAPI Plugin \n");
 
 	if (!config_listener) {
 		config_listener = exchange_mapi_account_listener_new ();
-	 	g_atexit ( free_mapi_listener );
+		g_atexit ( free_mapi_listener );
 	}
 
 	return 0;
@@ -88,7 +87,7 @@ e_plugin_lib_enable (EPlugin *ep, int enable)
 ExchangeMAPIAccountListener *
 exchange_mapi_accounts_peek_config_listener ()
 {
-	return config_listener; 
+	return config_listener;
 }
 
 enum {
@@ -98,7 +97,7 @@ enum {
   COLS_MAX
 };
 
-/* Callback for ProcessNetworkProfile. If we have more than one username, 
+/* Callback for ProcessNetworkProfile. If we have more than one username,
  we need to let the user select. */
 static uint32_t
 create_profile_callback (struct SRowSet *rowset, gpointer data)
@@ -143,7 +142,7 @@ create_profile_callback (struct SRowSet *rowset, gpointer data)
 
 	renderer = gtk_cell_renderer_text_new ();
 	gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view),
-						     -1, _("User name"), renderer, 
+						     -1, _("User name"), renderer,
 						     "text", COL_MAPI_ACCOUNT, NULL);
 
 	/* Model for TreeView */
@@ -175,7 +174,7 @@ create_profile_callback (struct SRowSet *rowset, gpointer data)
 	       /* Get the index from the selected value */
 		selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
 		gtk_tree_selection_get_selected (selection, NULL, &iter);
-		gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, COL_MAPI_INDEX, 
+		gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, COL_MAPI_INDEX,
 				    &index, -1);
 	} else /* If we return a value > available, we are canceling the login.*/
 	       index = rowset->cRows + 1;
@@ -190,8 +189,8 @@ validate_credentials (GtkWidget *widget, EConfig *config)
 {
 	EMConfigTargetAccount *target_account = (EMConfigTargetAccount *)(config->target);
 	CamelURL *url = NULL;
- 	gchar *key = NULL, *password = NULL;
-	const gchar *domain_name = NULL; 
+	gchar *key = NULL, *password = NULL;
+	const gchar *domain_name = NULL;
 
 	url = camel_url_new (e_account_get_string (target_account->account, E_ACCOUNT_SOURCE_URL), NULL);
 	domain_name = camel_url_get_param (url, "domain");
@@ -228,14 +227,14 @@ validate_credentials (GtkWidget *widget, EConfig *config)
 
 	/*Can there be a account without password ?*/
 	if (password && *password && domain_name && *domain_name && *url->user && *url->host) {
-		char *error_msg = NULL;
+		gchar *error_msg = NULL;
 		gboolean status = exchange_mapi_create_profile (url->user, password, domain_name,
-								url->host, &error_msg, 
+								url->host, &error_msg,
 								(mapi_profile_callback_t) create_profile_callback,
 								url->user);
 		if (status) {
 			/* Things are successful */
-			gchar *profname = NULL, *uri = NULL; 
+			gchar *profname = NULL, *uri = NULL;
 
 			profname = exchange_mapi_util_profile_name (url->user, domain_name);
 			camel_url_set_param(url, "profile", profname);
@@ -248,7 +247,7 @@ validate_credentials (GtkWidget *widget, EConfig *config)
 
 			e_notice (NULL, GTK_MESSAGE_INFO, "%s", _("Authentication finished successfully."));
 		} else {
-			char *e;
+			gchar *e;
 
 			e_passwords_forget_password (EXCHANGE_MAPI_PASSWORD_COMPONENT, key);
 
@@ -275,8 +274,8 @@ domain_entry_changed(GtkWidget *entry, EConfig *config)
 {
 	EMConfigTargetAccount *target = (EMConfigTargetAccount *)(config->target);
 	CamelURL *url = NULL;
-	const char *domain = NULL;
-	char *url_string = NULL;
+	const gchar *domain = NULL;
+	gchar *url_string = NULL;
 
 	url = camel_url_new (e_account_get_string(target->account, E_ACCOUNT_SOURCE_URL), NULL);
 	domain = gtk_entry_get_text (GTK_ENTRY(entry));
@@ -306,14 +305,14 @@ org_gnome_exchange_mapi_account_setup (EPlugin *epl, EConfigHookItemFactoryData
 
 	/* is NULL on New Account creation */
 	if (url == NULL)
-		return NULL; 
+		return NULL;
 
 	if (!g_ascii_strcasecmp (url->protocol, "mapi")) {
 		GtkWidget *label;
 		GtkWidget *domain_name;
 		GtkWidget *auth_button;
-		const char *domain_value = camel_url_get_param (url, "domain");
-		int row = ((GtkTable *)data->parent)->nrows;
+		const gchar *domain_value = camel_url_get_param (url, "domain");
+		gint row = ((GtkTable *)data->parent)->nrows;
 
 		/* Domain name & Authenticate Button */
 		hbox = gtk_hbox_new (FALSE, 6);
@@ -333,7 +332,7 @@ org_gnome_exchange_mapi_account_setup (EPlugin *epl, EConfigHookItemFactoryData
 
 		gtk_table_attach (GTK_TABLE (data->parent), label, 0, 1, row, row+1, 0, 0, 0, 0);
 		gtk_widget_show_all (GTK_WIDGET (hbox));
-		gtk_table_attach (GTK_TABLE (data->parent), GTK_WIDGET (hbox), 1, 2, row, row+1, GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0); 
+		gtk_table_attach (GTK_TABLE (data->parent), GTK_WIDGET (hbox), 1, 2, row, row+1, GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
 	}
 
 	camel_url_free (url);
@@ -347,19 +346,19 @@ org_gnome_exchange_mapi_check_options(EPlugin *epl, EConfigHookPageCheckData *da
 	gboolean status = TRUE;
 
 	if (data->pageid != NULL && g_ascii_strcasecmp (data->pageid, "10.receive") == 0) {
-		CamelURL *url = camel_url_new (e_account_get_string(target->account,  
+		CamelURL *url = camel_url_new (e_account_get_string(target->account,
 								    E_ACCOUNT_SOURCE_URL), NULL);
 
 		if (url && url->protocol && g_ascii_strcasecmp (url->protocol, "mapi") == 0) {
 			const gchar *prof = NULL;
 
 			/* We assume that if the profile is set, then the setting is valid. */
- 			prof = camel_url_get_param (url, "profile");
+			prof = camel_url_get_param (url, "profile");
 
 			/*Profile not set. Do not proceed with account creation.*/
 			if (!(prof && *prof))
-			        status = FALSE;
-		} 
+				status = FALSE;
+		}
 
 		if (url)
 			camel_url_free(url);
@@ -375,7 +374,6 @@ enum {
 	NUM_COLS
 };
 
-
 static gboolean
 check_node (GtkTreeStore *ts, ExchangeMAPIFolder *folder, GtkTreeIter *iter)
 {
@@ -384,13 +382,13 @@ check_node (GtkTreeStore *ts, ExchangeMAPIFolder *folder, GtkTreeIter *iter)
 	gboolean status = FALSE;
 
 	ts_model = GTK_TREE_MODEL (ts);
-	
+
 	gtk_tree_model_get (ts_model, iter, 1, &fid, -1);
 	if (fid && folder->parent_folder_id == fid) {
 		/* Do something */
 		GtkTreeIter node;
-		gtk_tree_store_append (ts, &node, iter);		
-		gtk_tree_store_set (ts, &node, 0, folder->folder_name, 1, folder->folder_id, 2, folder,-1);		
+		gtk_tree_store_append (ts, &node, iter);
+		gtk_tree_store_set (ts, &node, 0, folder->folder_name, 1, folder->folder_id, 2, folder,-1);
 		return TRUE;
 	}
 
@@ -414,13 +412,13 @@ add_to_store (GtkTreeStore *ts, ExchangeMAPIFolder *folder)
 	GtkTreeIter iter;
 
 	ts_model = GTK_TREE_MODEL (ts);
-	
+
 	gtk_tree_model_get_iter_first (ts_model, &iter);
 	if (!check_node (ts, folder, &iter)) {
 		GtkTreeIter node;
-		gtk_tree_store_append (ts, &node, &iter);		
+		gtk_tree_store_append (ts, &node, &iter);
 		gtk_tree_store_set (ts, &node, 0, folder->folder_name, 1, folder->folder_id, -1);
-		
+
 	}
 }
 
@@ -429,8 +427,8 @@ add_folders (GSList *folders, GtkTreeStore *ts)
 {
 	GSList *tmp = folders;
 	GtkTreeIter iter;
-	char *node = _("Personal Folders");
-	
+	gchar *node = _("Personal Folders");
+
 	gtk_tree_store_append (ts, &iter, NULL);
 	gtk_tree_store_set (ts, &iter, 0, node, -1);
 	while (tmp) {
@@ -448,13 +446,13 @@ exchange_mapi_cursor_change (GtkTreeView *treeview, ESource *source)
 	GtkTreeIter       iter;
 	mapi_id_t pfid;
 	gchar *sfid=NULL;
-	
+
 	selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview));
 	gtk_tree_selection_get_selected(selection, &model, &iter);
 
 	gtk_tree_model_get (model, &iter, CONTACTSFID_COL, &pfid, -1);
 	sfid = exchange_mapi_util_mapi_id_to_string (pfid);
-	e_source_set_property (source, "parent-fid", sfid); 
+	e_source_set_property (source, "parent-fid", sfid);
 	g_free (sfid);
 }
 
@@ -464,11 +462,11 @@ exchange_mapi_create (EPlugin *epl, EConfigHookItemFactoryData *data)
 	GtkWidget *vbox, *label, *scroll, *tv;
 	EABConfigTargetSource *t = (EABConfigTargetSource *) data->target;
 	ESource *source = t->source;
-	char *uri_text;
+	gchar *uri_text;
 	GtkCellRenderer *rcell;
 	GtkTreeStore *ts;
 	GtkTreeViewColumn *tvc;
-	const char *acc;
+	const gchar *acc;
 	GSList *folders;
 
 	uri_text = e_source_get_uri (source);
@@ -481,11 +479,11 @@ exchange_mapi_create (EPlugin *epl, EConfigHookItemFactoryData *data)
 	ts = gtk_tree_store_new (NUM_COLS, G_TYPE_STRING, G_TYPE_INT64, G_TYPE_POINTER);
 
 	add_folders (folders, ts);
-	
+
 	vbox = gtk_vbox_new (FALSE, 6);
 
 	if (!strcmp (data->config->id, "org.gnome.evolution.calendar.calendarProperties")) {
-		int row = ((GtkTable*) data->parent)->nrows;
+		gint row = ((GtkTable*) data->parent)->nrows;
 		gtk_table_attach (GTK_TABLE (data->parent), vbox, 0, 2, row+1, row+2, GTK_FILL|GTK_EXPAND, 0, 0, 0);
 	} else if (!strcmp (data->config->id, "com.novell.evolution.addressbook.config.accountEditor")) {
 		gtk_container_add (GTK_CONTAINER (data->parent), vbox);
@@ -495,14 +493,14 @@ exchange_mapi_create (EPlugin *epl, EConfigHookItemFactoryData *data)
 	gtk_widget_show (label);
 	gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
 	gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
-	
+
 	rcell = gtk_cell_renderer_text_new ();
 	tvc = gtk_tree_view_column_new_with_attributes (acc, rcell, "text", CONTACTSNAME_COL, NULL);
 	tv = gtk_tree_view_new_with_model (GTK_TREE_MODEL (ts));
 	gtk_tree_view_append_column (GTK_TREE_VIEW (tv), tvc);
 	g_object_set (tv,"expander-column", tvc, "headers-visible", TRUE, NULL);
 	gtk_tree_view_expand_all (GTK_TREE_VIEW (tv));
-	
+
 	scroll = gtk_scrolled_window_new (NULL, NULL);
 	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
 	gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroll), GTK_SHADOW_IN);
@@ -523,7 +521,7 @@ exchange_mapi_book_check (EPlugin *epl, EConfigHookPageCheckData *data)
 {
 	EABConfigTargetSource *t = (EABConfigTargetSource *) data->target;
 	ESource *source = t->source;
-	char *uri_text = e_source_get_uri (source);
+	gchar *uri_text = e_source_get_uri (source);
 
 	if (!uri_text)
 		return TRUE;
@@ -546,18 +544,18 @@ exchange_mapi_book_check (EPlugin *epl, EConfigHookPageCheckData *data)
 	return TRUE;
 }
 
-void 
+void
 exchange_mapi_book_commit (EPlugin *epl, EConfigTarget *target)
 {
 	EABConfigTargetSource *t = (EABConfigTargetSource *) target;
 	ESource *source = t->source;
-	char *uri_text;
+	gchar *uri_text;
 	ESourceGroup *grp;
-	
+
 	uri_text = e_source_get_uri (source);
 	if (uri_text && g_ascii_strncasecmp (uri_text, MAPI_URI_PREFIX, MAPI_PREFIX_LENGTH))
 		return;
-	
+
 	//FIXME: Offline handling
 	grp = e_source_peek_group (source);
 	e_source_set_property (source, "auth", "plain/password");
@@ -574,24 +572,23 @@ exchange_mapi_book_commit (EPlugin *epl, EConfigTarget *target)
 	return;
 }
 
-
 /* New calendar/task list/memo list */
 gboolean
 exchange_mapi_cal_check (EPlugin *epl, EConfigHookPageCheckData *data)
 {
 	ECalConfigTargetSource *t = (ECalConfigTargetSource *)(data->target);
 	ESource *source = t->source;
-	char *uri_text = e_source_get_uri (source);
+	gchar *uri_text = e_source_get_uri (source);
 
 	if (!uri_text)
-		return TRUE; 
+		return TRUE;
 
 	/* FIXME: Offline handling */
 
 	/* not a MAPI account */
 	if (g_ascii_strncasecmp (uri_text, MAPI_URI_PREFIX, MAPI_PREFIX_LENGTH)) {
-		g_free (uri_text); 
-		return TRUE; 
+		g_free (uri_text);
+		return TRUE;
 	}
 
 	g_free (uri_text);
@@ -605,7 +602,7 @@ exchange_mapi_cal_check (EPlugin *epl, EConfigHookPageCheckData *data)
 	return TRUE;
 }
 
-void 
+void
 exchange_mapi_cal_commit (EPlugin *epl, EConfigTarget *target)
 {
 	ECalConfigTargetSource *t = (ECalConfigTargetSource *) target;
@@ -614,23 +611,23 @@ exchange_mapi_cal_commit (EPlugin *epl, EConfigTarget *target)
 	gchar *tmp, *sfid;
 	mapi_id_t fid, pfid;
 	uint32_t type;
-	char *uri_text = e_source_get_uri (source);
+	gchar *uri_text = e_source_get_uri (source);
 
 	if (!uri_text || g_ascii_strncasecmp (uri_text, MAPI_URI_PREFIX, MAPI_PREFIX_LENGTH))
 		return;
 	g_free (uri_text);
 
 	switch (t->source_type) {
-		case E_CAL_SOURCE_TYPE_EVENT: 
-			type = olFolderCalendar; 
+		case E_CAL_SOURCE_TYPE_EVENT:
+			type = olFolderCalendar;
 			break;
-		case E_CAL_SOURCE_TYPE_TODO: 
-			type = olFolderTasks; 
+		case E_CAL_SOURCE_TYPE_TODO:
+			type = olFolderTasks;
 			break;
-		case E_CAL_SOURCE_TYPE_JOURNAL: 
-			type = olFolderNotes; 
+		case E_CAL_SOURCE_TYPE_JOURNAL:
+			type = olFolderNotes;
 			break;
-		default: 
+		default:
 			g_warning ("%s: %s: Unknown ExchangeMAPIFolderType\n", G_STRLOC, G_STRFUNC);
 			return;
 	}
@@ -656,7 +653,7 @@ exchange_mapi_cal_commit (EPlugin *epl, EConfigTarget *target)
 	tmp = e_source_group_get_property (group, "username");
 	e_source_set_property (source, "username", tmp);
 	g_free (tmp);
-	
+
 	tmp = e_source_group_get_property (group, "host");
 	e_source_set_property (source, "host", tmp);
 	g_free (tmp);
diff --git a/src/account-setup-eplugin/exchange-mapi-account-setup.h b/src/account-setup-eplugin/exchange-mapi-account-setup.h
index a764695..0cab23b 100644
--- a/src/account-setup-eplugin/exchange-mapi-account-setup.h
+++ b/src/account-setup-eplugin/exchange-mapi-account-setup.h
@@ -10,7 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -21,7 +21,6 @@
  *
  */
 
-
 #ifndef EXCHANGE_MAPI_ACCOUNT_SETUP_H
 #define EXCHANGE_MAPI_ACCOUNT_SETUP_H
 
@@ -36,6 +35,6 @@
 #define MAPI_PREFIX_LENGTH 7
 
 ExchangeMAPIAccountListener *
-exchange_mapi_accounts_peek_config_listener (void); 
+exchange_mapi_accounts_peek_config_listener (void);
 
 #endif /* EXCHANGE_MAPI_ACCOUNT_SETUP_H */
diff --git a/src/addressbook/e-book-backend-mapi-factory.c b/src/addressbook/e-book-backend-mapi-factory.c
index 6bc045a..b7f4eca 100644
--- a/src/addressbook/e-book-backend-mapi-factory.c
+++ b/src/addressbook/e-book-backend-mapi-factory.c
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -21,7 +21,6 @@
  *
  */
 
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -45,7 +44,7 @@ void	eds_module_shutdown   (void)
 {
 }
 
-void	eds_module_list_types (const GType **types, int *num_types)
+void	eds_module_list_types (const GType **types, gint *num_types)
 {
 	*types = &mapi_type;
 	*num_types = 1;
diff --git a/src/addressbook/e-book-backend-mapi-gal-factory.c b/src/addressbook/e-book-backend-mapi-gal-factory.c
index 3e4e8de..9c70810 100644
--- a/src/addressbook/e-book-backend-mapi-gal-factory.c
+++ b/src/addressbook/e-book-backend-mapi-gal-factory.c
@@ -10,7 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/> 
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -44,7 +44,7 @@ eds_module_shutdown   (void)
 }
 
 void
-eds_module_list_types (const GType **types, int *num_types)
+eds_module_list_types (const GType **types, gint *num_types)
 {
 	*types = & mapigal_type;
 	*num_types = 1;
diff --git a/src/addressbook/e-book-backend-mapi-gal.c b/src/addressbook/e-book-backend-mapi-gal.c
index ecdd389..f0847de 100644
--- a/src/addressbook/e-book-backend-mapi-gal.c
+++ b/src/addressbook/e-book-backend-mapi-gal.c
@@ -1,5 +1,5 @@
 #ifdef HAVE_CONFIG_H
-#include <config.h>  
+#include <config.h>
 #endif
 
 #include <stdlib.h>
@@ -32,19 +32,19 @@ static GList *supported_fields;
 
 static const struct field_element_mapping {
 		EContactField field_id;
-		int element_type;
-	        int mapi_id;
-	        int contact_type;
-//		char *element_name;
+		gint element_type;
+		gint mapi_id;
+		gint contact_type;
+//		gchar *element_name;
 //		void (*populate_contact_func)(EContact *contact,    gpointer data);
 //		void (*set_value_in_gw_item) (EGwItem *item, gpointer data);
 //		void (*set_changes) (EGwItem *new_item, EGwItem *old_item);
 
-	} mappings [] = { 
+	} mappings [] = {
 
 	{ E_CONTACT_UID, PT_STRING8, 0, ELEMENT_TYPE_SIMPLE},
 	{ E_CONTACT_REV, PT_SYSTIME, PR_LAST_MODIFICATION_TIME, ELEMENT_TYPE_SIMPLE},
-		
+
 	{ E_CONTACT_FILE_AS, PT_STRING8, PR_EMS_AB_MANAGER_T, ELEMENT_TYPE_SIMPLE},
 	{ E_CONTACT_FULL_NAME, PT_STRING8, PR_DISPLAY_NAME, ELEMENT_TYPE_SIMPLE },
 	{ E_CONTACT_GIVEN_NAME, PT_STRING8, PR_GIVEN_NAME, ELEMENT_TYPE_SIMPLE},
@@ -54,8 +54,8 @@ static const struct field_element_mapping {
 	{ E_CONTACT_EMAIL_1, PT_STRING8, PROP_TAG(PT_UNICODE, 0x8084), ELEMENT_TYPE_SIMPLE},
 	{ E_CONTACT_EMAIL_2, PT_STRING8, PROP_TAG(PT_UNICODE, 0x8094), ELEMENT_TYPE_SIMPLE},
 	{ E_CONTACT_EMAIL_3, PT_STRING8, PROP_TAG(PT_UNICODE, 0x80a4), ELEMENT_TYPE_SIMPLE},
-	{ E_CONTACT_IM_AIM,  PT_STRING8, PROP_TAG(PT_UNICODE, 0x8062), ELEMENT_TYPE_COMPLEX},	
-		
+	{ E_CONTACT_IM_AIM,  PT_STRING8, PROP_TAG(PT_UNICODE, 0x8062), ELEMENT_TYPE_COMPLEX},
+
 	{ E_CONTACT_PHONE_BUSINESS, PT_STRING8, PR_OFFICE_TELEPHONE_NUMBER, ELEMENT_TYPE_SIMPLE},
 	{ E_CONTACT_PHONE_HOME, PT_STRING8, PR_HOME_TELEPHONE_NUMBER, ELEMENT_TYPE_SIMPLE},
 	{ E_CONTACT_PHONE_MOBILE, PT_STRING8, PR_MOBILE_TELEPHONE_NUMBER, ELEMENT_TYPE_SIMPLE},
@@ -74,41 +74,40 @@ static const struct field_element_mapping {
 	{ E_CONTACT_ORG_UNIT, PT_STRING8, PR_DEPARTMENT_NAME,ELEMENT_TYPE_SIMPLE},
 	{ E_CONTACT_MANAGER, PT_STRING8, PR_MANAGER_NAME, ELEMENT_TYPE_SIMPLE},
 	{ E_CONTACT_ASSISTANT, PT_STRING8, PR_ASSISTANT, ELEMENT_TYPE_SIMPLE},
-		
+
 	{ E_CONTACT_OFFICE, PT_STRING8, PR_OFFICE_LOCATION, ELEMENT_TYPE_SIMPLE},
 	{ E_CONTACT_SPOUSE, PT_STRING8, PR_SPOUSE_NAME, ELEMENT_TYPE_SIMPLE},
-		
+
 	{ E_CONTACT_BIRTH_DATE,  PT_SYSTIME, PR_BIRTHDAY, ELEMENT_TYPE_COMPLEX},
 	{ E_CONTACT_ANNIVERSARY, PT_SYSTIME, PR_WEDDING_ANNIVERSARY, ELEMENT_TYPE_COMPLEX},
-		  
+
 	{ E_CONTACT_NOTE, PT_STRING8, PR_BODY, ELEMENT_TYPE_SIMPLE},
-		
 
 	{ E_CONTACT_ADDRESS_HOME, PT_STRING8, 0x801a001e, ELEMENT_TYPE_COMPLEX},
 	{ E_CONTACT_ADDRESS_WORK, PT_STRING8, 0x801c001e, ELEMENT_TYPE_COMPLEX},
 //		{ E_CONTACT_BOOK_URI, ELEMENT_TYPE_SIMPLE, "book_uri"}
 //		{ E_CONTACT_EMAIL, PT_STRING8, 0x8084001e},
-//		{ E_CONTACT_CATEGORIES, },		
+//		{ E_CONTACT_CATEGORIES, },
 	};
 
-static int maplen = G_N_ELEMENTS(mappings);
+static gint maplen = G_N_ELEMENTS(mappings);
 
 struct _EBookBackendMAPIGALPrivate
 {
-	char *profile;
+	gchar *profile;
 	mapi_id_t fid;
-	int mode;
+	gint mode;
 	gboolean marked_for_offline;
 	GThread *build_cache_thread;
 	gboolean kill_cache_build;
 	gboolean is_cache_ready;
 	gboolean is_summary_ready;
 	gboolean is_writable;
-	char *uri;
-	char *book_name;
-	
+	gchar *uri;
+	gchar *book_name;
+
 	GMutex *lock;
-	char *summary_file_name;
+	gchar *summary_file_name;
 	EBookBackendSummary *summary;
 	EBookBackendCache *cache;
 
@@ -116,13 +115,13 @@ struct _EBookBackendMAPIGALPrivate
 
 #define SUMMARY_FLUSH_TIMEOUT 5000
 
-static char *
+static gchar *
 e_book_backend_mapi_gal_get_static_capabilities (EBookBackend *backend)
 {
-	if(enable_debug)
+	if (enable_debug)
 		printf("mapi get_static_capabilities\n");
 	//FIXME: Implement this.
-	
+
 	return g_strdup ("net,bulk-removes,do-initial-query,contact-lists");
 }
 
@@ -171,12 +170,12 @@ static gpointer
 build_cache (EBookBackendMAPIGAL *ebmapi)
 {
 	EBookBackendMAPIGALPrivate *priv = ((EBookBackendMAPIGAL *) ebmapi)->priv;
-	char *tmp;
+	gchar *tmp;
 	GPtrArray *contacts_array = g_ptr_array_new();
 	gint i = 0;
 	gchar *status_msg;
 	EDataBookView *book_view;
-	
+
 	//FIXME: What if book view is NULL? Can it be? Check that.
 	if (!priv->cache) {
 		printf("Caching for the first time\n");
@@ -184,25 +183,25 @@ build_cache (EBookBackendMAPIGAL *ebmapi)
 	}
 
 	if (!priv->summary) {
-		priv->summary = e_book_backend_summary_new (priv->summary_file_name, 
+		priv->summary = e_book_backend_summary_new (priv->summary_file_name,
 							    SUMMARY_FLUSH_TIMEOUT);
 		printf("Summary file name is %s\n", priv->summary_file_name);
 	}
 
 	exchange_mapi_util_get_gal (contacts_array);
-	
+
 	e_file_cache_freeze_changes (E_FILE_CACHE (priv->cache));
 
 	book_view = find_book_view (ebmapi);
 
 	if (book_view)
-		e_data_book_view_notify_complete (book_view, 
+		e_data_book_view_notify_complete (book_view,
 						  GNOME_Evolution_Addressbook_Success);
 
 	for (i = 0; i < contacts_array->len && !priv->kill_cache_build; i++) {
 		EContact *contact = e_contact_new ();
 		ExchangeMAPIGALEntry *gal_entry = contacts_array->pdata[i];
-		char *uid;
+		gchar *uid;
 
 		uid = g_strdup_printf ("%d", i);
 
@@ -235,10 +234,10 @@ build_cache (EBookBackendMAPIGAL *ebmapi)
 						  GNOME_Evolution_Addressbook_Success);
 		e_data_book_view_unref (book_view);
 	}
-	
+
 	g_ptr_array_free (contacts_array, TRUE);
 
-	tmp = g_strdup_printf("%d", priv->kill_cache_build ? 0 : (int)time (NULL));
+	tmp = g_strdup_printf("%d", priv->kill_cache_build ? 0 : (gint)time (NULL));
 	e_book_backend_cache_set_time (priv->cache, tmp);
 	printf("setting time  %s\n", tmp);
 	g_free (tmp);
@@ -280,34 +279,33 @@ static void
 e_book_backend_mapi_gal_authenticate_user (EBookBackend *backend,
 					    EDataBook    *book,
 					    guint32       opid,
-					    const char *user,
-					    const char *passwd,
-					    const char *auth_method)
+					    const gchar *user,
+					    const gchar *passwd,
+					    const gchar *auth_method)
 {
 	EBookBackendMAPIGAL *ebmapi = (EBookBackendMAPIGAL *) backend;
 	EBookBackendMAPIGALPrivate *priv = ebmapi->priv;
-	
+
 	if (enable_debug) {
 		printf ("mapi: authenticate user\n");
-	}	
+	}
 
-	
 	switch (priv->mode) {
 	case GNOME_Evolution_Addressbook_MODE_LOCAL:
 		e_book_backend_notify_writable (backend, FALSE);
 		e_book_backend_set_is_writable (E_BOOK_BACKEND(backend), FALSE);
-		e_book_backend_notify_connection_status (backend, FALSE); 
-		e_data_book_respond_authenticate_user (book, opid, GNOME_Evolution_Addressbook_Success); 
+		e_book_backend_notify_connection_status (backend, FALSE);
+		e_data_book_respond_authenticate_user (book, opid, GNOME_Evolution_Addressbook_Success);
 		return;
-		
+
 	case GNOME_Evolution_Addressbook_MODE_REMOTE:
-		
+
 		if (!exchange_mapi_connection_new (priv->profile, passwd))
 			return e_data_book_respond_authenticate_user (book, opid,GNOME_Evolution_Addressbook_OtherError);
 
 		if (priv->cache && priv->is_cache_ready) {
 			printf("FIXME: Should check for an update in the cache\n");
-//			g_thread_create ((GThreadFunc) update_cache, 
+//			g_thread_create ((GThreadFunc) update_cache,
 	//					  backend, FALSE, backend);
 		} else if (priv->marked_for_offline && !priv->is_cache_ready) {
 			if (!priv->build_cache_thread) {
@@ -316,21 +314,21 @@ e_book_backend_mapi_gal_authenticate_user (EBookBackend *backend,
 				priv->kill_cache_build = FALSE;
 				priv->build_cache_thread = g_thread_create ((GThreadFunc) build_cache, ebmapi, TRUE, NULL);
 			}
-		} 
+		}
 		e_book_backend_set_is_writable (backend, FALSE);
 		e_data_book_respond_authenticate_user (book, opid, GNOME_Evolution_Addressbook_Success);
 		return;
-		
+
 	default :
 		break;
-	}	
+	}
 }
 
-static char *
-get_filename_from_uri (const char *uri, const char *file)
+static gchar *
+get_filename_from_uri (const gchar *uri, const gchar *file)
 {
-	char *mangled_uri, *filename;
-	int i;
+	gchar *mangled_uri, *filename;
+	gint i;
 
 	/* mangle the URI to not contain invalid characters */
 	mangled_uri = g_strdup (uri);
@@ -392,40 +390,38 @@ e_book_backend_mapi_gal_load_source (EBookBackend *backend,
 {
 	EBookBackendMAPIGALPrivate *priv = ((EBookBackendMAPIGAL *) backend)->priv;
 	const gchar *offline, *tmp;
-	char **tokens;
-	char *uri = NULL;
+	gchar **tokens;
+	gchar *uri = NULL;
 	if (enable_debug)
 		printf("MAPI load source\n");
 	offline = e_source_get_property (source, "offline_sync");
 	if (offline  && g_str_equal (offline, "1"))
 		priv->marked_for_offline = TRUE;
 
-
-
 	/* Either we are in Online mode or this is marked for offline */
-	
+
 	priv->uri = g_strdup (e_source_get_uri (source));
 
 	tokens = g_strsplit (priv->uri, ";", 2);
-  	if (tokens[0])
- 		uri = g_strdup (tokens [0]);
-  	priv->book_name  = g_strdup (tokens[1]);
-  	if (priv->book_name == NULL) {
+	if (tokens[0])
+		uri = g_strdup (tokens [0]);
+	priv->book_name  = g_strdup (tokens[1]);
+	if (priv->book_name == NULL) {
 		g_warning ("Bookname is null for %s\n", uri);
-  		return GNOME_Evolution_Addressbook_OtherError;
+		return GNOME_Evolution_Addressbook_OtherError;
 	}
-  	g_strfreev (tokens);
+	g_strfreev (tokens);
 
 	if (priv->mode ==  GNOME_Evolution_Addressbook_MODE_LOCAL &&
 	    !priv->marked_for_offline ) {
 		return GNOME_Evolution_Addressbook_OfflineUnavailable;
 	}
-	
+
 	if (priv->marked_for_offline) {
- 		priv->summary_file_name = get_filename_from_uri (priv->uri, "cache.summary"); 
+		priv->summary_file_name = get_filename_from_uri (priv->uri, "cache.summary");
 		if (g_file_test (priv->summary_file_name, G_FILE_TEST_EXISTS)) {
 			printf("Loading the summary\n");
-			priv->summary = e_book_backend_summary_new (priv->summary_file_name, 
+			priv->summary = e_book_backend_summary_new (priv->summary_file_name,
 								    SUMMARY_FLUSH_TIMEOUT);
 			e_book_backend_summary_load (priv->summary);
 			priv->is_summary_ready = TRUE;
@@ -449,7 +445,7 @@ e_book_backend_mapi_gal_load_source (EBookBackend *backend,
 
 	g_free (uri);
 	e_book_backend_set_is_loaded (E_BOOK_BACKEND (backend), TRUE);
-	e_book_backend_set_is_writable (backend, FALSE);	
+	e_book_backend_set_is_writable (backend, FALSE);
 	if (priv->mode ==  GNOME_Evolution_Addressbook_MODE_LOCAL) {
 		e_book_backend_set_is_writable (backend, FALSE);
 		e_book_backend_notify_writable (backend, FALSE);
@@ -461,7 +457,7 @@ e_book_backend_mapi_gal_load_source (EBookBackend *backend,
 	} else {
 		e_book_backend_notify_connection_status (backend, TRUE);
 	}
-	
+
 	priv->profile = g_strdup (e_source_get_property (source, "profile"));
 	exchange_mapi_util_mapi_id_from_string (e_source_get_property (source, "folder-id"), &priv->fid);
 
@@ -476,21 +472,20 @@ e_book_backend_mapi_gal_load_source (EBookBackend *backend,
 	e_book_backend_set_is_loaded (E_BOOK_BACKEND (backend), TRUE);
 	e_book_backend_notify_connection_status (E_BOOK_BACKEND (backend), TRUE);
 
-
 	if (enable_debug)
 		printf("For profile %s and folder %s - %016" G_GINT64_MODIFIER "X\n", priv->profile, tmp, priv->fid);
 
 	return GNOME_Evolution_Addressbook_Success;
 }
 
-static void 
+static void
 e_book_backend_mapi_gal_set_mode (EBookBackend *backend, GNOME_Evolution_Addressbook_BookMode mode)
 {
 	EBookBackendMAPIGALPrivate *priv = ((EBookBackendMAPIGAL *) backend)->priv;
 
-	if(enable_debug)
+	if (enable_debug)
 		printf("mapi: set_mode \n");
-	
+
 	priv->mode = mode;
 	if (e_book_backend_is_loaded (backend)) {
 		if (mode == GNOME_Evolution_Addressbook_MODE_LOCAL) {
@@ -505,7 +500,7 @@ e_book_backend_mapi_gal_set_mode (EBookBackend *backend, GNOME_Evolution_Address
 			e_book_backend_notify_connection_status (backend, TRUE);
 //			e_book_backend_notify_auth_required (backend); //FIXME: WTH is this required.
 		}
-	}	
+	}
 }
 
 static void
@@ -513,7 +508,7 @@ e_book_backend_mapi_gal_dispose (GObject *object)
 {
 	/* FIXME : provide implmentation */
 	EBookBackendMAPIGALPrivate *priv = ((EBookBackendMAPIGAL *) object)->priv;
-	
+
 	if (priv->profile) {
 		g_free (priv->profile);
 		priv->profile = NULL;
@@ -547,8 +542,8 @@ static EContact *
 emapidump_gal (struct SRow *gal_entry)
 {
 	EContact *contact = e_contact_new ();
-	int i;
-	
+	gint i;
+
 //	exchange_mapi_debug_property_dump (properties);
 	for (i=1; i<maplen; i++) {
 		gpointer value;
@@ -563,7 +558,7 @@ emapidump_gal (struct SRow *gal_entry)
 				struct FILETIME *t = value;
 				time_t time;
 				NTTIME nt;
-				char buff[129];
+				gchar buff[129];
 
 				nt = t->dwHighDateTime;
 				nt = nt << 32;
@@ -585,25 +580,25 @@ create_gal_contact_cb (FetchItemsCallbackData *item_data, gpointer data)
 	EBookBackendMAPIGAL *be = closure->bg;
 	EContact *contact;
 	EBookBackendMAPIGALPrivate *priv = ((EBookBackendMAPIGAL *) be)->priv;
-	char *suid;
+	gchar *suid;
 	GSList *l;
-	int counter;
-	
+	gint counter;
+
 	if (!e_flag_is_set (closure->running)) {
 		printf("Might be that the operation is cancelled. Lets ask our parent also to do.\n");
 		return FALSE;
 	}
-	
+
 //	contact = emapidump_contact (item_data->properties);
 	for (l=item_data->gallist; l; l=l->next) {
 		struct SRow *SRow = (struct SRow *) (l->data);
 		counter++;
 		contact = emapidump_gal (SRow);
 		suid = exchange_mapi_util_mapi_ids_to_uid (item_data->fid, item_data->mid);
-	
+
 		if (contact) {
 			/* UID of the contact is nothing but the concatenated string of hex id of folder and the message.*/
-			e_contact_set (contact, E_CONTACT_UID, suid);		
+			e_contact_set (contact, E_CONTACT_UID, suid);
 			e_contact_set (contact, E_CONTACT_BOOK_URI, priv->uri);
 			e_data_book_view_notify_update (book_view, contact);
 			g_object_unref(contact);
@@ -617,22 +612,22 @@ create_gal_contact_cb (FetchItemsCallbackData *item_data, gpointer data)
 #endif
 
 static void
-get_contacts_from_cache (EBookBackendMAPIGAL *ebmapi, 
-			 const char *query,
+get_contacts_from_cache (EBookBackendMAPIGAL *ebmapi,
+			 const gchar *query,
 			 GPtrArray *ids,
-			 EDataBookView *book_view, 
+			 EDataBookView *book_view,
 			 BESearchClosure *closure)
 {
-	int i;
+	gint i;
 
 	for (i = 0; i < ids->len; i ++) {
-		char *uid;
-		EContact *contact; 
+		gchar *uid;
+		EContact *contact;
 
                 if (!e_flag_is_set (closure->running))
                         break;
 
- 		uid = g_ptr_array_index (ids, i);
+		uid = g_ptr_array_index (ids, i);
 		contact = e_book_backend_cache_get_contact (ebmapi->priv->cache, uid);
 		if (contact) {
 			e_data_book_view_notify_update (book_view, contact);
@@ -640,19 +635,19 @@ get_contacts_from_cache (EBookBackendMAPIGAL *ebmapi,
 		}
 	}
 	if (e_flag_is_set (closure->running))
-		e_data_book_view_notify_complete (book_view, 
+		e_data_book_view_notify_complete (book_view,
 						  GNOME_Evolution_Addressbook_Success);
 }
 #if 0
 static gboolean
-build_restriction_emails_contains (struct mapi_SRestriction *res, 
-				   const char *query)
+build_restriction_emails_contains (struct mapi_SRestriction *res,
+				   const gchar *query)
 {
-	char *email=NULL, *tmp, *tmp1;
+	gchar *email=NULL, *tmp, *tmp1;
 
 	/* This currently supports "email foo bar soo" */
 	tmp = strdup (query);
-	
+
 	tmp = strstr (tmp, "email");
 	if (tmp ) {
 		tmp = strchr (tmp, '\"');
@@ -668,7 +663,6 @@ build_restriction_emails_contains (struct mapi_SRestriction *res,
 			}
 		}
 	}
-	
 
 	if (email==NULL || !strchr (email, '@'))
 		return FALSE;
@@ -684,17 +678,17 @@ build_restriction_emails_contains (struct mapi_SRestriction *res,
 #endif
 
 static gboolean
-build_multiple_restriction_emails_contains (struct mapi_SRestriction *res, 
-				            struct mapi_SRestriction_or *or_res, 
-					    const char *query)
+build_multiple_restriction_emails_contains (struct mapi_SRestriction *res,
+					    struct mapi_SRestriction_or *or_res,
+					    const gchar *query)
 {
-	char *email=NULL, *tmp, *tmp1;
+	gchar *email=NULL, *tmp, *tmp1;
 	//Number of restriction to apply
-	unsigned int res_count = 6;
+	guint res_count = 6;
 
 	/* This currently supports "email foo bar soo" */
 	tmp = strdup (query);
-	
+
 	tmp = strstr (tmp, "email");
 	if (tmp ) {
 		tmp = strchr (tmp, '\"');
@@ -762,24 +756,24 @@ book_view_thread (gpointer data)
 	BESearchClosure *closure = get_closure (book_view);
 	EBookBackendMAPIGAL *backend = closure->bg;
 	EBookBackendMAPIGALPrivate *priv = backend->priv;
-	const char *query = NULL;
+	const gchar *query = NULL;
 	GPtrArray *ids = NULL;
 	GList *contacts = NULL, *temp_list = NULL;
 	//Number of multiple restriction to apply
-	unsigned int res_count = 6;
-	
+	guint res_count = 6;
+
 	if (enable_debug)
 		printf("mapi: book view\n");
-	
+
 	g_object_ref (book_view);
 	e_flag_set (closure->running);
-						
+
 	book_view_notify_status (book_view, "Searching...");
 	query = e_data_book_view_get_card_query (book_view);
 
 	if (!find_book_view (backend))
 		e_book_backend_add_book_view (E_BOOK_BACKEND (backend), book_view);
-						
+
 	switch (priv->mode) {
 		case GNOME_Evolution_Addressbook_MODE_REMOTE:
 			if (!exchange_mapi_connection_exists ()) {
@@ -789,7 +783,7 @@ book_view_thread (gpointer data)
 				g_object_unref (book_view);
 				return;
 			}
-		
+
 			if (priv->marked_for_offline && !priv->is_cache_ready) {
 				/* To translators : Here Evolution MAPI downloads the entries from the GAL server */
 				book_view_notify_status (book_view, _("Downloading GAL entries from server..."));
@@ -797,7 +791,7 @@ book_view_thread (gpointer data)
 			}
 
 			if (priv->marked_for_offline && priv->cache && priv->is_cache_ready) {
-				if (priv->is_summary_ready && 
+				if (priv->is_summary_ready &&
 				    e_book_backend_summary_is_summary_query (priv->summary, query)) {
 					if (enable_debug)
 						printf ("reading the contacts from summary \n");
@@ -809,11 +803,11 @@ book_view_thread (gpointer data)
 					g_object_unref (book_view);
 					break;
 				}
-			
+
 				printf("Summary seems to be not there or not a summary query, lets fetch from cache directly\n");
-			
+
 				/* We are already cached. Lets return from there. */
-				contacts = e_book_backend_cache_get_contacts (priv->cache, 
+				contacts = e_book_backend_cache_get_contacts (priv->cache,
 								      query);
 				temp_list = contacts;
 				for (; contacts != NULL; contacts = g_list_next(contacts)) {
@@ -821,28 +815,28 @@ book_view_thread (gpointer data)
 						for (;contacts != NULL; contacts = g_list_next (contacts))
 							g_object_unref (contacts->data);
 						break;
-					}							
-					e_data_book_view_notify_update (book_view, 
+					}
+					e_data_book_view_notify_update (book_view,
 									E_CONTACT(contacts->data));
 					g_object_unref (contacts->data);
 				}
 				if (e_flag_is_set (closure->running))
-					e_data_book_view_notify_complete (book_view, 
+					e_data_book_view_notify_complete (book_view,
 									  GNOME_Evolution_Addressbook_Success);
 				if (temp_list)
 					 g_list_free (temp_list);
 				g_object_unref (book_view);
 				break;
 			}
-		
+
 			if (e_book_backend_summary_is_summary_query (priv->summary, query)) {
 				or_res = g_new (struct mapi_SRestriction_or, res_count);
-		
+
 				if (!build_multiple_restriction_emails_contains (&res, or_res, query)) {
-					e_data_book_view_notify_complete (book_view, 
+					e_data_book_view_notify_complete (book_view,
 								  GNOME_Evolution_Addressbook_OtherError);
-					return ;
-				} 
+					return;
+				}
 
 			if (e_flag_is_set (closure->running))
 				e_data_book_view_notify_complete (book_view,
@@ -851,9 +845,9 @@ book_view_thread (gpointer data)
 			break;
 		}
 	}
-	
+
 	if (book_view)
-		e_data_book_view_notify_complete (book_view, 
+		e_data_book_view_notify_complete (book_view,
 						  GNOME_Evolution_Addressbook_Success);
 	return;
 }
@@ -884,7 +878,7 @@ static void
 e_book_backend_mapi_gal_get_contact (EBookBackend *backend,
 				     EDataBook    *book,
 				     guint32       opid,
-				     const char   *id)
+				     const gchar   *id)
 {
 	if (enable_debug)
 		printf ("mapi: get contact %s\n", id);
@@ -896,11 +890,11 @@ static void
 e_book_backend_mapi_gal_get_contact_list (EBookBackend *backend,
 					    EDataBook    *book,
 					    guint32       opid,
-					    const char   *query )
+					    const gchar   *query )
 {
 	/*EBookBackendMAPIGALPrivate *priv = ((EBookBackendMAPIGAL *) backend)->priv;*/
 
-	if(enable_debug)
+	if (enable_debug)
 		printf("mapi: get contact list %s\n", query);
 
 	e_data_book_respond_get_contact_list (book, opid, GNOME_Evolution_Addressbook_RepositoryOffline,
@@ -919,21 +913,21 @@ e_book_backend_mapi_gal_start_book_view (EBookBackend  *backend,
 		printf ("mapi: start_book_view...\n");
 	closure->thread = g_thread_create ((GThreadFunc) book_view_thread, book_view, FALSE, NULL);
 	e_flag_wait (closure->running);
-	
-	/* at this point we know the book view thread is actually running */	
+
+	/* at this point we know the book view thread is actually running */
 }
 
 static void
 e_book_backend_mapi_gal_stop_book_view (EBookBackend  *backend,
 					  EDataBookView *book_view)
 {
-	if(enable_debug)
-		printf("mapi: stop book view\n");	
+	if (enable_debug)
+		printf("mapi: stop book view\n");
 	/* FIXME : provide implmentation */
 }
 
 static void
-e_book_backend_mapi_gal_get_changes (EBookBackend *backend, EDataBook *book, guint32 opid, const char *change_id)
+e_book_backend_mapi_gal_get_changes (EBookBackend *backend, EDataBook *book, guint32 opid, const gchar *change_id)
 {
 	if (enable_debug)
 		printf ("mapi: get changes\n");
@@ -941,12 +935,12 @@ e_book_backend_mapi_gal_get_changes (EBookBackend *backend, EDataBook *book, gui
 	e_data_book_respond_get_changes (book, opid, GNOME_Evolution_Addressbook_RepositoryOffline, NULL);
 }
 
-static void 
+static void
 e_book_backend_mapi_gal_get_supported_auth_methods (EBookBackend *backend, EDataBook *book, guint32 opid)
 {
 	GList *auth_methods = NULL;
-	char *auth_method;
-	
+	gchar *auth_method;
+
 	if (enable_debug)
 		printf ("mapi get_supported_auth_methods...\n");
 
@@ -955,9 +949,9 @@ e_book_backend_mapi_gal_get_supported_auth_methods (EBookBackend *backend, EData
 	e_data_book_respond_get_supported_auth_methods (book,
 							opid,
 							GNOME_Evolution_Addressbook_Success,
-							auth_methods);  
+							auth_methods);
 	g_free (auth_method);
-	g_list_free (auth_methods);	
+	g_list_free (auth_methods);
 }
 
 static GNOME_Evolution_Addressbook_CallStatus
@@ -979,9 +973,9 @@ static void e_book_backend_mapi_gal_class_init (EBookBackendMAPIGALClass *klass)
 	GObjectClass  *object_class = G_OBJECT_CLASS (klass);
 	EBookBackendClass *parent_class;
 	gint i;
-	
+
 	e_book_backend_mapi_gal_parent_class = g_type_class_peek_parent (klass);
-	
+
 	parent_class = E_BOOK_BACKEND_CLASS (klass);
 
 	/* Set the virtual methods. */
@@ -1005,7 +999,6 @@ static void e_book_backend_mapi_gal_class_init (EBookBackendMAPIGALClass *klass)
 	parent_class->remove			 = e_book_backend_mapi_gal_remove;
 	object_class->dispose                    = e_book_backend_mapi_gal_dispose;
 
-
 	supported_fields = NULL;
 	for (i = 0; i < maplen; i++) {
 		supported_fields = g_list_append (supported_fields,
@@ -1033,7 +1026,7 @@ e_book_backend_mapi_gal_new (void)
 static void	e_book_backend_mapi_gal_init (EBookBackendMAPIGAL *backend)
 {
 	EBookBackendMAPIGALPrivate *priv;
-  
+
 	priv= g_new0 (EBookBackendMAPIGALPrivate, 1);
 	/* Priv Struct init */
 	backend->priv = priv;
@@ -1045,9 +1038,9 @@ static void	e_book_backend_mapi_gal_init (EBookBackendMAPIGAL *backend)
 	priv->cache = NULL;
 	priv->is_summary_ready = FALSE;
 	priv->is_cache_ready = FALSE;
-	
+
 */	if (g_getenv ("MAPI_DEBUG"))
 		enable_debug = TRUE;
 	else
-		enable_debug = FALSE;	
+		enable_debug = FALSE;
 }
diff --git a/src/addressbook/e-book-backend-mapi-gal.h b/src/addressbook/e-book-backend-mapi-gal.h
index 080968c..c6c00f7 100644
--- a/src/addressbook/e-book-backend-mapi-gal.h
+++ b/src/addressbook/e-book-backend-mapi-gal.h
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -50,5 +50,5 @@ GType       e_book_backend_mapi_gal_get_type (void);
 #define E_IS_BOOK_BACKEND_MAPIGAL(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_BOOK_BACKEND_MAPIGAL))
 #define E_IS_BOOK_BACKEND_MAPIGAL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_BOOK_BACKEND_MAPIGAL))
 
-#endif /* ! __E_BOOK_BACKEND_MAPIGAL_H__ */
+#endif /* __E_BOOK_BACKEND_MAPIGAL_H__ */
 
diff --git a/src/addressbook/e-book-backend-mapi.c b/src/addressbook/e-book-backend-mapi.c
index 1a50828..06f0984 100644
--- a/src/addressbook/e-book-backend-mapi.c
+++ b/src/addressbook/e-book-backend-mapi.c
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -22,7 +22,7 @@
  */
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>  
+#include <config.h>
 #endif
 
 #include <stdlib.h>
@@ -53,18 +53,18 @@ static gboolean enable_debug = TRUE;
 
 struct _EBookBackendMAPIPrivate
 {
-	char *profile;
+	gchar *profile;
 	mapi_id_t fid;
-	int mode;
+	gint mode;
 	gboolean marked_for_offline;
 	gboolean is_cache_ready;
 	gboolean is_summary_ready;
 	gboolean is_writable;
-	char *uri;
-	char *book_name;
-	
+	gchar *uri;
+	gchar *book_name;
+
 	GMutex *lock;
-	char *summary_file_name;
+	gchar *summary_file_name;
 	EBookBackendSummary *summary;
 	EBookBackendCache *cache;
 
@@ -84,19 +84,19 @@ static EContact * emapidump_contact(struct mapi_SPropValue_array *properties);
 
 static const struct field_element_mapping {
 		EContactField field_id;
-		int element_type;
-	        int mapi_id;
-	        int contact_type;
-//		char *element_name;
+		gint element_type;
+		gint mapi_id;
+		gint contact_type;
+//		gchar *element_name;
 //		void (*populate_contact_func)(EContact *contact,    gpointer data);
 //		void (*set_value_in_gw_item) (EGwItem *item, gpointer data);
 //		void (*set_changes) (EGwItem *new_item, EGwItem *old_item);
 
-	} mappings [] = { 
+	} mappings [] = {
 
 	{ E_CONTACT_UID, PT_STRING8, 0, ELEMENT_TYPE_SIMPLE},
 	{ E_CONTACT_REV, PT_SYSTIME, PR_LAST_MODIFICATION_TIME, ELEMENT_TYPE_SIMPLE},
-		
+
 	{ E_CONTACT_FILE_AS, PT_STRING8, PR_EMS_AB_MANAGER_T, ELEMENT_TYPE_SIMPLE},
 	{ E_CONTACT_FULL_NAME, PT_STRING8, PR_DISPLAY_NAME, ELEMENT_TYPE_SIMPLE },
 	{ E_CONTACT_GIVEN_NAME, PT_STRING8, PR_GIVEN_NAME, ELEMENT_TYPE_SIMPLE},
@@ -106,8 +106,8 @@ static const struct field_element_mapping {
 	{ E_CONTACT_EMAIL_1, PT_STRING8, PROP_TAG(PT_STRING8, 0x8084), ELEMENT_TYPE_SIMPLE},
 	{ E_CONTACT_EMAIL_2, PT_STRING8, PROP_TAG(PT_STRING8, 0x8093), ELEMENT_TYPE_SIMPLE},
 	{ E_CONTACT_EMAIL_3, PT_STRING8, PROP_TAG(PT_STRING8, 0x80a3), ELEMENT_TYPE_SIMPLE},
-	{ E_CONTACT_IM_AIM,  PT_STRING8, PROP_TAG(PT_UNICODE, 0x8062), ELEMENT_TYPE_COMPLEX},	
-		
+	{ E_CONTACT_IM_AIM,  PT_STRING8, PROP_TAG(PT_UNICODE, 0x8062), ELEMENT_TYPE_COMPLEX},
+
 	{ E_CONTACT_PHONE_BUSINESS, PT_STRING8, PR_OFFICE_TELEPHONE_NUMBER, ELEMENT_TYPE_SIMPLE},
 	{ E_CONTACT_PHONE_HOME, PT_STRING8, PR_HOME_TELEPHONE_NUMBER, ELEMENT_TYPE_SIMPLE},
 	{ E_CONTACT_PHONE_MOBILE, PT_STRING8, PR_MOBILE_TELEPHONE_NUMBER, ELEMENT_TYPE_SIMPLE},
@@ -126,29 +126,27 @@ static const struct field_element_mapping {
 	{ E_CONTACT_ORG_UNIT, PT_STRING8, PR_DEPARTMENT_NAME,ELEMENT_TYPE_SIMPLE},
 	{ E_CONTACT_MANAGER, PT_STRING8, PR_MANAGER_NAME, ELEMENT_TYPE_SIMPLE},
 	{ E_CONTACT_ASSISTANT, PT_STRING8, PR_ASSISTANT, ELEMENT_TYPE_SIMPLE},
-		
+
 	{ E_CONTACT_OFFICE, PT_STRING8, PR_OFFICE_LOCATION, ELEMENT_TYPE_SIMPLE},
 	{ E_CONTACT_SPOUSE, PT_STRING8, PR_SPOUSE_NAME, ELEMENT_TYPE_SIMPLE},
-		
+
 	{ E_CONTACT_BIRTH_DATE,  PT_SYSTIME, PR_BIRTHDAY, ELEMENT_TYPE_COMPLEX},
 	{ E_CONTACT_ANNIVERSARY, PT_SYSTIME, PR_WEDDING_ANNIVERSARY, ELEMENT_TYPE_COMPLEX},
-		  
+
 	{ E_CONTACT_NOTE, PT_STRING8, PR_BODY, ELEMENT_TYPE_SIMPLE},
-		
 
 	{ E_CONTACT_ADDRESS_HOME, PT_STRING8, 0x801a001e, ELEMENT_TYPE_COMPLEX},
 	{ E_CONTACT_ADDRESS_WORK, PT_STRING8, 0x801c001e, ELEMENT_TYPE_COMPLEX},
 //		{ E_CONTACT_BOOK_URI, ELEMENT_TYPE_SIMPLE, "book_uri"}
 //		{ E_CONTACT_EMAIL, PT_STRING8, 0x8084001e},
-//		{ E_CONTACT_CATEGORIES, },		
+//		{ E_CONTACT_CATEGORIES, },
 	};
 
-static int maplen = G_N_ELEMENTS(mappings);
+static gint maplen = G_N_ELEMENTS(mappings);
 gboolean mapi_book_build_name_id (struct mapi_nameid *nameid, gpointer data);
-int mapi_book_build_props (struct SPropValue ** value, struct SPropTagArray * SPropTagArray, gpointer data);
+gint mapi_book_build_props (struct SPropValue ** value, struct SPropTagArray * SPropTagArray, gpointer data);
 gboolean mapi_book_build_name_id_for_getprops (struct mapi_nameid *nameid, gpointer data);
 
-
 #if 0
 static EDataBookView *
 find_book_view (EBookBackendMAPI *ebmapi)
@@ -176,20 +174,20 @@ find_book_view (EBookBackendMAPI *ebmapi)
 
 	g_object_unref (iter);
 	g_object_unref (views);
-	
+
 	return rv;
 }
 #endif
 
 static gboolean
-build_restriction_emails_contains (struct mapi_SRestriction *res, 
-				   const char *query)
+build_restriction_emails_contains (struct mapi_SRestriction *res,
+				   const gchar *query)
 {
-	char *email=NULL, *tmp, *tmp1;
+	gchar *email=NULL, *tmp, *tmp1;
 
 	/* This currently supports "email foo bar soo" */
 	tmp = strdup (query);
-	
+
 	tmp = strstr (tmp, "email");
 	if (tmp ) {
 		tmp = strchr (tmp, '\"');
@@ -205,7 +203,6 @@ build_restriction_emails_contains (struct mapi_SRestriction *res,
 			}
 		}
 	}
-	
 
 	if (email==NULL || !strchr (email, '@'))
 		return FALSE;
@@ -220,17 +217,17 @@ build_restriction_emails_contains (struct mapi_SRestriction *res,
 }
 
 static gboolean
-build_multiple_restriction_emails_contains (struct mapi_SRestriction *res, 
-				            struct mapi_SRestriction_or *or_res, 
-					    const char *query)
+build_multiple_restriction_emails_contains (struct mapi_SRestriction *res,
+					    struct mapi_SRestriction_or *or_res,
+					    const gchar *query)
 {
-	char *email=NULL, *tmp, *tmp1;
+	gchar *email=NULL, *tmp, *tmp1;
 	//Number of restriction to apply
-	unsigned int res_count = 6;
+	guint res_count = 6;
 
 	/* This currently supports "email foo bar soo" */
 	tmp = strdup (query);
-	
+
 	tmp = strstr (tmp, "email");
 	if (tmp ) {
 		tmp = strchr (tmp, '\"');
@@ -289,11 +286,11 @@ build_multiple_restriction_emails_contains (struct mapi_SRestriction *res,
 	return TRUE;
 }
 
-static char *
-get_filename_from_uri (const char *uri, const char *file)
+static gchar *
+get_filename_from_uri (const gchar *uri, const gchar *file)
 {
-	char *mangled_uri, *filename;
-	int i;
+	gchar *mangled_uri, *filename;
+	gint i;
 
 	/* mangle the URI to not contain invalid characters */
 	mangled_uri = g_strdup (uri);
@@ -322,40 +319,38 @@ e_book_backend_mapi_load_source (EBookBackend *backend,
 {
 	EBookBackendMAPIPrivate *priv = ((EBookBackendMAPI *) backend)->priv;
 	const gchar *offline, *tmp;
-	char **tokens;
-	char *uri = NULL;
+	gchar **tokens;
+	gchar *uri = NULL;
 	if (enable_debug)
 		printf("MAPI load source\n");
 	offline = e_source_get_property (source, "offline_sync");
 	if (offline  && g_str_equal (offline, "1"))
 		priv->marked_for_offline = TRUE;
 
-
-
 	/* Either we are in Online mode or this is marked for offline */
-	
+
 	priv->uri = g_strdup (e_source_get_uri (source));
 
 	tokens = g_strsplit (priv->uri, ";", 2);
-  	if (tokens[0])
- 		uri = g_strdup (tokens [0]);
-  	priv->book_name  = g_strdup (tokens[1]);
-  	if (priv->book_name == NULL) {
+	if (tokens[0])
+		uri = g_strdup (tokens [0]);
+	priv->book_name  = g_strdup (tokens[1]);
+	if (priv->book_name == NULL) {
 		g_warning ("Bookname is null for %s\n", uri);
-  		return GNOME_Evolution_Addressbook_OtherError;
+		return GNOME_Evolution_Addressbook_OtherError;
 	}
-  	g_strfreev (tokens);
+	g_strfreev (tokens);
 
 	if (priv->mode ==  GNOME_Evolution_Addressbook_MODE_LOCAL &&
 	    !priv->marked_for_offline ) {
 		return GNOME_Evolution_Addressbook_OfflineUnavailable;
 	}
-	
+
 	if (priv->marked_for_offline) {
- 		priv->summary_file_name = get_filename_from_uri (priv->uri, "cache.summary"); 
+		priv->summary_file_name = get_filename_from_uri (priv->uri, "cache.summary");
 		if (g_file_test (priv->summary_file_name, G_FILE_TEST_EXISTS)) {
 			printf("Loading the summary\n");
-			priv->summary = e_book_backend_summary_new (priv->summary_file_name, 
+			priv->summary = e_book_backend_summary_new (priv->summary_file_name,
 								    SUMMARY_FLUSH_TIMEOUT);
 			e_book_backend_summary_load (priv->summary);
 			priv->is_summary_ready = TRUE;
@@ -374,7 +369,7 @@ e_book_backend_mapi_load_source (EBookBackend *backend,
 
 	g_free (uri);
 	e_book_backend_set_is_loaded (E_BOOK_BACKEND (backend), TRUE);
-	e_book_backend_set_is_writable (backend, TRUE);	
+	e_book_backend_set_is_writable (backend, TRUE);
 	if (priv->mode ==  GNOME_Evolution_Addressbook_MODE_LOCAL) {
 		e_book_backend_set_is_writable (backend, FALSE);
 		e_book_backend_notify_writable (backend, FALSE);
@@ -386,7 +381,7 @@ e_book_backend_mapi_load_source (EBookBackend *backend,
 	} else {
 		e_book_backend_notify_connection_status (backend, TRUE);
 	}
-	
+
 	priv->profile = g_strdup (e_source_get_property (source, "profile"));
 	exchange_mapi_util_mapi_id_from_string (e_source_get_property (source, "folder-id"), &priv->fid);
 
@@ -402,20 +397,19 @@ e_book_backend_mapi_load_source (EBookBackend *backend,
 	e_book_backend_set_is_loaded (E_BOOK_BACKEND (backend), TRUE);
 	e_book_backend_notify_connection_status (E_BOOK_BACKEND (backend), TRUE);
 
-
 	if (enable_debug)
 		printf("For profile %s and folder %s - %016" G_GINT64_MODIFIER "X\n", priv->profile, tmp, priv->fid);
 
 	return GNOME_Evolution_Addressbook_Success;
 }
 
-static char *
+static gchar *
 e_book_backend_mapi_get_static_capabilities (EBookBackend *backend)
 {
-	if(enable_debug)
+	if (enable_debug)
 		printf("mapi get_static_capabilities\n");
 	//FIXME: Implement this.
-	
+
 	return g_strdup ("net,bulk-removes,do-initial-query,contact-lists");
 }
 
@@ -423,20 +417,20 @@ gboolean
 mapi_book_build_name_id (struct mapi_nameid *nameid, gpointer data)
 {
 //	EContact *contact = data;
-	
+
 	mapi_nameid_lid_add(nameid, 0x8005, PSETID_Address);
 	mapi_nameid_lid_add(nameid, 0x8084, PSETID_Address);
 	mapi_nameid_lid_add(nameid, 0x8083, PSETID_Address);
 
 	mapi_nameid_lid_add(nameid, 0x8093, PSETID_Address);
 	mapi_nameid_lid_add(nameid, 0x80A3, PSETID_Address);
-	
+
 	mapi_nameid_string_add(nameid, "urn:schemas:contacts:fileas", PS_PUBLIC_STRINGS);
 
 	mapi_nameid_lid_add(nameid, 0x802B, PSETID_Address);
 	mapi_nameid_lid_add(nameid, 0x8062, PSETID_Address);
 
-	mapi_nameid_lid_add(nameid, 0x801A, PSETID_Address);	
+	mapi_nameid_lid_add(nameid, 0x801A, PSETID_Address);
 	mapi_nameid_lid_add(nameid, 0x801B, PSETID_Address);
 
 	mapi_nameid_lid_add(nameid, 0x3A4F, PS_MAPI);
@@ -449,12 +443,12 @@ mapi_book_build_name_id (struct mapi_nameid *nameid, gpointer data)
 
 #define set_str_value(field_id, hex) if (e_contact_get (contact, field_id)) set_SPropValue_proptag (&props[i++], hex, e_contact_get (contact, field_id));
 
-int
+gint
 mapi_book_build_props (struct SPropValue ** value, struct SPropTagArray * SPropTagArray, gpointer data)
 {
-	EContact *contact = data;	
+	EContact *contact = data;
 	struct SPropValue *props;
-	int i=0;
+	gint i=0;
 
 	for (i=0; i<13; i++)
 		printf("hex %x\n", SPropTagArray->aulPropTag[i]);
@@ -463,23 +457,21 @@ mapi_book_build_props (struct SPropValue ** value, struct SPropTagArray * SPropT
 	set_str_value ( E_CONTACT_FILE_AS, SPropTagArray->aulPropTag[0]);
 
 	set_str_value (E_CONTACT_FULL_NAME, PR_DISPLAY_NAME);
-	set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (const void *)IPM_CONTACT);
+	set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (gconstpointer )IPM_CONTACT);
 	set_str_value (E_CONTACT_FILE_AS, PR_NORMALIZED_SUBJECT);
 	set_str_value (E_CONTACT_EMAIL_1,  SPropTagArray->aulPropTag[1]);
 //	set_str_value (E_CONTACT_EMAIL_1,  SPropTagArray->aulPropTag[2]);
 	set_str_value (E_CONTACT_FILE_AS,  SPropTagArray->aulPropTag[5]);
 
-	
 //	set_str_value ( E_CONTACT_EMAIL_1, 0x8083001e);
 	set_str_value ( E_CONTACT_EMAIL_2, SPropTagArray->aulPropTag[3]);
 //	set_str_value ( E_CONTACT_EMAIL_2, SPropTagArray->aulPropTag[11]);
-	
+
 	set_str_value ( E_CONTACT_EMAIL_3, SPropTagArray->aulPropTag[4]);
 //	set_str_value ( E_CONTACT_EMAIL_3, SPropTagArray->aulPropTag[12]);
-	
+
 	set_str_value (E_CONTACT_HOMEPAGE_URL, SPropTagArray->aulPropTag[6]);
 	set_str_value (E_CONTACT_FREEBUSY_URL, 0x812C001E);
-	
 
 	set_str_value ( E_CONTACT_PHONE_BUSINESS, PR_OFFICE_TELEPHONE_NUMBER);
 	set_str_value ( E_CONTACT_PHONE_HOME, PR_HOME_TELEPHONE_NUMBER);
@@ -509,7 +501,7 @@ mapi_book_build_props (struct SPropValue ** value, struct SPropTagArray * SPropT
 		time_t lt;
 		NTTIME nt;
 		struct FILETIME t;
-		
+
 		tmtime.tm_mday = date->day - 1;
 		tmtime.tm_mon = date->month - 1;
 		tmtime.tm_year = date->year - 1900;
@@ -528,7 +520,7 @@ mapi_book_build_props (struct SPropValue ** value, struct SPropTagArray * SPropT
 		time_t lt;
 		NTTIME nt;
 		struct FILETIME t;
-		
+
 		tmtime.tm_mday = date->day - 1;
 		tmtime.tm_mon = date->month - 1;
 		tmtime.tm_year = date->year - 1900;
@@ -539,7 +531,7 @@ mapi_book_build_props (struct SPropValue ** value, struct SPropTagArray * SPropT
 		t.dwHighDateTime = (nt >> 32);
 		printf("sending wed\n");
 		set_SPropValue_proptag (&props[i++], PR_WEDDING_ANNIVERSARY, &t);
-	}	
+	}
 	//Home and Office address
 	if (e_contact_get (contact, E_CONTACT_ADDRESS_HOME)) {
 		EContactAddress *contact_addr;
@@ -550,7 +542,7 @@ mapi_book_build_props (struct SPropValue ** value, struct SPropTagArray * SPropT
 		set_SPropValue_proptag (&props[i++], PR_HOME_ADDRESS_CITY, contact_addr->locality);
 		set_SPropValue_proptag (&props[i++], PR_HOME_ADDRESS_STATE_OR_PROVINCE, contact_addr->region);
 		set_SPropValue_proptag (&props[i++], PR_HOME_ADDRESS_POSTAL_CODE, contact_addr->code);
-		set_SPropValue_proptag (&props[i++], PR_HOME_ADDRESS_COUNTRY, contact_addr->country);				
+		set_SPropValue_proptag (&props[i++], PR_HOME_ADDRESS_COUNTRY, contact_addr->country);
 	}
 
 	if (e_contact_get (contact, E_CONTACT_ADDRESS_WORK)) {
@@ -562,22 +554,21 @@ mapi_book_build_props (struct SPropValue ** value, struct SPropTagArray * SPropT
 		set_SPropValue_proptag (&props[i++], PR_LOCALITY, contact_addr->locality);
 		set_SPropValue_proptag (&props[i++], PR_STATE_OR_PROVINCE, contact_addr->region);
 		set_SPropValue_proptag (&props[i++], PR_POSTAL_CODE, contact_addr->code);
-		set_SPropValue_proptag (&props[i++], PR_COUNTRY, contact_addr->country);				
+		set_SPropValue_proptag (&props[i++], PR_COUNTRY, contact_addr->country);
 	}
 
-	
-// 	set_str_value (E_CONTACT_NICKNAME, SPropTagArray->aulPropTag[10]); 
+//	set_str_value (E_CONTACT_NICKNAME, SPropTagArray->aulPropTag[10]);
 	if (e_contact_get (contact, E_CONTACT_IM_AIM)) {
 		GList *l = e_contact_get (contact, E_CONTACT_IM_AIM);
 		set_SPropValue_proptag (&props[i++], SPropTagArray->aulPropTag[7], l->data);
 	}
 
 	if (e_contact_get (contact, E_CONTACT_NICKNAME)) {
-		char *nick  = e_contact_get (contact, E_CONTACT_NICKNAME);
+		gchar *nick  = e_contact_get (contact, E_CONTACT_NICKNAME);
 //		set_SPropValue_proptag (&props[i++], SPropTagArray->aulPropTag[10], nick);
 		printf("nickname %s %x\n", nick,  SPropTagArray->aulPropTag[10]);
 	}
-	
+
 	*value =props;
 	printf("Sending %d \n", i);
 	return i;
@@ -587,22 +578,22 @@ static void
 e_book_backend_mapi_create_contact (EBookBackend *backend,
 					  EDataBook *book,
 					  guint32 opid,
-					  const char *vcard )
+					  const gchar *vcard )
 {
 	EContact *contact;
-	char *id;
+	gchar *id;
 	mapi_id_t status;
 	EBookBackendMAPIPrivate *priv = ((EBookBackendMAPI *) backend)->priv;
 
-	if(enable_debug)
+	if (enable_debug)
 		printf("mapi create_contact \n");
-	
+
 	switch (priv->mode) {
 
 	case GNOME_Evolution_Addressbook_MODE_LOCAL :
 		e_data_book_respond_create(book, opid, GNOME_Evolution_Addressbook_RepositoryOffline, NULL);
 		return;
-	   
+
 	case  GNOME_Evolution_Addressbook_MODE_REMOTE :
 		contact = e_contact_new_from_vcard(vcard);
 		status = exchange_mapi_create_item (olFolderContacts, priv->fid, mapi_book_build_name_id, contact, mapi_book_build_props, contact, NULL, NULL, NULL, 0);
@@ -610,12 +601,12 @@ e_book_backend_mapi_create_contact (EBookBackend *backend,
 			e_data_book_respond_create(book, opid, GNOME_Evolution_Addressbook_OtherError, NULL);
 			return;
 		}
-		id = exchange_mapi_util_mapi_ids_to_uid (priv->fid, status); 
-	
+		id = exchange_mapi_util_mapi_ids_to_uid (priv->fid, status);
+
 		/* UID of the contact is nothing but the concatenated string of hex id of folder and the message.*/
-		e_contact_set (contact, E_CONTACT_UID, id);		
+		e_contact_set (contact, E_CONTACT_UID, id);
 		e_contact_set (contact, E_CONTACT_BOOK_URI, priv->uri);
-		
+
 		//somehow get the mid.
 		//add to summary and cache.
 		if (priv->marked_for_offline && priv->is_cache_ready)
@@ -625,9 +616,9 @@ e_book_backend_mapi_create_contact (EBookBackend *backend,
 			e_book_backend_summary_add_contact (priv->summary, contact);
 
 		e_data_book_respond_create(book, opid, GNOME_Evolution_Addressbook_Success, contact);
-		return;			
+		return;
 	}
-	
+
 	return;
 }
 
@@ -637,12 +628,12 @@ e_book_backend_mapi_remove_contacts (EBookBackend *backend,
 					   guint32 opid,
 					   GList *id_list)
 {
-	GSList *list=NULL; 
+	GSList *list=NULL;
 	GList *tmp = id_list;
 	EBookBackendMAPIPrivate *priv = ((EBookBackendMAPI *) backend)->priv;
 	mapi_id_t fid, mid;
-			
-	if(enable_debug)
+
+	if (enable_debug)
 		printf("mapi: remove_contacts\n");
 
 	switch (priv->mode) {
@@ -652,7 +643,7 @@ e_book_backend_mapi_remove_contacts (EBookBackend *backend,
 		return;
 
 	case GNOME_Evolution_Addressbook_MODE_REMOTE:
-		
+
 		while (tmp) {
 			struct id_list *data = g_new (struct id_list, 1);
 			exchange_mapi_util_mapi_ids_from_uid (tmp->data, &fid, &mid);
@@ -673,11 +664,11 @@ e_book_backend_mapi_remove_contacts (EBookBackend *backend,
 		if (priv->marked_for_offline && priv->is_summary_ready) {
 			tmp = id_list;
 			while (tmp) {
-				e_book_backend_summary_remove_contact (priv->summary, tmp->data);		
+				e_book_backend_summary_remove_contact (priv->summary, tmp->data);
 				tmp = tmp->next;
 			}
 		}
-		
+
 		g_slist_free (list);
 		e_data_book_respond_remove_contacts (book, opid,
 							     GNOME_Evolution_Addressbook_Success, id_list);
@@ -691,15 +682,15 @@ static void
 e_book_backend_mapi_modify_contact (EBookBackend *backend,
 					  EDataBook    *book,
 					  guint32       opid,
-					  const char   *vcard)
+					  const gchar   *vcard)
 {
 	EBookBackendMAPIPrivate *priv = ((EBookBackendMAPI *) backend)->priv;
 	EContact *contact;
 	mapi_id_t fid, mid;
 	gboolean status;
-	char *tmp;
-	
-	if(enable_debug)
+	gchar *tmp;
+
+	if (enable_debug)
 		printf("mapi: modify_contacts\n");
 
 	switch (priv->mode) {
@@ -710,16 +701,16 @@ e_book_backend_mapi_modify_contact (EBookBackend *backend,
 	case GNOME_Evolution_Addressbook_MODE_REMOTE :
 		contact = e_contact_new_from_vcard(vcard);
 		tmp = e_contact_get (contact, E_CONTACT_UID);
-		exchange_mapi_util_mapi_ids_from_uid (tmp, &fid, &mid);		
+		exchange_mapi_util_mapi_ids_from_uid (tmp, &fid, &mid);
 		printf("modify id %s\n", tmp);
-		
+
 		status = exchange_mapi_modify_item (olFolderContacts, priv->fid, mid, mapi_book_build_name_id, contact, mapi_book_build_props, contact, NULL, NULL, NULL, 0);
 		printf("getting %d\n", status);
 		if (!status) {
 			e_data_book_respond_modify(book, opid, GNOME_Evolution_Addressbook_OtherError, NULL);
 			return;
 		}
-		
+
 		e_contact_set (contact, E_CONTACT_BOOK_URI, priv->uri);
 
 		//FIXME: Write it cleanly
@@ -728,16 +719,14 @@ e_book_backend_mapi_modify_contact (EBookBackend *backend,
 
 		if (priv->marked_for_offline && priv->is_summary_ready)
 				e_book_backend_summary_remove_contact (priv->summary, tmp);
-		
+
 		if (priv->marked_for_offline && priv->is_cache_ready)
 			e_book_backend_cache_add_contact (priv->cache, contact);
 
 		if (priv->marked_for_offline && priv->is_summary_ready)
 			e_book_backend_summary_add_contact (priv->summary, contact);
-		
-		
-		e_data_book_respond_modify (book, opid, GNOME_Evolution_Addressbook_Success, contact);
 
+		e_data_book_respond_modify (book, opid, GNOME_Evolution_Addressbook_Success, contact);
 
 	}
 }
@@ -746,9 +735,9 @@ static gboolean
 create_contact_item (FetchItemsCallbackData *item_data, gpointer data)
 {
 	EContact *contact;
-	char *suid;
+	gchar *suid;
 	GSList *recipients = item_data->recipients;
-	
+
 	contact = emapidump_contact (item_data->properties);
 	suid = exchange_mapi_util_mapi_ids_to_uid (item_data->fid, item_data->mid);
 	printf("got contact %s\n", suid);
@@ -769,22 +758,22 @@ static void
 e_book_backend_mapi_get_contact (EBookBackend *backend,
 				       EDataBook    *book,
 				       guint32       opid,
-				       const char   *id)
+				       const gchar   *id)
 {
 	EBookBackendMAPIPrivate *priv = ((EBookBackendMAPI *) backend)->priv;
 	EContact *contact = NULL;
-	char *vcard;
-	
+	gchar *vcard;
+
 	if (enable_debug)
 		printf("mapi: get_contact %s\n", id);
 
 	switch (priv->mode) {
-	
+
 	case GNOME_Evolution_Addressbook_MODE_LOCAL:
 		contact = e_book_backend_cache_get_contact (priv->cache,
 							    id);
 		if (contact) {
-			vcard =  e_vcard_to_string (E_VCARD (contact), 
+			vcard =  e_vcard_to_string (E_VCARD (contact),
 						     EVC_FORMAT_VCARD_30);
 			e_data_book_respond_get_contact (book,
 							 opid,
@@ -795,17 +784,17 @@ e_book_backend_mapi_get_contact (EBookBackend *backend,
 			return;
 		}
 		else {
-			e_data_book_respond_get_contact (book, opid, GNOME_Evolution_Addressbook_ContactNotFound, "");			
+			e_data_book_respond_get_contact (book, opid, GNOME_Evolution_Addressbook_ContactNotFound, "");
 			return;
 		}
-		
+
 	case GNOME_Evolution_Addressbook_MODE_REMOTE:
 
 		if (priv->marked_for_offline && e_book_backend_cache_is_populated (priv->cache)) {
 			contact = e_book_backend_cache_get_contact (priv->cache,
 								    id);
 			if (contact) {
-				vcard =  e_vcard_to_string (E_VCARD (contact), 
+				vcard =  e_vcard_to_string (E_VCARD (contact),
 							     EVC_FORMAT_VCARD_30);
 				e_data_book_respond_get_contact (book,
 								 opid,
@@ -816,23 +805,23 @@ e_book_backend_mapi_get_contact (EBookBackend *backend,
 				return;
 			}
 			else {
-				e_data_book_respond_get_contact (book, opid, GNOME_Evolution_Addressbook_ContactNotFound, "");			
+				e_data_book_respond_get_contact (book, opid, GNOME_Evolution_Addressbook_ContactNotFound, "");
 				return;
 			}
 
 		} else {
 			mapi_id_t fid, mid;
-			
+
 			exchange_mapi_util_mapi_ids_from_uid (id, &fid, &mid);
-			exchange_mapi_connection_fetch_item (priv->fid, mid, 
-							NULL, 0, 
-							NULL, NULL, 
-							create_contact_item, contact, 
+			exchange_mapi_connection_fetch_item (priv->fid, mid,
+							NULL, 0,
+							NULL, NULL,
+							create_contact_item, contact,
 							MAPI_OPTIONS_FETCH_ALL);
 
 			if (contact) {
 				e_contact_set (contact, E_CONTACT_BOOK_URI, priv->uri);
-				vcard =  e_vcard_to_string (E_VCARD (contact), 
+				vcard =  e_vcard_to_string (E_VCARD (contact),
 							     EVC_FORMAT_VCARD_30);
 				e_data_book_respond_get_contact (book,
 								 opid,
@@ -841,10 +830,10 @@ e_book_backend_mapi_get_contact (EBookBackend *backend,
 				g_free (vcard);
 				g_object_unref (contact);
 				return;
-			
+
 			} else {
-				e_data_book_respond_get_contact (book, opid, GNOME_Evolution_Addressbook_ContactNotFound, "");			
-				return;				
+				e_data_book_respond_get_contact (book, opid, GNOME_Evolution_Addressbook_ContactNotFound, "");
+				return;
 			}
 		}
 
@@ -853,7 +842,7 @@ e_book_backend_mapi_get_contact (EBookBackend *backend,
 	}
 
 	return;
-	
+
 }
 
 static gboolean
@@ -865,19 +854,19 @@ create_contact_list_cb (FetchItemsCallbackData *item_data, gpointer data)
 
 	GList *list = * (GList **) data;
 	EContact *contact;
-	char *suid;
-	
+	gchar *suid;
+
 	contact = emapidump_contact (array);
 	suid = exchange_mapi_util_mapi_ids_to_uid (fid, mid);
-	
+
 	if (contact) {
 		/* UID of the contact is nothing but the concatenated string of hex id of folder and the message.*/
 		printf("Contact added %s\n", suid);
-		e_contact_set (contact, E_CONTACT_UID, suid);		
+		e_contact_set (contact, E_CONTACT_UID, suid);
 //		e_contact_set (contact, E_CONTACT_BOOK_URI, priv->uri);
 		//FIXME: Should we set this? How can we get this first?
 		list = g_list_prepend (list, e_vcard_to_string (E_VCARD (contact),
-							        EVC_FORMAT_VCARD_30));
+								EVC_FORMAT_VCARD_30));
 		g_object_unref (contact);
 		if (* (GList **)data == NULL)
 			* (GList **)data = list;
@@ -918,7 +907,7 @@ static void
 e_book_backend_mapi_get_contact_list (EBookBackend *backend,
 					    EDataBook    *book,
 					    guint32       opid,
-					    const char   *query )
+					    const gchar   *query )
 {
 	EBookBackendMAPIPrivate *priv = ((EBookBackendMAPI *) backend)->priv;
 
@@ -947,7 +936,7 @@ e_book_backend_mapi_get_contact_list (EBookBackend *backend,
 		e_data_book_respond_get_contact_list (book, opid, GNOME_Evolution_Addressbook_RepositoryOffline,
 						      NULL);
 		return;
-		
+
 	case GNOME_Evolution_Addressbook_MODE_REMOTE:
 		printf("Mode : Remote\n");
 		if (priv->marked_for_offline && priv->cache) {
@@ -957,17 +946,17 @@ e_book_backend_mapi_get_contact_list (EBookBackend *backend,
 
 			contacts = e_book_backend_cache_get_contacts (priv->cache, query);
 
-			for (l = contacts; l ;l = g_list_next (l)) {
+			for (l = contacts; l;l = g_list_next (l)) {
 				EContact *contact = l->data;
 				vcard_strings = g_list_prepend (vcard_strings, e_vcard_to_string (E_VCARD (contact),
-							        EVC_FORMAT_VCARD_30));
+								EVC_FORMAT_VCARD_30));
 				g_object_unref (contact);
 			}
 
 			g_list_free (contacts);
-			printf("get_contact_list in %s  returning %d contacts\n", priv->uri, g_list_length (vcard_strings));			
+			printf("get_contact_list in %s  returning %d contacts\n", priv->uri, g_list_length (vcard_strings));
 			e_data_book_respond_get_contact_list (book, opid, GNOME_Evolution_Addressbook_Success, vcard_strings);
-			return ;
+			return;
 		}
 		else {
 			struct mapi_SRestriction res;
@@ -978,23 +967,23 @@ e_book_backend_mapi_get_contact_list (EBookBackend *backend,
 			/* Unfortunately MAPI Doesn't support searching well, we do allow only online search for emails rest all are returned as error. */
 			if (!build_restriction_emails_contains (&res, query)) {
 				e_data_book_respond_get_contact_list (book, opid, GNOME_Evolution_Addressbook_OtherError, NULL);
-				return ;				
+				return;
 			}
 
 			if (!exchange_mapi_connection_fetch_items (priv->fid, &res, NULL,
-								GetPropsList, n_GetPropsList, 
-								mapi_book_build_name_id_for_getprops, NULL, 
-								create_contact_list_cb, &vcard_str, 
+								GetPropsList, n_GetPropsList,
+								mapi_book_build_name_id_for_getprops, NULL,
+								create_contact_list_cb, &vcard_str,
 								MAPI_OPTIONS_FETCH_ALL)) {
 				e_data_book_respond_get_contact_list (book, opid, GNOME_Evolution_Addressbook_OtherError, NULL);
-				return ;
+				return;
 			}
-			printf("get_contact_list in %s returning %d contacts\n", priv->uri, g_list_length (vcard_str));			
+			printf("get_contact_list in %s returning %d contacts\n", priv->uri, g_list_length (vcard_str));
 			e_data_book_respond_get_contact_list (book, opid, GNOME_Evolution_Addressbook_Success, vcard_str);
-			return ;
-			
+			return;
+
 		}
-	}	
+	}
 }
 
 typedef struct {
@@ -1036,8 +1025,8 @@ static EContact *
 emapidump_contact(struct mapi_SPropValue_array *properties)
 {
 	EContact *contact = e_contact_new ();
-	int i;
-	
+	gint i;
+
 //	exchange_mapi_debug_property_dump (properties);
 	for (i=1; i<maplen; i++) {
 		gpointer value;
@@ -1052,7 +1041,7 @@ emapidump_contact(struct mapi_SPropValue_array *properties)
 				struct FILETIME *t = value;
 				time_t time;
 				NTTIME nt;
-				char buff[129];
+				gchar buff[129];
 
 				nt = t->dwHighDateTime;
 				nt = nt << 32;
@@ -1087,7 +1076,7 @@ emapidump_contact(struct mapi_SPropValue_array *properties)
 					date.year = tmtime->tm_year + 1900;
 					e_contact_set (contact, mappings[i].field_id, &date);
 				}
-				
+
 			} else if (mappings[i].field_id == E_CONTACT_ADDRESS_WORK
 				   || mappings[i].field_id == E_CONTACT_ADDRESS_HOME) {
 				EContactAddress contact_addr = { 0 };
@@ -1096,49 +1085,49 @@ emapidump_contact(struct mapi_SPropValue_array *properties)
 				if (mappings[i].field_id == E_CONTACT_ADDRESS_HOME) {
 					contact_addr.address_format = NULL;
 					contact_addr.po = NULL;
-					contact_addr.street = (char *)value;
-					contact_addr.ext = (char *)find_mapi_SPropValue_data (properties, PR_HOME_ADDRESS_POST_OFFICE_BOX);
-					contact_addr.locality = (char *)find_mapi_SPropValue_data (properties, PR_HOME_ADDRESS_CITY);
-					contact_addr.region = (char *)find_mapi_SPropValue_data (properties, PR_HOME_ADDRESS_STATE_OR_PROVINCE);
-					contact_addr.code = (char *)find_mapi_SPropValue_data (properties, PR_HOME_ADDRESS_POSTAL_CODE);
-					contact_addr.country = (char *)find_mapi_SPropValue_data (properties, PR_HOME_ADDRESS_COUNTRY);
+					contact_addr.street = (gchar *)value;
+					contact_addr.ext = (gchar *)find_mapi_SPropValue_data (properties, PR_HOME_ADDRESS_POST_OFFICE_BOX);
+					contact_addr.locality = (gchar *)find_mapi_SPropValue_data (properties, PR_HOME_ADDRESS_CITY);
+					contact_addr.region = (gchar *)find_mapi_SPropValue_data (properties, PR_HOME_ADDRESS_STATE_OR_PROVINCE);
+					contact_addr.code = (gchar *)find_mapi_SPropValue_data (properties, PR_HOME_ADDRESS_POSTAL_CODE);
+					contact_addr.country = (gchar *)find_mapi_SPropValue_data (properties, PR_HOME_ADDRESS_COUNTRY);
 				} else {
 					contact_addr.address_format = NULL;
 					contact_addr.po = NULL;
-					contact_addr.street = (char *)value;
-					contact_addr.ext = (char *)find_mapi_SPropValue_data (properties, PR_POST_OFFICE_BOX);
-					contact_addr.locality = (char *)find_mapi_SPropValue_data (properties, PR_LOCALITY);
-					contact_addr.region = (char *)find_mapi_SPropValue_data (properties, PR_STATE_OR_PROVINCE);
-					contact_addr.code = (char *)find_mapi_SPropValue_data (properties, PR_POSTAL_CODE);
-					contact_addr.country = (char *)find_mapi_SPropValue_data (properties, PR_COUNTRY);
+					contact_addr.street = (gchar *)value;
+					contact_addr.ext = (gchar *)find_mapi_SPropValue_data (properties, PR_POST_OFFICE_BOX);
+					contact_addr.locality = (gchar *)find_mapi_SPropValue_data (properties, PR_LOCALITY);
+					contact_addr.region = (gchar *)find_mapi_SPropValue_data (properties, PR_STATE_OR_PROVINCE);
+					contact_addr.code = (gchar *)find_mapi_SPropValue_data (properties, PR_POSTAL_CODE);
+					contact_addr.country = (gchar *)find_mapi_SPropValue_data (properties, PR_COUNTRY);
 				}
 				e_contact_set (contact, mappings[i].field_id, &contact_addr);
 			}
 		}
 	}
-	
+
 	return contact;
 }
 
 static void
-get_contacts_from_cache (EBookBackendMAPI *ebmapi, 
-			 const char *query,
+get_contacts_from_cache (EBookBackendMAPI *ebmapi,
+			 const gchar *query,
 			 GPtrArray *ids,
-			 EDataBookView *book_view, 
+			 EDataBookView *book_view,
 			 BESearchClosure *closure)
 {
-	int i;
+	gint i;
 
 	if (enable_debug)
 		printf ("\nread contacts from cache for the ids found in summary\n");
 	for (i = 0; i < ids->len; i ++) {
-		char *uid;
-		EContact *contact; 
+		gchar *uid;
+		EContact *contact;
 
                 if (!e_flag_is_set (closure->running))
                         break;
 
- 		uid = g_ptr_array_index (ids, i);
+		uid = g_ptr_array_index (ids, i);
 		contact = e_book_backend_cache_get_contact (ebmapi->priv->cache, uid);
 		if (contact) {
 			e_data_book_view_notify_update (book_view, contact);
@@ -1146,7 +1135,7 @@ get_contacts_from_cache (EBookBackendMAPI *ebmapi,
 		}
 	}
 	if (e_flag_is_set (closure->running))
-		e_data_book_view_notify_complete (book_view, 
+		e_data_book_view_notify_complete (book_view,
 						  GNOME_Evolution_Addressbook_Success);
 }
 
@@ -1158,19 +1147,19 @@ create_contact_cb (FetchItemsCallbackData *item_data, gpointer data)
 	EBookBackendMAPI *be = closure->bg;
 	EContact *contact;
 	EBookBackendMAPIPrivate *priv = ((EBookBackendMAPI *) be)->priv;
-	char *suid;
-	
+	gchar *suid;
+
 	if (!e_flag_is_set (closure->running)) {
 		printf("Might be that the operation is cancelled. Lets ask our parent also to do.\n");
 		return FALSE;
 	}
-	
+
 	contact = emapidump_contact (item_data->properties);
 	suid = exchange_mapi_util_mapi_ids_to_uid (item_data->fid, item_data->mid);
-	
+
 	if (contact) {
 		/* UID of the contact is nothing but the concatenated string of hex id of folder and the message.*/
-		e_contact_set (contact, E_CONTACT_UID, suid);		
+		e_contact_set (contact, E_CONTACT_UID, suid);
 		e_contact_set (contact, E_CONTACT_BOOK_URI, priv->uri);
 		e_data_book_view_notify_update (book_view, contact);
 		g_object_unref(contact);
@@ -1189,39 +1178,39 @@ book_view_thread (gpointer data)
 	BESearchClosure *closure = get_closure (book_view);
 	EBookBackendMAPI *backend = closure->bg;
 	EBookBackendMAPIPrivate *priv = backend->priv;
-	const char *query = NULL;
+	const gchar *query = NULL;
 	GPtrArray *ids = NULL;
 	GList *contacts = NULL, *temp_list = NULL;
 	//Number of multiple restriction to apply
-	unsigned int res_count = 6;
-	
+	guint res_count = 6;
+
 	if (enable_debug)
 		printf("mapi: book view\n");
-	
+
 	g_object_ref (book_view);
 	e_flag_set (closure->running);
-						
+
 	e_data_book_view_notify_status_message (book_view, "Searching...");
 	query = e_data_book_view_get_card_query (book_view);
-						
+
 	switch (priv->mode) {
 
 	case GNOME_Evolution_Addressbook_MODE_LOCAL:
 		if (!priv->marked_for_offline) {
-			e_data_book_view_notify_complete (book_view, 
+			e_data_book_view_notify_complete (book_view,
 					GNOME_Evolution_Addressbook_OfflineUnavailable);
 			g_object_unref (book_view);
 			return;
 		}
 		if (!priv->cache) {
 			printf("The cache is not yet built\n");
-			e_data_book_view_notify_complete (book_view, 
+			e_data_book_view_notify_complete (book_view,
 					GNOME_Evolution_Addressbook_Success);
 			return;
 		}
 
-		if (priv->is_summary_ready && 
-	    	    e_book_backend_summary_is_summary_query (priv->summary, query)) {
+		if (priv->is_summary_ready &&
+		    e_book_backend_summary_is_summary_query (priv->summary, query)) {
 			if (enable_debug)
 				printf ("reading the contacts from summary \n");
 			ids = e_book_backend_summary_search (priv->summary, query);
@@ -1236,8 +1225,8 @@ book_view_thread (gpointer data)
 		/* fall back to cache */
 		if (enable_debug)
 			printf ("summary not found or a summary query  reading the contacts from cache %s\n", query);
-		
-		contacts = e_book_backend_cache_get_contacts (priv->cache, 
+
+		contacts = e_book_backend_cache_get_contacts (priv->cache,
 							      query);
 		temp_list = contacts;
 		for (; contacts != NULL; contacts = g_list_next(contacts)) {
@@ -1245,19 +1234,19 @@ book_view_thread (gpointer data)
 				for (;contacts != NULL; contacts = g_list_next (contacts))
 					g_object_unref (contacts->data);
 				break;
-			}			
-			e_data_book_view_notify_update (book_view, 
+			}
+			e_data_book_view_notify_update (book_view,
 							E_CONTACT(contacts->data));
 			g_object_unref (contacts->data);
 		}
 		if (e_flag_is_set (closure->running))
-			e_data_book_view_notify_complete (book_view, 
+			e_data_book_view_notify_complete (book_view,
 							  GNOME_Evolution_Addressbook_Success);
 		if (temp_list)
 			 g_list_free (temp_list);
 		g_object_unref (book_view);
 		return;
-		
+
 	case GNOME_Evolution_Addressbook_MODE_REMOTE:
 
 		if (!exchange_mapi_connection_exists ()) {
@@ -1267,10 +1256,9 @@ book_view_thread (gpointer data)
 			g_object_unref (book_view);
 			return;
 		}
-		
 
 		if (priv->marked_for_offline && priv->cache && priv->is_cache_ready) {
-			if (priv->is_summary_ready && 
+			if (priv->is_summary_ready &&
 			    e_book_backend_summary_is_summary_query (priv->summary, query)) {
 				if (enable_debug)
 					printf ("reading the contacts from summary \n");
@@ -1282,11 +1270,11 @@ book_view_thread (gpointer data)
 				g_object_unref (book_view);
 				return;
 			}
-			
+
 			printf("Summary seems to be not there or not a summary query, lets fetch from cache directly\n");
-			
+
 			/* We are already cached. Lets return from there. */
-			contacts = e_book_backend_cache_get_contacts (priv->cache, 
+			contacts = e_book_backend_cache_get_contacts (priv->cache,
 								      query);
 			temp_list = contacts;
 			for (; contacts != NULL; contacts = g_list_next(contacts)) {
@@ -1294,54 +1282,54 @@ book_view_thread (gpointer data)
 					for (;contacts != NULL; contacts = g_list_next (contacts))
 						g_object_unref (contacts->data);
 					break;
-				}							
-				e_data_book_view_notify_update (book_view, 
+				}
+				e_data_book_view_notify_update (book_view,
 								E_CONTACT(contacts->data));
 				g_object_unref (contacts->data);
 			}
 			if (e_flag_is_set (closure->running))
-				e_data_book_view_notify_complete (book_view, 
+				e_data_book_view_notify_complete (book_view,
 								  GNOME_Evolution_Addressbook_Success);
 			if (temp_list)
 				 g_list_free (temp_list);
 			g_object_unref (book_view);
 			return;
 		}
-		
+
 		if (e_book_backend_summary_is_summary_query (priv->summary, query)) {
 			or_res = g_new (struct mapi_SRestriction_or, res_count);
-	
+
 			if (!build_multiple_restriction_emails_contains (&res, or_res, query)) {
-				e_data_book_view_notify_complete (book_view, 
+				e_data_book_view_notify_complete (book_view,
 							  GNOME_Evolution_Addressbook_OtherError);
-				return ;
-			} 
+				return;
+			}
 
 			//FIXME: We need to fetch only the query from the server live and not everything.
 			if (!exchange_mapi_connection_fetch_items (priv->fid, &res, NULL,
-							   GetPropsList, n_GetPropsList, 
-							   mapi_book_build_name_id_for_getprops, NULL, 
-							   create_contact_cb, book_view, 
+							   GetPropsList, n_GetPropsList,
+							   mapi_book_build_name_id_for_getprops, NULL,
+							   create_contact_cb, book_view,
 							   MAPI_OPTIONS_FETCH_ALL)) {
-        	                if (e_flag_is_set (closure->running))
-                	                e_data_book_view_notify_complete (book_view, 
-                        	                                          GNOME_Evolution_Addressbook_OtherError);      
-	                        g_object_unref (book_view);
-					
+			if (e_flag_is_set (closure->running))
+				e_data_book_view_notify_complete (book_view,
+								  GNOME_Evolution_Addressbook_OtherError);
+				g_object_unref (book_view);
+
 				if (or_res)
 					g_free(or_res);
-	
-        	                return;
-                	}
+
+				return;
+			}
 		} else {
 			if (!exchange_mapi_connection_fetch_items (priv->fid, NULL, NULL,
-							NULL, 0, 
-							NULL, NULL, 
-							create_contact_cb, book_view, 
+							NULL, 0,
+							NULL, NULL,
+							create_contact_cb, book_view,
 							MAPI_OPTIONS_FETCH_ALL)) {
 				if (e_flag_is_set (closure->running))
-					e_data_book_view_notify_complete (book_view, 
-									  GNOME_Evolution_Addressbook_OtherError);      
+					e_data_book_view_notify_complete (book_view,
+									  GNOME_Evolution_Addressbook_OtherError);
 				g_object_unref (book_view);
 				return;
 			}
@@ -1352,8 +1340,6 @@ book_view_thread (gpointer data)
 							  GNOME_Evolution_Addressbook_Success);
 		g_object_unref (book_view);
 
-		
-
 	default:
 		break;
 	}
@@ -1374,16 +1360,16 @@ e_book_backend_mapi_start_book_view (EBookBackend  *backend,
 		printf ("mapi: start_book_view...\n");
 	closure->thread = g_thread_create ((GThreadFunc) book_view_thread, book_view, FALSE, NULL);
 	e_flag_wait (closure->running);
-	
-	/* at this point we know the book view thread is actually running */	
+
+	/* at this point we know the book view thread is actually running */
 }
 
 static void
 e_book_backend_mapi_stop_book_view (EBookBackend  *backend,
 					  EDataBookView *book_view)
 {
-	if(enable_debug)
-		printf("mapi: stop book view\n");	
+	if (enable_debug)
+		printf("mapi: stop book view\n");
 	/* FIXME : provide implmentation */
 }
 
@@ -1391,44 +1377,44 @@ static void
 e_book_backend_mapi_get_changes (EBookBackend *backend,
 				       EDataBook    *book,
 				       guint32       opid,
-				       const char *change_id  )
+				       const gchar *change_id  )
 {
-	if(enable_debug)
-		printf("mapi: get changes\n");	
+	if (enable_debug)
+		printf("mapi: get changes\n");
 	/* FIXME : provide implmentation */
 	e_data_book_respond_get_changes (book, opid, GNOME_Evolution_Addressbook_RepositoryOffline, NULL);
 }
 
-static gboolean 
+static gboolean
 cache_contact_cb (FetchItemsCallbackData *item_data, gpointer data)
 {
 	EBookBackendMAPI *be = data;
 	EContact *contact;
 	EBookBackendMAPIPrivate *priv = ((EBookBackendMAPI *) be)->priv;
-	char *suid;
+	gchar *suid;
 
 	contact = emapidump_contact (item_data->properties);
 	suid = exchange_mapi_util_mapi_ids_to_uid (item_data->fid, item_data->mid);
-	
+
 	if (contact) {
 		/* UID of the contact is nothing but the concatenated string of hex id of folder and the message.*/
-		e_contact_set (contact, E_CONTACT_UID, suid);		
+		e_contact_set (contact, E_CONTACT_UID, suid);
 		e_contact_set (contact, E_CONTACT_BOOK_URI, priv->uri);
 		e_book_backend_cache_add_contact (priv->cache, contact);
-		e_book_backend_summary_add_contact (priv->summary, contact);		
+		e_book_backend_summary_add_contact (priv->summary, contact);
 		g_object_unref(contact);
 	}
 
 	g_free (suid);
-	return TRUE;	
+	return TRUE;
 }
 
 static gpointer
 build_cache (EBookBackendMAPI *ebmapi)
 {
 	EBookBackendMAPIPrivate *priv = ((EBookBackendMAPI *) ebmapi)->priv;
-	char *tmp;
-	
+	gchar *tmp;
+
 	//FIXME: What if book view is NULL? Can it be? Check that.
 	if (!priv->cache) {
 		printf("Caching for the first time\n");
@@ -1436,23 +1422,23 @@ build_cache (EBookBackendMAPI *ebmapi)
 	}
 
 	if (!priv->summary) {
-		priv->summary = e_book_backend_summary_new (priv->summary_file_name, 
+		priv->summary = e_book_backend_summary_new (priv->summary_file_name,
 							    SUMMARY_FLUSH_TIMEOUT);
 		printf("Summary file name is %s\n", priv->summary_file_name);
 	}
-	
+
 	e_file_cache_freeze_changes (E_FILE_CACHE (priv->cache));
-	
+
 	if (!exchange_mapi_connection_fetch_items (priv->fid, NULL, NULL,
-						NULL, 0, 
-						NULL, NULL, 
-						cache_contact_cb, ebmapi, 
+						NULL, 0,
+						NULL, NULL,
+						cache_contact_cb, ebmapi,
 						MAPI_OPTIONS_FETCH_ALL)) {
 		printf("Error during caching addressbook\n");
 		e_file_cache_thaw_changes (E_FILE_CACHE (priv->cache));
 		return NULL;
 	}
-	tmp = g_strdup_printf("%d", (int)time (NULL));
+	tmp = g_strdup_printf("%d", (gint)time (NULL));
 	e_book_backend_cache_set_time (priv->cache, tmp);
 	printf("setting time  %s\n", tmp);
 	g_free (tmp);
@@ -1460,7 +1446,7 @@ build_cache (EBookBackendMAPI *ebmapi)
 	e_book_backend_summary_save (priv->summary);
 	priv->is_cache_ready = TRUE;
 	priv->is_summary_ready = TRUE;
-	return NULL;		
+	return NULL;
 }
 
 #if 0
@@ -1468,11 +1454,11 @@ static gpointer
 update_cache (EBookBackendMAPI *ebmapi)
 {
 	EBookBackendMAPIPrivate *priv = ((EBookBackendMAPI *) ebmapi)->priv;
-	char *tmp = e_book_backend_cache_get_time (priv->cache);
+	gchar *tmp = e_book_backend_cache_get_time (priv->cache);
 	//FIXME: What if book view is NULL? Can it be? Check that.
 	time_t t=0;
 //	struct mapi_SRestriction res;
-	
+
 	if (tmp)
 		t = atoi (tmp);
 
@@ -1485,13 +1471,13 @@ update_cache (EBookBackendMAPI *ebmapi)
 #if 0
 	printf("time updated was %d\n", t);
 	/* Assume the cache and summary are already there */
-	
+
 	e_file_cache_freeze_changes (E_FILE_CACHE (priv->cache));
-	
+
 	if (!exchange_mapi_connection_fetch_items ( priv->fid, &res, NULL,
-						NULL, 0, 
-						NULL, NULL, 
-						cache_contact_cb, ebmapi, 
+						NULL, 0,
+						NULL, NULL,
+						cache_contact_cb, ebmapi,
 						MAPI_OPTIONS_FETCH_ALL)) {
 		printf("Error during caching addressbook\n");
 		e_file_cache_thaw_changes (E_FILE_CACHE (priv->cache));
@@ -1502,7 +1488,7 @@ update_cache (EBookBackendMAPI *ebmapi)
 	priv->is_cache_ready = TRUE;
 	priv->is_summary_ready = TRUE;
 #endif
-	
+
 	return NULL;
 }
 #endif
@@ -1511,45 +1497,44 @@ static void
 e_book_backend_mapi_authenticate_user (EBookBackend *backend,
 					    EDataBook    *book,
 					    guint32       opid,
-					    const char *user,
-					    const char *passwd,
-					    const char *auth_method)
+					    const gchar *user,
+					    const gchar *passwd,
+					    const gchar *auth_method)
 {
 	EBookBackendMAPIPrivate *priv = ((EBookBackendMAPI *) backend)->priv;
-	
+
 	if (enable_debug) {
 		printf ("mapi: authenticate user\n");
-	}	
+	}
 
-	
 	switch (priv->mode) {
 	case GNOME_Evolution_Addressbook_MODE_LOCAL:
 		e_book_backend_notify_writable (backend, FALSE);
-		e_book_backend_notify_connection_status (backend, FALSE); 
-		e_data_book_respond_authenticate_user (book, opid, GNOME_Evolution_Addressbook_Success); 
+		e_book_backend_notify_connection_status (backend, FALSE);
+		e_data_book_respond_authenticate_user (book, opid, GNOME_Evolution_Addressbook_Success);
 		return;
-		
+
 	case GNOME_Evolution_Addressbook_MODE_REMOTE:
-		
+
 		if (!exchange_mapi_connection_new (priv->profile, passwd))
 			return e_data_book_respond_authenticate_user (book, opid,GNOME_Evolution_Addressbook_OtherError);
 
 		if (priv->cache && priv->is_cache_ready) {
 			printf("FIXME: Should check for an update in the cache\n");
-//			g_thread_create ((GThreadFunc) update_cache, 
+//			g_thread_create ((GThreadFunc) update_cache,
 	//					  backend, FALSE, backend);
 		} else if (priv->marked_for_offline && !priv->is_cache_ready) {
 			/* Means we dont have a cache. Lets build that first */
 			printf("Preparing to build cache\n");
 			g_thread_create ((GThreadFunc) build_cache, backend, FALSE, NULL);
-		} 
+		}
 		e_book_backend_set_is_writable (backend, TRUE);
 		e_data_book_respond_authenticate_user (book, opid, GNOME_Evolution_Addressbook_Success);
 		return;
-		
+
 	default :
 		break;
-	}	
+	}
 }
 
 static void
@@ -1561,12 +1546,12 @@ e_book_backend_mapi_get_required_fields (EBookBackend *backend,
 
 	if (enable_debug)
 		printf ("mapi get_required_fields...\n");
-  
-	fields = g_list_append (fields, (char *)e_contact_field_name (E_CONTACT_FILE_AS));
+
+	fields = g_list_append (fields, (gchar *)e_contact_field_name (E_CONTACT_FILE_AS));
 	e_data_book_respond_get_supported_fields (book, opid,
 						  GNOME_Evolution_Addressbook_Success,
 						  fields);
-	g_list_free (fields);	
+	g_list_free (fields);
 }
 
 static void
@@ -1575,14 +1560,14 @@ e_book_backend_mapi_get_supported_fields (EBookBackend *backend,
 					       guint32       opid)
 {
 	GList *fields = NULL;
-	int i;
+	gint i;
 
 	if (enable_debug)
 		printf ("mapi get_supported_fields...\n");
 
 	for (i=0; i<maplen; i++)
 	{
-		fields = g_list_append (fields, (char *)e_contact_field_name (mappings[i].field_id));
+		fields = g_list_append (fields, (gchar *)e_contact_field_name (mappings[i].field_id));
 	}
 	fields = g_list_append (fields, g_strdup (e_contact_field_name (E_CONTACT_BOOK_URI)));
 
@@ -1590,15 +1575,15 @@ e_book_backend_mapi_get_supported_fields (EBookBackend *backend,
 						  GNOME_Evolution_Addressbook_Success,
 						  fields);
 	g_list_free (fields);
-	
+
 }
 
-static void 
+static void
 e_book_backend_mapi_get_supported_auth_methods (EBookBackend *backend, EDataBook *book, guint32 opid)
 {
 	GList *auth_methods = NULL;
-	char *auth_method;
-	
+	gchar *auth_method;
+
 	if (enable_debug)
 		printf ("mapi get_supported_auth_methods...\n");
 
@@ -1607,47 +1592,45 @@ e_book_backend_mapi_get_supported_auth_methods (EBookBackend *backend, EDataBook
 	e_data_book_respond_get_supported_auth_methods (book,
 							opid,
 							GNOME_Evolution_Addressbook_Success,
-							auth_methods);  
+							auth_methods);
 	g_free (auth_method);
-	g_list_free (auth_methods);	
+	g_list_free (auth_methods);
 }
 
-
 static GNOME_Evolution_Addressbook_CallStatus
 e_book_backend_mapi_cancel_operation (EBookBackend *backend, EDataBook *book)
 {
 	if (enable_debug)
 		printf ("mapi cancel_operation...\n");
-	return GNOME_Evolution_Addressbook_CouldNotCancel;	
+	return GNOME_Evolution_Addressbook_CouldNotCancel;
 }
 
-
 static void
 e_book_backend_mapi_remove (EBookBackend *backend,
 				  EDataBook    *book,
 				  guint32      opid)
 {
 	EBookBackendMAPIPrivate *priv = ((EBookBackendMAPI *) backend)->priv;
-	char *cache_uri = NULL;
+	gchar *cache_uri = NULL;
 	gboolean status;
 
-	if(enable_debug)
+	if (enable_debug)
 		printf("mapi: remove\n");
-	
+
 	switch (priv->mode) {
-	
+
 	case GNOME_Evolution_Addressbook_MODE_LOCAL:
 		e_data_book_respond_remove (book, opid, GNOME_Evolution_Addressbook_OfflineUnavailable);
 		return;
-		
+
 	case GNOME_Evolution_Addressbook_MODE_REMOTE:
 
 		status = exchange_mapi_remove_folder (olFolderContacts, priv->fid);
 		if (!status) {
 			e_data_book_respond_remove (book, opid, GNOME_Evolution_Addressbook_OtherError);
-			return;			
+			return;
 		}
-		
+
 		if (priv->marked_for_offline && priv->is_summary_ready) {
 			g_object_unref (priv->summary);
 			priv->summary = NULL;
@@ -1657,43 +1640,42 @@ e_book_backend_mapi_remove (EBookBackend *backend,
 
 			g_object_unref (priv->cache);
 			priv->cache= NULL;
-			
+
 		}
 
-		/* Remove the summary and cache independent of whether they are loaded or not. */		
+		/* Remove the summary and cache independent of whether they are loaded or not. */
 		cache_uri = get_filename_from_uri (priv->uri, "cache.summary");
 		if (g_file_test (cache_uri, G_FILE_TEST_EXISTS)) {
 			g_unlink (cache_uri);
 		}
 		g_free (cache_uri);
-		
+
 		cache_uri = get_filename_from_uri (priv->uri, "cache.xml");
 		if (g_file_test (cache_uri, G_FILE_TEST_EXISTS)) {
 			g_unlink (cache_uri);
 		}
 		g_free (cache_uri);
-				
+
 		e_data_book_respond_remove (book, opid, GNOME_Evolution_Addressbook_Success);
 		return;
 
-
 	default:
 		break;
 	}
 
 	return;
-	
+
 	/* FIXME : provide implmentation */
 }
 
-static void 
+static void
 e_book_backend_mapi_set_mode (EBookBackend *backend, GNOME_Evolution_Addressbook_BookMode mode)
 {
 	EBookBackendMAPIPrivate *priv = ((EBookBackendMAPI *) backend)->priv;
 
-	if(enable_debug)
+	if (enable_debug)
 		printf("mapi: set_mode \n");
-	
+
 	priv->mode = mode;
 	if (e_book_backend_is_loaded (backend)) {
 		if (mode == GNOME_Evolution_Addressbook_MODE_LOCAL) {
@@ -1706,7 +1688,7 @@ e_book_backend_mapi_set_mode (EBookBackend *backend, GNOME_Evolution_Addressbook
 			e_book_backend_notify_connection_status (backend, TRUE);
 			e_book_backend_notify_auth_required (backend); //FIXME: WTH is this required.
 		}
-	}	
+	}
 }
 
 static void
@@ -1714,7 +1696,7 @@ e_book_backend_mapi_dispose (GObject *object)
 {
 	/* FIXME : provide implmentation */
 	EBookBackendMAPIPrivate *priv = ((EBookBackendMAPI *) object)->priv;
-	
+
 	if (priv->profile) {
 		g_free (priv->profile);
 		priv->profile = NULL;
@@ -1723,21 +1705,18 @@ e_book_backend_mapi_dispose (GObject *object)
 		g_free (priv->uri);
 		priv->uri = NULL;
 	}
-	
-}
-
 
+}
 
 static void e_book_backend_mapi_class_init (EBookBackendMAPIClass *klass)
 {
 	GObjectClass  *object_class = G_OBJECT_CLASS (klass);
 	EBookBackendClass *parent_class;
-	
-	
+
 	e_book_backend_mapi_parent_class = g_type_class_peek_parent (klass);
-	
+
 	parent_class = E_BOOK_BACKEND_CLASS (klass);
-	
+
 	/* Set the virtual methods. */
 	parent_class->load_source		   = e_book_backend_mapi_load_source;
 	parent_class->get_static_capabilities    = e_book_backend_mapi_get_static_capabilities;
@@ -1757,23 +1736,21 @@ static void e_book_backend_mapi_class_init (EBookBackendMAPIClass *klass)
 	parent_class->remove                     = e_book_backend_mapi_remove;
 	parent_class->set_mode                   = e_book_backend_mapi_set_mode;
 	object_class->dispose                    = e_book_backend_mapi_dispose;
-	
+
 }
 
 EBookBackend *e_book_backend_mapi_new (void)
 {
 	EBookBackendMAPI *backend;
-	
-	
+
 	backend = g_object_new (E_TYPE_BOOK_BACKEND_MAPI, NULL);
 	return E_BOOK_BACKEND (backend);
 }
 
-
 static void	e_book_backend_mapi_init (EBookBackendMAPI *backend)
 {
 	EBookBackendMAPIPrivate *priv;
-  
+
 	priv= g_new0 (EBookBackendMAPIPrivate, 1);
 	/* Priv Struct init */
 	backend->priv = priv;
@@ -1783,11 +1760,10 @@ static void	e_book_backend_mapi_init (EBookBackendMAPI *backend)
 	priv->cache = NULL;
 	priv->is_summary_ready = FALSE;
 	priv->is_cache_ready = FALSE;
-	
+
 	if (g_getenv ("MAPI_DEBUG"))
 		enable_debug = TRUE;
 	else
 		enable_debug = FALSE;
-	
-	
+
 }
diff --git a/src/addressbook/e-book-backend-mapi.h b/src/addressbook/e-book-backend-mapi.h
index e62bcd0..cba39ef 100644
--- a/src/addressbook/e-book-backend-mapi.h
+++ b/src/addressbook/e-book-backend-mapi.h
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -32,7 +32,6 @@
 
 /* #include "db.h" */
 
-
 #define E_TYPE_BOOK_BACKEND_MAPI         (e_book_backend_mapi_get_type ())
 #define E_BOOK_BACKEND_MAPI(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_BOOK_BACKEND_MAPI, EBookBackendMAPI))
 #define E_BOOK_BACKEND_MAPI_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_BOOK_BACKEND_MAPI, EBookBackendMAPIClass))
@@ -56,5 +55,5 @@ typedef struct
 EBookBackend *e_book_backend_mapi_new      (void);
 GType         e_book_backend_mapi_get_type (void);
 
-#endif /* ! __E_BOOK_BACKEND_MAPI_H__ */
+#endif /* __E_BOOK_BACKEND_MAPI_H__ */
 
diff --git a/src/calendar/e-cal-backend-mapi-factory.c b/src/calendar/e-cal-backend-mapi-factory.c
index 528b012..2172551 100644
--- a/src/calendar/e-cal-backend-mapi-factory.c
+++ b/src/calendar/e-cal-backend-mapi-factory.c
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -39,7 +39,7 @@ e_cal_backend_mapi_factory_instance_init (ECalBackendMAPIFactory *factory)
 {
 }
 
-static const char *
+static const gchar *
 _get_protocol (ECalBackendFactory *factory)
 {
 	return "mapi";
@@ -206,7 +206,7 @@ eds_module_shutdown   (void)
 }
 
 void
-eds_module_list_types (const GType **types, int *num_types)
+eds_module_list_types (const GType **types, gint *num_types)
 {
 	*types = mapi_types;
 	*num_types = 3;
diff --git a/src/calendar/e-cal-backend-mapi-factory.h b/src/calendar/e-cal-backend-mapi-factory.h
index 8b9877d..ff04e84 100644
--- a/src/calendar/e-cal-backend-mapi-factory.h
+++ b/src/calendar/e-cal-backend-mapi-factory.h
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -30,7 +30,7 @@ G_BEGIN_DECLS
 
 void                 eds_module_initialize (GTypeModule *module);
 void                 eds_module_shutdown   (void);
-void                 eds_module_list_types (const GType **types, int *num_types);
+void                 eds_module_list_types (const GType **types, gint *num_types);
 
 G_END_DECLS
 
diff --git a/src/calendar/e-cal-backend-mapi.c b/src/calendar/e-cal-backend-mapi.c
index f4c6e6b..93b1fe9 100644
--- a/src/calendar/e-cal-backend-mapi.c
+++ b/src/calendar/e-cal-backend-mapi.c
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -59,13 +59,13 @@ typedef struct {
 
 /* Private part of the CalBackendMAPI structure */
 struct _ECalBackendMAPIPrivate {
-	mapi_id_t 		fid;
-	uint32_t 		olFolder;
-	gchar 			*profile; 
+	mapi_id_t		fid;
+	uint32_t		olFolder;
+	gchar			*profile;
 
 	/* These fields are entirely for access rights */
-	gchar 			*owner_name;
-	gchar 			*owner_email;	
+	gchar			*owner_name;
+	gchar			*owner_email;
 	gchar			*user_name;
 	gchar			*user_email;
 
@@ -82,13 +82,13 @@ struct _ECalBackendMAPIPrivate {
 
 	/* timeout handler for syncing sendoptions */
 	guint			sendoptions_sync_timeout;
-	
+
 	gchar			*local_attachments_store;
 
 	/* used exclusively for delta fetching */
-	guint 			timeout_id;
-	GThread 		*dthread;
-	SyncDelta 		*dlock;
+	guint			timeout_id;
+	GThread			*dthread;
+	SyncDelta		*dlock;
 };
 
 #define PARENT_TYPE E_TYPE_CAL_BACKEND_SYNC
@@ -111,7 +111,7 @@ e_cal_backend_mapi_authenticate (ECalBackend *backend)
 	if (authenticated || exchange_mapi_connection_exists () || exchange_mapi_connection_new (priv->profile, priv->password)) {
 		authenticated = TRUE;
 		return GNOME_Evolution_Calendar_Success;
-	} else { 
+	} else {
 		authenticated = FALSE;
 		e_cal_backend_notify_error (E_CAL_BACKEND (cbmapi), _("Authentication failed"));
 		return GNOME_Evolution_Calendar_AuthenticationFailed;
@@ -119,7 +119,7 @@ e_cal_backend_mapi_authenticate (ECalBackend *backend)
 }
 
 /***** OBJECT CLASS FUNCTIONS *****/
-static void 
+static void
 e_cal_backend_mapi_dispose (GObject *object)
 {
 	ECalBackendMAPI *cbmapi;
@@ -132,7 +132,7 @@ e_cal_backend_mapi_dispose (GObject *object)
 		(* G_OBJECT_CLASS (parent_class)->dispose) (object);
 }
 
-static void 
+static void
 e_cal_backend_mapi_finalize (GObject *object)
 {
 	ECalBackendMAPI *cbmapi;
@@ -154,12 +154,12 @@ e_cal_backend_mapi_finalize (GObject *object)
 		g_mutex_lock (priv->dlock->mutex);
 		priv->dlock->exit = TRUE;
 		g_mutex_unlock (priv->dlock->mutex);
-		
+
 		g_cond_signal (priv->dlock->cond);
 
 		if (priv->dthread)
 			g_thread_join (priv->dthread);
-		
+
 		g_mutex_free (priv->dlock->mutex);
 		g_cond_free (priv->dlock->cond);
 		g_free (priv->dlock);
@@ -233,9 +233,8 @@ e_cal_backend_mapi_finalize (GObject *object)
 		(* G_OBJECT_CLASS (parent_class)->finalize) (object);
 }
 
-
 /***** SYNC CLASS FUNCTIONS *****/
-static ECalBackendSyncStatus 
+static ECalBackendSyncStatus
 e_cal_backend_mapi_is_read_only (ECalBackendSync *backend, EDataCal *cal, gboolean *read_only)
 {
 	ECalBackendMAPI *cbmapi;
@@ -249,8 +248,8 @@ e_cal_backend_mapi_is_read_only (ECalBackendSync *backend, EDataCal *cal, gboole
 	return GNOME_Evolution_Calendar_Success;
 }
 
-static ECalBackendSyncStatus 
-e_cal_backend_mapi_get_cal_address (ECalBackendSync *backend, EDataCal *cal, char **address)
+static ECalBackendSyncStatus
+e_cal_backend_mapi_get_cal_address (ECalBackendSync *backend, EDataCal *cal, gchar **address)
 {
 	ECalBackendMAPI *cbmapi;
 	ECalBackendMAPIPrivate *priv;
@@ -263,8 +262,8 @@ e_cal_backend_mapi_get_cal_address (ECalBackendSync *backend, EDataCal *cal, cha
 	return GNOME_Evolution_Calendar_Success;
 }
 
-static ECalBackendSyncStatus 
-e_cal_backend_mapi_get_alarm_email_address (ECalBackendSync *backend, EDataCal *cal, char **address)
+static ECalBackendSyncStatus
+e_cal_backend_mapi_get_alarm_email_address (ECalBackendSync *backend, EDataCal *cal, gchar **address)
 {
 	/* We don't support email alarms. This should not have been called. */
 
@@ -273,8 +272,8 @@ e_cal_backend_mapi_get_alarm_email_address (ECalBackendSync *backend, EDataCal *
 	return GNOME_Evolution_Calendar_Success;
 }
 
-static ECalBackendSyncStatus 
-e_cal_backend_mapi_get_ldap_attribute (ECalBackendSync *backend, EDataCal *cal, char **attribute)
+static ECalBackendSyncStatus
+e_cal_backend_mapi_get_ldap_attribute (ECalBackendSync *backend, EDataCal *cal, gchar **attribute)
 {
 	/* This is just a hack for SunONE */
 	*attribute = NULL;
@@ -282,8 +281,8 @@ e_cal_backend_mapi_get_ldap_attribute (ECalBackendSync *backend, EDataCal *cal,
 	return GNOME_Evolution_Calendar_Success;
 }
 
-static ECalBackendSyncStatus 
-e_cal_backend_mapi_get_static_capabilities (ECalBackendSync *backend, EDataCal *cal, char **capabilities)
+static ECalBackendSyncStatus
+e_cal_backend_mapi_get_static_capabilities (ECalBackendSync *backend, EDataCal *cal, gchar **capabilities)
 {
 	/* FIXME: what else ? */
 
@@ -320,7 +319,7 @@ e_cal_backend_mapi_get_static_capabilities (ECalBackendSync *backend, EDataCal *
 	return GNOME_Evolution_Calendar_Success;
 }
 
-static ECalBackendSyncStatus 	
+static ECalBackendSyncStatus
 e_cal_backend_mapi_remove (ECalBackendSync *backend, EDataCal *cal)
 {
 	ECalBackendMAPI *cbmapi;
@@ -335,7 +334,7 @@ e_cal_backend_mapi_remove (ECalBackendSync *backend, EDataCal *cal)
 
 	/* FIXME: check for return status and respond */
 	if (!authenticated) {
-		g_static_mutex_lock (&auth_mutex); 
+		g_static_mutex_lock (&auth_mutex);
 		e_cal_backend_mapi_authenticate (E_CAL_BACKEND (cbmapi));
 		g_static_mutex_unlock (&auth_mutex);
 	}
@@ -361,11 +360,11 @@ e_cal_backend_mapi_remove (ECalBackendSync *backend, EDataCal *cal)
 }
 
 #if 0
-static const char *
+static const gchar *
 get_element_type (icalcomponent_kind kind)
 {
 
-	const char *type = "";
+	const gchar *type = "";
 
 	if (kind == ICAL_VEVENT_COMPONENT)
 		type = "Appointment";
@@ -379,32 +378,32 @@ get_element_type (icalcomponent_kind kind)
 }
 #endif
 
-static void 
+static void
 notify_progress (ECalBackendMAPI *cbmapi, guint64 index, guint64 total)
 {
-	guint percent = ((float)index/total) * 100 ;
+	guint percent = ((gfloat)index/total) * 100;
 	gchar *progress_string;
 
 	if (percent > 100)
-		percent = 99; 
+		percent = 99;
 
 	/* To translators: This message is displayed on the status bar when calendar/tasks/memo items are being fetched from the server. */
-	progress_string = g_strdup_printf (_("Loading items in folder %s"), 
-				e_source_get_property (e_cal_backend_get_source (E_CAL_BACKEND (cbmapi)), "name")); 
+	progress_string = g_strdup_printf (_("Loading items in folder %s"),
+				e_source_get_property (e_cal_backend_get_source (E_CAL_BACKEND (cbmapi)), "name"));
 
 	e_cal_backend_notify_view_progress (E_CAL_BACKEND (cbmapi), progress_string, percent);
 
-	g_free (progress_string); 
+	g_free (progress_string);
 }
 
 static gboolean
 mapi_cal_get_changes_cb (FetchItemsCallbackData *item_data, gpointer data)
 {
-	struct mapi_SPropValue_array *array = item_data->properties; 
-	const mapi_id_t mid = item_data->mid; 
-	GSList *streams = item_data->streams; 
-	GSList *recipients = item_data->recipients; 
-	GSList *attachments = item_data->attachments; 
+	struct mapi_SPropValue_array *array = item_data->properties;
+	const mapi_id_t mid = item_data->mid;
+	GSList *streams = item_data->streams;
+	GSList *recipients = item_data->recipients;
+	GSList *attachments = item_data->attachments;
 	ECalBackendMAPI *cbmapi	= data;
 	ECalBackendMAPIPrivate *priv = cbmapi->priv;
 	icalcomponent_kind kind = e_cal_backend_get_kind (E_CAL_BACKEND (cbmapi));
@@ -429,17 +428,17 @@ mapi_cal_get_changes_cb (FetchItemsCallbackData *item_data, gpointer data)
 	cache_comp = e_cal_backend_cache_get_component (priv->cache, tmp, NULL);
 
 	if (cache_comp == NULL) {
-		ECalComponent *comp = exchange_mapi_cal_util_mapi_props_to_comp (kind, tmp, array, 
-									streams, recipients, attachments, 
+		ECalComponent *comp = exchange_mapi_cal_util_mapi_props_to_comp (kind, tmp, array,
+									streams, recipients, attachments,
 									priv->local_attachments_store, priv->default_zone);
 
 		if (E_IS_CAL_COMPONENT (comp)) {
-			char *comp_str;
+			gchar *comp_str;
 
 			e_cal_component_commit_sequence (comp);
-			comp_str = e_cal_component_get_as_string (comp);	
+			comp_str = e_cal_component_get_as_string (comp);
 
-			e_cal_backend_notify_object_created (E_CAL_BACKEND (cbmapi), (const char *) comp_str);
+			e_cal_backend_notify_object_created (E_CAL_BACKEND (cbmapi), (const gchar *) comp_str);
 			e_cal_backend_cache_put_component (priv->cache, comp);
 
 			g_free (comp_str);
@@ -457,13 +456,13 @@ mapi_cal_get_changes_cb (FetchItemsCallbackData *item_data, gpointer data)
 			e_cal_component_get_last_modified (cache_comp, &cache_comp_lm);
 			if (!cache_comp_lm || (icaltime_compare (itt, *cache_comp_lm) != 0)) {
 				ECalComponent *comp;
-				char *cache_comp_str = NULL, *modif_comp_str = NULL;
+				gchar *cache_comp_str = NULL, *modif_comp_str = NULL;
 
 				e_cal_component_commit_sequence (cache_comp);
 				cache_comp_str = e_cal_component_get_as_string (cache_comp);
 
-				comp = exchange_mapi_cal_util_mapi_props_to_comp (kind, tmp, array, 
-									streams, recipients, attachments, 
+				comp = exchange_mapi_cal_util_mapi_props_to_comp (kind, tmp, array,
+									streams, recipients, attachments,
 									priv->local_attachments_store, priv->default_zone);
 
 				e_cal_component_commit_sequence (comp);
@@ -473,7 +472,7 @@ mapi_cal_get_changes_cb (FetchItemsCallbackData *item_data, gpointer data)
 				e_cal_backend_cache_put_component (priv->cache, comp);
 
 				g_object_unref (comp);
-				g_free (cache_comp_str); 
+				g_free (cache_comp_str);
 				g_free (modif_comp_str);
 			}
 			g_object_unref (cache_comp);
@@ -550,10 +549,10 @@ handle_deleted_items_cb (FetchItemsCallbackData *item_data, gpointer data)
 	return TRUE;
 }
 
-/* Simple workflow for fetching deltas: 
- * Poke cache for server_utc_time -> if exists, fetch all items modified after that time, 
- * note current time before fetching and update cache with the same after fetching. 
- * If server_utc_time does not exist OR is invalid, fetch all items 
+/* Simple workflow for fetching deltas:
+ * Poke cache for server_utc_time -> if exists, fetch all items modified after that time,
+ * note current time before fetching and update cache with the same after fetching.
+ * If server_utc_time does not exist OR is invalid, fetch all items
  * (we anyway process the results only if last_modified has changed).
  */
 
@@ -564,12 +563,12 @@ get_deltas (gpointer handle)
 	ECalBackendMAPIPrivate *priv;
 	icalcomponent_kind kind;
 	static GStaticMutex updating = G_STATIC_MUTEX_INIT;
-	icaltimetype itt_current, itt_cache = icaltime_null_time(); 
+	icaltimetype itt_current, itt_cache = icaltime_null_time();
 	time_t current_time;
 	struct tm tm;
 	gchar *time_string = NULL;
-	gchar t_str [26]; 
-	const char *serv_time;
+	gchar t_str [26];
+	const gchar *serv_time;
 	struct mapi_SRestriction res;
 	gboolean use_restriction = FALSE;
 	GSList *ls = NULL;
@@ -589,7 +588,7 @@ get_deltas (gpointer handle)
 
 	serv_time = e_cal_backend_cache_get_server_utc_time (priv->cache);
 	if (serv_time)
-		itt_cache = icaltime_from_string (serv_time); 
+		itt_cache = icaltime_from_string (serv_time);
 
 	if (!icaltime_is_null_time (itt_cache)) {
 		struct SPropValue sprop;
@@ -617,8 +616,8 @@ get_deltas (gpointer handle)
 	/* FIXME: GetProps does not seem to work for tasks :-( */
 	if (kind == ICAL_VTODO_COMPONENT) {
 		if (!exchange_mapi_connection_fetch_items (priv->fid, use_restriction ? &res : NULL, NULL,
-						NULL, 0, NULL, NULL, 
-						mapi_cal_get_changes_cb, cbmapi, 
+						NULL, 0, NULL, NULL,
+						mapi_cal_get_changes_cb, cbmapi,
 						MAPI_OPTIONS_FETCH_ALL)) {
 			/* FIXME: String : We need to restart evolution-data-server */
 			e_cal_backend_notify_error (E_CAL_BACKEND (cbmapi), _("Error fetching changes from the server."));
@@ -627,9 +626,9 @@ get_deltas (gpointer handle)
 			return FALSE;
 		}
 	} else if (!exchange_mapi_connection_fetch_items (priv->fid, use_restriction ? &res : NULL, NULL,
-						cal_GetPropsList, G_N_ELEMENTS (cal_GetPropsList), 
-						exchange_mapi_cal_util_build_name_id, GINT_TO_POINTER(kind), 
-						mapi_cal_get_changes_cb, cbmapi, 
+						cal_GetPropsList, G_N_ELEMENTS (cal_GetPropsList),
+						exchange_mapi_cal_util_build_name_id, GINT_TO_POINTER(kind),
+						mapi_cal_get_changes_cb, cbmapi,
 						MAPI_OPTIONS_FETCH_ALL)) {
 		/* FIXME: String : We need to restart evolution-data-server */
 		e_cal_backend_notify_error (E_CAL_BACKEND (cbmapi), _("Error fetching changes from the server."));
@@ -648,16 +647,16 @@ get_deltas (gpointer handle)
 	/* handle deleted items here by going over the entire cache and
 	 * checking for deleted items.*/
 
-	/* e_cal_backend_cache_get_keys returns a list of all the keys. 
-	 * The items in the list are pointers to internal data, 
+	/* e_cal_backend_cache_get_keys returns a list of all the keys.
+	 * The items in the list are pointers to internal data,
 	 * so should not be freed, only the list should. */
 	did.cbmapi = cbmapi;
 	did.cache_keys = e_cal_backend_cache_get_keys (priv->cache);
 	did.unknown_mids = NULL;
 	if (!exchange_mapi_connection_fetch_items (priv->fid, NULL, NULL,
-						cal_IDList, G_N_ELEMENTS (cal_IDList), 
-						NULL, NULL, 
-						handle_deleted_items_cb, &did, 
+						cal_IDList, G_N_ELEMENTS (cal_IDList),
+						NULL, NULL,
+						handle_deleted_items_cb, &did,
 						0)) {
 		/* FIXME: String : We need to restart evolution-data-server */
 		e_cal_backend_notify_error (E_CAL_BACKEND (cbmapi), _("Error fetching changes from the server."));
@@ -667,24 +666,24 @@ get_deltas (gpointer handle)
 	}
 
 	e_file_cache_freeze_changes (E_FILE_CACHE (priv->cache));
-	for (ls = did.cache_keys; ls ; ls = g_slist_next (ls)) {
+	for (ls = did.cache_keys; ls; ls = g_slist_next (ls)) {
 		ECalComponent *comp = NULL;
 		icalcomponent *icalcomp = NULL;
 
-		comp = e_cal_backend_cache_get_component (priv->cache, (const char *) ls->data, NULL);
+		comp = e_cal_backend_cache_get_component (priv->cache, (const gchar *) ls->data, NULL);
 
 		if (!comp)
 			continue;
 
 		icalcomp = e_cal_component_get_icalcomponent (comp);
 		if (kind == icalcomponent_isa (icalcomp)) {
-			char *comp_str = NULL;
+			gchar *comp_str = NULL;
 			ECalComponentId *id = e_cal_component_get_id (comp);
-			
+
 			comp_str = e_cal_component_get_as_string (comp);
-			e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbmapi), 
+			e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbmapi),
 					id, comp_str, NULL);
-			e_cal_backend_cache_remove_component (priv->cache, (const char *) id->uid, id->rid);
+			e_cal_backend_cache_remove_component (priv->cache, (const gchar *) id->uid, id->rid);
 
 			e_cal_component_free_id (id);
 			g_free (comp_str);
@@ -746,7 +745,7 @@ get_deltas (gpointer handle)
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_mapi_get_default_object (ECalBackendSync *backend, EDataCal *cal, char **object)
+e_cal_backend_mapi_get_default_object (ECalBackendSync *backend, EDataCal *cal, gchar **object)
 {
 	ECalComponent *comp;
 
@@ -754,7 +753,7 @@ e_cal_backend_mapi_get_default_object (ECalBackendSync *backend, EDataCal *cal,
 
 	switch (e_cal_backend_get_kind (E_CAL_BACKEND (backend))) {
 	case ICAL_VEVENT_COMPONENT:
-        	e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_EVENT);
+		e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_EVENT);
 		break;
 	case ICAL_VTODO_COMPONENT:
 		e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_TODO);
@@ -773,8 +772,8 @@ e_cal_backend_mapi_get_default_object (ECalBackendSync *backend, EDataCal *cal,
 	return GNOME_Evolution_Calendar_Success;
 }
 
-static ECalBackendSyncStatus 
-e_cal_backend_mapi_get_object (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *rid, char **object)
+static ECalBackendSyncStatus
+e_cal_backend_mapi_get_object (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *rid, gchar **object)
 {
 	ECalBackendMAPI *cbmapi;
 	ECalBackendMAPIPrivate *priv;
@@ -809,8 +808,8 @@ e_cal_backend_mapi_get_object (ECalBackendSync *backend, EDataCal *cal, const ch
 	return GNOME_Evolution_Calendar_ObjectNotFound;
 }
 
-static ECalBackendSyncStatus 
-e_cal_backend_mapi_get_object_list (ECalBackendSync *backend, EDataCal *cal, const char *sexp, GList **objects)
+static ECalBackendSyncStatus
+e_cal_backend_mapi_get_object_list (ECalBackendSync *backend, EDataCal *cal, const gchar *sexp, GList **objects)
 {
 	ECalBackendMAPI *cbmapi;
 	ECalBackendMAPIPrivate *priv;
@@ -818,7 +817,7 @@ e_cal_backend_mapi_get_object_list (ECalBackendSync *backend, EDataCal *cal, con
 	ECalBackendSExp *cbsexp;
 	gboolean search_needed = TRUE;
 
-	cbmapi = E_CAL_BACKEND_MAPI (backend);	
+	cbmapi = E_CAL_BACKEND_MAPI (backend);
 	priv = cbmapi->priv;
 
 	g_mutex_lock (priv->mutex);
@@ -845,9 +844,9 @@ e_cal_backend_mapi_get_object_list (ECalBackendSync *backend, EDataCal *cal, con
 			if ((!search_needed) ||
 					(e_cal_backend_sexp_match_comp (cbsexp, comp, E_CAL_BACKEND (backend)))) {
 				*objects = g_list_append (*objects, e_cal_component_get_as_string (comp));
-			} 
-		}  
-	}	
+			}
+		}
+	}
 
 	g_object_unref (cbsexp);
 	g_list_foreach (components, (GFunc) g_object_unref, NULL);
@@ -857,8 +856,8 @@ e_cal_backend_mapi_get_object_list (ECalBackendSync *backend, EDataCal *cal, con
 	return GNOME_Evolution_Calendar_Success;
 }
 
-static ECalBackendSyncStatus 
-e_cal_backend_mapi_get_attachment_list (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *rid, GSList **list)
+static ECalBackendSyncStatus
+e_cal_backend_mapi_get_attachment_list (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *rid, GSList **list)
 {
 	/* TODO implement the function */
 	return GNOME_Evolution_Calendar_Success;
@@ -868,15 +867,15 @@ static guint
 get_cache_refresh_interval (void)
 {
 	guint time_interval;
-	const char *time_interval_string = NULL;
-	
+	const gchar *time_interval_string = NULL;
+
 	time_interval = CACHE_REFRESH_INTERVAL;
 	time_interval_string = g_getenv ("GETQM_TIME_INTERVAL");
 	if (time_interval_string) {
 		time_interval = g_ascii_strtod (time_interval_string, NULL);
 		time_interval *= (60*1000);
 	}
-		
+
 	return time_interval;
 }
 
@@ -900,21 +899,21 @@ delta_thread (gpointer data)
 
 		g_mutex_lock (priv->dlock->mutex);
 
-		if (!succeeded || priv->dlock->exit) 
+		if (!succeeded || priv->dlock->exit)
 			break;
 
 		g_get_current_time (&timeout);
 		g_time_val_add (&timeout, get_cache_refresh_interval () * 1000);
 		g_cond_timed_wait (priv->dlock->cond, priv->dlock->mutex, &timeout);
-		
-		if (priv->dlock->exit) 
-			break;	
-		
+
+		if (priv->dlock->exit)
+			break;
+
 		g_mutex_unlock (priv->dlock->mutex);
 	}
 
 	g_mutex_unlock (priv->dlock->mutex);
-	priv->dthread = NULL;	
+	priv->dthread = NULL;
 	return NULL;
 }
 
@@ -928,16 +927,16 @@ fetch_deltas (ECalBackendMAPI *cbmapi)
 
 	priv = cbmapi->priv;
 
-	/* If the thread is already running just return back */	
-	if (priv->dthread) 
+	/* If the thread is already running just return back */
+	if (priv->dthread)
 		return FALSE;
-	
+
 	if (!priv->dlock) {
 		priv->dlock = g_new0 (SyncDelta, 1);
 		priv->dlock->mutex = g_mutex_new ();
 		priv->dlock->cond = g_cond_new ();
 	}
-	
+
 	priv->dlock->exit = FALSE;
 	priv->dthread = g_thread_create ((GThreadFunc) delta_thread, cbmapi, TRUE, &error);
 	if (!priv->dthread) {
@@ -948,7 +947,6 @@ fetch_deltas (ECalBackendMAPI *cbmapi)
 	return TRUE;
 }
 
-
 static gboolean
 start_fetch_deltas (gpointer data)
 {
@@ -970,11 +968,11 @@ start_fetch_deltas (gpointer data)
 static gboolean
 mapi_cal_cache_create_cb (FetchItemsCallbackData *item_data, gpointer data)
 {
-	struct mapi_SPropValue_array *properties = item_data->properties; 
-	const mapi_id_t mid = item_data->mid; 
-	GSList *streams = item_data->streams; 
-	GSList *recipients = item_data->recipients; 
-	GSList *attachments = item_data->attachments; 	
+	struct mapi_SPropValue_array *properties = item_data->properties;
+	const mapi_id_t mid = item_data->mid;
+	GSList *streams = item_data->streams;
+	GSList *recipients = item_data->recipients;
+	GSList *attachments = item_data->attachments;
 	ECalBackendMAPI *cbmapi	= E_CAL_BACKEND_MAPI (data);
 	ECalBackendMAPIPrivate *priv = cbmapi->priv;
 	icalcomponent_kind kind = e_cal_backend_get_kind (E_CAL_BACKEND (cbmapi));
@@ -1000,20 +998,20 @@ mapi_cal_cache_create_cb (FetchItemsCallbackData *item_data, gpointer data)
 		case ICAL_VJOURNAL_COMPONENT:
 			break;
 		default:
-			return FALSE; 
+			return FALSE;
 	}
-	
+
 	tmp = exchange_mapi_util_mapi_id_to_string (mid);
-	comp = exchange_mapi_cal_util_mapi_props_to_comp (kind, tmp, properties, 
-							streams, recipients, attachments, 
+	comp = exchange_mapi_cal_util_mapi_props_to_comp (kind, tmp, properties,
+							streams, recipients, attachments,
 							priv->local_attachments_store, priv->default_zone);
 	g_free (tmp);
 
 	if (E_IS_CAL_COMPONENT (comp)) {
 		gchar *comp_str;
 		e_cal_component_commit_sequence (comp);
-		comp_str = e_cal_component_get_as_string (comp);	
-		e_cal_backend_notify_object_created (E_CAL_BACKEND (cbmapi), (const char *) comp_str);
+		comp_str = e_cal_component_get_as_string (comp);
+		e_cal_backend_notify_object_created (E_CAL_BACKEND (cbmapi), (const gchar *) comp_str);
 		g_free (comp_str);
 		e_cal_backend_cache_put_component (priv->cache, comp);
 		g_object_unref (comp);
@@ -1034,11 +1032,11 @@ populate_cache (ECalBackendMAPI *cbmapi)
 	ECalBackendMAPIPrivate *priv;
 	ESource *source = NULL;
 	icalcomponent_kind kind;
-	icaltimetype itt_current; 
+	icaltimetype itt_current;
 	time_t current_time;
 	struct tm tm;
 	gchar *time_string = NULL;
-	gchar t_str [26]; 
+	gchar t_str [26];
 
 	priv = cbmapi->priv;
 	source = e_cal_backend_get_source (E_CAL_BACKEND (cbmapi));
@@ -1057,8 +1055,8 @@ populate_cache (ECalBackendMAPI *cbmapi)
 	/* FIXME: GetProps does not seem to work for tasks :-( */
 	if (kind == ICAL_VTODO_COMPONENT) {
 		if (!exchange_mapi_connection_fetch_items (priv->fid, NULL, NULL,
-						NULL, 0, NULL, NULL, 
-						mapi_cal_cache_create_cb, cbmapi, 
+						NULL, 0, NULL, NULL,
+						mapi_cal_cache_create_cb, cbmapi,
 						MAPI_OPTIONS_FETCH_ALL)) {
 			e_cal_backend_notify_error (E_CAL_BACKEND (cbmapi), _("Could not create cache file"));
 			e_file_cache_thaw_changes (E_FILE_CACHE (priv->cache));
@@ -1066,9 +1064,9 @@ populate_cache (ECalBackendMAPI *cbmapi)
 			return GNOME_Evolution_Calendar_OtherError;
 		}
 	} else if (!exchange_mapi_connection_fetch_items (priv->fid, NULL, NULL,
-						cal_GetPropsList, G_N_ELEMENTS (cal_GetPropsList), 
-						exchange_mapi_cal_util_build_name_id, GINT_TO_POINTER(kind), 
-						mapi_cal_cache_create_cb, cbmapi, 
+						cal_GetPropsList, G_N_ELEMENTS (cal_GetPropsList),
+						exchange_mapi_cal_util_build_name_id, GINT_TO_POINTER(kind),
+						mapi_cal_cache_create_cb, cbmapi,
 						MAPI_OPTIONS_FETCH_ALL)) {
 		e_cal_backend_notify_error (E_CAL_BACKEND (cbmapi), _("Could not create cache file"));
 		e_file_cache_thaw_changes (E_FILE_CACHE (priv->cache));
@@ -1095,7 +1093,7 @@ cache_init (ECalBackendMAPI *cbmapi)
 {
 	ECalBackendMAPIPrivate *priv = cbmapi->priv;
 	icalcomponent_kind kind;
-	ECalBackendSyncStatus status; 
+	ECalBackendSyncStatus status;
 
 	kind = e_cal_backend_get_kind (E_CAL_BACKEND (cbmapi));
 
@@ -1141,7 +1139,7 @@ e_cal_backend_mapi_connect (ECalBackendMAPI *cbmapi)
 
 	if (!authenticated) {
 		e_cal_backend_notify_error (E_CAL_BACKEND (cbmapi), _("Authentication failed"));
-		return GNOME_Evolution_Calendar_AuthenticationFailed; 
+		return GNOME_Evolution_Calendar_AuthenticationFailed;
 	}
 
 	/* We have established a connection */
@@ -1188,23 +1186,23 @@ e_cal_backend_mapi_connect (ECalBackendMAPI *cbmapi)
 		g_error_free (error);
 		e_cal_backend_notify_error (E_CAL_BACKEND (cbmapi), _("Could not create thread for populating cache"));
 		return GNOME_Evolution_Calendar_OtherError;
-	} 
+	}
 
 	return GNOME_Evolution_Calendar_Success;
 }
 
-static ECalBackendSyncStatus 
-e_cal_backend_mapi_open (ECalBackendSync *backend, EDataCal *cal, gboolean only_if_exists, const char *username, const char *password)
+static ECalBackendSyncStatus
+e_cal_backend_mapi_open (ECalBackendSync *backend, EDataCal *cal, gboolean only_if_exists, const gchar *username, const gchar *password)
 {
 	ECalBackendMAPI *cbmapi;
 	ECalBackendMAPIPrivate *priv;
 	ECalBackendSyncStatus status;
 	ECalSourceType source_type;
 	ESource *esource;
-	const char *source = NULL, *fid = NULL;
-	char *filename;
-	char *mangled_uri;
-	int i;
+	const gchar *source = NULL, *fid = NULL;
+	gchar *filename;
+	gchar *mangled_uri;
+	gint i;
 	uint32_t olFolder = 0;
 
 	cbmapi = E_CAL_BACKEND_MAPI (backend);
@@ -1240,15 +1238,15 @@ e_cal_backend_mapi_open (ECalBackendSync *backend, EDataCal *cal, gboolean only_
 		break;
 	}
 
-	/* Not for remote */	
+	/* Not for remote */
 	if (priv->mode == CAL_MODE_LOCAL) {
 		const gchar *display_contents = NULL;
 
-		cbmapi->priv->read_only = TRUE;				
+		cbmapi->priv->read_only = TRUE;
 		display_contents = e_source_get_property (esource, "offline_sync");
-		
+
 		if (!display_contents || !g_str_equal (display_contents, "1")) {
-			g_mutex_unlock (priv->mutex);	
+			g_mutex_unlock (priv->mutex);
 			return GNOME_Evolution_Calendar_RepositoryOffline;
 		}
 
@@ -1262,7 +1260,7 @@ e_cal_backend_mapi_open (ECalBackendSync *backend, EDataCal *cal, gboolean only_
 			}
 		}
 		e_cal_backend_cache_put_default_timezone (priv->cache, priv->default_zone);
-		g_mutex_unlock (priv->mutex);	
+		g_mutex_unlock (priv->mutex);
 		return GNOME_Evolution_Calendar_Success;
 	}
 
@@ -1292,11 +1290,11 @@ e_cal_backend_mapi_open (ECalBackendSync *backend, EDataCal *cal, gboolean only_
 	filename = g_build_filename (g_get_home_dir (),
 				     ".evolution/cache/", source,
 				     mangled_uri,
-				     G_DIR_SEPARATOR_S, 
+				     G_DIR_SEPARATOR_S,
 				     NULL);
 
 	g_free (mangled_uri);
-	priv->local_attachments_store = 
+	priv->local_attachments_store =
 		g_filename_to_uri (filename, NULL, NULL);
 	g_free (filename);
 
@@ -1304,7 +1302,7 @@ e_cal_backend_mapi_open (ECalBackendSync *backend, EDataCal *cal, gboolean only_
 
 	g_static_mutex_lock (&auth_mutex);
 	status = e_cal_backend_mapi_authenticate (E_CAL_BACKEND (cbmapi));
-	g_static_mutex_unlock (&auth_mutex); 
+	g_static_mutex_unlock (&auth_mutex);
 
 	if (status == GNOME_Evolution_Calendar_Success)
 		return e_cal_backend_mapi_connect (cbmapi);
@@ -1312,10 +1310,10 @@ e_cal_backend_mapi_open (ECalBackendSync *backend, EDataCal *cal, gboolean only_
 		return status;
 }
 
-static gboolean 
+static gboolean
 capture_req_props (FetchItemsCallbackData *item_data, gpointer data)
 {
-	struct mapi_SPropValue_array *properties = item_data->properties; 
+	struct mapi_SPropValue_array *properties = item_data->properties;
 	struct cbdata *cbdata = (struct cbdata *) data;
 	const uint32_t *ui32;
 
@@ -1341,7 +1339,7 @@ static void
 get_server_data (ECalBackendMAPI *cbmapi, icalcomponent *comp, struct cbdata *cbdata)
 {
 	ECalBackendMAPIPrivate *priv = cbmapi->priv;
-	const char *uid;
+	const gchar *uid;
 	mapi_id_t mid;
 	struct mapi_SRestriction res;
 	struct SPropValue sprop;
@@ -1351,10 +1349,10 @@ get_server_data (ECalBackendMAPI *cbmapi, icalcomponent *comp, struct cbdata *cb
 
 	uid = icalcomponent_get_uid (comp);
 	exchange_mapi_util_mapi_id_from_string (uid, &mid);
-	if (exchange_mapi_connection_fetch_item (priv->fid, mid, 
-					NULL, 0, 
-					NULL, NULL, 
-					capture_req_props, cbdata, 
+	if (exchange_mapi_connection_fetch_item (priv->fid, mid,
+					NULL, 0,
+					NULL, NULL,
+					capture_req_props, cbdata,
 					MAPI_OPTIONS_FETCH_GENERIC_STREAMS))
 
 		return;
@@ -1368,27 +1366,27 @@ get_server_data (ECalBackendMAPI *cbmapi, icalcomponent *comp, struct cbdata *cb
 
 	exchange_mapi_cal_util_generate_globalobjectid (TRUE, uid, &sb);
 
-	set_SPropValue_proptag (&sprop, proptag, (const void *) &sb);
+	set_SPropValue_proptag (&sprop, proptag, (gconstpointer ) &sb);
 	cast_mapi_SPropValue (&(res.res.resProperty.lpProp), &sprop);
 
 	exchange_mapi_connection_fetch_items (priv->fid, &res, NULL,
-					NULL, 0, 
-					NULL, NULL, 
-					capture_req_props, cbdata, 
+					NULL, 0,
+					NULL, NULL,
+					capture_req_props, cbdata,
 					MAPI_OPTIONS_FETCH_GENERIC_STREAMS);
 }
 
-static icaltimezone *e_cal_backend_mapi_internal_get_timezone (ECalBackend *backend, const char *tzid);
+static icaltimezone *e_cal_backend_mapi_internal_get_timezone (ECalBackend *backend, const gchar *tzid);
 
-static ECalBackendSyncStatus 
-e_cal_backend_mapi_create_object (ECalBackendSync *backend, EDataCal *cal, char **calobj, char **uid)
+static ECalBackendSyncStatus
+e_cal_backend_mapi_create_object (ECalBackendSync *backend, EDataCal *cal, gchar **calobj, gchar **uid)
 {
 	ECalBackendMAPI *cbmapi;
 	ECalBackendMAPIPrivate *priv;
 	icalcomponent_kind kind;
 	icalcomponent *icalcomp;
 	ECalComponent *comp;
-	const char *compuid;
+	const gchar *compuid;
 	mapi_id_t mid = 0;
 	gchar *tmp = NULL;
 	GSList *recipients = NULL;
@@ -1422,29 +1420,29 @@ e_cal_backend_mapi_create_object (ECalBackendSync *backend, EDataCal *cal, char
 	e_cal_component_set_icalcomponent (comp, icalcomp);
 
 	current = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ());
- 	e_cal_component_set_created (comp, &current);
- 	e_cal_component_set_last_modified (comp, &current);
+	e_cal_component_set_created (comp, &current);
+	e_cal_component_set_last_modified (comp, &current);
 
 	/* FIXME: [WIP] Add support for recurrences */
 	if (e_cal_component_has_recurrences (comp)) {
-		GByteArray *ba = exchange_mapi_cal_util_rrule_to_bin (comp, NULL); 
+		GByteArray *ba = exchange_mapi_cal_util_rrule_to_bin (comp, NULL);
 		if (ba) {
-			struct SPropTagArray *tag_array; 
-			ExchangeMAPIStream *stream = g_new0 (ExchangeMAPIStream, 1); 
-			stream->value = ba; 
-			tag_array = exchange_mapi_util_resolve_named_prop (priv->olFolder, priv->fid, 0x8216, PSETID_Appointment); 
+			struct SPropTagArray *tag_array;
+			ExchangeMAPIStream *stream = g_new0 (ExchangeMAPIStream, 1);
+			stream->value = ba;
+			tag_array = exchange_mapi_util_resolve_named_prop (priv->olFolder, priv->fid, 0x8216, PSETID_Appointment);
 			if (tag_array) {
 				stream->proptag = tag_array->aulPropTag[0];
-				streams = g_slist_append (streams, stream); 
+				streams = g_slist_append (streams, stream);
 
-				g_free (tag_array->aulPropTag); 
+				g_free (tag_array->aulPropTag);
 				g_free (tag_array);
 			}
 		}
 	}
 
 	/* FIXME: [WIP] Add support for meetings/assigned tasks */
-	if (e_cal_component_has_attendees (comp)) 
+	if (e_cal_component_has_attendees (comp))
 		exchange_mapi_cal_util_fetch_recipients (comp, &recipients);
 
 	if (e_cal_component_has_attachments (comp))
@@ -1476,9 +1474,9 @@ e_cal_backend_mapi_create_object (ECalBackendSync *backend, EDataCal *cal, char
 			cbdata.globalid = &globalid;
 			cbdata.cleanglobalid = &globalid;
 
-			mid = exchange_mapi_create_item (priv->olFolder, priv->fid, 
-							exchange_mapi_cal_util_build_name_id, GINT_TO_POINTER(kind), 
-							exchange_mapi_cal_util_build_props, &cbdata, 
+			mid = exchange_mapi_create_item (priv->olFolder, priv->fid,
+							exchange_mapi_cal_util_build_name_id, GINT_TO_POINTER(kind),
+							exchange_mapi_cal_util_build_props, &cbdata,
 							recipients, attachments, streams, MAPI_OPTIONS_DONT_SUBMIT);
 			g_free (cbdata.props);
 //			g_free (globalid.lpb);
@@ -1524,8 +1522,8 @@ e_cal_backend_mapi_create_object (ECalBackendSync *backend, EDataCal *cal, char
 static gboolean
 modifier_is_organizer (ECalBackendMAPI *cbmapi, ECalComponent *comp)
 {
-	ECalComponentOrganizer org; 
-	const char *ownerid, *orgid; 
+	ECalComponentOrganizer org;
+	const gchar *ownerid, *orgid;
 
 	if (!e_cal_component_has_organizer(comp))
 		return TRUE;
@@ -1533,21 +1531,21 @@ modifier_is_organizer (ECalBackendMAPI *cbmapi, ECalComponent *comp)
 	e_cal_component_get_organizer (comp, &org);
 	if (!g_ascii_strncasecmp (org.value, "mailto:";, 7))
 		orgid = (org.value) + 7;
-	else 
+	else
 		orgid = org.value;
 	ownerid = e_cal_backend_mapi_get_owner_email (cbmapi);
 
 	return (!g_ascii_strcasecmp(orgid, ownerid) ? TRUE : FALSE);
 }
 
-static OlResponseStatus 
+static OlResponseStatus
 get_trackstatus_from_partstat (icalparameter_partstat partstat)
 {
 	switch (partstat) {
-		case ICAL_PARTSTAT_ACCEPTED 	: return olResponseAccepted;
-		case ICAL_PARTSTAT_TENTATIVE 	: return olResponseTentative;
-		case ICAL_PARTSTAT_DECLINED 	: return olResponseDeclined;
-		default 			: return olResponseTentative;
+		case ICAL_PARTSTAT_ACCEPTED	: return olResponseAccepted;
+		case ICAL_PARTSTAT_TENTATIVE	: return olResponseTentative;
+		case ICAL_PARTSTAT_DECLINED	: return olResponseDeclined;
+		default				: return olResponseTentative;
 	}
 }
 
@@ -1555,14 +1553,14 @@ static OlResponseStatus
 find_my_response (ECalBackendMAPI *cbmapi, ECalComponent *comp)
 {
 	icalcomponent *icalcomp = e_cal_component_get_icalcomponent (comp);
-	icalproperty *attendee; 
+	icalproperty *attendee;
 	gchar *att = NULL;
-	OlResponseStatus val = olResponseTentative; 
+	OlResponseStatus val = olResponseTentative;
 
 	att = g_strdup_printf ("MAILTO:%s", e_cal_backend_mapi_get_owner_email (cbmapi));
 	attendee = icalcomponent_get_first_property (icalcomp, ICAL_ATTENDEE_PROPERTY);
 	while (attendee) {
-		const char *value = icalproperty_get_attendee (attendee);
+		const gchar *value = icalproperty_get_attendee (attendee);
 		if (!g_ascii_strcasecmp (value, att)) {
 			icalparameter *param = icalproperty_get_first_parameter (attendee, ICAL_PARTSTAT_PARAMETER);
 			val = get_trackstatus_from_partstat (icalparameter_get_partstat(param));
@@ -1575,9 +1573,9 @@ find_my_response (ECalBackendMAPI *cbmapi, ECalComponent *comp)
 	return val;
 }
 
-static ECalBackendSyncStatus 
-e_cal_backend_mapi_modify_object (ECalBackendSync *backend, EDataCal *cal, const char *calobj, 
-				  CalObjModType mod, char **old_object, char **new_object)
+static ECalBackendSyncStatus
+e_cal_backend_mapi_modify_object (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj,
+				  CalObjModType mod, gchar **old_object, gchar **new_object)
 {
 	ECalBackendMAPI *cbmapi;
         ECalBackendMAPIPrivate *priv;
@@ -1586,7 +1584,7 @@ e_cal_backend_mapi_modify_object (ECalBackendSync *backend, EDataCal *cal, const
 	ECalComponent *comp, *cache_comp = NULL;
 	gboolean status;
 	mapi_id_t mid;
-	const char *uid = NULL, *rid = NULL;
+	const gchar *uid = NULL, *rid = NULL;
 	GSList *recipients = NULL;
 	GSList *streams = NULL;
 	GSList *attachments = NULL;
@@ -1607,7 +1605,7 @@ e_cal_backend_mapi_modify_object (ECalBackendSync *backend, EDataCal *cal, const
 		return GNOME_Evolution_Calendar_RepositoryOffline;
 
 	if (mod != CALOBJ_MOD_ALL) {
-		e_cal_backend_notify_error (E_CAL_BACKEND (cbmapi), _("Support for modifying single instances of a recurring appointment is not yet implemented. No change was made to the appointment on the server.")); 
+		e_cal_backend_notify_error (E_CAL_BACKEND (cbmapi), _("Support for modifying single instances of a recurring appointment is not yet implemented. No change was made to the appointment on the server."));
 		return GNOME_Evolution_Calendar_OtherError;
 	}
 
@@ -1618,9 +1616,9 @@ e_cal_backend_mapi_modify_object (ECalBackendSync *backend, EDataCal *cal, const
 
 	prop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY);
 	while (prop) {
-		const char *name = icalproperty_get_x_name (prop);
+		const gchar *name = icalproperty_get_x_name (prop);
 		if (!g_ascii_strcasecmp (name, "X-EVOLUTION-IS-REPLY")) {
-			no_increment = TRUE; 
+			no_increment = TRUE;
 			icalcomponent_remove_property (icalcomp, prop);
 		}
 		prop = icalcomponent_get_next_property (icalcomp, ICAL_X_PROPERTY);
@@ -1630,24 +1628,24 @@ e_cal_backend_mapi_modify_object (ECalBackendSync *backend, EDataCal *cal, const
 	e_cal_component_set_icalcomponent (comp, icalcomp);
 
 	current = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ());
- 	e_cal_component_set_last_modified (comp, &current);
+	e_cal_component_set_last_modified (comp, &current);
 
 	/* FIXME: [WIP] Add support for recurrences */
 	if (e_cal_component_has_recurrences (comp)) {
-		GByteArray *ba = exchange_mapi_cal_util_rrule_to_bin (comp, NULL); 
+		GByteArray *ba = exchange_mapi_cal_util_rrule_to_bin (comp, NULL);
 		if (ba) {
-			struct SPropTagArray *tag_array; 
-			ExchangeMAPIStream *stream = g_new0 (ExchangeMAPIStream, 1); 
-			stream->value = ba; 
-			tag_array = exchange_mapi_util_resolve_named_prop (priv->olFolder, priv->fid, 0x8216, PSETID_Appointment); 
+			struct SPropTagArray *tag_array;
+			ExchangeMAPIStream *stream = g_new0 (ExchangeMAPIStream, 1);
+			stream->value = ba;
+			tag_array = exchange_mapi_util_resolve_named_prop (priv->olFolder, priv->fid, 0x8216, PSETID_Appointment);
 			if (tag_array) {
 				stream->proptag = tag_array->aulPropTag[0];
-				streams = g_slist_append (streams, stream); 
+				streams = g_slist_append (streams, stream);
 			}
 		}
 	}
 
-	if (e_cal_component_has_attendees (comp)) 
+	if (e_cal_component_has_attendees (comp))
 		exchange_mapi_cal_util_fetch_recipients (comp, &recipients);
 
 	if (e_cal_component_has_attachments (comp))
@@ -1685,7 +1683,7 @@ e_cal_backend_mapi_modify_object (ECalBackendSync *backend, EDataCal *cal, const
 
 		get_server_data (cbmapi, icalcomp, &cbdata);
 		if (modifier_is_organizer(cbmapi, comp)) {
-			cbdata.meeting_type = (recipients != NULL) ? MEETING_OBJECT : NOT_A_MEETING; 
+			cbdata.meeting_type = (recipients != NULL) ? MEETING_OBJECT : NOT_A_MEETING;
 			cbdata.resp = (recipients != NULL) ? olResponseOrganized : olResponseNone;
 			if (!no_increment)
 				cbdata.appt_seq += 1;
@@ -1697,12 +1695,12 @@ e_cal_backend_mapi_modify_object (ECalBackendSync *backend, EDataCal *cal, const
 			cbdata.ownerid = e_cal_backend_mapi_get_owner_email (cbmapi);
 		} else {
 			cbdata.resp = (recipients != NULL) ? find_my_response(cbmapi, comp) : olResponseNone;
-			cbdata.meeting_type = (recipients != NULL) ? MEETING_OBJECT_RCVD : NOT_A_MEETING; 
+			cbdata.meeting_type = (recipients != NULL) ? MEETING_OBJECT_RCVD : NOT_A_MEETING;
 		}
 
-		status = exchange_mapi_modify_item (priv->olFolder, priv->fid, mid, 
-						exchange_mapi_cal_util_build_name_id, GINT_TO_POINTER(kind), 
-						exchange_mapi_cal_util_build_props, &cbdata, 
+		status = exchange_mapi_modify_item (priv->olFolder, priv->fid, mid,
+						exchange_mapi_cal_util_build_name_id, GINT_TO_POINTER(kind),
+						exchange_mapi_cal_util_build_props, &cbdata,
 						recipients, attachments, streams, MAPI_OPTIONS_DONT_SUBMIT);
 		g_free (cbdata.props);
 		if (!status) {
@@ -1714,7 +1712,7 @@ e_cal_backend_mapi_modify_object (ECalBackendSync *backend, EDataCal *cal, const
 			return GNOME_Evolution_Calendar_OtherError;
 		}
 		break;
-	default : 
+	default :
 		g_object_unref (comp);
 		g_object_unref (cache_comp);
 		exchange_mapi_util_free_recipient_list (&recipients);
@@ -1735,16 +1733,16 @@ e_cal_backend_mapi_modify_object (ECalBackendSync *backend, EDataCal *cal, const
 	return GNOME_Evolution_Calendar_Success;
 }
 
-static ECalBackendSyncStatus 
+static ECalBackendSyncStatus
 e_cal_backend_mapi_remove_object (ECalBackendSync *backend, EDataCal *cal,
-				  const char *uid, const char *rid, CalObjModType mod, 
-				  char **old_object, char **object)
+				  const gchar *uid, const gchar *rid, CalObjModType mod,
+				  gchar **old_object, gchar **object)
 {
 	ECalBackendMAPI *cbmapi;
         ECalBackendMAPIPrivate *priv;
 	icalcomponent *icalcomp;
 	ECalBackendSyncStatus status;
-	char *calobj = NULL;
+	gchar *calobj = NULL;
 	mapi_id_t mid;
 
 	*old_object = *object = NULL;
@@ -1758,7 +1756,7 @@ e_cal_backend_mapi_remove_object (ECalBackendSync *backend, EDataCal *cal,
 
 	switch (priv->mode) {
 	case CAL_MODE_ANY :
-	case CAL_MODE_REMOTE : 	/* when online, modify/delete the item from the server */
+	case CAL_MODE_REMOTE :	/* when online, modify/delete the item from the server */
 		/* check if the object exists */
 		/* FIXME: we may have detached instances which need to be removed */
 		status = e_cal_backend_mapi_get_object (backend, cal, uid, NULL, &calobj);
@@ -1775,13 +1773,13 @@ e_cal_backend_mapi_remove_object (ECalBackendSync *backend, EDataCal *cal,
 		exchange_mapi_util_mapi_id_from_string (uid, &mid);
 
 		if (mod == CALOBJ_MOD_THIS && rid && *rid) {
-			char *obj = NULL, *new_object = NULL, *new_calobj = NULL;
+			gchar *obj = NULL, *new_object = NULL, *new_calobj = NULL;
 			struct icaltimetype time_rid;
 
 			/*remove a single instance of a recurring event and modify */
 			time_rid = icaltime_from_string (rid);
 			e_cal_util_remove_instances (icalcomp, time_rid, mod);
-			new_calobj  = (char *) icalcomponent_as_ical_string_r (icalcomp);
+			new_calobj  = (gchar *) icalcomponent_as_ical_string_r (icalcomp);
 			status = e_cal_backend_mapi_modify_object (backend, cal, new_calobj, CALOBJ_MOD_ALL, &obj, &new_object);
 			if (status == GNOME_Evolution_Calendar_Success) {
 				*old_object = obj;
@@ -1791,8 +1789,8 @@ e_cal_backend_mapi_remove_object (ECalBackendSync *backend, EDataCal *cal,
 		} else {
 			GSList *list=NULL, *l, *comp_list = e_cal_backend_cache_get_components_by_uid (priv->cache, uid);
 
-//			if (e_cal_component_has_attendees (E_CAL_COMPONENT (comp_list->data))) { 
-//			} else { 
+//			if (e_cal_component_has_attendees (E_CAL_COMPONENT (comp_list->data))) {
+//			} else {
 				struct id_list *data = g_new (struct id_list, 1);
 				data->id = mid;
 				list = g_slist_prepend (list, (gpointer) data);
@@ -1818,28 +1816,28 @@ e_cal_backend_mapi_remove_object (ECalBackendSync *backend, EDataCal *cal,
 
 			g_slist_free (list);
 			g_slist_free (comp_list);
-		} 
+		}
 		g_free (calobj);
-		break; 
+		break;
 	default :
 		status = GNOME_Evolution_Calendar_CalListener_MODE_NOT_SUPPORTED;
-		break; 
+		break;
 	}
 
 	return status;
 }
 
-static ECalBackendSyncStatus 
-e_cal_backend_mapi_discard_alarm (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *auid)
+static ECalBackendSyncStatus
+e_cal_backend_mapi_discard_alarm (ECalBackendSync *backend, EDataCal *cal, const gchar *uid, const gchar *auid)
 {
 
 	return GNOME_Evolution_Calendar_Success;
-	
+
 }
 
-static ECalBackendSyncStatus 
-e_cal_backend_mapi_send_objects (ECalBackendSync *backend, EDataCal *cal, const char *calobj, 
-				 GList **users, char **modified_calobj)
+static ECalBackendSyncStatus
+e_cal_backend_mapi_send_objects (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj,
+				 GList **users, gchar **modified_calobj)
 {
 	ECalBackendSyncStatus status = GNOME_Evolution_Calendar_OtherError;
 	ECalBackendMAPI *cbmapi;
@@ -1882,17 +1880,17 @@ e_cal_backend_mapi_send_objects (ECalBackendSync *backend, EDataCal *cal, const
 
 			/* FIXME: Add support for recurrences */
 			if (e_cal_component_has_recurrences (comp)) {
-				GByteArray *ba = exchange_mapi_cal_util_rrule_to_bin (comp, NULL); 
+				GByteArray *ba = exchange_mapi_cal_util_rrule_to_bin (comp, NULL);
 				if (ba) {
-					struct SPropTagArray *tag_array; 
-					ExchangeMAPIStream *stream = g_new0 (ExchangeMAPIStream, 1); 
-					stream->value = ba; 
-					tag_array = exchange_mapi_util_resolve_named_prop (priv->olFolder, priv->fid, 0x8216, PSETID_Appointment); 
+					struct SPropTagArray *tag_array;
+					ExchangeMAPIStream *stream = g_new0 (ExchangeMAPIStream, 1);
+					stream->value = ba;
+					tag_array = exchange_mapi_util_resolve_named_prop (priv->olFolder, priv->fid, 0x8216, PSETID_Appointment);
 					if (tag_array) {
 						stream->proptag = tag_array->aulPropTag[0];
-						streams = g_slist_append (streams, stream); 
+						streams = g_slist_append (streams, stream);
 
-						g_free (tag_array->aulPropTag); 
+						g_free (tag_array->aulPropTag);
 						g_free (tag_array);
 					}
 				}
@@ -1906,19 +1904,19 @@ e_cal_backend_mapi_send_objects (ECalBackendSync *backend, EDataCal *cal, const
 			cbdata.msgflags = MSGFLAG_READ | MSGFLAG_SUBMIT | MSGFLAG_UNSENT;
 
 			switch (method) {
-			case ICAL_METHOD_REQUEST : 
+			case ICAL_METHOD_REQUEST :
 				cbdata.meeting_type = MEETING_REQUEST;
 				cbdata.resp = olResponseNotResponded;
 				if (e_cal_component_has_attendees (comp))
 					exchange_mapi_cal_util_fetch_recipients (comp, &recipients);
 				break;
-			case ICAL_METHOD_CANCEL : 
+			case ICAL_METHOD_CANCEL :
 				cbdata.meeting_type = MEETING_CANCEL;
 				cbdata.resp = olResponseNotResponded;
 				if (e_cal_component_has_attendees (comp))
 					exchange_mapi_cal_util_fetch_recipients (comp, &recipients);
 				break;
-			case ICAL_METHOD_RESPONSE : 
+			case ICAL_METHOD_RESPONSE :
 				cbdata.meeting_type = MEETING_RESPONSE;
 				cbdata.resp = find_my_response (cbmapi, comp);
 				if (e_cal_component_has_organizer (comp))
@@ -1948,8 +1946,8 @@ e_cal_backend_mapi_send_objects (ECalBackendSync *backend, EDataCal *cal, const
 			cbdata.cleanglobalid = &globalid;
 
 			mid = exchange_mapi_create_item (olFolderSentMail, 0,
-							exchange_mapi_cal_util_build_name_id, GINT_TO_POINTER(kind), 
-							exchange_mapi_cal_util_build_props, &cbdata, 
+							exchange_mapi_cal_util_build_name_id, GINT_TO_POINTER(kind),
+							exchange_mapi_cal_util_build_props, &cbdata,
 							recipients, attachments, streams, MAPI_OPTIONS_DELETE_ON_SUBMIT_FAILURE);
 			g_free (cbdata.props);
 			if (!mid) {
@@ -1957,7 +1955,7 @@ e_cal_backend_mapi_send_objects (ECalBackendSync *backend, EDataCal *cal, const
 				exchange_mapi_util_free_recipient_list (&recipients);
 				exchange_mapi_util_free_attachment_list (&attachments);
 				return GNOME_Evolution_Calendar_OtherError;
-			} else 
+			} else
 				status = GNOME_Evolution_Calendar_Success;
 
 			g_object_unref (comp);
@@ -1977,8 +1975,8 @@ e_cal_backend_mapi_send_objects (ECalBackendSync *backend, EDataCal *cal, const
 	return GNOME_Evolution_Calendar_Success;
 }
 
-static ECalBackendSyncStatus 
-e_cal_backend_mapi_receive_objects (ECalBackendSync *backend, EDataCal *cal, const char *calobj)
+static ECalBackendSyncStatus
+e_cal_backend_mapi_receive_objects (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj)
 {
 	ECalBackendSyncStatus status = GNOME_Evolution_Calendar_OtherError;
 	ECalBackendMAPI *cbmapi;
@@ -2007,9 +2005,9 @@ e_cal_backend_mapi_receive_objects (ECalBackendSync *backend, EDataCal *cal, con
 		icalcomponent *subcomp = icalcomponent_get_first_component (icalcomp, kind);
 		while (subcomp && !stop) {
 			ECalComponent *comp = e_cal_component_new ();
-			gchar *rid = NULL; 
-			const char *uid;
-			gchar *old_object = NULL, *new_object = NULL, *comp_str; 
+			gchar *rid = NULL;
+			const gchar *uid;
+			gchar *old_object = NULL, *new_object = NULL, *comp_str;
 
 			e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (subcomp));
 
@@ -2044,7 +2042,7 @@ e_cal_backend_mapi_receive_objects (ECalBackendSync *backend, EDataCal *cal, con
 					GList *users = NULL, *l;
 					icalcomponent *resp_comp = e_cal_util_new_top_level ();
 					icalcomponent_set_method (resp_comp, ICAL_METHOD_RESPONSE);
-					icalcomponent_add_component (resp_comp, 
+					icalcomponent_add_component (resp_comp,
 						icalcomponent_new_clone(e_cal_component_get_icalcomponent(comp)));
 					comp_str = icalcomponent_as_ical_string_r (resp_comp);
 					status = e_cal_backend_mapi_send_objects (backend, cal, comp_str, &users, &new_object);
@@ -2069,7 +2067,7 @@ e_cal_backend_mapi_receive_objects (ECalBackendSync *backend, EDataCal *cal, con
 			case ICAL_METHOD_REPLY :
 				/* responses are automatically updated even as they are rendered (just like in Outlook) */
 				status = GNOME_Evolution_Calendar_Success;
-				break; 
+				break;
 			default :
 				break;
 			}
@@ -2085,8 +2083,8 @@ e_cal_backend_mapi_receive_objects (ECalBackendSync *backend, EDataCal *cal, con
 	return status;
 }
 
-static ECalBackendSyncStatus 
-e_cal_backend_mapi_add_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj)
+static ECalBackendSyncStatus
+e_cal_backend_mapi_add_timezone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzobj)
 {
 	ECalBackendMAPI *cbmapi;
 	ECalBackendMAPIPrivate *priv;
@@ -2118,8 +2116,8 @@ e_cal_backend_mapi_add_timezone (ECalBackendSync *backend, EDataCal *cal, const
 	return GNOME_Evolution_Calendar_Success;
 }
 
-static ECalBackendSyncStatus 
-e_cal_backend_mapi_set_default_zone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj)
+static ECalBackendSyncStatus
+e_cal_backend_mapi_set_default_zone (ECalBackendSync *backend, EDataCal *cal, const gchar *tzobj)
 {
 	icalcomponent *tz_comp;
 	ECalBackendMAPI *cbmapi;
@@ -2149,12 +2147,12 @@ e_cal_backend_mapi_set_default_zone (ECalBackendSync *backend, EDataCal *cal, co
 	return GNOME_Evolution_Calendar_Success;
 }
 
-static ECalBackendSyncStatus 
-e_cal_backend_mapi_get_free_busy (ECalBackendSync *backend, EDataCal *cal, 
+static ECalBackendSyncStatus
+e_cal_backend_mapi_get_free_busy (ECalBackendSync *backend, EDataCal *cal,
 				  GList *users, time_t start, time_t end, GList **freebusy)
 {
 
-	return GNOME_Evolution_Calendar_Success;	
+	return GNOME_Evolution_Calendar_Success;
 
 }
 
@@ -2166,7 +2164,7 @@ typedef struct {
 } ECalBackendMAPIComputeChangesData;
 
 static void
-e_cal_backend_mapi_compute_changes_foreach_key (const char *key, const char *value, gpointer data)
+e_cal_backend_mapi_compute_changes_foreach_key (const gchar *key, const gchar *value, gpointer data)
 {
 	ECalBackendMAPIComputeChangesData *be_data = data;
 
@@ -2184,11 +2182,11 @@ e_cal_backend_mapi_compute_changes_foreach_key (const char *key, const char *val
 
 		e_xmlhash_remove (be_data->ehash, key);
 		g_object_unref (comp);
- 	}
+	}
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_mapi_compute_changes (ECalBackendMAPI *cbmapi, const char *change_id,
+e_cal_backend_mapi_compute_changes (ECalBackendMAPI *cbmapi, const gchar *change_id,
 				    GList **adds, GList **modifies, GList **deletes)
 {
 	ECalBackendSyncStatus status;
@@ -2214,8 +2212,8 @@ e_cal_backend_mapi_compute_changes (ECalBackendMAPI *cbmapi, const char *change_
 
         /* Calculate adds and modifies */
 	for (i = list; i != NULL; i = g_list_next (i)) {
-		const char *uid;
-		char *calobj;
+		const gchar *uid;
+		gchar *calobj;
 		ECalComponent *comp;
 
 		comp = e_cal_component_new_from_string (i->data);
@@ -2248,18 +2246,18 @@ e_cal_backend_mapi_compute_changes (ECalBackendMAPI *cbmapi, const char *change_
 	be_data.kind = e_cal_backend_get_kind (E_CAL_BACKEND (cbmapi));
 	be_data.deletes = NULL;
 	be_data.ehash = ehash;
-   	e_xmlhash_foreach_key (ehash, (EXmlHashFunc)e_cal_backend_mapi_compute_changes_foreach_key, &be_data);
+	e_xmlhash_foreach_key (ehash, (EXmlHashFunc)e_cal_backend_mapi_compute_changes_foreach_key, &be_data);
 
 	*deletes = be_data.deletes;
 
 	e_xmlhash_write (ehash);
-  	e_xmlhash_destroy (ehash);
+	e_xmlhash_destroy (ehash);
 
 	return GNOME_Evolution_Calendar_Success;
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_mapi_get_changes (ECalBackendSync *backend, EDataCal *cal, const char *change_id,
+e_cal_backend_mapi_get_changes (ECalBackendSync *backend, EDataCal *cal, const gchar *change_id,
 				GList **adds, GList **modifies, GList **deletes)
 {
 	ECalBackendMAPI *cbmapi;
@@ -2273,9 +2271,8 @@ e_cal_backend_mapi_get_changes (ECalBackendSync *backend, EDataCal *cal, const c
 
 }
 
-
 /***** BACKEND CLASS FUNCTIONS *****/
-static gboolean	
+static gboolean
 e_cal_backend_mapi_is_loaded (ECalBackend *backend)
 {
 	ECalBackendMAPI *cbmapi;
@@ -2287,7 +2284,7 @@ e_cal_backend_mapi_is_loaded (ECalBackend *backend)
 	return priv->cache ? TRUE : FALSE;
 }
 
-static void 
+static void
 e_cal_backend_mapi_start_query (ECalBackend *backend, EDataCalView *query)
 {
         ECalBackendSyncStatus status;
@@ -2305,7 +2302,7 @@ e_cal_backend_mapi_start_query (ECalBackend *backend, EDataCalView *query)
                 return;
 	}
 
-       	/* notify listeners of all objects */
+	/* notify listeners of all objects */
 	if (objects) {
 		e_data_cal_view_notify_objects_added (query, (const GList *) objects);
 		/* free memory */
@@ -2316,7 +2313,7 @@ e_cal_backend_mapi_start_query (ECalBackend *backend, EDataCalView *query)
 	e_data_cal_view_notify_done (query, GNOME_Evolution_Calendar_Success);
 }
 
-static CalMode 
+static CalMode
 e_cal_backend_mapi_get_mode (ECalBackend *backend)
 {
 	ECalBackendMAPI *cbmapi;
@@ -2328,7 +2325,7 @@ e_cal_backend_mapi_get_mode (ECalBackend *backend)
 	return priv->mode;
 }
 
-static void 
+static void
 e_cal_backend_mapi_set_mode (ECalBackend *backend, CalMode mode)
 {
 	ECalBackendMAPI *cbmapi;
@@ -2340,9 +2337,9 @@ e_cal_backend_mapi_set_mode (ECalBackend *backend, CalMode mode)
 
 	if (!priv->mode && priv->mode == mode) {
 		e_cal_backend_notify_mode (backend, GNOME_Evolution_Calendar_CalListener_MODE_SET,
-				  	   cal_mode_to_corba (mode));
+					   cal_mode_to_corba (mode));
 		return;
-	}	
+	}
 
 	g_mutex_lock (priv->mutex);
 
@@ -2356,7 +2353,7 @@ e_cal_backend_mapi_set_mode (ECalBackend *backend, CalMode mode)
 			e_cal_backend_notify_mode (backend, GNOME_Evolution_Calendar_CalListener_MODE_SET,
 					GNOME_Evolution_Calendar_MODE_REMOTE);
 			if (e_cal_backend_mapi_is_loaded (backend) && re_open)
-		              e_cal_backend_notify_auth_required(backend);
+			      e_cal_backend_notify_auth_required(backend);
 			break;
 		case CAL_MODE_LOCAL:
 			priv->mode = CAL_MODE_LOCAL;
@@ -2368,12 +2365,12 @@ e_cal_backend_mapi_set_mode (ECalBackend *backend, CalMode mode)
 		default:
 			e_cal_backend_notify_mode (backend, GNOME_Evolution_Calendar_CalListener_MODE_NOT_SUPPORTED,
 					cal_mode_to_corba (mode));
-	}	
+	}
 
 	g_mutex_unlock (priv->mutex);
 }
 
-static icaltimezone * 
+static icaltimezone *
 e_cal_backend_mapi_internal_get_default_timezone (ECalBackend *backend)
 {
 	ECalBackendMAPI *cbmapi;
@@ -2386,7 +2383,7 @@ e_cal_backend_mapi_internal_get_default_timezone (ECalBackend *backend)
 }
 
 static icaltimezone *
-e_cal_backend_mapi_internal_get_timezone (ECalBackend *backend, const char *tzid)
+e_cal_backend_mapi_internal_get_timezone (ECalBackend *backend, const gchar *tzid)
 {
 	ECalBackendMAPI *cbmapi;
 	icaltimezone *zone;
@@ -2405,19 +2402,18 @@ e_cal_backend_mapi_internal_get_timezone (ECalBackend *backend, const char *tzid
 	return zone;
 }
 
-
 /* MAPI CLASS INIT */
-static void 
+static void
 e_cal_backend_mapi_class_init (ECalBackendMAPIClass *class)
 {
 	GObjectClass *object_class;
 	ECalBackendSyncClass *sync_class;
 	ECalBackendClass *backend_class;
-	
+
 	object_class = (GObjectClass *) class;
 	sync_class = (ECalBackendSyncClass *) class;
 	backend_class = (ECalBackendClass *) class;
-	
+
 	parent_class = g_type_class_peek_parent (class);
 
 	object_class->dispose = e_cal_backend_mapi_dispose;
@@ -2453,12 +2449,11 @@ e_cal_backend_mapi_class_init (ECalBackendMAPIClass *class)
 	backend_class->internal_get_timezone = e_cal_backend_mapi_internal_get_timezone;
 }
 
-
 static void
 e_cal_backend_mapi_init (ECalBackendMAPI *cbmapi)
 {
 	ECalBackendMAPIPrivate *priv;
-	
+
 	priv = g_new0 (ECalBackendMAPIPrivate, 1);
 
 	priv->timeout_id = 0;
@@ -2473,7 +2468,7 @@ e_cal_backend_mapi_init (ECalBackendMAPI *cbmapi)
 }
 
 /***** UTILITY FUNCTIONS *****/
-const char *	
+const gchar *
 e_cal_backend_mapi_get_local_attachments_store (ECalBackendMAPI *cbmapi)
 {
 	ECalBackendMAPIPrivate *priv;
@@ -2483,7 +2478,7 @@ e_cal_backend_mapi_get_local_attachments_store (ECalBackendMAPI *cbmapi)
 	return priv->local_attachments_store;
 }
 
-const char *	
+const gchar *
 e_cal_backend_mapi_get_owner_name (ECalBackendMAPI *cbmapi)
 {
 	ECalBackendMAPIPrivate *priv;
@@ -2493,7 +2488,7 @@ e_cal_backend_mapi_get_owner_name (ECalBackendMAPI *cbmapi)
 	return priv->owner_name;
 }
 
-const char *	
+const gchar *
 e_cal_backend_mapi_get_owner_email (ECalBackendMAPI *cbmapi)
 {
 	ECalBackendMAPIPrivate *priv;
@@ -2503,7 +2498,7 @@ e_cal_backend_mapi_get_owner_email (ECalBackendMAPI *cbmapi)
 	return priv->owner_email;
 }
 
-const char *	
+const gchar *
 e_cal_backend_mapi_get_user_name (ECalBackendMAPI *cbmapi)
 {
 	ECalBackendMAPIPrivate *priv;
@@ -2513,7 +2508,7 @@ e_cal_backend_mapi_get_user_name (ECalBackendMAPI *cbmapi)
 	return priv->user_name;
 }
 
-const char *	
+const gchar *
 e_cal_backend_mapi_get_user_email (ECalBackendMAPI *cbmapi)
 {
 	ECalBackendMAPIPrivate *priv;
diff --git a/src/calendar/e-cal-backend-mapi.h b/src/calendar/e-cal-backend-mapi.h
index 46b3154..641d469 100644
--- a/src/calendar/e-cal-backend-mapi.h
+++ b/src/calendar/e-cal-backend-mapi.h
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -53,17 +53,17 @@ struct _ECalBackendMAPIClass {
 
 GType	e_cal_backend_mapi_get_type(void);
 
-const char *	
+const gchar *
 e_cal_backend_mapi_get_local_attachments_store (ECalBackendMAPI *cbmapi);
 
-const char *	
+const gchar *
 e_cal_backend_mapi_get_owner_name (ECalBackendMAPI *cbmapi);
-const char *	
+const gchar *
 e_cal_backend_mapi_get_owner_email (ECalBackendMAPI *cbmapi);
 
-const char *	
+const gchar *
 e_cal_backend_mapi_get_user_name (ECalBackendMAPI *cbmapi);
-const char *	
+const gchar *
 e_cal_backend_mapi_get_user_email (ECalBackendMAPI *cbmapi);
 
 G_END_DECLS
diff --git a/src/camel/camel-mapi-folder.c b/src/camel/camel-mapi-folder.c
index 79e66e3..fb8dca2 100644
--- a/src/camel/camel-mapi-folder.c
+++ b/src/camel/camel-mapi-folder.c
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -53,7 +53,7 @@
 static CamelOfflineFolderClass *parent_class = NULL;
 
 struct _CamelMapiFolderPrivate {
-	
+
 //#ifdef ENABLE_THREADS
 	GStaticMutex search_lock;	/* for locking the search object */
 	GStaticRecMutex cache_lock;	/* for locking the cache object */
@@ -74,7 +74,7 @@ static void mapi_update_cache (CamelFolder *folder, GSList *list, CamelFolderCha
 			       CamelException *ex, gboolean uid_flag);
 
 static GPtrArray *
-mapi_folder_search_by_expression (CamelFolder *folder, const char *expression, CamelException *ex)
+mapi_folder_search_by_expression (CamelFolder *folder, const gchar *expression, CamelException *ex)
 {
 	CamelMapiFolder *mapi_folder = CAMEL_MAPI_FOLDER(folder);
 	GPtrArray *matches;
@@ -104,14 +104,14 @@ mapi_folder_search_by_uids (CamelFolder *folder, const gchar *expression, GPtrAr
 	return matches;
 }
 
-static int
+static gint
 mapi_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
 {
 	CamelFolder *folder = (CamelFolder *)object;
-	int i, count = 0;
+	gint i, count = 0;
 	guint32 tag;
 
-	for (i=0 ; i<args->argc ; i++) {
+	for (i=0; i<args->argc; i++) {
 		CamelArgGet *arg = &args->argv[i];
 
 		tag = arg->tag;
@@ -151,7 +151,7 @@ mapi_refresh_info(CamelFolder *folder, CamelException *ex)
 	 * should not interfere with the process
 	 */
 	//	if (summary->time_string && (strlen (summary->time_string) > 0))  {
-	if(1){
+	if (1) {
 		mapi_refresh_folder(folder, ex);
 		si = camel_store_summary_path ((CamelStoreSummary *)((CamelMapiStore *)folder->parent_store)->summary, folder->full_name);
 
@@ -177,7 +177,7 @@ mapi_refresh_info(CamelFolder *folder, CamelException *ex)
 
 }
 
-void 
+void
 mapi_item_free (MapiItem *item)
 {
 	g_free (item->header.subject);
@@ -286,7 +286,7 @@ static gboolean
 fetch_items_summary_cb (FetchItemsCallbackData *item_data, gpointer data)
 {
 	fetch_items_data *fi_data = (fetch_items_data *)data;
-	
+
 	GSList **slist = &(fi_data->items_list);
 
 	long *flags;
@@ -362,7 +362,7 @@ fetch_items_summary_cb (FetchItemsCallbackData *item_data, gpointer data)
 
 	*slist = g_slist_prepend (*slist, item);
 
-	/*Write summary to db in batches of SUMMARY_FETCH_BATCH_COUNT items.*/ 
+	/*Write summary to db in batches of SUMMARY_FETCH_BATCH_COUNT items.*/
 	if ((item_data->index % SUMMARY_FETCH_BATCH_COUNT == 0) ||
 	     item_data->index == item_data->total-1) {
 		mapi_update_cache (fi_data->folder, *slist, &fi_data->changes, NULL, false);
@@ -456,7 +456,7 @@ mapi_set_message_references (CamelMapiMessageInfo *mapi_mi, const gchar *referen
 
 static void
 mapi_update_cache (CamelFolder *folder, GSList *list, CamelFolderChangeInfo **changeinfo,
-		   CamelException *ex, gboolean uid_flag) 
+		   CamelException *ex, gboolean uid_flag)
 {
 	CamelMapiMessageInfo *mi = NULL;
 	CamelMessageInfo *pmi = NULL;
@@ -468,7 +468,7 @@ mapi_update_cache (CamelFolder *folder, GSList *list, CamelFolderChangeInfo **ch
 	GString *str = g_string_new (NULL);
 	const gchar *from_email, *folder_id = NULL;
 	GSList *item_list = list;
-	int total_items = g_slist_length (item_list), i=0;
+	gint total_items = g_slist_length (item_list), i=0;
 
 	changes = *changeinfo;
 
@@ -481,8 +481,8 @@ mapi_update_cache (CamelFolder *folder, GSList *list, CamelFolderChangeInfo **ch
 
 	camel_operation_start (NULL, _("Updating local summary cache for new messages in %s"), folder->name);
 
-	for ( ; item_list != NULL ; item_list = g_slist_next (item_list) ) {
-		MapiItem *temp_item ;
+	for (; item_list != NULL; item_list = g_slist_next (item_list) ) {
+		MapiItem *temp_item;
 		MapiItem *item;
 		gchar *msg_uid;
 		guint64 id;
@@ -491,7 +491,7 @@ mapi_update_cache (CamelFolder *folder, GSList *list, CamelFolderChangeInfo **ch
 		status_flags = 0;
 
 		if (uid_flag == FALSE) {
- 			temp_item = (MapiItem *)item_list->data;
+			temp_item = (MapiItem *)item_list->data;
 			id = temp_item->mid;
 			item = temp_item;
 		}
@@ -511,18 +511,18 @@ mapi_update_cache (CamelFolder *folder, GSList *list, CamelFolderChangeInfo **ch
 		}
 
 		if (!exists) {
-			mi = (CamelMapiMessageInfo *)camel_message_info_new (folder->summary); 
+			mi = (CamelMapiMessageInfo *)camel_message_info_new (folder->summary);
 			if (mi->info.content == NULL) {
 				mi->info.content = camel_folder_summary_content_info_new (folder->summary);
-				mi->info.content->type = camel_content_type_new ("multipart", "related");      
+				mi->info.content->type = camel_content_type_new ("multipart", "related");
 			}
 		}
-		
+
 		mi->info.flags = item->header.flags;
 
 		if (!exists) {
- 			GSList *l = NULL;
- 			guint32 count_to = 0, count_cc =0;
+			GSList *l = NULL;
+			guint32 count_to = 0, count_cc =0;
 			gchar *to = NULL, *cc = NULL;
 
 			mi->info.uid = exchange_mapi_util_mapi_ids_to_uid(item->fid, item->mid);
@@ -536,31 +536,31 @@ mapi_update_cache (CamelFolder *folder, GSList *list, CamelFolderChangeInfo **ch
 				mapi_set_message_references (mi, item->header.references, item->header.in_reply_to);
 
 			/*Recipients*/
- 			for (l = item->recipients; l; l=l->next) {
- 				gchar *formatted_id = NULL;
-				const char *name, *display_name;
- 				guint32 *type = NULL;
- 				struct SRow *aRow;
- 				ExchangeMAPIRecipient *recip = (ExchangeMAPIRecipient *)(l->data);
- 				
- 				/*Can't continue when there is no email-id*/
- 				if (!recip->email_id)
- 					continue;
- 				
- 				/* Build a SRow structure */
- 				aRow = &recip->out_SRow;
-
- 				type = (uint32_t *) find_SPropValue_data (aRow, PR_RECIPIENT_TYPE);
+			for (l = item->recipients; l; l=l->next) {
+				gchar *formatted_id = NULL;
+				const gchar *name, *display_name;
+				guint32 *type = NULL;
+				struct SRow *aRow;
+				ExchangeMAPIRecipient *recip = (ExchangeMAPIRecipient *)(l->data);
+
+				/*Can't continue when there is no email-id*/
+				if (!recip->email_id)
+					continue;
+
+				/* Build a SRow structure */
+				aRow = &recip->out_SRow;
+
+				type = (uint32_t *) find_SPropValue_data (aRow, PR_RECIPIENT_TYPE);
 
 				if (type) {
- 					name = (const char *) find_SPropValue_data (aRow, PR_DISPLAY_NAME);
- 					name = name ? name : (const char *) find_SPropValue_data (aRow, PR_RECIPIENT_DISPLAY_NAME);
- 					name = name ? name : (const char *) find_SPropValue_data (aRow, 
- 												 PR_RECIPIENT_DISPLAY_NAME_UNICODE);
- 					name = name ? name : (const char *) find_SPropValue_data (aRow, 
- 												 PR_7BIT_DISPLAY_NAME_UNICODE);
- 					display_name = name ? name : recip->email_id;
- 					formatted_id = camel_internet_address_format_address(display_name, recip->email_id);
+					name = (const gchar *) find_SPropValue_data (aRow, PR_DISPLAY_NAME);
+					name = name ? name : (const gchar *) find_SPropValue_data (aRow, PR_RECIPIENT_DISPLAY_NAME);
+					name = name ? name : (const gchar *) find_SPropValue_data (aRow,
+												 PR_RECIPIENT_DISPLAY_NAME_UNICODE);
+					name = name ? name : (const gchar *) find_SPropValue_data (aRow,
+												 PR_7BIT_DISPLAY_NAME_UNICODE);
+					display_name = name ? name : recip->email_id;
+					formatted_id = camel_internet_address_format_address(display_name, recip->email_id);
 
 					switch (*type) {
 					case MAPI_TO:
@@ -589,32 +589,32 @@ mapi_update_cache (CamelFolder *folder, GSList *list, CamelFolderChangeInfo **ch
 						continue;
 					}
 				}
- 			}
- 			
- 			if ((item->header.from_type != NULL) && !g_utf8_collate (item->header.from_type, "EX")) {
- 				CAMEL_SERVICE_REC_LOCK (mapi_store, connect_lock);
+			}
+
+			if ((item->header.from_type != NULL) && !g_utf8_collate (item->header.from_type, "EX")) {
+				CAMEL_SERVICE_REC_LOCK (mapi_store, connect_lock);
 				from_email = exchange_mapi_util_ex_to_smtp (item->header.from_email);
- 				CAMEL_SERVICE_REC_UNLOCK (mapi_store, connect_lock);
+				CAMEL_SERVICE_REC_UNLOCK (mapi_store, connect_lock);
+
+				g_free (item->header.from_email);
+				item->header.from_email = g_strdup (from_email);
+			}
 
- 				g_free (item->header.from_email);
-				item->header.from_email = g_strdup (from_email);				
- 			}
- 
- 			item->header.from_email = item->header.from_email ? 
- 				item->header.from_email : item->header.from;
+			item->header.from_email = item->header.from_email ?
+				item->header.from_email : item->header.from;
 
 			if (item->header.from_email) {
-				gchar *from = camel_internet_address_format_address (item->header.from, 
+				gchar *from = camel_internet_address_format_address (item->header.from,
 										     item->header.from_email);
- 				mi->info.from = camel_pstring_strdup (from);
+				mi->info.from = camel_pstring_strdup (from);
 
 				g_free (from);
 			} else
 				mi->info.from = NULL;
 
 			/* Fallback */
- 			mi->info.to = to ? camel_pstring_strdup (to) : camel_pstring_strdup (item->header.to);
- 			mi->info.cc = cc ? camel_pstring_strdup (cc) : camel_pstring_strdup (item->header.cc);
+			mi->info.to = to ? camel_pstring_strdup (to) : camel_pstring_strdup (item->header.to);
+			mi->info.cc = cc ? camel_pstring_strdup (cc) : camel_pstring_strdup (item->header.cc);
 
 			g_free (to);
 			g_free (cc);
@@ -644,7 +644,7 @@ mapi_update_cache (CamelFolder *folder, GSList *list, CamelFolderChangeInfo **ch
 	g_string_free (str, TRUE);
 }
 
-static void 
+static void
 mapi_sync_summary (CamelFolder *folder, CamelException *ex)
 {
 	camel_folder_summary_save_to_db (folder->summary, ex);
@@ -659,7 +659,6 @@ mapi_utils_do_flags_diff (flags_diff_t *diff, guint32 old, guint32 _new)
 	diff->bits = _new & diff->changed;
 }
 
-
 struct mapi_update_deleted_msg {
 	CamelSessionThreadMsg msg;
 
@@ -672,7 +671,7 @@ static gboolean
 deleted_items_sync_cb (FetchItemsCallbackData *item_data, gpointer data)
 {
 	GSList **uid_list = (GSList **) data;
-	gchar *msg_uid = exchange_mapi_util_mapi_ids_to_uid (item_data->fid, 
+	gchar *msg_uid = exchange_mapi_util_mapi_ids_to_uid (item_data->fid,
 							     item_data->mid);
 
 	*uid_list = g_slist_prepend (*uid_list, msg_uid);
@@ -704,10 +703,10 @@ mapi_sync_deleted (CamelSession *session, CamelSessionThreadMsg *msg)
 
 	/* Currently we don't have simple wrapper over getprops.*/
 	const guint32 prop_list[] = { PR_LAST_MODIFICATION_TIME };
-	
+
 	if (((CamelOfflineStore *) mapi_store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL ||
 			((CamelService *)mapi_store)->status == CAMEL_SERVICE_DISCONNECTED) {
-	
+
 		return;
 	}
 
@@ -747,7 +746,7 @@ mapi_sync_deleted (CamelSession *session, CamelSessionThreadMsg *msg)
 
 		if (server_uid_list) {
 			/* TODO : Find a better way and avoid this linear search */
-			tmp_list_item = g_slist_find_custom (server_uid_list, (gconstpointer) uid, 
+			tmp_list_item = g_slist_find_custom (server_uid_list, (gconstpointer) uid,
 						  (GCompareFunc) g_strcmp0);
 		}
 
@@ -821,7 +820,7 @@ mapi_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
 
 	GSList *read_items = NULL, *unread_items = NULL, *to_free = NULL;
 	flags_diff_t diff, unset_flags;
-	const char *folder_id;
+	const gchar *folder_id;
 	mapi_id_t fid, deleted_items_fid;
 	gint count, i;
 	guint32 options =0;
@@ -829,7 +828,7 @@ mapi_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
 	GSList *deleted_items, *deleted_head;
 	deleted_items = deleted_head = NULL;
 
-	if (((CamelOfflineStore *) mapi_store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL || 
+	if (((CamelOfflineStore *) mapi_store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL ||
 			((CamelService *)mapi_store)->status == CAMEL_SERVICE_DISCONNECTED) {
 		mapi_sync_summary (folder, ex);
 		return;
@@ -838,7 +837,7 @@ mapi_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
 	if (((CamelMapiFolder *)folder)->type & CAMEL_MAPI_FOLDER_PUBLIC)
 		options |= MAPI_OPTIONS_USE_PFSTORE;
 
-	folder_id =  camel_mapi_store_folder_id_lookup (mapi_store, folder->full_name) ;
+	folder_id =  camel_mapi_store_folder_id_lookup (mapi_store, folder->full_name);
 	exchange_mapi_util_mapi_id_from_string (folder_id, &fid);
 
 	CAMEL_SERVICE_REC_LOCK (mapi_store, connect_lock);
@@ -851,12 +850,12 @@ mapi_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
 
 	count = camel_folder_summary_count (folder->summary);
 	CAMEL_MAPI_FOLDER_REC_LOCK (folder, cache_lock);
-	for (i=0 ; i < count ; i++) {
+	for (i=0; i < count; i++) {
 		info = camel_folder_summary_index (folder->summary, i);
 		mapi_info = (CamelMapiMessageInfo *) info;
 
 		if (mapi_info && (mapi_info->info.flags & CAMEL_MESSAGE_FOLDER_FLAGGED)) {
-			const char *uid;
+			const gchar *uid;
 			mapi_id_t *mid = g_new0 (mapi_id_t, 1); /* FIXME : */
 			mapi_id_t temp_fid;
 			guint32 flags;
@@ -912,11 +911,11 @@ mapi_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
 		}
 		camel_message_info_free (info);
 	}
-	
+
 	CAMEL_MAPI_FOLDER_REC_UNLOCK (folder, cache_lock);
 
-	/* 
-	   Sync up the READ changes before deleting the message. 
+	/*
+	   Sync up the READ changes before deleting the message.
 	   Note that if a message is marked as unread and then deleted,
 	   Evo doesnt not take care of it, as I find that scenario to be impractical.
 	*/
@@ -943,7 +942,7 @@ mapi_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
 
 	/*Remove messages from local cache*/
 	while (deleted_items) {
-		char* deleted_msg_uid = g_strdup_printf ("%016" G_GINT64_MODIFIER "X%016" G_GINT64_MODIFIER "X", fid, *(mapi_id_t *)deleted_items->data);
+		gchar * deleted_msg_uid = g_strdup_printf ("%016" G_GINT64_MODIFIER "X%016" G_GINT64_MODIFIER "X", fid, *(mapi_id_t *)deleted_items->data);
 
 		CAMEL_MAPI_FOLDER_REC_LOCK (folder, cache_lock);
 		camel_folder_summary_remove_uid (folder->summary, deleted_msg_uid);
@@ -1009,7 +1008,7 @@ camel_mapi_folder_fetch_summary (CamelStore *store, const mapi_id_t fid, struct
 	CAMEL_SERVICE_REC_LOCK (mapi_store, connect_lock);
 
 	status = exchange_mapi_connection_fetch_items  (fid, res, sort, summary_prop_list,
-							G_N_ELEMENTS (summary_prop_list), 
+							G_N_ELEMENTS (summary_prop_list),
 							NULL, NULL, fetch_items_summary_cb,
 							fetch_data, options);
 
@@ -1070,7 +1069,7 @@ mapi_refresh_folder(CamelFolder *folder, CamelException *ex)
 		guint32 options = 0;
 
 		if (mapi_summary->sync_time_stamp && *mapi_summary->sync_time_stamp &&
-		    g_time_val_from_iso8601 (mapi_summary->sync_time_stamp, 
+		    g_time_val_from_iso8601 (mapi_summary->sync_time_stamp,
 					     &fetch_data->last_modification_time)) {
 			struct SPropValue sprop;
 			struct timeval t;
@@ -1084,11 +1083,11 @@ mapi_refresh_folder(CamelFolder *folder, CamelException *ex)
 			t.tv_sec = fetch_data->last_modification_time.tv_sec;
 			t.tv_usec = fetch_data->last_modification_time.tv_usec;
 
-			//Creation time ? 
+			//Creation time ?
 			set_SPropValue_proptag_date_timeval (&sprop, PR_LAST_MODIFICATION_TIME, &t);
 			cast_mapi_SPropValue (&(res->res.resProperty.lpProp), &sprop);
 
-		} 
+		}
 
 		/*Initialize other fetch_data fields*/
 		fetch_data->changes = camel_folder_change_info_new ();
@@ -1134,7 +1133,7 @@ mapi_refresh_folder(CamelFolder *folder, CamelException *ex)
 		is_locked = FALSE;
 
 		/* Downsync deleted items */
-		deleted_items_op_msg = camel_session_thread_msg_new (session, &deleted_items_sync_ops, 
+		deleted_items_op_msg = camel_session_thread_msg_new (session, &deleted_items_sync_ops,
 							 sizeof (*deleted_items_op_msg));
 		deleted_items_op_msg->folder = folder;
 		deleted_items_op_msg->folder_id = temp_folder_id;
@@ -1157,150 +1156,149 @@ end1:
 }
 
 static const uint32_t camel_GetPropsList[] = {
-	PR_FID, 
-	PR_MID, 
+	PR_FID,
+	PR_MID,
 	PR_INTERNET_CPID,
 
-
 	PR_TRANSPORT_MESSAGE_HEADERS,
 	PR_TRANSPORT_MESSAGE_HEADERS_UNICODE,
-	PR_MESSAGE_CLASS, 
-	PR_MESSAGE_CLASS_UNICODE, 
-	PR_MESSAGE_SIZE, 
-	PR_MESSAGE_FLAGS, 
-	PR_MESSAGE_DELIVERY_TIME, 
-	PR_MSG_EDITOR_FORMAT, 
-
-	PR_SUBJECT, 
-	PR_SUBJECT_UNICODE, 
-	PR_CONVERSATION_TOPIC, 
-	PR_CONVERSATION_TOPIC_UNICODE, 
+	PR_MESSAGE_CLASS,
+	PR_MESSAGE_CLASS_UNICODE,
+	PR_MESSAGE_SIZE,
+	PR_MESSAGE_FLAGS,
+	PR_MESSAGE_DELIVERY_TIME,
+	PR_MSG_EDITOR_FORMAT,
+
+	PR_SUBJECT,
+	PR_SUBJECT_UNICODE,
+	PR_CONVERSATION_TOPIC,
+	PR_CONVERSATION_TOPIC_UNICODE,
 
 	/*Properties used for message threading.*/
 	PR_INTERNET_MESSAGE_ID,
 	PR_INTERNET_REFERENCES,
 	PR_IN_REPLY_TO_ID,
 
-	PR_BODY, 
-	PR_BODY_UNICODE, 
+	PR_BODY,
+	PR_BODY_UNICODE,
 	PR_HTML,
 	/*Fixme : If this property is fetched, it garbles everything else. */
- 	/*PR_BODY_HTML, */
- 	/*PR_BODY_HTML_UNICODE, */
-
-	PR_DISPLAY_TO, 
-	PR_DISPLAY_TO_UNICODE, 
-	PR_DISPLAY_CC, 
-	PR_DISPLAY_CC_UNICODE, 
-	PR_DISPLAY_BCC, 
-	PR_DISPLAY_BCC_UNICODE, 
-
-	PR_CREATION_TIME, 
-	PR_LAST_MODIFICATION_TIME, 
-	PR_PRIORITY, 
-	PR_SENSITIVITY, 
-	PR_START_DATE, 
-	PR_END_DATE, 
-	PR_RESPONSE_REQUESTED, 
-	PR_OWNER_APPT_ID, 
-	PR_PROCESSED, 
-
-	PR_SENT_REPRESENTING_NAME, 
-	PR_SENT_REPRESENTING_NAME_UNICODE, 
-	PR_SENT_REPRESENTING_ADDRTYPE, 
-	PR_SENT_REPRESENTING_ADDRTYPE_UNICODE, 
-	PR_SENT_REPRESENTING_EMAIL_ADDRESS, 
-	PR_SENT_REPRESENTING_EMAIL_ADDRESS_UNICODE, 
-
-	PR_SENDER_NAME, 
-	PR_SENDER_NAME_UNICODE, 
-	PR_SENDER_ADDRTYPE, 
-	PR_SENDER_ADDRTYPE_UNICODE, 
-	PR_SENDER_EMAIL_ADDRESS, 
-	PR_SENDER_EMAIL_ADDRESS_UNICODE, 
-
-	PR_RCVD_REPRESENTING_NAME, 
-	PR_RCVD_REPRESENTING_NAME_UNICODE, 
-	PR_RCVD_REPRESENTING_ADDRTYPE, 
-	PR_RCVD_REPRESENTING_ADDRTYPE_UNICODE, 
-	PR_RCVD_REPRESENTING_EMAIL_ADDRESS, 
+	/*PR_BODY_HTML, */
+	/*PR_BODY_HTML_UNICODE, */
+
+	PR_DISPLAY_TO,
+	PR_DISPLAY_TO_UNICODE,
+	PR_DISPLAY_CC,
+	PR_DISPLAY_CC_UNICODE,
+	PR_DISPLAY_BCC,
+	PR_DISPLAY_BCC_UNICODE,
+
+	PR_CREATION_TIME,
+	PR_LAST_MODIFICATION_TIME,
+	PR_PRIORITY,
+	PR_SENSITIVITY,
+	PR_START_DATE,
+	PR_END_DATE,
+	PR_RESPONSE_REQUESTED,
+	PR_OWNER_APPT_ID,
+	PR_PROCESSED,
+
+	PR_SENT_REPRESENTING_NAME,
+	PR_SENT_REPRESENTING_NAME_UNICODE,
+	PR_SENT_REPRESENTING_ADDRTYPE,
+	PR_SENT_REPRESENTING_ADDRTYPE_UNICODE,
+	PR_SENT_REPRESENTING_EMAIL_ADDRESS,
+	PR_SENT_REPRESENTING_EMAIL_ADDRESS_UNICODE,
+
+	PR_SENDER_NAME,
+	PR_SENDER_NAME_UNICODE,
+	PR_SENDER_ADDRTYPE,
+	PR_SENDER_ADDRTYPE_UNICODE,
+	PR_SENDER_EMAIL_ADDRESS,
+	PR_SENDER_EMAIL_ADDRESS_UNICODE,
+
+	PR_RCVD_REPRESENTING_NAME,
+	PR_RCVD_REPRESENTING_NAME_UNICODE,
+	PR_RCVD_REPRESENTING_ADDRTYPE,
+	PR_RCVD_REPRESENTING_ADDRTYPE_UNICODE,
+	PR_RCVD_REPRESENTING_EMAIL_ADDRESS,
 	PR_RCVD_REPRESENTING_EMAIL_ADDRESS_UNICODE
 };
 
-static gboolean 
+static gboolean
 camel_build_name_id (struct mapi_nameid *nameid, gpointer data)
 {
-	mapi_nameid_lid_add(nameid, 0x8501, PSETID_Common); 	// PT_LONG - ReminderMinutesBeforeStart
-	mapi_nameid_lid_add(nameid, 0x8502, PSETID_Common); 	// PT_SYSTIME - ReminderTime
-	mapi_nameid_lid_add(nameid, 0x8503, PSETID_Common); 	// PT_BOOLEAN - ReminderSet
-	mapi_nameid_lid_add(nameid, 0x8506, PSETID_Common); 	// PT_BOOLEAN - Private
-	mapi_nameid_lid_add(nameid, 0x8510, PSETID_Common); 	// PT_LONG - (context menu flags)
-	mapi_nameid_lid_add(nameid, 0x8516, PSETID_Common); 	// PT_SYSTIME - CommonStart
-	mapi_nameid_lid_add(nameid, 0x8517, PSETID_Common); 	// PT_SYSTIME - CommonEnd
-	mapi_nameid_lid_add(nameid, 0x8560, PSETID_Common); 	// PT_SYSTIME - ReminderNextTime
-
-	mapi_nameid_lid_add(nameid, 0x8201, PSETID_Appointment); 	// PT_LONG - ApptSequence
-	mapi_nameid_lid_add(nameid, 0x8205, PSETID_Appointment); 	// PT_LONG - BusyStatus
-	mapi_nameid_lid_add(nameid, 0x8208, PSETID_Appointment); 	// PT_UNICODE - Location
-	mapi_nameid_lid_add(nameid, 0x820D, PSETID_Appointment); 	// PT_SYSTIME - Start/ApptStartWhole
-	mapi_nameid_lid_add(nameid, 0x820E, PSETID_Appointment); 	// PT_SYSTIME - End/ApptEndWhole
-	mapi_nameid_lid_add(nameid, 0x8213, PSETID_Appointment); 	// PT_LONG - Duration/ApptDuration
-	mapi_nameid_lid_add(nameid, 0x8215, PSETID_Appointment); 	// PT_BOOLEAN - AllDayEvent (also called ApptSubType)
-	mapi_nameid_lid_add(nameid, 0x8216, PSETID_Appointment); 	// PT_BINARY - (recurrence blob)
-	mapi_nameid_lid_add(nameid, 0x8217, PSETID_Appointment); 	// PT_LONG - MeetingStatus
-	mapi_nameid_lid_add(nameid, 0x8218, PSETID_Appointment); 	// PT_LONG - ResponseStatus
-	mapi_nameid_lid_add(nameid, 0x8223, PSETID_Appointment); 	// PT_BOOLEAN - Recurring
-	mapi_nameid_lid_add(nameid, 0x8224, PSETID_Appointment); 	// PT_LONG - IntendedBusyStatus
-	mapi_nameid_lid_add(nameid, 0x8228, PSETID_Appointment); 	// PT_SYSTIME - RecurrenceBase
-	mapi_nameid_lid_add(nameid, 0x8229, PSETID_Appointment); 	// PT_BOOLEAN - FInvited
-	mapi_nameid_lid_add(nameid, 0x8231, PSETID_Appointment); 	// PT_LONG - RecurrenceType
-	mapi_nameid_lid_add(nameid, 0x8232, PSETID_Appointment); 	// PT_STRING8 - RecurrencePattern
-	mapi_nameid_lid_add(nameid, 0x8235, PSETID_Appointment); 	// PT_SYSTIME - (dtstart)(for recurring events UTC 12 AM of day of start)
-	mapi_nameid_lid_add(nameid, 0x8236, PSETID_Appointment); 	// PT_SYSTIME - (dtend)(for recurring events UTC 12 AM of day of end)
-	mapi_nameid_lid_add(nameid, 0x823A, PSETID_Appointment); 	// PT_BOOLEAN - AutoFillLocation
-	mapi_nameid_lid_add(nameid, 0x8240, PSETID_Appointment); 	// PT_BOOLEAN - IsOnlineMeeting
-	mapi_nameid_lid_add(nameid, 0x8257, PSETID_Appointment); 	// PT_BOOLEAN - ApptCounterProposal
-	mapi_nameid_lid_add(nameid, 0x825E, PSETID_Appointment); 	// PT_BINARY - (timezone for dtstart)
-	mapi_nameid_lid_add(nameid, 0x825F, PSETID_Appointment); 	// PT_BINARY - (timezone for dtend)
-
-	mapi_nameid_lid_add(nameid, 0x0002, PSETID_Meeting); 		// PT_UNICODE - Where
-	mapi_nameid_lid_add(nameid, 0x0003, PSETID_Meeting); 		// PT_BINARY - GlobalObjectId
-	mapi_nameid_lid_add(nameid, 0x0005, PSETID_Meeting); 		// PT_BOOLEAN - IsRecurring
-	mapi_nameid_lid_add(nameid, 0x000a, PSETID_Meeting); 		// PT_BOOLEAN - IsException 
-	mapi_nameid_lid_add(nameid, 0x0023, PSETID_Meeting); 		// PT_BINARY - CleanGlobalObjectId
-	mapi_nameid_lid_add(nameid, 0x0024, PSETID_Meeting); 		// PT_STRING8 - AppointmentMessageClass 
-	mapi_nameid_lid_add(nameid, 0x0026, PSETID_Meeting); 		// PT_LONG - MeetingType
+	mapi_nameid_lid_add(nameid, 0x8501, PSETID_Common);	// PT_LONG - ReminderMinutesBeforeStart
+	mapi_nameid_lid_add(nameid, 0x8502, PSETID_Common);	// PT_SYSTIME - ReminderTime
+	mapi_nameid_lid_add(nameid, 0x8503, PSETID_Common);	// PT_BOOLEAN - ReminderSet
+	mapi_nameid_lid_add(nameid, 0x8506, PSETID_Common);	// PT_BOOLEAN - Private
+	mapi_nameid_lid_add(nameid, 0x8510, PSETID_Common);	// PT_LONG - (context menu flags)
+	mapi_nameid_lid_add(nameid, 0x8516, PSETID_Common);	// PT_SYSTIME - CommonStart
+	mapi_nameid_lid_add(nameid, 0x8517, PSETID_Common);	// PT_SYSTIME - CommonEnd
+	mapi_nameid_lid_add(nameid, 0x8560, PSETID_Common);	// PT_SYSTIME - ReminderNextTime
+
+	mapi_nameid_lid_add(nameid, 0x8201, PSETID_Appointment);	// PT_LONG - ApptSequence
+	mapi_nameid_lid_add(nameid, 0x8205, PSETID_Appointment);	// PT_LONG - BusyStatus
+	mapi_nameid_lid_add(nameid, 0x8208, PSETID_Appointment);	// PT_UNICODE - Location
+	mapi_nameid_lid_add(nameid, 0x820D, PSETID_Appointment);	// PT_SYSTIME - Start/ApptStartWhole
+	mapi_nameid_lid_add(nameid, 0x820E, PSETID_Appointment);	// PT_SYSTIME - End/ApptEndWhole
+	mapi_nameid_lid_add(nameid, 0x8213, PSETID_Appointment);	// PT_LONG - Duration/ApptDuration
+	mapi_nameid_lid_add(nameid, 0x8215, PSETID_Appointment);	// PT_BOOLEAN - AllDayEvent (also called ApptSubType)
+	mapi_nameid_lid_add(nameid, 0x8216, PSETID_Appointment);	// PT_BINARY - (recurrence blob)
+	mapi_nameid_lid_add(nameid, 0x8217, PSETID_Appointment);	// PT_LONG - MeetingStatus
+	mapi_nameid_lid_add(nameid, 0x8218, PSETID_Appointment);	// PT_LONG - ResponseStatus
+	mapi_nameid_lid_add(nameid, 0x8223, PSETID_Appointment);	// PT_BOOLEAN - Recurring
+	mapi_nameid_lid_add(nameid, 0x8224, PSETID_Appointment);	// PT_LONG - IntendedBusyStatus
+	mapi_nameid_lid_add(nameid, 0x8228, PSETID_Appointment);	// PT_SYSTIME - RecurrenceBase
+	mapi_nameid_lid_add(nameid, 0x8229, PSETID_Appointment);	// PT_BOOLEAN - FInvited
+	mapi_nameid_lid_add(nameid, 0x8231, PSETID_Appointment);	// PT_LONG - RecurrenceType
+	mapi_nameid_lid_add(nameid, 0x8232, PSETID_Appointment);	// PT_STRING8 - RecurrencePattern
+	mapi_nameid_lid_add(nameid, 0x8235, PSETID_Appointment);	// PT_SYSTIME - (dtstart)(for recurring events UTC 12 AM of day of start)
+	mapi_nameid_lid_add(nameid, 0x8236, PSETID_Appointment);	// PT_SYSTIME - (dtend)(for recurring events UTC 12 AM of day of end)
+	mapi_nameid_lid_add(nameid, 0x823A, PSETID_Appointment);	// PT_BOOLEAN - AutoFillLocation
+	mapi_nameid_lid_add(nameid, 0x8240, PSETID_Appointment);	// PT_BOOLEAN - IsOnlineMeeting
+	mapi_nameid_lid_add(nameid, 0x8257, PSETID_Appointment);	// PT_BOOLEAN - ApptCounterProposal
+	mapi_nameid_lid_add(nameid, 0x825E, PSETID_Appointment);	// PT_BINARY - (timezone for dtstart)
+	mapi_nameid_lid_add(nameid, 0x825F, PSETID_Appointment);	// PT_BINARY - (timezone for dtend)
+
+	mapi_nameid_lid_add(nameid, 0x0002, PSETID_Meeting);		// PT_UNICODE - Where
+	mapi_nameid_lid_add(nameid, 0x0003, PSETID_Meeting);		// PT_BINARY - GlobalObjectId
+	mapi_nameid_lid_add(nameid, 0x0005, PSETID_Meeting);		// PT_BOOLEAN - IsRecurring
+	mapi_nameid_lid_add(nameid, 0x000a, PSETID_Meeting);		// PT_BOOLEAN - IsException
+	mapi_nameid_lid_add(nameid, 0x0023, PSETID_Meeting);		// PT_BINARY - CleanGlobalObjectId
+	mapi_nameid_lid_add(nameid, 0x0024, PSETID_Meeting);		// PT_STRING8 - AppointmentMessageClass
+	mapi_nameid_lid_add(nameid, 0x0026, PSETID_Meeting);		// PT_LONG - MeetingType
 
 	/* These probably would never be used from Evolution */
-//	mapi_nameid_lid_add(nameid, 0x8200, PSETID_Appointment); 	// PT_BOOLEAN - SendAsICAL
-//	mapi_nameid_lid_add(nameid, 0x8202, PSETID_Appointment); 	// PT_SYSTIME - ApptSequenceTime
-//	mapi_nameid_lid_add(nameid, 0x8214, PSETID_Appointment); 	// PT_LONG - Label
-//	mapi_nameid_lid_add(nameid, 0x8234, PSETID_Appointment); 	// PT_STRING8 - display TimeZone
-//	mapi_nameid_lid_add(nameid, 0x8238, PSETID_Appointment); 	// PT_STRING8 - AllAttendees
-//	mapi_nameid_lid_add(nameid, 0x823B, PSETID_Appointment); 	// PT_STRING8 - ToAttendeesString (dupe PR_DISPLAY_TO)
-//	mapi_nameid_lid_add(nameid, 0x823C, PSETID_Appointment); 	// PT_STRING8 - CCAttendeesString (dupe PR_DISPLAY_CC)
-
-	mapi_nameid_lid_add(nameid, 0x8101, PSETID_Task); 	// PT_LONG - Status
-	mapi_nameid_lid_add(nameid, 0x8102, PSETID_Task); 	// PT_DOUBLE - PercentComplete
-	mapi_nameid_lid_add(nameid, 0x8103, PSETID_Task); 	// PT_BOOLEAN - TeamTask
-	mapi_nameid_lid_add(nameid, 0x8104, PSETID_Task); 	// PT_SYSTIME - StartDate/TaskStartDate
-	mapi_nameid_lid_add(nameid, 0x8105, PSETID_Task); 	// PT_SYSTIME - DueDate/TaskDueDate
-	mapi_nameid_lid_add(nameid, 0x810F, PSETID_Task); 	// PT_SYSTIME - DateCompleted
-//	mapi_nameid_lid_add(nameid, 0x8116, PSETID_Task); 	// PT_BINARY - (recurrence blob)
-	mapi_nameid_lid_add(nameid, 0x811C, PSETID_Task); 	// PT_BOOLEAN - Complete
-	mapi_nameid_lid_add(nameid, 0x811F, PSETID_Task); 	// PT_STRING8 - Owner
-	mapi_nameid_lid_add(nameid, 0x8121, PSETID_Task); 	// PT_STRING8 - Delegator
-	mapi_nameid_lid_add(nameid, 0x8126, PSETID_Task); 	// PT_BOOLEAN - IsRecurring/TaskFRecur
-	mapi_nameid_lid_add(nameid, 0x8127, PSETID_Task); 	// PT_STRING8 - Role
-	mapi_nameid_lid_add(nameid, 0x8129, PSETID_Task); 	// PT_LONG - Ownership
-	mapi_nameid_lid_add(nameid, 0x812A, PSETID_Task); 	// PT_LONG - DelegationState
+//	mapi_nameid_lid_add(nameid, 0x8200, PSETID_Appointment);	// PT_BOOLEAN - SendAsICAL
+//	mapi_nameid_lid_add(nameid, 0x8202, PSETID_Appointment);	// PT_SYSTIME - ApptSequenceTime
+//	mapi_nameid_lid_add(nameid, 0x8214, PSETID_Appointment);	// PT_LONG - Label
+//	mapi_nameid_lid_add(nameid, 0x8234, PSETID_Appointment);	// PT_STRING8 - display TimeZone
+//	mapi_nameid_lid_add(nameid, 0x8238, PSETID_Appointment);	// PT_STRING8 - AllAttendees
+//	mapi_nameid_lid_add(nameid, 0x823B, PSETID_Appointment);	// PT_STRING8 - ToAttendeesString (dupe PR_DISPLAY_TO)
+//	mapi_nameid_lid_add(nameid, 0x823C, PSETID_Appointment);	// PT_STRING8 - CCAttendeesString (dupe PR_DISPLAY_CC)
+
+	mapi_nameid_lid_add(nameid, 0x8101, PSETID_Task);	// PT_LONG - Status
+	mapi_nameid_lid_add(nameid, 0x8102, PSETID_Task);	// PT_DOUBLE - PercentComplete
+	mapi_nameid_lid_add(nameid, 0x8103, PSETID_Task);	// PT_BOOLEAN - TeamTask
+	mapi_nameid_lid_add(nameid, 0x8104, PSETID_Task);	// PT_SYSTIME - StartDate/TaskStartDate
+	mapi_nameid_lid_add(nameid, 0x8105, PSETID_Task);	// PT_SYSTIME - DueDate/TaskDueDate
+	mapi_nameid_lid_add(nameid, 0x810F, PSETID_Task);	// PT_SYSTIME - DateCompleted
+//	mapi_nameid_lid_add(nameid, 0x8116, PSETID_Task);	// PT_BINARY - (recurrence blob)
+	mapi_nameid_lid_add(nameid, 0x811C, PSETID_Task);	// PT_BOOLEAN - Complete
+	mapi_nameid_lid_add(nameid, 0x811F, PSETID_Task);	// PT_STRING8 - Owner
+	mapi_nameid_lid_add(nameid, 0x8121, PSETID_Task);	// PT_STRING8 - Delegator
+	mapi_nameid_lid_add(nameid, 0x8126, PSETID_Task);	// PT_BOOLEAN - IsRecurring/TaskFRecur
+	mapi_nameid_lid_add(nameid, 0x8127, PSETID_Task);	// PT_STRING8 - Role
+	mapi_nameid_lid_add(nameid, 0x8129, PSETID_Task);	// PT_LONG - Ownership
+	mapi_nameid_lid_add(nameid, 0x812A, PSETID_Task);	// PT_LONG - DelegationState
 
 	/* These probably would never be used from Evolution */
-//	mapi_nameid_lid_add(nameid, 0x8110, PSETID_Task); 	// PT_LONG - ActualWork/TaskActualEffort
-//	mapi_nameid_lid_add(nameid, 0x8111, PSETID_Task); 	// PT_LONG - TotalWork/TaskEstimatedEffort
+//	mapi_nameid_lid_add(nameid, 0x8110, PSETID_Task);	// PT_LONG - ActualWork/TaskActualEffort
+//	mapi_nameid_lid_add(nameid, 0x8111, PSETID_Task);	// PT_LONG - TotalWork/TaskEstimatedEffort
 
 	/* These probably would never be used from Evolution */
-//	mapi_nameid_lid_add(nameid, 0x8B00, PSETID_Note); 	// PT_LONG - Color
+//	mapi_nameid_lid_add(nameid, 0x8B00, PSETID_Note);	// PT_LONG - Color
 
 	return TRUE;
 }
@@ -1310,7 +1308,7 @@ fetch_item_cb (FetchItemsCallbackData *item_data, gpointer data)
 {
 	long *flags;
 	struct FILETIME *delivery_date;
-	const char *msg_class;
+	const gchar *msg_class;
 	NTTIME ntdate;
 	ExchangeMAPIStream *body;
 
@@ -1328,7 +1326,7 @@ fetch_item_cb (FetchItemsCallbackData *item_data, gpointer data)
 
 	/*Hold a reference to Recipient List*/
 	item->recipients = item_data->recipients;
-	
+
 	for (j = 0; j < item_data->properties->cValues; j++) {
 
 		gconstpointer prop_data = get_mapi_SPropValue_data(&item_data->properties->lpProps[j]);
@@ -1339,7 +1337,7 @@ fetch_item_cb (FetchItemsCallbackData *item_data, gpointer data)
 		switch (item_data->properties->lpProps[j].ulPropTag) {
 		case PR_MESSAGE_CLASS:
 		case PR_MESSAGE_CLASS_UNICODE:
-			msg_class = (const char *) prop_data;
+			msg_class = (const gchar *) prop_data;
 			break;
 		case PR_MESSAGE_DELIVERY_TIME:
 			delivery_date = (struct FILETIME *) prop_data;
@@ -1354,15 +1352,15 @@ fetch_item_cb (FetchItemsCallbackData *item_data, gpointer data)
 
 	item->is_cal = FALSE;
 	if (g_str_has_prefix (msg_class, IPM_SCHEDULE_MEETING_PREFIX)) {
-		guint8 *appointment_body_str = (guint8 *) exchange_mapi_cal_util_camel_helper (item_data->properties, 
-											     item_data->streams, 
+		guint8 *appointment_body_str = (guint8 *) exchange_mapi_cal_util_camel_helper (item_data->properties,
+											     item_data->streams,
 											     item_data->recipients, item_data->attachments);
 
 		if (appointment_body_str && *appointment_body_str) {
 			body = g_new0(ExchangeMAPIStream, 1);
 			body->proptag = PR_BODY;
 			body->value = g_byte_array_new ();
-			body->value = g_byte_array_append (body->value, appointment_body_str, strlen ((const char *)appointment_body_str));
+			body->value = g_byte_array_append (body->value, appointment_body_str, strlen ((const gchar *)appointment_body_str));
 
 			item->msg.body_parts = g_slist_append (item->msg.body_parts, body);
 			item->is_cal = TRUE;
@@ -1403,7 +1401,6 @@ fetch_item_cb (FetchItemsCallbackData *item_data, gpointer data)
 	return TRUE;
 }
 
-
 static void
 mapi_mime_set_recipient_list (CamelMimeMessage *msg, MapiItem *item)
 {
@@ -1415,34 +1412,34 @@ mapi_mime_set_recipient_list (CamelMimeMessage *msg, MapiItem *item)
 	to_addr = camel_internet_address_new ();
 	cc_addr = camel_internet_address_new ();
 	bcc_addr = camel_internet_address_new ();
-	
+
 	for (l = item->recipients; l; l=l->next) {
-		char *display_name;
-		const char *name = NULL;
+		gchar *display_name;
+		const gchar *name = NULL;
 		uint32_t rcpt_type = MAPI_TO;
-		uint32_t *type = NULL; 
+		uint32_t *type = NULL;
 		struct SRow *aRow;
 		ExchangeMAPIRecipient *recip = (ExchangeMAPIRecipient *)(l->data);
-		
+
 		/*Can't continue when there is no email-id*/
 		if (!recip->email_id)
 			continue;
-		
+
 		/* Build a SRow structure */
 		aRow = &recip->out_SRow;
-		
+
 		/*Name is probably available in one of these props.*/
-		name = (const char *) find_SPropValue_data (aRow, PR_DISPLAY_NAME);
-		name = name ? name : (const char *) find_SPropValue_data (aRow, PR_RECIPIENT_DISPLAY_NAME);
-		name = name ? name : (const char *) find_SPropValue_data (aRow, PR_RECIPIENT_DISPLAY_NAME_UNICODE);
-		name = name ? name : (const char *) find_SPropValue_data (aRow, PR_7BIT_DISPLAY_NAME_UNICODE);
+		name = (const gchar *) find_SPropValue_data (aRow, PR_DISPLAY_NAME);
+		name = name ? name : (const gchar *) find_SPropValue_data (aRow, PR_RECIPIENT_DISPLAY_NAME);
+		name = name ? name : (const gchar *) find_SPropValue_data (aRow, PR_RECIPIENT_DISPLAY_NAME_UNICODE);
+		name = name ? name : (const gchar *) find_SPropValue_data (aRow, PR_7BIT_DISPLAY_NAME_UNICODE);
 
 		type = (uint32_t *) find_SPropValue_data (aRow, PR_RECIPIENT_TYPE);
-		
+
 		/*Fallbacks. Not good*/
 		display_name = name ? g_strdup (name) : g_strdup (recip->email_id);
 		rcpt_type = (type ? *type : MAPI_TO);
-		
+
 		switch (rcpt_type) {
 		case MAPI_TO:
 			camel_internet_address_add (to_addr, display_name, recip->email_id);
@@ -1470,16 +1467,15 @@ mapi_mime_set_recipient_list (CamelMimeMessage *msg, MapiItem *item)
 	/*TODO : Unref *_addr ? */
 }
 
-
 static void
 mapi_mime_set_msg_headers (CamelFolder *folder, CamelMimeMessage *msg, MapiItem *item)
 {
-	char *temp_str = NULL;
-	const char *from_email;
+	gchar *temp_str = NULL;
+	const gchar *from_email;
 	time_t recieved_time;
 	CamelInternetAddress *addr = NULL;
 	CamelMapiStore *mapi_store = CAMEL_MAPI_STORE(folder->parent_store);
-	int offset = 0;
+	gint offset = 0;
 	time_t actual_time;
 
 	/* Setting headers from PR_TRANSPORT_MESSAGE_HEADERS */
@@ -1518,7 +1514,7 @@ mapi_mime_set_msg_headers (CamelFolder *folder, CamelMimeMessage *msg, MapiItem
 
 	/* Overwrite headers if we have specific properties available*/
 	temp_str = item->header.subject;
-	if(temp_str) 
+	if (temp_str)
 		camel_mime_message_set_subject (msg, temp_str);
 
 	recieved_time = item->header.recieved_time;
@@ -1535,14 +1531,14 @@ mapi_mime_set_msg_headers (CamelFolder *folder, CamelMimeMessage *msg, MapiItem
 			item->header.from_email = g_strdup (from_email);
 		}
 
-		item->header.from_email = item->header.from_email ? 
+		item->header.from_email = item->header.from_email ?
 			item->header.from_email : item->header.from;
 
 		/* add reply to */
 		addr = camel_internet_address_new();
 		camel_internet_address_add(addr, item->header.from, item->header.from_email);
 		camel_mime_message_set_reply_to(msg, addr);
-		
+
 		/* add from */
 		addr = camel_internet_address_new();
 		camel_internet_address_add(addr, item->header.from, item->header.from_email);
@@ -1561,21 +1557,20 @@ mapi_mime_set_msg_headers (CamelFolder *folder, CamelMimeMessage *msg, MapiItem
 
 }
 
-
 static CamelMimePart *
 mapi_mime_msg_body (MapiItem *item, const ExchangeMAPIStream *body)
 {
 	CamelMimePart *part = camel_mime_part_new ();
 	camel_mime_part_set_encoding (part, CAMEL_TRANSFER_ENCODING_8BIT);
-	
+
 	if (body && body->value && body->value->len > 0) {
-		const gchar* type = NULL;
+		const gchar * type = NULL;
 		gchar *buff = NULL;
 
 		if (item->is_cal)
 			type = "text/calendar";
 		else
-			type = (body->proptag == PR_BODY || body->proptag == PR_BODY_UNICODE) ? 
+			type = (body->proptag == PR_BODY || body->proptag == PR_BODY_UNICODE) ?
 				"text/plain" : "text/html";
 
 		if (item->header.cpid) {
@@ -1594,7 +1589,7 @@ mapi_mime_msg_body (MapiItem *item, const ExchangeMAPIStream *body)
 			type = buff;
 		}
 
-		camel_mime_part_set_content (part, (const char *) body->value->data, body->value->len, type);
+		camel_mime_part_set_content (part, (const gchar *) body->value->data, body->value->len, type);
 
 		g_free (buff);
 	} else
@@ -1657,7 +1652,7 @@ mapi_mime_build_multipart_related (MapiItem *item, const ExchangeMAPIStream *str
 	CamelMultipart *m_related = camel_multipart_new ();
 	camel_data_wrapper_set_mime_type (CAMEL_DATA_WRAPPER (m_related), "multipart/related");
 	camel_multipart_set_boundary (m_related, NULL);
-	
+
 	part = mapi_mime_msg_body (item, stream);
 	camel_multipart_add_part (m_related, part);
 	camel_object_unref (part);
@@ -1673,7 +1668,7 @@ mapi_mime_build_multipart_alternative (MapiItem *item, GSList *body_parts, GSLis
 {
 	CamelMimePart *part;
 	CamelMultipart *m_alternative = camel_multipart_new ();
-	camel_data_wrapper_set_mime_type (CAMEL_DATA_WRAPPER (m_alternative), 
+	camel_data_wrapper_set_mime_type (CAMEL_DATA_WRAPPER (m_alternative),
 					  "multipart/alternative");
 	camel_multipart_set_boundary (m_alternative, NULL);
 
@@ -1690,7 +1685,7 @@ mapi_mime_build_multipart_alternative (MapiItem *item, GSList *body_parts, GSLis
 			camel_object_unref (m_related);
 		} else
 			part = mapi_mime_msg_body (item, stream);
-		
+
 		camel_multipart_add_part (m_alternative, part);
 		camel_object_unref (part);
 	}
@@ -1703,7 +1698,7 @@ mapi_mime_build_multipart_mixed (CamelMultipart *content, GSList *attachs)
 {
 	CamelMimePart *part = camel_mime_part_new ();
 	CamelMultipart *m_mixed = camel_multipart_new ();
-	camel_data_wrapper_set_mime_type (CAMEL_DATA_WRAPPER (m_mixed), 
+	camel_data_wrapper_set_mime_type (CAMEL_DATA_WRAPPER (m_mixed),
 					  "multipart/mixed");
 	camel_multipart_set_boundary (m_mixed, NULL);
 
@@ -1724,7 +1719,7 @@ mapi_mime_classify_attachments (GSList *attachments, GSList **inline_attachs, GS
 	for (;attachments != NULL; attachments = attachments->next) {
 		ExchangeMAPIAttachment *attach = (ExchangeMAPIAttachment *)attachments->data;
 		ExchangeMAPIStream *stream = NULL;
-		const char *filename, *mime_type, *content_id = NULL; 
+		const gchar *filename, *mime_type, *content_id = NULL;
 		CamelContentType *content_type;
 		CamelMimePart *part;
 
@@ -1736,22 +1731,21 @@ mapi_mime_classify_attachments (GSList *attachments, GSList **inline_attachs, GS
 
 		part = camel_mime_part_new ();
 
-		filename = (const char *) exchange_mapi_util_find_SPropVal_array_propval(attach->lpProps, 
+		filename = (const gchar *) exchange_mapi_util_find_SPropVal_array_propval(attach->lpProps,
 											 PR_ATTACH_LONG_FILENAME);
 
 		if (!(filename && *filename))
-			filename = (const char *) exchange_mapi_util_find_SPropVal_array_propval(attach->lpProps, 
+			filename = (const gchar *) exchange_mapi_util_find_SPropVal_array_propval(attach->lpProps,
 												 PR_ATTACH_FILENAME);
 		camel_mime_part_set_filename(part, g_strdup(filename));
 		camel_content_type_set_param (((CamelDataWrapper *) part)->mime_type, "name", filename);
 
 		/*Content-Type*/
-		mime_type = (const char *) exchange_mapi_util_find_SPropVal_array_propval (attach->lpProps, PR_ATTACH_MIME_TAG);
+		mime_type = (const gchar *) exchange_mapi_util_find_SPropVal_array_propval (attach->lpProps, PR_ATTACH_MIME_TAG);
 		if (!mime_type)
 			mime_type = "application/octet-stream";
 
-		camel_mime_part_set_content (part, (const char *) stream->value->data, stream->value->len, mime_type);
-
+		camel_mime_part_set_content (part, (const gchar *) stream->value->data, stream->value->len, mime_type);
 
 		content_type = camel_mime_part_get_content_type (part);
 		if (content_type && camel_content_type_is (content_type, "text", "*"))
@@ -1760,7 +1754,7 @@ mapi_mime_classify_attachments (GSList *attachments, GSList **inline_attachs, GS
 			camel_mime_part_set_encoding (part, CAMEL_TRANSFER_ENCODING_BASE64);
 
 		/*Content-ID*/
-		content_id = (const char *) exchange_mapi_util_find_SPropVal_array_propval(attach->lpProps, 
+		content_id = (const gchar *) exchange_mapi_util_find_SPropVal_array_propval(attach->lpProps,
 											   PR_ATTACH_CONTENT_ID);
 		/* TODO : Add disposition */
 		if (content_id) {
@@ -1779,7 +1773,7 @@ mapi_folder_item_to_msg( CamelFolder *folder, MapiItem *item, CamelException *ex
 
 	GSList *attach_list = NULL;
 	GSList *inline_attachs =  NULL; /*Used for mulitpart/related*/
-	GSList *noninline_attachs = NULL; 
+	GSList *noninline_attachs = NULL;
 
 	gboolean build_alternative = FALSE;
 	gboolean build_related = FALSE;
@@ -1813,7 +1807,7 @@ mapi_folder_item_to_msg( CamelFolder *folder, MapiItem *item, CamelException *ex
 	}
 
 	if (noninline_attachs) { /* multipart/mixed */
-		multipart_body = mapi_mime_build_multipart_mixed (multipart_body, 
+		multipart_body = mapi_mime_build_multipart_mixed (multipart_body,
 								  noninline_attachs);
 	}
 
@@ -1824,7 +1818,7 @@ mapi_folder_item_to_msg( CamelFolder *folder, MapiItem *item, CamelException *ex
 }
 
 static CamelMimeMessage *
-mapi_folder_get_message( CamelFolder *folder, const char *uid, CamelException *ex )
+mapi_folder_get_message( CamelFolder *folder, const gchar *uid, CamelException *ex )
 {
 	CamelMimeMessage *msg = NULL;
 	CamelMapiFolder *mapi_folder = CAMEL_MAPI_FOLDER(folder);
@@ -1895,20 +1889,20 @@ mapi_folder_get_message( CamelFolder *folder, const char *uid, CamelException *e
 		return NULL;
 	}
 
-	options = MAPI_OPTIONS_FETCH_ALL | MAPI_OPTIONS_FETCH_BODY_STREAM | 
-		MAPI_OPTIONS_GETBESTBODY | MAPI_OPTIONS_FETCH_RECIPIENTS ;
+	options = MAPI_OPTIONS_FETCH_ALL | MAPI_OPTIONS_FETCH_BODY_STREAM |
+		MAPI_OPTIONS_GETBESTBODY | MAPI_OPTIONS_FETCH_RECIPIENTS;
 
 	exchange_mapi_util_mapi_ids_from_uid (uid, &id_folder, &id_message);
 
-	if (((CamelMapiFolder *)folder)->type & CAMEL_MAPI_FOLDER_PUBLIC){
+	if (((CamelMapiFolder *)folder)->type & CAMEL_MAPI_FOLDER_PUBLIC) {
 		options |= MAPI_OPTIONS_USE_PFSTORE;
-	} 
+	}
 
 	CAMEL_SERVICE_REC_LOCK (mapi_store, connect_lock);
-	exchange_mapi_connection_fetch_item (id_folder, id_message, 
-					camel_GetPropsList, G_N_ELEMENTS (camel_GetPropsList), 
-					camel_build_name_id, NULL, 
-					fetch_item_cb, &item, 
+	exchange_mapi_connection_fetch_item (id_folder, id_message,
+					camel_GetPropsList, G_N_ELEMENTS (camel_GetPropsList),
+					camel_build_name_id, NULL,
+					fetch_item_cb, &item,
 					options);
 	CAMEL_SERVICE_REC_UNLOCK (mapi_store, connect_lock);
 
@@ -1972,29 +1966,29 @@ camel_mapi_folder_finalize (CamelObject *object)
 
 #if 0
 static CamelMessageInfo*
-mapi_get_message_info(CamelFolder *folder, const char *uid)
-{ 
+mapi_get_message_info(CamelFolder *folder, const gchar *uid)
+{
 	CamelMessageInfo	*msg_info = NULL;
-	CamelMessageInfoBase	*mi = (CamelMessageInfoBase *)msg ;
-	int			status = 0;
+	CamelMessageInfoBase	*mi = (CamelMessageInfoBase *)msg;
+	gint			status = 0;
 	oc_message_headers_t	headers;
 
 	if (folder->summary) {
 		msg_info = camel_folder_summary_uid(folder->summary, uid);
 	}
 	if (msg_info != NULL) {
-		mi = (CamelMessageInfoBase *)msg_info ;
+		mi = (CamelMessageInfoBase *)msg_info;
 		return (msg_info);
 	}
 	/* Go online and fetch message summary. */
 
 	msg_info = camel_message_info_new(folder->summary);
-	mi = (CamelMessageInfoBase *)msg_info ;
+	mi = (CamelMessageInfoBase *)msg_info;
 
-	if (headers.subject) mi->subject = (char *)camel_pstring_strdup(headers.subject);
-	if (headers.from) mi->from = (char *)camel_pstring_strdup(headers.from);
-	if (headers.to) mi->to = (char *)camel_pstring_strdup(headers.to);
-	if (headers.cc) mi->cc = (char *)camel_pstring_strdup(headers.cc);
+	if (headers.subject) mi->subject = (gchar *)camel_pstring_strdup(headers.subject);
+	if (headers.from) mi->from = (gchar *)camel_pstring_strdup(headers.from);
+	if (headers.to) mi->to = (gchar *)camel_pstring_strdup(headers.to);
+	if (headers.cc) mi->cc = (gchar *)camel_pstring_strdup(headers.cc);
 	mi->flags = headers.flags;
 
 	mi->user_flags = NULL;
@@ -2020,7 +2014,7 @@ mapi_expunge (CamelFolder *folder, CamelException *ex)
 
 	mapi_id_t fid;
 
-	int i, count;
+	gint i, count;
 	gboolean delete = FALSE, status = FALSE;
 	gchar *folder_id;
 	GSList *deleted_items, *deleted_head;
@@ -2029,7 +2023,7 @@ mapi_expunge (CamelFolder *folder, CamelException *ex)
 	deleted_items = deleted_head = NULL;
 	deleted_items_uid = deleted_items_uid_head = NULL;
 
-	folder_id =  g_strdup (camel_mapi_store_folder_id_lookup (mapi_store, folder->full_name)) ;
+	folder_id =  g_strdup (camel_mapi_store_folder_id_lookup (mapi_store, folder->full_name));
 	exchange_mapi_util_mapi_id_from_string (folder_id, &fid);
 
 	if ((mapi_folder->type & CAMEL_FOLDER_TYPE_MASK) == CAMEL_FOLDER_TYPE_TRASH) {
@@ -2060,7 +2054,7 @@ mapi_expunge (CamelFolder *folder, CamelException *ex)
 
 			if (!exchange_mapi_util_mapi_ids_from_uid (uid, &fid, mid))
 				continue;
-			
+
 			if (deleted_items)
 				deleted_items = g_slist_prepend (deleted_items, mid);
 			else {
@@ -2108,8 +2102,8 @@ mapi_expunge (CamelFolder *folder, CamelException *ex)
 }
 
 static void
-mapi_transfer_messages_to (CamelFolder *source, GPtrArray *uids, 
-		CamelFolder *destination, GPtrArray **transferred_uids, 
+mapi_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
+		CamelFolder *destination, GPtrArray **transferred_uids,
 		gboolean delete_originals, CamelException *ex)
 {
 	mapi_id_t src_fid, dest_fid;
@@ -2119,16 +2113,15 @@ mapi_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
 	CamelFolderChangeInfo *changes = NULL;
 
 	const gchar *folder_id = NULL;
-	int i = 0;
+	gint i = 0;
 
 	GSList *src_msg_ids = NULL;
 
-
 	/* check for offline operation */
-	if (offline->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) 
+	if (offline->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL)
 		return;
 
-	folder_id =  camel_mapi_store_folder_id_lookup (mapi_store, source->full_name) ;
+	folder_id =  camel_mapi_store_folder_id_lookup (mapi_store, source->full_name);
 	exchange_mapi_util_mapi_id_from_string (folder_id, &src_fid);
 
 	folder_id = camel_mapi_store_folder_id_lookup (mapi_store, destination->full_name);
@@ -2144,7 +2137,7 @@ mapi_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
 
 	if (delete_originals) {
 		if (!exchange_mapi_move_items (src_fid, dest_fid, src_msg_ids)) {
-			//TODO : Set exception. 
+			//TODO : Set exception.
 		} else {
 			changes = camel_folder_change_info_new ();
 
@@ -2158,7 +2151,7 @@ mapi_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
 		}
 	} else {
 		if (!exchange_mapi_copy_items (src_fid, dest_fid, src_msg_ids)) {
-			//TODO : Set exception. 
+			//TODO : Set exception.
 		}
 	}
 
@@ -2169,13 +2162,13 @@ mapi_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
 }
 
 static void
-mapi_folder_rename (CamelFolder *folder, const char *new)
+mapi_folder_rename (CamelFolder *folder, const gchar *new)
 {
 	((CamelFolderClass *)parent_class)->rename(folder, new);
 }
 
 static gint
-mapi_cmp_uids (CamelFolder *folder, const char *uid1, const char *uid2)
+mapi_cmp_uids (CamelFolder *folder, const gchar *uid1, const gchar *uid2)
 {
 	g_return_val_if_fail (uid1 != NULL, 0);
 	g_return_val_if_fail (uid2 != NULL, 0);
@@ -2207,14 +2200,14 @@ mapi_append_message (CamelFolder *folder, CamelMimeMessage *message,
 
 	if (((folder_flags & CAMEL_FOLDER_TYPE_MASK) == CAMEL_FOLDER_TYPE_TRASH) ||
 	    ((folder_flags & CAMEL_FOLDER_TYPE_MASK) == CAMEL_FOLDER_TYPE_OUTBOX)) {
-		camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, 
+		camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
 				      _("Cannot append message to folder '%s'"),
 				      folder->full_name);
 		return;
 	}
 
 	if (offline->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
-		camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, 
+		camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
 				      _("Offline."));
 		return;
 	}
@@ -2229,7 +2222,7 @@ mapi_append_message (CamelFolder *folder, CamelMimeMessage *message,
 
 	item = camel_mapi_utils_mime_to_item (message, from, ex);
 
-	mid = exchange_mapi_create_item (-1, fid, NULL, NULL, 
+	mid = exchange_mapi_create_item (-1, fid, NULL, NULL,
 					 camel_mapi_utils_create_item_build_props, item,
 					 item->recipients, item->attachments,
 					 item->generic_streams, 0);
@@ -2248,10 +2241,10 @@ camel_mapi_folder_class_init (CamelMapiFolderClass *camel_mapi_folder_class)
 	((CamelObjectClass *) camel_mapi_folder_class)->getv = mapi_getv;
 
 	camel_folder_class->get_message = mapi_folder_get_message;
- 	camel_folder_class->rename = mapi_folder_rename;
+	camel_folder_class->rename = mapi_folder_rename;
 	camel_folder_class->search_by_expression = mapi_folder_search_by_expression;
 	camel_folder_class->cmp_uids = mapi_cmp_uids;
-/* 	camel_folder_class->get_message_info = mapi_get_message_info; */
+/*	camel_folder_class->get_message_info = mapi_get_message_info; */
 	camel_folder_class->search_by_uids = mapi_folder_search_by_uids;
 	camel_folder_class->search_free = mapi_folder_search_free;
 	camel_folder_class->append_message = mapi_append_message;
@@ -2267,7 +2260,6 @@ camel_mapi_folder_init (gpointer object, gpointer klass)
 	CamelMapiFolder *mapi_folder = CAMEL_MAPI_FOLDER (object);
 	CamelFolder *folder = CAMEL_FOLDER (object);
 
-
 	folder->permanent_flags = CAMEL_MESSAGE_ANSWERED | CAMEL_MESSAGE_DELETED |
 		CAMEL_MESSAGE_DRAFT | CAMEL_MESSAGE_FLAGGED | CAMEL_MESSAGE_SEEN;
 
@@ -2288,7 +2280,6 @@ camel_mapi_folder_get_type (void)
 {
 	static CamelType camel_mapi_folder_type = CAMEL_INVALID_TYPE;
 
-
 	if (camel_mapi_folder_type == CAMEL_INVALID_TYPE) {
 		camel_mapi_folder_type =
 			camel_type_register (camel_offline_folder_get_type (),
@@ -2305,7 +2296,7 @@ camel_mapi_folder_get_type (void)
 }
 
 CamelFolder *
-camel_mapi_folder_new (CamelStore *store, const char *folder_name, const char *folder_dir,
+camel_mapi_folder_new (CamelStore *store, const gchar *folder_name, const gchar *folder_dir,
 		      guint32 flags, CamelException *ex)
 {
 
@@ -2313,8 +2304,8 @@ camel_mapi_folder_new (CamelStore *store, const char *folder_name, const char *f
 	CamelMapiFolder *mapi_folder;
 	CamelMapiStore  *mapi_store = (CamelMapiStore *) store;
 
-	char *summary_file, *state_file;
-	char *short_name;
+	gchar *summary_file, *state_file;
+	gchar *short_name;
 	guint32 i = 0;
 
 	folder = CAMEL_FOLDER (camel_object_new(camel_mapi_folder_get_type ()) );
@@ -2324,7 +2315,7 @@ camel_mapi_folder_new (CamelStore *store, const char *folder_name, const char *f
 	if (short_name)
 		short_name++;
 	else
-		short_name = (char *) folder_name;
+		short_name = (gchar *) folder_name;
 	camel_folder_construct (folder, store, folder_name, short_name);
 
 	summary_file = g_strdup_printf ("%s/%s/summary",folder_dir, folder_name);
@@ -2354,13 +2345,13 @@ camel_mapi_folder_new (CamelStore *store, const char *folder_name, const char *f
 		return NULL;
 	}
 
-/* 	journal_file = g_strdup_printf ("%s/journal", g_strdup_printf ("%s-%s",folder_name, "dir")); */
-/* 	mapi_folder->journal = camel_mapi_journal_new (mapi_folder, journal_file); */
-/* 	g_free (journal_file); */
-/* 	if (!mapi_folder->journal) { */
-/* 		camel_object_unref (folder); */
-/* 		return NULL; */
-/* 	} */
+/*	journal_file = g_strdup_printf ("%s/journal", g_strdup_printf ("%s-%s",folder_name, "dir")); */
+/*	mapi_folder->journal = camel_mapi_journal_new (mapi_folder, journal_file); */
+/*	g_free (journal_file); */
+/*	if (!mapi_folder->journal) { */
+/*		camel_object_unref (folder); */
+/*		return NULL; */
+/*	} */
 
 	if (camel_url_get_param (((CamelService *) store)->url, "filter"))
 		folder->folder_flags |= CAMEL_FOLDER_FILTER_RECENT;
@@ -2373,7 +2364,7 @@ camel_mapi_folder_new (CamelStore *store, const char *folder_name, const char *f
 
 	for (i=0;i<camel_store_summary_count((CamelStoreSummary *)mapi_store->summary);i++) {
 		CamelStoreInfo *si = camel_store_summary_index((CamelStoreSummary *)mapi_store->summary, i);
-		if (si == NULL) 
+		if (si == NULL)
 			continue;
 
 		if (!strcmp(folder_name, camel_mapi_store_info_full_name (mapi_store->summary, si))) {
diff --git a/src/camel/camel-mapi-folder.h b/src/camel/camel-mapi-folder.h
index 2e4e8da..3658444 100644
--- a/src/camel/camel-mapi-folder.h
+++ b/src/camel/camel-mapi-folder.h
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -24,7 +24,6 @@
 #ifndef __MAPI_FOLDER_H__
 #define __MAPI_FOLDER_H__
 
-
 #include <camel/camel.h>
 #include <libmapi/libmapi.h>
 #include <exchange-mapi-connection.h>
@@ -69,7 +68,7 @@ typedef struct {
 	gchar *cc;
 	gchar *bcc;
 
-	int flags;
+	gint flags;
 	glong size;
 	time_t recieved_time;
 	time_t send_time;
@@ -112,16 +111,16 @@ struct _CamelMapiFolder {
 
 	guint32 type;
 
-	unsigned int need_rescan:1;
-	unsigned int need_refresh:1;
-	unsigned int read_only:1;
+	guint need_rescan:1;
+	guint need_refresh:1;
+	guint read_only:1;
 };
 
 struct _CamelMapiFolderClass {
 	CamelOfflineFolderClass parent_class;
 
-	/* Virtual methods */	
-	
+	/* Virtual methods */
+
 } ;
 
 typedef struct {
@@ -136,9 +135,9 @@ CamelType camel_mapi_folder_get_type (void);
 
 /* implemented */
 CamelFolder *
-camel_mapi_folder_new(CamelStore *store, const char *folder_name, const char *folder_dir, guint32 flags, CamelException *ex);
+camel_mapi_folder_new(CamelStore *store, const gchar *folder_name, const gchar *folder_dir, guint32 flags, CamelException *ex);
 
-void mapi_update_summary ( CamelFolder *folder, GList *item_list,CamelException *ex) ;
+void mapi_update_summary ( CamelFolder *folder, GList *item_list,CamelException *ex);
 void mapi_refresh_folder(CamelFolder *folder, CamelException *ex);
 gboolean camel_mapi_folder_fetch_summary (CamelStore *store, const mapi_id_t fid, struct mapi_SRestriction *res,
 					  struct SSortOrderSet *sort, fetch_items_data *fetch_data, guint32 options);
diff --git a/src/camel/camel-mapi-notifications.c b/src/camel/camel-mapi-notifications.c
index adaa195..aa57c43 100644
--- a/src/camel/camel-mapi-notifications.c
+++ b/src/camel/camel-mapi-notifications.c
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -51,7 +51,7 @@ extern gint camel_application_is_exiting;
 
 struct mapi_push_notification_data {
 	guint16 event_mask;
-	guint32 connection; 
+	guint32 connection;
 	guint32 event_options;
 	gpointer event_data;
 
@@ -88,7 +88,7 @@ process_mapi_new_mail_notif (CamelMapiStore *store, struct NewMailNotification *
 	while (info_count >= 0) {
 		info = camel_store_summary_index ((CamelStoreSummary *)store->summary, info_count);
 		mapi_info = (CamelMapiStoreInfo *)info;
-		if (info && !g_strcmp0 (mapi_info->folder_id, folder_id)){
+		if (info && !g_strcmp0 (mapi_info->folder_id, folder_id)) {
 			folder_name = mapi_info->full_name;
 		}
 		if (info)
@@ -118,7 +118,7 @@ process_mapi_new_mail_notif (CamelMapiStore *store, struct NewMailNotification *
 	CAMEL_SERVICE_REC_LOCK (store, connect_lock);
 	camel_mapi_folder_fetch_summary ((CamelStore *)store, new_mail_notif->FID, res, NULL, fetch_data, options);
 	CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
-	
+
 	camel_folder_summary_touch (folder->summary);
 	/* mapi_sync_summary */
 	camel_folder_summary_save_to_db (folder->summary, NULL);
@@ -132,9 +132,9 @@ process_mapi_new_mail_notif (CamelMapiStore *store, struct NewMailNotification *
 }
 
 static gint
-mapi_notifications_filter (guint16 type, void *event, void *store)
+mapi_notifications_filter (guint16 type, gpointer event, gpointer store)
 {
-	switch(type) {
+	switch (type) {
 	/* -- Folder Events -- */
 	case fnevObjectCreated:
 		d_notifications(printf ("Event : Folder Created\n"));
@@ -183,7 +183,6 @@ mapi_notifications_filter (guint16 type, void *event, void *store)
 	return 0;
 }
 
-
 /*Of type mapi_notify_continue_callback_t*/
 static gint
 mapi_notifications_continue_check (gpointer data)
@@ -195,7 +194,7 @@ mapi_notifications_continue_check (gpointer data)
 	if (g_cancellable_is_cancelled (thread_data->cancellable) || (camel_application_is_exiting == TRUE))
 		return 1;
 
-	/* HACK ALERT : This is a BAD idea. But ;-), A bug in MonitorNotification */
+	/* HACK ALERT : This is a BAD idea. But;-), A bug in MonitorNotification */
 	/* makes select() return immediately. We are introducing a artificial delay here */
 	/* to avoid high CPU usage. Remove this when libmapi 0.9.1 is out */
 	g_usleep (G_USEC_PER_SEC * 2);
@@ -230,7 +229,7 @@ mapi_push_notification_listener_thread (gpointer data)
 		CAMEL_SERVICE_REC_UNLOCK (mapi_store, connect_lock);
 		exchange_mapi_events_monitor (cb_data); /*Blocking call. Don't hold locks here*/
 		exchange_mapi_events_unsubscribe (thread_data->connection);
-	} else 
+	} else
 		CAMEL_SERVICE_REC_UNLOCK (mapi_store, connect_lock);
 
 	g_free (cb_data);
diff --git a/src/camel/camel-mapi-notifications.h b/src/camel/camel-mapi-notifications.h
index 363a416..b4f00d5 100644
--- a/src/camel/camel-mapi-notifications.h
+++ b/src/camel/camel-mapi-notifications.h
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -33,4 +33,4 @@ void camel_mapi_notification_listener_stop (CamelMapiStore *store, gpointer star
 
 G_END_DECLS
 
-#endif 
+#endif
diff --git a/src/camel/camel-mapi-private.h b/src/camel/camel-mapi-private.h
index ce2c762..5d09429 100644
--- a/src/camel/camel-mapi-private.h
+++ b/src/camel/camel-mapi-private.h
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
diff --git a/src/camel/camel-mapi-provider.c b/src/camel/camel-mapi-provider.c
index 7e6083e..6ca87b1 100644
--- a/src/camel/camel-mapi-provider.c
+++ b/src/camel/camel-mapi-provider.c
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -36,9 +36,9 @@
 
 #define d(x) x
 
-static void add_hash (guint *, char *);
+static void add_hash (guint *, gchar *);
 static guint mapi_url_hash (gconstpointer);
-static gint check_equal (char *, char *);
+static gint check_equal (gchar *, gchar *);
 static gint mapi_url_equal (gconstpointer, gconstpointer);
 
 static CamelProviderConfEntry mapi_conf_entries[] = {
@@ -60,22 +60,21 @@ static CamelProviderConfEntry mapi_conf_entries[] = {
 	{ CAMEL_PROVIDER_CONF_CHECKBOX, "filter_junk_inbox", "filter_junk",
 	  N_("Only check for Junk messag_es in the Inbox folder"), "0" },
 
-	 	
 	{ CAMEL_PROVIDER_CONF_SECTION_END },
 	{ CAMEL_PROVIDER_CONF_END }
 };
 
 static CamelProvider mapi_provider = {
-	"mapi",	
+	"mapi",
 
-	"Exchange MAPI", 
+	"Exchange MAPI",
 
-	N_("For accessing Microsoft Exchange / OpenChange servers using MAPI"),	
+	N_("For accessing Microsoft Exchange / OpenChange servers using MAPI"),
 
-	"mail",	
+	"mail",
 
 	CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_IS_SOURCE |
-	CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_DISABLE_SENT_FOLDER | CAMEL_PROVIDER_IS_EXTERNAL, 
+	CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_DISABLE_SENT_FOLDER | CAMEL_PROVIDER_IS_EXTERNAL,
 
 	CAMEL_URL_NEED_USER | CAMEL_URL_NEED_HOST,
 
@@ -91,7 +90,7 @@ CamelServiceAuthType camel_mapi_password_authtype = {
 	TRUE
 };
 
-static int 
+static gint
 mapi_auto_detect_cb(CamelURL *url, GHashTable **auto_detected, CamelException *ex)
 {
         d (printf("mapi_auto_detect_cb\n"));
@@ -116,7 +115,7 @@ camel_provider_module_init(void)
 }
 
 static void
-add_hash(guint *hash, char *s)
+add_hash(guint *hash, gchar *s)
 {
 	if (s) {
 		*hash ^= g_str_hash(s);
@@ -138,7 +137,7 @@ mapi_url_hash(gconstpointer key)
 }
 
 static gint
-check_equal(char *s1, char *s2)
+check_equal(gchar *s1, gchar *s2)
 {
 	if (s1 == NULL) {
 		if (s2 == NULL) {
@@ -159,7 +158,7 @@ mapi_url_equal (gconstpointer a, gconstpointer b)
 {
 	const CamelURL	*u1 = a;
 	const CamelURL	*u2 = b;
-  
+
 	return check_equal (u1->protocol, u2->protocol)
 		&& check_equal (u1->user, u2->user)
 		&& check_equal (u1->authmech, u2->authmech)
diff --git a/src/camel/camel-mapi-store-summary.c b/src/camel/camel-mapi-store-summary.c
index 828e58c..9d918eb 100644
--- a/src/camel/camel-mapi-store-summary.c
+++ b/src/camel/camel-mapi-store-summary.c
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -40,15 +40,15 @@
 
 #define d(x) 
 
-static int summary_header_load(CamelStoreSummary *, FILE *);
-static int summary_header_save(CamelStoreSummary *, FILE *);
+static gint summary_header_load(CamelStoreSummary *, FILE *);
+static gint summary_header_save(CamelStoreSummary *, FILE *);
 
-static CamelStoreInfo *store_info_load(CamelStoreSummary *s, FILE *in) ;
-static int store_info_save(CamelStoreSummary *s, FILE *out, CamelStoreInfo *mi) ;
-static void store_info_free(CamelStoreSummary *s, CamelStoreInfo *mi) ;
-static void store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, int type, const char *str) ;
+static CamelStoreInfo *store_info_load(CamelStoreSummary *s, FILE *in);
+static gint store_info_save(CamelStoreSummary *s, FILE *out, CamelStoreInfo *mi);
+static void store_info_free(CamelStoreSummary *s, CamelStoreInfo *mi);
+static void store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, gint type, const gchar *str);
 
-static const char *store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, int type) ;
+static const gchar *store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, gint type);
 
 static void camel_mapi_store_summary_class_init (CamelMapiStoreSummaryClass *klass);
 static void camel_mapi_store_summary_init       (CamelMapiStoreSummary *obj);
@@ -56,7 +56,6 @@ static void camel_mapi_store_summary_finalise   (CamelObject *obj);
 
 static CamelStoreSummaryClass *camel_mapi_store_summary_parent;
 
-
 static void
 camel_mapi_store_summary_class_init (CamelMapiStoreSummaryClass *klass)
 {
@@ -64,7 +63,7 @@ camel_mapi_store_summary_class_init (CamelMapiStoreSummaryClass *klass)
 
 	ssklass->summary_header_load = summary_header_load;
 	ssklass->summary_header_save = summary_header_save;
-	
+
 	ssklass->store_info_load = store_info_load;
 	ssklass->store_info_save = store_info_save;
 	ssklass->store_info_free = store_info_free;
@@ -72,7 +71,6 @@ camel_mapi_store_summary_class_init (CamelMapiStoreSummaryClass *klass)
 	ssklass->store_info_string = store_info_string;
 	ssklass->store_info_set_string = store_info_set_string;
 
-
 }
 
 static void
@@ -83,13 +81,11 @@ camel_mapi_store_summary_init (CamelMapiStoreSummary *s)
 	s->version = CAMEL_MAPI_STORE_SUMMARY_VERSION;
 }
 
-
 static void
 camel_mapi_store_summary_finalise (CamelObject *obj)
 {
 }
 
-
 CamelType
 camel_mapi_store_summary_get_type (void)
 {
@@ -109,7 +105,6 @@ camel_mapi_store_summary_get_type (void)
 	return type;
 }
 
-
 CamelMapiStoreSummary *
 camel_mapi_store_summary_new (void)
 {
@@ -118,31 +113,29 @@ camel_mapi_store_summary_new (void)
 	return new;
 }
 
-
-static int
+static gint
 summary_header_load(CamelStoreSummary *s, FILE *in)
 {
-	CamelMapiStoreSummary *summary = (CamelMapiStoreSummary *)s ;
+	CamelMapiStoreSummary *summary = (CamelMapiStoreSummary *)s;
 
 	/* TODO */
 	if (camel_mapi_store_summary_parent->summary_header_load ((CamelStoreSummary *)s, in) == -1)
 			/* || camel_file_util_decode_fixed_int32(in, &version) == -1) */
-		return -1 ;
+		return -1;
 
-	summary->version = 0 ;
+	summary->version = 0;
 
-	return 0 ;
+	return 0;
 }
 
-
-static int
+static gint
 summary_header_save(CamelStoreSummary *s, FILE *out)
 {
 
 	if (camel_mapi_store_summary_parent->summary_header_save((CamelStoreSummary *)s, out) == -1)
 		return -1;
 
-	return 0 ;
+	return 0;
 }
 
 static CamelStoreInfo *
@@ -162,14 +155,14 @@ store_info_load(CamelStoreSummary *s, FILE *in)
 	return (CamelStoreInfo *)si;
 }
 
-static int
+static gint
 store_info_save(CamelStoreSummary *s, FILE *out, CamelStoreInfo *mi)
 {
 	CamelMapiStoreInfo *summary = (CamelMapiStoreInfo *)mi;
 	if (camel_mapi_store_summary_parent->store_info_save(s, out, mi) == -1
 	    || camel_file_util_encode_string(out, summary->full_name) == -1
 	    || camel_file_util_encode_string(out, summary->folder_id) == -1
-	    || camel_file_util_encode_string(out, summary->parent_id) == -1) 
+	    || camel_file_util_encode_string(out, summary->parent_id) == -1)
 		return -1;
 
 	return 0;
@@ -187,8 +180,8 @@ store_info_free(CamelStoreSummary *s, CamelStoreInfo *mi)
 	camel_mapi_store_summary_parent->store_info_free(s, mi);
 }
 
-static const char *
-store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, int type)
+static const gchar *
+store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, gint type)
 {
 	CamelMapiStoreInfo *isi = (CamelMapiStoreInfo *)mi;
 
@@ -199,23 +192,23 @@ store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, int type)
 	switch (type) {
 		case CAMEL_MAPI_STORE_INFO_FULL_NAME:
 			return isi->full_name;
-	        case CAMEL_MAPI_STORE_INFO_FOLDER_ID:
-		        return isi->folder_id;
-	        case CAMEL_MAPI_STORE_INFO_PARENT_ID:
-		        return isi->parent_id;
+		case CAMEL_MAPI_STORE_INFO_FOLDER_ID:
+			return isi->folder_id;
+		case CAMEL_MAPI_STORE_INFO_PARENT_ID:
+			return isi->parent_id;
 		default:
 			return camel_mapi_store_summary_parent->store_info_string(s, mi, type);
 	}
 }
 
 static void
-store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, int type, const char *str)
+store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, gint type, const gchar *str)
 {
 	CamelMapiStoreInfo *isi = (CamelMapiStoreInfo *)mi;
 
 	g_assert(mi != NULL);
 
-	switch(type) {
+	switch (type) {
 		case CAMEL_MAPI_STORE_INFO_FULL_NAME:
 			d(printf("Set full name %s -> %s\n", isi->full_name, str));
 			CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
@@ -223,14 +216,14 @@ store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, int type, const
 			isi->full_name = g_strdup(str);
 			CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
 			break;
-	        case CAMEL_MAPI_STORE_INFO_FOLDER_ID:
+		case CAMEL_MAPI_STORE_INFO_FOLDER_ID:
 			d(printf("Set folder id %s -> %s\n", isi->folder_id, str));
 			CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
 			g_free(isi->folder_id);
 			isi->folder_id = g_strdup(str);
 			CAMEL_STORE_SUMMARY_UNLOCK(s, summary_lock);
 			break;
-	        case CAMEL_MAPI_STORE_INFO_PARENT_ID:
+		case CAMEL_MAPI_STORE_INFO_PARENT_ID:
 			d(printf("Set parent id %s -> %s\n", isi->parent_id, str));
 			CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
 			g_free(isi->parent_id);
@@ -244,9 +237,9 @@ store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, int type, const
 }
 
 CamelMapiStoreInfo *
-camel_mapi_store_summary_full_name(CamelMapiStoreSummary *s, const char *full_name)
+camel_mapi_store_summary_full_name(CamelMapiStoreSummary *s, const gchar *full_name)
 {
-	int count, i;
+	gint count, i;
 	CamelMapiStoreInfo *info;
 
 	count = camel_store_summary_count((CamelStoreSummary *)s);
@@ -263,41 +256,40 @@ camel_mapi_store_summary_full_name(CamelMapiStoreSummary *s, const char *full_na
 
 }
 
-char *
-camel_mapi_store_summary_full_to_path(CamelMapiStoreSummary *s, const char *full_name, char dir_sep)
+gchar *
+camel_mapi_store_summary_full_to_path(CamelMapiStoreSummary *s, const gchar *full_name, gchar dir_sep)
 {
-	char *path, *p;
-	int c;
-	const char *f;
+	gchar *path, *p;
+	gint c;
+	const gchar *f;
 
 	if (dir_sep != '/') {
 		p = path = alloca(strlen(full_name)*3+1);
 		f = full_name;
-		while ( (c = *f++ & 0xff) ) {
+		while ((c = *f++ & 0xff)) {
 			if (c == dir_sep)
 				*p++ = '/';
 //FIXME : why ?? :(
-/* 			else if (c == '/' || c == '%') */
-/* 				p += sprintf(p, "%%%02X", c); */
+/*			else if (c == '/' || c == '%') */
+/*				p += sprintf(p, "%%%02X", c); */
 			else
 				*p++ = c;
 		}
 		*p = 0;
 	} else
-		path = (char *)full_name;
+		path = (gchar *)full_name;
 
 	return g_strdup (path);
 }
 
-
 CamelMapiStoreInfo *
-camel_mapi_store_summary_add_from_full(CamelMapiStoreSummary *s, const char *full, 
-				       char dir_sep, char *folder_id, char *parent_id)
+camel_mapi_store_summary_add_from_full(CamelMapiStoreSummary *s, const gchar *full,
+				       gchar dir_sep, gchar *folder_id, gchar *parent_id)
 {
 	CamelMapiStoreInfo *info;
-	char *pathu8;
-	int len;
-	char *full_name;
+	gchar *pathu8;
+	gint len;
+	gchar *full_name;
 
 	d(printf("adding full name '%s' '%c'\n", full, dir_sep));
 	len = strlen(full);
@@ -325,10 +317,10 @@ camel_mapi_store_summary_add_from_full(CamelMapiStoreSummary *s, const char *ful
 	return info;
 }
 
-char *
-camel_mapi_store_summary_full_from_path(CamelMapiStoreSummary *s, const char *path)
+gchar *
+camel_mapi_store_summary_full_from_path(CamelMapiStoreSummary *s, const gchar *path)
 {
-	char *name = NULL;
+	gchar *name = NULL;
 
 	d(printf("looking up path %s -> %s\n", path, name?name:"not found"));
 
diff --git a/src/camel/camel-mapi-store-summary.h b/src/camel/camel-mapi-store-summary.h
index ced65e1..679557d 100644
--- a/src/camel/camel-mapi-store-summary.h
+++ b/src/camel/camel-mapi-store-summary.h
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -48,9 +48,9 @@ enum {
 
 struct _CamelMapiStoreInfo {
 	CamelStoreInfo info;
-	char *full_name;
-	char *folder_id;
-	char *parent_id;
+	gchar *full_name;
+	gchar *folder_id;
+	gchar *parent_id;
 };
 
 struct _CamelMapiStoreSummary {
@@ -69,13 +69,13 @@ struct _CamelMapiStoreSummaryClass {
 
 CamelType                        camel_mapi_store_summary_get_type      (void);
 CamelMapiStoreSummary      *camel_mapi_store_summary_new        (void);
-CamelMapiStoreInfo *camel_mapi_store_summary_full_name(CamelMapiStoreSummary *s, const char *full_name) ;
-CamelMapiStoreInfo *camel_mapi_store_summary_add_from_full(CamelMapiStoreSummary *s, const char *full, char dir_sep, 
-							   char *folder_id, char *parent_id);
+CamelMapiStoreInfo *camel_mapi_store_summary_full_name(CamelMapiStoreSummary *s, const gchar *full_name);
+CamelMapiStoreInfo *camel_mapi_store_summary_add_from_full(CamelMapiStoreSummary *s, const gchar *full, gchar dir_sep,
+							   gchar *folder_id, gchar *parent_id);
 
-char *camel_mapi_store_summary_full_to_path(CamelMapiStoreSummary *s, const char *full_name, char dir_sep) ;
-char *camel_mapi_store_summary_path_to_full(CamelMapiStoreSummary *s, const char *path, char dir_sep) ;
-char *camel_mapi_store_summary_full_from_path(CamelMapiStoreSummary *s, const char *path) ;
+gchar *camel_mapi_store_summary_full_to_path(CamelMapiStoreSummary *s, const gchar *full_name, gchar dir_sep);
+gchar *camel_mapi_store_summary_path_to_full(CamelMapiStoreSummary *s, const gchar *path, gchar dir_sep);
+gchar *camel_mapi_store_summary_full_from_path(CamelMapiStoreSummary *s, const gchar *path);
 
 #define camel_mapi_store_info_full_name(s, i) (camel_store_info_string((CamelStoreSummary *)s, (const CamelStoreInfo *)i, CAMEL_MAPI_STORE_INFO_FULL_NAME))
 #define camel_mapi_store_info_folder_id(s, i) (camel_store_info_string((CamelStoreSummary *)s, (const CamelStoreInfo *)i, CAMEL_MAPI_STORE_INFO_FOLDER_ID))
@@ -83,4 +83,4 @@ char *camel_mapi_store_summary_full_from_path(CamelMapiStoreSummary *s, const ch
 
 G_END_DECLS
 
-#endif /* ! _CAMEL_MAPI_STORE_SUMMARY_H */
+#endif /* _CAMEL_MAPI_STORE_SUMMARY_H */
diff --git a/src/camel/camel-mapi-store.c b/src/camel/camel-mapi-store.c
index b6926ad..ed17ccd 100644
--- a/src/camel/camel-mapi-store.c
+++ b/src/camel/camel-mapi-store.c
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -44,7 +44,6 @@
 #include <exchange-mapi-utils.h>
 //#define d(x) x
 
-
 /* This definition should be in-sync with those in exchange-mapi-account-setup.c and exchange-account-listener.c */
 #define E_PASSWORD_COMPONENT "ExchangeMAPI"
 
@@ -61,10 +60,10 @@
 #define d(x) printf("%s:%s:%s \n", G_STRLOC, G_STRFUNC, x)
 
 struct _CamelMapiStorePrivate {
-	char *user;
-	const char *profile;
-	char *base_url;
-	char *storage_path;
+	gchar *user;
+	const gchar *profile;
+	gchar *base_url;
+	gchar *storage_path;
 
 	GHashTable *id_hash; /*get names from ids*/
 	GHashTable *name_hash;/*get ids from names*/
@@ -85,28 +84,28 @@ static void	camel_mapi_store_finalize(CamelObject *);
 static void	mapi_construct(CamelService *, CamelSession *,
 				     CamelProvider *, CamelURL *,
 				     CamelException *);
-static char	*mapi_get_name(CamelService *, gboolean );
+static gchar	*mapi_get_name(CamelService *, gboolean );
 static gboolean	mapi_connect(CamelService *, CamelException *);
 static gboolean	mapi_disconnect(CamelService *, gboolean , CamelException *);
 static GList	*mapi_query_auth_types(CamelService *, CamelException *);
 
 /* store methods */
-static CamelFolder	*mapi_get_folder(CamelStore *, const char *, guint32, CamelException *);
-static CamelFolderInfo	*mapi_create_folder(CamelStore *, const char *, const char *, CamelException *);
-static void		mapi_delete_folder(CamelStore *, const char *, CamelException *);
-static void		mapi_rename_folder(CamelStore *, const char *, const char *, CamelException *);
-static CamelFolderInfo	*mapi_get_folder_info(CamelStore *, const char *, guint32, CamelException *);
-static void		mapi_subscribe_folder(CamelStore *, const char *, CamelException *);
-static gboolean mapi_folder_subscribed (CamelStore *store, const char *folder_name);
-static void		mapi_unsubscribe_folder(CamelStore *, const char *, CamelException *);
+static CamelFolder	*mapi_get_folder(CamelStore *, const gchar *, guint32, CamelException *);
+static CamelFolderInfo	*mapi_create_folder(CamelStore *, const gchar *, const gchar *, CamelException *);
+static void		mapi_delete_folder(CamelStore *, const gchar *, CamelException *);
+static void		mapi_rename_folder(CamelStore *, const gchar *, const gchar *, CamelException *);
+static CamelFolderInfo	*mapi_get_folder_info(CamelStore *, const gchar *, guint32, CamelException *);
+static void		mapi_subscribe_folder(CamelStore *, const gchar *, CamelException *);
+static gboolean mapi_folder_subscribed (CamelStore *store, const gchar *folder_name);
+static void		mapi_unsubscribe_folder(CamelStore *, const gchar *, CamelException *);
 static void		mapi_noop(CamelStore *, CamelException *);
-static CamelFolderInfo * mapi_build_folder_info(CamelMapiStore *mapi_store, const char *parent_name, const char *folder_name);
-static gboolean mapi_fid_is_system_folder (CamelMapiStore *mapi_store, const char *fid);
+static CamelFolderInfo * mapi_build_folder_info(CamelMapiStore *mapi_store, const gchar *parent_name, const gchar *folder_name);
+static gboolean mapi_fid_is_system_folder (CamelMapiStore *mapi_store, const gchar *fid);
 
 static void mapi_update_folder_hash_tables (CamelMapiStore *store, const gchar *name, const gchar *fid, const gchar *parent_id);
-/* static const gchar* mapi_folders_hash_table_name_lookup (CamelMapiStore *store, const gchar *fid, gboolean use_cache); */
+/* static const gchar * mapi_folders_hash_table_name_lookup (CamelMapiStore *store, const gchar *fid, gboolean use_cache); */
 #if 0
-static const gchar* mapi_folders_hash_table_fid_lookup (CamelMapiStore *store, const gchar *name, gboolean use_cache);
+static const gchar * mapi_folders_hash_table_fid_lookup (CamelMapiStore *store, const gchar *name, gboolean use_cache);
 #endif
 
 #if 0
@@ -153,16 +152,16 @@ mapi_hash_folder_name(gconstpointer key)
 static gint
 mapi_compare_folder_name(gconstpointer a, gconstpointer b)
 {
-	gconstpointer	aname = a; 
+	gconstpointer	aname = a;
 	gconstpointer	bname = b;
-  
+
 	return g_str_equal(aname, bname);
 }
 
 static void
 camel_mapi_store_class_init(CamelMapiStoreClass *klass)
 {
-	CamelServiceClass	*service_class = 
+	CamelServiceClass	*service_class =
 		CAMEL_SERVICE_CLASS (klass);
 	CamelStoreClass		*store_class = (CamelStoreClass *) klass;
 
@@ -188,11 +187,11 @@ camel_mapi_store_class_init(CamelMapiStoreClass *klass)
 	store_class->noop = mapi_noop;
 }
 
-CamelType 
+CamelType
 camel_mapi_store_get_type(void)
 {
 	static CamelType camel_mapi_store_type = CAMEL_INVALID_TYPE;
-  
+
 	if (camel_mapi_store_type == CAMEL_INVALID_TYPE) {
 		camel_mapi_store_type = camel_type_register(camel_offline_store_get_type (),
 							    "CamelMapiStores",
@@ -240,23 +239,23 @@ static void mapi_construct(CamelService *service, CamelSession *session,
 	CamelMapiStore	*mapi_store = CAMEL_MAPI_STORE (service);
 	CamelStore *store = CAMEL_STORE (service);
 	CamelMapiStorePrivate *priv = mapi_store->priv;
-	char *path = NULL;
-	
+	gchar *path = NULL;
+
 	CAMEL_SERVICE_CLASS (parent_class)->construct (service, session, provider, url, ex);
 
 	if (camel_exception_is_set (ex))
 		return;
-	
-/* 	if (!(url->host || url->user)) { */
-/* 		camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_INVALID, */
-/* 				     _("Host or user not available in url")); */
-/* 	} */
+
+/*	if (!(url->host || url->user)) { */
+/*		camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_INVALID, */
+/*				     _("Host or user not available in url")); */
+/*	} */
 
 	/*storage path*/
 	priv->storage_path = camel_session_get_storage_path (session, service, ex);
 	if (!priv->storage_path)
 		return;
-	
+
 	/*store summary*/
 	path = g_alloca (strlen (priv->storage_path) + 32);
 	sprintf (path, "%s/.summary", priv->storage_path);
@@ -276,12 +275,11 @@ static void mapi_construct(CamelService *service, CamelSession *session,
 						       CAMEL_URL_HIDE_PARAMS   |
 						       CAMEL_URL_HIDE_AUTH)  );
 
-
 	/*filter*/
 	if (camel_url_get_param (url, "filter"))
 		store->flags |= CAMEL_STORE_FILTER_INBOX;
 
-	/*Hash Table*/	
+	/*Hash Table*/
 	priv->id_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); /* folder ID to folder Full name */
 	priv->name_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); /* folder Full name to folder ID */
 	/*priv->parent_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); / * folder ID to its parent folder ID */
@@ -301,7 +299,7 @@ static char
 		/* Translators: The %s is replaced with a server's host name */
 		return g_strdup_printf(_("Exchange MAPI server %s"), service->url->host);
 	} else {
-		/*To translators : Example string : Exchange MAPI service for 
+		/*To translators : Example string : Exchange MAPI service for
 		  _username_ on _server host name__*/
 		return g_strdup_printf(_("Exchange MAPI service for %s on %s"),
 				       service->url->user, service->url->host);
@@ -311,7 +309,7 @@ static char
 static gboolean
 check_for_connection (CamelService *service, CamelException *ex)
 {
-	/*Fixme : What happens when the network connection drops. 
+	/*Fixme : What happens when the network connection drops.
 	  will mapi subsystem handle that ?*/
 	return exchange_mapi_connection_exists ();
 }
@@ -321,7 +319,7 @@ mapi_auth_loop (CamelService *service, CamelException *ex)
 {
 	CamelSession *session = camel_service_get_session (service);
 
-	char *errbuf = NULL;
+	gchar *errbuf = NULL;
 	gboolean authenticated = FALSE;
 
 	service->url->passwd = NULL;
@@ -333,10 +331,10 @@ mapi_auth_loop (CamelService *service, CamelException *ex)
 			g_free (service->url->passwd);
 			service->url->passwd = NULL;
 		}
-	
-		if (!service->url->passwd ){
-			char *prompt;
-			
+
+		if (!service->url->passwd ) {
+			gchar *prompt;
+
 			/*To translators : First %s : is the error text or the reason
 			  for prompting the user if it is available.
 			 Second %s is : Username.
@@ -351,28 +349,27 @@ mapi_auth_loop (CamelService *service, CamelException *ex)
 			g_free (prompt);
 			g_free (errbuf);
 			errbuf = NULL;
-			
+
 			if (!service->url->passwd) {
 				camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
 						     _("You did not enter a password."));
 				return FALSE;
 			}
 		}
-		
+
 		exchange_mapi_connection_new (NULL,service->url->passwd);
 
 		if (!exchange_mapi_connection_exists ()) {
 			errbuf = g_strdup_printf (_("Unable to authenticate to Exchange MAPI server."));
-						  
+
 			camel_exception_clear (ex);
-		} else 
+		} else
 			authenticated = TRUE;
-		
+
 	}
 	return TRUE;
 }
 
-
 static gboolean
 mapi_connect(CamelService *service, CamelException *ex)
 {
@@ -401,7 +398,7 @@ mapi_connect(CamelService *service, CamelException *ex)
 		camel_service_disconnect (service, TRUE, NULL);
 		return FALSE;
 	}
-	
+
 	service->status = CAMEL_SERVICE_CONNECTED;
 	((CamelOfflineStore *) store)->state = CAMEL_OFFLINE_STORE_NETWORK_AVAIL;
 
@@ -432,7 +429,7 @@ camel_mapi_store_unset_notification_data (CamelMapiStore *mstore)
 	mstore->priv->notification_data = NULL;
 }
 
-static gboolean 
+static gboolean
 mapi_disconnect(CamelService *service, gboolean clean, CamelException *ex)
 {
 	CamelMapiStore *store = CAMEL_MAPI_STORE (service);
@@ -459,34 +456,33 @@ static GList *mapi_query_auth_types(CamelService *service, CamelException *ex)
 	return NULL;
 }
 
-
-static gboolean 
+static gboolean
 hash_check_fid_presence (gpointer key, gpointer value, gpointer folder_id)
 {
 	return (g_ascii_strcasecmp (value, folder_id) == 0);
 }
 
 static gboolean
-mapi_fid_is_system_folder (CamelMapiStore *mapi_store, const char *fid)
+mapi_fid_is_system_folder (CamelMapiStore *mapi_store, const gchar *fid)
 {
 	CamelMapiStorePrivate *priv = mapi_store->priv;
 
-	if (!(fid && *fid)) 
+	if (!(fid && *fid))
 		return FALSE;
 
 	return (g_hash_table_find (priv->default_folders, hash_check_fid_presence, (gpointer) fid) != NULL);
 }
 
-static const gchar*
-mapi_system_folder_fid (CamelMapiStore *mapi_store, int folder_type)
-{ 
+static const gchar *
+mapi_system_folder_fid (CamelMapiStore *mapi_store, gint folder_type)
+{
 	CamelMapiStorePrivate *priv = mapi_store->priv;
 
-	return g_hash_table_lookup (priv->default_folders, &folder_type); 
+	return g_hash_table_lookup (priv->default_folders, &folder_type);
 }
 
 static CamelFolder *
-mapi_get_folder(CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
+mapi_get_folder(CamelStore *store, const gchar *folder_name, guint32 flags, CamelException *ex)
 {
 	CamelMapiStore *mapi_store = CAMEL_MAPI_STORE (store);
 	CamelMapiStorePrivate *priv = mapi_store->priv;
@@ -529,12 +525,12 @@ mapi_get_folder(CamelStore *store, const char *folder_name, guint32 flags, Camel
 }
 
 static CamelFolderInfo*
-mapi_create_folder(CamelStore *store, const char *parent_name, const char *folder_name, CamelException *ex)
+mapi_create_folder(CamelStore *store, const gchar *parent_name, const gchar *folder_name, CamelException *ex)
 {
 	CamelMapiStore *mapi_store = CAMEL_MAPI_STORE (store);
 	CamelMapiStorePrivate  *priv = mapi_store->priv;
 	CamelFolderInfo *root = NULL;
-	char *parent_id;
+	gchar *parent_id;
 	mapi_id_t parent_fid, new_folder_id;
 
 	if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
@@ -582,13 +578,13 @@ mapi_create_folder(CamelStore *store, const char *parent_name, const char *folde
 }
 
 static void
-mapi_forget_folder (CamelMapiStore *mapi_store, const char *folder_name, CamelException *ex)
+mapi_forget_folder (CamelMapiStore *mapi_store, const gchar *folder_name, CamelException *ex)
 {
 	CamelMapiStorePrivate *priv = mapi_store->priv;
-	char *state_file;
-	char *folder_dir, *storage_path;
+	gchar *state_file;
+	gchar *folder_dir, *storage_path;
 	CamelFolderInfo *fi;
-	const char *name;
+	const gchar *name;
 
 	name = folder_name;
 
@@ -618,18 +614,18 @@ mapi_forget_folder (CamelMapiStore *mapi_store, const char *folder_name, CamelEx
 	camel_folder_info_free (fi);
 }
 
-static void 
-mapi_delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
+static void
+mapi_delete_folder(CamelStore *store, const gchar *folder_name, CamelException *ex)
 {
 	CamelMapiStore *mapi_store = CAMEL_MAPI_STORE (store);
 	CamelMapiStorePrivate  *priv = mapi_store->priv;
 
-	const char *folder_id; 
+	const gchar *folder_id;
 	mapi_id_t folder_fid;
 	gboolean status = FALSE;
-	
+
 	CAMEL_SERVICE_REC_LOCK (store, connect_lock);
-	
+
 	if (!camel_mapi_store_connected ((CamelMapiStore *)store, ex)) {
 		CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
 		return;
@@ -641,22 +637,22 @@ mapi_delete_folder(CamelStore *store, const char *folder_name, CamelException *e
 
 	if (status) {
 		/* Fixme ??  */
-/* 		if (mapi_store->current_folder) */
-/* 			camel_object_unref (mapi_store->current_folder); */
+/*		if (mapi_store->current_folder) */
+/*			camel_object_unref (mapi_store->current_folder); */
 		mapi_forget_folder(mapi_store,folder_name,ex);
 
 		/* remove from name_cache at the end, because the folder_id is from there */
 		/*g_hash_table_remove (priv->parent_hash, folder_id);*/
 		g_hash_table_remove (priv->id_hash, folder_id);
 		g_hash_table_remove (priv->name_hash, folder_name);
-	} 
+	}
 
 	CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
 
 }
 
-static void 
-mapi_rename_folder(CamelStore *store, const char *old_name, const char *new_name, CamelException *ex)
+static void
+mapi_rename_folder(CamelStore *store, const gchar *old_name, const gchar *new_name, CamelException *ex)
 {
 	CamelMapiStore *mapi_store = CAMEL_MAPI_STORE (store);
 	CamelMapiStorePrivate  *priv = mapi_store->priv;
@@ -677,7 +673,7 @@ mapi_rename_folder(CamelStore *store, const char *old_name, const char *new_name
 	old_fid_str = camel_mapi_store_folder_id_lookup (mapi_store, old_name);
 	if (!old_fid_str) {
 		/*To translators : '%s' is current name of the folder */
-		camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, 
+		camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
 				      _("Cannot rename MAPI folder `%s'. Folder does not exist."),
 				      old_name);
 		CAMEL_SERVICE_REC_UNLOCK (mapi_store, connect_lock);
@@ -688,7 +684,7 @@ mapi_rename_folder(CamelStore *store, const char *old_name, const char *new_name
 	if (mapi_fid_is_system_folder (mapi_store, old_fid_str)) {
 		/*To translators : '%s to %s' is current name of the folder  and
 		 new name of the folder.*/
-		camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, 
+		camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
 				      _("Cannot rename MAPI default folder `%s' to `%s'."),
 				      old_name, new_name);
 		return;
@@ -727,7 +723,7 @@ mapi_rename_folder(CamelStore *store, const char *old_name, const char *new_name
 		if (!exchange_mapi_rename_folder (old_fid, tmp ? tmp : new_name)) {
 			/*To translators : '%s to %s' is current name of the folder  and
 			new name of the folder.*/
-			camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, 
+			camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
 						  _("Cannot rename MAPI folder `%s' to `%s'"), old_name, new_name);
 
 			CAMEL_SERVICE_REC_UNLOCK (mapi_store, connect_lock);
@@ -877,14 +873,14 @@ static guint32 hexnib(guint32 c)
 		return 0;
 }
 
-char *
-camel_mapi_store_summary_path_to_full(CamelMapiStoreSummary *s, const char *path, char dir_sep)
+gchar *
+camel_mapi_store_summary_path_to_full(CamelMapiStoreSummary *s, const gchar *path, gchar dir_sep)
 {
-	char *full, *f;
+	gchar *full, *f;
 	guint32 c, v = 0;
-	const char *p;
-	int state=0;
-	char *subpath, *last = NULL;
+	const gchar *p;
+	gint state=0;
+	gchar *subpath, *last = NULL;
 	CamelStoreInfo *si;
 
 	/* check to see if we have a subpath of path already defined */
@@ -912,15 +908,15 @@ camel_mapi_store_summary_path_to_full(CamelMapiStoreSummary *s, const char *path
 	else
 		p = path;
 
-	while ( (c = camel_utf8_getc((const unsigned char **)&p)) ) {
-		switch(state) {
+	while ((c = camel_utf8_getc((const guchar **)&p))) {
+		switch (state) {
 			case 0:
 				if (c == '%')
 					state = 1;
 				else {
 					if (c == '/')
 						c = dir_sep;
-					camel_utf8_putc((unsigned char **)&f, c);
+					camel_utf8_putc((guchar **)&f, c);
 				}
 				break;
 			case 1:
@@ -930,11 +926,11 @@ camel_mapi_store_summary_path_to_full(CamelMapiStoreSummary *s, const char *path
 			case 2:
 				state = 0;
 				v |= hexnib(c);
-				camel_utf8_putc((unsigned char **)&f, v);
+				camel_utf8_putc((guchar **)&f, v);
 				break;
 		}
 	}
-	camel_utf8_putc((unsigned char **)&f, c);
+	camel_utf8_putc((guchar **)&f, c);
 
 	/* merge old path part if required */
 	f = g_strdup (full);
@@ -943,17 +939,16 @@ camel_mapi_store_summary_path_to_full(CamelMapiStoreSummary *s, const char *path
 		g_free(f);
 		camel_store_summary_info_free((CamelStoreSummary *)s, si);
 		f = full;
-	} 
+	}
 
-	return f ;
+	return f;
 }
 
-
-//do we realy need this. move to utils then ! 
-static int 
-match_path(const char *path, const char *name)
+//do we realy need this. move to utils then !
+static gint
+match_path(const gchar *path, const gchar *name)
 {
-	char p, n;
+	gchar p, n;
 
 	p = *path++;
 	n = *name++;
@@ -976,10 +971,10 @@ match_path(const char *path, const char *name)
 	return n == 0 && (p == '%' || p == 0);
 }
 
-static char *
-mapi_concat ( const char *prefix, const char *suffix)
+static gchar *
+mapi_concat ( const gchar *prefix, const gchar *suffix)
 {
-	size_t len;
+	gsize len;
 
 	len = strlen (prefix);
 	if (len == 0 || prefix[len - 1] == '/')
@@ -989,26 +984,26 @@ mapi_concat ( const char *prefix, const char *suffix)
 }
 
 static CamelFolderInfo *
-mapi_build_folder_info(CamelMapiStore *mapi_store, const char *parent_name, const char *folder_name)
+mapi_build_folder_info(CamelMapiStore *mapi_store, const gchar *parent_name, const gchar *folder_name)
 {
 	CamelURL *url;
-	const char *name;
+	const gchar *name;
 	CamelFolderInfo *fi;
 	CamelMapiStorePrivate *priv = mapi_store->priv;
 
 	fi = camel_folder_info_new ();
-	
+
 	fi->unread = -1;
 	fi->total = -1;
 
 	if (parent_name) {
-		if (strlen(parent_name) > 0) 
+		if (strlen(parent_name) > 0)
 			fi->full_name = g_strconcat(parent_name, "/", folder_name, NULL);
 		else
 			fi->full_name = g_strdup (folder_name);
-	} else 
+	} else
 		fi->full_name = g_strdup(folder_name);
- 
+
 	url = camel_url_new(priv->base_url,NULL);
 	g_free(url->path);
 
@@ -1017,7 +1012,7 @@ mapi_build_folder_info(CamelMapiStore *mapi_store, const char *parent_name, cons
 	camel_url_free(url);
 
 	name = strrchr(fi->full_name,'/');
-	if(name == NULL)
+	if (name == NULL)
 		name = fi->full_name;
 	else
 		name++;
@@ -1029,14 +1024,14 @@ mapi_build_folder_info(CamelMapiStore *mapi_store, const char *parent_name, cons
 }
 
 static CamelFolderInfo *
-mapi_get_folder_info_offline (CamelStore *store, const char *top,
+mapi_get_folder_info_offline (CamelStore *store, const gchar *top,
 			 guint32 flags, CamelException *ex)
 {
 	CamelMapiStore *mapi_store = CAMEL_MAPI_STORE (store);
 	CamelFolderInfo *fi;
 	GPtrArray *folders;
-	char *path, *name;
-	int i;
+	gchar *path, *name;
+	gint i;
 	gboolean subscribed, favourites = FALSE, subscription_list = FALSE;
 
 	subscription_list = (flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIPTION_LIST);
@@ -1061,7 +1056,7 @@ mapi_get_folder_info_offline (CamelStore *store, const char *top,
 	for (i=0;i<camel_store_summary_count((CamelStoreSummary *)mapi_store->summary);i++) {
 		CamelStoreInfo *si = camel_store_summary_index((CamelStoreSummary *)mapi_store->summary, i);
 
-		if (si == NULL) 
+		if (si == NULL)
 			continue;
 
 		/* Allow only All Public Folders heirarchy */
@@ -1088,7 +1083,7 @@ mapi_get_folder_info_offline (CamelStore *store, const char *top,
 				parent_name = DISPLAY_NAME_FAVOURITES;
 
 				folder_name = strrchr(store_info_path,'/');
-				if(folder_name != NULL)
+				if (folder_name != NULL)
 					store_info_path = ++folder_name;
 
 				favourites = TRUE;
@@ -1103,7 +1098,7 @@ mapi_get_folder_info_offline (CamelStore *store, const char *top,
 				fi->uri = camel_url_to_string(url,CAMEL_URL_HIDE_ALL);
 				camel_url_free (url);
 			}
-				
+
 			fi->unread = si->unread;
 			fi->total = si->total;
 			fi->flags = si->flags;
@@ -1117,7 +1112,7 @@ mapi_get_folder_info_offline (CamelStore *store, const char *top,
 		fi = mapi_build_folder_info(mapi_store, NULL, DISPLAY_NAME_FAVOURITES);
 		fi->flags |= CAMEL_FOLDER_NOSELECT;
 		fi->flags |= CAMEL_FOLDER_SYSTEM;
-		
+
 		g_ptr_array_add (folders, fi);
 	}
 
@@ -1129,19 +1124,19 @@ mapi_get_folder_info_offline (CamelStore *store, const char *top,
 }
 
 static CamelFolderInfo *
-mapi_convert_to_folder_info (CamelMapiStore *store, ExchangeMAPIFolder *folder, const char *url, CamelException *ex)
+mapi_convert_to_folder_info (CamelMapiStore *store, ExchangeMAPIFolder *folder, const gchar *url, CamelException *ex)
 {
-	const char *name = NULL;
+	const gchar *name = NULL;
 	gchar *parent, *id = NULL;
 	mapi_id_t mapi_id_folder;
 
-	const char *par_name = NULL;
+	const gchar *par_name = NULL;
 	CamelFolderInfo *fi;
 
 	name = exchange_mapi_folder_get_name (folder);
 
 	id = g_strdup_printf ("%016" G_GINT64_MODIFIER "X", exchange_mapi_folder_get_fid (folder));
-		
+
 	fi = camel_folder_info_new ();
 
 	if (folder->is_default) {
@@ -1215,14 +1210,13 @@ gboolean
 camel_mapi_store_connected (CamelMapiStore *store, CamelException *ex)
 {
 	if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_AVAIL
-	    && camel_service_connect ((CamelService *)store, ex)) 
+	    && camel_service_connect ((CamelService *)store, ex))
 
 		return TRUE;
 
 	return FALSE;
 }
 
-
 static void
 mapi_update_folder_hash_tables (CamelMapiStore *store, const gchar *full_name, const gchar *fid, const gchar *parent_id)
 {
@@ -1231,7 +1225,7 @@ mapi_update_folder_hash_tables (CamelMapiStore *store, const gchar *full_name, c
 	if (fid && full_name) {
 		/*id_hash returns the name for a given container id*/
 		if (!g_hash_table_lookup (priv->id_hash, fid))
-			g_hash_table_insert (priv->id_hash, g_strdup (fid), g_strdup (full_name)); 
+			g_hash_table_insert (priv->id_hash, g_strdup (fid), g_strdup (full_name));
 
 		/* name_hash : name <-> fid mapping */
 		if (!g_hash_table_lookup (priv->name_hash, full_name))
@@ -1253,7 +1247,7 @@ mapi_folders_update_hash_tables_from_cache (CamelMapiStore *store)
 
 	for (i = 0; i < summary_count; i++) {
 		CamelMapiStoreInfo *si = (CamelMapiStoreInfo *) camel_store_summary_index(summary, i);
-		
+
 		if (si == NULL) continue;
 
 		mapi_update_folder_hash_tables (store, si->full_name, si->folder_id, si->parent_id);
@@ -1261,8 +1255,8 @@ mapi_folders_update_hash_tables_from_cache (CamelMapiStore *store)
 	}
 }
 
-/* static const gchar* */
-const gchar*
+/* static const gchar * */
+const gchar *
 mapi_folders_hash_table_name_lookup (CamelMapiStore *store, const gchar *fid,
 				     gboolean use_cache)
 {
@@ -1278,7 +1272,7 @@ mapi_folders_hash_table_name_lookup (CamelMapiStore *store, const gchar *fid,
 }
 
 #if 0
-static const gchar*
+static const gchar *
 mapi_folders_hash_table_fid_lookup (CamelMapiStore *store, const gchar *name,
 				    gboolean use_cache)
 {
@@ -1314,7 +1308,7 @@ remove_path_from_store_summary (const gchar *path, gpointer value, CamelMapiStor
 	si = camel_store_summary_path ((CamelStoreSummary *)mstore->summary, path);
 	if (si) {
 		CamelFolderInfo *fi;
-	
+
 		fi = camel_folder_info_new ();
 		fi->unread = -1;
 		fi->total = -1;
@@ -1338,12 +1332,12 @@ remove_path_from_store_summary (const gchar *path, gpointer value, CamelMapiStor
 }
 
 static void
-mapi_folders_sync (CamelMapiStore *store, const char *top, guint32 flags, CamelException *ex)
+mapi_folders_sync (CamelMapiStore *store, const gchar *top, guint32 flags, CamelException *ex)
 {
 	CamelMapiStorePrivate  *priv = store->priv;
 	gboolean status;
 	GSList *folder_list = NULL, *temp_list = NULL, *list = NULL;
-	char *url, *temp_url;
+	gchar *url, *temp_url;
 	gboolean subscription_list = FALSE;
 	CamelFolderInfo *info = NULL;
 	CamelMapiStoreInfo *mapi_si = NULL;
@@ -1383,7 +1377,7 @@ mapi_folders_sync (CamelMapiStore *store, const char *top, guint32 flags, CamelE
 		gchar *parent_id = NULL;
 		mapi_id_t pid = 0;
 
-		parent_id = (top) ? g_strdup (camel_mapi_store_folder_id_lookup_offline (store, top)) : NULL; 
+		parent_id = (top) ? g_strdup (camel_mapi_store_folder_id_lookup_offline (store, top)) : NULL;
 		exchange_mapi_util_mapi_id_from_string (parent_id, &pid);
 
 		status = exchange_mapi_get_pf_folders_list (&folder_list, pid);
@@ -1404,13 +1398,13 @@ mapi_folders_sync (CamelMapiStore *store, const char *top, guint32 flags, CamelE
 
 	if ( url[strlen(url) - 1] != '/') {
 		temp_url = g_strconcat (url, "/", NULL);
-		g_free ((char *)url);
+		g_free ((gchar *)url);
 		url = temp_url;
 	}
-	
+
 	/*populate the hash table for finding the mapping from container id <-> folder name*/
-	for (;temp_list != NULL ; temp_list = g_slist_next (temp_list) ) {
-		const char *full_name;
+	for (;temp_list != NULL; temp_list = g_slist_next (temp_list) ) {
+		const gchar *full_name;
 		gchar *fid = NULL, *parent_id = NULL, *tmp = NULL;
 
 		fid = g_strdup_printf ("%016" G_GINT64_MODIFIER "X", exchange_mapi_folder_get_fid((ExchangeMAPIFolder *)(temp_list->data)));
@@ -1447,20 +1441,20 @@ mapi_folders_sync (CamelMapiStore *store, const char *top, guint32 flags, CamelE
 
 	for (;folder_list != NULL; folder_list = g_slist_next (folder_list)) {
 		ExchangeMAPIFolder *folder = (ExchangeMAPIFolder *) folder_list->data;
-		
+
 		if (folder->default_type == olPublicFoldersAllPublicFolders)
 			continue;
 
-		if ( folder->container_class != MAPI_FOLDER_TYPE_MAIL) 
+		if ( folder->container_class != MAPI_FOLDER_TYPE_MAIL)
 			continue;
 
-		info = mapi_convert_to_folder_info (store, folder, (const char *)url, ex);
-		if (!(mapi_si = (CamelMapiStoreInfo *) camel_store_summary_path ((CamelStoreSummary *)store->summary, info->full_name))){
+		info = mapi_convert_to_folder_info (store, folder, (const gchar *)url, ex);
+		if (!(mapi_si = (CamelMapiStoreInfo *) camel_store_summary_path ((CamelStoreSummary *)store->summary, info->full_name))) {
 			gchar *fid, *pfid = NULL;
 
-			fid = g_strdup_printf ("%016" G_GINT64_MODIFIER "X", 
+			fid = g_strdup_printf ("%016" G_GINT64_MODIFIER "X",
 					       exchange_mapi_folder_get_fid((ExchangeMAPIFolder *)(folder_list->data)));
-			pfid = g_strdup_printf ("%016" G_GINT64_MODIFIER "X", 
+			pfid = g_strdup_printf ("%016" G_GINT64_MODIFIER "X",
 						exchange_mapi_folder_get_parent_id((ExchangeMAPIFolder *)(folder_list->data)));
 
 			mapi_si = camel_mapi_store_summary_add_from_full (store->summary, info->full_name, '/', fid, pfid);
@@ -1507,18 +1501,17 @@ mapi_folders_sync (CamelMapiStore *store, const char *top, guint32 flags, CamelE
 	/* FIXME : This place is not right! */
 	/* Start Push Notification listener */
 	/* event_mask = fnevNewMail | fnevObjectCreated | fnevObjectDeleted | */
-	/* 	fnevObjectModified | fnevObjectMoved | fnevObjectCopied; */
+	/*	fnevObjectModified | fnevObjectMoved | fnevObjectCopied; */
 
 	/* camel_mapi_notfication_listener_start (store, event_mask, MAPI_EVENTS_USE_STORE); */
 }
 
-
 static CamelFolderInfo*
-mapi_get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelException *ex)
+mapi_get_folder_info(CamelStore *store, const gchar *top, guint32 flags, CamelException *ex)
 {
 	CamelMapiStore *mapi_store = CAMEL_MAPI_STORE (store);
 	CamelFolderInfo *info = NULL;
-	int s_count = 0;	
+	gint s_count = 0;
 
 	/*
 	 * Thanks to Michael, for his cached folders implementation in IMAP
@@ -1528,7 +1521,7 @@ mapi_get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelExc
 	CAMEL_SERVICE_REC_LOCK (store, connect_lock);
 
 	if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_AVAIL) {
-		if (((CamelService *)store)->status == CAMEL_SERVICE_DISCONNECTED){
+		if (((CamelService *)store)->status == CAMEL_SERVICE_DISCONNECTED) {
 			((CamelService *)store)->status = CAMEL_SERVICE_CONNECTING;
 			mapi_connect ((CamelService *)store, ex);
 		}
@@ -1560,7 +1553,7 @@ mapi_get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelExc
 }
 
 const gchar *
-camel_mapi_store_folder_id_lookup_offline (CamelMapiStore *mapi_store, const char *folder_name)
+camel_mapi_store_folder_id_lookup_offline (CamelMapiStore *mapi_store, const gchar *folder_name)
 {
 	CamelMapiStoreInfo *mapi_si;
 	const gchar *folder_id;
@@ -1576,7 +1569,7 @@ camel_mapi_store_folder_id_lookup_offline (CamelMapiStore *mapi_store, const cha
 }
 
 const gchar *
-camel_mapi_store_folder_id_lookup (CamelMapiStore *mapi_store, const char *folder_name)
+camel_mapi_store_folder_id_lookup (CamelMapiStore *mapi_store, const gchar *folder_name)
 {
 	CamelMapiStorePrivate *priv = mapi_store->priv;
 
@@ -1590,7 +1583,7 @@ camel_mapi_store_system_folder_fid (CamelMapiStore *mapi_store, guint folder_typ
 }
 
 const gchar *
-camel_mapi_store_folder_lookup (CamelMapiStore *mapi_store, const char *folder_id)
+camel_mapi_store_folder_lookup (CamelMapiStore *mapi_store, const gchar *folder_id)
 {
 	CamelMapiStorePrivate *priv = mapi_store->priv;
 
@@ -1610,7 +1603,7 @@ camel_mapi_store_get_profile_name (CamelMapiStore *mapi_store)
 }
 
 static void
-mapi_subscribe_folder(CamelStore *store, const char *folder_name, CamelException *ex)
+mapi_subscribe_folder(CamelStore *store, const gchar *folder_name, CamelException *ex)
 {
 	CamelMapiStore *mapi_store = CAMEL_MAPI_STORE (store);
 
@@ -1634,7 +1627,7 @@ mapi_subscribe_folder(CamelStore *store, const char *folder_name, CamelException
 		parent_name = DISPLAY_NAME_FAVOURITES;
 
 		f_name = strrchr(folder_name,'/');
-		if(f_name != NULL)
+		if (f_name != NULL)
 			folder_name = ++f_name;
 		else  //Don't process All Public Folder.
 			return;
@@ -1651,11 +1644,11 @@ mapi_subscribe_folder(CamelStore *store, const char *folder_name, CamelException
 }
 
 static gboolean
-mapi_folder_subscribed (CamelStore *store, const char *folder_name)
+mapi_folder_subscribed (CamelStore *store, const gchar *folder_name)
 {
 	CamelMapiStore *mapi_store = (CamelMapiStore *) store;
 	CamelStoreInfo *si;
-	int truth = FALSE;
+	gint truth = FALSE;
 
 	if ((si = camel_store_summary_path ((CamelStoreSummary *) mapi_store->summary, folder_name))) {
 		truth = (si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) != 0;
@@ -1665,8 +1658,8 @@ mapi_folder_subscribed (CamelStore *store, const char *folder_name)
 	return truth;
 }
 
-static void 
-mapi_unsubscribe_folder(CamelStore *store, const char *folder_name, CamelException *ex)
+static void
+mapi_unsubscribe_folder(CamelStore *store, const gchar *folder_name, CamelException *ex)
 {
 	CamelFolderInfo *fi;
 	CamelStoreInfo *si;
@@ -1689,7 +1682,7 @@ mapi_unsubscribe_folder(CamelStore *store, const char *folder_name, CamelExcepti
 		parent_name = DISPLAY_NAME_FAVOURITES;
 
 		f_name = strrchr(folder_name,'/');
-		if(f_name != NULL)
+		if (f_name != NULL)
 			folder_name = ++f_name;
 		else //Don't process All Public Folder.
 			return;
diff --git a/src/camel/camel-mapi-store.h b/src/camel/camel-mapi-store.h
index fff2f86..d2cde6e 100644
--- a/src/camel/camel-mapi-store.h
+++ b/src/camel/camel-mapi-store.h
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -50,26 +50,22 @@ typedef struct _CamelMapiStoreClass CamelMapiStoreClass;
 typedef struct _CamelMapiStorePrivate CamelMapiStorePrivate;
 
 struct _CamelMapiStore{
-	CamelOfflineStore parent_object;	
+	CamelOfflineStore parent_object;
 
 	struct _CamelMapiStoreSummary *summary;
 	CamelMapiStorePrivate *priv;
-/* 	char			*base_url; */
-/* 	CamelURL		*camel_url; */
-/* 	CamelFolderInfo		*fi; */
-/* 	GHashTable		*folders; */
-/* 	GMutex			*folders_lock; */
-/* 	GMutex			*connect_lock; */
+/*	gchar			*base_url; */
+/*	CamelURL		*camel_url; */
+/*	CamelFolderInfo		*fi; */
+/*	GHashTable		*folders; */
+/*	GMutex			*folders_lock; */
+/*	GMutex			*connect_lock; */
 };
 
-
-
-
 struct _CamelMapiStoreClass {
 	CamelOfflineStoreClass		parent_class;
 };
 
-
 /**
  * PROTOTYPES
  */
@@ -89,12 +85,12 @@ __BEGIN_DECLS
 CamelType camel_mapi_store_get_type(void);
 gboolean camel_mapi_store_connected(CamelMapiStore *, CamelException *);
 
-const gchar* camel_mapi_store_folder_id_lookup (CamelMapiStore *mapi_store, const char *folder_name);
-const gchar* camel_mapi_store_folder_lookup (CamelMapiStore *mapi_store, const char *folder_id);
-const gchar* camel_mapi_store_get_profile_name (CamelMapiStore *mapi_store);
+const gchar * camel_mapi_store_folder_id_lookup (CamelMapiStore *mapi_store, const gchar *folder_name);
+const gchar * camel_mapi_store_folder_lookup (CamelMapiStore *mapi_store, const gchar *folder_id);
+const gchar * camel_mapi_store_get_profile_name (CamelMapiStore *mapi_store);
 const gchar *camel_mapi_store_system_folder_fid (CamelMapiStore *mapi_store, guint folder_type);
-const gchar *camel_mapi_store_folder_id_lookup_offline (CamelMapiStore *mapi_store, const char *folder_name);
-const gchar* mapi_folders_hash_table_name_lookup (CamelMapiStore *store, const gchar *fid, gboolean use_cache);
+const gchar *camel_mapi_store_folder_id_lookup_offline (CamelMapiStore *mapi_store, const gchar *folder_name);
+const gchar * mapi_folders_hash_table_name_lookup (CamelMapiStore *store, const gchar *fid, gboolean use_cache);
 
 void camel_mapi_store_unset_notification_data (CamelMapiStore *mstore);
 
diff --git a/src/camel/camel-mapi-summary.c b/src/camel/camel-mapi-summary.c
index b88da36..a4a2ab3 100644
--- a/src/camel/camel-mapi-summary.c
+++ b/src/camel/camel-mapi-summary.c
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -41,13 +41,13 @@
 
 /*Prototypes*/
 static CamelFIRecord* mapi_summary_header_to_db (CamelFolderSummary *, CamelException *ex);
-static int mapi_summary_header_from_db (CamelFolderSummary *, CamelFIRecord *fir);
+static gint mapi_summary_header_from_db (CamelFolderSummary *, CamelFIRecord *fir);
 
-static CamelMessageInfo *mapi_message_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir) ;
-static CamelMIRecord *mapi_message_info_to_db (CamelFolderSummary *s, CamelMessageInfo *info) ;
+static CamelMessageInfo *mapi_message_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir);
+static CamelMIRecord *mapi_message_info_to_db (CamelFolderSummary *s, CamelMessageInfo *info);
 
-static CamelMessageContentInfo * mapi_content_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir) ;
-static int mapi_content_info_to_db (CamelFolderSummary *s, CamelMessageContentInfo *info, CamelMIRecord *mir) ;
+static CamelMessageContentInfo * mapi_content_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir);
+static gint mapi_content_info_to_db (CamelFolderSummary *s, CamelMessageContentInfo *info, CamelMIRecord *mir);
 
 static void camel_mapi_summary_class_init (CamelMapiSummaryClass *klass);
 static void camel_mapi_summary_init       (CamelMapiSummary *obj);
@@ -55,9 +55,7 @@ static void camel_mapi_summary_finalize   (CamelObject *obj);
 
 /*End of Prototypes*/
 
-
-static CamelFolderSummaryClass *camel_mapi_summary_parent ;
-
+static CamelFolderSummaryClass *camel_mapi_summary_parent;
 
 CamelType
 camel_mapi_summary_get_type (void)
@@ -100,7 +98,7 @@ camel_mapi_summary_class_init (CamelMapiSummaryClass *klass)
 
 	camel_mapi_summary_parent = CAMEL_FOLDER_SUMMARY_CLASS (camel_type_get_global_classfuncs (camel_folder_summary_get_type()));
 
-	cfs_class->message_info_clone = mapi_message_info_clone ;
+	cfs_class->message_info_clone = mapi_message_info_clone;
 
 	cfs_class->summary_header_to_db = mapi_summary_header_to_db;
 	cfs_class->summary_header_from_db = mapi_summary_header_from_db;
@@ -110,7 +108,6 @@ camel_mapi_summary_class_init (CamelMapiSummaryClass *klass)
 	cfs_class->content_info_from_db = mapi_content_info_from_db;
 }
 
-
 static void
 camel_mapi_summary_init (CamelMapiSummary *obj)
 {
@@ -119,7 +116,7 @@ camel_mapi_summary_init (CamelMapiSummary *obj)
 	/* subclasses need to set the right instance data sizes */
 	s->message_info_size = sizeof(CamelMapiMessageInfo);
 	s->content_info_size = sizeof(CamelMapiMessageContentInfo);
-	
+
 	/* Meta-summary - Overriding UID len */
 	s->meta_summary->uid_len = 2048;
 }
@@ -142,7 +139,7 @@ camel_mapi_summary_finalize (CamelObject *obj)
  * Return value: A new CamelMapiSummary object.
  **/
 CamelFolderSummary *
-camel_mapi_summary_new (struct _CamelFolder *folder, const char *filename)
+camel_mapi_summary_new (struct _CamelFolder *folder, const gchar *filename)
 {
 	CamelException ex;
 
@@ -150,8 +147,8 @@ camel_mapi_summary_new (struct _CamelFolder *folder, const char *filename)
 			camel_object_new (camel_mapi_summary_get_type ()));
 
 	camel_exception_init (&ex);
-	
-	summary->folder = folder ;
+
+	summary->folder = folder;
 	camel_folder_summary_set_build_content (summary, TRUE);
 	camel_folder_summary_set_filename (summary, filename);
 
@@ -167,14 +164,14 @@ camel_mapi_summary_new (struct _CamelFolder *folder, const char *filename)
 	return summary;
 }
 
-static int
-mapi_summary_header_from_db (CamelFolderSummary *summary, CamelFIRecord *fir) 
+static gint
+mapi_summary_header_from_db (CamelFolderSummary *summary, CamelFIRecord *fir)
 {
 	CamelMapiSummary *mapi_summary = CAMEL_MAPI_SUMMARY (summary);
 	gchar *part;
 
 	if (camel_mapi_summary_parent->summary_header_from_db (summary, fir) == -1)
-		return -1 ;
+		return -1;
 
 	part = fir->bdata;
 
@@ -189,14 +186,14 @@ mapi_summary_header_from_db (CamelFolderSummary *summary, CamelFIRecord *fir)
 	return 0;
 }
 static CamelFIRecord *
-mapi_summary_header_to_db (CamelFolderSummary *summary, CamelException *ex) 
+mapi_summary_header_to_db (CamelFolderSummary *summary, CamelException *ex)
 {
 	CamelMapiSummary *mapi_summary = CAMEL_MAPI_SUMMARY(summary);
 	struct _CamelFIRecord *fir;
 
 	fir = camel_mapi_summary_parent->summary_header_to_db (summary, ex);
 
-	if(!fir)
+	if (!fir)
 		return NULL;
 
 	fir->bdata = g_strdup_printf ("%d %s", CAMEL_MAPI_SUMMARY_VERSION, mapi_summary->sync_time_stamp);
@@ -205,17 +202,17 @@ mapi_summary_header_to_db (CamelFolderSummary *summary, CamelException *ex)
 }
 
 static CamelMessageInfo*
-mapi_message_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir) 
+mapi_message_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir)
 {
-	CamelMessageInfo *info ;
+	CamelMessageInfo *info;
 
-	info = camel_mapi_summary_parent->message_info_from_db (s, mir) ;
+	info = camel_mapi_summary_parent->message_info_from_db (s, mir);
 
-	return info ;
+	return info;
 }
 
 static CamelMIRecord *
-mapi_message_info_to_db (CamelFolderSummary *s, CamelMessageInfo *info) 
+mapi_message_info_to_db (CamelFolderSummary *s, CamelMessageInfo *info)
 {
 	struct _CamelMIRecord *mir;
 
@@ -224,13 +221,13 @@ mapi_message_info_to_db (CamelFolderSummary *s, CamelMessageInfo *info)
 	return mir;
 }
 
-static CamelMessageContentInfo* 
-mapi_content_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir) 
+static CamelMessageContentInfo*
+mapi_content_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir)
 {
-	char *part = mir->cinfo;
+	gchar *part = mir->cinfo;
 	guint32 type=0;
-	
-	if (part) 
+
+	if (part)
 		MS_EXTRACT_FIRST_DIGIT (type);
 
 	mir->cinfo = part;
@@ -241,7 +238,7 @@ mapi_content_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir)
 		return camel_folder_summary_content_info_new (s);
 }
 
-static int
+static gint
 mapi_content_info_to_db (CamelFolderSummary *s, CamelMessageContentInfo *info, CamelMIRecord *mir)
 {
 	if (info->type) {
@@ -258,8 +255,8 @@ mapi_summary_clear (CamelFolderSummary *summary, gboolean uncache)
 {
 	CamelFolderChangeInfo *changes;
 	CamelMessageInfo *info;
-	int i, count;
-	const char *uid;
+	gint i, count;
+	const gchar *uid;
 
 	changes = camel_folder_change_info_new ();
 	count = camel_folder_summary_count (summary);
diff --git a/src/camel/camel-mapi-summary.h b/src/camel/camel-mapi-summary.h
index 027a0e4..c1a133a 100644
--- a/src/camel/camel-mapi-summary.h
+++ b/src/camel/camel-mapi-summary.h
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -32,10 +32,10 @@
 
 G_BEGIN_DECLS
 
-typedef struct _CamelMapiSummary CamelMapiSummary ;
-typedef struct _CamelMapiSummaryClass CamelMapiSummaryClass ;
-typedef struct _CamelMapiMessageInfo CamelMapiMessageInfo ;
-typedef struct _CamelMapiMessageContentInfo CamelMapiMessageContentInfo ;
+typedef struct _CamelMapiSummary CamelMapiSummary;
+typedef struct _CamelMapiSummaryClass CamelMapiSummaryClass;
+typedef struct _CamelMapiMessageInfo CamelMapiMessageInfo;
+typedef struct _CamelMapiMessageContentInfo CamelMapiMessageContentInfo;
 
 /* extra summary flags*/
 enum {
@@ -49,29 +49,25 @@ struct _CamelMapiMessageInfo {
 	guint32 server_flags;
 } ;
 
-
 struct _CamelMapiMessageContentInfo {
-	CamelMessageContentInfo info ;
-} ; 
-
+	CamelMessageContentInfo info;
+} ;
 
 struct _CamelMapiSummary {
-	CamelFolderSummary parent ;
+	CamelFolderSummary parent;
 
 	gchar *sync_time_stamp;
-	guint32 version ;
-	guint32 validity ;
+	guint32 version;
+	guint32 validity;
 } ;
 
-
 struct _CamelMapiSummaryClass {
-	CamelFolderSummaryClass parent_class ;
+	CamelFolderSummaryClass parent_class;
 } ;
 
+CamelType camel_mapi_summary_get_type (void);
 
-CamelType camel_mapi_summary_get_type (void) ;
-
-CamelFolderSummary *camel_mapi_summary_new (struct _CamelFolder *folder, const char *filename) ;
+CamelFolderSummary *camel_mapi_summary_new (struct _CamelFolder *folder, const gchar *filename);
 
 void mapi_summary_clear (CamelFolderSummary *summary, gboolean uncache);
 
diff --git a/src/camel/camel-mapi-transport.c b/src/camel/camel-mapi-transport.c
index 0ec079a..fb7ae46 100644
--- a/src/camel/camel-mapi-transport.c
+++ b/src/camel/camel-mapi-transport.c
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -53,7 +53,6 @@ CamelStore *get_store(void);
 
 void	set_store(CamelStore *);
 
-
 /*CreateItem would return the MID of the new message or '0' if we fail.*/
 static mapi_id_t
 mapi_message_item_send (MapiItem *item)
@@ -61,7 +60,7 @@ mapi_message_item_send (MapiItem *item)
 	guint64 fid = 0;
 	mapi_id_t mid = 0;
 
-	mid = exchange_mapi_create_item (olFolderSentMail, fid, NULL, NULL, 
+	mid = exchange_mapi_create_item (olFolderSentMail, fid, NULL, NULL,
 					 camel_mapi_utils_create_item_build_props,
 					 item, item->recipients,
 					 item->attachments, item->generic_streams, MAPI_OPTIONS_DELETE_ON_SUBMIT_FAILURE);
@@ -74,8 +73,8 @@ mapi_send_to (CamelTransport *transport, CamelMimeMessage *message,
 	      CamelAddress *from, CamelAddress *recipients, CamelException *ex)
 {
 	MapiItem *item = NULL;
-	const char *namep;
-	const char *addressp;
+	const gchar *namep;
+	const gchar *addressp;
 	mapi_id_t st = 0;
 
 	if (!camel_internet_address_get((CamelInternetAddress *)from, 0, &namep, &addressp)) {
@@ -93,12 +92,11 @@ mapi_send_to (CamelTransport *transport, CamelMimeMessage *message,
 		camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,_("Could not send message."));
 		return FALSE;
 	}
-	
+
 	return TRUE;
 }
 
-
-static char*
+static gchar *
 mapi_transport_get_name(CamelService *service, gboolean brief)
 {
 	if (brief) {
@@ -111,7 +109,6 @@ mapi_transport_get_name(CamelService *service, gboolean brief)
 	}
 }
 
-
 static void
 camel_mapi_transport_class_init(CamelMapiTransportClass *camel_mapi_transport_class)
 {
@@ -119,7 +116,7 @@ camel_mapi_transport_class_init(CamelMapiTransportClass *camel_mapi_transport_cl
 		CAMEL_TRANSPORT_CLASS (camel_mapi_transport_class);
 	CamelServiceClass *camel_service_class =
 		CAMEL_SERVICE_CLASS (camel_mapi_transport_class);
-  
+
 	camel_service_class->get_name = mapi_transport_get_name;
 	camel_transport_class->send_to = mapi_send_to;
 }
@@ -134,7 +131,7 @@ CamelType
 camel_mapi_transport_get_type (void)
 {
 	static CamelType camel_mapi_transport_type = CAMEL_INVALID_TYPE;
-  
+
 	if (camel_mapi_transport_type == CAMEL_INVALID_TYPE) {
 		camel_mapi_transport_type =
 			camel_type_register (CAMEL_TRANSPORT_TYPE,
diff --git a/src/camel/camel-mapi-transport.h b/src/camel/camel-mapi-transport.h
index c9210b7..d2d9992 100644
--- a/src/camel/camel-mapi-transport.h
+++ b/src/camel/camel-mapi-transport.h
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -37,17 +37,15 @@ G_BEGIN_DECLS
 
 typedef struct {
 	CamelTransport parent_object;
-	gboolean connected ;
+	gboolean connected;
 
 } CamelMapiTransport;
 
-
 typedef struct {
 	CamelTransportClass parent_class;
 
 } CamelMapiTransportClass;
 
-
 /* Standard Camel function */
 CamelType camel_mapi_transport_get_type (void);
 
diff --git a/src/camel/camel-mapi-utils.c b/src/camel/camel-mapi-utils.c
index 5689ae0..a74f544 100644
--- a/src/camel/camel-mapi-utils.c
+++ b/src/camel/camel-mapi-utils.c
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -21,7 +21,6 @@
  *
  */
 
-
 /* -- Generate MIME to ITEM -- */
 
 #include <string.h>
@@ -45,15 +44,15 @@
 #define STREAM_SIZE 4000
 
 static void
-mapi_item_add_recipient (const char *recipients, OlMailRecipientType type, GSList **recipient_list)
+mapi_item_add_recipient (const gchar *recipients, OlMailRecipientType type, GSList **recipient_list)
 {
 	ExchangeMAPIRecipient *recipient;
 	uint32_t val = 0;
 	uint8_t bVal;
-	const char *str = NULL;
+	const gchar *str = NULL;
 
 	if (!recipients)
-		return ;
+		return;
 
 	recipient = g_new0 (ExchangeMAPIRecipient, 1);
 
@@ -64,27 +63,27 @@ mapi_item_add_recipient (const char *recipients, OlMailRecipientType type, GSLis
 	recipient->in.req_cValues = 2;
 	recipient->in.req_lpProps = g_new0 (struct SPropValue, recipient->in.req_cValues + 1);
 
-	set_SPropValue_proptag (&(recipient->in.req_lpProps[0]), PR_RECIPIENT_TYPE, (const void *) &type);
+	set_SPropValue_proptag (&(recipient->in.req_lpProps[0]), PR_RECIPIENT_TYPE, (gconstpointer ) &type);
 
 	val = 0;
-	set_SPropValue_proptag (&(recipient->in.req_lpProps[1]), PR_SEND_INTERNET_ENCODING, (const void *)&val);
+	set_SPropValue_proptag (&(recipient->in.req_lpProps[1]), PR_SEND_INTERNET_ENCODING, (gconstpointer )&val);
 
 	/* External recipient properties - set them only when the recipient is unresolved */
 	recipient->in.ext_cValues = 8;
 	recipient->in.ext_lpProps = g_new0 (struct SPropValue, recipient->in.ext_cValues + 1);
 
 	val = DT_MAILUSER;
-	set_SPropValue_proptag (&(recipient->in.ext_lpProps[0]), PR_DISPLAY_TYPE, (const void *)&val);
+	set_SPropValue_proptag (&(recipient->in.ext_lpProps[0]), PR_DISPLAY_TYPE, (gconstpointer )&val);
 	val = MAPI_MAILUSER;
-	set_SPropValue_proptag (&(recipient->in.ext_lpProps[1]), PR_OBJECT_TYPE, (const void *)&val);
+	set_SPropValue_proptag (&(recipient->in.ext_lpProps[1]), PR_OBJECT_TYPE, (gconstpointer )&val);
 	str = "SMTP";
-	set_SPropValue_proptag (&(recipient->in.ext_lpProps[2]), PR_ADDRTYPE, (const void *)(str));
+	set_SPropValue_proptag (&(recipient->in.ext_lpProps[2]), PR_ADDRTYPE, (gconstpointer )(str));
 	str = recipient->email_id;
-	set_SPropValue_proptag (&(recipient->in.ext_lpProps[3]), PR_SMTP_ADDRESS, (const void *)(str));
+	set_SPropValue_proptag (&(recipient->in.ext_lpProps[3]), PR_SMTP_ADDRESS, (gconstpointer )(str));
 	/* FIXME: Please add the correct names here instead of the e-mail ID */
-	set_SPropValue_proptag (&(recipient->in.ext_lpProps[4]), PR_GIVEN_NAME, (const void *)(str));
-	set_SPropValue_proptag (&(recipient->in.ext_lpProps[5]), PR_DISPLAY_NAME, (const void *)(str));
-	set_SPropValue_proptag (&(recipient->in.ext_lpProps[6]), PR_7BIT_DISPLAY_NAME, (const void *)(str));
+	set_SPropValue_proptag (&(recipient->in.ext_lpProps[4]), PR_GIVEN_NAME, (gconstpointer )(str));
+	set_SPropValue_proptag (&(recipient->in.ext_lpProps[5]), PR_DISPLAY_NAME, (gconstpointer )(str));
+	set_SPropValue_proptag (&(recipient->in.ext_lpProps[6]), PR_7BIT_DISPLAY_NAME, (gconstpointer )(str));
 
 	bVal = FALSE;
 	set_SPropValue_proptag (&(recipient->in.ext_lpProps[7]), PR_SEND_RICH_INFO, &bVal);
@@ -93,7 +92,7 @@ mapi_item_add_recipient (const char *recipients, OlMailRecipientType type, GSLis
 }
 
 static void
-mapi_item_set_from(MapiItem *item, const char *from)
+mapi_item_set_from(MapiItem *item, const gchar *from)
 {
 	if (item->header.from)
 		g_free (item->header.from);
@@ -102,7 +101,7 @@ mapi_item_set_from(MapiItem *item, const char *from)
 }
 
 static void
-mapi_item_set_subject(MapiItem *item, const char *subject)
+mapi_item_set_subject(MapiItem *item, const gchar *subject)
 {
 	if (item->header.subject)
 		g_free (item->header.subject);
@@ -124,7 +123,7 @@ mapi_item_set_body_stream (MapiItem *item, CamelStream *body, MapiItemPartType p
 
 	stream->value = g_byte_array_new ();
 
-	while (read_size = camel_stream_read (body, (char *)buf, STREAM_SIZE), read_size > 0){
+	while (read_size = camel_stream_read (body, (gchar *)buf, STREAM_SIZE), read_size > 0) {
 		stream->value = g_byte_array_append (stream->value, buf, read_size);
 
 		is_null_terminated = buf [read_size - 1] == 0;
@@ -183,71 +182,71 @@ mapi_item_add_attach (MapiItem *item, CamelMimePart *part, CamelStream *content_
 	CamelContentType *content_type;
 
 	ExchangeMAPIAttachment *item_attach;
-	ExchangeMAPIStream *stream; 
+	ExchangeMAPIStream *stream;
 
 	const gchar *filename = camel_mime_part_get_filename (part);
-	
+
 	item_attach = g_new0 (ExchangeMAPIAttachment, 1);
 
 	item_attach->lpProps = g_new0 (struct SPropValue, 6 + 1);
 
-	flag = ATTACH_BY_VALUE; 
-	set_SPropValue_proptag(&(item_attach->lpProps[i++]), PR_ATTACH_METHOD, (const void *) (&flag));
+	flag = ATTACH_BY_VALUE;
+	set_SPropValue_proptag(&(item_attach->lpProps[i++]), PR_ATTACH_METHOD, (gconstpointer ) (&flag));
 
-	/* MSDN Documentation: When the supplied offset is -1 (0xFFFFFFFF), the 
-	 * attachment is not rendered using the PR_RENDERING_POSITION property. 
-	 * All values other than -1 indicate the position within PR_BODY at which 
-	 * the attachment is to be rendered. 
+	/* MSDN Documentation: When the supplied offset is -1 (0xFFFFFFFF), the
+	 * attachment is not rendered using the PR_RENDERING_POSITION property.
+	 * All values other than -1 indicate the position within PR_BODY at which
+	 * the attachment is to be rendered.
 	 */
 	flag = 0xFFFFFFFF;
-	set_SPropValue_proptag(&(item_attach->lpProps[i++]), PR_RENDERING_POSITION, (const void *) (&flag));
+	set_SPropValue_proptag(&(item_attach->lpProps[i++]), PR_RENDERING_POSITION, (gconstpointer ) (&flag));
 
 	if (filename) {
-		set_SPropValue_proptag(&(item_attach->lpProps[i++]), 
+		set_SPropValue_proptag(&(item_attach->lpProps[i++]),
 				       PR_ATTACH_FILENAME,
-				       (const void *) g_strdup(filename));
+				       (gconstpointer ) g_strdup(filename));
 
-		set_SPropValue_proptag(&(item_attach->lpProps[i++]), 
-				       PR_ATTACH_LONG_FILENAME, 
-				       (const void *) g_strdup(filename));
+		set_SPropValue_proptag(&(item_attach->lpProps[i++]),
+				       PR_ATTACH_LONG_FILENAME,
+				       (gconstpointer ) g_strdup(filename));
 	}
 
 	/* mime type : multipart/related */
 	content_id = camel_mime_part_get_content_id (part);
 	if (content_id) {
-		set_SPropValue_proptag(&(item_attach->lpProps[i++]), 
+		set_SPropValue_proptag(&(item_attach->lpProps[i++]),
 				       PR_ATTACH_CONTENT_ID,
-				       (const void *) g_strdup(content_id));
+				       (gconstpointer ) g_strdup(content_id));
 	}
 
 	content_type  = camel_mime_part_get_content_type (part);
 	if (content_type) {
 		gchar *ct = camel_content_type_simple (content_type);
 		if (ct) {
-			set_SPropValue_proptag (&(item_attach->lpProps[i++]), 
+			set_SPropValue_proptag (&(item_attach->lpProps[i++]),
 					PR_ATTACH_MIME_TAG,
-					(const void *) ct);
+					(gconstpointer ) ct);
 		}
 	}
 
 	item_attach->cValues = i;
 
 	stream = g_new0 (ExchangeMAPIStream, 1);
-	stream->proptag = PR_ATTACH_DATA_BIN; 
+	stream->proptag = PR_ATTACH_DATA_BIN;
 	stream->value = g_byte_array_new ();
 
 	camel_seekable_stream_seek((CamelSeekableStream *)content_stream, 0, CAMEL_STREAM_SET);
-	while (read_size = camel_stream_read(content_stream, (char *)buf, STREAM_SIZE), read_size > 0) {
+	while (read_size = camel_stream_read(content_stream, (gchar *)buf, STREAM_SIZE), read_size > 0) {
 		stream->value = g_byte_array_append (stream->value, buf, read_size);
 	}
 
-	item_attach->streams = g_slist_append (item_attach->streams, stream); 
+	item_attach->streams = g_slist_append (item_attach->streams, stream);
 	item->attachments = g_slist_append(item->attachments, item_attach);
 
 	return TRUE;
 }
 
-static gboolean 
+static gboolean
 mapi_do_multipart (CamelMultipart *mp, MapiItem *item, gboolean *is_first)
 {
 	CamelDataWrapper *dw;
@@ -271,7 +270,7 @@ mapi_do_multipart (CamelMultipart *mp, MapiItem *item, gboolean *is_first)
 			/* recursive */
 			if (!mapi_do_multipart (CAMEL_MULTIPART (dw), item, is_first))
 				return FALSE;
-			continue ;
+			continue;
 		}
 		/* filename */
 		filename = camel_mime_part_get_filename(part);
@@ -283,7 +282,7 @@ mapi_do_multipart (CamelMultipart *mp, MapiItem *item, gboolean *is_first)
 
 		description = camel_mime_part_get_description(part);
 		content_id = camel_mime_part_get_content_id(part);
-		
+
 		type = camel_mime_part_get_content_type(part);
 
 		if (i_part == 0 && (*is_first) && camel_content_type_is (type, "text", "plain")) {
@@ -299,7 +298,6 @@ mapi_do_multipart (CamelMultipart *mp, MapiItem *item, gboolean *is_first)
 	return TRUE;
 }
 
-
 MapiItem *
 camel_mapi_utils_mime_to_item (CamelMimeMessage *message, CamelAddress *from, CamelException *ex)
 {
@@ -309,11 +307,11 @@ camel_mapi_utils_mime_to_item (CamelMimeMessage *message, CamelAddress *from, Ca
 	CamelMultipart *multipart;
 	CamelInternetAddress *to, *cc, *bcc;
 	MapiItem *item = g_new0 (MapiItem, 1);
-	const char *namep;
-	const char *addressp;
-	const char *content_type;		
+	const gchar *namep;
+	const gchar *addressp;
+	const gchar *content_type;
 
-	ssize_t	content_size;
+	gssize	content_size;
 	GSList *recipient_list = NULL;
 	gint i = 0;
 
@@ -333,7 +331,7 @@ camel_mapi_utils_mime_to_item (CamelMimeMessage *message, CamelAddress *from, Ca
 	mapi_item_set_from (item, namep);
 
 	to = camel_mime_message_get_recipients(message, CAMEL_RECIPIENT_TYPE_TO);
-	for (i = 0; to && camel_internet_address_get (to, i, &namep, &addressp); i++){
+	for (i = 0; to && camel_internet_address_get (to, i, &namep, &addressp); i++) {
 		mapi_item_add_recipient (addressp, olTo, &recipient_list);
 	}
 
@@ -346,7 +344,7 @@ camel_mapi_utils_mime_to_item (CamelMimeMessage *message, CamelAddress *from, Ca
 	for (i = 0; bcc && camel_internet_address_get (bcc, i, &namep, &addressp); i++) {
 		mapi_item_add_recipient (addressp, olBCC, &recipient_list);
 	}
-	
+
 	if (camel_mime_message_get_subject(message)) {
 		mapi_item_set_subject(item, camel_mime_message_get_subject(message));
 	}
@@ -362,7 +360,7 @@ camel_mapi_utils_mime_to_item (CamelMimeMessage *message, CamelAddress *from, Ca
 	if (CAMEL_IS_MULTIPART(multipart)) {
 		gboolean is_first = TRUE;
 		if (!mapi_do_multipart (CAMEL_MULTIPART(multipart), item, &is_first))
-			printf("camel message multi part error\n"); 
+			printf("camel message multi part error\n");
 	} else {
 		dw = camel_medium_get_content (CAMEL_MEDIUM (message));
 		if (dw) {
@@ -377,7 +375,7 @@ camel_mapi_utils_mime_to_item (CamelMimeMessage *message, CamelAddress *from, Ca
 	}
 
 	item->recipients = recipient_list;
-	
+
 	return item;
 }
 
@@ -391,7 +389,7 @@ camel_mapi_utils_create_item_build_props (struct SPropValue **value, struct SPro
 	bool *send_rich_info = g_new0 (bool, 1);
 	uint32_t *msgflag = g_new0 (uint32_t, 1);
 	uint32_t *cpid = g_new0 (uint32_t, 1);
-	int i=0;
+	gint i=0;
 
 	props = g_new0 (struct SPropValue, 11 + 1);
 
@@ -402,10 +400,10 @@ camel_mapi_utils_create_item_build_props (struct SPropValue **value, struct SPro
 	set_SPropValue_proptag(&props[i++], PR_NORMALIZED_SUBJECT_UNICODE, g_strdup (item->header.subject));
 
 	*send_rich_info = false;
-	set_SPropValue_proptag(&props[i++], PR_SEND_RICH_INFO, (const void *) send_rich_info);
+	set_SPropValue_proptag(&props[i++], PR_SEND_RICH_INFO, (gconstpointer ) send_rich_info);
 
 	*msgflag = MSGFLAG_UNSENT;
-	set_SPropValue_proptag(&props[i++], PR_MESSAGE_FLAGS, (void *)msgflag);
+	set_SPropValue_proptag(&props[i++], PR_MESSAGE_FLAGS, (gpointer)msgflag);
 
 	/* Message threading information */
 	if (item->header.references)
@@ -424,14 +422,14 @@ camel_mapi_utils_create_item_build_props (struct SPropValue **value, struct SPro
 		bin->cb = stream->value->len;
 		bin->lpb = (uint8_t *)stream->value->data;
 		if (stream->proptag == PR_HTML)
-			set_SPropValue_proptag(&props[i++], stream->proptag, (void *)bin);
+			set_SPropValue_proptag(&props[i++], stream->proptag, (gpointer)bin);
 		else if (stream->proptag == PR_BODY_UNICODE)
-			set_SPropValue_proptag(&props[i++], stream->proptag, (void *)stream->value->data);
+			set_SPropValue_proptag(&props[i++], stream->proptag, (gpointer)stream->value->data);
 	}
 
 	/*  FIXME : */
 	/* editor = EDITOR_FORMAT_PLAINTEXT; */
-	/* set_SPropValue_proptag(&props[i++], PR_MSG_EDITOR_FORMAT, (const void *)editor); */
+	/* set_SPropValue_proptag(&props[i++], PR_MSG_EDITOR_FORMAT, (gconstpointer )editor); */
 
 	*value = props;
 	return i;
diff --git a/src/camel/camel-mapi-utils.h b/src/camel/camel-mapi-utils.h
index 633851d..2f1d7f1 100644
--- a/src/camel/camel-mapi-utils.h
+++ b/src/camel/camel-mapi-utils.h
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -30,7 +30,7 @@ MapiItem *
 camel_mapi_utils_mime_to_item (CamelMimeMessage *message, CamelAddress *from, CamelException *ex);
 
 gint
-camel_mapi_utils_create_item_build_props (struct SPropValue **value, 
+camel_mapi_utils_create_item_build_props (struct SPropValue **value,
 					  struct SPropTagArray *SPropTagArray,
 					  gpointer data);
 
diff --git a/src/camel/camel-private.h b/src/camel/camel-private.h
index e4d56b0..7d4f960 100644
--- a/src/camel/camel-private.h
+++ b/src/camel/camel-private.h
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -39,7 +39,7 @@ struct _CamelFolderPrivate {
 	GStaticRecMutex lock;
 	GStaticMutex change_lock;
 	/* must require the 'change_lock' to access this */
-	int frozen;
+	gint frozen;
 	struct _CamelFolderChangeInfo *changed_frozen; /* queues changed events */
 };
 
@@ -52,7 +52,6 @@ struct _CamelFolderPrivate {
 #define CAMEL_FOLDER_REC_UNLOCK(f, l) \
 	(g_static_rec_mutex_unlock(&((CamelFolder *)f)->priv->l))
 
-
 struct _CamelStorePrivate {
 	GStaticRecMutex folder_lock;	/* for locking folder operations */
 };
@@ -62,7 +61,6 @@ struct _CamelStorePrivate {
 #define CAMEL_STORE_UNLOCK(f, l) \
 	(g_static_rec_mutex_unlock(&((CamelStore *)f)->priv->l))
 
-
 struct _CamelTransportPrivate {
 	GMutex *send_lock;   /* for locking send operations */
 };
@@ -70,7 +68,6 @@ struct _CamelTransportPrivate {
 #define CAMEL_TRANSPORT_LOCK(f, l) (g_mutex_lock(((CamelTransport *)f)->priv->l))
 #define CAMEL_TRANSPORT_UNLOCK(f, l) (g_mutex_unlock(((CamelTransport *)f)->priv->l))
 
-
 struct _CamelServicePrivate {
 	GStaticRecMutex connect_lock;	/* for locking connection operations */
 	GStaticMutex connect_op_lock;	/* for locking the connection_op */
@@ -85,12 +82,11 @@ struct _CamelServicePrivate {
 #define CAMEL_SERVICE_REC_UNLOCK(f, l) \
 	(g_static_rec_mutex_unlock(&((CamelService *)f)->priv->l))
 
-
 struct _CamelSessionPrivate {
 	GMutex *lock;		/* for locking everything basically */
 	GMutex *thread_lock;	/* locking threads */
 
-	int thread_id;
+	gint thread_id;
 	GHashTable *thread_active;
 	GThreadPool *thread_pool;
 
@@ -100,7 +96,6 @@ struct _CamelSessionPrivate {
 #define CAMEL_SESSION_LOCK(f, l) (g_mutex_lock(((CamelSession *)f)->priv->l))
 #define CAMEL_SESSION_UNLOCK(f, l) (g_mutex_unlock(((CamelSession *)f)->priv->l))
 
-
 /* most of this stuff really is private, but the lock can be used by subordinate classes */
 struct _CamelFolderSummaryPrivate {
 	GHashTable *filter_charset;	/* CamelMimeFilterCharset's indexed by source charset */
@@ -115,7 +110,7 @@ struct _CamelFolderSummaryPrivate {
 	struct _CamelStreamFilter *filter_stream;
 
 	struct _CamelIndex *index;
-	
+
 	GMutex *summary_lock;	/* for the summary hashtable/array */
 	GMutex *io_lock;	/* load/save lock, for access to saved_count, etc */
 	GMutex *filter_lock;	/* for accessing any of the filtering/indexing stuff, since we share them */
@@ -126,7 +121,6 @@ struct _CamelFolderSummaryPrivate {
 #define CAMEL_SUMMARY_LOCK(f, l) (g_mutex_lock(((CamelFolderSummary *)f)->priv->l))
 #define CAMEL_SUMMARY_UNLOCK(f, l) (g_mutex_unlock(((CamelFolderSummary *)f)->priv->l))
 
-
 struct _CamelStoreSummaryPrivate {
 	GMutex *summary_lock;	/* for the summary hashtable/array */
 	GMutex *io_lock;	/* load/save lock, for access to saved_count, etc */
@@ -137,11 +131,10 @@ struct _CamelStoreSummaryPrivate {
 #define CAMEL_STORE_SUMMARY_LOCK(f, l) (g_mutex_lock(((CamelStoreSummary *)f)->priv->l))
 #define CAMEL_STORE_SUMMARY_UNLOCK(f, l) (g_mutex_unlock(((CamelStoreSummary *)f)->priv->l))
 
-
 struct _CamelVeeFolderPrivate {
 	GList *folders;			/* lock using subfolder_lock before changing/accessing */
 	GList *folders_changed;		/* for list of folders that have changed between updates */
-	
+
 	GMutex *summary_lock;		/* for locking vfolder summary */
 	GMutex *subfolder_lock;		/* for locking the subfolder list */
 	GMutex *changed_lock;		/* for locking the folders-changed list */
@@ -150,7 +143,6 @@ struct _CamelVeeFolderPrivate {
 #define CAMEL_VEE_FOLDER_LOCK(f, l) (g_mutex_lock(((CamelVeeFolder *)f)->priv->l))
 #define CAMEL_VEE_FOLDER_UNLOCK(f, l) (g_mutex_unlock(((CamelVeeFolder *)f)->priv->l))
 
-
 struct _CamelDataWrapperPrivate {
 	pthread_mutex_t stream_lock;
 };
@@ -158,7 +150,6 @@ struct _CamelDataWrapperPrivate {
 #define CAMEL_DATA_WRAPPER_LOCK(dw, l)   (pthread_mutex_lock(&((CamelDataWrapper *)dw)->priv->l))
 #define CAMEL_DATA_WRAPPER_UNLOCK(dw, l) (pthread_mutex_unlock(&((CamelDataWrapper *)dw)->priv->l))
 
-
 /* most of this stuff really is private, but the lock can be used by subordinate classes */
 struct _CamelCertDBPrivate {
 	GMutex *db_lock;	/* for the db hashtable/array */
@@ -171,11 +162,11 @@ struct _CamelCertDBPrivate {
 #define CAMEL_CERTDB_UNLOCK(db, l) (g_mutex_unlock (((CamelCertDB *) db)->priv->l))
 
 #ifdef G_OS_WIN32
-int fsync (int fd);
+gint fsync (gint fd);
 
-const char *_camel_get_localedir (void) G_GNUC_CONST;
-const char *_camel_get_libexecdir (void) G_GNUC_CONST;
-const char *_camel_get_providerdir (void) G_GNUC_CONST;
+const gchar *_camel_get_localedir (void) G_GNUC_CONST;
+const gchar *_camel_get_libexecdir (void) G_GNUC_CONST;
+const gchar *_camel_get_providerdir (void) G_GNUC_CONST;
 
 #undef EVOLUTION_LOCALEDIR
 #define EVOLUTION_LOCALEDIR _camel_get_localedir ()
diff --git a/src/libexchangemapi/exchange-mapi-cal-recur-utils.c b/src/libexchangemapi/exchange-mapi-cal-recur-utils.c
index 2b45775..bfadf38 100644
--- a/src/libexchangemapi/exchange-mapi-cal-recur-utils.c
+++ b/src/libexchangemapi/exchange-mapi-cal-recur-utils.c
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -28,71 +28,71 @@
 #include "exchange-mapi-cal-recur-utils.h"
 
 /* Reader/Writer versions */
-#define READER_VERSION 	0x3004
-#define WRITER_VERSION 	0x3004
+#define READER_VERSION	0x3004
+#define WRITER_VERSION	0x3004
 #define READER_VERSION2 0x3006
 #define WRITER_VERSION2 0x3009
 
 #if 0
 struct ChangeHighlight {
-	uint32_t Size; 
-	uint32_t Value; 
-	uint32_t Reserved; 
+	uint32_t Size;
+	uint32_t Value;
+	uint32_t Reserved;
 };
 
 struct ExtendedException {
-	struct ChangeHighlight ch; 
+	struct ChangeHighlight ch;
 	uint32_t ReservedEE1Size;
 	uint32_t ReservedEE1;
-	uint32_t StartDateTime; 
-	uint32_t EndDateTime; 
-	uint32_t OrigStartDate; 
-	uint16_t WideCharSubjectLength; 
-	gchar *WideCharSubject; 
-	uint16_t WideCharLocationLength; 
-	gchar *WideCharLocation; 
+	uint32_t StartDateTime;
+	uint32_t EndDateTime;
+	uint32_t OrigStartDate;
+	uint16_t WideCharSubjectLength;
+	gchar *WideCharSubject;
+	uint16_t WideCharLocationLength;
+	gchar *WideCharLocation;
 	uint32_t ReservedEE2Size;
 	uint32_t ReservedEE2;
 };
 
 struct ExceptionInfo {
-	uint32_t StartDateTime; 
-	uint32_t EndDateTime; 
-	uint32_t OrigStartDate; 
-	uint16_t OverrideFlags; 
-	uint16_t SubjectLength; 
-	uint16_t SubjectLength2; 
-	gchar *Subject; 
-	uint32_t MeetingType; 
-	uint32_t ReminderDelta; 
-	uint32_t ReminderSet; 
-	uint16_t LocationLength; 
-	uint16_t LocationLength2; 
-	gchar *Location; 
-	uint32_t BusyStatus; 
-	uint32_t Attachment; 
-	uint32_t SubType; 
-	uint32_t AppointmentColor; 
+	uint32_t StartDateTime;
+	uint32_t EndDateTime;
+	uint32_t OrigStartDate;
+	uint16_t OverrideFlags;
+	uint16_t SubjectLength;
+	uint16_t SubjectLength2;
+	gchar *Subject;
+	uint32_t MeetingType;
+	uint32_t ReminderDelta;
+	uint32_t ReminderSet;
+	uint16_t LocationLength;
+	uint16_t LocationLength2;
+	gchar *Location;
+	uint32_t BusyStatus;
+	uint32_t Attachment;
+	uint32_t SubType;
+	uint32_t AppointmentColor;
 };
 #endif
 
-static icalrecurrencetype_weekday 
-get_ical_weekstart (uint32_t fdow) 
+static icalrecurrencetype_weekday
+get_ical_weekstart (uint32_t fdow)
 {
 	switch (fdow) {
-		case FirstDOW_Sunday 	: return ICAL_SUNDAY_WEEKDAY;
-		case FirstDOW_Monday 	: return ICAL_MONDAY_WEEKDAY;
-		case FirstDOW_Tuesday 	: return ICAL_TUESDAY_WEEKDAY;
+		case FirstDOW_Sunday	: return ICAL_SUNDAY_WEEKDAY;
+		case FirstDOW_Monday	: return ICAL_MONDAY_WEEKDAY;
+		case FirstDOW_Tuesday	: return ICAL_TUESDAY_WEEKDAY;
 		case FirstDOW_Wednesday : return ICAL_WEDNESDAY_WEEKDAY;
-		case FirstDOW_Thursday 	: return ICAL_THURSDAY_WEEKDAY;
-		case FirstDOW_Friday 	: return ICAL_FRIDAY_WEEKDAY;
-		case FirstDOW_Saturday 	: return ICAL_SATURDAY_WEEKDAY;
-		default 		: return ICAL_SUNDAY_WEEKDAY;
+		case FirstDOW_Thursday	: return ICAL_THURSDAY_WEEKDAY;
+		case FirstDOW_Friday	: return ICAL_FRIDAY_WEEKDAY;
+		case FirstDOW_Saturday	: return ICAL_SATURDAY_WEEKDAY;
+		default			: return ICAL_SUNDAY_WEEKDAY;
 	}
 }
 
-static uint32_t 
-get_mapi_weekstart (icalrecurrencetype_weekday weekstart) 
+static uint32_t
+get_mapi_weekstart (icalrecurrencetype_weekday weekstart)
 {
 	switch (weekstart) {
 		case ICAL_SUNDAY_WEEKDAY   : return FirstDOW_Sunday;
@@ -102,11 +102,11 @@ get_mapi_weekstart (icalrecurrencetype_weekday weekstart)
 		case ICAL_THURSDAY_WEEKDAY : return FirstDOW_Thursday;
 		case ICAL_FRIDAY_WEEKDAY   : return FirstDOW_Friday;
 		case ICAL_SATURDAY_WEEKDAY : return FirstDOW_Saturday;
-		default 		   : return FirstDOW_Sunday;
+		default			   : return FirstDOW_Sunday;
 	}
 }
 
-static uint32_t 
+static uint32_t
 get_mapi_day (icalrecurrencetype_weekday someday)
 {
 	switch (someday) {
@@ -117,31 +117,31 @@ get_mapi_day (icalrecurrencetype_weekday someday)
 		case ICAL_THURSDAY_WEEKDAY : return olThursday;
 		case ICAL_FRIDAY_WEEKDAY   : return olFriday;
 		case ICAL_SATURDAY_WEEKDAY : return olSaturday;
-		default 		   : return 0;
+		default			   : return 0;
 	}
 }
 
-static int32_t 
-get_ical_pos (uint32_t pos) 
+static int32_t
+get_ical_pos (uint32_t pos)
 {
 	switch (pos) {
-		case RecurrenceN_First 	: return 1;
+		case RecurrenceN_First	: return 1;
 		case RecurrenceN_Second : return 2;
-		case RecurrenceN_Third 	: return 3;
+		case RecurrenceN_Third	: return 3;
 		case RecurrenceN_Fourth : return 4;
-		case RecurrenceN_Last 	: return (-1);
-		default 		: return 0;
+		case RecurrenceN_Last	: return (-1);
+		default			: return 0;
 	}
 }
 
-static uint32_t 
-get_mapi_pos (int32_t pos) 
+static uint32_t
+get_mapi_pos (int32_t pos)
 {
 	switch (pos) {
-		case 1 	: return RecurrenceN_First;
-		case 2 	: return RecurrenceN_Second;
-		case 3 	: return RecurrenceN_Third;
-		case 4 	: return RecurrenceN_Fourth;
+		case 1	: return RecurrenceN_First;
+		case 2	: return RecurrenceN_Second;
+		case 3	: return RecurrenceN_Third;
+		case 4	: return RecurrenceN_Fourth;
 		case -1 : return RecurrenceN_Last;
 		default : return 0;
 	}
@@ -153,12 +153,12 @@ get_mapi_pos (int32_t pos)
 static void
 convert_recurrence_minutes_to_date (uint32_t minutes, struct FILETIME *ft)
 {
-	NTTIME nt; 
+	NTTIME nt;
 
-	nt = (NTTIME) minutes * (60 * cFileTimeUnitsPerSecond); 
+	nt = (NTTIME) minutes * (60 * cFileTimeUnitsPerSecond);
 
-	ft->dwLowDateTime = (uint32_t)((nt << 32) >> 32); 
-	ft->dwHighDateTime = (uint32_t)(nt >> 32); 
+	ft->dwLowDateTime = (uint32_t)((nt << 32) >> 32);
+	ft->dwHighDateTime = (uint32_t)(nt >> 32);
 }
 
 static uint32_t
@@ -166,19 +166,19 @@ convert_date_to_recurrence_minutes (const struct FILETIME *ft)
 {
 	NTTIME minutes;
 
-	minutes = ft->dwHighDateTime; 
+	minutes = ft->dwHighDateTime;
 	minutes = minutes << 32;
 	minutes |= ft->dwLowDateTime;
 
-	minutes = minutes / (60 * cFileTimeUnitsPerSecond); 
+	minutes = minutes / (60 * cFileTimeUnitsPerSecond);
 
 	return (uint32_t)(minutes);
 }
 
-static time_t 
+static time_t
 convert_filetime_to_timet (const struct FILETIME *ft)
 {
-	NTTIME time; 
+	NTTIME time;
 
 	time = ft->dwHighDateTime;
 	time = time << 32;
@@ -187,24 +187,24 @@ convert_filetime_to_timet (const struct FILETIME *ft)
 	return nt_time_to_unix (time);
 }
 
-static void 
+static void
 convert_timet_to_filetime (time_t t, struct FILETIME *ft)
 {
-	NTTIME nt; 
+	NTTIME nt;
 
 	unix_to_nt_time (&nt, t);
 
-	ft->dwLowDateTime = (uint32_t)((nt << 32) >> 32); 
-	ft->dwHighDateTime = (uint32_t)(nt >> 32); 
+	ft->dwLowDateTime = (uint32_t)((nt << 32) >> 32);
+	ft->dwHighDateTime = (uint32_t)(nt >> 32);
 }
 #endif
 
 static time_t
 convert_recurrence_minutes_to_timet (uint32_t minutes)
 {
-	NTTIME nt; 
+	NTTIME nt;
 
-	nt = (NTTIME) minutes * (60 * cFileTimeUnitsPerSecond); 
+	nt = (NTTIME) minutes * (60 * cFileTimeUnitsPerSecond);
 
 	return nt_time_to_unix (nt);
 }
@@ -216,20 +216,20 @@ convert_timet_to_recurrence_minutes (time_t t)
 
 	unix_to_nt_time (&minutes, t);
 
-	minutes = minutes / (60 * cFileTimeUnitsPerSecond); 
+	minutes = minutes / (60 * cFileTimeUnitsPerSecond);
 
 	return (uint32_t)(minutes);
 }
 
-static gboolean 
-check_calendar_type (guint16 type) 
+static gboolean
+check_calendar_type (guint16 type)
 {
 	/* Calendar Type - We support Gregorian only. */
 	if (type == CAL_DEFAULT || type == CAL_GREGORIAN)
-		return TRUE; 
+		return TRUE;
 	else {
-		g_warning ("Calendar type = 0x%04X - Evolution does not handle such calendar types.", type); 
-		return FALSE; 
+		g_warning ("Calendar type = 0x%04X - Evolution does not handle such calendar types.", type);
+		return FALSE;
 	}
 }
 
@@ -242,7 +242,7 @@ exchange_mapi_cal_util_bin_to_rrule (GByteArray *ba, ECalComponent *comp)
 	guint8 *ptr = ba->data;
 	gint i;
 	GSList *exdate_list = NULL;
-	gboolean repeats_until_date = FALSE; 
+	gboolean repeats_until_date = FALSE;
 
 	icalrecurrencetype_clear (&rt);
 
@@ -299,7 +299,7 @@ exchange_mapi_cal_util_bin_to_rrule (GByteArray *ba, ECalComponent *comp)
 			if (!check_calendar_type (flag16))
 				return FALSE;
 
-	/* NOTE: Evolution does not handle daily-every-weekday any different 
+	/* NOTE: Evolution does not handle daily-every-weekday any different
 	 * from a weekly recurrence.
 	 */
 			rt.freq = ICAL_WEEKLY_RECURRENCE;
@@ -399,7 +399,7 @@ exchange_mapi_cal_util_bin_to_rrule (GByteArray *ba, ECalComponent *comp)
 				return FALSE;
 
 			/* FIXME: we don't handle regenerating tasks */
-			g_warning ("Evolution does not handle recurring tasks."); 
+			g_warning ("Evolution does not handle recurring tasks.");
 			return FALSE;
 		}
 
@@ -409,7 +409,7 @@ exchange_mapi_cal_util_bin_to_rrule (GByteArray *ba, ECalComponent *comp)
 		flag16 = *((guint16 *)ptr);
 		ptr += sizeof (guint16);
 		if (flag16 == PatternType_Month || flag16 == PatternType_MonthEnd) {
-			guint16 pattern = flag16; 
+			guint16 pattern = flag16;
 			/* Monthly every N months on day D or last day. */
 
 			/* Calendar Type */
@@ -433,7 +433,7 @@ exchange_mapi_cal_util_bin_to_rrule (GByteArray *ba, ECalComponent *comp)
 			if (flag32)
 				return FALSE;
 
-			/* MONTH_DAY */ 
+			/* MONTH_DAY */
 			flag32 = *((guint32 *)ptr);
 			ptr += sizeof (guint32);
 			if (pattern == PatternType_Month)
@@ -442,7 +442,7 @@ exchange_mapi_cal_util_bin_to_rrule (GByteArray *ba, ECalComponent *comp)
 				rt.by_month_day[0] = (short) (-1);
 
 		} else if (flag16 == PatternType_MonthNth) {
-			gboolean post_process = FALSE; 
+			gboolean post_process = FALSE;
 			guint32 mask = 0;
 			/* Monthly every N months on the Xth Y */
 
@@ -466,7 +466,7 @@ exchange_mapi_cal_util_bin_to_rrule (GByteArray *ba, ECalComponent *comp)
 			ptr += sizeof (guint32);
 			if (flag32)
 				return FALSE;
-			
+
 			/* BITMASK */
 			flag32 = *((guint32 *)ptr);
 			ptr += sizeof (guint32);
@@ -485,25 +485,25 @@ exchange_mapi_cal_util_bin_to_rrule (GByteArray *ba, ECalComponent *comp)
 			else if (flag32 == olSaturday)
 				rt.by_day[0] = ICAL_SATURDAY_WEEKDAY;
 			else {
-				post_process = TRUE; 
-				mask = flag32; 
+				post_process = TRUE;
+				mask = flag32;
 			}
-				
+
 			/* RecurrenceN */
 			flag32 = *((guint32 *)ptr);
 			ptr += sizeof (guint32);
 			if (!post_process) {
-				rt.by_set_pos[0] = get_ical_pos (flag32); 
+				rt.by_set_pos[0] = get_ical_pos (flag32);
 				if (rt.by_set_pos[0] == 0)
-					return FALSE; 
+					return FALSE;
 			} else {
 				if (mask == (olSunday | olMonday | olTuesday | olWednesday | olThursday | olFriday | olSaturday)) {
-					rt.by_month_day[0] = get_ical_pos (flag32); 
+					rt.by_month_day[0] = get_ical_pos (flag32);
 					if (rt.by_month_day[0] == 0)
-						return FALSE; 
+						return FALSE;
 				} else {
 				/* FIXME: Can we/LibICAL support any other types here? Namely, weekday and weekend-day */
-					g_warning ("Encountered a recurrence type Evolution cannot handle. "); 
+					g_warning ("Encountered a recurrence type Evolution cannot handle. ");
 					return FALSE;
 				}
 			}
@@ -579,7 +579,7 @@ exchange_mapi_cal_util_bin_to_rrule (GByteArray *ba, ECalComponent *comp)
 			/* TODO: Add support for this kinda recurrence in Evolution */
 			return FALSE;
 		}
-	} else 
+	} else
 		return FALSE;
 
 	/* End Type - followed by Occurence count */
@@ -610,22 +610,22 @@ exchange_mapi_cal_util_bin_to_rrule (GByteArray *ba, ECalComponent *comp)
 	ptr += sizeof (guint32);
 	if (flag32) {
 		for (i = 0; i < flag32; ++i) {
-			uint32_t exdate; 
-			struct icaltimetype tt, *val; 
-			ECalComponentDateTime *dt = g_new0 (ECalComponentDateTime, 1); 
+			uint32_t exdate;
+			struct icaltimetype tt, *val;
+			ECalComponentDateTime *dt = g_new0 (ECalComponentDateTime, 1);
 
 			exdate = *((guint32 *)ptr);
 			ptr += sizeof (guint32);
 
 			tt = icaltime_from_timet_with_zone (convert_recurrence_minutes_to_timet (exdate), 1, 0);
 
-			val = g_new0(struct icaltimetype, 1); 
-			memcpy (val, &tt, sizeof(struct icaltimetype)); 
+			val = g_new0(struct icaltimetype, 1);
+			memcpy (val, &tt, sizeof(struct icaltimetype));
 
-			dt->value = val; 
-			dt->tzid = g_strdup ("UTC"); 
+			dt->value = val;
+			dt->tzid = g_strdup ("UTC");
 
-			exdate_list = g_slist_append (exdate_list, dt); 
+			exdate_list = g_slist_append (exdate_list, dt);
 		}
 	}
 
@@ -633,9 +633,9 @@ exchange_mapi_cal_util_bin_to_rrule (GByteArray *ba, ECalComponent *comp)
 	flag32 = *((guint32 *)ptr);
 	ptr += sizeof (guint32);
 	/* FIXME: Parse modified instances */
-	if (flag32) 
+	if (flag32)
 		ptr += flag32 * sizeof (guint32);
-	
+
 	/* start date */
 	flag32 = *((guint32 *)ptr);
 	ptr += sizeof (guint32);
@@ -689,19 +689,19 @@ exchange_mapi_cal_util_bin_to_rrule (GByteArray *ba, ECalComponent *comp)
 	{
 		GSList l;
 
-		l.data = &rt; 
+		l.data = &rt;
 		l.next = NULL;
 
 		e_cal_component_set_rrule_list (comp, &l);
 	}
 
 	/* FIXME: this also has modified instances */
-	e_cal_component_set_exdate_list (comp, exdate_list); 
+	e_cal_component_set_exdate_list (comp, exdate_list);
 
 	g_print ("\n== MAPI to ICAL == The recurrence blob data is as follows:\n");
 	for (i = 0; i < ba->len; ++i)
 		g_print ("0x%02X ", ba->data[i]);
-	g_print("\n== End of stream ==\n"); 
+	g_print("\n== End of stream ==\n");
 
 	return TRUE;
 }
@@ -709,16 +709,16 @@ exchange_mapi_cal_util_bin_to_rrule (GByteArray *ba, ECalComponent *comp)
 static guint32
 compute_startdate (ECalComponent *comp)
 {
-	ECalComponentDateTime dtstart; 
-	guint32 flag32; 
+	ECalComponentDateTime dtstart;
+	guint32 flag32;
 
 	e_cal_component_get_dtstart (comp, &dtstart);
-	dtstart.value->hour = dtstart.value->minute = dtstart.value->second = 0; 
+	dtstart.value->hour = dtstart.value->minute = dtstart.value->second = 0;
 	flag32 = convert_timet_to_recurrence_minutes (icaltime_as_timet_with_zone (*(dtstart.value), 0));
 
-	e_cal_component_free_datetime (&dtstart); 
+	e_cal_component_free_datetime (&dtstart);
 
-	return flag32; 
+	return flag32;
 }
 
 static guint32
@@ -730,31 +730,31 @@ compute_rdaily_firstdatetime (ECalComponent *comp, guint32 period)
 static guint32
 compute_rweekly_firstdatetime (ECalComponent *comp, icalrecurrencetype_weekday week_start, guint32 period)
 {
-	ECalComponentDateTime dtstart; 
-	guint32 flag32; 
-	int cur_weekday = 0, weekstart_weekday = 0, diff = 0;
-	time_t t; 
+	ECalComponentDateTime dtstart;
+	guint32 flag32;
+	gint cur_weekday = 0, weekstart_weekday = 0, diff = 0;
+	time_t t;
 
 	e_cal_component_get_dtstart (comp, &dtstart);
-	dtstart.value->hour = dtstart.value->minute = dtstart.value->second = 0; 
+	dtstart.value->hour = dtstart.value->minute = dtstart.value->second = 0;
 	cur_weekday = icaltime_day_of_week (*(dtstart.value));
 	t = icaltime_as_timet_with_zone (*(dtstart.value), 0);
-	e_cal_component_free_datetime (&dtstart); 
+	e_cal_component_free_datetime (&dtstart);
 
 	switch (week_start) {
-		case ICAL_SUNDAY_WEEKDAY 	: weekstart_weekday = 1; break; 
-		case ICAL_MONDAY_WEEKDAY 	: weekstart_weekday = 2; break; 
-		case ICAL_TUESDAY_WEEKDAY 	: weekstart_weekday = 3; break; 
-		case ICAL_WEDNESDAY_WEEKDAY 	: weekstart_weekday = 4; break; 
-		case ICAL_THURSDAY_WEEKDAY 	: weekstart_weekday = 5; break; 
-		case ICAL_FRIDAY_WEEKDAY 	: weekstart_weekday = 6; break; 
-		case ICAL_SATURDAY_WEEKDAY 	: weekstart_weekday = 7; break; 
-		default 			: weekstart_weekday = 1; break; 
+		case ICAL_SUNDAY_WEEKDAY	: weekstart_weekday = 1; break;
+		case ICAL_MONDAY_WEEKDAY	: weekstart_weekday = 2; break;
+		case ICAL_TUESDAY_WEEKDAY	: weekstart_weekday = 3; break;
+		case ICAL_WEDNESDAY_WEEKDAY	: weekstart_weekday = 4; break;
+		case ICAL_THURSDAY_WEEKDAY	: weekstart_weekday = 5; break;
+		case ICAL_FRIDAY_WEEKDAY	: weekstart_weekday = 6; break;
+		case ICAL_SATURDAY_WEEKDAY	: weekstart_weekday = 7; break;
+		default				: weekstart_weekday = 1; break;
 	};
 
-	diff = cur_weekday - weekstart_weekday; 
+	diff = cur_weekday - weekstart_weekday;
 
-	if (diff == 0); 
+	if (diff == 0);
 	else if (diff > 0)
 		t -= (diff * 24 * 60 * 60);
 	else if (diff < 0)
@@ -770,42 +770,42 @@ static guint32
 compute_rmonthly_firstdatetime (ECalComponent *comp, guint32 period)
 {
 	const guint8 dinm[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
-	ECalComponentDateTime dtstart; 
-	guint32 flag32, monthindex, i; 
+	ECalComponentDateTime dtstart;
+	guint32 flag32, monthindex, i;
 
 	e_cal_component_get_dtstart (comp, &dtstart);
-	monthindex = (guint32)((((guint64)(12) * (dtstart.value->year - 1601)) + (dtstart.value->month - 1)) % period); 
-	e_cal_component_free_datetime (&dtstart); 
+	monthindex = (guint32)((((guint64)(12) * (dtstart.value->year - 1601)) + (dtstart.value->month - 1)) % period);
+	e_cal_component_free_datetime (&dtstart);
 
 	for (flag32 = 0, i = 0; i < monthindex; ++i)
 		flag32 += dinm[(i % 12) + 1] * 24 * 60;
 
-	return flag32; 
+	return flag32;
 }
 
 static guint32
 calculate_no_of_occurrences (ECalComponent *comp, const struct icalrecurrencetype *rt)
 {
-	ECalComponentDateTime dtstart; 
-	icalrecur_iterator *iter; 
-	struct icaltimetype next; 
-	guint32 count = 1; 
+	ECalComponentDateTime dtstart;
+	icalrecur_iterator *iter;
+	struct icaltimetype next;
+	guint32 count = 1;
 
 	e_cal_component_get_dtstart (comp, &dtstart);
 
-	for (iter = icalrecur_iterator_new (*rt, *(dtstart.value)), 
+	for (iter = icalrecur_iterator_new (*rt, *(dtstart.value)),
 	     next = icalrecur_iterator_next(iter);
 	     !icaltime_is_null_time(next);
 	     next = icalrecur_iterator_next(iter))
-		++count; 
+		++count;
 
-	icalrecur_iterator_free (iter); 
-	e_cal_component_free_datetime (&dtstart); 
+	icalrecur_iterator_free (iter);
+	e_cal_component_free_datetime (&dtstart);
 
-	return count; 
+	return count;
 }
 
-static gint 
+static gint
 compare_guint32 (gconstpointer a, gconstpointer b, gpointer user_data)
 {
 	return (*((guint32 *) a) - *((guint32 *) b));
@@ -817,22 +817,22 @@ exchange_mapi_cal_util_rrule_to_bin (ECalComponent *comp, GSList *modified_comps
 	struct icalrecurrencetype *rt;
 	guint16 flag16;
 	guint32 flag32, end_type;
-	gint i; 
-	GSList *rrule_list = NULL, *exdate_list = NULL; 
+	gint i;
+	GSList *rrule_list = NULL, *exdate_list = NULL;
 	GByteArray *ba = NULL;
 
 	if (!e_cal_component_has_recurrences (comp))
-		return NULL; 
+		return NULL;
 
-	e_cal_component_get_rrule_list (comp, &rrule_list); 
-	e_cal_component_get_exdate_list (comp, &exdate_list); 
+	e_cal_component_get_rrule_list (comp, &rrule_list);
+	e_cal_component_get_exdate_list (comp, &exdate_list);
 
 	if (g_slist_length (rrule_list) != 1)
-		goto cleanup; 
+		goto cleanup;
 
 	rt = (struct icalrecurrencetype *)(rrule_list->data);
 
-	ba = g_byte_array_new (); 
+	ba = g_byte_array_new ();
 
 	/* Reader Version */
 	flag16 = READER_VERSION;
@@ -846,14 +846,14 @@ exchange_mapi_cal_util_rrule_to_bin (ECalComponent *comp, GSList *modified_comps
 		flag16 = RecurFrequency_Daily;
 		ba = g_byte_array_append (ba, (const guint8 *)&flag16, sizeof (guint16));
 
-		/* Pattern Type - it would be PatternType_Day since we have only "Daily every N days" 
-		 * The other type would be parsed as a weekly recurrence. 
+		/* Pattern Type - it would be PatternType_Day since we have only "Daily every N days"
+		 * The other type would be parsed as a weekly recurrence.
 		 */
 		flag16 = PatternType_Day;
 		ba = g_byte_array_append (ba, (const guint8 *)&flag16, sizeof (guint16));
 
 		/* Calendar Type */
-		flag16 = CAL_DEFAULT; 
+		flag16 = CAL_DEFAULT;
 		ba = g_byte_array_append (ba, (const guint8 *)&flag16, sizeof (guint16));
 
 		/* FirstDateTime */
@@ -861,7 +861,7 @@ exchange_mapi_cal_util_rrule_to_bin (ECalComponent *comp, GSList *modified_comps
 		ba = g_byte_array_append (ba, (const guint8 *)&flag32, sizeof (guint32));
 
 		/* INTERVAL */
-		flag32 = (rt->interval * (60 * 24)); 
+		flag32 = (rt->interval * (60 * 24));
 		ba = g_byte_array_append (ba, (const guint8 *)&flag32, sizeof (guint32));
 
 		/* This would be 0 for the stuff we handle */
@@ -879,7 +879,7 @@ exchange_mapi_cal_util_rrule_to_bin (ECalComponent *comp, GSList *modified_comps
 		ba = g_byte_array_append (ba, (const guint8 *)&flag16, sizeof (guint16));
 
 		/* Calendar Type */
-		flag16 = CAL_DEFAULT; 
+		flag16 = CAL_DEFAULT;
 		ba = g_byte_array_append (ba, (const guint8 *)&flag16, sizeof (guint16));
 
 		/* FirstDateTime */
@@ -887,7 +887,7 @@ exchange_mapi_cal_util_rrule_to_bin (ECalComponent *comp, GSList *modified_comps
 		ba = g_byte_array_append (ba, (const guint8 *)&flag32, sizeof (guint32));
 
 		/* INTERVAL */
-		flag32 = rt->interval; 
+		flag32 = rt->interval;
 		ba = g_byte_array_append (ba, (const guint8 *)&flag32, sizeof (guint32));
 
 		/* This would be 0 for the stuff we handle */
@@ -897,37 +897,37 @@ exchange_mapi_cal_util_rrule_to_bin (ECalComponent *comp, GSList *modified_comps
 		/* BITMASK */
 		for (flag32 = 0x0, i = 0; i < ICAL_BY_DAY_SIZE; ++i) {
 			if (rt->by_day[i] == ICAL_SUNDAY_WEEKDAY)
-				flag32 |= olSunday; 
+				flag32 |= olSunday;
 			else if (rt->by_day[i] == ICAL_MONDAY_WEEKDAY)
-				flag32 |= olMonday; 
+				flag32 |= olMonday;
 			else if (rt->by_day[i] == ICAL_TUESDAY_WEEKDAY)
-				flag32 |= olTuesday; 
+				flag32 |= olTuesday;
 			else if (rt->by_day[i] == ICAL_WEDNESDAY_WEEKDAY)
-				flag32 |= olWednesday; 
+				flag32 |= olWednesday;
 			else if (rt->by_day[i] == ICAL_THURSDAY_WEEKDAY)
-				flag32 |= olThursday; 
+				flag32 |= olThursday;
 			else if (rt->by_day[i] == ICAL_FRIDAY_WEEKDAY)
-				flag32 |= olFriday; 
+				flag32 |= olFriday;
 			else if (rt->by_day[i] == ICAL_SATURDAY_WEEKDAY)
-				flag32 |= olSaturday; 
-			else 
-				break; 
+				flag32 |= olSaturday;
+			else
+				break;
 		}
 		ba = g_byte_array_append (ba, (const guint8 *)&flag32, sizeof (guint32));
 
 	} else if (rt->freq == ICAL_MONTHLY_RECURRENCE) {
-		guint16 pattern = 0x0; guint32 mask = 0x0, flag = 0x0; 
+		guint16 pattern = 0x0; guint32 mask = 0x0, flag = 0x0;
 
 		flag16 = RecurFrequency_Monthly;
 		ba = g_byte_array_append (ba, (const guint8 *)&flag16, sizeof (guint16));
 
 		if (rt->by_month_day[0] >= 1 && rt->by_month_day[0] <= 31) {
 			pattern = PatternType_Month;
-			flag = rt->by_month_day[0]; 
+			flag = rt->by_month_day[0];
 		} else if (rt->by_month_day[0] == -1) {
-			pattern = PatternType_MonthNth; 
-			mask = (olSunday | olMonday | olTuesday | olWednesday | olThursday | olFriday | olSaturday); 
-			flag = RecurrenceN_Last; 
+			pattern = PatternType_MonthNth;
+			mask = (olSunday | olMonday | olTuesday | olWednesday | olThursday | olFriday | olSaturday);
+			flag = RecurrenceN_Last;
 		} else if (rt->by_day[0] >= ICAL_SUNDAY_WEEKDAY && rt->by_day[0] <= ICAL_SATURDAY_WEEKDAY) {
 			pattern = PatternType_MonthNth;
 			mask = get_mapi_day (rt->by_day[0]);
@@ -939,7 +939,7 @@ exchange_mapi_cal_util_rrule_to_bin (ECalComponent *comp, GSList *modified_comps
 		ba = g_byte_array_append (ba, (const guint8 *)&flag16, sizeof (guint16));
 
 		/* Calendar Type */
-		flag16 = CAL_DEFAULT; 
+		flag16 = CAL_DEFAULT;
 		ba = g_byte_array_append (ba, (const guint8 *)&flag16, sizeof (guint16));
 
 		/* FirstDateTime */
@@ -947,7 +947,7 @@ exchange_mapi_cal_util_rrule_to_bin (ECalComponent *comp, GSList *modified_comps
 		ba = g_byte_array_append (ba, (const guint8 *)&flag32, sizeof (guint32));
 
 		/* INTERVAL */
-		flag32 = rt->interval; 
+		flag32 = rt->interval;
 		ba = g_byte_array_append (ba, (const guint8 *)&flag32, sizeof (guint32));
 
 		/* This would be 0 for the stuff we handle */
@@ -959,7 +959,7 @@ exchange_mapi_cal_util_rrule_to_bin (ECalComponent *comp, GSList *modified_comps
 			ba = g_byte_array_append (ba, (const guint8 *)&flag32, sizeof (guint32));
 
 			if (!(flag))
-				g_warning ("Possibly setting incorrect values in the stream. "); 
+				g_warning ("Possibly setting incorrect values in the stream. ");
 		} else if (pattern == PatternType_MonthNth) {
 			flag32 = mask;
 			ba = g_byte_array_append (ba, (const guint8 *)&flag32, sizeof (guint32));
@@ -968,9 +968,9 @@ exchange_mapi_cal_util_rrule_to_bin (ECalComponent *comp, GSList *modified_comps
 			ba = g_byte_array_append (ba, (const guint8 *)&flag32, sizeof (guint32));
 
 			if (!(flag && mask))
-				g_warning ("Possibly setting incorrect values in the stream. "); 
-		} else 
-			g_warning ("Possibly setting incorrect values in the stream. "); 
+				g_warning ("Possibly setting incorrect values in the stream. ");
+		} else
+			g_warning ("Possibly setting incorrect values in the stream. ");
 
 	} else if (rt->freq == ICAL_YEARLY_RECURRENCE) {
 		flag16 = RecurFrequency_Yearly;
@@ -981,7 +981,7 @@ exchange_mapi_cal_util_rrule_to_bin (ECalComponent *comp, GSList *modified_comps
 		ba = g_byte_array_append (ba, (const guint8 *)&flag16, sizeof (guint16));
 
 		/* Calendar Type */
-		flag16 = CAL_DEFAULT; 
+		flag16 = CAL_DEFAULT;
 		ba = g_byte_array_append (ba, (const guint8 *)&flag16, sizeof (guint16));
 
 		/* FirstDateTime - uses the same function as monthly recurrence */
@@ -989,7 +989,7 @@ exchange_mapi_cal_util_rrule_to_bin (ECalComponent *comp, GSList *modified_comps
 		ba = g_byte_array_append (ba, (const guint8 *)&flag32, sizeof (guint32));
 
 		/* INTERVAL - should be 12 for yearly recurrence */
-		flag32 = 0xC; 
+		flag32 = 0xC;
 		ba = g_byte_array_append (ba, (const guint8 *)&flag32, sizeof (guint32));
 
 		/* This would be 0 for the stuff we handle */
@@ -998,21 +998,21 @@ exchange_mapi_cal_util_rrule_to_bin (ECalComponent *comp, GSList *modified_comps
 
 		/* MONTH_DAY */
 		{
-			ECalComponentDateTime dtstart; 
+			ECalComponentDateTime dtstart;
 			e_cal_component_get_dtstart (comp, &dtstart);
-			flag32 = dtstart.value->day; 
-			e_cal_component_free_datetime (&dtstart); 
+			flag32 = dtstart.value->day;
+			e_cal_component_free_datetime (&dtstart);
 		}
 		ba = g_byte_array_append (ba, (const guint8 *)&flag32, sizeof (guint32));
 
-	} 
+	}
 
 	/* End Type followed by Occurence count */
 	if (!icaltime_is_null_time (rt->until)) {
 		flag32 = END_AFTER_DATE;
 		ba = g_byte_array_append (ba, (const guint8 *)&flag32, sizeof (guint32));
 
-		flag32 = calculate_no_of_occurrences (comp, rt); 
+		flag32 = calculate_no_of_occurrences (comp, rt);
 		ba = g_byte_array_append (ba, (const guint8 *)&flag32, sizeof (guint32));
 
 		end_type = END_AFTER_DATE;
@@ -1035,23 +1035,23 @@ exchange_mapi_cal_util_rrule_to_bin (ECalComponent *comp, GSList *modified_comps
 	}
 
 	/* FirstDOW */
-	flag32 = get_mapi_weekstart (rt->week_start); 
+	flag32 = get_mapi_weekstart (rt->week_start);
 	ba = g_byte_array_append (ba, (const guint8 *)&flag32, sizeof (guint32));
 
 	/* DeletedInstances */
 	flag32 = g_slist_length (exdate_list);
 	ba = g_byte_array_append (ba, (const guint8 *)&flag32, sizeof (guint32));
 	if (flag32) {
-		GSList *l; 
+		GSList *l;
 		guint32 *sorted_list = g_new0(guint32, flag32);
 		/* FIXME: This should include modified dates */
 		for (i = 0, l = exdate_list; l; ++i, l = l->next) {
-			ECalComponentDateTime *dt = (ECalComponentDateTime *)(l->data); 
-			dt->value->hour = dt->value->minute = dt->value->second = 0; 
-			sorted_list[i] = convert_timet_to_recurrence_minutes (icaltime_as_timet_with_zone (*(dt->value), 0)); 
+			ECalComponentDateTime *dt = (ECalComponentDateTime *)(l->data);
+			dt->value->hour = dt->value->minute = dt->value->second = 0;
+			sorted_list[i] = convert_timet_to_recurrence_minutes (icaltime_as_timet_with_zone (*(dt->value), 0));
 		}
 
-		g_qsort_with_data (sorted_list, flag32, sizeof (guint32), compare_guint32, NULL); 
+		g_qsort_with_data (sorted_list, flag32, sizeof (guint32), compare_guint32, NULL);
 
 		for (i = 0; i < flag32; ++i)
 			ba = g_byte_array_append (ba, (const guint8 *)&(sorted_list[i]), sizeof (guint32));
@@ -1067,35 +1067,35 @@ exchange_mapi_cal_util_rrule_to_bin (ECalComponent *comp, GSList *modified_comps
 	}
 
 	/* StartDate */
-	flag32 = compute_startdate (comp); 
+	flag32 = compute_startdate (comp);
 	ba = g_byte_array_append (ba, (const guint8 *)&flag32, sizeof (guint32));
 
 	/* EndDate */
 	{
-		if (end_type == END_NEVER_END) 
-			flag32 = 0x5AE980DF; 
+		if (end_type == END_NEVER_END)
+			flag32 = 0x5AE980DF;
 		else if (end_type == END_AFTER_N_OCCURRENCES) {
-			ECalComponentDateTime dtstart; 
-			gchar *rrule_str = icalrecurrencetype_as_string_r (rt); 
-			time_t *array = g_new0 (time_t, rt->count); 
+			ECalComponentDateTime dtstart;
+			gchar *rrule_str = icalrecurrencetype_as_string_r (rt);
+			time_t *array = g_new0 (time_t, rt->count);
 
 			e_cal_component_get_dtstart (comp, &dtstart);
-			dtstart.value->hour = dtstart.value->minute = dtstart.value->second = 0; 
+			dtstart.value->hour = dtstart.value->minute = dtstart.value->second = 0;
 
-			icalrecur_expand_recurrence (rrule_str, icaltime_as_timet_with_zone (*(dtstart.value), 0), rt->count, array); 
+			icalrecur_expand_recurrence (rrule_str, icaltime_as_timet_with_zone (*(dtstart.value), 0), rt->count, array);
 
-			flag32 = convert_timet_to_recurrence_minutes (array[(rt->count) - 1]); 
+			flag32 = convert_timet_to_recurrence_minutes (array[(rt->count) - 1]);
 
-			g_free (array); 
-			g_free (rrule_str); 
-			e_cal_component_free_datetime (&dtstart); 
+			g_free (array);
+			g_free (rrule_str);
+			e_cal_component_free_datetime (&dtstart);
 		} else if (end_type == END_AFTER_DATE) {
-			struct icaltimetype until; 
+			struct icaltimetype until;
 			memcpy (&until, &(rt->until), sizeof(struct icaltimetype));
-			until.hour = until.minute = until.second = 0; 
+			until.hour = until.minute = until.second = 0;
 			flag32 = convert_timet_to_recurrence_minutes (icaltime_as_timet_with_zone (until, 0));
-		} else 
-			flag32 = 0x0; 
+		} else
+			flag32 = 0x0;
 	}
 	ba = g_byte_array_append (ba, (const guint8 *)&flag32, sizeof (guint32));
 
@@ -1109,25 +1109,25 @@ exchange_mapi_cal_util_rrule_to_bin (ECalComponent *comp, GSList *modified_comps
 
 	/* StartTimeOffset */
 	{
-		ECalComponentDateTime dtstart; 
+		ECalComponentDateTime dtstart;
 		e_cal_component_get_dtstart (comp, &dtstart);
-		flag32 = (dtstart.value->hour * 60) + dtstart.value->minute; 
-		e_cal_component_free_datetime (&dtstart); 
+		flag32 = (dtstart.value->hour * 60) + dtstart.value->minute;
+		e_cal_component_free_datetime (&dtstart);
 	}
 	ba = g_byte_array_append (ba, (const guint8 *)&flag32, sizeof (guint32));
 
 	/* EndTimeOffset */
 	{
-		ECalComponentDateTime dtend; 
+		ECalComponentDateTime dtend;
 		e_cal_component_get_dtend (comp, &dtend);
-		flag32 = (dtend.value->hour * 60) + dtend.value->minute; 
-		e_cal_component_free_datetime (&dtend); 
+		flag32 = (dtend.value->hour * 60) + dtend.value->minute;
+		e_cal_component_free_datetime (&dtend);
 	}
 	ba = g_byte_array_append (ba, (const guint8 *)&flag32, sizeof (guint32));
 
 	/* FIXME: Add support for modified instances */
 	/* ModifiedExceptionCount */
-	flag16 = 0x0; 
+	flag16 = 0x0;
 	ba = g_byte_array_append (ba, (const guint8 *)&flag16, sizeof (guint16));
 
 	/* FIXME: Add the ExceptionInfo here */
@@ -1142,15 +1142,15 @@ exchange_mapi_cal_util_rrule_to_bin (ECalComponent *comp, GSList *modified_comps
 	flag32 = 0x0;
 	ba = g_byte_array_append (ba, (const guint8 *)&flag32, sizeof (guint32));
 
-cleanup: 
+cleanup:
 	e_cal_component_free_exdate_list (exdate_list);
 	e_cal_component_free_recur_list (rrule_list);
 
 	g_print ("\n== ICAL to MAPI == The recurrence blob data is as follows:\n");
 	for (i = 0; i < ba->len; ++i)
 		g_print ("0x%02X ", ba->data[i]);
-	g_print("\n== End of stream ==\n"); 
+	g_print("\n== End of stream ==\n");
 
-	return ba; 
+	return ba;
 }
 
diff --git a/src/libexchangemapi/exchange-mapi-cal-recur-utils.h b/src/libexchangemapi/exchange-mapi-cal-recur-utils.h
index 65634d6..621b8d9 100644
--- a/src/libexchangemapi/exchange-mapi-cal-recur-utils.h
+++ b/src/libexchangemapi/exchange-mapi-cal-recur-utils.h
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
diff --git a/src/libexchangemapi/exchange-mapi-cal-tz-utils.c b/src/libexchangemapi/exchange-mapi-cal-tz-utils.c
index 82e3deb..893edc0 100644
--- a/src/libexchangemapi/exchange-mapi-cal-tz-utils.c
+++ b/src/libexchangemapi/exchange-mapi-cal-tz-utils.c
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -99,8 +99,8 @@ exchange_mapi_cal_tz_util_destroy ()
 	g_static_rec_mutex_unlock(&mutex);
 }
 
-static void 
-file_contents_to_hashtable (const char *contents, GHashTable *table) 
+static void
+file_contents_to_hashtable (const gchar *contents, GHashTable *table)
 {
 	gchar **array = NULL;
 	guint len = 0, i;
@@ -110,7 +110,7 @@ file_contents_to_hashtable (const char *contents, GHashTable *table)
 
 	for (i=0; i < len-1; ++i) {
 		gchar **mapping = g_strsplit (array[i], MAPPING_SEPARATOR, -1);
-		if (g_strv_length (mapping) == 2) 
+		if (g_strv_length (mapping) == 2)
 			g_hash_table_insert (table, g_strdup (mapping[0]), g_strdup (mapping[1]));
 		g_strfreev (mapping);
 	}
@@ -159,16 +159,16 @@ exchange_mapi_cal_tz_util_populate ()
 		return FALSE;
 	}
 
-	mapi_to_ical = g_hash_table_new_full   ((GHashFunc) g_str_hash, 
-						(GEqualFunc) g_str_equal, 
-						(GDestroyNotify) g_free, 
+	mapi_to_ical = g_hash_table_new_full   ((GHashFunc) g_str_hash,
+						(GEqualFunc) g_str_equal,
+						(GDestroyNotify) g_free,
 						(GDestroyNotify) g_free);
 
 	file_contents_to_hashtable (g_mapped_file_get_contents (mtoi_mf), mapi_to_ical);
 
-	ical_to_mapi = g_hash_table_new_full   ((GHashFunc) g_str_hash, 
-						(GEqualFunc) g_str_equal, 
-						(GDestroyNotify) g_free, 
+	ical_to_mapi = g_hash_table_new_full   ((GHashFunc) g_str_hash,
+						(GEqualFunc) g_str_equal,
+						(GDestroyNotify) g_free,
 						(GDestroyNotify) g_free);
 
 	file_contents_to_hashtable (g_mapped_file_get_contents (itom_mf), ical_to_mapi);
@@ -188,7 +188,7 @@ exchange_mapi_cal_tz_util_populate ()
 
 		g_static_rec_mutex_unlock(&mutex);
 		return FALSE;
-	} 
+	}
 
 #if GLIB_CHECK_VERSION(2,21,3)
 	g_mapped_file_unref (mtoi_mf);
@@ -205,20 +205,20 @@ exchange_mapi_cal_tz_util_populate ()
 	return TRUE;
 }
 
-static void 
+static void
 exchange_mapi_cal_tz_util_dump_ical_tzs ()
 {
 	guint i;
 	icalarray *zones;
 	GList *l, *list_items = NULL;
-	
+
 	/* Get the array of builtin timezones. */
 	zones = icaltimezone_get_builtin_timezones ();
 
 	g_message("%s: %s: ", G_STRLOC, G_STRFUNC);
 	for (i = 0; i < zones->num_elements; i++) {
 		icaltimezone *zone;
-		const char *tzid = NULL;
+		const gchar *tzid = NULL;
 
 		zone = icalarray_element_at (zones, i);
 
@@ -232,7 +232,7 @@ exchange_mapi_cal_tz_util_dump_ical_tzs ()
 	/* Put the "UTC" entry at the top of the combo's list. */
 	list_items = g_list_prepend (list_items, (gpointer)"UTC");
 
-	for (l = list_items, i = 0; l != NULL; l = l->next, ++i) 
+	for (l = list_items, i = 0; l != NULL; l = l->next, ++i)
 		g_print ("[%3d]\t%s\n", (i+1), (gchar *)(l->data));
 
 //	icaltimezone_free_builtin_timezones ();
@@ -358,44 +358,44 @@ TZDEFINITION* BinToTZDEFINITION(ULONG cbDef, LPBYTE lpbDef)
 
         LPBYTE lpNextRule = lpPtr;
         BOOL bRuleOK = false;
-		
+
         for (i = 0;i < tzDef.cRules;i++)
         {
             bRuleOK = false;
             lpPtr = lpNextRule;
-			
-            if (lpbDef + cbDef - lpPtr < 
+
+            if (lpbDef + cbDef - lpPtr <
                 2*sizeof(BYTE) + 2*sizeof(WORD) + 3*sizeof(long) + 2*sizeof(SYSTEMTIME)) return NULL;
             bRuleOK = true;
             BYTE bRuleMajorVersion = *((BYTE*)lpPtr);
             lpPtr += sizeof(BYTE);
             BYTE bRuleMinorVersion = *((BYTE*)lpPtr);
             lpPtr += sizeof(BYTE);
-			
+
             // We only understand TZ_BIN_VERSION_MAJOR
             if (TZ_BIN_VERSION_MAJOR != bRuleMajorVersion) return NULL;
-			
+
             // We only understand if >= TZ_BIN_VERSION_MINOR
             if (TZ_BIN_VERSION_MINOR > bRuleMinorVersion) return NULL;
-			
+
             WORD cbRule = *((WORD*)lpPtr);
             lpPtr += sizeof(WORD);
-			
+
             lpNextRule = lpPtr + cbRule;
-			
+
             lpRules[i].wFlags = *((WORD*)lpPtr);
             lpPtr += sizeof(WORD);
-			
+
             lpRules[i].stStart = *((SYSTEMTIME*)lpPtr);
             lpPtr += sizeof(SYSTEMTIME);
-			
+
             lpRules[i].TZReg.lBias = *((long*)lpPtr);
             lpPtr += sizeof(long);
             lpRules[i].TZReg.lStandardBias = *((long*)lpPtr);
             lpPtr += sizeof(long);
             lpRules[i].TZReg.lDaylightBias = *((long*)lpPtr);
             lpPtr += sizeof(long);
-			
+
             lpRules[i].TZReg.stStandardDate = *((SYSTEMTIME*)lpPtr);
             lpPtr += sizeof(SYSTEMTIME);
             lpRules[i].TZReg.stDaylightDate = *((SYSTEMTIME*)lpPtr);
@@ -404,17 +404,17 @@ TZDEFINITION* BinToTZDEFINITION(ULONG cbDef, LPBYTE lpbDef)
         if (!bRuleOK)
         {
             delete[] lpRules;
-            return NULL;			
+            return NULL;
         }
     }
-#endif 
+#endif
     // Now we've read everything - allocate a structure and copy it in
-    size_t cbTZDef = sizeof(TZDEFINITION) +
+    gsize cbTZDef = sizeof(TZDEFINITION) +
         sizeof(WCHAR)*(cchKeyName+1) +
         sizeof(TZRULE)*tzDef.cRules;
 
     TZDEFINITION* ptzDef = (TZDEFINITION*) malloc (cbTZDef);
-    
+
     if (ptzDef)
     {
         // Copy main struct over
@@ -455,7 +455,7 @@ TZDEFINITION* BinToTZDEFINITION(ULONG cbDef, LPBYTE lpbDef)
 #define TZ_BIN_VERSION_MINOR  0x01 
 
 void
-exchange_mapi_cal_util_mapi_tz_to_bin (const char *mapi_tzid, struct Binary_r *sb)
+exchange_mapi_cal_util_mapi_tz_to_bin (const gchar *mapi_tzid, struct Binary_r *sb)
 {
 	GByteArray *ba;
 	guint8 flag8;
@@ -499,7 +499,7 @@ exchange_mapi_cal_util_mapi_tz_to_bin (const char *mapi_tzid, struct Binary_r *s
 	sb->cb = ba->len;
 
 	d(g_message ("New timezone stream.. Length: %d bytes.. Hex-data follows:", ba->len));
-	d(for (i = 0; i < ba->len; i++) 
+	d(for (i = 0; i < ba->len; i++)
 		g_print("0x%.2X ", ba->data[i]));
 
 	g_byte_array_free (ba, FALSE);
diff --git a/src/libexchangemapi/exchange-mapi-cal-tz-utils.h b/src/libexchangemapi/exchange-mapi-cal-tz-utils.h
index 4cfb97a..b726e17 100644
--- a/src/libexchangemapi/exchange-mapi-cal-tz-utils.h
+++ b/src/libexchangemapi/exchange-mapi-cal-tz-utils.h
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -46,7 +46,7 @@ void
 exchange_mapi_cal_tz_util_dump (void);
 
 void
-exchange_mapi_cal_util_mapi_tz_to_bin (const char *mapi_tzid, struct Binary_r *sb);
+exchange_mapi_cal_util_mapi_tz_to_bin (const gchar *mapi_tzid, struct Binary_r *sb);
 
 gchar *
 exchange_mapi_cal_util_bin_to_mapi_tz (GByteArray *ba);
@@ -60,8 +60,8 @@ typedef uint32_t GUID;
 typedef uint64_t ULONG;
 typedef time_t SYSTEMTIME;
 typedef uint8_t* LPBYTE;
-typedef char* LPWSTR;
-typedef char WCHAR;
+typedef gchar * LPWSTR;
+typedef gchar WCHAR;
 
 // TZREG
 // =====================
@@ -82,9 +82,9 @@ typedef struct RenTimeZone
 
 // TZRULE
 // =====================
-//   This structure represents both a description when a daylight. 
+//   This structure represents both a description when a daylight.
 //   saving shift occurs, and in addition, the year in which that
-//   timezone rule came into effect. 
+//   timezone rule came into effect.
 //
 typedef struct
 {
diff --git a/src/libexchangemapi/exchange-mapi-cal-utils.c b/src/libexchangemapi/exchange-mapi-cal-utils.c
index 526b487..a7089b1 100644
--- a/src/libexchangemapi/exchange-mapi-cal-utils.c
+++ b/src/libexchangemapi/exchange-mapi-cal-utils.c
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -45,9 +45,9 @@ get_role_from_type (OlMailRecipientType type)
 {
 	switch (type) {
 		case olCC   : return ICAL_ROLE_OPTPARTICIPANT;
-		case olOriginator : 
-		case olTo   : 
-		case olBCC  : 
+		case olOriginator :
+		case olTo   :
+		case olBCC  :
 		default     : return ICAL_ROLE_REQPARTICIPANT;
 	}
 }
@@ -56,60 +56,60 @@ static OlMailRecipientType
 get_type_from_role (icalparameter_role role)
 {
 	switch (role) {
-		case ICAL_ROLE_OPTPARTICIPANT 	: return olCC;
-		case ICAL_ROLE_CHAIR 		:
-		case ICAL_ROLE_REQPARTICIPANT 	:
-		case ICAL_ROLE_NONPARTICIPANT 	: 
-		default 			: return olTo;
+		case ICAL_ROLE_OPTPARTICIPANT	: return olCC;
+		case ICAL_ROLE_CHAIR		:
+		case ICAL_ROLE_REQPARTICIPANT	:
+		case ICAL_ROLE_NONPARTICIPANT	:
+		default				: return olTo;
 	}
-} 
+}
 
 static icalparameter_partstat
 get_partstat_from_trackstatus (uint32_t trackstatus)
 {
 	switch (trackstatus) {
-		case olResponseOrganized : 
+		case olResponseOrganized :
 		case olResponseAccepted  : return ICAL_PARTSTAT_ACCEPTED;
 		case olResponseTentative : return ICAL_PARTSTAT_TENTATIVE;
 		case olResponseDeclined  : return ICAL_PARTSTAT_DECLINED;
-		default 		 : return ICAL_PARTSTAT_NEEDSACTION;
+		default			: return ICAL_PARTSTAT_NEEDSACTION;
 	}
 }
 
-static uint32_t 
+static uint32_t
 get_trackstatus_from_partstat (icalparameter_partstat partstat)
 {
 	switch (partstat) {
-		case ICAL_PARTSTAT_ACCEPTED 	: return olResponseAccepted;
-		case ICAL_PARTSTAT_TENTATIVE 	: return olResponseTentative;
-		case ICAL_PARTSTAT_DECLINED 	: return olResponseDeclined;
-		default 			: return olResponseNone;
+		case ICAL_PARTSTAT_ACCEPTED	: return olResponseAccepted;
+		case ICAL_PARTSTAT_TENTATIVE	: return olResponseTentative;
+		case ICAL_PARTSTAT_DECLINED	: return olResponseDeclined;
+		default				: return olResponseNone;
 	}
 }
 
 static icalproperty_transp
-get_transp_from_prop (uint32_t prop) 
+get_transp_from_prop (uint32_t prop)
 {
 	/* FIXME: is this mapping correct ? */
 	switch (prop) {
-		case olFree 		:
-		case olTentative 	: return ICAL_TRANSP_TRANSPARENT;
-		case olBusy 		:
-		case olOutOfOffice 	:
-		default 		: return ICAL_TRANSP_OPAQUE;
+		case olFree		:
+		case olTentative	: return ICAL_TRANSP_TRANSPARENT;
+		case olBusy		:
+		case olOutOfOffice	:
+		default			: return ICAL_TRANSP_OPAQUE;
 	}
 }
 
-static uint32_t 
+static uint32_t
 get_prop_from_transp (icalproperty_transp transp)
 {
 	/* FIXME: is this mapping correct ? */
 	switch (transp) {
-		case ICAL_TRANSP_TRANSPARENT 		:
-		case ICAL_TRANSP_TRANSPARENTNOCONFLICT 	: return olFree; 
-		case ICAL_TRANSP_OPAQUE 		: 
-		case ICAL_TRANSP_OPAQUENOCONFLICT 	:
-		default 				: return olBusy;
+		case ICAL_TRANSP_TRANSPARENT		:
+		case ICAL_TRANSP_TRANSPARENTNOCONFLICT	: return olFree;
+		case ICAL_TRANSP_OPAQUE			:
+		case ICAL_TRANSP_OPAQUENOCONFLICT	:
+		default					: return olBusy;
 	}
 }
 
@@ -118,12 +118,12 @@ get_taskstatus_from_prop (uint32_t prop)
 {
 	/* FIXME: is this mapping correct ? */
 	switch (prop) {
-		case olTaskComplete 	: return ICAL_STATUS_COMPLETED;
-		case olTaskWaiting 	:
-		case olTaskInProgress 	: return ICAL_STATUS_INPROCESS;
-		case olTaskDeferred 	: return ICAL_STATUS_CANCELLED;
-		case olTaskNotStarted 	: 
-		default 		: return ICAL_STATUS_NEEDSACTION;
+		case olTaskComplete	: return ICAL_STATUS_COMPLETED;
+		case olTaskWaiting	:
+		case olTaskInProgress	: return ICAL_STATUS_INPROCESS;
+		case olTaskDeferred	: return ICAL_STATUS_CANCELLED;
+		case olTaskNotStarted	:
+		default			: return ICAL_STATUS_NEEDSACTION;
 	}
 }
 
@@ -132,10 +132,10 @@ get_prop_from_taskstatus (icalproperty_status status)
 {
 	/* FIXME: is this mapping correct ? */
 	switch (status) {
-		case ICAL_STATUS_INPROCESS 	: return olTaskInProgress;
-		case ICAL_STATUS_COMPLETED 	: return olTaskComplete;
-		case ICAL_STATUS_CANCELLED 	: return olTaskDeferred;
-		default 			: return olTaskNotStarted;
+		case ICAL_STATUS_INPROCESS	: return olTaskInProgress;
+		case ICAL_STATUS_COMPLETED	: return olTaskComplete;
+		case ICAL_STATUS_CANCELLED	: return olTaskDeferred;
+		default				: return olTaskNotStarted;
 	}
 }
 
@@ -144,38 +144,38 @@ get_class_from_prop (uint32_t prop)
 {
 	/* FIXME: is this mapping correct ? */
 	switch (prop) {
-		case olPersonal 	:
-		case olPrivate 		: return ICAL_CLASS_PRIVATE;
-		case olConfidential 	: return ICAL_CLASS_CONFIDENTIAL;
-		case olNormal 		: 
-		default 		: return ICAL_CLASS_PUBLIC;
+		case olPersonal		:
+		case olPrivate		: return ICAL_CLASS_PRIVATE;
+		case olConfidential	: return ICAL_CLASS_CONFIDENTIAL;
+		case olNormal		:
+		default			: return ICAL_CLASS_PUBLIC;
 	}
 }
 
-static uint32_t 
+static uint32_t
 get_prop_from_class (icalproperty_class class)
 {
 	/* FIXME: is this mapping correct ? */
 	switch (class) {
-		case ICAL_CLASS_PRIVATE 	: return olPrivate;
-		case ICAL_CLASS_CONFIDENTIAL 	: return olConfidential;
-		default 			: return olNormal;
+		case ICAL_CLASS_PRIVATE		: return olPrivate;
+		case ICAL_CLASS_CONFIDENTIAL	: return olConfidential;
+		default				: return olNormal;
 	}
 }
 
-static int
+static gint
 get_priority_from_prop (uint32_t prop)
 {
 	switch (prop) {
-		case PRIORITY_LOW 	: return 7;
-		case PRIORITY_HIGH 	: return 1;
-		case PRIORITY_NORMAL 	: 
-		default 		: return 5;
+		case PRIORITY_LOW	: return 7;
+		case PRIORITY_HIGH	: return 1;
+		case PRIORITY_NORMAL	:
+		default			: return 5;
 	}
 }
 
 static uint32_t
-get_prio_prop_from_priority (int priority)
+get_prio_prop_from_priority (gint priority)
 {
 	if (priority > 0 && priority <= 4)
 		return PRIORITY_HIGH;
@@ -186,7 +186,7 @@ get_prio_prop_from_priority (int priority)
 }
 
 static uint32_t
-get_imp_prop_from_priority (int priority)
+get_imp_prop_from_priority (gint priority)
 {
 	if (priority > 0 && priority <= 4)
 		return IMPORTANCE_HIGH;
@@ -197,16 +197,16 @@ get_imp_prop_from_priority (int priority)
 }
 
 void
-exchange_mapi_cal_util_fetch_attachments (ECalComponent *comp, GSList **attach_list, const char *local_store_uri)
+exchange_mapi_cal_util_fetch_attachments (ECalComponent *comp, GSList **attach_list, const gchar *local_store_uri)
 {
 	GSList *comp_attach_list = NULL, *new_attach_list = NULL;
 	GSList *l;
-	const char *uid;
+	const gchar *uid;
 
 	e_cal_component_get_attachment_list (comp, &comp_attach_list);
 	e_cal_component_get_uid (comp, &uid);
 
-	for (l = comp_attach_list; l ; l = l->next) {
+	for (l = comp_attach_list; l; l = l->next) {
 		gchar *sfname_uri = (gchar *) l->data;
 		gchar *sfname = NULL, *filename = NULL;
 		GMappedFile *mapped_file;
@@ -218,11 +218,11 @@ exchange_mapi_cal_util_fetch_attachments (ECalComponent *comp, GSList **attach_l
 
 		if (mapped_file) {
 			ExchangeMAPIAttachment *attach_item;
-			ExchangeMAPIStream *stream; 
+			ExchangeMAPIStream *stream;
 			guint8 *attach = (guint8 *) g_mapped_file_get_contents (mapped_file);
 			guint filelength = g_mapped_file_get_length (mapped_file);
 			const gchar *split_name;
-			uint32_t flag; 
+			uint32_t flag;
 
 			if (g_str_has_prefix (filename, uid)) {
 				split_name = (filename + strlen (uid) + strlen ("-"));
@@ -234,28 +234,28 @@ exchange_mapi_cal_util_fetch_attachments (ECalComponent *comp, GSList **attach_l
 
 			attach_item = g_new0 (ExchangeMAPIAttachment, 1);
 
-			attach_item->cValues = 4; 
+			attach_item->cValues = 4;
 			attach_item->lpProps = g_new0 (struct SPropValue, attach_item->cValues + 1);
 
-			flag = ATTACH_BY_VALUE; 
-			set_SPropValue_proptag(&(attach_item->lpProps[0]), PR_ATTACH_METHOD, (const void *) (&flag));
+			flag = ATTACH_BY_VALUE;
+			set_SPropValue_proptag(&(attach_item->lpProps[0]), PR_ATTACH_METHOD, (gconstpointer ) (&flag));
 
-			/* MSDN Documentation: When the supplied offset is -1 (0xFFFFFFFF), the 
-			 * attachment is not rendered using the PR_RENDERING_POSITION property. 
-			 * All values other than -1 indicate the position within PR_BODY at which 
-			 * the attachment is to be rendered. 
+			/* MSDN Documentation: When the supplied offset is -1 (0xFFFFFFFF), the
+			 * attachment is not rendered using the PR_RENDERING_POSITION property.
+			 * All values other than -1 indicate the position within PR_BODY at which
+			 * the attachment is to be rendered.
 			 */
 			flag = 0xFFFFFFFF;
-			set_SPropValue_proptag(&(attach_item->lpProps[1]), PR_RENDERING_POSITION, (const void *) (&flag));
+			set_SPropValue_proptag(&(attach_item->lpProps[1]), PR_RENDERING_POSITION, (gconstpointer ) (&flag));
 
-			set_SPropValue_proptag(&(attach_item->lpProps[2]), PR_ATTACH_FILENAME, (const void *) g_strdup(split_name));
-			set_SPropValue_proptag(&(attach_item->lpProps[3]), PR_ATTACH_LONG_FILENAME, (const void *) g_strdup(split_name));
+			set_SPropValue_proptag(&(attach_item->lpProps[2]), PR_ATTACH_FILENAME, (gconstpointer ) g_strdup(split_name));
+			set_SPropValue_proptag(&(attach_item->lpProps[3]), PR_ATTACH_LONG_FILENAME, (gconstpointer ) g_strdup(split_name));
 
 			stream = g_new0 (ExchangeMAPIStream, 1);
-			stream->proptag = PR_ATTACH_DATA_BIN; 
+			stream->proptag = PR_ATTACH_DATA_BIN;
 			stream->value = g_byte_array_sized_new (filelength);
 			stream->value = g_byte_array_append (stream->value, attach, filelength);
-			attach_item->streams = g_slist_append (attach_item->streams, stream); 
+			attach_item->streams = g_slist_append (attach_item->streams, stream);
 
 			*attach_list = g_slist_append (*attach_list, attach_item);
 
@@ -286,7 +286,7 @@ void
 exchange_mapi_cal_util_fetch_organizer (ECalComponent *comp, GSList **recip_list)
 {
 	icalcomponent *icalcomp = e_cal_component_get_icalcomponent (comp);
-	icalproperty *org_prop = NULL; 
+	icalproperty *org_prop = NULL;
 	const gchar *org = NULL;
 
 	org_prop = icalcomponent_get_first_property (icalcomp, ICAL_ORGANIZER_PROPERTY);
@@ -294,14 +294,14 @@ exchange_mapi_cal_util_fetch_organizer (ECalComponent *comp, GSList **recip_list
 	if (org && *org) {
 		ExchangeMAPIRecipient *recipient;
 		uint32_t val = 0;
-		const char *str = NULL;
+		const gchar *str = NULL;
 		icalparameter *param;
 
 		recipient = g_new0 (ExchangeMAPIRecipient, 1);
 
-		if (!g_ascii_strncasecmp (org, "mailto:";, 7)) 
+		if (!g_ascii_strncasecmp (org, "mailto:";, 7))
 			recipient->email_id = (org) + 7;
-		else 
+		else
 			recipient->email_id = (org);
 
 		/* Required properties - set them always */
@@ -309,41 +309,41 @@ exchange_mapi_cal_util_fetch_organizer (ECalComponent *comp, GSList **recip_list
 		recipient->in.req_lpProps = g_new0 (struct SPropValue, recipient->in.req_cValues + 1);
 
 		val = 0;
-		set_SPropValue_proptag (&(recipient->in.req_lpProps[0]), PR_SEND_INTERNET_ENCODING, (const void *)&val);
+		set_SPropValue_proptag (&(recipient->in.req_lpProps[0]), PR_SEND_INTERNET_ENCODING, (gconstpointer )&val);
 
 		val = RECIP_SENDABLE | RECIP_ORGANIZER;
-		set_SPropValue_proptag (&(recipient->in.req_lpProps[1]), PR_RECIPIENTS_FLAGS, (const void *)&val);
+		set_SPropValue_proptag (&(recipient->in.req_lpProps[1]), PR_RECIPIENTS_FLAGS, (gconstpointer )&val);
 
 		val = olResponseNone;
-		set_SPropValue_proptag (&(recipient->in.req_lpProps[2]), PR_RECIPIENT_TRACKSTATUS, (const void *)&val);
+		set_SPropValue_proptag (&(recipient->in.req_lpProps[2]), PR_RECIPIENT_TRACKSTATUS, (gconstpointer )&val);
 
 		val = olTo;
-		set_SPropValue_proptag (&(recipient->in.req_lpProps[3]), PR_RECIPIENT_TYPE, (const void *) &val);
+		set_SPropValue_proptag (&(recipient->in.req_lpProps[3]), PR_RECIPIENT_TYPE, (gconstpointer ) &val);
 
 		param = icalproperty_get_first_parameter (org_prop, ICAL_CN_PARAMETER);
 		str = icalparameter_get_cn (param);
-		if (!(str && *str)) 
+		if (!(str && *str))
 			str = "";
-		set_SPropValue_proptag (&(recipient->in.req_lpProps[4]), PR_RECIPIENT_DISPLAY_NAME, (const void *)(str));
+		set_SPropValue_proptag (&(recipient->in.req_lpProps[4]), PR_RECIPIENT_DISPLAY_NAME, (gconstpointer )(str));
 
 		/* External recipient properties - set them only when the recipient is unresolved */
 		recipient->in.ext_cValues = 5;
 		recipient->in.ext_lpProps = g_new0 (struct SPropValue, recipient->in.ext_cValues + 1);
 
 		val = DT_MAILUSER;
-		set_SPropValue_proptag (&(recipient->in.ext_lpProps[0]), PR_DISPLAY_TYPE, (const void *)&val);
+		set_SPropValue_proptag (&(recipient->in.ext_lpProps[0]), PR_DISPLAY_TYPE, (gconstpointer )&val);
 		val = MAPI_MAILUSER;
-		set_SPropValue_proptag (&(recipient->in.ext_lpProps[1]), PR_OBJECT_TYPE, (const void *)&val);
+		set_SPropValue_proptag (&(recipient->in.ext_lpProps[1]), PR_OBJECT_TYPE, (gconstpointer )&val);
 		str = "SMTP";
-		set_SPropValue_proptag (&(recipient->in.ext_lpProps[2]), PR_ADDRTYPE, (const void *)(str));
+		set_SPropValue_proptag (&(recipient->in.ext_lpProps[2]), PR_ADDRTYPE, (gconstpointer )(str));
 		str = recipient->email_id;
-		set_SPropValue_proptag (&(recipient->in.ext_lpProps[3]), PR_SMTP_ADDRESS, (const void *)(str));
+		set_SPropValue_proptag (&(recipient->in.ext_lpProps[3]), PR_SMTP_ADDRESS, (gconstpointer )(str));
 
 		param = icalproperty_get_first_parameter (org_prop, ICAL_CN_PARAMETER);
 		str = icalparameter_get_cn (param);
-		if (!(str && *str)) 
+		if (!(str && *str))
 			str = "";
-		set_SPropValue_proptag (&(recipient->in.ext_lpProps[4]), PR_DISPLAY_NAME, (const void *)(str));
+		set_SPropValue_proptag (&(recipient->in.ext_lpProps[4]), PR_DISPLAY_NAME, (gconstpointer )(str));
 
 		*recip_list = g_slist_append (*recip_list, recipient);
 	}
@@ -353,7 +353,7 @@ void
 exchange_mapi_cal_util_fetch_recipients (ECalComponent *comp, GSList **recip_list)
 {
 	icalcomponent *icalcomp = e_cal_component_get_icalcomponent (comp);
-	icalproperty *org_prop = NULL, *att_prop = NULL; 
+	icalproperty *org_prop = NULL, *att_prop = NULL;
 	const gchar *org = NULL;
 
 	org_prop = icalcomponent_get_first_property (icalcomp, ICAL_ORGANIZER_PROPERTY);
@@ -365,15 +365,15 @@ exchange_mapi_cal_util_fetch_recipients (ECalComponent *comp, GSList **recip_lis
 	while (att_prop) {
 		ExchangeMAPIRecipient *recipient;
 		uint32_t val = 0;
-		const char *str = NULL;
+		const gchar *str = NULL;
 		icalparameter *param;
 
 		recipient = g_new0 (ExchangeMAPIRecipient, 1);
 
 		str = icalproperty_get_attendee (att_prop);
-		if (!g_ascii_strncasecmp (str, "mailto:";, 7)) 
+		if (!g_ascii_strncasecmp (str, "mailto:";, 7))
 			recipient->email_id = (str) + 7;
-		else 
+		else
 			recipient->email_id = (str);
 
 		/* Required properties - set them always */
@@ -381,43 +381,43 @@ exchange_mapi_cal_util_fetch_recipients (ECalComponent *comp, GSList **recip_lis
 		recipient->in.req_lpProps = g_new0 (struct SPropValue, recipient->in.req_cValues + 1);
 
 		val = 0;
-		set_SPropValue_proptag (&(recipient->in.req_lpProps[0]), PR_SEND_INTERNET_ENCODING, (const void *)&val);
+		set_SPropValue_proptag (&(recipient->in.req_lpProps[0]), PR_SEND_INTERNET_ENCODING, (gconstpointer )&val);
 
 		val = RECIP_SENDABLE | (!g_ascii_strcasecmp(str, org) ? RECIP_ORGANIZER : 0);
-		set_SPropValue_proptag (&(recipient->in.req_lpProps[1]), PR_RECIPIENTS_FLAGS, (const void *)&val);
+		set_SPropValue_proptag (&(recipient->in.req_lpProps[1]), PR_RECIPIENTS_FLAGS, (gconstpointer )&val);
 
 		param = icalproperty_get_first_parameter (att_prop, ICAL_PARTSTAT_PARAMETER);
 		val = get_trackstatus_from_partstat (icalparameter_get_partstat(param));
-		set_SPropValue_proptag (&(recipient->in.req_lpProps[2]), PR_RECIPIENT_TRACKSTATUS, (const void *)&val);
+		set_SPropValue_proptag (&(recipient->in.req_lpProps[2]), PR_RECIPIENT_TRACKSTATUS, (gconstpointer )&val);
 
 		param = icalproperty_get_first_parameter (att_prop, ICAL_ROLE_PARAMETER);
 		val = get_type_from_role (icalparameter_get_role(param));
-		set_SPropValue_proptag (&(recipient->in.req_lpProps[3]), PR_RECIPIENT_TYPE, (const void *) &val);
+		set_SPropValue_proptag (&(recipient->in.req_lpProps[3]), PR_RECIPIENT_TYPE, (gconstpointer ) &val);
 
 		param = icalproperty_get_first_parameter (att_prop, ICAL_CN_PARAMETER);
 		str = icalparameter_get_cn (param);
 		str = (str) ? str : recipient->email_id;
-		set_SPropValue_proptag (&(recipient->in.req_lpProps[4]), PR_RECIPIENT_DISPLAY_NAME, (const void *)(str));
+		set_SPropValue_proptag (&(recipient->in.req_lpProps[4]), PR_RECIPIENT_DISPLAY_NAME, (gconstpointer )(str));
 
 		/* External recipient properties - set them only when the recipient is unresolved */
 		recipient->in.ext_cValues = 7;
 		recipient->in.ext_lpProps = g_new0 (struct SPropValue, recipient->in.ext_cValues + 1);
 
 		val = DT_MAILUSER;
-		set_SPropValue_proptag (&(recipient->in.ext_lpProps[0]), PR_DISPLAY_TYPE, (const void *)&val);
+		set_SPropValue_proptag (&(recipient->in.ext_lpProps[0]), PR_DISPLAY_TYPE, (gconstpointer )&val);
 		val = MAPI_MAILUSER;
-		set_SPropValue_proptag (&(recipient->in.ext_lpProps[1]), PR_OBJECT_TYPE, (const void *)&val);
+		set_SPropValue_proptag (&(recipient->in.ext_lpProps[1]), PR_OBJECT_TYPE, (gconstpointer )&val);
 		str = "SMTP";
-		set_SPropValue_proptag (&(recipient->in.ext_lpProps[2]), PR_ADDRTYPE, (const void *)(str));
+		set_SPropValue_proptag (&(recipient->in.ext_lpProps[2]), PR_ADDRTYPE, (gconstpointer )(str));
 		str = recipient->email_id;
-		set_SPropValue_proptag (&(recipient->in.ext_lpProps[3]), PR_SMTP_ADDRESS, (const void *)(str));
+		set_SPropValue_proptag (&(recipient->in.ext_lpProps[3]), PR_SMTP_ADDRESS, (gconstpointer )(str));
 
 		param = icalproperty_get_first_parameter (att_prop, ICAL_CN_PARAMETER);
 		str = icalparameter_get_cn (param);
 		str = (str) ? str : recipient->email_id;
-		set_SPropValue_proptag (&(recipient->in.ext_lpProps[4]), PR_GIVEN_NAME, (const void *)(str));
-		set_SPropValue_proptag (&(recipient->in.ext_lpProps[5]), PR_DISPLAY_NAME, (const void *)(str));
-		set_SPropValue_proptag (&(recipient->in.ext_lpProps[6]), PR_7BIT_DISPLAY_NAME, (const void *)(str));
+		set_SPropValue_proptag (&(recipient->in.ext_lpProps[4]), PR_GIVEN_NAME, (gconstpointer )(str));
+		set_SPropValue_proptag (&(recipient->in.ext_lpProps[5]), PR_DISPLAY_NAME, (gconstpointer )(str));
+		set_SPropValue_proptag (&(recipient->in.ext_lpProps[6]), PR_7BIT_DISPLAY_NAME, (gconstpointer )(str));
 
 		*recip_list = g_slist_append (*recip_list, recipient);
 
@@ -426,37 +426,37 @@ exchange_mapi_cal_util_fetch_recipients (ECalComponent *comp, GSList **recip_lis
 }
 
 static void
-set_attachments_to_cal_component (ECalComponent *comp, GSList *attach_list, const char *local_store_uri)
+set_attachments_to_cal_component (ECalComponent *comp, GSList *attach_list, const gchar *local_store_uri)
 {
 	GSList *comp_attach_list = NULL, *l;
-	const char *uid;
+	const gchar *uid;
 
 	g_return_if_fail (comp != NULL);
 
 	e_cal_component_get_uid (comp, &uid);
-	for (l = attach_list; l ; l = l->next) {
+	for (l = attach_list; l; l = l->next) {
 		ExchangeMAPIAttachment *attach_item = (ExchangeMAPIAttachment *) (l->data);
-		ExchangeMAPIStream *stream; 
-		gchar *attach_file_url, *filename; 
-		const char *str, *attach;
+		ExchangeMAPIStream *stream;
+		gchar *attach_file_url, *filename;
+		const gchar *str, *attach;
 		guint len;
-		int fd = -1;
+		gint fd = -1;
 
 		stream = exchange_mapi_util_find_stream (attach_item->streams, PR_ATTACH_DATA_BIN);
 		if (!stream)
 			continue;
 
-		attach = (const char *)stream->value->data;
+		attach = (const gchar *)stream->value->data;
 		len = stream->value->len;
 
-		str = (const char *) exchange_mapi_util_find_SPropVal_array_propval(attach_item->lpProps, PR_ATTACH_LONG_FILENAME);
+		str = (const gchar *) exchange_mapi_util_find_SPropVal_array_propval(attach_item->lpProps, PR_ATTACH_LONG_FILENAME);
 		if (!(str && *str))
-			str = (const char *) exchange_mapi_util_find_SPropVal_array_propval(attach_item->lpProps, PR_ATTACH_FILENAME);
+			str = (const gchar *) exchange_mapi_util_find_SPropVal_array_propval(attach_item->lpProps, PR_ATTACH_FILENAME);
 		attach_file_url = g_strconcat (local_store_uri, G_DIR_SEPARATOR_S, uid, "-", str, NULL);
 		filename = g_filename_from_uri (attach_file_url, NULL, NULL);
 
 		fd = g_open (filename, O_RDWR|O_CREAT|O_TRUNC|O_BINARY, 0600);
-		if (fd == -1) { 
+		if (fd == -1) {
 			/* skip gracefully */
 			g_debug ("Could not open %s for writing \n", filename);
 		} else if (len && write (fd, attach, len) == -1) {
@@ -475,7 +475,7 @@ set_attachments_to_cal_component (ECalComponent *comp, GSList *attach_list, cons
 	e_cal_component_set_attachment_list (comp, comp_attach_list);
 }
 
-static void 
+static void
 ical_attendees_from_props (icalcomponent *ical_comp, GSList *recipients, gboolean rsvp)
 {
 	GSList *l;
@@ -485,12 +485,12 @@ ical_attendees_from_props (icalcomponent *ical_comp, GSList *recipients, gboolea
 		icalparameter *param;
 		gchar *val;
 		const uint32_t *ui32;
-		const char *str;
-		const uint32_t *flags; 
+		const gchar *str;
+		const uint32_t *flags;
 
 		if (recip->email_id)
 			val = g_strdup_printf ("MAILTO:%s", recip->email_id);
-		else 
+		else
 			continue;
 
 		flags = (const uint32_t *) get_SPropValue_SRow_data (&recip->out_SRow, PR_RECIPIENTS_FLAGS);
@@ -499,9 +499,9 @@ ical_attendees_from_props (icalcomponent *ical_comp, GSList *recipients, gboolea
 			prop = icalproperty_new_organizer (val);
 
 			/* CN */
-			str = (const char *) exchange_mapi_util_find_row_propval (&recip->out_SRow, PR_RECIPIENT_DISPLAY_NAME);
+			str = (const gchar *) exchange_mapi_util_find_row_propval (&recip->out_SRow, PR_RECIPIENT_DISPLAY_NAME);
 			if (!str)
-				str = (const char *) exchange_mapi_util_find_row_propval (&recip->out_SRow, PR_DISPLAY_NAME);
+				str = (const gchar *) exchange_mapi_util_find_row_propval (&recip->out_SRow, PR_DISPLAY_NAME);
 			if (str) {
 				param = icalparameter_new_cn (str);
 				icalproperty_add_parameter (prop, param);
@@ -510,9 +510,9 @@ ical_attendees_from_props (icalcomponent *ical_comp, GSList *recipients, gboolea
 			prop = icalproperty_new_attendee (val);
 
 			/* CN */
-			str = (const char *) exchange_mapi_util_find_row_propval (&recip->out_SRow, PR_RECIPIENT_DISPLAY_NAME);
+			str = (const gchar *) exchange_mapi_util_find_row_propval (&recip->out_SRow, PR_RECIPIENT_DISPLAY_NAME);
 			if (!str)
-				str = (const char *) exchange_mapi_util_find_row_propval (&recip->out_SRow, PR_DISPLAY_NAME);
+				str = (const gchar *) exchange_mapi_util_find_row_propval (&recip->out_SRow, PR_DISPLAY_NAME);
 			if (str) {
 				param = icalparameter_new_cn (str);
 				icalproperty_add_parameter (prop, param);
@@ -548,7 +548,7 @@ static const uint8_t GID_START_SEQ[] = {
 };
 
 void
-exchange_mapi_cal_util_generate_globalobjectid (gboolean is_clean, const char *uid, struct Binary_r *sb)
+exchange_mapi_cal_util_generate_globalobjectid (gboolean is_clean, const gchar *uid, struct Binary_r *sb)
 {
 	GByteArray *ba;
 	guint32 flag32;
@@ -596,7 +596,7 @@ exchange_mapi_cal_util_generate_globalobjectid (gboolean is_clean, const char *u
 	sb->cb = ba->len;
 
 	d(g_message ("New GlobalObjectId.. Length: %d bytes.. Hex-data follows:", ba->len));
-	d(for (i = 0; i < ba->len; i++) 
+	d(for (i = 0; i < ba->len; i++)
 		g_print("0x%02X ", ba->data[i]));
 
 	g_byte_array_free (ba, FALSE);
@@ -669,13 +669,13 @@ id_to_string (GByteArray *ba)
 }
 
 ECalComponent *
-exchange_mapi_cal_util_mapi_props_to_comp (icalcomponent_kind kind, const gchar *mid, struct mapi_SPropValue_array *properties, 
-					   GSList *streams, GSList *recipients, GSList *attachments, 
-					   const char *local_store_uri, const icaltimezone *default_zone)
+exchange_mapi_cal_util_mapi_props_to_comp (icalcomponent_kind kind, const gchar *mid, struct mapi_SPropValue_array *properties,
+					   GSList *streams, GSList *recipients, GSList *attachments,
+					   const gchar *local_store_uri, const icaltimezone *default_zone)
 {
 	ECalComponent *comp = NULL;
 	struct timeval t;
-	ExchangeMAPIStream *body_stream; 
+	ExchangeMAPIStream *body_stream;
 	const gchar *subject = NULL, *body = NULL;
 	const uint32_t *ui32;
 	const bool *b;
@@ -706,12 +706,12 @@ exchange_mapi_cal_util_mapi_props_to_comp (icalcomponent_kind kind, const gchar
 	if (!subject)
 		subject = (const gchar *)exchange_mapi_util_find_array_propval(properties, PR_CONVERSATION_TOPIC);
 	if (!subject)
-		subject = ""; 
+		subject = "";
 
 	body = (const gchar *)exchange_mapi_util_find_array_propval(properties, PR_BODY);
 	if (!body) {
 		body_stream = exchange_mapi_util_find_stream (streams, PR_HTML);
-		body = body_stream ? (const gchar *) body_stream->value->data : ""; 
+		body = body_stream ? (const gchar *) body_stream->value->data : "";
 	}
 
 	/* set dtstamp - in UTC */
@@ -721,7 +721,7 @@ exchange_mapi_cal_util_mapi_props_to_comp (icalcomponent_kind kind, const gchar
 	/* created - in UTC */
 	prop = icalproperty_new_created (icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ()));
 	icalcomponent_add_property (ical_comp, prop);
-	
+
 	/* last modified - in UTC */
 	if (get_mapi_SPropValue_array_date_timeval (&t, properties, PR_LAST_MODIFICATION_TIME) == MAPI_E_SUCCESS) {
 		prop = icalproperty_new_lastmodified (icaltime_from_timet_with_zone (t.tv_sec, 0, utc_zone));
@@ -732,7 +732,7 @@ exchange_mapi_cal_util_mapi_props_to_comp (icalcomponent_kind kind, const gchar
 	icalcomponent_set_description (ical_comp, body);
 
 	if (icalcomponent_isa (ical_comp) == ICAL_VEVENT_COMPONENT) {
-		const char *location = NULL;
+		const gchar *location = NULL;
 		const gchar *dtstart_tz_location = NULL, *dtend_tz_location = NULL;
 		ExchangeMAPIStream *stream;
 
@@ -766,7 +766,7 @@ exchange_mapi_cal_util_mapi_props_to_comp (icalcomponent_kind kind, const gchar
 			g_free (value);
 		}
 
-		location = (const char *)exchange_mapi_util_find_array_propval(properties, PROP_TAG(PT_STRING8, 0x8208));
+		location = (const gchar *)exchange_mapi_util_find_array_propval(properties, PROP_TAG(PT_STRING8, 0x8208));
 		if (location && *location)
 			icalcomponent_set_location (ical_comp, location);
 
@@ -815,12 +815,12 @@ exchange_mapi_cal_util_mapi_props_to_comp (icalcomponent_kind kind, const gchar
 			ical_attendees_from_props (ical_comp, recipients, (b && *b));
 			if (icalcomponent_get_first_property (ical_comp, ICAL_ORGANIZER_PROPERTY) == NULL) {
 				gchar *val;
-//				const char *sender_name = (const char *) exchange_mapi_util_find_array_propval (properties, PR_SENDER_NAME);
-				const char *sender_email_type = (const char *) exchange_mapi_util_find_array_propval (properties, PR_SENDER_ADDRTYPE);
-				const char *sender_email = (const char *) exchange_mapi_util_find_array_propval (properties, PR_SENDER_EMAIL_ADDRESS);
-				const char *sent_name = (const char *) exchange_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_NAME);
-				const char *sent_email_type = (const char *) exchange_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_ADDRTYPE);
-				const char *sent_email = (const char *) exchange_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_EMAIL_ADDRESS);
+//				const gchar *sender_name = (const gchar *) exchange_mapi_util_find_array_propval (properties, PR_SENDER_NAME);
+				const gchar *sender_email_type = (const gchar *) exchange_mapi_util_find_array_propval (properties, PR_SENDER_ADDRTYPE);
+				const gchar *sender_email = (const gchar *) exchange_mapi_util_find_array_propval (properties, PR_SENDER_EMAIL_ADDRESS);
+				const gchar *sent_name = (const gchar *) exchange_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_NAME);
+				const gchar *sent_email_type = (const gchar *) exchange_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_ADDRTYPE);
+				const gchar *sent_email = (const gchar *) exchange_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_EMAIL_ADDRESS);
 
 				if (!g_utf8_collate (sender_email_type, "EX"))
 					sender_email = exchange_mapi_util_ex_to_smtp (sender_email);
@@ -851,19 +851,19 @@ exchange_mapi_cal_util_mapi_props_to_comp (icalcomponent_kind kind, const gchar
 			if (stream) {
 				exchange_mapi_cal_util_bin_to_rrule (stream->value, comp);
 			}
-		} 
+		}
 
 		b = (const bool *)find_mapi_SPropValue_data(properties, PROP_TAG(PT_BOOLEAN, 0x8503));
 		if (b && *b) {
 			struct timeval start, displaytime;
 
-			if ((get_mapi_SPropValue_array_date_timeval (&start, properties, PROP_TAG(PT_SYSTIME, 0x8502)) == MAPI_E_SUCCESS) 
+			if ((get_mapi_SPropValue_array_date_timeval (&start, properties, PROP_TAG(PT_SYSTIME, 0x8502)) == MAPI_E_SUCCESS)
 			 && (get_mapi_SPropValue_array_date_timeval (&displaytime, properties, PROP_TAG(PT_SYSTIME, 0x8560)) == MAPI_E_SUCCESS)) {
 				ECalComponentAlarm *e_alarm = e_cal_component_alarm_new ();
 				ECalComponentAlarmTrigger trigger;
 
 				trigger.type = E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START;
-				trigger.u.rel_duration = icaltime_subtract (icaltime_from_timet_with_zone (displaytime.tv_sec, 0, 0), 
+				trigger.u.rel_duration = icaltime_subtract (icaltime_from_timet_with_zone (displaytime.tv_sec, 0, 0),
 									    icaltime_from_timet_with_zone (start.tv_sec, 0, 0));
 
 				e_cal_component_alarm_set_action (e_alarm, E_CAL_COMPONENT_ALARM_DISPLAY);
@@ -877,7 +877,7 @@ exchange_mapi_cal_util_mapi_props_to_comp (icalcomponent_kind kind, const gchar
 	} else if (icalcomponent_isa (ical_comp) == ICAL_VTODO_COMPONENT) {
 		const double *complete = 0;
 
-		/* NOTE: Exchange tasks are DATE values, not DATE-TIME values, but maybe someday, we could expect Exchange to support it ;) */
+		/* NOTE: Exchange tasks are DATE values, not DATE-TIME values, but maybe someday, we could expect Exchange to support it;) */
 		if (get_mapi_SPropValue_array_date_timeval (&t, properties, PROP_TAG(PT_SYSTIME, 0x8104)) == MAPI_E_SUCCESS)
 			icalcomponent_set_dtstart (ical_comp, icaltime_from_timet_with_zone (t.tv_sec, 1, default_zone));
 		if (get_mapi_SPropValue_array_date_timeval (&t, properties, PROP_TAG(PT_SYSTIME, 0x8105)) == MAPI_E_SUCCESS)
@@ -886,7 +886,7 @@ exchange_mapi_cal_util_mapi_props_to_comp (icalcomponent_kind kind, const gchar
 		ui32 = (const uint32_t *)find_mapi_SPropValue_data(properties, PROP_TAG(PT_LONG, 0x8101));
 		if (ui32) {
 			icalcomponent_set_status (ical_comp, get_taskstatus_from_prop(*ui32));
-			if (*ui32 == olTaskComplete 
+			if (*ui32 == olTaskComplete
 			&& get_mapi_SPropValue_array_date_timeval (&t, properties, PROP_TAG(PT_SYSTIME, 0x810F)) == MAPI_E_SUCCESS) {
 				prop = icalproperty_new_completed (icaltime_from_timet_with_zone (t.tv_sec, 1, default_zone));
 				icalcomponent_add_property (ical_comp, prop);
@@ -895,7 +895,7 @@ exchange_mapi_cal_util_mapi_props_to_comp (icalcomponent_kind kind, const gchar
 
 		complete = (const double *)find_mapi_SPropValue_data(properties, PROP_TAG(PT_DOUBLE, 0x8102));
 		if (complete) {
-			prop = icalproperty_new_percentcomplete ((int)(*complete * 100));
+			prop = icalproperty_new_percentcomplete ((gint)(*complete * 100));
 			icalcomponent_add_property (ical_comp, prop);
 		}
 
@@ -960,12 +960,12 @@ static void
 change_partstat (ECalComponent *comp, const gchar *att, const gchar *sentby, icalparameter_partstat partstat)
 {
 	icalcomponent *icalcomp = e_cal_component_get_icalcomponent (comp);
-	icalproperty *attendee; 
+	icalproperty *attendee;
 	gboolean found = FALSE;
 
 	attendee = icalcomponent_get_first_property (icalcomp, ICAL_ATTENDEE_PROPERTY);
 	while (attendee) {
-		const char *value = icalproperty_get_attendee (attendee);
+		const gchar *value = icalproperty_get_attendee (attendee);
 		if (!g_ascii_strcasecmp (value, att)) {
 			icalparameter *param = icalparameter_new_partstat (partstat);
 			icalproperty_set_parameter (attendee, param);
@@ -992,11 +992,11 @@ static void
 remove_other_attendees (ECalComponent *comp, const gchar *att)
 {
 	icalcomponent *icalcomp = e_cal_component_get_icalcomponent (comp);
-	icalproperty *attendee; 
+	icalproperty *attendee;
 
 	attendee = icalcomponent_get_first_property (icalcomp, ICAL_ATTENDEE_PROPERTY);
 	while (attendee) {
-		const char *value = icalproperty_get_attendee (attendee);
+		const gchar *value = icalproperty_get_attendee (attendee);
 		if (g_ascii_strcasecmp (value, att))
 			icalcomponent_remove_property (icalcomp, attendee);
 
@@ -1007,7 +1007,7 @@ remove_other_attendees (ECalComponent *comp, const gchar *att)
 }
 
 static gboolean
-fetch_server_data_cb (FetchItemsCallbackData *item_data, gpointer data) 
+fetch_server_data_cb (FetchItemsCallbackData *item_data, gpointer data)
 {
 	struct mapi_SPropValue_array *properties = item_data->properties;
 	const mapi_id_t mid = item_data->mid;
@@ -1034,10 +1034,10 @@ fetch_server_data_cb (FetchItemsCallbackData *item_data, gpointer data)
 	cbdata->owneridtype = exchange_mapi_util_find_array_propval (properties, PR_SENDER_ADDRTYPE);
 	cbdata->ownerid = exchange_mapi_util_find_array_propval (properties, PR_SENDER_EMAIL_ADDRESS);
 
-	cbdata->comp = comp; 
+	cbdata->comp = comp;
 
 	exchange_mapi_util_free_recipient_list (&recipients);
-	
+
 	g_free (smid);
 	g_free (fileuri);
 	g_free (filename);
@@ -1046,23 +1046,23 @@ fetch_server_data_cb (FetchItemsCallbackData *item_data, gpointer data)
 }
 
 static void
-fetch_server_data (mapi_id_t mid, struct cbdata *cbd) 
+fetch_server_data (mapi_id_t mid, struct cbdata *cbd)
 {
 	icalcomponent_kind kind = ICAL_VEVENT_COMPONENT;
 	mapi_id_t fid;
 
 	fid = exchange_mapi_get_default_folder_id (olFolderCalendar);
 
-	exchange_mapi_connection_fetch_item (fid, mid, 
-					cal_GetPropsList, G_N_ELEMENTS (cal_GetPropsList), 
-					exchange_mapi_cal_util_build_name_id, GINT_TO_POINTER (kind), 
-					fetch_server_data_cb, cbd, 
+	exchange_mapi_connection_fetch_item (fid, mid,
+					cal_GetPropsList, G_N_ELEMENTS (cal_GetPropsList),
+					exchange_mapi_cal_util_build_name_id, GINT_TO_POINTER (kind),
+					fetch_server_data_cb, cbd,
 					MAPI_OPTIONS_FETCH_RECIPIENTS | MAPI_OPTIONS_FETCH_GENERIC_STREAMS);
 
 }
 
-static ECalComponent * 
-update_attendee_status (struct mapi_SPropValue_array *properties, mapi_id_t mid) 
+static ECalComponent *
+update_attendee_status (struct mapi_SPropValue_array *properties, mapi_id_t mid)
 {
 	const gchar *att, *att_sentby, *addrtype;
 	icalparameter_partstat partstat = ICAL_PARTSTAT_NONE;
@@ -1106,9 +1106,9 @@ update_attendee_status (struct mapi_SPropValue_array *properties, mapi_id_t mid)
 
 	if (cbdata.appt_seq == cur_seq) {
 
-/* 
+/*
  * The itip-formatter provides an option to update the attendee's status.
- * Hence, we need not update the server straight away. 
+ * Hence, we need not update the server straight away.
  */
 #if 0
 		gchar *filename = g_build_filename (g_get_home_dir (), TEMP_ATTACH_STORE, NULL);
@@ -1130,9 +1130,9 @@ update_attendee_status (struct mapi_SPropValue_array *properties, mapi_id_t mid)
 		cbdata.get_timezone = NULL;
 		cbdata.get_tz_data = NULL;
 
-		status = exchange_mapi_modify_item (olFolderCalendar, fid, mid, 
-				exchange_mapi_cal_util_build_name_id, GINT_TO_POINTER (kind), 
-				exchange_mapi_cal_util_build_props, &cbdata, 
+		status = exchange_mapi_modify_item (olFolderCalendar, fid, mid,
+				exchange_mapi_cal_util_build_name_id, GINT_TO_POINTER (kind),
+				exchange_mapi_cal_util_build_props, &cbdata,
 				recipients, attachments, streams, MAPI_OPTIONS_DONT_SUBMIT);
 		g_free (cbdata.props);
 
@@ -1140,11 +1140,11 @@ update_attendee_status (struct mapi_SPropValue_array *properties, mapi_id_t mid)
 		exchange_mapi_util_free_attachment_list (&attachments);
 		g_free (fileuri);
 		g_free (filename);
-#endif 
+#endif
 
 		/* remove the other attendees so not to confuse itip-formatter */
 		remove_other_attendees (cbdata.comp, matt);
-	} else { 
+	} else {
 		g_free (cbdata.props);
 		g_object_unref (cbdata.comp);
 		cbdata.comp = NULL;
@@ -1156,7 +1156,7 @@ update_attendee_status (struct mapi_SPropValue_array *properties, mapi_id_t mid)
 	return cbdata.comp;
 }
 
-static void 
+static void
 update_server_object (struct mapi_SPropValue_array *properties, GSList *attachments, ECalComponent *comp, mapi_id_t *mid)
 {
 	const uint32_t *ui32 = NULL;
@@ -1174,7 +1174,7 @@ update_server_object (struct mapi_SPropValue_array *properties, GSList *attachme
 		fetch_server_data (*mid, &server_cbd);
 
 		if (cur_seq > server_cbd.appt_seq) {
-			struct id_list idlist; 
+			struct id_list idlist;
 			GSList *ids = NULL;
 
 			idlist.id = *mid;
@@ -1182,7 +1182,7 @@ update_server_object (struct mapi_SPropValue_array *properties, GSList *attachme
 
 			exchange_mapi_remove_items (olFolderCalendar, fid, ids);
 			g_slist_free (ids);
-		} else 
+		} else
 			create_new = FALSE;
 
 		if (server_cbd.comp)
@@ -1197,12 +1197,12 @@ update_server_object (struct mapi_SPropValue_array *properties, GSList *attachme
 		icalcomponent_kind kind = icalcomponent_isa (e_cal_component_get_icalcomponent(comp));
 
 		cbdata.comp = comp;
-		cbdata.username = (const char *) exchange_mapi_util_find_array_propval (properties, PR_SENDER_NAME);
-		cbdata.useridtype = (const char *) exchange_mapi_util_find_array_propval (properties, PR_SENDER_ADDRTYPE);
-		cbdata.userid = (const char *) exchange_mapi_util_find_array_propval (properties, PR_SENDER_EMAIL_ADDRESS);
-		cbdata.ownername = (const char *) exchange_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_NAME);
-		cbdata.owneridtype = (const char *) exchange_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_ADDRTYPE);
-		cbdata.ownerid = (const char *) exchange_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_EMAIL_ADDRESS);
+		cbdata.username = (const gchar *) exchange_mapi_util_find_array_propval (properties, PR_SENDER_NAME);
+		cbdata.useridtype = (const gchar *) exchange_mapi_util_find_array_propval (properties, PR_SENDER_ADDRTYPE);
+		cbdata.userid = (const gchar *) exchange_mapi_util_find_array_propval (properties, PR_SENDER_EMAIL_ADDRESS);
+		cbdata.ownername = (const gchar *) exchange_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_NAME);
+		cbdata.owneridtype = (const gchar *) exchange_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_ADDRTYPE);
+		cbdata.ownerid = (const gchar *) exchange_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_EMAIL_ADDRESS);
 		cbdata.is_modify = FALSE;
 		cbdata.msgflags = MSGFLAG_READ;
 		cbdata.meeting_type = MEETING_REQUEST_RCVD;
@@ -1216,9 +1216,9 @@ update_server_object (struct mapi_SPropValue_array *properties, GSList *attachme
 
 		exchange_mapi_cal_util_fetch_recipients (comp, &myrecipients);
 		myattachments = attachments;
-		*mid = exchange_mapi_create_item (olFolderCalendar, 0, 
+		*mid = exchange_mapi_create_item (olFolderCalendar, 0,
 					exchange_mapi_cal_util_build_name_id, GINT_TO_POINTER(kind),
-					exchange_mapi_cal_util_build_props, &cbdata, 
+					exchange_mapi_cal_util_build_props, &cbdata,
 					myrecipients, myattachments, NULL, MAPI_OPTIONS_DONT_SUBMIT);
 		g_free (cbdata.props);
 		exchange_mapi_util_free_recipient_list (&myrecipients);
@@ -1249,7 +1249,7 @@ check_server_for_object (struct mapi_SPropValue_array *properties, mapi_id_t *mi
 
 	sb = (const struct SBinary *)find_mapi_SPropValue_data(properties, PROP_TAG(PT_BINARY, 0x0023));
 
-	set_SPropValue_proptag (&sprop, proptag, (const void *) sb);
+	set_SPropValue_proptag (&sprop, proptag, (gconstpointer ) sb);
 	cast_mapi_SPropValue (&(res.res.resProperty.lpProp), &sprop);
 
 	ids = exchange_mapi_util_check_restriction (fid, &res);
@@ -1267,18 +1267,18 @@ check_server_for_object (struct mapi_SPropValue_array *properties, mapi_id_t *mi
 }
 
 gchar *
-exchange_mapi_cal_util_camel_helper (struct mapi_SPropValue_array *properties, 
+exchange_mapi_cal_util_camel_helper (struct mapi_SPropValue_array *properties,
 				   GSList *streams, GSList *recipients, GSList *attachments)
 {
 	ECalComponent *comp = NULL;
 	icalcomponent_kind kind = ICAL_NO_COMPONENT;
 	icalproperty_method method = ICAL_METHOD_NONE;
-	const char *msg_class = NULL;
+	const gchar *msg_class = NULL;
 	mapi_id_t mid = 0;
 	icalcomponent *icalcomp = NULL;
 	gchar *str = NULL, *smid = NULL, *tmp, *filename, *fileuri;
 
-	msg_class = (const char *) exchange_mapi_util_find_array_propval (properties, PR_MESSAGE_CLASS);
+	msg_class = (const gchar *) exchange_mapi_util_find_array_propval (properties, PR_MESSAGE_CLASS);
 	g_return_val_if_fail (msg_class && *msg_class, NULL);
 	if (!g_ascii_strcasecmp (msg_class, IPM_SCHEDULE_MEETING_REQUEST)) {
 		method = ICAL_METHOD_REQUEST;
@@ -1298,10 +1298,10 @@ exchange_mapi_cal_util_camel_helper (struct mapi_SPropValue_array *properties,
 	check_server_for_object (properties, &mid);
 
 	if (method == ICAL_METHOD_REPLY) {
-		if (mid) { 
-	 		comp = update_attendee_status (properties, mid);
+		if (mid) {
+			comp = update_attendee_status (properties, mid);
 			set_attachments_to_cal_component (comp, attachments, fileuri);
-		} 
+		}
 	} else if (method == ICAL_METHOD_CANCEL) {
 		if (mid) {
 			struct cbdata server_cbd = { 0 };
@@ -1311,14 +1311,14 @@ exchange_mapi_cal_util_camel_helper (struct mapi_SPropValue_array *properties,
 
 			g_free (server_cbd.props);
 		}
-	} else if (method == ICAL_METHOD_REQUEST) { 
+	} else if (method == ICAL_METHOD_REQUEST) {
 		if (mid)
 			smid = exchange_mapi_util_mapi_id_to_string (mid);
-		else 
+		else
 			smid = e_cal_component_gen_uid();
 
-		comp = exchange_mapi_cal_util_mapi_props_to_comp (kind, smid, 
-							properties, streams, recipients, 
+		comp = exchange_mapi_cal_util_mapi_props_to_comp (kind, smid,
+							properties, streams, recipients,
 							NULL, NULL, NULL);
 		set_attachments_to_cal_component (comp, attachments, fileuri);
 
@@ -1336,7 +1336,7 @@ exchange_mapi_cal_util_camel_helper (struct mapi_SPropValue_array *properties,
 	icalcomp = e_cal_util_new_top_level ();
 	icalcomponent_set_method (icalcomp, method);
 	if (comp)
-		icalcomponent_add_component (icalcomp, 
+		icalcomponent_add_component (icalcomp,
 			icalcomponent_new_clone(e_cal_component_get_icalcomponent(comp)));
 	str = icalcomponent_as_ical_string_r (icalcomp);
 	icalcomponent_free (icalcomp);
@@ -1346,20 +1346,19 @@ exchange_mapi_cal_util_camel_helper (struct mapi_SPropValue_array *properties,
 	return str;
 }
 
-
 #define COMMON_NAMED_PROPS_N 9
 
-typedef enum 
+typedef enum
 {
-	I_COMMON_REMMINS = 0 , 
-	I_COMMON_REMTIME , 
-	I_COMMON_REMSET , 
-	I_COMMON_ISPRIVATE , 
-	I_COMMON_SIDEEFFECTS , 
-	I_COMMON_START , 
-	I_COMMON_END , 
-	I_COMMON_TASKMODE , 
-	I_COMMON_REMNEXTTIME 
+	I_COMMON_REMMINS = 0 ,
+	I_COMMON_REMTIME ,
+	I_COMMON_REMSET ,
+	I_COMMON_ISPRIVATE ,
+	I_COMMON_SIDEEFFECTS ,
+	I_COMMON_START ,
+	I_COMMON_END ,
+	I_COMMON_TASKMODE ,
+	I_COMMON_REMNEXTTIME
 } CommonNamedPropsIndex;
 
 gboolean
@@ -1367,22 +1366,22 @@ exchange_mapi_cal_util_build_name_id (struct mapi_nameid *nameid, gpointer data)
 {
 	icalcomponent_kind kind = GPOINTER_TO_INT (data);
 
-	/* NOTE: Avoid using mapi_nameid_OOM_add because: 
-	 * a) its inefficient (uses strcmp) 
-	 * b) names may vary in different server/libmapi versions 
+	/* NOTE: Avoid using mapi_nameid_OOM_add because:
+	 * a) its inefficient (uses strcmp)
+	 * b) names may vary in different server/libmapi versions
 	 */
 
-	mapi_nameid_lid_add(nameid, 0x8501, PSETID_Common); 	// PT_LONG - ReminderMinutesBeforeStart
-	mapi_nameid_lid_add(nameid, 0x8502, PSETID_Common); 	// PT_SYSTIME - ReminderTime
-	mapi_nameid_lid_add(nameid, 0x8503, PSETID_Common); 	// PT_BOOLEAN - ReminderSet
-	mapi_nameid_lid_add(nameid, 0x8506, PSETID_Common); 	// PT_BOOLEAN - Private
-	mapi_nameid_lid_add(nameid, 0x8510, PSETID_Common); 	// PT_LONG - (context menu flags)
-	mapi_nameid_lid_add(nameid, 0x8516, PSETID_Common); 	// PT_SYSTIME - CommonStart
-	mapi_nameid_lid_add(nameid, 0x8517, PSETID_Common); 	// PT_SYSTIME - CommonEnd
-	mapi_nameid_lid_add(nameid, 0x8518, PSETID_Common); 	// PT_LONG - TaskMode
-	mapi_nameid_lid_add(nameid, 0x8560, PSETID_Common); 	// PT_SYSTIME - ReminderNextTime
-
-	if (kind == ICAL_VEVENT_COMPONENT) 
+	mapi_nameid_lid_add(nameid, 0x8501, PSETID_Common);	// PT_LONG - ReminderMinutesBeforeStart
+	mapi_nameid_lid_add(nameid, 0x8502, PSETID_Common);	// PT_SYSTIME - ReminderTime
+	mapi_nameid_lid_add(nameid, 0x8503, PSETID_Common);	// PT_BOOLEAN - ReminderSet
+	mapi_nameid_lid_add(nameid, 0x8506, PSETID_Common);	// PT_BOOLEAN - Private
+	mapi_nameid_lid_add(nameid, 0x8510, PSETID_Common);	// PT_LONG - (context menu flags)
+	mapi_nameid_lid_add(nameid, 0x8516, PSETID_Common);	// PT_SYSTIME - CommonStart
+	mapi_nameid_lid_add(nameid, 0x8517, PSETID_Common);	// PT_SYSTIME - CommonEnd
+	mapi_nameid_lid_add(nameid, 0x8518, PSETID_Common);	// PT_LONG - TaskMode
+	mapi_nameid_lid_add(nameid, 0x8560, PSETID_Common);	// PT_SYSTIME - ReminderNextTime
+
+	if (kind == ICAL_VEVENT_COMPONENT)
 		appt_build_name_id (nameid);
 	else if (kind == ICAL_VTODO_COMPONENT)
 		task_build_name_id (nameid);
@@ -1393,179 +1392,177 @@ exchange_mapi_cal_util_build_name_id (struct mapi_nameid *nameid, gpointer data)
 }
 
 /**
- * NOTE: The enumerations '(Appt/Task/Note)NamedPropsIndex' have been defined 
- * only to make life a little easier for developers. Here's the logic 
+ * NOTE: The enumerations '(Appt/Task/Note)NamedPropsIndex' have been defined
+ * only to make life a little easier for developers. Here's the logic
  * behind the definition:
-     1) The first element is initialized with 'COMMON_NAMED_PROPS_N' : When 
-	adding named props, we add the common named props first and then the 
-	specific named props. So.. the index of the first specific 
+     1) The first element is initialized with 'COMMON_NAMED_PROPS_N' : When
+	adding named props, we add the common named props first and then the
+	specific named props. So.. the index of the first specific
 	named property = COMMON_NAMED_PROPS_N
-     2) The order in the enumeration 'must' be the same as that in the routine 
+     2) The order in the enumeration 'must' be the same as that in the routine
 	which adds the specific named props - (appt/task/note)_build_name_id
      3) If a specific named prop is added/deleted, an index needs to
-	be created/deleted at the correct position. [Don't forget to update 
-	(APPT/TASK/NOTE)_NAMED_PROPS_N]. 
+	be created/deleted at the correct position. [Don't forget to update
+	(APPT/TASK/NOTE)_NAMED_PROPS_N].
 
- * To summarize the pros: 
-     1) Addition/deletion of a common-named-prop would not affect the indexes 
-	of the specific named props once COMMON_NAMED_PROPS_N is updated. 
-     2) Values of named props can be added in any order. 
+ * To summarize the pros:
+     1) Addition/deletion of a common-named-prop would not affect the indexes
+	of the specific named props once COMMON_NAMED_PROPS_N is updated.
+     2) Values of named props can be added in any order.
  */
 
-
 #define APPT_NAMED_PROPS_N  29
 #define DEFAULT_APPT_REMINDER_MINS 15
 
-typedef enum 
+typedef enum
 {
-	I_APPT_SEQ = COMMON_NAMED_PROPS_N , 
-	I_APPT_BUSYSTATUS , 
-	I_APPT_LOCATION , 
-	I_APPT_START , 
-	I_APPT_END , 
-	I_APPT_DURATION , 
-	I_APPT_ALLDAY , 
-	I_APPT_RECURBLOB , 
-	I_APPT_STATEFLAGS , 
-	I_APPT_RESPONSESTATUS , 
-	I_APPT_RECURRING , 
-	I_APPT_INTENDEDBUSY , 
-	I_APPT_RECURBASE , 
-	I_APPT_INVITED , 
-	I_APPT_RECURTYPE , 
-	I_APPT_CLIPSTART , 
-	I_APPT_CLIPEND , 
-	I_APPT_AUTOLOCATION , 
-	I_APPT_ISCOUNTERPROPOSAL , 
-	I_APPT_NOTALLOWPROPOSE , 
-	I_APPT_STARTTZBLOB , 
-	I_APPT_ENDTZBLOB , 
-
-	I_MEET_WHERE , 
-	I_MEET_GUID , 
-	I_MEET_ISRECURRING , 
-	I_MEET_ISEXCEPTION , 
-	I_MEET_CLEANGUID , 
-	I_MEET_APPTMSGCLASS , 
+	I_APPT_SEQ = COMMON_NAMED_PROPS_N ,
+	I_APPT_BUSYSTATUS ,
+	I_APPT_LOCATION ,
+	I_APPT_START ,
+	I_APPT_END ,
+	I_APPT_DURATION ,
+	I_APPT_ALLDAY ,
+	I_APPT_RECURBLOB ,
+	I_APPT_STATEFLAGS ,
+	I_APPT_RESPONSESTATUS ,
+	I_APPT_RECURRING ,
+	I_APPT_INTENDEDBUSY ,
+	I_APPT_RECURBASE ,
+	I_APPT_INVITED ,
+	I_APPT_RECURTYPE ,
+	I_APPT_CLIPSTART ,
+	I_APPT_CLIPEND ,
+	I_APPT_AUTOLOCATION ,
+	I_APPT_ISCOUNTERPROPOSAL ,
+	I_APPT_NOTALLOWPROPOSE ,
+	I_APPT_STARTTZBLOB ,
+	I_APPT_ENDTZBLOB ,
+
+	I_MEET_WHERE ,
+	I_MEET_GUID ,
+	I_MEET_ISRECURRING ,
+	I_MEET_ISEXCEPTION ,
+	I_MEET_CLEANGUID ,
+	I_MEET_APPTMSGCLASS ,
 	I_MEET_TYPE
 
-//	I_APPT_SENDASICAL , 
-//	I_APPT_SEQTIME , 
-//	I_APPT_LABEL , 
-//	I_APPT_RECURPATTERN , 
-//	I_APPT_DISPTZ , 
-//	I_APPT_ALLATTENDEES , 
-//	I_APPT_TOATTENDEES , 
-//	I_APPT_CCATTENDEES , 
+//	I_APPT_SENDASICAL ,
+//	I_APPT_SEQTIME ,
+//	I_APPT_LABEL ,
+//	I_APPT_RECURPATTERN ,
+//	I_APPT_DISPTZ ,
+//	I_APPT_ALLATTENDEES ,
+//	I_APPT_TOATTENDEES ,
+//	I_APPT_CCATTENDEES ,
 } ApptNamedPropsIndex;
 
-static void 
+static void
 appt_build_name_id (struct mapi_nameid *nameid)
 {
-	mapi_nameid_lid_add(nameid, 0x8201, PSETID_Appointment); 	// PT_LONG - ApptSequence
-	mapi_nameid_lid_add(nameid, 0x8205, PSETID_Appointment); 	// PT_LONG - BusyStatus
-	mapi_nameid_lid_add(nameid, 0x8208, PSETID_Appointment); 	// PT_UNICODE - Location
-	mapi_nameid_lid_add(nameid, 0x820D, PSETID_Appointment); 	// PT_SYSTIME - Start/ApptStartWhole
-	mapi_nameid_lid_add(nameid, 0x820E, PSETID_Appointment); 	// PT_SYSTIME - End/ApptEndWhole
-	mapi_nameid_lid_add(nameid, 0x8213, PSETID_Appointment); 	// PT_LONG - Duration/ApptDuration
-	mapi_nameid_lid_add(nameid, 0x8215, PSETID_Appointment); 	// PT_BOOLEAN - AllDayEvent (also called ApptSubType)
-	mapi_nameid_lid_add(nameid, 0x8216, PSETID_Appointment); 	// PT_BINARY - (recurrence blob)
-	mapi_nameid_lid_add(nameid, 0x8217, PSETID_Appointment); 	// PT_LONG - ApptStateFlags
-	mapi_nameid_lid_add(nameid, 0x8218, PSETID_Appointment); 	// PT_LONG - ResponseStatus
-	mapi_nameid_lid_add(nameid, 0x8223, PSETID_Appointment); 	// PT_BOOLEAN - Recurring
-	mapi_nameid_lid_add(nameid, 0x8224, PSETID_Appointment); 	// PT_LONG - IntendedBusyStatus
-	mapi_nameid_lid_add(nameid, 0x8228, PSETID_Appointment); 	// PT_SYSTIME - RecurrenceBase
-	mapi_nameid_lid_add(nameid, 0x8229, PSETID_Appointment); 	// PT_BOOLEAN - FInvited
-	mapi_nameid_lid_add(nameid, 0x8231, PSETID_Appointment); 	// PT_LONG - RecurrenceType
-	mapi_nameid_lid_add(nameid, 0x8235, PSETID_Appointment); 	// PT_SYSTIME - (dtstart)(for recurring events UTC 12 AM of day of start)
-	mapi_nameid_lid_add(nameid, 0x8236, PSETID_Appointment); 	// PT_SYSTIME - (dtend)(for recurring events UTC 12 AM of day of end)
-	mapi_nameid_lid_add(nameid, 0x823A, PSETID_Appointment); 	// PT_BOOLEAN - AutoFillLocation
-	mapi_nameid_lid_add(nameid, 0x8257, PSETID_Appointment); 	// PT_BOOLEAN - ApptCounterProposal
-	mapi_nameid_lid_add(nameid, 0x825A, PSETID_Appointment); 	// PT_BOOLEAN - ApptNotAllowPropose
-	mapi_nameid_lid_add(nameid, 0x825E, PSETID_Appointment); 	// PT_BINARY - (timezone for dtstart)
-	mapi_nameid_lid_add(nameid, 0x825F, PSETID_Appointment); 	// PT_BINARY - (timezone for dtend)
-
-	mapi_nameid_lid_add(nameid, 0x0002, PSETID_Meeting); 		// PT_UNICODE - Where
-	mapi_nameid_lid_add(nameid, 0x0003, PSETID_Meeting); 		// PT_BINARY - GlobalObjectId
-	mapi_nameid_lid_add(nameid, 0x0005, PSETID_Meeting); 		// PT_BOOLEAN - IsRecurring
-	mapi_nameid_lid_add(nameid, 0x000A, PSETID_Meeting); 		// PT_BOOLEAN - IsException 
-	mapi_nameid_lid_add(nameid, 0x0023, PSETID_Meeting); 		// PT_BINARY - CleanGlobalObjectId
-	mapi_nameid_lid_add(nameid, 0x0024, PSETID_Meeting); 		// PT_STRING8 - AppointmentMessageClass 
-	mapi_nameid_lid_add(nameid, 0x0026, PSETID_Meeting); 		// PT_LONG - MeetingType
+	mapi_nameid_lid_add(nameid, 0x8201, PSETID_Appointment);	// PT_LONG - ApptSequence
+	mapi_nameid_lid_add(nameid, 0x8205, PSETID_Appointment);	// PT_LONG - BusyStatus
+	mapi_nameid_lid_add(nameid, 0x8208, PSETID_Appointment);	// PT_UNICODE - Location
+	mapi_nameid_lid_add(nameid, 0x820D, PSETID_Appointment);	// PT_SYSTIME - Start/ApptStartWhole
+	mapi_nameid_lid_add(nameid, 0x820E, PSETID_Appointment);	// PT_SYSTIME - End/ApptEndWhole
+	mapi_nameid_lid_add(nameid, 0x8213, PSETID_Appointment);	// PT_LONG - Duration/ApptDuration
+	mapi_nameid_lid_add(nameid, 0x8215, PSETID_Appointment);	// PT_BOOLEAN - AllDayEvent (also called ApptSubType)
+	mapi_nameid_lid_add(nameid, 0x8216, PSETID_Appointment);	// PT_BINARY - (recurrence blob)
+	mapi_nameid_lid_add(nameid, 0x8217, PSETID_Appointment);	// PT_LONG - ApptStateFlags
+	mapi_nameid_lid_add(nameid, 0x8218, PSETID_Appointment);	// PT_LONG - ResponseStatus
+	mapi_nameid_lid_add(nameid, 0x8223, PSETID_Appointment);	// PT_BOOLEAN - Recurring
+	mapi_nameid_lid_add(nameid, 0x8224, PSETID_Appointment);	// PT_LONG - IntendedBusyStatus
+	mapi_nameid_lid_add(nameid, 0x8228, PSETID_Appointment);	// PT_SYSTIME - RecurrenceBase
+	mapi_nameid_lid_add(nameid, 0x8229, PSETID_Appointment);	// PT_BOOLEAN - FInvited
+	mapi_nameid_lid_add(nameid, 0x8231, PSETID_Appointment);	// PT_LONG - RecurrenceType
+	mapi_nameid_lid_add(nameid, 0x8235, PSETID_Appointment);	// PT_SYSTIME - (dtstart)(for recurring events UTC 12 AM of day of start)
+	mapi_nameid_lid_add(nameid, 0x8236, PSETID_Appointment);	// PT_SYSTIME - (dtend)(for recurring events UTC 12 AM of day of end)
+	mapi_nameid_lid_add(nameid, 0x823A, PSETID_Appointment);	// PT_BOOLEAN - AutoFillLocation
+	mapi_nameid_lid_add(nameid, 0x8257, PSETID_Appointment);	// PT_BOOLEAN - ApptCounterProposal
+	mapi_nameid_lid_add(nameid, 0x825A, PSETID_Appointment);	// PT_BOOLEAN - ApptNotAllowPropose
+	mapi_nameid_lid_add(nameid, 0x825E, PSETID_Appointment);	// PT_BINARY - (timezone for dtstart)
+	mapi_nameid_lid_add(nameid, 0x825F, PSETID_Appointment);	// PT_BINARY - (timezone for dtend)
+
+	mapi_nameid_lid_add(nameid, 0x0002, PSETID_Meeting);		// PT_UNICODE - Where
+	mapi_nameid_lid_add(nameid, 0x0003, PSETID_Meeting);		// PT_BINARY - GlobalObjectId
+	mapi_nameid_lid_add(nameid, 0x0005, PSETID_Meeting);		// PT_BOOLEAN - IsRecurring
+	mapi_nameid_lid_add(nameid, 0x000A, PSETID_Meeting);		// PT_BOOLEAN - IsException
+	mapi_nameid_lid_add(nameid, 0x0023, PSETID_Meeting);		// PT_BINARY - CleanGlobalObjectId
+	mapi_nameid_lid_add(nameid, 0x0024, PSETID_Meeting);		// PT_STRING8 - AppointmentMessageClass
+	mapi_nameid_lid_add(nameid, 0x0026, PSETID_Meeting);		// PT_LONG - MeetingType
 
 	/* These probably would never be used from Evolution */
-//	mapi_nameid_lid_add(nameid, 0x8200, PSETID_Appointment); 	// PT_BOOLEAN - SendAsICAL
-//	mapi_nameid_lid_add(nameid, 0x8202, PSETID_Appointment); 	// PT_SYSTIME - ApptSequenceTime
-//	mapi_nameid_lid_add(nameid, 0x8214, PSETID_Appointment); 	// PT_LONG - Label
-//	mapi_nameid_lid_add(nameid, 0x8232, PSETID_Appointment); 	// PT_STRING8 - RecurrencePattern
-//	mapi_nameid_lid_add(nameid, 0x8234, PSETID_Appointment); 	// PT_STRING8 - display TimeZone
-//	mapi_nameid_lid_add(nameid, 0x8238, PSETID_Appointment); 	// PT_STRING8 - AllAttendees
-//	mapi_nameid_lid_add(nameid, 0x823B, PSETID_Appointment); 	// PT_STRING8 - ToAttendeesString (dupe PR_DISPLAY_TO)
-//	mapi_nameid_lid_add(nameid, 0x823C, PSETID_Appointment); 	// PT_STRING8 - CCAttendeesString (dupe PR_DISPLAY_CC)
+//	mapi_nameid_lid_add(nameid, 0x8200, PSETID_Appointment);	// PT_BOOLEAN - SendAsICAL
+//	mapi_nameid_lid_add(nameid, 0x8202, PSETID_Appointment);	// PT_SYSTIME - ApptSequenceTime
+//	mapi_nameid_lid_add(nameid, 0x8214, PSETID_Appointment);	// PT_LONG - Label
+//	mapi_nameid_lid_add(nameid, 0x8232, PSETID_Appointment);	// PT_STRING8 - RecurrencePattern
+//	mapi_nameid_lid_add(nameid, 0x8234, PSETID_Appointment);	// PT_STRING8 - display TimeZone
+//	mapi_nameid_lid_add(nameid, 0x8238, PSETID_Appointment);	// PT_STRING8 - AllAttendees
+//	mapi_nameid_lid_add(nameid, 0x823B, PSETID_Appointment);	// PT_STRING8 - ToAttendeesString (dupe PR_DISPLAY_TO)
+//	mapi_nameid_lid_add(nameid, 0x823C, PSETID_Appointment);	// PT_STRING8 - CCAttendeesString (dupe PR_DISPLAY_CC)
 }
 
 #define TASK_NAMED_PROPS_N 13
 #define DEFAULT_TASK_REMINDER_MINS 1080
 
-typedef enum 
+typedef enum
 {
-	I_TASK_STATUS = COMMON_NAMED_PROPS_N , 
-	I_TASK_PERCENT , 
-	I_TASK_ISTEAMTASK , 
-	I_TASK_START , 
-	I_TASK_DUE , 
-	I_TASK_COMPLETED , 
-//	I_TASK_RECURBLOB , 
-	I_TASK_ISCOMPLETE , 
-	I_TASK_OWNER , 
-	I_TASK_DELEGATOR , 
-	I_TASK_ISRECURRING , 
-	I_TASK_ROLE , 
-	I_TASK_OWNERSHIP , 
-	I_TASK_DELEGATIONSTATE , 
-//	I_TASK_ACTUALWORK , 
-//	I_TASK_TOTALWORK 
+	I_TASK_STATUS = COMMON_NAMED_PROPS_N ,
+	I_TASK_PERCENT ,
+	I_TASK_ISTEAMTASK ,
+	I_TASK_START ,
+	I_TASK_DUE ,
+	I_TASK_COMPLETED ,
+//	I_TASK_RECURBLOB ,
+	I_TASK_ISCOMPLETE ,
+	I_TASK_OWNER ,
+	I_TASK_DELEGATOR ,
+	I_TASK_ISRECURRING ,
+	I_TASK_ROLE ,
+	I_TASK_OWNERSHIP ,
+	I_TASK_DELEGATIONSTATE ,
+//	I_TASK_ACTUALWORK ,
+//	I_TASK_TOTALWORK
 } TaskNamedPropsIndex;
 
-static void 
+static void
 task_build_name_id (struct mapi_nameid *nameid)
 {
-	mapi_nameid_lid_add(nameid, 0x8101, PSETID_Task); 	// PT_LONG - Status
-	mapi_nameid_lid_add(nameid, 0x8102, PSETID_Task); 	// PT_DOUBLE - PercentComplete
-	mapi_nameid_lid_add(nameid, 0x8103, PSETID_Task); 	// PT_BOOLEAN - TeamTask
-	mapi_nameid_lid_add(nameid, 0x8104, PSETID_Task); 	// PT_SYSTIME - StartDate/TaskStartDate
-	mapi_nameid_lid_add(nameid, 0x8105, PSETID_Task); 	// PT_SYSTIME - DueDate/TaskDueDate
-	mapi_nameid_lid_add(nameid, 0x810F, PSETID_Task); 	// PT_SYSTIME - DateCompleted
-//	mapi_nameid_lid_add(nameid, 0x8116, PSETID_Task); 	// PT_BINARY - (recurrence blob)
-	mapi_nameid_lid_add(nameid, 0x811C, PSETID_Task); 	// PT_BOOLEAN - Complete
-	mapi_nameid_lid_add(nameid, 0x811F, PSETID_Task); 	// PT_STRING8 - Owner
-	mapi_nameid_lid_add(nameid, 0x8121, PSETID_Task); 	// PT_STRING8 - Delegator
-	mapi_nameid_lid_add(nameid, 0x8126, PSETID_Task); 	// PT_BOOLEAN - IsRecurring/TaskFRecur
-	mapi_nameid_lid_add(nameid, 0x8127, PSETID_Task); 	// PT_STRING8 - Role
-	mapi_nameid_lid_add(nameid, 0x8129, PSETID_Task); 	// PT_LONG - Ownership
-	mapi_nameid_lid_add(nameid, 0x812A, PSETID_Task); 	// PT_LONG - DelegationState
+	mapi_nameid_lid_add(nameid, 0x8101, PSETID_Task);	// PT_LONG - Status
+	mapi_nameid_lid_add(nameid, 0x8102, PSETID_Task);	// PT_DOUBLE - PercentComplete
+	mapi_nameid_lid_add(nameid, 0x8103, PSETID_Task);	// PT_BOOLEAN - TeamTask
+	mapi_nameid_lid_add(nameid, 0x8104, PSETID_Task);	// PT_SYSTIME - StartDate/TaskStartDate
+	mapi_nameid_lid_add(nameid, 0x8105, PSETID_Task);	// PT_SYSTIME - DueDate/TaskDueDate
+	mapi_nameid_lid_add(nameid, 0x810F, PSETID_Task);	// PT_SYSTIME - DateCompleted
+//	mapi_nameid_lid_add(nameid, 0x8116, PSETID_Task);	// PT_BINARY - (recurrence blob)
+	mapi_nameid_lid_add(nameid, 0x811C, PSETID_Task);	// PT_BOOLEAN - Complete
+	mapi_nameid_lid_add(nameid, 0x811F, PSETID_Task);	// PT_STRING8 - Owner
+	mapi_nameid_lid_add(nameid, 0x8121, PSETID_Task);	// PT_STRING8 - Delegator
+	mapi_nameid_lid_add(nameid, 0x8126, PSETID_Task);	// PT_BOOLEAN - IsRecurring/TaskFRecur
+	mapi_nameid_lid_add(nameid, 0x8127, PSETID_Task);	// PT_STRING8 - Role
+	mapi_nameid_lid_add(nameid, 0x8129, PSETID_Task);	// PT_LONG - Ownership
+	mapi_nameid_lid_add(nameid, 0x812A, PSETID_Task);	// PT_LONG - DelegationState
 
 	/* These probably would never be used from Evolution */
-//	mapi_nameid_lid_add(nameid, 0x8110, PSETID_Task); 	// PT_LONG - ActualWork/TaskActualEffort
-//	mapi_nameid_lid_add(nameid, 0x8111, PSETID_Task); 	// PT_LONG - TotalWork/TaskEstimatedEffort
+//	mapi_nameid_lid_add(nameid, 0x8110, PSETID_Task);	// PT_LONG - ActualWork/TaskActualEffort
+//	mapi_nameid_lid_add(nameid, 0x8111, PSETID_Task);	// PT_LONG - TotalWork/TaskEstimatedEffort
 }
 
-
 #define NOTE_NAMED_PROPS_N 3
 
-typedef enum 
+typedef enum
 {
-	I_NOTE_COLOR = COMMON_NAMED_PROPS_N , 
-	I_NOTE_WIDTH , 
+	I_NOTE_COLOR = COMMON_NAMED_PROPS_N ,
+	I_NOTE_WIDTH ,
 	I_NOTE_HEIGHT
 } NoteNamedPropsIndex;
 
-static void 
+static void
 note_build_name_id (struct mapi_nameid *nameid)
 {
-	mapi_nameid_lid_add(nameid, 0x8B00, PSETID_Note); 	// PT_LONG - Color
-	mapi_nameid_lid_add(nameid, 0x8B02, PSETID_Note); 	// PT_LONG - Width
-	mapi_nameid_lid_add(nameid, 0x8B03, PSETID_Note); 	// PT_LONG - Height
+	mapi_nameid_lid_add(nameid, 0x8B00, PSETID_Note);	// PT_LONG - Color
+	mapi_nameid_lid_add(nameid, 0x8B02, PSETID_Note);	// PT_LONG - Width
+	mapi_nameid_lid_add(nameid, 0x8B03, PSETID_Note);	// PT_LONG - Height
 }
 
 /* retrieves timezone location from a timezone ID */
@@ -1601,13 +1598,13 @@ get_tzid_location (const gchar *tzid, struct cbdata *cbdata)
 #define MINUTES_IN_HOUR 60
 #define SECS_IN_MINUTE 60
 
-/** 
- * NOTE: When a new regular property (PR_***) is added, 'REGULAR_PROPS_N' 
- * should be updated. 
+/**
+ * NOTE: When a new regular property (PR_***) is added, 'REGULAR_PROPS_N'
+ * should be updated.
  */
 #define REGULAR_PROPS_N    22
 
-int
+gint
 exchange_mapi_cal_util_build_props (struct SPropValue **value, struct SPropTagArray *proptag_array, gpointer data)
 {
 	struct cbdata *cbdata = (struct cbdata *) data;
@@ -1615,13 +1612,13 @@ exchange_mapi_cal_util_build_props (struct SPropValue **value, struct SPropTagAr
 	icalcomponent *ical_comp = e_cal_component_get_icalcomponent (comp);
 	icalcomponent_kind  kind = icalcomponent_isa (ical_comp);
 	struct SPropValue *props = NULL;
-	int i=0;
+	gint i=0;
 	uint32_t flag32;
 	bool b;
 	icalproperty *prop;
 	struct icaltimetype dtstart, dtend, utc_dtstart, utc_dtend;
 	const icaltimezone *utc_zone;
-	const char *dtstart_tz_location, *dtend_tz_location, *text = NULL;
+	const gchar *dtstart_tz_location, *dtend_tz_location, *text = NULL;
 	struct timeval t;
 
 	flag32 = REGULAR_PROPS_N + COMMON_NAMED_PROPS_N;
@@ -1637,7 +1634,7 @@ exchange_mapi_cal_util_build_props (struct SPropValue **value, struct SPropTagAr
 			break;
 		default:
 			return 0;
-	} 
+	}
 
 	d(g_debug ("Allocating space for %d props ", flag32));
 	props = g_new0 (struct SPropValue, flag32 + 1);
@@ -1654,7 +1651,7 @@ exchange_mapi_cal_util_build_props (struct SPropValue **value, struct SPropTagAr
 	/* For VTODOs */
 	else if (icalcomponent_get_first_property (ical_comp, ICAL_DUE_PROPERTY) != 0)
 		dtend = icalcomponent_get_due (ical_comp);
-	else 
+	else
 		dtend = icalcomponent_get_dtstart (ical_comp);
 
 	dtstart_tz_location = get_tzid_location (icaltime_get_tzid (dtstart), cbdata);
@@ -1664,63 +1661,63 @@ exchange_mapi_cal_util_build_props (struct SPropValue **value, struct SPropTagAr
 	utc_dtend = icaltime_convert_to_zone (dtend, (icaltimezone *)utc_zone);
 
 	text = icalcomponent_get_summary (ical_comp);
-	if (!(text && *text)) 
+	if (!(text && *text))
 		text = "";
-	set_SPropValue_proptag(&props[i++], PR_SUBJECT, 					/* propcount++ */ 
-					(const void *) text);
-	set_SPropValue_proptag(&props[i++], PR_NORMALIZED_SUBJECT, 				/* propcount++ */ 
-					(const void *) text);
+	set_SPropValue_proptag(&props[i++], PR_SUBJECT,						/* propcount++ */
+					(gconstpointer ) text);
+	set_SPropValue_proptag(&props[i++], PR_NORMALIZED_SUBJECT,				/* propcount++ */
+					(gconstpointer ) text);
 	if (cbdata->appt_seq == 0)
-		set_SPropValue_proptag(&props[i++], PR_CONVERSATION_TOPIC, 			/* propcount++ */
-						(const void *) text);
+		set_SPropValue_proptag(&props[i++], PR_CONVERSATION_TOPIC,			/* propcount++ */
+						(gconstpointer ) text);
 	text = NULL;
 
 	/* we don't support HTML event/task/memo editor */
 	flag32 = olEditorText;
-	set_SPropValue_proptag(&props[i++], PR_MSG_EDITOR_FORMAT, &flag32); 			/* propcount++ */
+	set_SPropValue_proptag(&props[i++], PR_MSG_EDITOR_FORMAT, &flag32);			/* propcount++ */
 
 	/* it'd be better to convert, then set it in unicode */
 	text = icalcomponent_get_description (ical_comp);
-	if (!(text && *text) || !g_utf8_validate (text, -1, NULL)) 
+	if (!(text && *text) || !g_utf8_validate (text, -1, NULL))
 		text = "";
-	set_SPropValue_proptag(&props[i++], PR_BODY, 						/* propcount++ */
-					(const void *) text);
+	set_SPropValue_proptag(&props[i++], PR_BODY,						/* propcount++ */
+					(gconstpointer ) text);
 	text = NULL;
 
 	/* Priority and Importance */
 	prop = icalcomponent_get_first_property (ical_comp, ICAL_PRIORITY_PROPERTY);
 	flag32 = prop ? get_prio_prop_from_priority (icalproperty_get_priority (prop)) : PRIORITY_NORMAL;
-	set_SPropValue_proptag(&props[i++], PR_PRIORITY, (const void *) &flag32); 		/* propcount++ */
+	set_SPropValue_proptag(&props[i++], PR_PRIORITY, (gconstpointer ) &flag32);		/* propcount++ */
 	flag32 = prop ? get_imp_prop_from_priority (icalproperty_get_priority (prop)) : IMPORTANCE_NORMAL;
-	set_SPropValue_proptag(&props[i++], PR_IMPORTANCE, (const void *) &flag32); 		/* propcount++ */
-
-	set_SPropValue_proptag(&props[i++], PR_SENT_REPRESENTING_NAME, 
-		(const void *) cbdata->ownername); 						/* propcount++ */
-	set_SPropValue_proptag(&props[i++], PR_SENT_REPRESENTING_ADDRTYPE, 
-		(const void *) cbdata->owneridtype); 						/* propcount++ */
-	set_SPropValue_proptag(&props[i++], PR_SENT_REPRESENTING_EMAIL_ADDRESS, 
-		(const void *) cbdata->ownerid); 						/* propcount++ */
-	set_SPropValue_proptag(&props[i++], PR_SENDER_NAME, 
-		(const void *) cbdata->username); 						/* propcount++ */
-	set_SPropValue_proptag(&props[i++], PR_SENDER_ADDRTYPE, 
-		(const void *) cbdata->useridtype); 						/* propcount++ */
-	set_SPropValue_proptag(&props[i++], PR_SENDER_EMAIL_ADDRESS, 
-		(const void *) cbdata->userid); 						/* propcount++ */
+	set_SPropValue_proptag(&props[i++], PR_IMPORTANCE, (gconstpointer ) &flag32);		/* propcount++ */
+
+	set_SPropValue_proptag(&props[i++], PR_SENT_REPRESENTING_NAME,
+		(gconstpointer ) cbdata->ownername);						/* propcount++ */
+	set_SPropValue_proptag(&props[i++], PR_SENT_REPRESENTING_ADDRTYPE,
+		(gconstpointer ) cbdata->owneridtype);						/* propcount++ */
+	set_SPropValue_proptag(&props[i++], PR_SENT_REPRESENTING_EMAIL_ADDRESS,
+		(gconstpointer ) cbdata->ownerid);						/* propcount++ */
+	set_SPropValue_proptag(&props[i++], PR_SENDER_NAME,
+		(gconstpointer ) cbdata->username);						/* propcount++ */
+	set_SPropValue_proptag(&props[i++], PR_SENDER_ADDRTYPE,
+		(gconstpointer ) cbdata->useridtype);						/* propcount++ */
+	set_SPropValue_proptag(&props[i++], PR_SENDER_EMAIL_ADDRESS,
+		(gconstpointer ) cbdata->userid);						/* propcount++ */
 
 	flag32 = cbdata->msgflags;
-	set_SPropValue_proptag(&props[i++], PR_MESSAGE_FLAGS, (const void *) &flag32); 		/* propcount++ */
+	set_SPropValue_proptag(&props[i++], PR_MESSAGE_FLAGS, (gconstpointer ) &flag32);		/* propcount++ */
 
 	flag32 = 0x0;
 	b = e_cal_component_has_alarms (comp);
 	if (b) {
 		/* We know there would be only a single alarm of type:DISPLAY [static properties of the backend] */
 		GList *alarm_uids = e_cal_component_get_alarm_uids (comp);
-		ECalComponentAlarm *alarm = e_cal_component_get_alarm (comp, (const char *)(alarm_uids->data));
+		ECalComponentAlarm *alarm = e_cal_component_get_alarm (comp, (const gchar *)(alarm_uids->data));
 		ECalComponentAlarmAction action;
 		e_cal_component_alarm_get_action (alarm, &action);
 		if (action == E_CAL_COMPONENT_ALARM_DISPLAY) {
 			ECalComponentAlarmTrigger trigger;
-			int dur_int = 0; 
+			gint dur_int = 0;
 			e_cal_component_alarm_get_trigger (alarm, &trigger);
 			switch (trigger.type) {
 			case E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START :
@@ -1734,7 +1731,7 @@ exchange_mapi_cal_util_build_props (struct SPropValue **value, struct SPropTagAr
 		}
 		e_cal_component_alarm_free (alarm);
 		cal_obj_uid_list_free (alarm_uids);
-	} 
+	}
 	if (!flag32)
 		switch (kind) {
 			case ICAL_VEVENT_COMPONENT:
@@ -1746,8 +1743,8 @@ exchange_mapi_cal_util_build_props (struct SPropValue **value, struct SPropTagAr
 			default:
 				break;
 		}
-	set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_REMSET], (const void *) &b);
-	set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_REMMINS], (const void *) &flag32);
+	set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_REMSET], (gconstpointer ) &b);
+	set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_REMMINS], (gconstpointer ) &flag32);
 	t.tv_sec = icaltime_as_timet (utc_dtstart);
 	t.tv_usec = 0;
 	set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[I_COMMON_REMTIME], &t);
@@ -1757,69 +1754,69 @@ exchange_mapi_cal_util_build_props (struct SPropValue **value, struct SPropTagAr
 	set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[I_COMMON_REMNEXTTIME], &t);
 
 	/* Sensitivity, Private */
-	flag32 = olNormal; 	/* default */
-	b = 0; 			/* default */
+	flag32 = olNormal;	/* default */
+	b = 0;			/* default */
 	prop = icalcomponent_get_first_property (ical_comp, ICAL_CLASS_PROPERTY);
-	if (prop) 
+	if (prop)
 		flag32 = get_prop_from_class (icalproperty_get_class (prop));
 	if (flag32 == olPrivate || flag32 == olConfidential)
 		b = 1;
-	set_SPropValue_proptag(&props[i++], PR_SENSITIVITY, (const void *) &flag32); 		/* propcount++ */
-	set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_ISPRIVATE], (const void *) &b);
+	set_SPropValue_proptag(&props[i++], PR_SENSITIVITY, (gconstpointer ) &flag32);		/* propcount++ */
+	set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_ISPRIVATE], (gconstpointer ) &b);
 
 	t.tv_sec = icaltime_as_timet (utc_dtstart);
 	t.tv_usec = 0;
 	set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[I_COMMON_START], &t);
-	set_SPropValue_proptag_date_timeval(&props[i++], PR_START_DATE, &t); 			/* propcount++ */
+	set_SPropValue_proptag_date_timeval(&props[i++], PR_START_DATE, &t);			/* propcount++ */
 
 	t.tv_sec = icaltime_as_timet (utc_dtend);
 	t.tv_usec = 0;
 	set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[I_COMMON_END], &t);
-	set_SPropValue_proptag_date_timeval(&props[i++], PR_END_DATE, &t); 			/* propcount++ */
+	set_SPropValue_proptag_date_timeval(&props[i++], PR_END_DATE, &t);			/* propcount++ */
 
 	b = 1;
-	set_SPropValue_proptag(&props[i++], PR_RESPONSE_REQUESTED, (const void *) &b); 		/* propcount++ */
+	set_SPropValue_proptag(&props[i++], PR_RESPONSE_REQUESTED, (gconstpointer ) &b);		/* propcount++ */
 
 	/* PR_OWNER_APPT_ID needs to be set in certain cases only */				/* propcount++ */
 	/* PR_ICON_INDEX needs to be set appropriately */					/* propcount++ */
 
 	b = 0;
-	set_SPropValue_proptag(&props[i++], PR_RTF_IN_SYNC, (const void *) &b); 		/* propcount++ */
+	set_SPropValue_proptag(&props[i++], PR_RTF_IN_SYNC, (gconstpointer ) &b);		/* propcount++ */
 
 	if (kind == ICAL_VEVENT_COMPONENT) {
-		const char *mapi_tzid;
-		struct Binary_r start_tz, end_tz; 
+		const gchar *mapi_tzid;
+		struct Binary_r start_tz, end_tz;
 
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_APPTMSGCLASS], (const void *) IPM_APPOINTMENT);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_APPTMSGCLASS], (gconstpointer ) IPM_APPOINTMENT);
 
 		/* Busy Status */
-		flag32 = olBusy; 	/* default */
+		flag32 = olBusy;	/* default */
 		prop = icalcomponent_get_first_property (ical_comp, ICAL_TRANSP_PROPERTY);
 		if (prop)
 			flag32 = get_prop_from_transp (icalproperty_get_transp (prop));
 		if (cbdata->meeting_type == MEETING_CANCEL)
 			flag32 = olFree;
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_INTENDEDBUSY], (const void *) &flag32);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_INTENDEDBUSY], (gconstpointer ) &flag32);
 
 		if (cbdata->meeting_type == MEETING_REQUEST || cbdata->meeting_type == MEETING_REQUEST_RCVD) {
 			flag32 = olTentative;
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_BUSYSTATUS], (const void *) &flag32);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_BUSYSTATUS], (gconstpointer ) &flag32);
 		} else if (cbdata->meeting_type == MEETING_CANCEL) {
 			flag32 = olFree;
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_BUSYSTATUS], (const void *) &flag32);
-		} else 
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_BUSYSTATUS], (const void *) &flag32);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_BUSYSTATUS], (gconstpointer ) &flag32);
+		} else
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_BUSYSTATUS], (gconstpointer ) &flag32);
 
 		/* Location */
 		text = icalcomponent_get_location (ical_comp);
-		if (!(text && *text)) 
+		if (!(text && *text))
 			text = "";
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_LOCATION], (const void *) text);
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_WHERE], (const void *) text);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_LOCATION], (gconstpointer ) text);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_WHERE], (gconstpointer ) text);
 		text = NULL;
 		/* Auto-Location is always FALSE - Evolution doesn't work that way */
-		b = 0; 
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_AUTOLOCATION], (const void *) &b);
+		b = 0;
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_AUTOLOCATION], (gconstpointer ) &b);
 
 		/* Start */
 		t.tv_sec = icaltime_as_timet (utc_dtstart);
@@ -1832,7 +1829,7 @@ exchange_mapi_cal_util_build_props (struct SPropValue **value, struct SPropTagAr
 		mapi_tzid = exchange_mapi_cal_tz_util_get_mapi_equivalent ((dtstart_tz_location && *dtstart_tz_location) ? dtstart_tz_location : "UTC");
 		if (mapi_tzid && *mapi_tzid) {
 			exchange_mapi_cal_util_mapi_tz_to_bin (mapi_tzid, &start_tz);
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_STARTTZBLOB], (const void *) &start_tz);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_STARTTZBLOB], (gconstpointer ) &start_tz);
 		}
 
 		/* End */
@@ -1846,219 +1843,219 @@ exchange_mapi_cal_util_build_props (struct SPropValue **value, struct SPropTagAr
 		mapi_tzid = exchange_mapi_cal_tz_util_get_mapi_equivalent ((dtend_tz_location && *dtend_tz_location) ? dtend_tz_location : "UTC");
 		if (mapi_tzid && *mapi_tzid) {
 			exchange_mapi_cal_util_mapi_tz_to_bin (mapi_tzid, &end_tz);
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_ENDTZBLOB], (const void *) &end_tz);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_ENDTZBLOB], (gconstpointer ) &end_tz);
 		}
 
 		/* Duration */
 		flag32 = icaldurationtype_as_int (icaltime_subtract (dtend, dtstart));
 		flag32 /= MINUTES_IN_HOUR;
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_DURATION], (const void *) &flag32);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_DURATION], (gconstpointer ) &flag32);
 
 		/* All-day event */
 		b = (icaltime_is_date (dtstart) && icaltime_is_date (dtend));
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_ALLDAY], (const void *) &b);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_ALLDAY], (gconstpointer ) &b);
 
 		if (e_cal_component_has_recurrences (comp)) {
-			GSList *rrule_list = NULL; 
+			GSList *rrule_list = NULL;
 			struct icalrecurrencetype *rt = NULL;
 
-			e_cal_component_get_rrule_list (comp, &rrule_list); 
+			e_cal_component_get_rrule_list (comp, &rrule_list);
 			rt = (struct icalrecurrencetype *)(rrule_list->data);
 
 			if (rt->freq == ICAL_DAILY_RECURRENCE)
-				flag32 = rectypeDaily; 
+				flag32 = rectypeDaily;
 			else if (rt->freq == ICAL_WEEKLY_RECURRENCE)
-				flag32 = rectypeWeekly; 
+				flag32 = rectypeWeekly;
 			else if (rt->freq == ICAL_MONTHLY_RECURRENCE)
-				flag32 = rectypeMonthly; 
+				flag32 = rectypeMonthly;
 			else if (rt->freq == ICAL_YEARLY_RECURRENCE)
-				flag32 = rectypeYearly; 
-			else 
+				flag32 = rectypeYearly;
+			else
 				flag32 = rectypeNone;
 
-			e_cal_component_free_recur_list (rrule_list); 
-		} else 
+			e_cal_component_free_recur_list (rrule_list);
+		} else
 			flag32 = rectypeNone;
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_RECURTYPE], (const void *) &flag32);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_RECURTYPE], (gconstpointer ) &flag32);
 
 		flag32 = cbdata->appt_id;
-		set_SPropValue_proptag(&props[i++], PR_OWNER_APPT_ID, (const void *) &flag32);
+		set_SPropValue_proptag(&props[i++], PR_OWNER_APPT_ID, (gconstpointer ) &flag32);
 
 		flag32 = cbdata->appt_seq;
-		set_SPropValue_proptag(&props[i++],  proptag_array->aulPropTag[I_APPT_SEQ], (const void *) &flag32);
+		set_SPropValue_proptag(&props[i++],  proptag_array->aulPropTag[I_APPT_SEQ], (gconstpointer ) &flag32);
 
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_CLEANGUID], (const void *) cbdata->cleanglobalid);
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_GUID], (const void *) cbdata->globalid);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_CLEANGUID], (gconstpointer ) cbdata->cleanglobalid);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_GUID], (gconstpointer ) cbdata->globalid);
 
 		flag32 = cbdata->resp;
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_RESPONSESTATUS], (const void *) &flag32);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_RESPONSESTATUS], (gconstpointer ) &flag32);
 
 		switch (cbdata->meeting_type) {
 		case MEETING_OBJECT :
-			set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (const void *) IPM_APPOINTMENT);
+			set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (gconstpointer ) IPM_APPOINTMENT);
 
-			flag32 = e_cal_component_has_recurrences (comp) ? RecurMeet : SingleMeet; 
-			set_SPropValue_proptag(&props[i++], PR_ICON_INDEX, (const void *) &flag32);
+			flag32 = e_cal_component_has_recurrences (comp) ? RecurMeet : SingleMeet;
+			set_SPropValue_proptag(&props[i++], PR_ICON_INDEX, (gconstpointer ) &flag32);
 
 			flag32 = 0x0171;
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_SIDEEFFECTS], (const void *) &flag32);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_SIDEEFFECTS], (gconstpointer ) &flag32);
 
 			flag32 = asfMeeting;
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_STATEFLAGS], (const void *) &flag32);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_STATEFLAGS], (gconstpointer ) &flag32);
 
-			flag32 = mtgRequest; 
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_TYPE], (const void *) &flag32);
+			flag32 = mtgRequest;
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_TYPE], (gconstpointer ) &flag32);
 
 			b = 1;
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_INVITED], (const void *) &b);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_INVITED], (gconstpointer ) &b);
 
 			break;
 		case MEETING_OBJECT_RCVD :
-			set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (const void *) IPM_APPOINTMENT);
+			set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (gconstpointer ) IPM_APPOINTMENT);
 
-			flag32 = e_cal_component_has_recurrences (comp) ? RecurMeet : SingleMeet; 
-			set_SPropValue_proptag(&props[i++], PR_ICON_INDEX, (const void *) &flag32);
+			flag32 = e_cal_component_has_recurrences (comp) ? RecurMeet : SingleMeet;
+			set_SPropValue_proptag(&props[i++], PR_ICON_INDEX, (gconstpointer ) &flag32);
 
 			flag32 = 0x0171;
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_SIDEEFFECTS], (const void *) &flag32);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_SIDEEFFECTS], (gconstpointer ) &flag32);
 
 			flag32 = asfMeeting | asfReceived;
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_STATEFLAGS], (const void *) &flag32);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_STATEFLAGS], (gconstpointer ) &flag32);
 
-			flag32 = mtgRequest; 
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_TYPE], (const void *) &flag32);
+			flag32 = mtgRequest;
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_TYPE], (gconstpointer ) &flag32);
 
 			b = 1;
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_INVITED], (const void *) &b);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_INVITED], (gconstpointer ) &b);
 
 			break;
 		case MEETING_REQUEST :
-			set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (const void *) IPM_SCHEDULE_MEETING_REQUEST);
+			set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (gconstpointer ) IPM_SCHEDULE_MEETING_REQUEST);
 
 			flag32 = 0xFFFFFFFF;  /* no idea why this has to be -1, but that's what the docs say */
-			set_SPropValue_proptag(&props[i++], PR_ICON_INDEX, (const void *) &flag32);
+			set_SPropValue_proptag(&props[i++], PR_ICON_INDEX, (gconstpointer ) &flag32);
 
 			flag32 = 0x1C61;
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_SIDEEFFECTS], (const void *) &flag32);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_SIDEEFFECTS], (gconstpointer ) &flag32);
 
 			flag32 = asfMeeting | asfReceived;
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_STATEFLAGS], (const void *) &flag32);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_STATEFLAGS], (gconstpointer ) &flag32);
 
-			flag32 = (cbdata->appt_seq == 0) ? mtgRequest : mtgFull; 
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_TYPE], (const void *) &flag32);
+			flag32 = (cbdata->appt_seq == 0) ? mtgRequest : mtgFull;
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_TYPE], (gconstpointer ) &flag32);
 
 			b = 1;
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_INVITED], (const void *) &b);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_INVITED], (gconstpointer ) &b);
 
 			break;
 		case MEETING_REQUEST_RCVD :
-			set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (const void *) IPM_APPOINTMENT);
+			set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (gconstpointer ) IPM_APPOINTMENT);
 
-			flag32 = e_cal_component_has_recurrences (comp) ? RecurMeet : SingleMeet; 
-			set_SPropValue_proptag(&props[i++], PR_ICON_INDEX, (const void *) &flag32);
+			flag32 = e_cal_component_has_recurrences (comp) ? RecurMeet : SingleMeet;
+			set_SPropValue_proptag(&props[i++], PR_ICON_INDEX, (gconstpointer ) &flag32);
 
 			flag32 = 0x0171;
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_SIDEEFFECTS], (const void *) &flag32);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_SIDEEFFECTS], (gconstpointer ) &flag32);
 
 			flag32 = asfMeeting | asfReceived;
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_STATEFLAGS], (const void *) &flag32);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_STATEFLAGS], (gconstpointer ) &flag32);
 
-			flag32 = mtgRequest; 
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_TYPE], (const void *) &flag32);
+			flag32 = mtgRequest;
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_TYPE], (gconstpointer ) &flag32);
 
 			b = 1;
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_INVITED], (const void *) &b);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_INVITED], (gconstpointer ) &b);
 
 			break;
 		case MEETING_CANCEL :
-			set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (const void *) IPM_SCHEDULE_MEETING_CANCELED);
+			set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (gconstpointer ) IPM_SCHEDULE_MEETING_CANCELED);
 
-			flag32 = 0xFFFFFFFF;  /* no idea why this has to be -1, but that's what the docs say */ 
-			set_SPropValue_proptag(&props[i++], PR_ICON_INDEX, (const void *) &flag32);
+			flag32 = 0xFFFFFFFF;  /* no idea why this has to be -1, but that's what the docs say */
+			set_SPropValue_proptag(&props[i++], PR_ICON_INDEX, (gconstpointer ) &flag32);
 
 			flag32 = 0x1C61;
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_SIDEEFFECTS], (const void *) &flag32);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_SIDEEFFECTS], (gconstpointer ) &flag32);
 
 			flag32 = asfMeeting | asfReceived | asfCanceled;
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_STATEFLAGS], (const void *) &flag32);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_STATEFLAGS], (gconstpointer ) &flag32);
 
-			flag32 = mtgEmpty; 
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_TYPE], (const void *) &flag32);
+			flag32 = mtgEmpty;
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_TYPE], (gconstpointer ) &flag32);
 
 			b = 1;
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_INVITED], (const void *) &b);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_INVITED], (gconstpointer ) &b);
 
 			break;
-		case MEETING_RESPONSE : 
+		case MEETING_RESPONSE :
 			if (cbdata->resp == olResponseAccepted) {
-				text = IPM_SCHEDULE_MEETING_RESP_POS; 
+				text = IPM_SCHEDULE_MEETING_RESP_POS;
 			} else if (cbdata->resp == olResponseTentative) {
-				text = IPM_SCHEDULE_MEETING_RESP_TENT; 
+				text = IPM_SCHEDULE_MEETING_RESP_TENT;
 			} else if (cbdata->resp == olResponseDeclined) {
-				text = IPM_SCHEDULE_MEETING_RESP_NEG; 
+				text = IPM_SCHEDULE_MEETING_RESP_NEG;
 			} else {
-				text = ""; 
+				text = "";
 			}
-			set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (const void *) text);
+			set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (gconstpointer ) text);
 			text = NULL;
 
-			flag32 = 0xFFFFFFFF;  /* no idea why this has to be -1, but that's what the docs say */ 
-			set_SPropValue_proptag(&props[i++], PR_ICON_INDEX, (const void *) &flag32);
+			flag32 = 0xFFFFFFFF;  /* no idea why this has to be -1, but that's what the docs say */
+			set_SPropValue_proptag(&props[i++], PR_ICON_INDEX, (gconstpointer ) &flag32);
 
 			flag32 = 0x1C61;
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_SIDEEFFECTS], (const void *) &flag32);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_SIDEEFFECTS], (gconstpointer ) &flag32);
 
 			flag32 = asfNone;
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_STATEFLAGS], (const void *) &flag32);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_STATEFLAGS], (gconstpointer ) &flag32);
 
-			flag32 = mtgEmpty; 
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_TYPE], (const void *) &flag32);
+			flag32 = mtgEmpty;
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_TYPE], (gconstpointer ) &flag32);
 
 			break;
 		case NOT_A_MEETING :
 		default :
-			set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (const void *) IPM_APPOINTMENT);
+			set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (gconstpointer ) IPM_APPOINTMENT);
 
-			flag32 = e_cal_component_has_recurrences (comp) ? RecurAppt : SingleAppt; 
-			set_SPropValue_proptag(&props[i++], PR_ICON_INDEX, (const void *) &flag32);
+			flag32 = e_cal_component_has_recurrences (comp) ? RecurAppt : SingleAppt;
+			set_SPropValue_proptag(&props[i++], PR_ICON_INDEX, (gconstpointer ) &flag32);
 
 			flag32 = 0x0171;
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_SIDEEFFECTS], (const void *) &flag32);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_SIDEEFFECTS], (gconstpointer ) &flag32);
 
 			flag32 = 0;
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_STATEFLAGS], (const void *) &flag32);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_STATEFLAGS], (gconstpointer ) &flag32);
 
 			b = 0;
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_INVITED], (const void *) &b);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_INVITED], (gconstpointer ) &b);
 
 			break;
 		}
 
 		b = e_cal_component_has_recurrences (comp);
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_RECURRING], (const void *) &b);
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_ISRECURRING], (const void *) &b);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_RECURRING], (gconstpointer ) &b);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_ISRECURRING], (gconstpointer ) &b);
 		/* FIXME: Modified exceptions */
 		b = e_cal_component_has_exceptions (comp) && FALSE; b = 0;
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_ISEXCEPTION], (const void *) &b);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_ISEXCEPTION], (gconstpointer ) &b);
 
 		/* Counter Proposal for appointments : not supported */
 		b = 1;
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_NOTALLOWPROPOSE], (const void *) &b);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_NOTALLOWPROPOSE], (gconstpointer ) &b);
 		b = 0;
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_ISCOUNTERPROPOSAL], (const void *) &b);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_ISCOUNTERPROPOSAL], (gconstpointer ) &b);
 
 	} else if (kind == ICAL_VTODO_COMPONENT) {
-		double d;
+		gdouble d;
 
-		set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (const void *) IPM_TASK);
+		set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (gconstpointer ) IPM_TASK);
 
 		/* Context menu flags */ /* FIXME: for assigned tasks */
-		flag32 = 0x0110; 
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_SIDEEFFECTS], (const void *) &flag32);
+		flag32 = 0x0110;
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_SIDEEFFECTS], (gconstpointer ) &flag32);
 
 		/* Status, Percent complete, IsComplete */
-		flag32 = olTaskNotStarted; 	/* default */
-		b = 0; 				/* default */
+		flag32 = olTaskNotStarted;	/* default */
+		b = 0;				/* default */
 		d = 0.0;
 		prop = icalcomponent_get_first_property (ical_comp, ICAL_PERCENTCOMPLETE_PROPERTY);
 		if (prop)
@@ -2070,16 +2067,16 @@ exchange_mapi_cal_util_build_props (struct SPropValue **value, struct SPropTagAr
 			d = 1.0;
 		}
 
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_TASK_STATUS], (const void *) &flag32);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_TASK_STATUS], (gconstpointer ) &flag32);
 
 		/* FIXME: bug in LibMAPI - does not handle PT_DOUBLE in set_SPropValue() */
-//		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_TASK_PERCENT], (const void *) &d); 
+//		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_TASK_PERCENT], (gconstpointer ) &d);
 		props[i].ulPropTag = proptag_array->aulPropTag[I_TASK_PERCENT];
 		props[i].dwAlignPad = 0x0;
 		memcpy (&(props[i].value.dbl), &d, sizeof(double));
-		i++; 
+		i++;
 
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_TASK_ISCOMPLETE], (const void *) &b);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_TASK_ISCOMPLETE], (gconstpointer ) &b);
 
 		/* Date completed */
 		if (b) {
@@ -2109,30 +2106,30 @@ exchange_mapi_cal_util_build_props (struct SPropValue **value, struct SPropTagAr
 
 		/* FIXME: Evolution does not support recurring tasks */
 		b = 0;
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_TASK_ISRECURRING], (const void *) &b);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_TASK_ISRECURRING], (gconstpointer ) &b);
 
 	} else if (kind == ICAL_VJOURNAL_COMPONENT) {
-		uint32_t color = olYellow; 
+		uint32_t color = olYellow;
 
-		set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (const void *) IPM_STICKYNOTE);
+		set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (gconstpointer ) IPM_STICKYNOTE);
 
 		/* Context menu flags */
-		flag32 = 0x0110; 
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_SIDEEFFECTS], (const void *) &flag32);
+		flag32 = 0x0110;
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_SIDEEFFECTS], (gconstpointer ) &flag32);
 
-		flag32 = 0x0300 + color; 
-		set_SPropValue_proptag(&props[i++], PR_ICON_INDEX, (const void *) &flag32);
+		flag32 = 0x0300 + color;
+		set_SPropValue_proptag(&props[i++], PR_ICON_INDEX, (gconstpointer ) &flag32);
 
-		flag32 = color; 
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_NOTE_COLOR], (const void *) &flag32);
+		flag32 = color;
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_NOTE_COLOR], (gconstpointer ) &flag32);
 
 		/* some random value */
-		flag32 = 0x00FF; 
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_NOTE_WIDTH], (const void *) &flag32);
+		flag32 = 0x00FF;
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_NOTE_WIDTH], (gconstpointer ) &flag32);
 
 		/* some random value */
-		flag32 = 0x00FF; 
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_NOTE_HEIGHT], (const void *) &flag32);
+		flag32 = 0x00FF;
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_NOTE_HEIGHT], (gconstpointer ) &flag32);
 	}
 
 	*value = props;
@@ -2160,14 +2157,14 @@ exchange_mapi_cal_util_get_new_appt_id (mapi_id_t fid)
 		id = g_random_int ();
 		if (id) {
 			GSList *ids = NULL;
-			set_SPropValue_proptag (&sprop, PR_OWNER_APPT_ID, (const void *) &id);
+			set_SPropValue_proptag (&sprop, PR_OWNER_APPT_ID, (gconstpointer ) &id);
 			cast_mapi_SPropValue (&(res.res.resProperty.lpProp), &sprop);
 			ids = exchange_mapi_util_check_restriction (fid, &res);
 			if (ids) {
 				GSList *l;
 				for (l = ids; l; l = l->next)
 					g_free (l->data);
-			} else 
+			} else
 				found = TRUE;
 		}
 	};
diff --git a/src/libexchangemapi/exchange-mapi-cal-utils.h b/src/libexchangemapi/exchange-mapi-cal-utils.h
index 3a6f2db..cd09f25 100644
--- a/src/libexchangemapi/exchange-mapi-cal-utils.h
+++ b/src/libexchangemapi/exchange-mapi-cal-utils.h
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -36,24 +36,24 @@
 G_BEGIN_DECLS
 
 typedef enum {
-	NOT_A_MEETING 		= (1 << 0), 
-	MEETING_OBJECT 		= (1 << 1), 
-	MEETING_OBJECT_SENT 	= (1 << 2), 
-	MEETING_OBJECT_RCVD 	= (1 << 3), 
-	MEETING_REQUEST 	= (1 << 4), 
-	MEETING_REQUEST_RCVD 	= (1 << 5), 
-	MEETING_RESPONSE 	= (1 << 6), 
-	MEETING_RESPONSE_RCVD 	= (1 << 7), 
-	MEETING_CANCEL 		= (1 << 8), 
-	MEETING_CANCEL_RCVD 	= (1 << 9) 
+	NOT_A_MEETING		= (1 << 0),
+	MEETING_OBJECT		= (1 << 1),
+	MEETING_OBJECT_SENT	= (1 << 2),
+	MEETING_OBJECT_RCVD	= (1 << 3),
+	MEETING_REQUEST		= (1 << 4),
+	MEETING_REQUEST_RCVD	= (1 << 5),
+	MEETING_RESPONSE	= (1 << 6),
+	MEETING_RESPONSE_RCVD	= (1 << 7),
+	MEETING_CANCEL		= (1 << 8),
+	MEETING_CANCEL_RCVD	= (1 << 9)
 } MAPIMeetingOptions;
 
-struct cbdata { 
+struct cbdata {
 	ECalComponent *comp;
 	struct SPropValue *props;
 	gboolean is_modify;
 
-	/* These are appt specific data */ 
+	/* These are appt specific data */
 	MAPIMeetingOptions meeting_type;
 	uint32_t appt_id;
 	uint32_t appt_seq;
@@ -61,13 +61,13 @@ struct cbdata {
 	const struct Binary_r *cleanglobalid;
 
 	uint32_t msgflags;
-	OlResponseStatus resp; 
-	const char *username;
-	const char *useridtype;
-	const char *userid;
-	const char *ownername;
-	const char *owneridtype;
-	const char *ownerid;
+	OlResponseStatus resp;
+	const gchar *username;
+	const gchar *useridtype;
+	const gchar *userid;
+	const gchar *ownername;
+	const gchar *owneridtype;
+	const gchar *ownerid;
 
 	/* custom callback to get timezone from a backend */
 	gpointer get_tz_data;
@@ -79,76 +79,76 @@ exchange_mapi_cal_util_fetch_organizer (ECalComponent *comp, GSList **recip_list
 void
 exchange_mapi_cal_util_fetch_recipients (ECalComponent *comp, GSList **recip_list);
 void
-exchange_mapi_cal_util_fetch_attachments (ECalComponent *comp, GSList **attach_list, const char *local_store_uri);
+exchange_mapi_cal_util_fetch_attachments (ECalComponent *comp, GSList **attach_list, const gchar *local_store_uri);
 
 ECalComponent *
-exchange_mapi_cal_util_mapi_props_to_comp (icalcomponent_kind kind, const gchar *mid, struct mapi_SPropValue_array *properties, 
-					   GSList *streams, GSList *recipients, GSList *attachments, 
-					   const char *local_store_uri, const icaltimezone *default_zone);
+exchange_mapi_cal_util_mapi_props_to_comp (icalcomponent_kind kind, const gchar *mid, struct mapi_SPropValue_array *properties,
+					   GSList *streams, GSList *recipients, GSList *attachments,
+					   const gchar *local_store_uri, const icaltimezone *default_zone);
 gboolean
 exchange_mapi_cal_util_build_name_id (struct mapi_nameid *nameid, gpointer data);
 
-int
+gint
 exchange_mapi_cal_util_build_props (struct SPropValue **value, struct SPropTagArray *proptag_array, gpointer data);
 
 void
-exchange_mapi_cal_util_generate_globalobjectid (gboolean is_clean, const char *uid, struct Binary_r *sb);
+exchange_mapi_cal_util_generate_globalobjectid (gboolean is_clean, const gchar *uid, struct Binary_r *sb);
 
 gchar *
-exchange_mapi_cal_util_camel_helper (struct mapi_SPropValue_array *properties, 
+exchange_mapi_cal_util_camel_helper (struct mapi_SPropValue_array *properties,
 				   GSList *streams, GSList *recipients, GSList *attachments);
 
 uint32_t
 exchange_mapi_cal_util_get_new_appt_id (mapi_id_t fid);
 
 static const uint32_t cal_GetPropsList[] = {
-	PR_FID, 
-	PR_MID, 
-
-	PR_SUBJECT, 
-	PR_SUBJECT_UNICODE, 
-	PR_NORMALIZED_SUBJECT, 
-	PR_NORMALIZED_SUBJECT_UNICODE, 
-	PR_CONVERSATION_TOPIC, 
-	PR_CONVERSATION_TOPIC_UNICODE, 
-	PR_BODY, 
-	PR_BODY_UNICODE, 
-
-	PR_CREATION_TIME, 
-	PR_LAST_MODIFICATION_TIME, 
-	PR_PRIORITY, 
-	PR_SENSITIVITY, 
-	PR_START_DATE, 
-	PR_END_DATE, 
-	PR_RESPONSE_REQUESTED, 
-	PR_OWNER_APPT_ID, 
-	PR_PROCESSED, 
-	PR_MSG_EDITOR_FORMAT, 
-
-	PR_SENT_REPRESENTING_NAME, 
-	PR_SENT_REPRESENTING_NAME_UNICODE, 
-	PR_SENT_REPRESENTING_ADDRTYPE, 
-	PR_SENT_REPRESENTING_ADDRTYPE_UNICODE, 
-	PR_SENT_REPRESENTING_EMAIL_ADDRESS, 
-	PR_SENT_REPRESENTING_EMAIL_ADDRESS_UNICODE, 
-
-	PR_SENDER_NAME, 
-	PR_SENDER_NAME_UNICODE, 
-	PR_SENDER_ADDRTYPE, 
-	PR_SENDER_ADDRTYPE_UNICODE, 
-	PR_SENDER_EMAIL_ADDRESS, 
-	PR_SENDER_EMAIL_ADDRESS_UNICODE, 
-
-	PR_RCVD_REPRESENTING_NAME, 
-	PR_RCVD_REPRESENTING_NAME_UNICODE, 
-	PR_RCVD_REPRESENTING_ADDRTYPE, 
-	PR_RCVD_REPRESENTING_ADDRTYPE_UNICODE, 
-	PR_RCVD_REPRESENTING_EMAIL_ADDRESS, 
+	PR_FID,
+	PR_MID,
+
+	PR_SUBJECT,
+	PR_SUBJECT_UNICODE,
+	PR_NORMALIZED_SUBJECT,
+	PR_NORMALIZED_SUBJECT_UNICODE,
+	PR_CONVERSATION_TOPIC,
+	PR_CONVERSATION_TOPIC_UNICODE,
+	PR_BODY,
+	PR_BODY_UNICODE,
+
+	PR_CREATION_TIME,
+	PR_LAST_MODIFICATION_TIME,
+	PR_PRIORITY,
+	PR_SENSITIVITY,
+	PR_START_DATE,
+	PR_END_DATE,
+	PR_RESPONSE_REQUESTED,
+	PR_OWNER_APPT_ID,
+	PR_PROCESSED,
+	PR_MSG_EDITOR_FORMAT,
+
+	PR_SENT_REPRESENTING_NAME,
+	PR_SENT_REPRESENTING_NAME_UNICODE,
+	PR_SENT_REPRESENTING_ADDRTYPE,
+	PR_SENT_REPRESENTING_ADDRTYPE_UNICODE,
+	PR_SENT_REPRESENTING_EMAIL_ADDRESS,
+	PR_SENT_REPRESENTING_EMAIL_ADDRESS_UNICODE,
+
+	PR_SENDER_NAME,
+	PR_SENDER_NAME_UNICODE,
+	PR_SENDER_ADDRTYPE,
+	PR_SENDER_ADDRTYPE_UNICODE,
+	PR_SENDER_EMAIL_ADDRESS,
+	PR_SENDER_EMAIL_ADDRESS_UNICODE,
+
+	PR_RCVD_REPRESENTING_NAME,
+	PR_RCVD_REPRESENTING_NAME_UNICODE,
+	PR_RCVD_REPRESENTING_ADDRTYPE,
+	PR_RCVD_REPRESENTING_ADDRTYPE_UNICODE,
+	PR_RCVD_REPRESENTING_EMAIL_ADDRESS,
 	PR_RCVD_REPRESENTING_EMAIL_ADDRESS_UNICODE
 };
 
 static const uint32_t cal_IDList[] = {
-	PR_FID, 
+	PR_FID,
 	PR_MID,
 	PR_LAST_MODIFICATION_TIME
 };
diff --git a/src/libexchangemapi/exchange-mapi-connection.c b/src/libexchangemapi/exchange-mapi-connection.c
index 7ae454d..7e1fb11 100644
--- a/src/libexchangemapi/exchange-mapi-connection.c
+++ b/src/libexchangemapi/exchange-mapi-connection.c
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -36,16 +36,15 @@
 static struct mapi_session *global_mapi_session= NULL;
 static GStaticRecMutex connect_lock = G_STATIC_REC_MUTEX_INIT;
 
-
-#define LOCK() 		g_debug("%s: %s: lock(connect_lock)", G_STRLOC, G_STRFUNC);g_static_rec_mutex_lock(&connect_lock);
-#define UNLOCK() 	g_debug("%s: %s: unlock(connect_lock)", G_STRLOC, G_STRFUNC);g_static_rec_mutex_unlock(&connect_lock);
+#define LOCK()		g_debug("%s: %s: lock(connect_lock)", G_STRLOC, G_STRFUNC);g_static_rec_mutex_lock(&connect_lock);
+#define UNLOCK()	g_debug("%s: %s: unlock(connect_lock)", G_STRLOC, G_STRFUNC);g_static_rec_mutex_unlock(&connect_lock);
 
 #if 0
-#define LOGALL() 	lp_set_cmdline(global_mapi_ctx->lp_ctx, "log level", "10"); global_mapi_ctx->dumpdata = TRUE;
-#define LOGNONE() 	lp_set_cmdline(global_mapi_ctx->lp_ctx, "log level", "0"); global_mapi_ctx->dumpdata = FALSE;
+#define LOGALL()	lp_set_cmdline(global_mapi_ctx->lp_ctx, "log level", "10"); global_mapi_ctx->dumpdata = TRUE;
+#define LOGNONE()	lp_set_cmdline(global_mapi_ctx->lp_ctx, "log level", "0"); global_mapi_ctx->dumpdata = FALSE;
 
-#define ENABLE_VERBOSE_LOG() 	global_mapi_ctx->dumpdata = TRUE;
-#define DISABLE_VERBOSE_LOG() 	global_mapi_ctx->dumpdata = FALSE;
+#define ENABLE_VERBOSE_LOG()	global_mapi_ctx->dumpdata = TRUE;
+#define DISABLE_VERBOSE_LOG()	global_mapi_ctx->dumpdata = FALSE;
 #endif
 
 //#if 0
@@ -54,7 +53,7 @@ static GStaticRecMutex connect_lock = G_STATIC_REC_MUTEX_INIT;
 
 #define ENABLE_VERBOSE_LOG()
 #define DISABLE_VERBOSE_LOG()
-//#endif 
+//#endif
 
 /* Specifies READ/WRITE sizes to be used while handling normal streams */
 #define STREAM_MAX_READ_SIZE    0x1000
@@ -64,15 +63,15 @@ static GStaticRecMutex connect_lock = G_STATIC_REC_MUTEX_INIT;
 #define STREAM_ACCESS_READWRITE 0x0002
 
 static
-void mapi_debug_logger (const gchar* domain, GLogLevelFlags level,
-			const gchar* message, gpointer data)
+void mapi_debug_logger (const gchar * domain, GLogLevelFlags level,
+			const gchar * message, gpointer data)
 {
 	g_print ("[DEBUG] %s\n", message);
 }
 
 static
-void mapi_debug_logger_muted (const gchar* domain, GLogLevelFlags level,
-			      const gchar* message, gpointer data)
+void mapi_debug_logger_muted (const gchar * domain, GLogLevelFlags level,
+			      const gchar * message, gpointer data)
 {
 	/*Nothing here. Just a dummy function*/
 }
@@ -126,18 +125,18 @@ ensure_mapi_init_called (void)
 }
 
 static struct mapi_session *
-mapi_profile_load (const char *profname, const char *password)
+mapi_profile_load (const gchar *profname, const gchar *password)
 {
 	enum MAPISTATUS	retval = MAPI_E_SUCCESS;
 	struct mapi_session *session = NULL;
 	gchar *default_profile_name = NULL;
-	const char *profile = NULL;
+	const gchar *profile = NULL;
 	guint32 debug_log_level = 0;
 
 	/* Initialize libexchangemapi logger*/
 	if (g_getenv ("EXCHANGEMAPI_DEBUG")) {
 		g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, mapi_debug_logger, NULL);
-	} else 
+	} else
 		g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, mapi_debug_logger_muted, NULL);
 
 	g_debug("%s: Entering %s ", G_STRLOC, G_STRFUNC);
@@ -152,7 +151,6 @@ mapi_profile_load (const char *profname, const char *password)
 		SetMAPIDebugLevel(debug_log_level);
 	}
 
-
 	if (profname)
 		profile = profname;
 	else {
@@ -183,8 +181,8 @@ exchange_mapi_connection_exists ()
 	return global_mapi_session != NULL;
 }
 
-gboolean 
-exchange_mapi_connection_new (const char *profile, const char *password)
+gboolean
+exchange_mapi_connection_new (const gchar *profile, const gchar *password)
 {
 	LOCK();
 	if (!global_mapi_session)
@@ -223,17 +221,17 @@ exchange_mapi_connection_close (void)
 	UNLOCK();
 }
 
-static gboolean 
+static gboolean
 exchange_mapi_util_read_generic_stream (mapi_object_t *obj_message, uint32_t proptag, GSList **stream_list)
 {
 	enum MAPISTATUS	retval;
-	TALLOC_CTX 	*mem_ctx;
-	mapi_object_t 	obj_stream;
-	uint16_t 	cn_read = 0;
-	uint32_t 	off_data = 0;
+	TALLOC_CTX	*mem_ctx;
+	mapi_object_t	obj_stream;
+	uint16_t	cn_read = 0;
+	uint32_t	off_data = 0;
 	uint8_t		*buf_data = NULL;
-	uint32_t 	buf_size = 0;
-	gboolean 	done = FALSE;
+	uint32_t	buf_size = 0;
+	gboolean	done = FALSE;
 
 	/* sanity */
 	g_return_val_if_fail (obj_message, FALSE);
@@ -265,7 +263,7 @@ exchange_mapi_util_read_generic_stream (mapi_object_t *obj_message, uint32_t pro
 
 	buf_data = talloc_size (mem_ctx, buf_size);
 	if (!buf_data)
-		goto cleanup; 
+		goto cleanup;
 
 	/* Read from the stream */
 	while (!done) {
@@ -273,11 +271,11 @@ exchange_mapi_util_read_generic_stream (mapi_object_t *obj_message, uint32_t pro
 				    (buf_data) + off_data,
 				    STREAM_MAX_READ_SIZE,
 				    &cn_read);
-		if (retval != MAPI_E_SUCCESS) { 
+		if (retval != MAPI_E_SUCCESS) {
 			mapi_errstr("ReadStream", GetLastError());
-			done = TRUE; 
+			done = TRUE;
 		} else if (cn_read == 0) {
-			done = TRUE; 
+			done = TRUE;
 		} else {
 			off_data += cn_read;
 			if (off_data >= buf_size)
@@ -286,16 +284,16 @@ exchange_mapi_util_read_generic_stream (mapi_object_t *obj_message, uint32_t pro
 	};
 
 	if (retval == MAPI_E_SUCCESS) {
-		ExchangeMAPIStream 		*stream = g_new0 (ExchangeMAPIStream, 1);
-		struct mapi_SPropValue_array 	properties_array;
+		ExchangeMAPIStream		*stream = g_new0 (ExchangeMAPIStream, 1);
+		struct mapi_SPropValue_array	properties_array;
 
 		stream->value = g_byte_array_sized_new (off_data);
 		stream->value = g_byte_array_append (stream->value, buf_data, off_data);
 
 		/* Build a mapi_SPropValue_array structure */
-		properties_array.cValues = 1; 
+		properties_array.cValues = 1;
 		properties_array.lpProps = talloc_zero_array (mem_ctx, struct mapi_SPropValue, properties_array.cValues + 1);
-		properties_array.lpProps[0].ulPropTag = proptag; 
+		properties_array.lpProps[0].ulPropTag = proptag;
 		/* This call is needed in case the read stream was a named prop. */
 		mapi_SPropValue_array_named (obj_message, &properties_array);
 
@@ -306,7 +304,7 @@ exchange_mapi_util_read_generic_stream (mapi_object_t *obj_message, uint32_t pro
 		*stream_list = g_slist_append (*stream_list, stream);
 	}
 
-cleanup: 
+cleanup:
 	mapi_object_release(&obj_stream);
 	talloc_free (mem_ctx);
 
@@ -319,15 +317,15 @@ static gboolean
 exchange_mapi_util_read_body_stream (mapi_object_t *obj_message, GSList **stream_list, gboolean getbestbody)
 {
 	enum MAPISTATUS			retval;
-	TALLOC_CTX 			*mem_ctx;
+	TALLOC_CTX			*mem_ctx;
 	struct SPropTagArray		*SPropTagArray;
 	struct SPropValue		*lpProps;
 	uint32_t			count;
 	DATA_BLOB			body;
-	uint8_t 			editor;
-	const char			*data = NULL;
-	const bool 			*rtf_in_sync;
-	uint32_t 			proptag = 0;
+	uint8_t			editor;
+	const gchar			*data = NULL;
+	const bool			*rtf_in_sync;
+	uint32_t			proptag = 0;
 
 	/* sanity check */
 	g_return_val_if_fail (obj_message, FALSE);
@@ -360,11 +358,11 @@ exchange_mapi_util_read_body_stream (mapi_object_t *obj_message, GSList **stream
 		if (retval != MAPI_E_SUCCESS) {
 			mapi_errstr("GetBestBody", GetLastError());
 			/* On failure, fallback to Plain Text */
-			editor = olEditorText; 
+			editor = olEditorText;
 		}
 
-		/* HACK : We can't handle RTF. So default to HTML */ 
-		if (editor != olEditorText && editor != olEditorHTML) 
+		/* HACK : We can't handle RTF. So default to HTML */
+		if (editor != olEditorText && editor != olEditorHTML)
 			editor = olEditorHTML;
 	} else {
 		const uint32_t *ui32 = (const uint32_t *) get_SPropValue(lpProps, PR_MSG_EDITOR_FORMAT);
@@ -379,26 +377,26 @@ exchange_mapi_util_read_body_stream (mapi_object_t *obj_message, GSList **stream
 	retval = -1;
 	switch (editor) {
 		case olEditorText:
-			if ((data = (const char *) get_SPropValue (lpProps, PR_BODY_UNICODE)) != NULL)
+			if ((data = (const gchar *) get_SPropValue (lpProps, PR_BODY_UNICODE)) != NULL)
 				proptag = PR_BODY_UNICODE;
-			else if ((data = (const char *) get_SPropValue (lpProps, PR_BODY)) != NULL)
+			else if ((data = (const gchar *) get_SPropValue (lpProps, PR_BODY)) != NULL)
 				proptag = PR_BODY;
 			if (data) {
-				size_t size = strlen(data)+1;
+				gsize size = strlen(data)+1;
 				body.data = talloc_memdup(mem_ctx, data, size);
 				body.length = size;
 				retval = MAPI_E_SUCCESS;
-			} 
+			}
 			break;
-		case olEditorHTML: 
+		case olEditorHTML:
 			/* Fixme : */
- 			/*if ((data = (const char *) get_SPropValue (lpProps, PR_BODY_HTML_UNICODE)) != NULL) */
- 			/*	proptag = PR_BODY_HTML_UNICODE; */
-			if ((data = (const char *) get_SPropValue (lpProps, PR_BODY_HTML)) != NULL)
+			/*if ((data = (const gchar *) get_SPropValue (lpProps, PR_BODY_HTML_UNICODE)) != NULL) */
+			/*	proptag = PR_BODY_HTML_UNICODE; */
+			if ((data = (const gchar *) get_SPropValue (lpProps, PR_BODY_HTML)) != NULL)
 				proptag = PR_BODY_HTML;
 
 			if (data) {
-				size_t size = strlen(data)+1;
+				gsize size = strlen(data)+1;
 				body.data = talloc_memdup(mem_ctx, data, size);
 				body.length = size;
 				retval = MAPI_E_SUCCESS;
@@ -406,7 +404,7 @@ exchange_mapi_util_read_body_stream (mapi_object_t *obj_message, GSList **stream
 				retval = MAPI_E_SUCCESS;
 			}
 			break;
-		case olEditorRTF: 
+		case olEditorRTF:
 			rtf_in_sync = (const bool *) get_SPropValue (lpProps, PR_RTF_IN_SYNC);
 //			if (!(rtf_in_sync && *rtf_in_sync))
 			{
@@ -433,12 +431,12 @@ exchange_mapi_util_read_body_stream (mapi_object_t *obj_message, GSList **stream
 				mapi_object_release(&obj_stream);
 			}
 			break;
-		default: 
+		default:
 			break;
 	}
 
 	if (retval == MAPI_E_SUCCESS && proptag) {
-		ExchangeMAPIStream 	*stream = g_new0 (ExchangeMAPIStream, 1);
+		ExchangeMAPIStream	*stream = g_new0 (ExchangeMAPIStream, 1);
 
 		stream->value = g_byte_array_sized_new (body.length);
 		stream->value = g_byte_array_append (stream->value, body.data, body.length);
@@ -457,18 +455,18 @@ exchange_mapi_util_read_body_stream (mapi_object_t *obj_message, GSList **stream
 
 /* Returns TRUE if all streams were written succcesfully, else returns FALSE */
 static gboolean
-exchange_mapi_util_write_generic_streams (mapi_object_t *obj_message, GSList *stream_list) 
+exchange_mapi_util_write_generic_streams (mapi_object_t *obj_message, GSList *stream_list)
 {
-	GSList 		*l;
+	GSList		*l;
 	enum MAPISTATUS	retval;
-	gboolean 	status = TRUE;
+	gboolean	status = TRUE;
 
 	g_debug("%s: Entering %s ", G_STRLOC, G_STRFUNC);
 
 	for (l = stream_list; l; l = l->next) {
-		ExchangeMAPIStream 	*stream = (ExchangeMAPIStream *) (l->data);
-		uint32_t 		total_written;
-		gboolean 		done = FALSE;
+		ExchangeMAPIStream	*stream = (ExchangeMAPIStream *) (l->data);
+		uint32_t		total_written;
+		gboolean		done = FALSE;
 		mapi_object_t		obj_stream;
 
 		mapi_object_init(&obj_stream);
@@ -490,10 +488,10 @@ exchange_mapi_util_write_generic_streams (mapi_object_t *obj_message, GSList *st
 		total_written = 0;
 		/* Write attachment */
 		while (!done) {
-			uint16_t 	cn_written = 0;
-			DATA_BLOB 	blob;
+			uint16_t	cn_written = 0;
+			DATA_BLOB	blob;
 
-			blob.length = (stream->value->len - total_written) < STREAM_MAX_WRITE_SIZE ? 
+			blob.length = (stream->value->len - total_written) < STREAM_MAX_WRITE_SIZE ?
 					(stream->value->len - total_written) : STREAM_MAX_WRITE_SIZE;
 			blob.data = (stream->value->data) + total_written;
 
@@ -505,7 +503,7 @@ exchange_mapi_util_write_generic_streams (mapi_object_t *obj_message, GSList *st
 				mapi_errstr("WriteStream", GetLastError());
 				done = TRUE;
 			} else if (cn_written == 0) {
-				done = TRUE; 
+				done = TRUE;
 			} else {
 				total_written += cn_written;
 				if (total_written >= stream->value->len)
@@ -521,7 +519,7 @@ exchange_mapi_util_write_generic_streams (mapi_object_t *obj_message, GSList *st
 		}
 
 	cleanup:
-		if (retval != MAPI_E_SUCCESS) 
+		if (retval != MAPI_E_SUCCESS)
 			status = FALSE;
 		mapi_object_release(&obj_stream);
 	}
@@ -535,22 +533,22 @@ static gboolean
 exchange_mapi_util_delete_attachments (mapi_object_t *obj_message)
 {
 	enum MAPISTATUS		retval;
-	TALLOC_CTX 		*mem_ctx;
-	mapi_object_t 		obj_tb_attach;
+	TALLOC_CTX		*mem_ctx;
+	mapi_object_t		obj_tb_attach;
 	struct SPropTagArray	*proptags;
 	struct SRowSet		rows_attach;
 	uint32_t		attach_count;
 	uint32_t		i_row_attach;
-	gboolean 		status = TRUE;
+	gboolean		status = TRUE;
 
 	g_debug("%s: Entering %s ", G_STRLOC, G_STRFUNC);
 
 	mem_ctx = talloc_init ("ExchangeMAPI_DeleteAttachments");
 
-	proptags = set_SPropTagArray(mem_ctx, 0x4, 
-				     PR_ATTACH_NUM, 
-				     PR_INSTANCE_KEY, 
-				     PR_RECORD_KEY, 
+	proptags = set_SPropTagArray(mem_ctx, 0x4,
+				     PR_ATTACH_NUM,
+				     PR_INSTANCE_KEY,
+				     PR_RECORD_KEY,
 				     PR_RENDERING_POSITION);
 
 	mapi_object_init(&obj_tb_attach);
@@ -608,10 +606,10 @@ cleanup:
 static gboolean
 exchange_mapi_util_set_attachments (mapi_object_t *obj_message, GSList *attach_list, gboolean remove_existing)
 {
-//	TALLOC_CTX 	*mem_ctx;
-	GSList 		*l;
+//	TALLOC_CTX	*mem_ctx;
+	GSList		*l;
 	enum MAPISTATUS	retval;
-	gboolean 	status = TRUE;
+	gboolean	status = TRUE;
 
 	g_debug("%s: Entering %s ", G_STRLOC, G_STRFUNC);
 
@@ -621,7 +619,7 @@ exchange_mapi_util_set_attachments (mapi_object_t *obj_message, GSList *attach_l
 //	mem_ctx = talloc_init ("ExchangeMAPI_SetAttachments");
 
 	for (l = attach_list; l; l = l->next) {
-		ExchangeMAPIAttachment 	*attachment = (ExchangeMAPIAttachment *) (l->data);
+		ExchangeMAPIAttachment *attachment = (ExchangeMAPIAttachment *) (l->data);
 		mapi_object_t		obj_attach;
 
 		mapi_object_init(&obj_attach);
@@ -651,7 +649,7 @@ exchange_mapi_util_set_attachments (mapi_object_t *obj_message, GSList *attach_l
 		}
 
 	cleanup:
-		if (retval != MAPI_E_SUCCESS) 
+		if (retval != MAPI_E_SUCCESS)
 			status = FALSE;
 		mapi_object_release(&obj_attach);
 	}
@@ -668,23 +666,23 @@ static gboolean
 exchange_mapi_util_get_attachments (mapi_object_t *obj_message, GSList **attach_list)
 {
 	enum MAPISTATUS		retval;
-	TALLOC_CTX 		*mem_ctx;
-	mapi_object_t 		obj_tb_attach;
+	TALLOC_CTX		*mem_ctx;
+	mapi_object_t		obj_tb_attach;
 	struct SPropTagArray	*proptags;
 	struct SRowSet		rows_attach;
 	uint32_t		attach_count;
 	uint32_t		i_row_attach;
-	gboolean 		status = TRUE;
+	gboolean		status = TRUE;
 
 	g_debug("%s: Entering %s ", G_STRLOC, G_STRFUNC);
 
 	mem_ctx = talloc_init ("ExchangeMAPI_GetAttachments");
 
-	proptags = set_SPropTagArray(mem_ctx, 0x5, 
-				     PR_ATTACH_NUM, 
-				     PR_INSTANCE_KEY, 
-				     PR_RECORD_KEY, 
-				     PR_RENDERING_POSITION, 
+	proptags = set_SPropTagArray(mem_ctx, 0x5,
+				     PR_ATTACH_NUM,
+				     PR_INSTANCE_KEY,
+				     PR_RECORD_KEY,
+				     PR_RENDERING_POSITION,
 				     PR_ATTACH_METHOD);
 
 	mapi_object_init(&obj_tb_attach);
@@ -716,11 +714,11 @@ exchange_mapi_util_get_attachments (mapi_object_t *obj_message, GSList **attach_
 
 	/* foreach attachment, open by PR_ATTACH_NUM */
 	for (i_row_attach = 0; i_row_attach < rows_attach.cRows; i_row_attach++) {
-		ExchangeMAPIAttachment 	*attachment;
+		ExchangeMAPIAttachment	*attachment;
 		struct mapi_SPropValue_array properties;
 		const uint32_t	*ui32;
 		mapi_object_t	obj_attach;
-		uint32_t 	z;
+		uint32_t	z;
 
 		mapi_object_init(&obj_attach);
 
@@ -739,14 +737,14 @@ exchange_mapi_util_get_attachments (mapi_object_t *obj_message, GSList **attach_
 		}
 
 		attachment = g_new0 (ExchangeMAPIAttachment, 1);
-		attachment->cValues = properties.cValues; 
+		attachment->cValues = properties.cValues;
 		attachment->lpProps = g_new0 (struct SPropValue, attachment->cValues + 1);
-		for (z=0; z < properties.cValues; z++) 
+		for (z=0; z < properties.cValues; z++)
 			cast_SPropValue (&properties.lpProps[z], &(attachment->lpProps[z]));
 
 		/* just to get all the other streams */
 		for (z=0; z < properties.cValues; z++) {
-			if ((properties.lpProps[z].ulPropTag & 0xFFFF) == PT_BINARY) 
+			if ((properties.lpProps[z].ulPropTag & 0xFFFF) == PT_BINARY)
 				exchange_mapi_util_read_generic_stream (&obj_attach, properties.lpProps[z].ulPropTag, &(attachment->streams));
 		}
 
@@ -774,23 +772,21 @@ cleanup:
 	return status;
 }
 
-
-
-static ExchangeMAPIGALEntry * 
+static ExchangeMAPIGALEntry *
 mapidump_PAB_gal_entry (struct SRow *aRow)
 {
-	const char	*addrtype;
-	const char	*name;
-	const char	*email;
-	const char	*account;
+	const gchar	*addrtype;
+	const gchar	*name;
+	const gchar	*email;
+	const gchar	*account;
 	ExchangeMAPIGALEntry *gal_entry;
 
-	addrtype = (const char *)find_SPropValue_data(aRow, PR_ADDRTYPE_UNICODE);
-	name = (const char *)find_SPropValue_data(aRow, PR_DISPLAY_NAME_UNICODE);
-	email = (const char *)find_SPropValue_data(aRow, PR_SMTP_ADDRESS_UNICODE);
-	account = (const char *)find_SPropValue_data(aRow, PR_ACCOUNT_UNICODE);
+	addrtype = (const gchar *)find_SPropValue_data(aRow, PR_ADDRTYPE_UNICODE);
+	name = (const gchar *)find_SPropValue_data(aRow, PR_DISPLAY_NAME_UNICODE);
+	email = (const gchar *)find_SPropValue_data(aRow, PR_SMTP_ADDRESS_UNICODE);
+	account = (const gchar *)find_SPropValue_data(aRow, PR_ACCOUNT_UNICODE);
 
-	printf("[%s] %s:\n\tName: %-25s\n\tEmail: %-25s\n", 
+	printf("[%s] %s:\n\tName: %-25s\n\tEmail: %-25s\n",
 	       addrtype, account, name, email);
 
 	gal_entry = g_new0 (ExchangeMAPIGALEntry, 1);
@@ -810,7 +806,7 @@ exchange_mapi_util_get_gal (GPtrArray *contacts_array)
 	uint32_t		count;
 	uint8_t			ulFlags;
 	TALLOC_CTX *mem_ctx;
-	
+
 	mem_ctx = talloc_init ("ExchangeMAPI_GetGAL");
 
 	LOCK ();
@@ -857,10 +853,8 @@ exchange_mapi_util_get_gal (GPtrArray *contacts_array)
 	UNLOCK ();
 
 	return TRUE;
-	
-}
-
 
+}
 
 /* Returns TRUE if all recipients were read succcesfully, else returns FALSE */
 static gboolean
@@ -870,10 +864,10 @@ exchange_mapi_util_get_recipients (mapi_object_t *obj_message, GSList **recip_li
 	struct SPropTagArray	proptags;
 	struct SRowSet		rows_recip;
 	uint32_t		i_row_recip;
-	gboolean 		status = TRUE;
+	gboolean		status = TRUE;
 
 	g_debug("%s: Entering %s ", G_STRLOC, G_STRFUNC);
-	
+
 	/* fetch recipient table */
 	retval = GetRecipientTable(obj_message, &rows_recip, &proptags);
 	if (retval != MAPI_E_SUCCESS) {
@@ -882,16 +876,16 @@ exchange_mapi_util_get_recipients (mapi_object_t *obj_message, GSList **recip_li
 	}
 
 	for (i_row_recip = 0; i_row_recip < rows_recip.cRows; i_row_recip++) {
-		ExchangeMAPIRecipient 	*recipient = g_new0 (ExchangeMAPIRecipient, 1);
+		ExchangeMAPIRecipient	*recipient = g_new0 (ExchangeMAPIRecipient, 1);
 
 		recipient->mem_ctx = talloc_init ("ExchangeMAPI_GetRecipients");
 
-		recipient->email_id = talloc_steal (recipient->mem_ctx, (const char *) exchange_mapi_util_find_row_propval (&(rows_recip.aRow[i_row_recip]), PR_SMTP_ADDRESS));
+		recipient->email_id = talloc_steal (recipient->mem_ctx, (const gchar *) exchange_mapi_util_find_row_propval (&(rows_recip.aRow[i_row_recip]), PR_SMTP_ADDRESS));
 		/* fallback */
 		if (!recipient->email_id) {
-			const char *addrtype = talloc_steal (recipient->mem_ctx, (const char *) exchange_mapi_util_find_row_propval (&(rows_recip.aRow[i_row_recip]), PR_ADDRTYPE));
+			const gchar *addrtype = talloc_steal (recipient->mem_ctx, (const gchar *) exchange_mapi_util_find_row_propval (&(rows_recip.aRow[i_row_recip]), PR_ADDRTYPE));
 			if (addrtype && !g_ascii_strcasecmp(addrtype, "SMTP"))
-				recipient->email_id = talloc_steal (recipient->mem_ctx, (const char *) exchange_mapi_util_find_row_propval (&(rows_recip.aRow[i_row_recip]), PR_EMAIL_ADDRESS));
+				recipient->email_id = talloc_steal (recipient->mem_ctx, (const gchar *) exchange_mapi_util_find_row_propval (&(rows_recip.aRow[i_row_recip]), PR_EMAIL_ADDRESS));
 		}
 		/* fail */
 		if (!recipient->email_id) {
@@ -915,25 +909,25 @@ cleanup:
 	return status;
 }
 
-static void 
+static void
 set_recipient_properties (TALLOC_CTX *mem_ctx, struct SRow *aRow, ExchangeMAPIRecipient *recipient, gboolean is_external)
 {
 	uint32_t i;
 
 	if (is_external && recipient->in.ext_lpProps) {
-	/* FIXME: Setting PR_ENTRYID property seems to create problems for now. We should take 
+	/* FIXME: Setting PR_ENTRYID property seems to create problems for now. We should take
 	 * another look at this after the CreateOneoffEntryId API is provided by LibMAPI. */
 #if 0
 		struct Binary_r *oneoff_eid;
-		struct SPropValue sprop; 
-		const gchar *dn = NULL, *email = NULL; 
+		struct SPropValue sprop;
+		const gchar *dn = NULL, *email = NULL;
 
 		dn = (const gchar *) get_SPropValue (recipient->in.ext_lpProps, PR_DISPLAY_NAME);
 		dn = (dn) ? dn : "";
 		email = (const gchar *) get_SPropValue (recipient->in.ext_lpProps, PR_SMTP_ADDRESS);
 		email = (email) ? email : "";
 		oneoff_eid = exchange_mapi_util_entryid_generate_oneoff (mem_ctx, dn, email, FALSE);
-		set_SPropValue_proptag (&sprop, PR_ENTRYID, (const void *)(oneoff_eid));
+		set_SPropValue_proptag (&sprop, PR_ENTRYID, (gconstpointer )(oneoff_eid));
 		SRow_addprop (aRow, sprop);
 #endif
 
@@ -951,13 +945,13 @@ set_recipient_properties (TALLOC_CTX *mem_ctx, struct SRow *aRow, ExchangeMAPIRe
 static void
 exchange_mapi_util_modify_recipients (TALLOC_CTX *mem_ctx, mapi_object_t *obj_message , GSList *recipients, gboolean remove_existing)
 {
-	enum MAPISTATUS 	retval;
-	struct SPropTagArray 	*SPropTagArray = NULL;
-	struct SRowSet 		*SRowSet = NULL;
-	struct SPropTagArray 	*FlagList = NULL;
-	GSList 			*l;
-	const char 		**users = NULL;
-	uint32_t 		i, j, count = 0;
+	enum MAPISTATUS	retval;
+	struct SPropTagArray	*SPropTagArray = NULL;
+	struct SRowSet		*SRowSet = NULL;
+	struct SPropTagArray	*FlagList = NULL;
+	GSList			*l;
+	const gchar		**users = NULL;
+	uint32_t		i, j, count = 0;
 
 	g_debug("%s: Entering %s ", G_STRLOC, G_STRFUNC);
 
@@ -974,9 +968,9 @@ exchange_mapi_util_modify_recipients (TALLOC_CTX *mem_ctx, mapi_object_t *obj_me
 					  PR_SMTP_ADDRESS_UNICODE);
 
 	count = g_slist_length (recipients);
-	users = g_new0 (const char *, count + 1);
+	users = g_new0 (const gchar *, count + 1);
 
-	for (i = 0, l = recipients; (i < count && l != NULL); ++i, l = l->next) { 
+	for (i = 0, l = recipients; (i < count && l != NULL); ++i, l = l->next) {
 		ExchangeMAPIRecipient *recipient = (ExchangeMAPIRecipient *)(l->data);
 		users[i] = recipient->email_id;
 	}
@@ -1000,7 +994,7 @@ exchange_mapi_util_modify_recipients (TALLOC_CTX *mem_ctx, mapi_object_t *obj_me
 		uint32_t last;
 
 		if (FlagList->aulPropTag[i] == MAPI_AMBIGUOUS) {
-			/* We should never get an ambiguous resolution as we use the email-id for resolving. 
+			/* We should never get an ambiguous resolution as we use the email-id for resolving.
 			 * However, if we do still get an ambiguous entry, we can't handle it :-( */
 			g_debug ("%s: %s() - '%s' is ambiguous ", G_STRLOC, G_STRFUNC, recipient->email_id);
 		} else if (FlagList->aulPropTag[i] == MAPI_UNRESOLVED) {
@@ -1149,11 +1143,11 @@ cleanup:
 }
 
 gboolean
-exchange_mapi_connection_fetch_items   (mapi_id_t fid, 
+exchange_mapi_connection_fetch_items   (mapi_id_t fid,
 					struct mapi_SRestriction *res, struct SSortOrderSet *sort_order,
-					const uint32_t *GetPropsList, const uint16_t cn_props, 
-					BuildNameID build_name_id, gpointer build_name_data, 
-					FetchCallback cb, gpointer data, 
+					const uint32_t *GetPropsList, const uint16_t cn_props,
+					BuildNameID build_name_id, gpointer build_name_data,
+					FetchCallback cb, gpointer data,
 					guint32 options)
 {
 	enum MAPISTATUS retval;
@@ -1176,7 +1170,7 @@ exchange_mapi_connection_fetch_items   (mapi_id_t fid,
 	mapi_object_init(&obj_table);
 
 	/* Open the message store */
-	retval = ((options & MAPI_OPTIONS_USE_PFSTORE) ? 
+	retval = ((options & MAPI_OPTIONS_USE_PFSTORE) ?
 		  OpenPublicFolder(global_mapi_session, &obj_store) : OpenMsgStore(global_mapi_session, &obj_store));
 	if (retval != MAPI_E_SUCCESS) {
 		mapi_errstr("OpenMsgStore / OpenPublicFolder", GetLastError());
@@ -1311,7 +1305,7 @@ GetProps_cleanup:
 
 			if (options & MAPI_OPTIONS_DONT_OPEN_MESSAGE)
 				goto relax;
-				
+
 			retval = OpenMessage(&obj_folder, *pfid, *pmid, &obj_message, 0);
 			if (retval != MAPI_E_SUCCESS) {
 				mapi_errstr("OpenMessage", GetLastError());
@@ -1322,14 +1316,14 @@ GetProps_cleanup:
 				exchange_mapi_util_get_attachments (&obj_message, &attach_list);
 			}
 
-			if (options & MAPI_OPTIONS_FETCH_RECIPIENTS) 
+			if (options & MAPI_OPTIONS_FETCH_RECIPIENTS)
 				exchange_mapi_util_get_recipients (&obj_message, &recip_list);
 
 //			exchange_mapi_util_get_gal (contacts_array);
 
 			/* get the main body stream no matter what */
 			if (options & MAPI_OPTIONS_FETCH_BODY_STREAM)
-				exchange_mapi_util_read_body_stream (&obj_message, &stream_list, 
+				exchange_mapi_util_read_body_stream (&obj_message, &stream_list,
 								     options & MAPI_OPTIONS_GETBESTBODY);
 
 			if (GetPropsTagArray && GetPropsTagArray->cValues) {
@@ -1344,7 +1338,7 @@ GetProps_cleanup:
 					SPropTagArray_add (mem_ctx, tags, GetPropsTagArray->aulPropTag[k]);
 				retval = GetProps (&obj_message, tags, &lpProps, &prop_count);
 				MAPIFreeBuffer (tags);
-				properties_array.lpProps = talloc_zero_array (mem_ctx, struct mapi_SPropValue, 
+				properties_array.lpProps = talloc_zero_array (mem_ctx, struct mapi_SPropValue,
 									 prop_count + 1);
 				properties_array.cValues = prop_count;
 				for (k=0; k < prop_count; k++)
@@ -1360,8 +1354,8 @@ GetProps_cleanup:
 				if ((options & MAPI_OPTIONS_DONT_OPEN_MESSAGE) == 0) {
 					/* just to get all the other streams */
 					for (z=0; z < properties_array.cValues; z++) {
-						if ((properties_array.lpProps[z].ulPropTag & 0xFFFF) == PT_BINARY && 
-						    (options & MAPI_OPTIONS_FETCH_GENERIC_STREAMS)) 
+						if ((properties_array.lpProps[z].ulPropTag & 0xFFFF) == PT_BINARY &&
+						    (options & MAPI_OPTIONS_FETCH_GENERIC_STREAMS))
 						exchange_mapi_util_read_generic_stream (&obj_message, properties_array.lpProps[z].ulPropTag, &stream_list);
 					}
 
@@ -1389,7 +1383,7 @@ GetProps_cleanup:
 				exchange_mapi_util_free_attachment_list (&attach_list);
 			}
 
-			if (GetPropsTagArray && GetPropsTagArray->cValues) 
+			if (GetPropsTagArray && GetPropsTagArray->cValues)
 				talloc_free (properties_array.lpProps);
 
 		loop_cleanup:
@@ -1419,10 +1413,10 @@ cleanup:
 }
 
 gboolean
-exchange_mapi_connection_fetch_item (mapi_id_t fid, mapi_id_t mid, 
-				     const uint32_t *GetPropsList, const uint16_t cn_props, 
-				     BuildNameID build_name_id, gpointer build_name_data, 
-				     FetchCallback cb, gpointer data, 
+exchange_mapi_connection_fetch_item (mapi_id_t fid, mapi_id_t mid,
+				     const uint32_t *GetPropsList, const uint16_t cn_props,
+				     BuildNameID build_name_id, gpointer build_name_data,
+				     FetchCallback cb, gpointer data,
 				     guint32 options)
 {
 	enum MAPISTATUS retval;
@@ -1448,7 +1442,7 @@ exchange_mapi_connection_fetch_item (mapi_id_t fid, mapi_id_t mid,
 	mapi_object_init(&obj_message);
 
 	/* Open the message store */
-	retval = ((options & MAPI_OPTIONS_USE_PFSTORE) ? 
+	retval = ((options & MAPI_OPTIONS_USE_PFSTORE) ?
 		  OpenPublicFolder(global_mapi_session, &obj_store) : OpenMsgStore(global_mapi_session, &obj_store));
 	if (retval != MAPI_E_SUCCESS) {
 		mapi_errstr("OpenMsgStore", GetLastError());
@@ -1510,16 +1504,16 @@ exchange_mapi_connection_fetch_item (mapi_id_t fid, mapi_id_t mid,
 	}
 
 	/* Fetch attachments */
-	if (options & MAPI_OPTIONS_FETCH_ATTACHMENTS) 
+	if (options & MAPI_OPTIONS_FETCH_ATTACHMENTS)
 		exchange_mapi_util_get_attachments (&obj_message, &attach_list);
 
 	/* Fetch recipients */
-	if (options & MAPI_OPTIONS_FETCH_RECIPIENTS) 
+	if (options & MAPI_OPTIONS_FETCH_RECIPIENTS)
 		exchange_mapi_util_get_recipients (&obj_message, &recip_list);
 
 	/* get the main body stream no matter what */
 	if (options & MAPI_OPTIONS_FETCH_BODY_STREAM)
-		exchange_mapi_util_read_body_stream (&obj_message, &stream_list, 
+		exchange_mapi_util_read_body_stream (&obj_message, &stream_list,
 			options & MAPI_OPTIONS_GETBESTBODY);
 
 	if (GetPropsTagArray->cValues) {
@@ -1573,7 +1567,7 @@ exchange_mapi_connection_fetch_item (mapi_id_t fid, mapi_id_t mid,
 		exchange_mapi_util_free_attachment_list (&attach_list);
 	}
 
-//	if (GetPropsTagArray->cValues) 
+//	if (GetPropsTagArray->cValues)
 //		talloc_free (properties_array.lpProps);
 
 	result = TRUE;
@@ -1593,15 +1587,15 @@ cleanup:
 	return result;
 }
 
-mapi_id_t 
-exchange_mapi_create_folder (uint32_t olFolder, mapi_id_t pfid, const char *name)
+mapi_id_t
+exchange_mapi_create_folder (uint32_t olFolder, mapi_id_t pfid, const gchar *name)
 {
 	enum MAPISTATUS retval;
 	mapi_object_t obj_store;
 	mapi_object_t obj_folder;
 	mapi_object_t obj_top;
 	struct SPropValue vals[1];
-	const char *type;
+	const gchar *type;
 	mapi_id_t fid = 0;
 
 	g_debug("%s: Entering %s ", G_STRLOC, G_STRFUNC);
@@ -1624,7 +1618,7 @@ exchange_mapi_create_folder (uint32_t olFolder, mapi_id_t pfid, const char *name
 		mapi_errstr("OpenFolder", GetLastError());
 		goto cleanup;
 	}
-	
+
 	/* Attempt to create the folder */
 	retval = CreateFolder(&obj_top, FOLDER_GENERIC, name, "Created using Evolution/LibMAPI", OPEN_IF_EXISTS, &obj_folder);
 	if (retval != MAPI_E_SUCCESS) {
@@ -1756,7 +1750,7 @@ exchange_mapi_remove_folder (uint32_t olFolder, mapi_id_t fid)
 	}
 
 	/* FIXME: If the folder has sub-folders, open each of them in turn, empty them and delete them.
-	 * Note that this has to be done recursively, for the sub-folders as well. 
+	 * Note that this has to be done recursively, for the sub-folders as well.
 	 */
 
 	/* Attempt to open the folder to be removed */
@@ -1805,8 +1799,8 @@ cleanup:
 	return result;
 }
 
-gboolean 
-exchange_mapi_rename_folder (mapi_id_t fid, const char *new_name)
+gboolean
+exchange_mapi_rename_folder (mapi_id_t fid, const gchar *new_name)
 {
 	enum MAPISTATUS retval;
 	mapi_object_t obj_store;
@@ -1862,7 +1856,7 @@ cleanup:
 /* moves folder 'src_fid' to folder 'des_fid' under name 'new_name' (no path in a new_name),
    'src_parent_fid' is folder ID of a parent of the src_fid */
 gboolean
-exchange_mapi_move_folder (mapi_id_t src_fid, mapi_id_t src_parent_fid, mapi_id_t des_fid, const char *new_name)
+exchange_mapi_move_folder (mapi_id_t src_fid, mapi_id_t src_parent_fid, mapi_id_t des_fid, const gchar *new_name)
 {
 	enum MAPISTATUS retval;
 	mapi_object_t obj_store;
@@ -1907,7 +1901,7 @@ exchange_mapi_move_folder (mapi_id_t src_fid, mapi_id_t src_parent_fid, mapi_id_
 		goto cleanup;
 	}
 
-	retval = MoveFolder (&obj_src, &obj_src_parent, &obj_des, (char *)new_name, TRUE);
+	retval = MoveFolder (&obj_src, &obj_src_parent, &obj_des, (gchar *)new_name, TRUE);
 	if (retval != MAPI_E_SUCCESS) {
 		mapi_errstr ("MoveFolder", GetLastError());
 		goto cleanup;
@@ -1928,7 +1922,7 @@ cleanup:
 }
 
 struct SPropTagArray *
-exchange_mapi_util_resolve_named_props (uint32_t olFolder, mapi_id_t fid, 
+exchange_mapi_util_resolve_named_props (uint32_t olFolder, mapi_id_t fid,
 					BuildNameID build_name_id, gpointer ni_data)
 {
 	enum MAPISTATUS retval;
@@ -2006,7 +2000,7 @@ cleanup:
 }
 
 struct SPropTagArray *
-exchange_mapi_util_resolve_named_prop (uint32_t olFolder, mapi_id_t fid, uint16_t lid, const char *OLEGUID)
+exchange_mapi_util_resolve_named_prop (uint32_t olFolder, mapi_id_t fid, uint16_t lid, const gchar *OLEGUID)
 {
 	enum MAPISTATUS retval;
 	TALLOC_CTX *mem_ctx;
@@ -2077,8 +2071,8 @@ cleanup:
 }
 
 uint32_t
-exchange_mapi_util_create_named_prop (uint32_t olFolder, mapi_id_t fid, 
-				      const char *named_prop_name, uint32_t ptype)
+exchange_mapi_util_create_named_prop (uint32_t olFolder, mapi_id_t fid,
+				      const gchar *named_prop_name, uint32_t ptype)
 {
 	enum MAPISTATUS retval;
 	TALLOC_CTX *mem_ctx;
@@ -2147,7 +2141,7 @@ cleanup:
 
 	g_debug("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
 
-	return propID; 
+	return propID;
 }
 
 mapi_id_t
@@ -2187,10 +2181,10 @@ cleanup:
 }
 
 mapi_id_t
-exchange_mapi_create_item (uint32_t olFolder, mapi_id_t fid, 
-			   BuildNameID build_name_id, gpointer ni_data, 
-			   BuildProps build_props, gpointer p_data, 
-			   GSList *recipients, GSList *attachments, GSList *generic_streams, 
+exchange_mapi_create_item (uint32_t olFolder, mapi_id_t fid,
+			   BuildNameID build_name_id, gpointer ni_data,
+			   BuildProps build_props, gpointer p_data,
+			   GSList *recipients, GSList *attachments, GSList *generic_streams,
 			   uint32_t options)
 {
 	enum MAPISTATUS retval;
@@ -2348,10 +2342,10 @@ cleanup:
 }
 
 gboolean
-exchange_mapi_modify_item (uint32_t olFolder, mapi_id_t fid, mapi_id_t mid, 
-			   BuildNameID build_name_id, gpointer ni_data, 
-			   BuildProps build_props, gpointer p_data, 
-			   GSList *recipients, GSList *attachments, GSList *generic_streams, 
+exchange_mapi_modify_item (uint32_t olFolder, mapi_id_t fid, mapi_id_t mid,
+			   BuildNameID build_name_id, gpointer ni_data,
+			   BuildProps build_props, gpointer p_data,
+			   GSList *recipients, GSList *attachments, GSList *generic_streams,
 			   uint32_t options)
 {
 	enum MAPISTATUS retval;
@@ -2455,7 +2449,7 @@ exchange_mapi_modify_item (uint32_t olFolder, mapi_id_t fid, mapi_id_t mid,
 	if (recipients) {
 		exchange_mapi_util_modify_recipients (mem_ctx, &obj_message, recipients, TRUE);
 	}
- 
+
 	/* Finally, save all changes */
 	retval = SaveChangesMessage(&obj_folder, &obj_message, KeepOpenReadWrite);
 	if (retval != MAPI_E_SUCCESS) {
@@ -2512,8 +2506,8 @@ exchange_mapi_set_flags (uint32_t olFolder, mapi_id_t fid, GSList *mids, uint32_
 		id_messages[i] = *((mapi_id_t *)tmp->data);
 
 	/* Open the message store */
-	retval = ((options & MAPI_OPTIONS_USE_PFSTORE) ? 
-		  OpenPublicFolder(global_mapi_session, &obj_store) : OpenMsgStore(global_mapi_session, &obj_store)) ;
+	retval = ((options & MAPI_OPTIONS_USE_PFSTORE) ?
+		  OpenPublicFolder(global_mapi_session, &obj_store) : OpenMsgStore(global_mapi_session, &obj_store));
 	if (retval != MAPI_E_SUCCESS) {
 		mapi_errstr("OpenMsgStore / OpenPublicFolder", GetLastError());
 		goto cleanup;
@@ -2603,7 +2597,7 @@ cleanup:
 gboolean
 exchange_mapi_copy_items (mapi_id_t src_fid, mapi_id_t dest_fid, GSList *mids)
 {
-	gboolean result = FALSE; 
+	gboolean result = FALSE;
 
 	g_debug("%s: Entering %s ", G_STRLOC, G_STRFUNC);
 
@@ -2615,13 +2609,13 @@ exchange_mapi_copy_items (mapi_id_t src_fid, mapi_id_t dest_fid, GSList *mids)
 
 	g_debug("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
 
-	return result; 
+	return result;
 }
 
 gboolean
 exchange_mapi_move_items (mapi_id_t src_fid, mapi_id_t dest_fid, GSList *mids)
 {
-	gboolean result = FALSE; 
+	gboolean result = FALSE;
 
 	g_debug("%s: Entering %s ", G_STRLOC, G_STRFUNC);
 
@@ -2633,7 +2627,7 @@ exchange_mapi_move_items (mapi_id_t src_fid, mapi_id_t dest_fid, GSList *mids)
 
 	g_debug("%s: Leaving %s ", G_STRLOC, G_STRFUNC);
 
-	return result; 
+	return result;
 }
 
 gboolean
@@ -2707,7 +2701,7 @@ cleanup:
 }
 
 static gboolean
-get_child_folders(TALLOC_CTX *mem_ctx, ExchangeMAPIFolderCategory folder_hier, mapi_object_t *parent, 
+get_child_folders(TALLOC_CTX *mem_ctx, ExchangeMAPIFolderCategory folder_hier, mapi_object_t *parent,
 		  mapi_id_t folder_id, GSList **mapi_folders, gint32 depth)
 {
 	enum MAPISTATUS		retval;
@@ -2716,7 +2710,7 @@ get_child_folders(TALLOC_CTX *mem_ctx, ExchangeMAPIFolderCategory folder_hier, m
 	struct SPropTagArray	*SPropTagArray = NULL;
 	struct SRowSet		rowset;
 	uint32_t		i, row_count = 0;
-	gboolean 		result = TRUE;
+	gboolean		result = TRUE;
 
 	/* sanity check */
 	g_return_val_if_fail (mem_ctx != NULL, FALSE);
@@ -2771,8 +2765,8 @@ get_child_folders(TALLOC_CTX *mem_ctx, ExchangeMAPIFolderCategory folder_hier, m
 		gchar *newname = NULL;
 
 		const mapi_id_t *fid = (const mapi_id_t *)find_SPropValue_data(&rowset.aRow[i], PR_FID);
-		const char *class = (const char *)find_SPropValue_data(&rowset.aRow[i], PR_CONTAINER_CLASS);
-		const char *name = (const char *)find_SPropValue_data(&rowset.aRow[i], PR_DISPLAY_NAME);
+		const gchar *class = (const gchar *)find_SPropValue_data(&rowset.aRow[i], PR_CONTAINER_CLASS);
+		const gchar *name = (const gchar *)find_SPropValue_data(&rowset.aRow[i], PR_DISPLAY_NAME);
 		const uint32_t *unread = (const uint32_t *)find_SPropValue_data(&rowset.aRow[i], PR_CONTENT_UNREAD);
 		const uint32_t *total = (const uint32_t *)find_SPropValue_data(&rowset.aRow[i], PR_CONTENT_COUNT);
 		const uint32_t *child = (const uint32_t *)find_SPropValue_data(&rowset.aRow[i], PR_FOLDER_CHILD_COUNT);
@@ -2782,7 +2776,7 @@ get_child_folders(TALLOC_CTX *mem_ctx, ExchangeMAPIFolderCategory folder_hier, m
 			class = IPF_NOTE;
 
 		newname = utf8tolinux (name);
-		g_debug("|---+ %-15s : (Container class: %s %016" G_GINT64_MODIFIER "X) UnRead : %d Total : %d size : %d", 
+		g_debug("|---+ %-15s : (Container class: %s %016" G_GINT64_MODIFIER "X) UnRead : %d Total : %d size : %d",
 			newname, class, *fid, unread ? *unread : 0, total ? *total : 0, folder_size ? *folder_size : 0);
 
 		folder = exchange_mapi_folder_new (newname, class, folder_hier, *fid, folder_id,
@@ -2793,7 +2787,7 @@ get_child_folders(TALLOC_CTX *mem_ctx, ExchangeMAPIFolderCategory folder_hier, m
 		*mapi_folders = g_slist_prepend (*mapi_folders, folder);
 
 		if (child && *child && (depth != 0))
-			result = (result && get_child_folders(mem_ctx, folder_hier, &obj_folder, *fid, 
+			result = (result && get_child_folders(mem_ctx, folder_hier, &obj_folder, *fid,
 							      mapi_folders, depth));
 
 		g_free (newname);
@@ -2880,8 +2874,8 @@ mapi_get_ren_additional_fids (mapi_object_t *obj_store, GHashTable **folder_list
 				folder_type = g_new0 (guint32, 1);
 				*folder_type = olfolder_defaults[i];
 
-				g_hash_table_insert (*folder_list, 
-						     exchange_mapi_util_mapi_id_to_string (fid), 
+				g_hash_table_insert (*folder_list,
+						     exchange_mapi_util_mapi_id_to_string (fid),
 						     folder_type);
 			}
 		}
@@ -2892,7 +2886,7 @@ cleanup:
 	talloc_free (mem_ctx);
 }
 
-static void 
+static void
 set_default_folders (mapi_object_t *obj_store, GSList **mapi_folders)
 {
 	GSList *folder_list = *mapi_folders;
@@ -2901,7 +2895,7 @@ set_default_folders (mapi_object_t *obj_store, GSList **mapi_folders)
 							     g_free, g_free);
 
 	mapi_get_ren_additional_fids (obj_store, &default_folders);
-	
+
 	while (folder_list != NULL) {
 		ExchangeMAPIFolder *folder = NULL;
 		guint32 default_type = 0;
@@ -2920,43 +2914,43 @@ set_default_folders (mapi_object_t *obj_store, GSList **mapi_folders)
 			folder->default_type = default_type;
 		}
 
-		folder_list = g_slist_next (folder_list); 
+		folder_list = g_slist_next (folder_list);
 	}
 
 	g_hash_table_destroy (default_folders);
 }
 
-static void 
+static void
 set_owner_name (gpointer data, gpointer user_data)
 {
 	ExchangeMAPIFolder *folder = (ExchangeMAPIFolder *)(data);
 	folder->owner_name = (gchar *)(user_data);
 }
 
-static void 
+static void
 set_user_name (gpointer data, gpointer user_data)
 {
 	ExchangeMAPIFolder *folder = (ExchangeMAPIFolder *)(data);
 	folder->user_name = (gchar *)(user_data);
 }
 
-gboolean 
+gboolean
 exchange_mapi_get_folders_list (GSList **mapi_folders)
 {
-	enum MAPISTATUS 	retval;
-	TALLOC_CTX 		*mem_ctx;
-	mapi_object_t 		obj_store;
-	struct SPropTagArray 	*SPropTagArray;
-	struct SPropValue 	*lpProps;
+	enum MAPISTATUS	retval;
+	TALLOC_CTX		*mem_ctx;
+	mapi_object_t		obj_store;
+	struct SPropTagArray	*SPropTagArray;
+	struct SPropValue	*lpProps;
 	struct SRow		aRow;
-	gboolean 		result = FALSE;
+	gboolean		result = FALSE;
 	mapi_id_t		mailbox_id;
-	ExchangeMAPIFolder 	*folder;
-	uint32_t 		count = 0;
-	const char 		*mailbox_name = NULL;
-	char 			*utf8_mailbox_name = NULL;
-	const char 		*mailbox_owner_name = NULL;
-	const char 		*mailbox_user_name = NULL;
+	ExchangeMAPIFolder	*folder;
+	uint32_t		count = 0;
+	const gchar		*mailbox_name = NULL;
+	gchar			*utf8_mailbox_name = NULL;
+	const gchar		*mailbox_owner_name = NULL;
+	const gchar		*mailbox_user_name = NULL;
 	const uint32_t          *mailbox_size = NULL;
 
 	g_debug("%s: Entering %s ", G_STRLOC, G_STRFUNC);
@@ -2995,9 +2989,9 @@ exchange_mapi_get_folders_list (GSList **mapi_folders)
 	aRow.lpProps = lpProps;
 
 	/* betting that these will never fail */
-	mailbox_name = (const char *) find_SPropValue_data(&aRow, PR_DISPLAY_NAME);
-	mailbox_owner_name = (const char *) find_SPropValue_data(&aRow, PR_MAILBOX_OWNER_NAME);
-	mailbox_user_name = (const char *) find_SPropValue_data(&aRow, PR_USER_NAME);
+	mailbox_name = (const gchar *) find_SPropValue_data(&aRow, PR_DISPLAY_NAME);
+	mailbox_owner_name = (const gchar *) find_SPropValue_data(&aRow, PR_MAILBOX_OWNER_NAME);
+	mailbox_user_name = (const gchar *) find_SPropValue_data(&aRow, PR_USER_NAME);
 	mailbox_size = (const uint32_t *)find_SPropValue_data (&aRow, PR_MESSAGE_SIZE);
 
 	/* Prepare the directory listing */
@@ -3010,8 +3004,8 @@ exchange_mapi_get_folders_list (GSList **mapi_folders)
 	utf8_mailbox_name = utf8tolinux (mailbox_name);
 
 	/* FIXME: May have to get the child folders count? Do we need/use it? */
-	folder = exchange_mapi_folder_new (utf8_mailbox_name, IPF_NOTE, 
-					   MAPI_PERSONAL_FOLDER, mailbox_id, 0, 0, 0 ,0); 
+	folder = exchange_mapi_folder_new (utf8_mailbox_name, IPF_NOTE,
+					   MAPI_PERSONAL_FOLDER, mailbox_id, 0, 0, 0 ,0);
 	folder->is_default = true;
 	folder->default_type = olFolderTopInformationStore; /*Is this correct ?*/
 	folder->size = *mailbox_size;
@@ -3042,15 +3036,15 @@ cleanup:
 	return result;
 }
 
-gboolean 
+gboolean
 exchange_mapi_get_pf_folders_list (GSList **mapi_folders, mapi_id_t parent_fid)
 {
-	enum MAPISTATUS 	retval;
-	TALLOC_CTX 		*mem_ctx;
-	mapi_object_t 		obj_store;
-	gboolean 		result = FALSE;
+	enum MAPISTATUS		retval;
+	TALLOC_CTX		*mem_ctx;
+	mapi_object_t		obj_store;
+	gboolean		result = FALSE;
 	mapi_id_t		mailbox_id;
-	ExchangeMAPIFolder 	*folder;
+	ExchangeMAPIFolder	*folder;
 	mapi_object_t obj_parent_folder;
 
 	g_debug("%s: Entering %s ", G_STRLOC, G_STRFUNC);
@@ -3084,7 +3078,7 @@ exchange_mapi_get_pf_folders_list (GSList **mapi_folders, mapi_id_t parent_fid)
 		}
 	}
 	/*  TODO : Localized string */
-	folder = exchange_mapi_folder_new ("All Public Folders", IPF_NOTE, 0, 
+	folder = exchange_mapi_folder_new ("All Public Folders", IPF_NOTE, 0,
 					   mailbox_id, 0, 0, 0 ,0);
 	folder->is_default = true;
 	folder->default_type = olPublicFoldersAllPublicFolders;
@@ -3108,7 +3102,6 @@ cleanup:
 	return result;
 }
 
-
 /**
    This function has temporarily been moved here for convenient
    purposes. This is the only routine outside exchange-mapi-connection
@@ -3120,13 +3113,13 @@ cleanup:
 const gchar *
 exchange_mapi_util_ex_to_smtp (const gchar *ex_address)
 {
-	enum MAPISTATUS 	retval;
-	TALLOC_CTX 		*mem_ctx;
+	enum MAPISTATUS	retval;
+	TALLOC_CTX		*mem_ctx;
 	struct SPropTagArray	*SPropTagArray;
-	struct SRowSet 		*SRowSet = NULL;
-	struct SPropTagArray   	*flaglist = NULL;
-	const gchar 		*str_array[2];
-	const gchar 		*smtp_addr = NULL;
+	struct SRowSet		*SRowSet = NULL;
+	struct SPropTagArray	*flaglist = NULL;
+	const gchar		*str_array[2];
+	const gchar		*smtp_addr = NULL;
 
 	g_return_val_if_fail (ex_address != NULL, NULL);
 
@@ -3139,14 +3132,14 @@ exchange_mapi_util_ex_to_smtp (const gchar *ex_address)
 					  PR_SMTP_ADDRESS,
 					  PR_SMTP_ADDRESS_UNICODE);
 
-	retval = ResolveNames(global_mapi_session, (const char **)str_array, SPropTagArray, &SRowSet, &flaglist, 0);
+	retval = ResolveNames(global_mapi_session, (const gchar **)str_array, SPropTagArray, &SRowSet, &flaglist, 0);
 	if (retval != MAPI_E_SUCCESS)
-		retval = ResolveNames(global_mapi_session, (const char **)str_array, SPropTagArray, &SRowSet, &flaglist, MAPI_UNICODE);
+		retval = ResolveNames(global_mapi_session, (const gchar **)str_array, SPropTagArray, &SRowSet, &flaglist, MAPI_UNICODE);
 
 	if (retval == MAPI_E_SUCCESS && SRowSet && SRowSet->cRows == 1) {
-		smtp_addr = (const char *) find_SPropValue_data(SRowSet->aRow, PR_SMTP_ADDRESS);
+		smtp_addr = (const gchar *) find_SPropValue_data(SRowSet->aRow, PR_SMTP_ADDRESS);
 		if (!smtp_addr)
-			smtp_addr = (const char *) find_SPropValue_data(SRowSet->aRow, PR_SMTP_ADDRESS_UNICODE);
+			smtp_addr = (const gchar *) find_SPropValue_data(SRowSet->aRow, PR_SMTP_ADDRESS_UNICODE);
 	}
 
 	talloc_free (mem_ctx);
@@ -3229,7 +3222,7 @@ exchange_mapi_events_monitor (struct mapi_notify_continue_callback_data *cb_data
 /* Shows error message on the console, and, if error_msg is not NULL, then
    sets it to the similar error message as well. */
 static void
-manage_mapi_error (const char *context, uint32_t error_id, char **error_msg)
+manage_mapi_error (const gchar *context, uint32_t error_id, gchar **error_msg)
 {
 	if (!context)
 		context = "???";
@@ -3237,21 +3230,20 @@ manage_mapi_error (const char *context, uint32_t error_id, char **error_msg)
 	mapi_errstr (context, error_id);
 
 	if (error_msg) {
-		char *e = g_strconcat (context, ":", mapi_get_errstr (error_id), NULL);
+		gchar *e = g_strconcat (context, ":", mapi_get_errstr (error_id), NULL);
 
 		g_free (*error_msg);
 		*error_msg = e;
 	}
 }
 
-
 gboolean
-exchange_mapi_create_profile (const char *username, const char *password, const char *domain,
-			      const char *server, char **error_msg,
+exchange_mapi_create_profile (const gchar *username, const gchar *password, const gchar *domain,
+			      const gchar *server, gchar **error_msg,
 			      mapi_profile_callback_t callback, gpointer data)
 {
 	enum MAPISTATUS	retval;
-	gboolean result = FALSE; 
+	gboolean result = FALSE;
 	const gchar *workstation = "localhost";
 	gchar *profname = NULL;
 	struct mapi_session *session = NULL;
@@ -3272,51 +3264,51 @@ exchange_mapi_create_profile (const char *username, const char *password, const
 	}
 
 	/* Delete any existing profiles with the same profilename */
-	retval = DeleteProfile(profname); 
+	retval = DeleteProfile(profname);
 	/* don't bother to check error - it would be valid if we got an error */
 
 	retval = CreateProfile(profname, username, password, OC_PROFILE_NOPASSWORD);
 	if (retval != MAPI_E_SUCCESS) {
 		manage_mapi_error ("CreateProfile", GetLastError(), error_msg);
-		goto cleanup; 
+		goto cleanup;
 	}
 
 	mapi_profile_add_string_attr(profname, "binding", server);
 	mapi_profile_add_string_attr(profname, "workstation", workstation);
 	mapi_profile_add_string_attr(profname, "domain", domain);
-	
+
 	/* This is only convenient here and should be replaced at some point */
 	mapi_profile_add_string_attr(profname, "codepage", "0x4e4");
 	mapi_profile_add_string_attr(profname, "language", "0x409");
 	mapi_profile_add_string_attr(profname, "method", "0x409");
-	
+
 	/* Login now */
 	g_debug("Logging into the server... ");
-	retval = MapiLogonProvider(&session, profname, password, PROVIDER_ID_NSPI); 
+	retval = MapiLogonProvider(&session, profname, password, PROVIDER_ID_NSPI);
 	if (retval != MAPI_E_SUCCESS) {
 		manage_mapi_error ("MapiLogonProvider", GetLastError(), error_msg);
-		g_debug ("Deleting profile %s ", profname); 
-		retval = DeleteProfile(profname); 
+		g_debug ("Deleting profile %s ", profname);
+		retval = DeleteProfile(profname);
 		if (retval != MAPI_E_SUCCESS)
 			manage_mapi_error ("DeleteProfile", GetLastError(), error_msg);
-		goto cleanup; 
+		goto cleanup;
 	}
 	g_debug("MapiLogonProvider : succeeded \n");
 
-	retval = ProcessNetworkProfile(session, username, callback, data); 
+	retval = ProcessNetworkProfile(session, username, callback, data);
 	if (retval != MAPI_E_SUCCESS) {
 		manage_mapi_error ("ProcessNetworkProfile", GetLastError(), error_msg);
-		g_debug ("Deleting profile %s ", profname); 
-		DeleteProfile(profname); 
-		goto exit; 
+		g_debug ("Deleting profile %s ", profname);
+		DeleteProfile(profname);
+		goto exit;
 	}
 	g_debug("ProcessNetworkProfile : succeeded \n");
 
 	/* Set it as the default profile. Is this needed? */
-	retval = SetDefaultProfile(profname); 
+	retval = SetDefaultProfile(profname);
 	if (retval != MAPI_E_SUCCESS) {
 		manage_mapi_error ("SetDefaultProfile", GetLastError(), error_msg);
-		goto cleanup; 
+		goto cleanup;
 	}
 
 	/* Close the connection, so that we can login with what we created */
@@ -3326,10 +3318,10 @@ exchange_mapi_create_profile (const char *username, const char *password, const
 	if (exchange_mapi_connection_new (profname, password)) {
 		result = TRUE;
 		exchange_mapi_peek_folder_list ();
-	} else 
+	} else
 		goto exit;
 
- cleanup: 
+ cleanup:
  exit:
 	g_free (profname);
 
@@ -3339,28 +3331,28 @@ exchange_mapi_create_profile (const char *username, const char *password, const
 }
 
 gboolean
-exchange_mapi_delete_profile (const char *profile)
+exchange_mapi_delete_profile (const gchar *profile)
 {
 	enum MAPISTATUS	retval;
-	gboolean result = FALSE; 
+	gboolean result = FALSE;
 
 	LOCK ();
 
 	if (!ensure_mapi_init_called ()) {
-		goto cleanup; 
+		goto cleanup;
 	}
 
-	g_debug ("Deleting profile %s ", profile); 
-	retval = DeleteProfile(profile); 
+	g_debug ("Deleting profile %s ", profile);
+	retval = DeleteProfile(profile);
 	if (retval != MAPI_E_SUCCESS) {
 		mapi_errstr("DeleteProfile", GetLastError());
-		goto cleanup; 
+		goto cleanup;
 	}
 
 	exchange_mapi_connection_close ();
-	result = TRUE; 
+	result = TRUE;
 
-cleanup: 
+cleanup:
 	UNLOCK ();
 
 	return result;
diff --git a/src/libexchangemapi/exchange-mapi-connection.h b/src/libexchangemapi/exchange-mapi-connection.h
index e2b06b6..bbc5227 100644
--- a/src/libexchangemapi/exchange-mapi-connection.h
+++ b/src/libexchangemapi/exchange-mapi-connection.h
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -35,7 +35,7 @@ typedef enum {
 	MAPI_OPTIONS_FETCH_BODY_STREAM = 1<<2,
 	MAPI_OPTIONS_FETCH_GENERIC_STREAMS = 1<<3,
 	MAPI_OPTIONS_FETCH_GAL = 1 <<4,
-	MAPI_OPTIONS_DONT_SUBMIT = 1<<5, 
+	MAPI_OPTIONS_DONT_SUBMIT = 1<<5,
 	MAPI_OPTIONS_GETBESTBODY = 1<<6,
 	MAPI_OPTIONS_USE_PFSTORE = 1<<7,
 	MAPI_OPTIONS_DONT_OPEN_MESSAGE = 1<<8,
@@ -50,9 +50,9 @@ typedef enum {
 } ExchangeMAPIEventsOptions;
 
 #define MAPI_OPTIONS_FETCH_ALL MAPI_OPTIONS_FETCH_ATTACHMENTS | \
-	                       MAPI_OPTIONS_FETCH_RECIPIENTS | \
-	                       MAPI_OPTIONS_FETCH_BODY_STREAM | \
-	                       MAPI_OPTIONS_FETCH_GENERIC_STREAMS
+			       MAPI_OPTIONS_FETCH_RECIPIENTS | \
+			       MAPI_OPTIONS_FETCH_BODY_STREAM | \
+			       MAPI_OPTIONS_FETCH_GENERIC_STREAMS
 
 typedef struct {
 	GByteArray *value;
@@ -67,38 +67,38 @@ typedef struct {
 
 typedef struct {
 	/* MANDATORY */
-	const char *email_id;
+	const gchar *email_id;
 	TALLOC_CTX *mem_ctx;
 
-	/* It is ideal to set all these properties on all recipients 
-	 * as we never know if a recipient would be resolved or not. */ 
+	/* It is ideal to set all these properties on all recipients
+	 * as we never know if a recipient would be resolved or not. */
 	struct {
-		/* These are properties which would be set on the 
+		/* These are properties which would be set on the
 		 * recipients regardless if the recipient is resolved or not */
-		uint32_t req_cValues; 
+		uint32_t req_cValues;
 		struct SPropValue *req_lpProps;
 
-		/* These are properties which would be set on the 
+		/* These are properties which would be set on the
 		 * recipients only if the recipient is MAPI_UNRESOLVED */
-		uint32_t ext_cValues; 
+		uint32_t ext_cValues;
 		struct SPropValue *ext_lpProps;
-	} in; 
+	} in;
 
-	/* These are properties which would be set on the 
+	/* These are properties which would be set on the
 	 * recipients after GetRecipientTable() */
 	struct SRow out_SRow;
 } ExchangeMAPIRecipient;
 
 typedef struct {
-	const char *name;
-	const char *email;
+	const gchar *name;
+	const gchar *email;
 } ExchangeMAPIGALEntry;
 
 typedef struct {
-	uint32_t cValues; 
-	struct SPropValue *lpProps; 
-	GSList *streams; 
-	GSList *objects; 
+	uint32_t cValues;
+	struct SPropValue *lpProps;
+	GSList *streams;
+	GSList *objects;
 } ExchangeMAPIAttachment;
 
 typedef struct {
@@ -117,12 +117,12 @@ struct id_list {
 	mapi_id_t id;
 };
 
-typedef gboolean (*FetchCallback) 	(FetchItemsCallbackData *item_data, gpointer data);
-typedef gboolean (*BuildNameID) 	(struct mapi_nameid *nameid, gpointer data);
-typedef int 	 (*BuildProps) 		(struct SPropValue **, struct SPropTagArray *, gpointer data);
+typedef gboolean (*FetchCallback)	(FetchItemsCallbackData *item_data, gpointer data);
+typedef gboolean (*BuildNameID)	(struct mapi_nameid *nameid, gpointer data);
+typedef gint	 (*BuildProps)		(struct SPropValue **, struct SPropTagArray *, gpointer data);
 
-gboolean 
-exchange_mapi_connection_new (const char *profile, const char *password);
+gboolean
+exchange_mapi_connection_new (const gchar *profile, const gchar *password);
 
 void
 exchange_mapi_connection_close (void);
@@ -131,36 +131,36 @@ gboolean
 exchange_mapi_connection_exists (void);
 
 gboolean
-exchange_mapi_connection_fetch_item (mapi_id_t fid, mapi_id_t mid, 
-				     const uint32_t *GetPropsList, const uint16_t cn_props, 
-				     BuildNameID build_name_id, gpointer build_name_data, 
-				     FetchCallback cb, gpointer data, 
+exchange_mapi_connection_fetch_item (mapi_id_t fid, mapi_id_t mid,
+				     const uint32_t *GetPropsList, const uint16_t cn_props,
+				     BuildNameID build_name_id, gpointer build_name_data,
+				     FetchCallback cb, gpointer data,
 				     guint32 options);
 gboolean
-exchange_mapi_connection_fetch_items   (mapi_id_t fid, 
+exchange_mapi_connection_fetch_items   (mapi_id_t fid,
 					struct mapi_SRestriction *res,struct SSortOrderSet *sort_order,
-					const uint32_t *GetPropsList, const uint16_t cn_props, 
-					BuildNameID build_name_id, gpointer build_name_data, 
-					FetchCallback cb, gpointer data, 
+					const uint32_t *GetPropsList, const uint16_t cn_props,
+					BuildNameID build_name_id, gpointer build_name_data,
+					FetchCallback cb, gpointer data,
 					guint32 options);
 
 gboolean
 exchange_mapi_util_get_gal (GPtrArray *contacts_array);
 
-mapi_id_t 
-exchange_mapi_create_folder (uint32_t olFolder, mapi_id_t pfid, const char *name);
+mapi_id_t
+exchange_mapi_create_folder (uint32_t olFolder, mapi_id_t pfid, const gchar *name);
 
-gboolean 
+gboolean
 exchange_mapi_remove_folder (uint32_t olFolder, mapi_id_t fid);
 
 gboolean
 exchange_mapi_empty_folder (mapi_id_t fid);
 
-gboolean 
-exchange_mapi_rename_folder (mapi_id_t fid, const char *new_name);
+gboolean
+exchange_mapi_rename_folder (mapi_id_t fid, const gchar *new_name);
 
 gboolean
-exchange_mapi_move_folder (mapi_id_t src_fid, mapi_id_t src_parent_fid, mapi_id_t des_fid, const char *new_name);
+exchange_mapi_move_folder (mapi_id_t src_fid, mapi_id_t src_parent_fid, mapi_id_t des_fid, const gchar *new_name);
 
 GSList *
 exchange_mapi_util_check_restriction (mapi_id_t fid, struct mapi_SRestriction *res);
@@ -169,14 +169,14 @@ mapi_id_t
 exchange_mapi_get_default_folder_id (uint32_t olFolder);
 
 mapi_id_t
-exchange_mapi_create_item (uint32_t olFolder, mapi_id_t fid, 
-			   BuildNameID build_name_id, gpointer ni_data, 
-			   BuildProps build_props, gpointer p_data, 
+exchange_mapi_create_item (uint32_t olFolder, mapi_id_t fid,
+			   BuildNameID build_name_id, gpointer ni_data,
+			   BuildProps build_props, gpointer p_data,
 			   GSList *recipients, GSList *attachments, GSList *generic_streams,
 			   uint32_t options);
 gboolean
-exchange_mapi_modify_item (uint32_t olFolder, mapi_id_t fid, mapi_id_t mid, 
-			   BuildNameID build_name_id, gpointer ni_data, 
+exchange_mapi_modify_item (uint32_t olFolder, mapi_id_t fid, mapi_id_t mid,
+			   BuildNameID build_name_id, gpointer ni_data,
 			   BuildProps build_props, gpointer p_data,
 			   GSList *recipients, GSList *attachments, GSList *generic_streams,
 			   uint32_t options);
@@ -193,25 +193,23 @@ exchange_mapi_copy_items ( mapi_id_t src_fid, mapi_id_t dest_fid, GSList *mids);
 gboolean
 exchange_mapi_move_items ( mapi_id_t src_fid, mapi_id_t dest_fid, GSList *mids);
 
-
-gboolean exchange_mapi_get_folders_list (GSList **mapi_folders); 
-gboolean exchange_mapi_get_pf_folders_list (GSList **mapi_folders, mapi_id_t parent_id); 
+gboolean exchange_mapi_get_folders_list (GSList **mapi_folders);
+gboolean exchange_mapi_get_pf_folders_list (GSList **mapi_folders, mapi_id_t parent_id);
 
 struct SPropTagArray *
-exchange_mapi_util_resolve_named_props (uint32_t olFolder, mapi_id_t fid, 
+exchange_mapi_util_resolve_named_props (uint32_t olFolder, mapi_id_t fid,
 				   BuildNameID build_name_id, gpointer ni_data);
 struct SPropTagArray *
-exchange_mapi_util_resolve_named_prop (uint32_t olFolder, mapi_id_t fid, 
-				       uint16_t lid, const char *OLEGUID);
+exchange_mapi_util_resolve_named_prop (uint32_t olFolder, mapi_id_t fid,
+				       uint16_t lid, const gchar *OLEGUID);
 uint32_t
-exchange_mapi_util_create_named_prop (uint32_t olFolder, mapi_id_t fid, 
-				      const char *named_prop_name, uint32_t ptype);
-
-gboolean exchange_mapi_create_profile (const char *username, const char *password,
-				       const char *domain, const char *server,
-				       char **error_msg, mapi_profile_callback_t cb, gpointer data);
-gboolean exchange_mapi_delete_profile (const char *profile);
+exchange_mapi_util_create_named_prop (uint32_t olFolder, mapi_id_t fid,
+				      const gchar *named_prop_name, uint32_t ptype);
 
+gboolean exchange_mapi_create_profile (const gchar *username, const gchar *password,
+				       const gchar *domain, const gchar *server,
+				       gchar **error_msg, mapi_profile_callback_t cb, gpointer data);
+gboolean exchange_mapi_delete_profile (const gchar *profile);
 
 /* Push notifications APIs */
 typedef gboolean (*exchange_check_continue) (void);
diff --git a/src/libexchangemapi/exchange-mapi-defs.h b/src/libexchangemapi/exchange-mapi-defs.h
index 3450a8d..53ed08c 100644
--- a/src/libexchangemapi/exchange-mapi-defs.h
+++ b/src/libexchangemapi/exchange-mapi-defs.h
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -22,7 +22,8 @@
  */
 
 /* Someday, all these definitions should be pushed in libmapi/mapidefs.h */
-/* NOTE: Some of the enumerations are commented out since they conflict with libmapi/mapidefs.h */
+/* NOTE: Some of the enumerations are commented out since they conflict
+ *       with libmapi/mapidefs.h */
 
 #ifndef EXCHANGE_MAPI_DEFS_H
 #define EXCHANGE_MAPI_DEFS_H
@@ -63,14 +64,14 @@ typedef enum {
 typedef enum {
     SingleAppt = 0x0400 ,
     RecurAppt = 0x0401 ,
-    SingleMeet = 0x0402 , 
+    SingleMeet = 0x0402 ,
     RecurMeet = 0x0403 ,
     MeetReq = 0x0404 ,
     RespAccept = 0x0405 ,
     RespDecline = 0x0406 ,
     RespTentAccept = 0x0407 ,
     MeetCancel = 0x0408 ,
-    MeetInfoUpdate = 0x0409 
+    MeetInfoUpdate = 0x0409
 } IconIndex;
 
 #if 0
@@ -110,7 +111,6 @@ typedef enum {
 #define	olFolderPublicIPMSubtree	26
 #endif
 
-
 /* APPOINTMENTS */
 typedef enum {
     olFree = 0,
@@ -142,12 +142,12 @@ typedef enum {
 } OlResponseStatus;
 
 typedef enum {
-    mtgEmpty = 		0x00000000,
-    mtgRequest = 	0x00000001,
-    mtgFull = 		0x00010000,
-    mtgInfo = 		0x00020000,
-    mtgOutOfDate = 	0x00080000,
-    mtgDelegatorCopy = 	0x00100000
+    mtgEmpty =		0x00000000,
+    mtgRequest =	0x00000001,
+    mtgFull =		0x00010000,
+    mtgInfo =		0x00020000,
+    mtgOutOfDate =	0x00080000,
+    mtgDelegatorCopy =	0x00100000
 } MeetingType;
 
 typedef enum {
@@ -170,7 +170,6 @@ typedef enum {
     olChat = 2
 } OlNetMeetingType;
 
-
 /* TASKS */
 typedef enum {
     olTaskNotDelegated = 0,
@@ -207,7 +206,6 @@ typedef enum {
 } OlTaskStatus;
 #endif
 
-
 /* NOTES */
 #if 0
 typedef enum {
@@ -219,9 +217,8 @@ typedef enum {
 } OlNoteColor;
 #endif
 
-
 /* RECURRENCE (APPOINTMENTS/MEETINGS/TASKS) */
-typedef enum { 
+typedef enum {
     rectypeNone = 0,
     rectypeDaily = 1,
     rectypeWeekly = 2,
@@ -245,21 +242,19 @@ typedef enum {
     olRecursYearly = 5,
     olRecursYearNth = 6
 } OlRecurrencePatternType;
-#endif 
-
-
-#define IPM_CONTACT 				"IPM.Contact"
-#define IPM_APPOINTMENT 			"IPM.Appointment"
-#define IPM_SCHEDULE_MEETING_PREFIX 		"IPM.Schedule.Meeting."
-#define IPM_SCHEDULE_MEETING_REQUEST 		"IPM.Schedule.Meeting.Request"
-#define IPM_SCHEDULE_MEETING_CANCELED 		"IPM.Schedule.Meeting.Canceled"
-#define IPM_SCHEDULE_MEETING_RESP_PREFIX 	"IPM.Schedule.Meeting.Resp."
-#define IPM_SCHEDULE_MEETING_RESP_POS 		"IPM.Schedule.Meeting.Resp.Pos"
-#define IPM_SCHEDULE_MEETING_RESP_TENT 		"IPM.Schedule.Meeting.Resp.Tent"
-#define IPM_SCHEDULE_MEETING_RESP_NEG 		"IPM.Schedule.Meeting.Resp.Neg"
-#define IPM_TASK 				"IPM.Task"
-#define IPM_STICKYNOTE 				"IPM.StickyNote"
+#endif
 
+#define IPM_CONTACT				"IPM.Contact"
+#define IPM_APPOINTMENT				"IPM.Appointment"
+#define IPM_SCHEDULE_MEETING_PREFIX		"IPM.Schedule.Meeting."
+#define IPM_SCHEDULE_MEETING_REQUEST		"IPM.Schedule.Meeting.Request"
+#define IPM_SCHEDULE_MEETING_CANCELED		"IPM.Schedule.Meeting.Canceled"
+#define IPM_SCHEDULE_MEETING_RESP_PREFIX	"IPM.Schedule.Meeting.Resp."
+#define IPM_SCHEDULE_MEETING_RESP_POS		"IPM.Schedule.Meeting.Resp.Pos"
+#define IPM_SCHEDULE_MEETING_RESP_TENT		"IPM.Schedule.Meeting.Resp.Tent"
+#define IPM_SCHEDULE_MEETING_RESP_NEG		"IPM.Schedule.Meeting.Resp.Neg"
+#define IPM_TASK				"IPM.Task"
+#define IPM_STICKYNOTE				"IPM.StickyNote"
 
 G_END_DECLS
 
diff --git a/src/libexchangemapi/exchange-mapi-folder.c b/src/libexchangemapi/exchange-mapi-folder.c
index 98bc484..a9cde99 100644
--- a/src/libexchangemapi/exchange-mapi-folder.c
+++ b/src/libexchangemapi/exchange-mapi-folder.c
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -33,16 +33,16 @@ static GSList *folder_list = NULL;
 /* we use a static mutex - even the same thread *may not* use the static vars concurrently */
 static GStaticMutex folder_lock = G_STATIC_MUTEX_INIT;
 
-#define LOCK() 		g_message("%s: %s: lock(folder_lock)", G_STRLOC, G_STRFUNC);g_static_mutex_lock(&folder_lock)
-#define UNLOCK() 	g_message("%s: %s: unlock(folder_lock)", G_STRLOC, G_STRFUNC);g_static_mutex_unlock(&folder_lock)
+#define LOCK()		g_message("%s: %s: lock(folder_lock)", G_STRLOC, G_STRFUNC);g_static_mutex_lock(&folder_lock)
+#define UNLOCK()	g_message("%s: %s: unlock(folder_lock)", G_STRLOC, G_STRFUNC);g_static_mutex_unlock(&folder_lock)
 #define d(x) x
 
 static ExchangeMAPIFolderType
-container_class_to_type (const char *type)
+container_class_to_type (const gchar *type)
 {
 	ExchangeMAPIFolderType folder_type = MAPI_FOLDER_TYPE_UNKNOWN;;
 
-	if (!strcmp (type, IPF_APPOINTMENT)) 
+	if (!strcmp (type, IPF_APPOINTMENT))
 		folder_type = MAPI_FOLDER_TYPE_APPOINTMENT;
 	else if (!strcmp (type, IPF_CONTACT))
 		folder_type = MAPI_FOLDER_TYPE_CONTACT;
@@ -62,7 +62,7 @@ container_class_to_type (const char *type)
 }
 
 ExchangeMAPIFolder *
-exchange_mapi_folder_new (const char *folder_name, const char *container_class, ExchangeMAPIFolderCategory category, mapi_id_t folder_id, mapi_id_t parent_folder_id, uint32_t child_count, uint32_t unread_count, uint32_t total)
+exchange_mapi_folder_new (const gchar *folder_name, const gchar *container_class, ExchangeMAPIFolderCategory category, mapi_id_t folder_id, mapi_id_t parent_folder_id, uint32_t child_count, uint32_t unread_count, uint32_t total)
 {
 	ExchangeMAPIFolder *folder;
 
@@ -90,12 +90,12 @@ exchange_mapi_folder_free (ExchangeMAPIFolder *folder)
 }
 
 ExchangeMAPIFolderType
-exchange_mapi_container_class (char *type)
+exchange_mapi_container_class (gchar *type)
 {
 	return container_class_to_type (type);
 }
 
-const gchar*
+const gchar *
 exchange_mapi_folder_get_name (ExchangeMAPIFolder *folder)
 {
 	return folder->folder_name;
@@ -142,7 +142,7 @@ exchange_mapi_peek_folder_list (void)
 {
 	LOCK ();
 	if (!folder_list)
-		exchange_mapi_get_folders_list (&folder_list); 
+		exchange_mapi_get_folders_list (&folder_list);
 	if (!folder_list)
 		g_warning ("Get folders list call failed \n");
 	UNLOCK ();
@@ -157,7 +157,7 @@ exchange_mapi_folder_get_folder (mapi_id_t fid)
 
 	if (!folder_list)
 		exchange_mapi_peek_folder_list ();
-	
+
 	tmp = folder_list;
 	while (tmp) {
 		ExchangeMAPIFolder * folder = tmp->data;
diff --git a/src/libexchangemapi/exchange-mapi-folder.h b/src/libexchangemapi/exchange-mapi-folder.h
index 026ad6f..0867337 100644
--- a/src/libexchangemapi/exchange-mapi-folder.h
+++ b/src/libexchangemapi/exchange-mapi-folder.h
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -73,14 +73,14 @@ typedef struct _ExchangeMAPIFolder {
 } ExchangeMAPIFolder;
 
 ExchangeMAPIFolder *
-exchange_mapi_folder_new (const char *folder_name, const char *container_class, 
-			  ExchangeMAPIFolderCategory catgory, 
-			  mapi_id_t folder_id, mapi_id_t parent_folder_id, 
+exchange_mapi_folder_new (const gchar *folder_name, const gchar *container_class,
+			  ExchangeMAPIFolderCategory catgory,
+			  mapi_id_t folder_id, mapi_id_t parent_folder_id,
 			  uint32_t child_count, uint32_t unread_count, uint32_t total);
 void exchange_mapi_folder_free (ExchangeMAPIFolder *folder);
-ExchangeMAPIFolderType exchange_mapi_container_class (char *type);
+ExchangeMAPIFolderType exchange_mapi_container_class (gchar *type);
 
-const gchar* exchange_mapi_folder_get_name (ExchangeMAPIFolder *folder);
+const gchar * exchange_mapi_folder_get_name (ExchangeMAPIFolder *folder);
 guint64 exchange_mapi_folder_get_fid (ExchangeMAPIFolder *folder);
 guint64 exchange_mapi_folder_get_parent_id (ExchangeMAPIFolder *folder);
 ExchangeMAPIFolderType exchange_mapi_folder_get_type (ExchangeMAPIFolder *folder);
diff --git a/src/libexchangemapi/exchange-mapi-utils.c b/src/libexchangemapi/exchange-mapi-utils.c
index b1bc412..c4e57d9 100644
--- a/src/libexchangemapi/exchange-mapi-utils.c
+++ b/src/libexchangemapi/exchange-mapi-utils.c
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -42,14 +42,14 @@
  * allocated string using g_free()
  */
 gchar *
-utf8tolinux (const char *wstring)
+utf8tolinux (const gchar *wstring)
 {
 	#ifndef HAVE_WINDOWS_TO_UTF8
 	/* newer Openchange (0.10+) doesn't provide windows_to_utf8 function,
 	   it does all the necessary decoding to utf8 transparently */
 	return g_strdup (wstring);
 	#else
-	TALLOC_CTX 	*mem_ctx;
+	TALLOC_CTX	*mem_ctx;
 	gchar		*newstr, *retval = NULL;
 	gint i;
 	gboolean all_ok = TRUE;
@@ -75,7 +75,7 @@ utf8tolinux (const char *wstring)
 
 	newstr = windows_to_utf8(mem_ctx, wstring);
 
-	if (g_utf8_validate (newstr, -1, NULL)) 
+	if (g_utf8_validate (newstr, -1, NULL))
 		retval = g_strdup (newstr);
 	else
 		retval = g_strdup (wstring);
@@ -92,8 +92,8 @@ exchange_mapi_util_mapi_id_to_string (mapi_id_t id)
 	return g_strdup_printf ("%016" G_GINT64_MODIFIER "X", id);
 }
 
-inline gboolean 
-exchange_mapi_util_mapi_id_from_string (const char *str, mapi_id_t *id)
+inline gboolean
+exchange_mapi_util_mapi_id_from_string (const gchar *str, mapi_id_t *id)
 {
 	gint n = 0;
 
@@ -103,7 +103,7 @@ exchange_mapi_util_mapi_id_from_string (const char *str, mapi_id_t *id)
 	return (n == 1);
 }
 
-/* NOTE: We use the UID as a combination of the folder-id and the message-id. 
+/* NOTE: We use the UID as a combination of the folder-id and the message-id.
  * Specifically, it is in this format: ("%016" G_GINT64_MODIFIER "X%016" G_GINT64_MODIFIER "X", fid, mid).
  */
 inline gchar *
@@ -112,8 +112,8 @@ exchange_mapi_util_mapi_ids_to_uid (mapi_id_t fid, mapi_id_t mid)
 	return g_strdup_printf ("%016" G_GINT64_MODIFIER "X%016" G_GINT64_MODIFIER "X", fid, mid);
 }
 
-inline gboolean 
-exchange_mapi_util_mapi_ids_from_uid (const char *str, mapi_id_t *fid, mapi_id_t *mid)
+inline gboolean
+exchange_mapi_util_mapi_ids_from_uid (const gchar *str, mapi_id_t *fid, mapi_id_t *mid)
 {
 	gint n = 0;
 
@@ -124,7 +124,7 @@ exchange_mapi_util_mapi_ids_from_uid (const char *str, mapi_id_t *fid, mapi_id_t
 }
 
 /*
- * Retrieve the property value for a given SPropValue and property tag.  
+ * Retrieve the property value for a given SPropValue and property tag.
  *
  * If the property type is a string: fetch PT_STRING8 then PT_UNICODE
  * in case the desired property is not available in first choice.
@@ -132,11 +132,11 @@ exchange_mapi_util_mapi_ids_from_uid (const char *str, mapi_id_t *fid, mapi_id_t
  * Fetch property normally for any others properties
  */
 /* NOTE: For now, since this function has special significance only for
- * 'string' type properties, callers should (preferably) use it for fetching 
- * such properties alone. If callers are sure that proptag would, for instance, 
+ * 'string' type properties, callers should (preferably) use it for fetching
+ * such properties alone. If callers are sure that proptag would, for instance,
  * return an 'int' or a 'systime', they should prefer get_SPropValue.
  */
-const void *
+gconstpointer
 exchange_mapi_util_find_SPropVal_array_propval (struct SPropValue *values, uint32_t proptag)
 {
 	if (((proptag & 0xFFFF) == PT_STRING8) ||
@@ -154,17 +154,17 @@ exchange_mapi_util_find_SPropVal_array_propval (struct SPropValue *values, uint3
 			return str;
 
 		return NULL;
-	} 
+	}
 
-	/* NOTE: Similar generalizations (if any) for other property types 
-	 * can be made here. 
+	/* NOTE: Similar generalizations (if any) for other property types
+	 * can be made here.
 	 */
 
 	return (get_SPropValue(values, proptag));
 }
 
 /*
- * Retrieve the property value for a given SRow and property tag.  
+ * Retrieve the property value for a given SRow and property tag.
  *
  * If the property type is a string: fetch PT_STRING8 then PT_UNICODE
  * in case the desired property is not available in first choice.
@@ -172,11 +172,11 @@ exchange_mapi_util_find_SPropVal_array_propval (struct SPropValue *values, uint3
  * Fetch property normally for any others properties
  */
 /* NOTE: For now, since this function has special significance only for
- * 'string' type properties, callers should (preferably) use it for fetching 
- * such properties alone. If callers are sure that proptag would, for instance, 
+ * 'string' type properties, callers should (preferably) use it for fetching
+ * such properties alone. If callers are sure that proptag would, for instance,
  * return an 'int' or a 'systime', they should prefer find_SPropValue_data.
  */
-const void *
+gconstpointer
 exchange_mapi_util_find_row_propval (struct SRow *aRow, uint32_t proptag)
 {
 	if (((proptag & 0xFFFF) == PT_STRING8) ||
@@ -194,17 +194,17 @@ exchange_mapi_util_find_row_propval (struct SRow *aRow, uint32_t proptag)
 			return str;
 
 		return NULL;
-	} 
+	}
 
-	/* NOTE: Similar generalizations (if any) for other property types 
-	 * can be made here. 
+	/* NOTE: Similar generalizations (if any) for other property types
+	 * can be made here.
 	 */
 
 	return (find_SPropValue_data(aRow, proptag));
 }
 
 /*
- * Retrieve the property value for a given mapi_SPropValue_array and property tag.  
+ * Retrieve the property value for a given mapi_SPropValue_array and property tag.
  *
  * If the property type is a string: fetch PT_STRING8 then PT_UNICODE
  * in case the desired property is not available in first choice.
@@ -212,11 +212,11 @@ exchange_mapi_util_find_row_propval (struct SRow *aRow, uint32_t proptag)
  * Fetch property normally for any others properties
  */
 /* NOTE: For now, since this function has special significance only for
- * 'string' type properties, callers should (preferably) use it for fetching 
- * such properties alone. If callers are sure that proptag would, for instance, 
+ * 'string' type properties, callers should (preferably) use it for fetching
+ * such properties alone. If callers are sure that proptag would, for instance,
  * return an 'int' or a 'systime', they should prefer find_mapi_SPropValue_data.
  */
-const void *
+gconstpointer
 exchange_mapi_util_find_array_propval (struct mapi_SPropValue_array *properties, uint32_t proptag)
 {
 	if (((proptag & 0xFFFF) == PT_STRING8) ||
@@ -234,10 +234,10 @@ exchange_mapi_util_find_array_propval (struct mapi_SPropValue_array *properties,
 			return str;
 
 		return NULL;
-	} 
+	}
 
-	/* NOTE: Similar generalizations (if any) for other property types 
-	 * can be made here. 
+	/* NOTE: Similar generalizations (if any) for other property types
+	 * can be made here.
 	 */
 
 	return (find_mapi_SPropValue_data(properties, proptag));
@@ -257,19 +257,19 @@ exchange_mapi_util_find_stream (GSList *stream_list, uint32_t proptag)
 	return NULL;
 }
 
-void 
+void
 exchange_mapi_util_free_attachment_list (GSList **attach_list)
 {
 	GSList *l = *attach_list;
 
-	if(!l)
+	if (!l)
 		return;
 
 	for (; l != NULL; l = l->next) {
 		ExchangeMAPIAttachment *attachment = (ExchangeMAPIAttachment *) (l->data);
 		/* FIXME: more stuff here */
 		g_free (attachment->lpProps);
-		exchange_mapi_util_free_stream_list (&(attachment->streams)); 
+		exchange_mapi_util_free_stream_list (&(attachment->streams));
 		g_free (attachment);
 		attachment = NULL;
 	}
@@ -277,12 +277,12 @@ exchange_mapi_util_free_attachment_list (GSList **attach_list)
 	*attach_list = NULL;
 }
 
-void 
+void
 exchange_mapi_util_free_recipient_list (GSList **recip_list)
 {
 	GSList *l = *recip_list;
 
-	if(!l)
+	if (!l)
 		return;
 
 	for (; l != NULL; l = l->next) {
@@ -301,12 +301,12 @@ exchange_mapi_util_free_recipient_list (GSList **recip_list)
 	*recip_list = NULL;
 }
 
-void 
+void
 exchange_mapi_util_free_stream_list (GSList **stream_list)
 {
 	GSList *l = *stream_list;
 
-	if(!l)
+	if (!l)
 		return;
 
 	for (; l != NULL; l = l->next) {
@@ -320,23 +320,22 @@ exchange_mapi_util_free_stream_list (GSList **stream_list)
 	*stream_list = NULL;
 }
 
-
 void
 exchange_mapi_debug_property_dump (struct mapi_SPropValue_array *properties)
 {
 	gint i = 0;
 
-	for (i = 0; i < properties->cValues; i++) { 
+	for (i = 0; i < properties->cValues; i++) {
 		for (i = 0; i < properties->cValues; i++) {
 			struct mapi_SPropValue *lpProp = &properties->lpProps[i];
-			const char *tmp =  get_proptag_name (lpProp->ulPropTag);
-			char t_str[26];
+			const gchar *tmp =  get_proptag_name (lpProp->ulPropTag);
+			gchar t_str[26];
 			gint j = 0;
 			if (tmp && *tmp)
 				g_print("\n%s \t",tmp);
 			else
 				g_print("\n0x%08X \t", lpProp->ulPropTag);
-			switch(lpProp->ulPropTag & 0xFFFF) {
+			switch (lpProp->ulPropTag & 0xFFFF) {
 			case PT_BOOLEAN:
 				g_print(" (bool) - %d", (bool) lpProp->value.b);
 				break;
@@ -350,7 +349,7 @@ exchange_mapi_debug_property_dump (struct mapi_SPropValue_array *properties)
 				g_print (" (double) -  %lf", (double)lpProp->value.dbl);
 				break;
 			case PT_I8:
-				g_print (" (int) - 0x%016" G_GINT64_MODIFIER "X", lpProp->value.d);
+				g_print (" (gint) - 0x%016" G_GINT64_MODIFIER "X", lpProp->value.d);
 				break;
 			case PT_SYSTIME: {
 					struct timeval t;
@@ -378,7 +377,7 @@ exchange_mapi_debug_property_dump (struct mapi_SPropValue_array *properties)
 					g_print("0x%02X ", lpProp->value.bin.lpb[j]);
 				break;
 			case PT_MV_STRING8:
- 				g_print(" (struct mapi_SLPSTRArray *) - %p", &lpProp->value.MVszA);
+				g_print(" (struct mapi_SLPSTRArray *) - %p", &lpProp->value.MVszA);
 				break;
 			default:
 				g_print(" - NONE NULL");
@@ -387,10 +386,9 @@ exchange_mapi_debug_property_dump (struct mapi_SPropValue_array *properties)
 	}
 }
 
+/* Attention: Devs at work;-) */
 
-/* Attention: Devs at work ;-) */
-
-static void 
+static void
 exchange_mapi_util_bin_append_uint16 (TALLOC_CTX *mem_ctx, struct Binary_r *bin, const uint16_t val)
 {
 	uint8_t *ptr = NULL;
@@ -404,7 +402,7 @@ exchange_mapi_util_bin_append_uint16 (TALLOC_CTX *mem_ctx, struct Binary_r *bin,
 	*ptr++ = ((val >>  8) & 0xFF);
 }
 
-static void 
+static void
 exchange_mapi_util_bin_append_uint32 (TALLOC_CTX *mem_ctx, struct Binary_r *bin, const uint32_t val)
 {
 	uint8_t *ptr = NULL;
@@ -420,28 +418,28 @@ exchange_mapi_util_bin_append_uint32 (TALLOC_CTX *mem_ctx, struct Binary_r *bin,
 	*ptr++ = ((val >> 24) & 0xFF);
 }
 
-static void 
-exchange_mapi_util_bin_append_string (TALLOC_CTX *mem_ctx, struct Binary_r *bin, const char *val)
+static void
+exchange_mapi_util_bin_append_string (TALLOC_CTX *mem_ctx, struct Binary_r *bin, const gchar *val)
 {
-	size_t len = strlen (val);
-	char *ptr = NULL;
+	gsize len = strlen (val);
+	gchar *ptr = NULL;
 
 	bin->lpb = talloc_realloc (mem_ctx, bin->lpb, uint8_t, bin->cb + (len + 1));
 	bin->cb += (len + 1);
 
-	ptr = (char *) bin->lpb + bin->cb - (len + 1);
+	ptr = (gchar *) bin->lpb + bin->cb - (len + 1);
 
 	strcpy (ptr, val);
 }
 
-static void 
-exchange_mapi_util_bin_append_unicode (TALLOC_CTX *mem_ctx, struct Binary_r *bin, const char *val)
+static void
+exchange_mapi_util_bin_append_unicode (TALLOC_CTX *mem_ctx, struct Binary_r *bin, const gchar *val)
 {
 	/* WRITE ME */
 }
 
-static void 
-exchange_mapi_util_bin_append_val (TALLOC_CTX *mem_ctx, struct Binary_r *bin, const uint8_t *val, size_t len)
+static void
+exchange_mapi_util_bin_append_val (TALLOC_CTX *mem_ctx, struct Binary_r *bin, const uint8_t *val, gsize len)
 {
 	uint8_t *ptr = NULL;
 
@@ -476,7 +474,7 @@ static const uint8_t MAPI_ONE_OFF_UID[] = {
  * Return value: the recipient ENTRYID
  **/
 struct Binary_r *
-exchange_mapi_util_entryid_generate_oneoff (TALLOC_CTX *mem_ctx, const char *display_name, const char *email, gboolean unicode)
+exchange_mapi_util_entryid_generate_oneoff (TALLOC_CTX *mem_ctx, const gchar *display_name, const gchar *email, gboolean unicode)
 {
 	struct Binary_r *entryid;
 
@@ -519,7 +517,7 @@ static const uint8_t MAPI_LOCAL_UID[] = {
  * Return value: the recipient ENTRYID
  **/
 struct Binary_r *
-exchange_mapi_util_entryid_generate_local (TALLOC_CTX *mem_ctx, const char *exchange_dn)
+exchange_mapi_util_entryid_generate_local (TALLOC_CTX *mem_ctx, const gchar *exchange_dn)
 {
 	struct Binary_r *entryid;
 
@@ -542,12 +540,12 @@ exchange_mapi_util_entryid_generate_local (TALLOC_CTX *mem_ctx, const char *exch
  *
  * Return value: the converted text, which the caller must free.
  **/
-char *
-exchange_lf_to_crlf (const char *in)
+gchar *
+exchange_lf_to_crlf (const gchar *in)
 {
-	int len;
-	const char *s;
-	char *out, *d;
+	gint len;
+	const gchar *s;
+	gchar *out, *d;
 
 	g_return_val_if_fail (in != NULL, NULL);
 
@@ -575,12 +573,12 @@ exchange_lf_to_crlf (const char *in)
  *
  * Return value: the converted text, which the caller must free.
  **/
-char *
-exchange_crlf_to_lf (const char *in)
+gchar *
+exchange_crlf_to_lf (const gchar *in)
 {
-	int len;
-	const char *s;
-	char *out;
+	gint len;
+	const gchar *s;
+	gchar *out;
 	GString *str;
 
 	g_return_val_if_fail (in != NULL, NULL);
diff --git a/src/libexchangemapi/exchange-mapi-utils.h b/src/libexchangemapi/exchange-mapi-utils.h
index 680b825..2885d2a 100644
--- a/src/libexchangemapi/exchange-mapi-utils.h
+++ b/src/libexchangemapi/exchange-mapi-utils.h
@@ -11,7 +11,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -27,33 +27,33 @@
 #include "exchange-mapi-connection.h"
 
 gchar *
-utf8tolinux (const char *wstring);
+utf8tolinux (const gchar *wstring);
 
 gchar *
 exchange_mapi_util_mapi_id_to_string (mapi_id_t id);
-gboolean 
-exchange_mapi_util_mapi_id_from_string (const char *str, mapi_id_t *id);
+gboolean
+exchange_mapi_util_mapi_id_from_string (const gchar *str, mapi_id_t *id);
 
 gchar *
 exchange_mapi_util_mapi_ids_to_uid (mapi_id_t fid, mapi_id_t mid);
-gboolean 
-exchange_mapi_util_mapi_ids_from_uid (const char *str, mapi_id_t *fid, mapi_id_t *mid);
+gboolean
+exchange_mapi_util_mapi_ids_from_uid (const gchar *str, mapi_id_t *fid, mapi_id_t *mid);
 
-const void *
+gconstpointer
 exchange_mapi_util_find_SPropVal_array_propval (struct SPropValue *values, uint32_t proptag);
-const void *
+gconstpointer
 exchange_mapi_util_find_row_propval (struct SRow *aRow, uint32_t proptag);
-const void *
+gconstpointer
 exchange_mapi_util_find_array_propval (struct mapi_SPropValue_array *properties, uint32_t proptag);
 
 ExchangeMAPIStream *
 exchange_mapi_util_find_stream (GSList *stream_list, uint32_t proptag);
 
-void 
+void
 exchange_mapi_util_free_attachment_list (GSList **attach_list);
-void 
+void
 exchange_mapi_util_free_recipient_list (GSList **recip_list);
-void 
+void
 exchange_mapi_util_free_stream_list (GSList **stream_list);
 
 const gchar *
@@ -63,14 +63,14 @@ void
 exchange_mapi_debug_property_dump (struct mapi_SPropValue_array *properties);
 
 struct Binary_r *
-exchange_mapi_util_entryid_generate_oneoff (TALLOC_CTX *mem_ctx, const char *display_name, const char *email, gboolean unicode);
+exchange_mapi_util_entryid_generate_oneoff (TALLOC_CTX *mem_ctx, const gchar *display_name, const gchar *email, gboolean unicode);
 struct Binary_r *
-exchange_mapi_util_entryid_generate_local (TALLOC_CTX *mem_ctx, const char *exchange_dn);
+exchange_mapi_util_entryid_generate_local (TALLOC_CTX *mem_ctx, const gchar *exchange_dn);
 
-char *
-exchange_lf_to_crlf (const char *in);
-char *
-exchange_crlf_to_lf (const char *in);
+gchar *
+exchange_lf_to_crlf (const gchar *in);
+gchar *
+exchange_crlf_to_lf (const gchar *in);
 
 gchar *exchange_mapi_util_profile_name (const gchar *username, const gchar *domain);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]